From 18693ba87fec4df72693aafda19028ce7c5ffc36 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 18 Oct 2018 19:01:11 -0400 Subject: [PATCH 001/691] just for experiments --- .gitignore | 3 +- .npmignore | 5 +- README.md | 2 + index.js | 46 +- index.ts | 11 + lib/block_tracker.js | 66 - lib/blockchain_double.js | 1085 -- lib/database.js | 69 - lib/database/blocklogsserializer.js | 49 - lib/database/blockserializer.js | 36 - lib/database/bufferserializer.js | 12 - lib/database/filedown.js | 66 - lib/database/leveluparrayadapter.js | 108 - lib/database/levelupobjectadapter.js | 93 - lib/database/levelupvalueadapter.js | 44 - lib/database/receiptserializer.js | 34 - lib/database/txserializer.js | 38 - lib/httpServer.js | 78 - lib/provider.js | 248 - lib/server.js | 85 - lib/statemanager.js | 886 -- lib/subproviders/delayedblockfilter.js | 123 - lib/subproviders/geth_api_double.js | 820 -- lib/subproviders/gethdefaults.js | 36 - lib/subproviders/reactiveblocktracker.js | 47 - lib/subproviders/requestfunnel.js | 60 - lib/utils/block_helper.js | 35 - lib/utils/forkedblockchain.js | 601 -- lib/utils/forkedstoragetrie.js | 96 - lib/utils/log.js | 38 - lib/utils/random.js | 29 - lib/utils/receipt.js | 46 - lib/utils/runtimeerror.js | 100 - lib/utils/to.js | 80 - lib/utils/txhelper.js | 68 - lib/utils/txrejectederror.js | 15 - lib/webSocketServer.js | 130 - npm-shrinkwrap.json | 9230 +---------------- package.json | 67 +- perf/transactions.js | 76 - public-exports.js | 16 - src/options/options.ts | 124 + src/options/provider-options.ts | 5 + src/options/server-options.ts | 23 + src/provider.ts | 24 + src/server.ts | 13 + src/servers/http-server.ts | 0 src/servers/ws-server..ts | 0 src/types/account.ts | 11 + src/types/hex-data.ts | 12 + src/types/hex-quantity.ts | 35 + test/DebugContract.sol | 12 - test/EstimateGas.sol | 89 - test/Example.sol | 16 - test/LargeContract.sol | 8 - test/Oracle.sol | 15 - test/Revert.sol | 13 - test/RuntimeError.sol | 22 - test/accounts.js | 220 - test/bad_input.js | 176 - test/block_tags.js | 141 - test/call.js | 71 - test/custom_gas_limit.js | 23 - test/custom_gas_price.js | 32 - test/debug.js | 125 - test/ethereum.js | 20 - test/events.js | 291 - test/forking.js | 630 -- test/forking_deploy_after_fork.js | 135 - test/forkingasprovider.js | 133 - test/gas.js | 423 - test/helpers/contracts.js | 41 - test/hex.js | 136 - test/interface.ts | 11 + test/interval_mining.js | 176 - test/mining.js | 337 - test/options/gasLimit.js | 30 - test/options/gasPrice.js | 79 - test/persistence.js | 167 - test/public-exports.js | 8 - test/requests.js | 1523 --- test/runtime_errors.js | 234 - test/server.js | 17 - test/snapshotting.js | 110 - test/stability.js | 189 - test/swarm.js | 27 - test/time_adjust.js | 142 - test/transaction_ordering.js | 90 - test/transaction_rejection.js | 149 - test/unlimited_contract_size.js | 88 - test/vm.js | 75 - test/whisper.js | 19 - tsconfig.json | 17 + webpack/base.webpack.config.js | 49 - webpack/node/core.webpack.config.js | 17 - webpack/node/provider.webpack.config.js | 17 - webpack/node/server.webpack.config.js | 17 - .../web-experimental/core.webpack.config.js | 17 - .../provider.webpack.config.js | 17 - .../web-experimental/server.webpack.config.js | 17 - .../webbase.webpack.config.js | 12 - 101 files changed, 626 insertions(+), 20821 deletions(-) create mode 100644 index.ts delete mode 100644 lib/block_tracker.js delete mode 100644 lib/blockchain_double.js delete mode 100644 lib/database.js delete mode 100644 lib/database/blocklogsserializer.js delete mode 100644 lib/database/blockserializer.js delete mode 100644 lib/database/bufferserializer.js delete mode 100644 lib/database/filedown.js delete mode 100644 lib/database/leveluparrayadapter.js delete mode 100644 lib/database/levelupobjectadapter.js delete mode 100644 lib/database/levelupvalueadapter.js delete mode 100644 lib/database/receiptserializer.js delete mode 100644 lib/database/txserializer.js delete mode 100644 lib/httpServer.js delete mode 100644 lib/provider.js delete mode 100644 lib/server.js delete mode 100644 lib/statemanager.js delete mode 100644 lib/subproviders/delayedblockfilter.js delete mode 100644 lib/subproviders/geth_api_double.js delete mode 100644 lib/subproviders/gethdefaults.js delete mode 100644 lib/subproviders/reactiveblocktracker.js delete mode 100644 lib/subproviders/requestfunnel.js delete mode 100644 lib/utils/block_helper.js delete mode 100644 lib/utils/forkedblockchain.js delete mode 100644 lib/utils/forkedstoragetrie.js delete mode 100644 lib/utils/log.js delete mode 100644 lib/utils/random.js delete mode 100644 lib/utils/receipt.js delete mode 100644 lib/utils/runtimeerror.js delete mode 100644 lib/utils/to.js delete mode 100644 lib/utils/txhelper.js delete mode 100644 lib/utils/txrejectederror.js delete mode 100644 lib/webSocketServer.js delete mode 100755 perf/transactions.js delete mode 100644 public-exports.js create mode 100644 src/options/options.ts create mode 100644 src/options/provider-options.ts create mode 100644 src/options/server-options.ts create mode 100644 src/provider.ts create mode 100644 src/server.ts create mode 100644 src/servers/http-server.ts create mode 100644 src/servers/ws-server..ts create mode 100644 src/types/account.ts create mode 100644 src/types/hex-data.ts create mode 100644 src/types/hex-quantity.ts delete mode 100644 test/DebugContract.sol delete mode 100644 test/EstimateGas.sol delete mode 100644 test/Example.sol delete mode 100644 test/LargeContract.sol delete mode 100644 test/Oracle.sol delete mode 100644 test/Revert.sol delete mode 100644 test/RuntimeError.sol delete mode 100644 test/accounts.js delete mode 100644 test/bad_input.js delete mode 100644 test/block_tags.js delete mode 100644 test/call.js delete mode 100644 test/custom_gas_limit.js delete mode 100644 test/custom_gas_price.js delete mode 100644 test/debug.js delete mode 100644 test/ethereum.js delete mode 100644 test/events.js delete mode 100644 test/forking.js delete mode 100644 test/forking_deploy_after_fork.js delete mode 100644 test/forkingasprovider.js delete mode 100644 test/gas.js delete mode 100644 test/helpers/contracts.js delete mode 100644 test/hex.js create mode 100644 test/interface.ts delete mode 100644 test/interval_mining.js delete mode 100644 test/mining.js delete mode 100644 test/options/gasLimit.js delete mode 100644 test/options/gasPrice.js delete mode 100644 test/persistence.js delete mode 100644 test/public-exports.js delete mode 100644 test/requests.js delete mode 100644 test/runtime_errors.js delete mode 100644 test/server.js delete mode 100644 test/snapshotting.js delete mode 100644 test/stability.js delete mode 100644 test/swarm.js delete mode 100644 test/time_adjust.js delete mode 100644 test/transaction_ordering.js delete mode 100644 test/transaction_rejection.js delete mode 100644 test/unlimited_contract_size.js delete mode 100644 test/vm.js delete mode 100644 test/whisper.js create mode 100644 tsconfig.json delete mode 100644 webpack/base.webpack.config.js delete mode 100644 webpack/node/core.webpack.config.js delete mode 100644 webpack/node/provider.webpack.config.js delete mode 100644 webpack/node/server.webpack.config.js delete mode 100644 webpack/web-experimental/core.webpack.config.js delete mode 100644 webpack/web-experimental/provider.webpack.config.js delete mode 100644 webpack/web-experimental/server.webpack.config.js delete mode 100644 webpack/web-experimental/webbase.webpack.config.js diff --git a/.gitignore b/.gitignore index 5a759832bd..dacdbceb0b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ TODO .DS_Store .tern-port .vscode -build \ No newline at end of file +build +dist diff --git a/.npmignore b/.npmignore index a8b1202e89..2119bc01d9 100644 --- a/.npmignore +++ b/.npmignore @@ -8,6 +8,7 @@ Dockerfile ISSUE_TEMPLATE.md .vscode/ -test/ +build/ +dist/ webpack/ -perf/ \ No newline at end of file +perf/ diff --git a/README.md b/README.md index e9cfb11029..a64423402f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# JUST FOR EXPERIEMENTS + [![npm](https://img.shields.io/npm/v/ganache-core.svg)]() [![npm](https://img.shields.io/npm/dm/ganache-core.svg)]() [![Build Status](https://travis-ci.org/trufflesuite/ganache-core.svg?branch=master)](https://travis-ci.org/trufflesuite/ganache-core) diff --git a/index.js b/index.js index 4b721c4a2b..77ce1acc4f 100644 --- a/index.js +++ b/index.js @@ -1,35 +1,11 @@ -// make sourcemaps work! -require("source-map-support/register"); - -const debug = require("debug")("ganache"); - -// we use optional dependencies which may, or may not exist, so try native first -try { - // make sure these exist before we try to load ganache with native modules - const optionalDependencies = require("./package.json").optionalDependencies; - const wrongWeb3 = require("web3/package.json").version !== optionalDependencies["web3"]; - const wrongEthereumJs = require("ethereumjs-wallet/package.json").version !== optionalDependencies["ethereumjs-wallet"]; - if (wrongWeb3 || wrongEthereumJs) { - useBundled(); - } else { - module.exports = require("./public-exports.js"); - module.exports._webpacked = false; - debug("Optional dependencies installed; exporting ganache-core with native optional dependencies."); - } -} catch (nativeError) { - debug(nativeError); - - // grabbing the native/optional deps failed, try using our webpacked build. - useBundled(); -} - -function useBundled() { - try { - module.exports = require("./build/ganache.core.node.js"); - module.exports._webpacked = true; - debug("Optional dependencies not installed; exporting ganache-core from `./build` directory."); - } catch(webpackError) { - debug("ganache-core could not be exported; optional dependencies nor webpack build available for export."); - throw webpackError; - } -} \ No newline at end of file +"use strict"; +exports.__esModule = true; +var provider_1 = require("./src/provider"); +var server_1 = require("./src/server"); +// `server` and `provider` are here for backwards compatability +exports["default"] = { + server: function (options) { return new server_1["default"](options); }, + provider: function (options) { return new provider_1["default"](options); }, + Server: server_1["default"], + Provider: provider_1["default"] +}; diff --git a/index.ts b/index.ts new file mode 100644 index 0000000000..78a023026f --- /dev/null +++ b/index.ts @@ -0,0 +1,11 @@ +import Provider from "./src/provider"; +import ProviderOptions from "./src/options/server-options"; +import Server, {ServerOptions} from "./src/server"; + +// `server` and `provider` are here for backwards compatability +export default { + server: (options: ServerOptions) => new Server(options), + provider: (options: ProviderOptions) => new Provider(options), + Server, + Provider +}; diff --git a/lib/block_tracker.js b/lib/block_tracker.js deleted file mode 100644 index edaba0d601..0000000000 --- a/lib/block_tracker.js +++ /dev/null @@ -1,66 +0,0 @@ -// this replaces `eth-block-tracker` in the provider-engine, as that block tracker is meant to work with -// an external provider instance - -const EventEmitter = require('events') -const BlockSerializer = require('./database/blockserializer') -var blockHelper = require('./utils/block_helper'); -const to = require('./utils/to') - -function GanacheBlockTracker(opts) { - opts = opts || {} - EventEmitter.apply(this) - if (!opts.blockchain) throw new Error('RpcBlockTracker - no blockchain specified.') - if (!opts.blockchain.on) throw new Error('RpcBlockTracker - blockchain is not an EventEmitter.') - this._blockchain = opts.blockchain - this.start = this.start.bind(this) - this.stop = this.stop.bind(this) - this.getTrackingBlock = this.getTrackingBlock.bind(this) - this.awaitCurrentBlock = this.awaitCurrentBlock.bind(this) - this._setCurrentBlock = this._setCurrentBlock.bind(this) -} - -GanacheBlockTracker.prototype = Object.create(EventEmitter.prototype) -GanacheBlockTracker.prototype.constructor = GanacheBlockTracker - -GanacheBlockTracker.prototype.getTrackingBlock = function() { - return this._currentBlock -} - -GanacheBlockTracker.prototype.getCurrentBlock = function() { - return this._currentBlock -} - -GanacheBlockTracker.prototype.awaitCurrentBlock = function() { - const self = this - // return if available - if (this._currentBlock) return this._currentBlock - // wait for "sync" event - return new Promise(resolve => this.once('block', resolve)) - .then(() => self._currentBlock) -} - -GanacheBlockTracker.prototype.start = function(opts = {}) { - this._blockchain.on('block', this._setCurrentBlock) - return Promise.resolve() -} - -GanacheBlockTracker.prototype.stop = function() { - this._isRunning = false - this._blockchain.removeListener('block', this._setCurrentBlock) -} - - // - // private - // - -GanacheBlockTracker.prototype._setCurrentBlock = function(newBlock) { - let block = blockHelper.toJSON(newBlock, true) - if (this._currentBlock && (this._currentBlock.hash === block.hash)) return - const oldBlock = this._currentBlock - this._currentBlock = block - this.emit('latest', block) - this.emit('sync', { block, oldBlock }) - this.emit('block', block) -} - -module.exports = GanacheBlockTracker diff --git a/lib/blockchain_double.js b/lib/blockchain_double.js deleted file mode 100644 index 24d2481684..0000000000 --- a/lib/blockchain_double.js +++ /dev/null @@ -1,1085 +0,0 @@ -var to = require("./utils/to.js"); -var Account = require('ethereumjs-account'); -var Block = require('ethereumjs-block'); -var Log = require("./utils/log"); -var Receipt = require("./utils/receipt"); -var VM = require('ethereumjs-vm'); -var RuntimeError = require("./utils/runtimeerror"); -var Trie = require("merkle-patricia-tree"); -var Web3 = require("web3"); -var utils = require("ethereumjs-util"); -var async = require('async'); -var Heap = require("heap"); -var Database = require("./database"); -var EventEmitter = require("events"); -var _ = require('lodash') - -function BlockchainDouble(options) { - var self = this; - EventEmitter.apply(self) - - this.options = options = this._applyDefaultOptions(options || {}); - - this.logger = options.logger || console; - - this.data = new Database(options); - - if (options.trie != null && options.db_path != null) { - throw new Error("Can't initialize a TestRPC with a db and a custom trie."); - } - - this.pending_transactions = []; - - // updated periodically to keep up with the times - this.blockGasLimit = options.gasLimit; - this.defaultTransactionGasLimit = options.defaultTransactionGasLimit; - this.timeAdjustment = 0; -}; - -const defaultOptions = { - gasLimit: "0x6691b7", - defaultTransactionGasLimit: '0x15f90', - time: null, - debug: false, - allowUnlimitedContractSize: false -} - -// inheritence w/ prototype chaining -BlockchainDouble.prototype = Object.create(EventEmitter.prototype); -BlockchainDouble.prototype.constructor = BlockchainDouble; - -BlockchainDouble.prototype._applyDefaultOptions = function(options) { - // We want this function to mutate the options object so that we can report - // our settings back to our consumer application (e.g., ganache) - return _.merge(options, defaultOptions, Object.assign({}, options)); -} - -BlockchainDouble.prototype.initialize = function(accounts, callback) { - var self = this; - - this.data.initialize(function(err) { - if (err) return callback(err); - - self.latestBlock(function(err, block) { - if (err) return callback(err); - - var options = self.options; - - var root = null; - - if (block) { - root = block.header.stateRoot; - } - - // I haven't yet found a good way to do this. Getting the trie from the - // forked blockchain without going through the other setup is a little gross. - self.stateTrie = self.createStateTrie(self.data.trie_db, root); - - self.vm = options.vm || new VM({ - state: self.stateTrie, - blockchain: { - // EthereumJS VM needs a blockchain object in order to get block information. - // When calling getBlock() it will pass a number that's of a Buffer type. - // Unfortunately, it uses a 64-character buffer (when converted to hex) to - // represent block numbers as well as block hashes. Since it's very unlikely - // any block number will get higher than the maximum safe Javascript integer, - // we can convert this buffer to a number ahead of time before calling our - // own getBlock(). If the conversion succeeds, we have a block number. - // If it doesn't, we have a block hash. (Note: Our implementation accepts both.) - getBlock: function(number, done) { - try { - number = to.number(number) - } catch (e) { - // Do nothing; must be a block hash. - } - - self.getBlock(number, done) - } - }, - enableHomestead: true, - activatePrecompiles: true, - allowUnlimitedContractSize: options.allowUnlimitedContractSize - }); - - if (options.debug == true) { - // log executed opcodes, including args as hex - self.vm.on('step', function(info) { - var name = info.opcode.name; - var argsNum = info.opcode.in; - if (argsNum) { - var args = info.stack.slice(-argsNum) - .map((arg) => to.hex(arg)) - .join(' '); - - self.logger.log(`${name} ${args}`); - } else { - self.logger.log(name); - } - }); - } - - if (options.time) { - self.setTime(options.time); - } - - // If we already have a block, then that means there's an existing chain. - // Don't create a genesis block. - if (block) { - self.emit('block', block); - return callback(); - } - - self.createGenesisBlock(function(err, block) { - if (err) return callback(err); - - accounts = accounts || []; - - async.eachSeries(accounts, function(account_data, finished) { - self.putAccount(account_data.account, account_data.address, finished); - }, function(err) { - if (err) return callback(err); - - // Create first block - self.putBlock(block, [], [], callback); - }); - }); - }); - - }); -}; - -BlockchainDouble.prototype.createStateTrie = function(db, root) { - return new Trie(this.data.trie_db, root); -}; - -// Overrideable so other implementations (forking) can edit it. -BlockchainDouble.prototype.createGenesisBlock = function(callback) { - this.createBlock(callback); -}; - -BlockchainDouble.prototype.latestBlock = function(callback) { - this.data.blocks.last(function(err, last) { - if (err) return callback(err); - callback(null, last); - }); -} - -// number accepts number (integer, hex) or tag (e.g., "latest") -BlockchainDouble.prototype.getEffectiveBlockNumber = function(number, callback) { - if (typeof number != "string") { - number = to.hex(number); - } - - // If we have a hex number - if (number.indexOf("0x") >= 0) { - return callback(null, to.number(number)); - } else { - if (number == "latest" || number == "pending") { - return this.getHeight(callback); - } else if (number == "earliest") { - return callback(null, 0); - } - } -}; - -// number accepts number (integer, hex), tag (e.g., "latest") or block hash -// This function is used by ethereumjs-vm -BlockchainDouble.prototype.getBlock = function(number, callback) { - var self = this; - - if (typeof number != "string") { - number = to.hex(number); - } - - // If we have a hex number or a block hash - if (number.indexOf("0x") >= 0) { - var hash = number; - - // block hash - if (hash.length > 40) { - this.data.blockHashes.get(to.hex(hash), function(err, blockIndex) { - if (err) return callback(err); - return self.data.blocks.get(blockIndex, callback); - }); - } else { - // Block number - return this.data.blocks.get(to.number(hash), callback); - } - } else { - if (number == "latest" || number == "pending") { - return this.latestBlock(callback); - } else if (number == "earliest") { - return this.data.blocks.first(callback); - } - } -}; - -BlockchainDouble.prototype.putBlock = function(block, logs, receipts, callback) { - var self = this; - - // Lock in the state root for this block. - block.header.stateRoot = this.stateTrie.root; - - this.data.blocks.length(function(err, length) { - if (err) return callback(err); - - var requests = [ - self.data.blocks.push.bind(self.data.blocks, block), - self.data.blockLogs.push.bind(self.data.blockLogs, logs), - self.data.blockHashes.set.bind(self.data.blockHashes, to.hex(block.hash()), length), - ]; - - block.transactions.forEach(function(tx, index) { - var tx_hash = to.hex(tx.hash()); - - requests.push( - self.data.transactions.set.bind(self.data.transactions, tx_hash, tx), - self.data.transactionReceipts.set.bind(self.data.transactionReceipts, tx_hash, receipts[index]) - ); - }); - - async.parallel(requests, (err, result) => { - if (!err) { - self.emit('block', block); - } - callback(err, result); - }); - }); -}; - -BlockchainDouble.prototype.popBlock = function(callback) { - var self = this; - - this.data.blocks.last(function(err, block) { - if (err) return callback(err); - if (block == null) return callback(null, null); - - var requests = []; - var blockHash = to.hex(block.hash()); - - block.transactions.forEach(function(tx, index) { - var tx_hash = to.hex(tx.hash()); - - requests.push( - self.data.transactions.del.bind(self.data.transactions, tx_hash), - self.data.transactionReceipts.del.bind(self.data.transactionReceipts, tx_hash) - ); - }); - - requests.push( - self.data.blockLogs.pop.bind(self.data.blockLogs), - self.data.blockHashes.del.bind(self.data.blockHashes, blockHash), - self.data.blocks.pop.bind(self.data.blocks) // Do this one last in case anything relies on it. - ); - - async.series(requests, function(err) { - if (err) return callback(err); - - // Set the root to the last available, which will "roll back" to the previous - // moment in time. Note that all the old data is still in the db, but it's now just junk data. - self.data.blocks.last(function(err, newLastBlock) { - if (err) return callback(err); - self.stateTrie.root = newLastBlock.header.stateRoot; - // Remember: Return block we popped off. - callback(null, block); - }); - }); - }); -}; - -BlockchainDouble.prototype.clearPendingTransactions = function() { - this.pending_transactions = []; -}; - -BlockchainDouble.prototype.putAccount = function(account, address, callback) { - var self = this; - - address = utils.toBuffer(address); - - this.vm.stateManager.putAccount(address, account, function(err) { - if (err) return callback(err); - - self.vm.stateManager.cache.flush(callback); - }); -}; - -/** - * createBlock - * - * Create a new block, where the parent's block is either the latest block - * on the chain or the parent block passed in. - * - * @param {Block} parent The block meant to be the parent block (optional) - * @param {Function} callback Callback function called after block is created - * @return Block The block created. - */ -BlockchainDouble.prototype.createBlock = function(parent, callback) { - var self = this; - - if (typeof parent == "function") { - callback = parent; - parent = null; - } - - var block = new Block(); - - function getParent(callback) { - if (parent) { - return callback(null, parent); - } else { - self.latestBlock(callback); - } - }; - - getParent(function(err, parent) { - if (err) return callback(err); - - var parentNumber = parent != null ? to.number(parent.header.number) : -1; - - block.header.gasLimit = self.blockGasLimit; - - // Ensure we have the right block number for the VM. - block.header.number = to.hex(parentNumber + 1); - - // Set the timestamp before processing txs - block.header.timestamp = to.hex(self.currentTime()); - - if (parent != null) { - block.header.parentHash = to.hex(parent.hash()); - } - - callback(null, block); - }); -}; - -BlockchainDouble.prototype.getQueuedNonce = function(address, callback) { - var nonce = null; - - this.pending_transactions.forEach(function(tx) { - //tx.from and address are buffers, so cannot simply do - //tx.from==address - if (to.hex(tx.from) != to.hex(address)) return; - - var pending_nonce = to.number(tx.nonce); - //If this is the first queued nonce for this address we found, - //or it's higher than the previous highest, note it. - if (nonce===null || pending_nonce > nonce) { - nonce = pending_nonce; - } - }); - - //If we found a queued transaction nonce, return one higher - //than the highest we found - if (nonce!=null) return callback(null, nonce+1); - - this.stateTrie.get(address, function(err, val) { - if (err) return callback(err); - - var account = new Account(val); - callback(null, account.nonce); - }); -}; - -BlockchainDouble.prototype.queueTransaction = function(tx) { - this.pending_transactions.push(tx); -}; - -BlockchainDouble.prototype.sortByPriceAndNonce = function() { - // Sorts transactions like I believe geth does. - // See the description of 'SortByPriceAndNonce' at - // https://github.com/ethereum/go-ethereum/blob/290e851f57f5d27a1d5f0f7ad784c836e017c337/core/types/transaction.go - var self = this; - var sortedByNonce = {}; - - self.pending_transactions.forEach((tx) => { - if (!sortedByNonce[to.hex(tx.from)]){ - sortedByNonce[to.hex(tx.from)] = [tx]; - } else { - sortedByNonce[to.hex(tx.from)].push(tx); - } - }); - - var priceSort = function(a,b){ - return parseInt(to.hex(b.gasPrice),16)-parseInt(to.hex(a.gasPrice),16); - } - var nonceSort = function(a,b){ - return parseInt(to.hex(a.nonce),16) - parseInt(to.hex(b.nonce),16) - } - - // Now sort each address by nonce - Object.keys(sortedByNonce).forEach((address) => { - sortedByNonce[address].sort(nonceSort) - }) - - // Initialise a heap, sorted by price, for the head transaction from each account. - var heap = new Heap(priceSort); - Object.keys(sortedByNonce).forEach((address) => { - heap.push(sortedByNonce[address].shift()); - }) - - // Now reorder our transactions. Compare the next transactions from each account, and choose - // the one with the highest gas price. - const sorted_transactions = []; - while (heap.size()>0){ - const best = heap.pop(); - let address = to.hex(best.from) - if (sortedByNonce[address].length>0){ - //Push on the next transaction from this account - heap.push(sortedByNonce[address].shift()); - } - sorted_transactions.push(best); - } - self.pending_transactions = sorted_transactions; -}; - -BlockchainDouble.prototype.processCall = function(tx, blockNumber, callback) { - var self = this; - var startingStateRoot; - - var cleanUpAndReturn = function (err, result, changeRoot) { - self.vm.stateManager.revert(function (e) { - // For defaultBlock, undo state root changes - if (changeRoot){ - self.stateTrie.root = startingStateRoot; - } - callback(err || e, result); - }); - }; - - var runCall = function(tx, changeRoot, err, block){ - if (err) return callback(err); - - // For defaultBlock, use that block's root - if (changeRoot){ - startingStateRoot = self.stateTrie.root; - self.stateTrie.root = block.header.stateRoot; - } - - // create a fake block with this fake transaction - self.createBlock(block, function(err, block) { - block.transactions.push(tx); - - // We checkpoint here for speed. We want all state trie reads/writes to happen in memory, - // and the final output be flushed to the database at the end of transaction processing. - self.vm.stateManager.checkpoint(); - - var runArgs = { - tx: tx, - block: block, - skipBalance: true, - skipNonce: true - }; - - self.vm.runTx(runArgs, function (vmerr, result) { - // This is a check that has been in there for awhile. I'm unsure if it's required, but it can't hurt. - if (vmerr && vmerr instanceof Error == false) { - vmerr = new Error("VM error: " + vmerr); - } - - // If we're given an error back directly, it's worse than a runtime error. Expose it and get out. - if (vmerr) return cleanUpAndReturn(vmerr); - - // If no error, check for a runtime error. This can return null if no runtime error. - vmerr = RuntimeError.fromResults([tx], { results: [result] }); - - cleanUpAndReturn(vmerr, result, changeRoot); - }); - }); - }; - - // Delegate block selection - (blockNumber === 'latest') - ? self.latestBlock(runCall.bind(null, tx, false)) - : self.getBlock(blockNumber, runCall.bind(null, tx, true)); -} - -/** - * processBlock - * - * Process the passed in block and included transactions - * - * @param {Block} block block to process - * @param {Boolean} commit Whether or not changes should be committed to the state trie and the block appended to the end of the chain. - * @param {Function} callback Callback function when transaction processing is completed. - * @return [type] [description] - */ -BlockchainDouble.prototype.processBlock = function(block, commit, callback) { - var self = this; - - if (typeof commit == "function") { - callback = commit; - commit = true; - } - - var currentStateRoot = self.stateTrie.root; - - // We checkpoint here for speed. We want all state trie reads/writes to happen in memory, - // and the final output be flushed to the database at the end of transaction processing. - self.vm.stateManager.checkpoint(); - - var cleanup = function(err) { - self.vm.stateManager.revert(function(e) { - callback(err || e); - }); - }; - - self.vm.runBlock({ - block: block, - generate: true, - }, function(vmerr, results) { - // This is a check that has been in there for awhile. I'm unsure if it's required, but it can't hurt. - if (vmerr && vmerr instanceof Error == false) { - vmerr = new Error("VM error: " + vmerr); - } - - // If we're given an error back directly, it's worse than a runtime error. Expose it and get out. - if (vmerr) return cleanup(vmerr); - - // If no error, check for a runtime error. This can return null if no runtime error. - vmerr = RuntimeError.fromResults(block.transactions, results); - - // Note, even if we have an error, some transactions may still have succeeded. - // Process their logs if so, returning the error at the end. - - var logs = []; - var receipts = []; - - var totalBlockGasUsage = 0; - - results.results.forEach(function(result) { - totalBlockGasUsage += to.number(result.gasUsed); - }); - - block.header.gasUsed = utils.toBuffer(to.hex(totalBlockGasUsage)); - - for (var v = 0; v < results.receipts.length; v++) { - var result = results.results[v]; - var receipt = results.receipts[v]; - var tx = block.transactions[v]; - var tx_hash = tx.hash(); - var tx_logs = []; - - // Only process the transaction's logs if it didn't error. - if (result.vm.exception == 1) { - for (var i = 0; i < receipt.logs.length; i++) { - var log = receipt.logs[i]; - var address = to.hex(log[0]); - var topics = [] - - for (var j = 0; j < log[1].length; j++) { - topics.push(to.hex(log[1][j])); - } - - var data = to.hex(log[2]); - - var log = new Log({ - logIndex: to.rpcQuantityHexString(i), - transactionIndex: to.rpcQuantityHexString(v), - transactionHash: tx_hash, - block: block, - address: address, - data: data, - topics: topics, - type: "mined" - }); - - logs.push(log); - tx_logs.push(log); - } - } - - let rcpt = new Receipt(tx, block, tx_logs, result.gasUsed.toArrayLike(Buffer), receipt.gasUsed, result.createdAddress, receipt.status, to.hex(result.bloom.bitvector)); - receipts.push(rcpt); - } - - function commmitIfNeeded(cb) { - if (commit === true) { - self.vm.stateManager.commit(function(e) { - if (e) return cleanup(e); - - // Put that block on the end the chain - self.putBlock(block, logs, receipts, cb); - }); - } else { - self.vm.stateManager.revert(cb); - } - } - - commmitIfNeeded(function(e) { - if (e) return callback(e); - // Note we return the vm err here too, if it exists. - callback(vmerr, block.transactions, results); - }); - }); -}; - -/** - * processNextBlock - * - * Process the next block like a normal blockchain, pulling from the list of - * pending transactions. - * - * @param {number} timestamp at which the block is mined - * @param {Function} callback Callback when transaction processing is finished. - * @return [type] [description] - */ -BlockchainDouble.prototype.processNextBlock = function(timestamp, callback) { - var self = this; - - if (typeof timestamp === 'function') { - callback = timestamp; - timestamp = undefined; - } - - self.sortByPriceAndNonce(); - - var successfullyAddedTransactions = []; - - // Grab only the transactions that can fit within the block - var currentTransactions = []; - var totalGasLimit = 0; - var maxGasLimit = to.number(self.blockGasLimit); - - while (self.pending_transactions.length > 0) { - var tx = self.pending_transactions[0]; - var gasLimit = to.number(tx.gasLimit); - - if (totalGasLimit + gasLimit <= maxGasLimit) { - totalGasLimit += gasLimit; - self.pending_transactions.shift(); - currentTransactions.push(tx); - } else { - // Next one won't fit. Break. - break; - } - } - - // Remember, we ensured transactions had a valid gas limit when they were queued (in the state manager). - // If we run into a case where we can't process any because one is higher than the gas limit, - // then it's a serious issue. This should never happen, but let's check anyway. - if (currentTransactions.length == 0 && self.pending_transactions.length > 0) { - // Error like geth. - return callback("Unexpected error condition: next transaction exceeds block gas limit") - } - - // Create a new block meant to be the end of the chain - this.createBlock(function(err, block) { - if (err) return callback(err); - - //Overwrite block timestamp - if (timestamp) { - self.data.blocks.last(function(err, last) { - if (last && to.number(last.header.timestamp) > timestamp) { - self.logger.log("Waring: Setting the block timestamp (" + timestamp + ") that is earlier than the parent block one."); - } - }); - block.header.timestamp = to.hex(timestamp); - self.setTime(new Date(timestamp * 1000)); - } - // Add transactions to the block. - Array.prototype.push.apply(block.transactions, currentTransactions); - - // Process the block, committing the block to the chain - self.processBlock(block, true, callback); - }); -}; - -/** - * processTransactionTrace - * - * Run a previously-run transaction in the same state in which it occurred at the time it was run. - * This will return the vm-level trace output for debugging purposes. - * - * Strategy: - * - * 1. Find block where transaction occurred - * 2. Set state root of that block - * 3. Rerun every transaction in that block prior to and including the requested transaction - * 4. Reset state root back to original - * 5. Send trace results back. - * - * @param {[type]} tx [description] - * @param {Function} callback [description] - * @return [type] [description] - */ -BlockchainDouble.prototype.processTransactionTrace = function(hash, params, callback) { - var self = this; - var target_hash = to.hex(hash); - var tx_hash_currently_processing = ""; - var tx_currently_processing = null; - - var storageStack = { - currentDepth: -1, - stack: [] - } - - var returnVal = { - gas: 0, - returnValue: "", - structLogs: [] - }; - - function step_listener(event, next) { - // See these docs: - // https://github.com/ethereum/go-ethereum/wiki/Management-APIs - - var gasLeft = to.number(event.gasLeft); - var totalGasUsedAfterThisStep = to.number(tx_currently_processing.gasLimit) - gasLeft; - var gasUsedThisStep = totalGasUsedAfterThisStep - returnVal.gas; - returnVal.gas += gasUsedThisStep; - - var isMemoryEnabled = !params.disableMemory; - var memory = null; - if (isMemoryEnabled) { - // Get memory and break it up into 32-byte words. - // Note we may possibly have to pad the final word. - memory = (Buffer.from(event.memory)).toString("hex"); - memory = memory.match(/.{1,64}/g) || []; - - if (memory.length > 0) { - var lastItem = memory[memory.length - 1]; - if (lastItem.length < 64) { - memory[memory.length - 1] = lastItem + new Array(64 - lastItem.length + 1).join("0"); - } - } - } - - var stack = params.disableStack ? null : event.stack.map(function(item) { - return to.rpcDataHexString(item, 64).replace('0x',''); // non-0x prefixed. - }); - - var structLog = { - depth: event.depth, - error: "", - gas: gasLeft, - gasCost: gasUsedThisStep, - memory, - op: event.opcode.name, - pc: event.pc, - stack, - storage: null - } - - if (params.disableStorage) { - returnVal.structLogs.push(structLog); - next(); - } else { - structLog = self.processStorageTrace(structLog, storageStack, event, function(err, structLog) { - if (err) return next(err) - returnVal.structLogs.push(structLog); - next() - }); - } - } - - function beforeTx_listener(tx) { - tx_currently_processing = tx; - tx_hash_currently_processing = to.hex(tx.hash()); - - if (tx_hash_currently_processing == target_hash) { - self.vm.on("step", step_listener); - } - } - - // afterTx_listener cleans up everything. - function afterTx_listener() { - if (tx_hash_currently_processing == target_hash) { - self.vm.removeListener("step", step_listener); - self.vm.removeListener("beforeTx", beforeTx_listener); - self.vm.removeListener("afterTx", afterTx_listener); - } - } - - // Listen to beforeTx and afterTx so we know when our target transaction - // is processing. These events will add the vent listener for getting the trace data. - self.vm.on("beforeTx", beforeTx_listener); - self.vm.on("afterTx", afterTx_listener); - - // #1 - get block via transaction receipt - this.getTransactionReceipt(target_hash, function(err, receipt) { - if (err) return callback(err); - - if (!receipt) { - return callback(new Error("Unknown transaction " + target_hash)); - } - - var targetBlock = receipt.block; - - // Get the parent of the target block - self.getBlock(targetBlock.header.parentHash, function(err, parent) { - if (err) return callback(err); - - var startingStateRoot = self.stateTrie.root; - - // #2 - Set state root of original block - self.stateTrie.root = parent.header.stateRoot; - - // Prepare the "next" block with necessary transactions - self.createBlock(parent, function(err, block) { - if (err) return callback(err); - - for (var i = 0; i < targetBlock.transactions.length; i++) { - var tx = targetBlock.transactions[i]; - block.transactions.push(tx) - - // After including the target transaction, that's all we need to do. - if (to.hex(tx.hash()) == target_hash) { - break; - } - } - - // #3 - Process the block without committing the data. - self.processBlock(block, false, function(err, transactions, results) { - // Ignore runtime errors, or else erroneous transactions can't be traced. - if (err && err.message.indexOf("VM Exception") == 0) { - err = null; - } - - // #4 - reset the state root. - self.stateTrie.root = startingStateRoot; - - // Just to be safe - self.vm.removeListener("beforeTx", beforeTx_listener); - self.vm.removeListener("afterTx", afterTx_listener); - self.vm.removeListener("step", step_listener); - - // #5 - send state results back - callback(err, returnVal); - }); - }); - }); - }); -}; - -BlockchainDouble.prototype.processStorageTrace = function(structLog, storageStack, event, callback) { - var self = this; - var name = event.opcode.name; - - var argsNum = event.opcode.in; - var args = event.stack.slice(-argsNum) - .map((arg) => to.hex(arg)); - - if (storageStack.currentDepth > event.depth) { - storageStack.stack.pop() - } if (storageStack.currentDepth < event.depth) { - storageStack.stack.push({}) - } - - storageStack.currentDepth = event.depth; - - var key; - var value; - switch(name) { - case 'SSTORE': - key = to.rpcDataHexString(args[1], 64).replace('0x','') - value = to.rpcDataHexString(args[0], 64).replace('0x','') - // use Object.assign to prevent future steps from overwriting this step's storage values - structLog.storage = Object.assign({}, storageStack.stack[storageStack.currentDepth]) - - callback(null, structLog) - // assign after callback because this storage change actually takes - // effect _after_ this opcode executes - storageStack.stack[storageStack.currentDepth][key] = value; - break; - case 'SLOAD': - // this one's more fun, we need to get the value the contract is loading from current storage - key = to.rpcDataHexString(args[0], 64).replace('0x','') - - self.vm.stateManager.getContractStorage(event.address, '0x' + key, function(err, result) { - if (err) return callback(err); - - value = to.rpcDataHexString(result, 64).replace('0x','') - storageStack.stack[storageStack.currentDepth][key] = value; - // use Object.assign to prevent future steps from overwriting this step's storage values - structLog.storage = Object.assign({}, storageStack.stack[storageStack.currentDepth]) - callback(null, structLog) - }) - break; - default: - // use Object.assign to prevent future steps from overwriting this step's storage values - structLog.storage = Object.assign({}, storageStack.stack[storageStack.currentDepth]) - callback(null, structLog) - } -}; - -BlockchainDouble.prototype.getAccount = function(address, number, callback) { - var self = this; - - this.getBlock(number, function(err, block) { - if (err) return callback(err); - - var trie = self.stateTrie; - - // Manipulate the state root in place to maintain checkpoints - var currentStateRoot = trie.root; - self.stateTrie.root = block.header.stateRoot; - - trie.get(utils.toBuffer(address), function(err, data) { - // Finally, put the stateRoot back for good - trie.root = currentStateRoot; - - if (err) return callback(err); - - var account = new Account(data); - - account.exists = !!data; - - callback(null, account); - }); - }); -}; - -BlockchainDouble.prototype.getNonce = function(address, number, callback) { - this.getAccount(address, number, function(err, account) { - if (err) return callback(err); - callback(null, account.nonce); - }); -}; - -BlockchainDouble.prototype.getBalance = function(address, number, callback) { - this.getAccount(address, number, function(err, account) { - if (err) return callback(err); - - callback(null, account.balance); - }); -}; - -// Note! Storage values are returned RLP encoded! -BlockchainDouble.prototype.getStorage = function(address, position, number, callback) { - var self = this; - - this.getBlock(number, function(err, block) { - if (err) return callback(err); - - var trie = self.stateTrie; - - // Manipulate the state root in place to maintain checkpoints - var currentStateRoot = trie.root; - self.stateTrie.root = block.header.stateRoot; - - trie.get(utils.toBuffer(address), function(err, data) { - if (err != null) { - // Put the stateRoot back if there's an error - trie.root = currentStateRoot; - return callback(err); - } - - var account = new Account(data); - - trie.root = account.stateRoot; - - trie.get(utils.setLengthLeft(utils.toBuffer(position), 32), function(err, value) { - // Finally, put the stateRoot back for good - trie.root = currentStateRoot; - - if (err != null) { - return callback(err); - } - - callback(null, value); - }); - - }); - }); -} - -BlockchainDouble.prototype.getCode = function(address, number, callback) { - var self = this; - - this.getBlock(number, function(err, block) { - if (err) return callback(err); - - var trie = self.stateTrie; - - // Manipulate the state root in place to maintain checkpoints - var currentStateRoot = trie.root; - self.stateTrie.root = block.header.stateRoot; - - trie.get(utils.toBuffer(address), function(err, data) { - if (err != null) { - // Put the stateRoot back if there's an error - trie.root = currentStateRoot; - return callback(err); - } - - var account = new Account(data); - - account.getCode(trie, function(err, code) { - // Finally, put the stateRoot back for good - trie.root = currentStateRoot; - - if (err) return callback(err); - - callback(null, code); - }); - }); - }); -}; - -BlockchainDouble.prototype.getTransaction = function(hash, callback) { - hash = to.hex(hash); - - this.data.transactions.get(hash, function(err, tx) { - if (err) { - if (err.notFound) { - return callback(null, null); - } else { - return callback(err); - } - } - callback(null, tx); - }); -}; - -BlockchainDouble.prototype.getTransactionReceipt = function(hash, callback) { - hash = to.hex(hash); - - this.data.transactionReceipts.get(hash, function(err, receipt) { - if (err) { - if (err.notFound) { - return callback(null, null); - } else { - return callback(err); - } - } - - callback(err, receipt); - }); -}; - -BlockchainDouble.prototype.getBlockLogs = function(number, callback) { - var self = this; - this.getEffectiveBlockNumber(number, function(err, effective) { - if (err) return callback(err); - self.data.blockLogs.get(effective, callback); - }); -}; - -BlockchainDouble.prototype.getHeight = function(callback) { - this.data.blocks.length(function(err, length) { - if (err) return callback(err); - callback(null, length - 1); - }) -}; - -BlockchainDouble.prototype.currentTime = function() { - return (new Date().getTime() / 1000 | 0) + this.timeAdjustment; -}; - -BlockchainDouble.prototype.increaseTime = function(seconds) { - if (seconds < 0) seconds = 0; - this.timeAdjustment += seconds; - return this.timeAdjustment; -}; - -BlockchainDouble.prototype.setTime = function(date) { - var now = new Date().getTime() / 1000 | 0; - var start = date.getTime() / 1000 | 0; - this.timeAdjustment = start - now; -}; - -BlockchainDouble.prototype.close = function(callback) { - this.data.close(callback); -}; - -module.exports = BlockchainDouble; diff --git a/lib/database.js b/lib/database.js deleted file mode 100644 index ba2472c5f3..0000000000 --- a/lib/database.js +++ /dev/null @@ -1,69 +0,0 @@ -var LevelUpArrayAdapter = require("./database/leveluparrayadapter"); -var LevelUpObjectAdapter = require("./database/levelupobjectadapter"); -var levelup = require('levelup'); -var encode = require('encoding-down') -var filedown = require("./database/filedown"); -var cachedown = require("cachedown"); -var Sublevel = require("level-sublevel"); -var Block = require("ethereumjs-block"); -var txserializer = require("./database/txserializer"); -var blockserializer = require("./database/blockserializer"); -var bufferserializer = require("./database/bufferserializer"); -var BlockLogsSerializer = require("./database/blocklogsserializer"); -var ReceiptSerializer = require("./database/receiptserializer"); -var to = require("./utils/to"); -var utils = require("ethereumjs-util"); -var FakeTransaction = require('ethereumjs-tx/fake.js'); -var tmp = require("tmp"); - -function Database(options) { - this.options = options; -}; - -Database.prototype.initialize = function(callback) { - var self = this; - - function getDir(cb) { - if (self.options.db_path) { - cb(null, self.options.db_path); - } else { - tmp.dir(cb); - } - } - - getDir(function(err, directory) { - if (err) return callback(err); - levelup(self.options.db || encode(cachedown(directory, filedown).maxSize(100)), {valueEncoding: "json"}, finishInitializing); - }); - - function finishInitializing(err, db) { - if (err) return callback(err); - - self.db = db; - - // Blocks, keyed by array index (not necessarily by block number) (0-based) - self.blocks = new LevelUpArrayAdapter("blocks", self.db, blockserializer); - - // Logs triggered in each block, keyed by block id (ids in the blocks array; not necessarily block number) (0-based) - self.blockLogs = new LevelUpArrayAdapter("blockLogs", self.db, new BlockLogsSerializer(self)); - - // Block hashes -> block ids (ids in the blocks array; not necessarily block number) for quick lookup - self.blockHashes = new LevelUpObjectAdapter("blockHashes", self.db); - - // Transaction hash -> transaction objects - self.transactions = new LevelUpObjectAdapter("transactions", self.db, txserializer); - - // Transaction hash -> transaction receipts - self.transactionReceipts = new LevelUpObjectAdapter("transactionReceipts", self.db, new ReceiptSerializer(self)); - - self.trie_db = new LevelUpObjectAdapter("trie_db", self.db, bufferserializer, bufferserializer); - - callback(); - }; -}; - -Database.prototype.close = function(callback) { - callback(); -}; - -module.exports = Database; diff --git a/lib/database/blocklogsserializer.js b/lib/database/blocklogsserializer.js deleted file mode 100644 index 16d58e1d68..0000000000 --- a/lib/database/blocklogsserializer.js +++ /dev/null @@ -1,49 +0,0 @@ -var to = require("../utils/to"); -var Log = require("../utils/log"); -var async = require("async"); - -function BlockLogsSerializer(database) { - this.database = database; -}; - -BlockLogsSerializer.prototype.encode = function(logs, done) { - logs = logs.map(function(log) { - return log.toJSON(); - }); - - done(null, logs); -}; - -BlockLogsSerializer.prototype.decode = function(json, done) { - var self = this; - - if (json.length == 0) { - return done(null, []); - } - - this.database.blockHashes.get(json[0].blockHash, function(err, blockIndex) { - if (err) return done(err); - - self.database.blocks.get(blockIndex, function(err, block) { - if (err) return done(err); - - async.map(json, function(log, finished) { - finished(null, new Log({ - block: block, - logIndex: log.logIndex, - transactionIndex: log.transactionIndex, - transactionHash: log.transactionHash, - address: log.address, - data: log.data, - topics: log.topics, - type: log.type - })); - }, function(err, logs) { - if (err) return done(err); - done(null, logs) - }); - }); - }); -}; - -module.exports = BlockLogsSerializer; diff --git a/lib/database/blockserializer.js b/lib/database/blockserializer.js deleted file mode 100644 index 3a67643538..0000000000 --- a/lib/database/blockserializer.js +++ /dev/null @@ -1,36 +0,0 @@ -var to = require("../utils/to"); -var txserializer = require("./txserializer"); -var async = require("async"); -var Block = require("ethereumjs-block"); - -module.exports = { - encode: function(block, done) { - var encoded = block.toJSON(true); - - async.map(block.transactions, function(tx, finished) { - txserializer.encode(tx, finished); - }, function(err, transactions) { - if (err) return done(err); - encoded.transactions = transactions; - done(null, encoded); - }); - }, - decode: function(json, done) { - var transactions = json.transactions; - json.transactions = []; - - var block = new Block(json); - - async.eachSeries(transactions, function(tx_json, finished) { - txserializer.decode(tx_json, function(err, tx) { - if (err) return finished(err); - block.transactions.push(tx); - finished(); - }); - }, function(err) { - if (err) return done(err); - - done(null, block); - }); - } -} diff --git a/lib/database/bufferserializer.js b/lib/database/bufferserializer.js deleted file mode 100644 index 95e703d48f..0000000000 --- a/lib/database/bufferserializer.js +++ /dev/null @@ -1,12 +0,0 @@ -var utils = require("ethereumjs-util"); -var to = require("../utils/to"); - -module.exports = { - encode: function(val, cb) { - var hex = to.hex(val); - cb(null, hex); - }, - decode: function(json, cb) { - cb(null, utils.toBuffer(json)) - } -}; diff --git a/lib/database/filedown.js b/lib/database/filedown.js deleted file mode 100644 index 0c262ed461..0000000000 --- a/lib/database/filedown.js +++ /dev/null @@ -1,66 +0,0 @@ -var util = require('util'); -var AbstractLevelDOWN = require('abstract-leveldown').AbstractLevelDOWN; -var async = require("async"); -var fs = require("fs"); -var path = require("path"); - -util.inherits(FileDown, AbstractLevelDOWN) - -function FileDown (location) { - this.location = location; - AbstractLevelDOWN.call(this, location) -} - -FileDown.prototype._open = function (options, callback) { - var self = this; - callback(null, self); -} - -FileDown.prototype._put = function (key, value, options, callback) { - var self = this; - fs.writeFile(path.join(this.location, key), value, "utf8", callback); -} - -FileDown.prototype._get = function (key, options, callback) { - fs.readFile(path.join(this.location, key), "utf8", function(err, data) { - if (err) { - return callback(new Error("NotFound")); - } - callback(null, data); - }); -} - -FileDown.prototype._del = function (key, options, callback) { - fs.unlink(path.join(this.location, key), function(err) { - // Ignore when we try to delete a file that doesn't exist. - // I'm not sure why this happens. Worth looking into. - if (err) { - if (err.message.indexOf("ENOENT") >= 0) { - return callback(); - } else { - return callback(err); - } - } - callback(); - }); -} - -FileDown.prototype._batch = function(array, options, callback) { - var self = this; - async.each(array, function(item, finished) { - if (item.type == "put") { - self.put(item.key, item.value, options, finished); - } else if (item.type == "del") { - self.del(item.key, options, finished); - } else { - finished(new Error("Unknown batch type", item.type)); - } - }, function(err) { - if (err) return callback(err); - callback(); - }); -} - -module.exports = function(location) { - return new FileDown(location); -}; diff --git a/lib/database/leveluparrayadapter.js b/lib/database/leveluparrayadapter.js deleted file mode 100644 index a8781e5279..0000000000 --- a/lib/database/leveluparrayadapter.js +++ /dev/null @@ -1,108 +0,0 @@ -var Sublevel = require("level-sublevel"); - -// Level up adapter that looks like an array. Doesn't support inserts. - -function LevelUpArrayAdapter(name, db, serializer) { - this.db = Sublevel(db); - this.db = this.db.sublevel(name); - this.name = name; - this.serializer = serializer || { - encode: function(val, callback) { callback(null, val); }, - decode: function(val, callback) { callback(null, val); } - }; -}; - -LevelUpArrayAdapter.prototype.length = function(callback) { - this.db.get("length", function(err, result) { - if (err) { - if (err.notFound) { - return callback(null, 0); - } else { - return callback(err); - } - } - - callback(null, result); - }); -}; - -LevelUpArrayAdapter.prototype._get = function(key, callback) { - var self = this; - this.db.get(key, function(err, val) { - if (err) return callback(err); - self.serializer.decode(val, callback); - }); -}; - -LevelUpArrayAdapter.prototype._put = function(key, value, callback) { - var self = this; - this.serializer.encode(value, function(err, encoded) { - if (err) return callback(err); - self.db.put(key, encoded, callback); - }); -}; - -LevelUpArrayAdapter.prototype.get = function(index, callback) { - var self = this; - - this.length(function(err, length) { - if (err) return callback(err); - if (index >= length) { - return callback(new Error("LevelUpArrayAdapter named '" + self.name + "' index out of range: index " + index + "; length: " + length)); - } - self._get(index, callback); - }); -}; - -LevelUpArrayAdapter.prototype.push = function(val, callback) { - var self = this; - this.length(function(err, length) { - if (err) return callback(err); - - // TODO: Do this in atomic batch. - self._put(length + "", val, function(err) { - if (err) return callback(err); - self.db.put("length", length + 1, callback); - }); - }); -}; - -LevelUpArrayAdapter.prototype.pop = function(callback) { - var self = this; - - this.length(function(err, length) { - if (err) return callback(err); - - var newLength = length - 1; - - // TODO: Do this in atomic batch. - self._get(newLength + "", function(err, val) { - if (err) return callback(err); - self.db.del(newLength + "", function(err) { - if (err) return callback(err); - self.db.put("length", newLength, function(err) { - if (err) return callback(err); - - callback(null, val); - }); - }); - }); - }); -}; - -LevelUpArrayAdapter.prototype.last = function(callback) { - var self = this; - this.length(function(err, length) { - if (err) return callback(err); - - if (length == 0) return callback(null, null); - - self._get((length - 1) + "", callback); - }); -}; - -LevelUpArrayAdapter.prototype.first = function(callback) { - this._get("0", callback); -}; - -module.exports = LevelUpArrayAdapter; diff --git a/lib/database/levelupobjectadapter.js b/lib/database/levelupobjectadapter.js deleted file mode 100644 index 8175170674..0000000000 --- a/lib/database/levelupobjectadapter.js +++ /dev/null @@ -1,93 +0,0 @@ -var Sublevel = require("level-sublevel"); -var async = require("async"); - -function LevelUpObjectAdapter(name, db, valueserializer, keyserializer, options) { - this.db = Sublevel(db, options); - this.db = this.db.sublevel(name); - this.name = name; - this.valueserializer = valueserializer || { - encode: function(val, callback) { callback(null, val); }, - decode: function(val, callback) { callback(null, val); } - }; - this.keyserializer = keyserializer || { - encode: function(val, callback) { callback(null, val); }, - decode: function(val, callback) { callback(null, val); } - }; -}; - -LevelUpObjectAdapter.prototype.get = function(key, options, callback) { - var self = this; - - if (typeof options == "function") { - callback = options; - options = {}; - } - - this.keyserializer.encode(key, function(err, encodedKey) { - if (err) return callback(err); - - self.db.get(encodedKey, function(err, val) { - if (err) return callback(err); - - self.valueserializer.decode(val, function(err, decodedValue) { - if (err) return callback(err); - - callback(null, decodedValue); - }); - }); - }); -}; - -LevelUpObjectAdapter.prototype.put = function(key, value, options, callback) { - var self = this; - - if (typeof options == "function") { - callback = options; - options = {}; - } - - this.keyserializer.encode(key, function(err, encodedKey) { - if (err) return callback(err); - - self.valueserializer.encode(value, function(err, encoded) { - if (err) return callback(err); - - self.db.put(encodedKey, encoded, callback); - }); - }); -}; - -LevelUpObjectAdapter.prototype.set = LevelUpObjectAdapter.prototype.put; - -LevelUpObjectAdapter.prototype.del = function(key, callback) { - var self = this; - - this.keyserializer.encode(key, function(err, encodedKey) { - if (err) return callback(err); - - self.db.del(encodedKey, callback); - }); -} - -LevelUpObjectAdapter.prototype.batch = function(array, options, callback) { - var self = this; - - async.each(array, function(item, finished) { - if (item.type == "put") { - self.put(item.key, item.value, options, finished); - } else if (item.type == "del") { - self.del(item.key, finished); - } else { - finished(new Error("Unknown batch type", item.type)); - } - }, function(err) { - if (err) return callback(err); - callback(); - }); -}; - -LevelUpObjectAdapter.prototype.isOpen = function() { - return true; -} - -module.exports = LevelUpObjectAdapter; diff --git a/lib/database/levelupvalueadapter.js b/lib/database/levelupvalueadapter.js deleted file mode 100644 index 6c59012d76..0000000000 --- a/lib/database/levelupvalueadapter.js +++ /dev/null @@ -1,44 +0,0 @@ -// Warning: Wrote this because I wanted it, then didn't need it. -// May come in handy later. You've been warned. This might be bad/dead code. -var Sublevel = require("level-sublevel"); - -function LevelUpValueAdapter(name, db, serializer) { - this.db = Sublevel(db); - this.db = this.db.sublevel(name); - this.name = name; - this.serializer = serializer || { - encode: function(val, callback) { callback(null, val); }, - decode: function(val, callback) { callback(null, val); } - }; - this.value_key = "value"; -}; - -LevelUpValueAdapter.prototype.get = function(callback) { - var self = this; - - this.db.get(this.value_key, function(err, val) { - if (err) { - if (err.notFound) { - return callback(null, null); - } else { - return callback(err); - } - } - - self.serializer.decode(val, callback); - }); -}; - -LevelUpValueAdapter.prototype.set = function(value, callback) { - var self = this; - this.serializer.encode(value, function(err, encoded) { - if (err) return callback(err); - self.db.put(self.value_key, encoded, callback); - }); -}; - -LevelUpValueAdapter.prototype.del = function(callback) { - this.db.del(this.value_key, callback); -} - -module.exports = LevelUpValueAdapter; diff --git a/lib/database/receiptserializer.js b/lib/database/receiptserializer.js deleted file mode 100644 index 78e43c4199..0000000000 --- a/lib/database/receiptserializer.js +++ /dev/null @@ -1,34 +0,0 @@ -var to = require("../utils/to"); -var Receipt = require("../utils/receipt"); -var async = require("async"); - -function ReceiptSerializer(database) { - this.database = database; -}; - -ReceiptSerializer.prototype.encode = function(receipt, done) { - done(null, receipt.toJSON()); -}; - -ReceiptSerializer.prototype.decode = function(json, done) { - var self = this; - - this.database.transactions.get(json.transactionHash, function(err, tx) { - if (err) return done(err); - - self.database.blockHashes.get(json.blockHash, function(err, blockIndex) { - if (err) return done(err); - - async.parallel({ - block: self.database.blocks.get.bind(self.database.blocks, blockIndex), - logs: self.database.blockLogs.get.bind(self.database.blockLogs, blockIndex) - }, function(err, result) { - if (err) return done(err); - - done(null, new Receipt(tx, result.block, result.logs, json.gasUsed, json.cumulativeGasUsed, json.contractAddress, json.status, json.logsBloom)); - }); - }); - }); -}; - -module.exports = ReceiptSerializer; diff --git a/lib/database/txserializer.js b/lib/database/txserializer.js deleted file mode 100644 index ec49d7f14c..0000000000 --- a/lib/database/txserializer.js +++ /dev/null @@ -1,38 +0,0 @@ -var to = require("../utils/to"); -var utils = require("ethereumjs-util"); -var FakeTransaction = require("ethereumjs-tx/fake.js") - -module.exports = { - encode: function(tx, done) { - var encoded = tx.toJSON(true); - - encoded.from = to.hex(tx.from); - encoded.hash = to.hex(tx.hash()); - - done(null, encoded); - }, - decode: function(json, done) { - // TODO: We can't use txhelper here because there are two - // JSON serialization types: ethereumjs-tx, and web3. - // Here we deserialize from ethereumjs-tx because it's - // closer to the metal, so to speak. - var tx = new FakeTransaction({ - nonce: utils.toBuffer(json.nonce), - value: utils.toBuffer(json.value), - to: utils.toBuffer(json.to), - from: utils.toBuffer(json.from), - gasLimit: utils.toBuffer(json.gasLimit), - gasPrice: utils.toBuffer(json.gasPrice), - data: utils.toBuffer(json.data), - v: utils.toBuffer(json.v), - r: utils.toBuffer(json.r), - s: utils.toBuffer(json.s) - }); - - // if (to.hex(tx.hash()) != json.hash) { - // return done(new Error("DB consistency check: Decoded transaction hash didn't match encoded hash. Expected: " + json.hash + "; actual: " + to.hex(tx.hash()))); - // } - - done(null, tx); - } -} diff --git a/lib/httpServer.js b/lib/httpServer.js deleted file mode 100644 index 78e79f49e3..0000000000 --- a/lib/httpServer.js +++ /dev/null @@ -1,78 +0,0 @@ -var http = require("http"); - -module.exports = function (provider, logger) { - var server = http.createServer(function (request, response) { - - var headers = request.headers; - var method = request.method; - var url = request.url; - var body = []; - - request.on('error', function (err) { - // console.error(err); - }).on('data', function (chunk) { - body.push(chunk); - }).on('end', function () { - body = Buffer.concat(body).toString(); - // At this point, we have the headers, method, url and body, and can now - // do whatever we need to in order to respond to this request. - - var headers = { - "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept, User-Agent", - "Access-Control-Allow-Origin": "*", - "Access-Control-Allow-Methods": "*" - }; - - switch (method) { - case "OPTIONS": - headers[ "Content-Type" ] = "text/plain" - response.writeHead(200, headers); - response.end(""); - break; - case "POST": - //console.log("Request coming in:", body); - - var payload; - try { - payload = JSON.parse(body); - } catch (e) { - headers[ "Content-Type" ] = "text/plain"; - response.writeHead(400, headers); - response.end("400 Bad Request"); - return; - } - - // Log messages that come into the TestRPC via http - if (payload instanceof Array) { - // Batch request - for (var i = 0; i < payload.length; i++) { - var item = payload[ i ]; - logger.log(item.method); - } - } else { - logger.log(payload.method); - } - - provider.send(payload, function (err, result) { - headers[ "Content-Type" ] = "application/json"; - response.writeHead(200, headers); - response.end(JSON.stringify(result)); - }); - - break; - default: - response.writeHead(400, { - "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept, User-Agent", - "Access-Control-Allow-Origin": "*", - "Access-Control-Allow-Methods": "*", - "Content-Type": "text/plain" - }); - response.end("400 Bad Request"); - break; - } - }); - }); - - server.ganacheProvider = provider; - return server; -}; diff --git a/lib/provider.js b/lib/provider.js deleted file mode 100644 index 9780d10ad6..0000000000 --- a/lib/provider.js +++ /dev/null @@ -1,248 +0,0 @@ -// make sourcemaps work! -require('source-map-support/register') - -let ProviderEngine = require("web3-provider-engine"); -let SubscriptionSubprovider = require('web3-provider-engine/subproviders/subscriptions'); - -let RequestFunnel = require('./subproviders/requestfunnel'); -let DelayedBlockFilter = require("./subproviders/delayedblockfilter"); -let GethDefaults = require("./subproviders/gethdefaults"); -let GethApiDouble = require('./subproviders/geth_api_double'); - -let BlockTracker = require('./block_tracker'); - -let RuntimeError = require("./utils/runtimeerror"); -let EventEmitter = require('events'); - -let _ = require('lodash') - -function Provider(options) { - const self = this; - EventEmitter.call(this); - - this.options = options = self._applyDefaultOptions(options || {}) - - let gethApiDouble = new GethApiDouble(options, this); - - this.engine = new ProviderEngine({ - blockTracker: new BlockTracker({ blockchain: gethApiDouble.state.blockchain }) - }); - - let subscriptionSubprovider = new SubscriptionSubprovider(); - - this.engine.manager = gethApiDouble; - this.engine.addProvider(new RequestFunnel()); - this.engine.addProvider(new DelayedBlockFilter()); - this.engine.addProvider(subscriptionSubprovider); - this.engine.addProvider(new GethDefaults()); - this.engine.addProvider(gethApiDouble); - - this.engine.setMaxListeners(100); - this.engine.start(); - - this.manager = gethApiDouble; - this.sendAsync = this.send.bind(this); - this.send = this.send.bind(this); - this.close = this.close.bind(this); - this._queueRequest = this._queueRequest.bind(this); - this._processRequestQueue = this._processRequestQueue.bind(this); - - subscriptionSubprovider.on('data', function(err, notification) { - self.emit('data', err, notification); - }); -}; - -const defaultOptions = { - vmErrorsOnRPCResponse: true, - verbose: false, - asyncRequestProcessing: false, - logger: { - log: function() {} - } -} - -Provider.prototype = Object.create(EventEmitter.prototype); -Provider.prototype.constructor = Provider; - -Provider.prototype._applyDefaultOptions = function(options) { - return _.merge({}, defaultOptions, options) -} - -Provider.prototype.send = function(payload, callback) { - if (typeof callback != 'function') { - throw new Error("No callback provided to provider's send function. As of web3 1.0, provider.send is no longer synchronous and must be passed a callback as its final argument."); - } - - let self = this; - - let externalize = function(payload) { - return _.cloneDeep(payload) - }; - - if (Array.isArray(payload)) { - payload = payload.map(externalize) - } else { - payload = externalize(payload); - } - - let intermediary = function(err, result) { - // clone result so that we can mutate the response without worrying about - // that messing up assumptions the calling logic might have about us - // mutating things - result = _.cloneDeep(result) - let response; - if (Array.isArray(result)) { - response = [] - for (let i = 0; i < result.length; i++) { - response.push(self.reportErrorInResponse(payload[i], err, result[i])) - } - } else { - response = self.reportErrorInResponse(payload, err, result); - } - - if (self.options.verbose) { - self.options.logger.log(" < " + JSON.stringify(response, null, 2).split("\n").join("\n < ")); - } - callback(response.error ? err : null, response); - }; - - if (self.options.verbose) { - self.options.logger.log(" > " + JSON.stringify(payload, null, 2).split("\n").join("\n > ")); - } - - if (self.options.asyncRequestProcessing) { - self.engine.sendAsync(payload, intermediary); - } else { - self._queueRequest(payload, intermediary); - } -}; - -Provider.prototype.close = function(callback) { - // This is a little gross reaching, but... - this.manager.state.blockchain.close(callback); - this.engine.stop() -}; - -Provider.prototype._queueRequest = function(payload, intermediary) { - if (!this._requestQueue) { - this._requestQueue = [] - } - - this._requestQueue.push({ - payload: payload, - callback: intermediary - }); - - setImmediate(this._processRequestQueue) -} - -Provider.prototype._processRequestQueue = function() { - const self = this; - - if (self._requestInProgress) return - - self._requestInProgress = true - - let args = self._requestQueue.shift() - - if (args) { - self.engine.sendAsync(args.payload, (err, result) => { - if (self._requestQueue.length > 0) { - setImmediate(self._processRequestQueue) - } - args.callback(err, result) - self._requestInProgress = false; - }) - } else { - // still need to free the lock - self._requestInProgress = false; - - if (self._requestQueue.length > 0) { - setImmediate(self._processRequestQueue) - } - } -} - -Provider.prototype.cleanUpErrorObject = function(err, response) { - // Our response should already have an error field at this point, if it - // doesn't, this was likely intentional. If not, this is the wrong place to - // fix that problem. - if (!err || !response.error) { - return response - } - - let errorObject = { - error: { - data: {} - }, - } - - if (err.message) { - // clean up the error reporting done by the provider engine so the error message isn't lost in the stack trace noise - errorObject.error.message = err.message; - errorObject.error.data.stack = err.stack; - errorObject.error.data.name = err.name; - } else if (!response.error) { - errorObject.error = { - message: err.toString() - } - } - - return _.merge(response, errorObject) -} - -// helper list of RPC methods which execute code and respond with a transaction hash as their result -let transactionMethods = [ - 'eth_sendTransaction', - 'eth_sendRawTransaction', - 'personal_sendTransaction' -]; - -Provider.prototype._isTransactionRequest = function(request) { - return transactionMethods.indexOf(request.method) != -1; -} - -Provider.prototype.reportErrorInResponse = function(request, err, response) { - const self = this; - - if (!err) return response; - - // TODO: for next major release: move reporting of tx hash on error to error - // field to prevent poorly-written clients which assume that the existence of - // the "result" field implies no errors from breaking. - if (self._isTransactionRequest(request)) { - if (err instanceof RuntimeError) { - // Make sure we always return the transaction hash on failed transactions so - // the caller can get their tx receipt. This breaks JSONRPC 2.0, but it's how - // we've always done it. - response.result = err.hashes[0] - - if (self.options.vmErrorsOnRPCResponse) { - if(!response.error.data) { - response.error.data = {} - } - response.error.data[err.hashes[0]] = err.results[err.hashes[0]] - } else { - delete response.error - } - } - } - - if (request.method === 'eth_call') { - if (err instanceof RuntimeError) { - if (self.options.vmErrorsOnRPCResponse) { - if(!response.error.data) { - response.error.data = {} - } - response.error.data[err.hashes[0]] = err.results[err.hashes[0]] - } else { - response.result = err.results[err.hashes[0]].return || '0x' - delete response.error - } - } - } - - return self.cleanUpErrorObject(err, response) -} - -module.exports = Provider; diff --git a/lib/server.js b/lib/server.js deleted file mode 100644 index ea07235d00..0000000000 --- a/lib/server.js +++ /dev/null @@ -1,85 +0,0 @@ -// make sourcemaps work! -require('source-map-support/register') - -var Provider = require("./provider"); -var webSocketServer = require("./webSocketServer"); -var httpServer = require("./httpServer"); -var _ = require("lodash"); - -module.exports = { - create: function(options) { - options = _applyDefaultOptions(options || {}) - - var logger = options.logger; - var provider = new Provider(options); - - var server = httpServer(provider, logger); - - let connectionCounter = 0; - const connections = {}; - server.on('connection', conn => { - let key = connectionCounter++; - connections[key] = conn; - conn.on('close', () => delete connections[key]) - }); - - var oldListen = server.listen; - - server.listen = function() { - var args = Array.prototype.slice.call(arguments); - var callback = function() {}; - if (args.length > 0) { - var last = args[args.length - 1]; - if (typeof last == "function") { - callback = args.pop(); - } - } - - var intermediary = function(err) { - if (err) return callback(err); - server.provider.manager.waitForInitialization(callback); - }; - - args.push(intermediary); - - oldListen.apply(server, args); - } - - server.provider = provider; - - var wss = null; - - if (options.ws) { - wss = webSocketServer(server, provider, logger); - } - - var oldClose = server.close; - - server.close = function(callback) { - var args = Array.prototype.slice.call(arguments); - oldClose.apply(server, args); - - server.provider.close(function(err) { - if (err) return callback(err); - Object.keys(connections).forEach(key => { - try { - connections[key].destroy(); - } catch (error) {} - }) - }); - }; - - return server; - } -}; - -const defaultOptions = { - logger: { - log: function() {} - }, - ws: true -} - -var _applyDefaultOptions = function(options) { - return _.merge({}, defaultOptions, options) -} diff --git a/lib/statemanager.js b/lib/statemanager.js deleted file mode 100644 index e6525788be..0000000000 --- a/lib/statemanager.js +++ /dev/null @@ -1,886 +0,0 @@ -var Account = require('ethereumjs-account'); -var Block = require('ethereumjs-block'); -var VM = require('ethereumjs-vm'); -var RuntimeError = require('./utils/runtimeerror'); -var Trie = require('merkle-patricia-tree'); -var FakeTransaction = require('ethereumjs-tx/fake.js'); -var utils = require('ethereumjs-util'); -var seedrandom = require('seedrandom'); -var bip39 = require('bip39'); -var wallet = require('ethereumjs-wallet'); -var hdkey = require('ethereumjs-wallet/hdkey'); -var async = require("async"); -var BlockchainDouble = require("./blockchain_double.js"); -var ForkedBlockchain = require("./utils/forkedblockchain.js"); -var Web3 = require('web3'); -var util = require("util"); -var sigUtil = require('eth-sig-util') -var _ = require("lodash"); - -var to = require('./utils/to'); -var random = require('./utils/random'); -var txhelper = require('./utils/txhelper'); -var TXRejectedError = require('./utils/txrejectederror'); - -StateManager = function(options, provider) { - var self = this; - - this.options = options = this._applyDefaultOptions(options || {}) - - if (options.fork) { - this.blockchain = new ForkedBlockchain(options); - } else { - this.blockchain = new BlockchainDouble(options); - } - - this.vm = this.blockchain.vm; - this.stateTrie = this.blockchain.stateTrie; - - this.accounts = {}; - this.secure = !!options.secure; - this.account_passwords = {} - this.personal_accounts = {} - this.total_accounts = options.total_accounts; - this.coinbase = null; - - this.latest_filter_id = 1; - - // This queue manages actions that shouldn't be run in parallel. - // The action_processing flag ensures new actions are queued instead of - // run immediately. - this.action_queue = []; - this.action_processing == false; - - this.snapshots = []; - this.logger = options.logger; - this.net_version = options.network_id; - this.mnemonic = options.mnemonic; - this.wallet = hdkey.fromMasterSeed(bip39.mnemonicToSeed(this.mnemonic)); - this.wallet_hdpath = options.hdPath; - - this.gasPriceVal = to.rpcQuantityHexString(options.gasPrice); - - this.is_mining = true; - this.blockTime = options.blockTime; - this.is_mining_on_interval = !!options.blockTime; - this.mining_interval_timeout = null; - - this._provider = provider; -} - -const defaultOptions = { - total_accounts: 10, - gasPrice: '0x77359400', //2 gwei - default_balance_ether: 100, - unlocked_accounts: [], - hdPath: "m/44'/60'/0'/0/" -} - -StateManager.prototype._applyDefaultOptions = function(options) { - // do this so that we can use the same seed on our next run and get the same - // results without explicitly setting a seed up front - if (!options.seed) { - options.seed = random.randomAlphaNumericString(10, seedrandom()) - } - - // generate a randomized default mnemonic - if (!options.mnemonic) { - let randomBytes = random.randomBytes(16, seedrandom(options.seed)) - options.mnemonic = bip39.entropyToMnemonic(randomBytes.toString("hex")) - } - - if (!options.fork && !options.network_id) { - options.network_id = (new Date()).getTime(); - } - - // We want this function to mutate the options object so that we can report - // our settings back to our consumer application (e.g., ganache) - return _.merge(options, defaultOptions, Object.assign({}, options)); -} - -StateManager.prototype.initialize = function(callback) { - var self = this; - - var accounts = []; - - let defaultBalanceWei = to.hex(Web3.utils.toWei(self.options.default_balance_ether.toString(), 'ether')); - - if (self.options.accounts) { - accounts = self.options.accounts.map(self.createAccount.bind(self)); - } else { - if (!self.total_accounts) { - return callback(new Error('Cannot initialize chain: either options.accounts or options.total_accounts must be specified')) - } - - for (var i = 0; i < self.total_accounts; i++) { - accounts.push(self.createAccount({ - index: i, - balance: defaultBalanceWei - })); - } - } - - self.coinbase = to.hex(accounts[0].address); - self.accounts = {}; - - accounts.forEach(function(data) { - self.accounts[data.address] = data; - self.personal_accounts[data.address.toLowerCase()] = true; - }); - - // Turn array into object, mostly for speed purposes. - // No need for caller to specify private keys. - self.unlocked_accounts = self.options.unlocked_accounts.reduce(function(obj, address) { - // If it doesn't have a hex prefix, must be a number (either a string or number type). - if ((address + "").indexOf("0x") != 0) { - let idx = parseInt(address) - let account = accounts[idx] - if (!account) { - throw new Error(`Account at index ${idx} not found. Max index available is ${accounts.length - 1}.`) - } - address = account.address.toLowerCase(); - } - - obj[address.toLowerCase()] = true; // can be any value - return obj; - }, {}); - - if (!self.secure) { - accounts.forEach(function(data) { - self.unlocked_accounts[data.address.toLowerCase()] = data; - }); - } - - self.blockchain.initialize(accounts, function(err) { - if (err) return callback(err); - - // If the user didn't pass a specific version id in, then use the - // forked blockchain's version (if it exists) or create our own. - if (!self.net_version) { - self.net_version = self.blockchain.fork_version - } - - if (self.is_mining_on_interval) { - self.mineOnInterval(); - } - - callback(); - }); -}; - -StateManager.prototype.mineOnInterval = function() { - var self = this; - - // For good measure. - clearTimeout(self.mining_interval_timeout); - self.mining_interval_timeout = null; - - self.mining_interval_timeout = setTimeout(function() { - self._provider.send({ - method: 'evm_mine' - }, - self.mineOnInterval.bind(self) - ); - - }, this.blockTime * 1000); - - // Ensure this won't keep a node process open. - if (this.mining_interval_timeout && this.mining_interval_timeout.unref) { - this.mining_interval_timeout.unref(); - } -}; - -StateManager.prototype.createAccount = function(opts, i) { - var secretKey; - var balance; - - if (opts.generate) { - secretKey = wallet.generate().getPrivateKey(); - } else if (opts.secretKey) { - secretKey = utils.toBuffer(to.hex(opts.secretKey)); - } else { - var index = (typeof(opts.index) === 'undefined') ? i : opts.index; - var acct = this.wallet.derivePath(this.wallet_hdpath + index) // index is a number - secretKey = acct.getWallet().getPrivateKey() // Buffer - } - - var publicKey = utils.privateToPublic(secretKey); - var address = utils.publicToAddress(publicKey); - - var account = new Account(); - - account.balance = to.hex(opts.balance) - - var data = { - secretKey: secretKey, - publicKey: publicKey, - address: to.hex(address).toLowerCase(), - account: account - }; - - return data; -}; - -StateManager.prototype.blockNumber = function(callback) { - return this.blockchain.getHeight(callback); -}; - -StateManager.prototype.gasPrice = function() { - return this.gasPriceVal; -} - -StateManager.prototype.getBalance = function(address, number, callback) { - this.blockchain.getBalance(address, number, function(err, balance) { - if (balance) { - balance = to.rpcQuantityHexString(balance); - } - callback(err, balance); - }); -} - -StateManager.prototype.getTransactionCount = function(address, number, callback) { - this.blockchain.getNonce(address, number, function(err, nonce) { - if (nonce) { - nonce = to.rpcQuantityHexString(nonce); - } - callback(err, nonce); - }); -} - -StateManager.prototype.getCode = function(address, number, callback) { - this.blockchain.getCode(address, number, function(err, code) { - if (code) { - code = to.hex(code); - } - callback(err, code); - }); -} - -StateManager.prototype.queueRawTransaction = function(rawTx, callback) { - var data = Buffer.from(utils.stripHexPrefix(rawTx), 'hex'); - - var tx = new FakeTransaction(data); - var txParams = { - from: tx.from.toString('hex'), - to: tx.to.toString('hex'), - gas: tx.gasLimit.toString('hex'), - gasPrice: tx.gasPrice.toString('hex'), - value: tx.value.toString('hex'), - data: tx.data.toString('hex'), - nonce: tx.nonce.toString('hex'), - } - - if (tx.v && tx.v.length > 0 && - tx.r && tx.r.length > 0 && - tx.s && tx.s.length > 0) { - txParams.v = tx.v.toString('hex'); - txParams.r = tx.r.toString('hex'); - txParams.s = tx.s.toString('hex'); - } - - this.queueTransaction("eth_sendRawTransaction", txParams, null, callback); -}; - -StateManager.prototype.queueStorage = function(address, position, block, callback) { - this.action_queue.push({ - method: "eth_getStorageAt", - address: utils.addHexPrefix(address), - position: utils.addHexPrefix(position), - block: block, - callback: callback - }); - - // We know there's work, so get started. - this.processNextAction(); -} - -StateManager.prototype.queueTransaction = function(method, tx_params, block_number, callback) { - if (tx_params.from == null) { - callback(new TXRejectedError("from not found; is required")); - return; - } - - // use toLowerCase() to properly handle from addresses meant to be validated. - tx_params.from = utils.addHexPrefix(tx_params.from).toLowerCase(); - - if (method == "eth_sendTransaction" && - this.accounts[tx_params.from] == null && - this.unlocked_accounts[tx_params.from] == null) { - - return callback(new TXRejectedError("sender account not recognized")); - } - - if (method == "eth_sendTransaction" && this.unlocked_accounts[tx_params.from] == null) { - return callback(new TXRejectedError("signer account is locked")); - } - - var rawTx = { - gasPrice: "0x1", - gasLimit: to.hex(this.blockchain.defaultTransactionGasLimit), - value: '0x0', - }; - - if (tx_params.gas != null) { - rawTx.gasLimit = utils.addHexPrefix(tx_params.gas); - } - - if (tx_params.gasPrice != null) { - rawTx.gasPrice = utils.addHexPrefix(tx_params.gasPrice); - } else { - rawTx.gasPrice = this.gasPriceVal; - } - - if (tx_params.to != null) { - rawTx.to = utils.addHexPrefix(tx_params.to); - } - - if (tx_params.value != null) { - rawTx.value = utils.addHexPrefix(tx_params.value); - } - - if (tx_params.data != null) { - rawTx.data = utils.addHexPrefix(tx_params.data); - } - - if (tx_params.nonce != null) { - rawTx.nonce = utils.addHexPrefix(tx_params.nonce); - } - - if (tx_params.v != null && tx_params.s != null && tx_params.v != null) { - rawTx.v = utils.addHexPrefix(tx_params.v); - rawTx.r = utils.addHexPrefix(tx_params.r); - rawTx.s = utils.addHexPrefix(tx_params.s); - } - - // some tools use a null or empty `to` field when doing contract deployments - if (rawTx.to == '0x0' || rawTx.to == '') { - delete rawTx.to - } - - // Error checks - if (rawTx.to && typeof rawTx.to != "string") { - return callback(new TXRejectedError("Invalid to address")); - } - - // If the transaction has a higher gas limit than the block gas limit, error. - if (to.number(rawTx.gasLimit) > to.number(this.blockchain.blockGasLimit)) { - return callback(new TXRejectedError("Exceeds block gas limit")); - } - - // Get the nonce for this address, taking account any transactions already queued. - var self = this; - var address = utils.toBuffer(tx_params.from); - - // we don't call createFakeTransactionWithCorrectNonce here because then we'd need to worry - // about nonce calculation for the items pending in the action_queue. - // Instead, we simply create a `FakeTransaction` and bail on validation - // errors so that we fail fast when we have bad tx input - - try { - let tx = new FakeTransaction(rawTx); - tx.from = address; - } catch (err) { - return callback(err); - } - - self.action_queue.push({ - method: method, - from: tx_params.from, - tx: rawTx, - callback: callback, - blockNumber: block_number, - }); - - // We know there's work, so get started. - self.processNextAction(); -}; - -StateManager.prototype.queueTransactionTrace = function(tx_hash, params, callback) { - this.action_queue.push({ - method: "debug_traceTransaction", - hash: to.hex(tx_hash), - params: params, - callback: callback - }); - - // We know there's work, so get started. - this.processNextAction(); -}; - -StateManager.prototype.processNextAction = function(override) { - var self = this; - - if (override != true) { - if (this.action_processing == true || this.action_queue.length == 0) { - return; - } - } - - var queued = this.action_queue.shift(); - - // Set the flag that we're currently processing something. - this.action_processing = true; - - var intermediary = function(err, result) { - queued.callback(err, result); - - if (self.action_queue.length > 0) { - self.processNextAction(true); - } else { - self.action_processing = false; - } - }; - - if (typeof queued.method == "function") { - var result = queued.method(); - return intermediary(null, result); - } else if (queued.method == "eth_getStorageAt") { - this.blockchain.getStorage(queued.address, queued.position, queued.block, function(err, result) { - if (err) return intermediary(err); - - if (result) { - result = utils.rlp.decode(result); - } - - result = to.hex(result || 0); - intermediary(null, result); - }); - } else if (queued.method == "debug_traceTransaction") { - this.blockchain.processTransactionTrace(queued.hash, queued.params, intermediary); - } else if (queued.method == "eth_sendTransaction" || queued.method == "eth_sendRawTransaction") { - this.processTransaction(queued.from, queued.tx, intermediary); - } else if (queued.method == "eth_call") { - this.processCall(queued.from, queued.tx, queued.blockNumber, intermediary); - } else if (queued.method == "eth_estimateGas") { - this.processGasEstimate(queued.from, queued.tx, queued.blockNumber, intermediary); - } -}; - -StateManager.prototype.sign = function(address, dataToSign) { - var account = this.accounts[to.hex(address).toLowerCase()]; - - if (!account) { - throw new Error("cannot sign data; no private key"); - } - - var secretKey = account.secretKey; - var msg = Buffer.from(dataToSign.replace('0x',''), 'hex'); - var msgHash = utils.hashPersonalMessage(msg); - var sgn = utils.ecsign(msgHash, Buffer.from(secretKey)); - return utils.toRpcSig(sgn.v, sgn.r, sgn.s); -}; - -StateManager.prototype.signTypedData = function(address, typedDataToSign) { - var account = this.accounts[to.hex(address).toLowerCase()]; - if (!account) { - throw new Error("cannot sign data; no private key"); - } - - if(!typedDataToSign.types) { - throw new Error("cannot sign data; types missing"); - } - - if(!typedDataToSign.types.EIP712Domain) { - throw new Error("cannot sign data; EIP712Domain definition missing"); - } - - if(!typedDataToSign.domain) { - throw new Error("cannot sign data; domain missing"); - } - - if(!typedDataToSign.primaryType) { - throw new Error("cannot sign data; primaryType missing"); - } - - if(!typedDataToSign.message) { - throw new Error("cannot sign data; message missing"); - } - - return sigUtil.signTypedData(account.secretKey, { data: typedDataToSign }); -}; - -StateManager.prototype.printTransactionReceipt = function(tx_hash, error, callback){ - var self = this; - - self.blockchain.getTransactionReceipt(tx_hash, function(err, receipt) { - if (err) return callback(err); - - self.blockchain.latestBlock(function(err, block) { - if (err) return callback(err); - - receipt = receipt.toJSON(); - - self.logger.log(""); - self.logger.log(" Transaction: " + tx_hash); - - if (receipt.contractAddress != null) { - self.logger.log(" Contract created: " + receipt.contractAddress); - } - - self.logger.log(" Gas usage: " + parseInt(receipt.gasUsed, 16)); - self.logger.log(" Block Number: " + parseInt(receipt.blockNumber, 16)); - self.logger.log(" Block Time: " + new Date(to.number(block.header.timestamp) * 1000).toString()); - - if (error) { - self.logger.log(" Runtime Error: " + error.error); - if (error.reason) { - self.logger.log(" Revert reason: " + error.reason); - } - } - - self.logger.log(""); - - callback(null, tx_hash); - }); - }); -} - -StateManager.prototype.processBlock = function(timestamp, callback) { - var self = this; - - if (typeof timestamp == "function") { - callback = timestamp; - timestamp = null; - } - - self.blockchain.processNextBlock(timestamp, function(runtime_error, transactions, vm_output) { - if (runtime_error && runtime_error instanceof RuntimeError == false) { - // This is bad. Get out. - return callback(runtime_error, transactions, vm_output); - } - - // TODO: Can we refactor printTransactionReceipt so it's synchronous? - // We technically have the raw vm receipts (though they're not full receipts here...). - async.eachSeries(transactions, function(tx, finished_printing) { - var hash = to.hex(tx.hash()); - var error = runtime_error == null ? {results: {}} : runtime_error; - self.printTransactionReceipt(hash, error.results[hash], finished_printing); - }, callback(runtime_error, transactions, vm_output)); - }); -} - -StateManager.prototype.processBlocks = function(total_blocks, callback) { - var self = this; - - if (typeof total_blocks == "function") { - callback = total_blocks; - total_blocks = null; - } - - // Note: VM errors (errors that the VM directly returns) trump all runtime errors. - var runtime_error = null; - var amount_processed = 0; - - async.whilst(function() { - var shouldContinue; - - if (total_blocks == null) { - shouldContinue = self.blockchain.pending_transactions.length > 0; - } else { - shouldContinue = amount_processed < total_blocks; - } - - return shouldContinue; - }, function(done) { - self.processBlock(function(err, transactions, vm_output) { - amount_processed += 1; - - if (err) { - if (err instanceof RuntimeError == false) { - // This is bad. Get out. - return done(err); - } - - // We must have a RuntimeError. Merge results if we've found - // other runtime errors during this execution. - if (runtime_error == null) { - runtime_error = err; - } else { - runtime_error.combine(err); - } - } - - // Note we don't quit on runtime errors. We keep processing transactions. - done(); - }); - }, function(err) { - // Remember: vm errors trump runtime errors - callback(err || runtime_error); - }); -}; - -StateManager.prototype.processCall = function (from, rawTx, blockNumber, callback) { - var self = this; - - self.createFakeTransactionWithCorrectNonce(rawTx, from, function(err, tx) { - if (err) return callback(err); - - self.blockchain.processCall(tx, blockNumber, function (err, results) { - if (err) { - return callback(err); - } - - var result = '0x0' - if (!results.error && results.vm.return) { - result = to.hex(results.vm.return); - } else if (results.error) { - self.logger.log(`Error processing call: ${results.error}`) - } - - return callback(null, result); - }); - }); -}; - -StateManager.prototype.processGasEstimate = function (from, rawTx, blockNumber, callback) { - var self = this; - - self.createFakeTransactionWithCorrectNonce(rawTx, from, function(err, tx) { - if (err) return callback(err); - - self.blockchain.processCall(tx, blockNumber, function (err, results) { - if (err) { - return callback(err); - } - var result = '0x0' - if (!results.error) { - result = results.gasRefund ? to.hex(results.gasUsed.add(results.gasRefund)) : to.hex(results.gasUsed); - } else { - self.logger.log(`Error calculating gas estimate: ${results.error}`) - } - return callback(null, result); - }); - }); -} - -StateManager.prototype.processTransaction = function(from, rawTx, callback) { - var self = this; - - self.createFakeTransactionWithCorrectNonce(rawTx, from, function(err, tx) { - if (err) return callback(err); - - self.blockchain.queueTransaction(tx); - - var tx_hash = to.hex(tx.hash()); - - // If we're not currently mining or we're mining on an interval, - // only queue the transaction, don't process it. - if (self.is_mining == false || self.is_mining_on_interval) { - return callback(null, tx_hash); - } - - self.processBlocks(function (err) { - if (err) return callback(err); - callback(null, tx_hash); - }); - }); -}; - -StateManager.prototype.getTransactionReceipt = function(hash, callback) { - this.blockchain.getTransactionReceipt(hash, function(err, receipt) { - if (err && err.notFound) { - // Return null if the receipt's not found. - return callback(null, null); - } - callback(err, receipt); - }); -}; - -StateManager.prototype.getBlock = function(hash_or_number, callback) { - this.blockchain.getBlock(hash_or_number, callback); -}; - -StateManager.prototype.getLogs = function(filter, callback) { - var self = this; - - // filter.address may be a single address or an array - // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getlogs - var expectedAddress = filter.address && (Array.isArray(filter.address) ? filter.address : [filter.address]); - expectedAddress = expectedAddress && expectedAddress.map(function(a) { return a.toLowerCase() }); - var expectedTopics = filter.topics || []; - - async.parallel({ - fromBlock: this.blockchain.getEffectiveBlockNumber.bind(this.blockchain, filter.fromBlock || "latest"), - toBlock: this.blockchain.getEffectiveBlockNumber.bind(this.blockchain, filter.toBlock || "latest"), - latestBlock: this.blockchain.getEffectiveBlockNumber.bind(this.blockchain, "latest") - }, function(err, results) { - var fromBlock = results.fromBlock; - var toBlock = results.toBlock; - var latestBlock = results.latestBlock; - - if (toBlock > latestBlock) { - toBlock = latestBlock; - } - - var logs = []; - var current = fromBlock; - - async.whilst(function() { - return current <= toBlock; - }, function(finished) { - self.blockchain.getBlockLogs(current, function(err, blockLogs) { - if (err) return finished(err); - - // Filter logs that match the address - var filtered = !expectedAddress ? blockLogs : blockLogs.filter(function(log) { - return expectedAddress.indexOf(log.address.toLowerCase()) > -1; - }); - - // Now filter based on topics. - filtered = filtered.filter(function(log) { - var keep = true; - for (var i = 0; i < expectedTopics.length; i++) { - var expectedTopic = expectedTopics[i]; - var logTopic = log.topics[i]; - if (expectedTopic == null) continue; - var isMatch = Array.isArray(expectedTopic) - ? expectedTopic.includes(logTopic) - : expectedTopic === logTopic; - if (i >= log.topics.length || !isMatch) { - keep = false; - break; - } - } - return keep; - }); - - logs.push.apply(logs, filtered); - - current += 1; - finished(); - }); - }, function(err) { - if (err) return callback(err); - - logs = logs.map(function(log) { - return log.toJSON(); - }); - - callback(err, logs); - }); - - }); -}; - -// Note: Snapshots have 1-based ids. -StateManager.prototype.snapshot = function(callback) { - var self = this; - - this.blockchain.getHeight(function(err, blockNumber) { - if (err) return callback(err); - - self.snapshots.push({ - blockNumber: blockNumber, - timeAdjustment: self.blockchain.timeAdjustment - }); - - self.logger.log("Saved snapshot #" + self.snapshots.length); - - callback(null, to.hex(self.snapshots.length)); - }); -}; - -StateManager.prototype.revert = function(snapshot_id, callback) { - var self = this; - - // Convert from hex. - snapshot_id = utils.bufferToInt(snapshot_id); - - this.logger.log("Reverting to snapshot #" + snapshot_id); - - if (snapshot_id > this.snapshots.length) { - return false; - } - - // Convert to zero based. - snapshot_id = snapshot_id - 1; - var timeAdjustment = this.snapshots[snapshot_id].timeAdjustment; - - // Loop through each snapshot with a higher id than the current one. - async.whilst(function() { - return self.snapshots.length > snapshot_id - }, function(nextSnapshot) { - var snapshot = self.snapshots.pop(); - - // For each snapshot, asynchronously pop off the blocks it represents. - async.during(function(doneWithTest) { - self.blockchain.getHeight(function(err, blockNumber) { - if (err) return doneWithTest(err); - - doneWithTest(null, blockNumber > snapshot.blockNumber) - }); - }, function(nextBlock) { - self.blockchain.popBlock(function(err) { - if (err) return nextBlock(err); - nextBlock(); - }); - }, nextSnapshot); - - - }, function(err) { - if (err) return callback(err); - - // Pending transactions are removed when you revert. - self.blockchain.clearPendingTransactions(); - // The time adjustment is restored to its prior state - self.blockchain.timeAdjustment = timeAdjustment; - - callback(null, true); - }); -}; - -StateManager.prototype.hasContractCode = function(address, callback) { - this.vm.stateManager.getContractCode( address, function( err, result ) { - if( err != null ) { - callback( err, false ); - } else { - callback( null, true ); - } - }); -} - -StateManager.prototype.startMining = function(callback) { - this.is_mining = true; - - if (this.is_mining_on_interval) { - this.mineOnInterval(); - callback(); - } else { - this.processBlocks(callback); - } -}; - -StateManager.prototype.stopMining = function(callback) { - this.is_mining = false; - clearTimeout(this.mining_interval_timeout); - this.mining_interval_timeout = null; - callback(); -}; - -StateManager.prototype.isUnlocked = function(address) { - return this.unlocked_accounts[address.toLowerCase()] != null; -}; - -StateManager.prototype.createFakeTransactionWithCorrectNonce = function(rawTx, from, callback) { - const self = this; - self.blockchain.getQueuedNonce(from, (err, expectedNonce) => { - if (err) return callback(err); - - var tx = new FakeTransaction(rawTx); - tx.from = from; - - // If the user specified a nonce, use that instead. - if (rawTx.nonce == null) { - // account for transactions waiting in the tx queue - tx.nonce = to.hex(expectedNonce); - } else { - if (to.number(rawTx.nonce) !== to.number(expectedNonce)) { - return callback(new TXRejectedError(`the tx doesn't have the correct nonce. ` + - `account has nonce of: ${to.number(expectedNonce)} ` + - `tx has nonce of: ${to.number(tx.nonce)}`)) - } - } - callback(null, tx) - }); -} -module.exports = StateManager; diff --git a/lib/subproviders/delayedblockfilter.js b/lib/subproviders/delayedblockfilter.js deleted file mode 100644 index a95d2366f1..0000000000 --- a/lib/subproviders/delayedblockfilter.js +++ /dev/null @@ -1,123 +0,0 @@ -// It's unforutnate we have to have this subprovider, but it's because -// we instamine, and web3 isn't written in a way that supports instamining -// (i.e., it sets up the filter after the transaction has been processed). -// This block filter will ensure that each block filter will always see -// the change from the last block to the current block. -// -// Note: An added benefit of this is that it shaves off a signifcant -// amount of time from tests that use web3 and block filters. - -var Subprovider = require('web3-provider-engine/subproviders/subprovider.js'); -var inherits = require("util").inherits; -var async = require("async"); -var to = require("../utils/to"); - -inherits(DelayedBlockFilter, Subprovider); - -module.exports = DelayedBlockFilter; - -function DelayedBlockFilter() { - this.watching = {}; -}; - -DelayedBlockFilter.prototype.handleRequest = function(payload, next, end) { - if (payload.method == "eth_newBlockFilter") return this.handleNewBlockFilter(payload, next, end); - if (payload.method == "eth_getFilterChanges") return this.handleGetFilterChanges(payload, next, end); - - next(); -}; - -DelayedBlockFilter.prototype.handleNewBlockFilter = function(payload, next, end) { - var self = this; - - // Let this filter process and add it to our watch list. - next(function(err, result, cb) { - if (err) return cb(); - self.watching[result] = true; - cb(); - }); -} - -DelayedBlockFilter.prototype.handleGetFilterChanges = function(payload, next, end) { - var self = this; - var filter_id = payload.params[0]; - - if (!this.watching[filter_id]) return next(); - - // Get the changes, and then alter the result. - next(function(err, result, cb) { - if (err) return cb(); - - var currentBlockHash; - var previousBlockHash; - var blockNumber; - - async.series([ - function(c) { - // If we have a result, use it. - if (result.length != 0) { - currentBlockHash = result[0]; - c(); - } else { - // Otherwise, get the current block number. - self.emitPayload({ - method: "eth_blockNumber" - }, function(err, res) { - if (err) return c(err); - blockNumber = to.number(res.result); - c(); - }); - } - }, - function(c) { - // If we got a block number above, meaning, we didn't get a block hash, - // skip this step. - if (blockNumber) return c(); - - // If not skipped, then we got a block hash, and we need to get a block number from it. - self.emitPayload({ - method: "eth_getBlockByHash", - params: [currentBlockHash, false] - }, function(err, res) { - if (err) return c(err); - blockNumber = to.number(res.result.number); - c(); - }) - }, - function(c) { - // If we're at block 0, return no changes. See final function below. - if (blockNumber == 0) { - previousBlockHash = undefined; - return c(); - } - - // If at this point, we do have a block number, so let's subtract one - // from it and get the block hash of the block before it. - blockNumber = blockNumber - 1; - self.emitPayload({ - method: "eth_getBlockByNumber", - params: [blockNumber, false] - }, function(err, res) { - if (err) return c(err); - previousBlockHash = res.result.hash; - c(); - }); - } - ], function(err) { - if (err) { - // Unfortunately the subprovider code doesn't let us return an error - // through the callback cb(). So we'll just ignore it.... (famous last words). - } - - // If we got the previous block, use it. Otherwise do nothing. - // Then stop watching because we only want on getFilterChanges to react this way. - if (previousBlockHash) { - result[0] = previousBlockHash; - } - - delete self.watching[filter_id]; - cb(); - }) - }); - -}; diff --git a/lib/subproviders/geth_api_double.js b/lib/subproviders/geth_api_double.js deleted file mode 100644 index 8241ee8468..0000000000 --- a/lib/subproviders/geth_api_double.js +++ /dev/null @@ -1,820 +0,0 @@ -var utils = require('ethereumjs-util'); -var inherits = require('util').inherits; -var StateManager = require('../statemanager.js'); -var to = require('../utils/to'); -var txhelper = require('../utils/txhelper'); -var blockHelper = require('../utils/block_helper'); -var pkg = require('../../package.json'); -var _ = require('lodash'); - -var Subprovider = require('web3-provider-engine/subproviders/subprovider.js'); - -inherits(GethApiDouble, Subprovider) - -function GethApiDouble(options, provider) { - var self = this; - - this.state = options.state || new StateManager(options, provider); - this.options = options; - this.initialized = false; - - this.initialization_error = null; - this.post_initialization_callbacks = []; - - this.state.initialize(function(err) { - if (err) { - self.initialization_error = err; - } - self.initialized = true; - - var callbacks = self.post_initialization_callbacks; - self.post_initialization_callbacks = []; - - callbacks.forEach(function(callback) { - setImmediate(function() { - callback(self.initialization_error, self.state); - }); - }); - }); -} - -GethApiDouble.prototype.waitForInitialization = function(callback) { - var self = this; - if (self.initialized == false) { - self.post_initialization_callbacks.push(callback); - } else { - callback(self.initialization_error, self.state); - } -} - -// Function to not pass methods through until initialization is finished -GethApiDouble.prototype.handleRequest = function(payload, next, end) { - var self = this; - - if (self.initialization_error != null) { - return end(self.initialization_error); - } - - if (self.initialized == false) { - self.waitForInitialization(self.getDelayedHandler(payload, next, end)); - return; - } - - var method = self[payload.method]; - - if (method == null) { - return end(new Error("Method " + payload.method + " not supported.")); - } - - var params = payload.params || []; - var args = [].concat(params); - - var addedBlockParam = false; - - if (self.requiresDefaultBlockParameter(payload.method) && args.length < method.length - 1) { - args.push("latest"); - addedBlockParam = true; - } - - args.push(end); - - // avoid crash by checking to make sure that we haven't specified too many arguments - if ( - args.length > method.length - || (method.minLength !== undefined && args.length < method.minLength) - || (method.minLength === undefined && args.length < method.length) - ){ - - var errorMessage = `Incorrect number of arguments. Method '${payload.method}' requires `; - if (method.minLength) { - errorMessage += `between ${method.minLength - 1} and ${method.length - 1} arguments. `; - } else { - errorMessage += `exactly ${method.length - 1} arguments. `; - } - - if (addedBlockParam) { - errorMessage += 'Including the implicit block argument, r'; - } else { - // new sentence, capitalize it. - errorMessage += 'R'; - } - errorMessage += `equest specified ${args.length - 1} arguments: ${JSON.stringify(args)}.` - - return end(new Error(errorMessage)); - } - - method.apply(self, args); -}; - -GethApiDouble.prototype.getDelayedHandler = function(payload, next, end) { - var self = this; - return function(err, state) { - if (err) { - end(err); - } - self.handleRequest(payload, next, end); - } -} - -GethApiDouble.prototype.requiresDefaultBlockParameter = function(method) { - // object for O(1) lookup. - var methods = { - "eth_getBalance": true, - "eth_getCode": true, - "eth_getTransactionCount": true, - "eth_getStorageAt": true, - "eth_call": true, - "eth_estimateGas": true - }; - - return methods[method] === true; -}; - -// Handle individual requests. - -GethApiDouble.prototype.eth_accounts = function(callback) { - callback(null, Object.keys(this.state.accounts)); -}; - -GethApiDouble.prototype.eth_blockNumber = function(callback) { - this.state.blockNumber(function(err, result) { - if (err) return callback(err); - callback(null, to.hex(result)); - }); -}; - -GethApiDouble.prototype.eth_coinbase = function(callback) { - callback(null, this.state.coinbase); -}; - -GethApiDouble.prototype.eth_mining = function(callback) { - callback(null, this.state.is_mining); -}; - -GethApiDouble.prototype.eth_hashrate = function(callback) { - callback(null, '0x0'); -}; - -GethApiDouble.prototype.eth_gasPrice = function(callback) { - callback(null, utils.addHexPrefix(this.state.gasPrice())); -}; - -GethApiDouble.prototype.eth_getBalance = function(address, block_number, callback) { - this.state.getBalance(address, block_number, callback); -}; - -GethApiDouble.prototype.eth_getCode = function(address, block_number, callback) { - this.state.getCode(address, block_number, callback); -}; - -GethApiDouble.prototype.eth_getBlockByNumber = function(block_number, include_full_transactions, callback) { - this.state.blockchain.getBlock(block_number, function(err, block) { - if (err) { - if (err.message && err.message.indexOf("index out of range") >= 0) { - return callback(null, null); - } else { - return callback(err); - } - } - - callback(null, blockHelper.toJSON(block, include_full_transactions)); - }); -}; - -GethApiDouble.prototype.eth_getBlockByHash = function(tx_hash, include_full_transactions, callback) { - this.eth_getBlockByNumber.apply(this, arguments); -}; - -GethApiDouble.prototype.eth_getBlockTransactionCountByNumber = function(block_number, callback) { - this.state.blockchain.getBlock(block_number, function(err, block) { - if (err) { - if (err.message.indexOf("index out of range")) { - // block doesn't exist - return callback(null, 0); - } else { - return callback(err); - } - } - callback(null, block.transactions.length); - }); -} - -GethApiDouble.prototype.eth_getBlockTransactionCountByHash = function(block_hash, callback) { - this.eth_getBlockTransactionCountByNumber.apply(this, arguments); -} - -GethApiDouble.prototype.eth_getTransactionReceipt = function(hash, callback) { - this.state.getTransactionReceipt(hash, function(err, receipt) { - if (err) return callback(err); - - var result = null; - - if (receipt){ - result = receipt.toJSON(); - } - callback(null, result); - }); -}; - -GethApiDouble.prototype.eth_getTransactionByHash = function(hash, callback) { - this.state.getTransactionReceipt(hash, function(err, receipt) { - if (err) return callback(err); - - var result = null; - - if (receipt) { - result = txhelper.toJSON(receipt.tx, receipt.block) - } - - callback(null, result); - }); -} - -GethApiDouble.prototype.eth_getTransactionByBlockHashAndIndex = function(hash_or_number, index, callback) { - var self = this; - - index = to.number(index); - - this.state.getBlock(hash_or_number, function(err, block) { - if (err) { - // block doesn't exist by that hash - if (err.notFound) { - return callback(null, null); - } else { - return callback(err); - } - } - - if (index >= block.transactions.length) { - return callback(new Error("Transaction at index " + to.hex(index) + " does not exist in block.")); - } - - var tx = block.transactions[index]; - var result = txhelper.toJSON(tx, block); - - callback(null, result); - }); -}; - -GethApiDouble.prototype.eth_getTransactionByBlockNumberAndIndex = function(hash_or_number, index, callback) { - this.eth_getTransactionByBlockHashAndIndex(hash_or_number, index, callback); -}; - -GethApiDouble.prototype.eth_getTransactionCount = function(address, block_number, callback) { - this.state.getTransactionCount(address, block_number, (err, count) => { - if (err && err.message && err.message.indexOf("index out of range") >= 0) { - err = new Error("Unknown block number") - } - return callback(err, count); - }); -} - -GethApiDouble.prototype.eth_sign = function(address, dataToSign, callback) { - var result; - var error; - - try { - result = this.state.sign(address, dataToSign); - } catch (e) { - error = e; - } - - callback(error, result); -}; - -GethApiDouble.prototype.eth_signTypedData = function(address, typedDataToSign, callback) { - var result; - var error; - - try { - result = this.state.signTypedData(address, typedDataToSign); - } catch (e) { - error = e; - } - - callback(error, result); -}; - -GethApiDouble.prototype.eth_sendTransaction = function(tx_data, callback) { - this.state.queueTransaction("eth_sendTransaction", tx_data, null, callback); -}; - -GethApiDouble.prototype.eth_sendRawTransaction = function(rawTx, callback) { - this.state.queueRawTransaction(rawTx, callback); -}; - -GethApiDouble.prototype.eth_call = function(tx_data, block_number, callback) { - if (!tx_data.gas) { - tx_data.gas = this.state.blockchain.blockGasLimit; - } - - this.state.queueTransaction("eth_call", tx_data, block_number, callback); // :( -}; - -GethApiDouble.prototype.eth_estimateGas = function(tx_data, block_number, callback) { - if (!tx_data.gas) { - tx_data.gas = this.state.blockchain.blockGasLimit; - } - this.state.queueTransaction("eth_estimateGas", tx_data, block_number, callback); -}; - -GethApiDouble.prototype.eth_getStorageAt = function(address, position, block_number, callback) { - this.state.queueStorage(address, position, block_number, callback); -}; - -GethApiDouble.prototype.eth_newBlockFilter = function(callback) { - var filter_id = utils.addHexPrefix(utils.intToHex(this.state.latest_filter_id)); - this.state.latest_filter_id += 1; - callback(null, filter_id); -}; - -GethApiDouble.prototype.eth_getFilterChanges = function(filter_id, callback) { - var blockHash = this.state.latestBlock().hash().toString("hex"); - // Mine a block after each request to getFilterChanges so block filters work. - this.state.mine(); - callback(null, [blockHash]); -}; - -GethApiDouble.prototype.eth_getLogs = function(filter, callback) { - this.state.getLogs(filter, callback); -}; - -GethApiDouble.prototype.eth_uninstallFilter = function(filter_id, callback) { - callback(null, true); -}; - -GethApiDouble.prototype.eth_protocolVersion = function(callback) { - callback(null, "63"); -}; - -GethApiDouble.prototype.bzz_hive = function(callback) { - callback(null, []); -}; - -GethApiDouble.prototype.bzz_info = function(callback) { - callback(null, []); -}; - -GethApiDouble.prototype.shh_version = function(callback) { - callback(null, "2"); -}; - -GethApiDouble.prototype.eth_getCompilers = function(callback) { - callback(null, []); -} - -GethApiDouble.prototype.eth_syncing = function(callback) { - callback(null, false); -}; - -GethApiDouble.prototype.net_listening = function(callback) { - callback(null, true); -}; - -GethApiDouble.prototype.net_peerCount = function(callback) { - callback(null, 0); -}; - -GethApiDouble.prototype.web3_clientVersion = function(callback) { - callback(null, "EthereumJS TestRPC/v" + pkg.version + "/ethereum-js") -}; - -GethApiDouble.prototype.web3_sha3 = function(string, callback) { - callback(null, to.hex(utils.sha3(string))); -}; - -GethApiDouble.prototype.net_version = function(callback) { - // net_version returns a string containing a base 10 integer. - callback(null, this.state.net_version + ""); -}; - -GethApiDouble.prototype.miner_start = function(threads, callback) { - if (!callback && typeof threads === 'function') { - callback = threads; - threads = null; - } - - this.state.startMining(function(err) { - callback(err, true); - }); -}; - -// indicate that `miner_start` only requires one argument (the callback) -GethApiDouble.prototype.miner_start.minLength = 1; - -GethApiDouble.prototype.miner_stop = function(callback) { - this.state.stopMining(function(err) { - callback(err, true); - }); -}; - -GethApiDouble.prototype.rpc_modules = function(callback) { - // returns the availible api modules and versions - callback(null, {"eth":"1.0","net":"1.0","rpc":"1.0","web3":"1.0","evm":"1.0","personal":"1.0"}); -}; - -GethApiDouble.prototype.personal_listAccounts = function(callback) { - callback(null, Object.keys(this.state.personal_accounts)); -}; - -GethApiDouble.prototype.personal_newAccount = function(password, callback) { - var account = this.state.createAccount({ generate: true }); - this.state.accounts[account.address.toLowerCase()] = account; - this.state.personal_accounts[account.address.toLowerCase()] = true; - this.state.account_passwords[account.address.toLowerCase()] = password; - callback(null, account.address); -}; - -GethApiDouble.prototype.personal_importRawKey = function(rawKey, password, callback) { - var account = this.state.createAccount({ secretKey: rawKey }); - this.state.accounts[account.address.toLowerCase()] = account; - this.state.personal_accounts[account.address.toLowerCase()] = true; - this.state.account_passwords[account.address.toLowerCase()] = password; - callback(null, account.address); -}; - -GethApiDouble.prototype.personal_lockAccount = function(address, callback) { - var account = this.state.personal_accounts[address.toLowerCase()]; - if (account !== true) { - return callback("Account not found"); - } - delete this.state.unlocked_accounts[address.toLowerCase()]; - callback(null, true); -}; - -GethApiDouble.prototype.personal_unlockAccount = function(address, password, duration, callback) { - // FIXME handle duration - var account = this.state.personal_accounts[address.toLowerCase()]; - if (account !== true) { - return callback("Account not found"); - } - - var storedPassword = this.state.account_passwords[address.toLowerCase()]; - if (storedPassword !== undefined && storedPassword !== password) { - return callback("Invalid password") - } - - this.state.unlocked_accounts[address.toLowerCase()] = true; - callback(null, true); -}; - -GethApiDouble.prototype.personal_sendTransaction = function(tx_data, password, callback) { - if (tx_data.from == null) { - callback("Sender not found"); - return; - } - - var from = utils.addHexPrefix(tx_data.from).toLowerCase(); - - var self = this; - self.personal_unlockAccount(from, password, null, function(err) { - if (err) return callback(err); - - self.state.queueTransaction("eth_sendTransaction", tx_data, null, function(err, ret) { - self.state.unlocked_accounts[from.toLowerCase()] = false; - callback(err, ret); - }); - }); -}; - -/* Functions for testing purposes only. */ - -GethApiDouble.prototype.evm_snapshot = function(callback) { - this.state.snapshot(callback) -}; - -GethApiDouble.prototype.evm_revert = function(snapshot_id, callback) { - this.state.revert(snapshot_id, callback); -}; - -GethApiDouble.prototype.evm_increaseTime = function(seconds, callback) { - callback(null, this.state.blockchain.increaseTime(seconds)); -}; - -GethApiDouble.prototype.evm_setTime = function(date, callback) { - callback(null, this.state.blockchain.setTime(date)) -}; - -GethApiDouble.prototype.evm_mine = function(timestamp, callback) { - var self = this; - if (typeof timestamp == "function") { - callback = timestamp; - timestamp = undefined; - } - this.state.processBlock(timestamp, function(err) { - if (err) return callback(err); - callback(err, '0x0'); - }); -}; - -// indicate that `evm_mine` only requires one argument (the callback) -GethApiDouble.prototype.evm_mine.minLength = 1; - -GethApiDouble.prototype.debug_traceTransaction = function(tx_hash, params, callback) { - if (typeof params == "function") { - callback = params; - params = []; - } - - this.state.queueTransactionTrace(tx_hash, params, callback); -}; - -/* - RPC AUDIT: - TODO ETH: eth_getUncleCountByBlockHash, eth_getUncleCountByBlockNumber, eth_getUncleByBlockHashAndIndex, - eth_getUncleByBlockNumberAndIndex, eth_getWork, eth_submitWork, eth_submitHashrate - - TODO DB: db_putString, db_getString, db_putHex, db_getHex - - TODO WHISPER: shh_post, shh_newIdentity, shh_hasIdentity, shh_newGroup, shh_addToGroup, - shh_newFilter, shh_uninstallFilter, shh_getFilterChanges, shh_getMessages -*/ - -/** - * Returns the number of uncles in a block from a block matching the given block hash. - * - * @param {DATA, 32 Bytes} hash - hash of a block. - * @callback callback - * @param {error} err - Error Object - * @param {QUANTITY} result - integer of the number of uncles in this block. - */ -GethApiDouble.prototype.eth_getUncleCountByBlockHash = function(hash, callback) { - callback(null, '0x0'); -}; - -/** - * Returns the number of uncles in a block from a block matching the given block number. - * - * @param {QUANTITY} blockNumber - integer of a block number, or the string "latest", "earliest" or "pending". Ex: '0xe8', // 232 - * @callback callback - * @param {error} err - Error Object - * @param {QUANTITY} result - integer of the number of uncles in this block. - */ -GethApiDouble.prototype.eth_getUncleCountByBlockNumber = function(blockNumber, callback) { - callback(null, '0x0'); -}; - -/** - * Returns information about a uncle of a block by hash and uncle index position. - * - * @param {DATA, 32 Bytes} hash - hash of a block - * @param {QUANTITY} index - the uncle's index position. - * @callback callback - * @param {error} err - Error Object - * @param {Object} result - A block object, - */ -GethApiDouble.prototype.eth_getUncleByBlockHashAndIndex = function(hash, index, callback) { - callback(null, {}); -}; - -/** - * Returns information about a uncle of a block by number and uncle index position. - * - * @param {QUANTITY} blockNumber - a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. - * @param {QUANTITY} uncleIndex - the uncle's index position. - * @callback callback - * @param {error} err - Error object - * @param {Object} resutl - A block object, - */ -GethApiDouble.prototype.eth_getUncleByBlockNumberAndIndex = function(blockNumber, uncleIndex, callback) { - callback(null, {}); -}; - -/** - * Creates a filter in the node, to notify when new pending transactions arrive. - * - * @callback callback - * @param {error} err - Error object - * @param {QUANTITY} result - A filter id - */ -GethApiDouble.prototype.eth_newPendingTransactionFilter = function(callback) { - callback(null, '0x00'); -}; - -/** - * Returns an array of all logs matching filter with given id. - * - * @param {QUANTITY} filter_id - A filter id - * @callback callback - * @param {error} err - Error object - * @param {Array of Log Objects} result - More Info: https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getfilterlogs - */ -GethApiDouble.prototype.eth_getFilterLogs = function(filter_id, callback) { - callback(null, []); -}; - -/** - * Returns: An Array with the following elements - * 1: DATA, 32 Bytes - current block header pow-hash - * 2: DATA, 32 Bytes - the seed hash used for the DAG. - * 3: DATA, 32 Bytes - the boundary condition ("target"), 2^256 / difficulty. - * - * @param {QUANTITY} filter_id - A filter id - * @callback callback - * @param {error} err - Error object - * @param {Array} result - the hash of the current block, the seedHash, and the boundary condition to be met ("target"). - */ -GethApiDouble.prototype.eth_getWork = function(filter_id, callback) { - callback(null, []); -}; - -/** - * Used for submitting a proof-of-work solution - * - * @param {DATA, 8 Bytes} nonce - The nonce found (64 bits) - * @param {DATA, 32 Bytes} powHash - The header's pow-hash (256 bits) - * @param {DATA, 32 Bytes} digest - The mix digest (256 bits) - * @callback callback - * @param {error} err - Error object - * @param {Boolean} result - returns true if the provided solution is valid, otherwise false. - */ -GethApiDouble.prototype.eth_submitWork = function(nonce, powHash, digest, callback) { - callback(null, false); -}; - -/** - * Used for submitting mining hashrate. - * - * @param {String} hashRate - a hexadecimal string representation (32 bytes) of the hash rate - * @param {String} clientID - A random hexadecimal(32 bytes) ID identifying the client - * @callback callback - * @param {error} err - Error object - * @param {Boolean} result - returns true if submitting went through succesfully and false otherwise. - */ -GethApiDouble.prototype.eth_submitHashrate = function(hashRate, clientID, callback) { - callback(null, false); -}; - - -/** - * Stores a string in the local database. - * - * @param {String} dbName - Database name. - * @param {String} key - Key name. - * @param {String} value - String to store. - * @callback callback - * @param {error} err - Error object - * @param {Boolean} result - returns true if the value was stored, otherwise false. - */ -GethApiDouble.prototype.db_putString = function(dbName, key, value, callback) { - callback(null, false); -}; - -/** - * Returns string from the local database - * - * @param {String} dbName - Database name. - * @param {String} key - Key name. - * @callback callback - * @param {error} - Error Object - * @param {String} result - The previously stored string. - */ -GethApiDouble.prototype.db_getString = function(dbName, key, callback) { - callback(null, ""); -}; - -/** - * Stores binary data in the local database. - * - * @param {String} dbName - Database name. - * @param {String} key - Key name. - * @param {DATA} data - Data to store. - * @callback callback - * @param {error} err - Error Object - * @param {Boolean} result - returns true if the value was stored, otherwise false. - */ -GethApiDouble.prototype.db_putHex = function(dbName, key, data, callback) { - callback(null, false); -}; - -/** - * Returns binary data from the local database - * - * @param {String} dbName - Database name. - * @param {String} key - Key name. - * @callback callback - * @param {error} err - Error Object - * @param {DATA} result - The previously stored data. - */ -GethApiDouble.prototype.db_getHex = function(dbName, key, callback) { - callback(null, "0x00"); -}; - - -/** - * Sends a whisper message. - * - * @param {DATA, 60 Bytes} from - (optional) The identity of the sender. - * @param {DATA, 60 Bytes} to - (optional) The identity of the receiver. When present whisper will encrypt the message so that only the receiver can decrypt it. - * @param {Array of DATA} topics - Array of DATA topics, for the receiver to identify messages. - * @param {DATA} payload - The payload of the message. - * @param {QUANTITY} priority - The integer of the priority in a range from ... (?). - * @param {QUANTITY} ttl - integer of the time to live in seconds. - * @callback callback - * @param {error} err - Error Object - * @param {Boolean} result - returns true if the message was sent, otherwise false. - */ -GethApiDouble.prototype.shh_post = function(from, to, topics, payload, priority, ttl, callback) { - callback(null, false); -}; - -/** - * Creates new whisper identity in the client. - * - * @callback callback - * @param {error} err - Error Object - * @param {DATA, 60 Bytes} result - the address of the new identiy. - */ -GethApiDouble.prototype.shh_newIdentity = function(callback) { - callback(null, '0x00'); -}; - -/** - * Checks if the client hold the private keys for a given identity. - * - * @param {DATA, 60 Bytes} address - The identity address to check. - * @callback callback - * @param {error} err - Error Object - * @param {Boolean} result - returns true if the client holds the privatekey for that identity, otherwise false. - */ -GethApiDouble.prototype.shh_hasIdentity = function(address, callback) { - callback(null, false); -}; - - -/** - * Creates a new group. - * - * @callback callback - * @param {error} err - Error Object - * @param {DATA, 60 Bytes} result - the address of the new group. - */ -GethApiDouble.prototype.shh_newGroup = function(callback) { - callback(null, '0x00'); -}; - -/** - * Adds a whisper identity to the group - * - * @param {DATA, 60 Bytes} - The identity address to add to a group. - * @callback callback - * @param {error} err - Error Object - * @param {Boolean} result - returns true if the identity was successfully added to the group, otherwise false. - */ -GethApiDouble.prototype.shh_addToGroup = function(address, callback) { - callback(null, false); -}; - - -/** - * Creates filter to notify, when client receives whisper message matching the filter options. - * - * @param {DATA, 60 Bytes} to - (optional) Identity of the receiver. When present it will try to decrypt any incoming message if the client holds the private key to this identity. - * @param {Array of DATA} topics - Array of DATA topics which the incoming message's topics should match. - * @callback callback - * @param {error} err - Error Object - * @param {Boolean} result - returns true if the identity was successfully added to the group, otherwise false. - */ -GethApiDouble.prototype.shh_newFilter = function(to, topics, callback) { - callback(null, false); -}; - -/** - * Uninstalls a filter with given id. Should always be called when watch is no longer needed. - * Additonally Filters timeout when they aren't requested with shh_getFilterChanges for a period of time. - * - * @param {QUANTITY} id - The filter id. Ex: "0x7" - * @callback callback - * @param {error} err - Error Object - * @param {Boolean} result - true if the filter was successfully uninstalled, otherwise false. - */ -GethApiDouble.prototype.shh_uninstallFilter = function(id, callback) { - callback(null, false); -}; - -/** - * Polling method for whisper filters. Returns new messages since the last call of this method. - * - * @param {QUANTITY} id - The filter id. Ex: "0x7" - * @callback callback - * @param {error} err - Error Object - * @param {Array} result - More Info: https://github.com/ethereum/wiki/wiki/JSON-RPC#shh_getfilterchanges - */ -GethApiDouble.prototype.shh_getFilterChanges = function(id, callback) { - callback(null, []); -}; - -/** - * Get all messages matching a filter. Unlike shh_getFilterChanges this returns all messages. - * - * @param {QUANTITY} id - The filter id. Ex: "0x7" - * @callback callback - * @param {error} err - Error Object - * @param {Array} result - See: shh_getFilterChanges - */ -GethApiDouble.prototype.shh_getMessages = function(id, callback) { - callback(null, false); -}; - - -module.exports = GethApiDouble; diff --git a/lib/subproviders/gethdefaults.js b/lib/subproviders/gethdefaults.js deleted file mode 100644 index 09e5756b7e..0000000000 --- a/lib/subproviders/gethdefaults.js +++ /dev/null @@ -1,36 +0,0 @@ -var Subprovider = require('web3-provider-engine/subproviders/subprovider.js'); -var inherits = require("util").inherits; - -inherits(GethDefaults, Subprovider); - -module.exports = GethDefaults; - -function GethDefaults() {}; - -// Massage eth_estimateGas requests, setting default data (e.g., from) if -// not specified. This is here specifically to make the testrpc -// react like Geth. -GethDefaults.prototype.handleRequest = function(payload, next, end) { - var self = this; - - if (payload.method != "eth_estimateGas" && payload.method != "eth_call") { - return next(); - } - - var params = payload.params[0]; - - if (params.from == null) { - this.emitPayload({ - method: "eth_coinbase" - }, function(err, result) { - if (err) return end(err); - - var coinbase = result.result; - - params.from = coinbase; - next(); - }); - } else { - next(); - } -}; diff --git a/lib/subproviders/reactiveblocktracker.js b/lib/subproviders/reactiveblocktracker.js deleted file mode 100644 index 0cb4b687e8..0000000000 --- a/lib/subproviders/reactiveblocktracker.js +++ /dev/null @@ -1,47 +0,0 @@ -var Subprovider = require('web3-provider-engine/subproviders/subprovider.js'); -var inherits = require("util").inherits; - -inherits(ReactiveBlockTracker, Subprovider); - -module.exports = ReactiveBlockTracker; - -function ReactiveBlockTracker() { - this.methods = { - "eth_call": "before", - "eth_getStorageAt": "before", - "eth_getLogs": "before" - }; -}; - -// Fetch the block before certain requests to make sure we're completely updated -// before those methods are processed. Also, fetch the block after certain requests -// to speed things up. -ReactiveBlockTracker.prototype.handleRequest = function(payload, next, end) { - var self = this; - - var when = this.methods[payload.method]; - - if (when == null) { - return next(); - } - - function fetchBlock(cb) { - self.engine.fetchBlock("latest", function(err, block) { - if (err) return end(err); - if (!self.engine.currentBlock || 0 !== self.engine.currentBlock.hash.compare(block.hash)) { - self.engine._setCurrentBlock(block); - } - cb(); - }); - } - - if (when == "before") { - fetchBlock(function() { - next(); - }); - } else { - next(function(error, result, cb) { - fetchBlock(cb); - }); - } -}; diff --git a/lib/subproviders/requestfunnel.js b/lib/subproviders/requestfunnel.js deleted file mode 100644 index 3022a8a3e9..0000000000 --- a/lib/subproviders/requestfunnel.js +++ /dev/null @@ -1,60 +0,0 @@ -var Subprovider = require('web3-provider-engine/subproviders/subprovider.js'); -var inherits = require("util").inherits; - -inherits(RequestFunnel, Subprovider); - -module.exports = RequestFunnel; - -// See if any payloads for the specified methods are marked as external. -// If they are external, and match the method list, process them one at -// a time. -function RequestFunnel() { - // We use an object here for O(1) lookups (speed). - this.methods = { - "eth_call": true, - "eth_getStorageAt": true, - "eth_sendTransaction": true, - "eth_sendRawTransaction": true, - - // Ensure block filter and filter changes are process one at a time - // as well so filter requests that come in after a transaction get - // processed once that transaction has finished processing. - "eth_newBlockFilter": true, - "eth_getFilterChanges": true, - "eth_getFilterLogs": true - }; - this.queue = []; - this.isWorking = false; -}; - -RequestFunnel.prototype.handleRequest = function(payload, next, end) { - if (payload.external != true || this.methods[payload.method] != true) { - return next(); - } - - this.queue.push([payload, next]); - - if (this.isWorking == false) { - this.processNext(); - } -}; - -RequestFunnel.prototype.processNext = function() { - var self = this; - - if (this.queue.length == 0) { - this.isWorking = false; - return; - } - - this.isWorking = true; - - var item = this.queue.shift(); - var payload = item[0]; - var next = item[1]; - - next(function(error, request, cb) { - cb(); - self.processNext(); - }); -}; diff --git a/lib/utils/block_helper.js b/lib/utils/block_helper.js deleted file mode 100644 index e7f99f746a..0000000000 --- a/lib/utils/block_helper.js +++ /dev/null @@ -1,35 +0,0 @@ -var to = require("./to"); -var txhelper = require("./txhelper") - -module.exports = { - toJSON: function(block, include_full_transactions) { - return { - number: to.rpcQuantityHexString(block.header.number), - hash: to.hex(block.hash()), - parentHash: to.hex(block.header.parentHash), //common.hash - mixHash: to.hex(block.header.mixHash), - nonce: to.rpcDataHexString(to.hex(block.header.nonce), 16), - sha3Uncles: to.hex(block.header.uncleHash), - logsBloom: to.hex(block.header.bloom), - transactionsRoot: to.hex(block.header.transactionsTrie), - stateRoot: to.hex(block.header.stateRoot), - receiptsRoot: to.hex(block.header.receiptTrie), - miner: to.hex(block.header.coinbase), - difficulty: to.rpcQuantityHexString(block.header.difficulty), - totalDifficulty: to.rpcQuantityHexString(block.header.difficulty), // TODO: Figure out what to do here. - extraData: to.rpcDataHexString(block.header.extraData), - size: to.hex(1000), // TODO: Do something better here - gasLimit: to.rpcQuantityHexString(block.header.gasLimit), - gasUsed: to.rpcQuantityHexString(block.header.gasUsed), - timestamp: to.rpcQuantityHexString(block.header.timestamp), - transactions: block.transactions.map(function(tx) { - if (include_full_transactions) { - return txhelper.toJSON(tx, block); - } else { - return to.hex(tx.hash()); - } - }), - uncles: []//block.uncleHeaders.map(function(uncleHash) {return to.hex(uncleHash)}) - } - } -} diff --git a/lib/utils/forkedblockchain.js b/lib/utils/forkedblockchain.js deleted file mode 100644 index 20ff259969..0000000000 --- a/lib/utils/forkedblockchain.js +++ /dev/null @@ -1,601 +0,0 @@ -var BlockchainDouble = require("../blockchain_double.js"); -var VM = require("ethereumjs-vm"); -var Account = require("ethereumjs-account"); -var Block = require("ethereumjs-block"); -var Log = require("./log.js"); -var Receipt = require("./receipt.js"); -var utils = require("ethereumjs-util"); -var ForkedStorageTrie = require("./forkedstoragetrie.js"); -var Web3 = require("web3"); -var to = require("./to.js"); -var async = require("async"); -var txhelper = require("./txhelper.js") -var BN = require("bn.js"); - -var inherits = require("util").inherits; - -inherits(ForkedBlockchain, BlockchainDouble); - -function ForkedBlockchain(options) { - var self = this; - - this.options = options || {} - - if (options.fork == null) { - throw new Error("ForkedBlockchain must be passed a fork parameter."); - } - - this.fork = options.fork; - this.fork_block_number = options.fork_block_number; - this.fork_version = null; - - if (typeof this.fork == "string") { - if (this.fork.indexOf("@") >= 0) { - var split = this.fork.split("@"); - this.fork = split[0]; - this.fork_block_number = parseInt(split[1]); - } - - this.fork = new Web3.providers.HttpProvider(this.fork); - } - - this.time = options.time; - this.storageTrieCache = {}; - - BlockchainDouble.call(this, options); - - this.web3 = new Web3(this.fork); -}; - -ForkedBlockchain.prototype.initialize = function(accounts, callback) { - var self = this; - - this.web3.eth.net.getId(function(err, version) { - if (err) return callback(err); - - self.fork_version = version; - - BlockchainDouble.prototype.initialize.call(self, accounts, function(err) { - if (err) return callback(err); - - // Unfortunately forking requires a bit of monkey patching, but it gets the job done. - self.vm.stateManager._lookupStorageTrie = self.lookupStorageTrie.bind(self); - self.vm.stateManager.cache._lookupAccount = self.getAccount.bind(self); - self.vm.stateManager.getContractCode = self.getCode.bind(self); - self.vm.stateManager.putContractCode = self.putCode.bind(self); - - callback(); - }); - }); -}; - -ForkedBlockchain.prototype.createStateTrie = function(db, root) { - return new ForkedStorageTrie(db, root, { - fork: this.fork, - fork_block_number: this.fork_block_number, - blockchain: this - }); -}; - -ForkedBlockchain.prototype.createGenesisBlock = function(callback) { - var self = this; - var blockNumber = this.fork_block_number || "latest"; - - self.web3.eth.getBlock(blockNumber, function(err, json) { - if (err) return callback(err); - - // If no start time was passed, set the time to where we forked from. - // We only want to do this if a block was explicitly passed. If a block - // number wasn't passed, then we're using the last block and the current time. - if (!self.time && self.fork_block_number) { - self.time = self.options.time = new Date(to.number(json.timestamp) * 1000); - self.setTime(self.time); - } - - blockNumber = to.hex(json.number); - - // Update the relevant block numbers - self.fork_block_number = self.options.fork_block_number = blockNumber; - self.stateTrie.fork_block_number = blockNumber; - - self.createBlock(function(err, block) { - if (err) return callback(err); - - block.header.number = utils.toBuffer(to.number(json.number) + 1); - block.header.parentHash = utils.toBuffer(json.hash); - - callback(null, block); - }); - }); -}; - -ForkedBlockchain.prototype.createForkedStorageTrie = function(address) { - address = to.hex(address); - - var trie = new ForkedStorageTrie(this.data.trie_db, null, { - address: address, - stateTrie: this.stateTrie, - blockchain: this, - fork: this.fork, - fork_block_number: this.fork_block_number - }); - - this.storageTrieCache[address] = trie; - - return trie; -}; - -ForkedBlockchain.prototype.lookupStorageTrie = function(address, callback) { - var self = this - - address = to.hex(address); - - if (this.storageTrieCache[address] != null) { - return callback(null, this.storageTrieCache[address]); - } - - callback(null, this.createForkedStorageTrie(address)); -}; - -ForkedBlockchain.prototype.isFallbackBlock = function(value, callback) { - var self = this; - - self.getEffectiveBlockNumber(value, function(err, number) { - if (err) return callback(err); - - callback(null, number <= to.number(self.fork_block_number)); - }); -}; - -ForkedBlockchain.prototype.isBlockHash = function(value) { - return typeof value == "string" && value.indexOf("0x") == 0 && value.length > 42; -} - -ForkedBlockchain.prototype.isFallbackBlockHash = function(value, callback) { - var self = this; - - if (!this.isBlockHash(value)) { - return callback(null, false); - } - - self.data.blockHashes.get(value, function(err, blockIndex) { - if (err) { - if (err.notFound) { - // If the block isn't found in our database, then it must be a fallback block. - return callback(null, true); - } else { - return callback(err); - } - } - callback(null, false); - }); -} - -ForkedBlockchain.prototype.getFallbackBlock = function(number_or_hash, cb) { - var self = this; - - // This function sometimes gets passed hex values that aren't long enough to - // be a block hash. In that case, let's convert them to a big number so Web3 - // doesn't get stopped up. - if (typeof number_or_hash == "string" && number_or_hash.length < 66) { - number_or_hash = self.web3.utils.toBN(number_or_hash) - } - - self.web3.eth.getBlock(number_or_hash, true, function(err, json) { - if (err) return cb(err); - - if (json == null) return cb(); - - var block = new Block(); - - block.header.parentHash = utils.toBuffer(json.parentHash); - block.header.uncleHash = utils.toBuffer(json.sha3Uncles); - block.header.coinbase = utils.toBuffer(json.miner); - block.header.stateRoot = utils.toBuffer(json.stateRoot); // Should we include the following three? - block.header.transactionTrie = utils.toBuffer(json.transactionsRoot); - block.header.receiptTrie = utils.toBuffer(json.receiptsRoot); - block.header.bloom = utils.toBuffer(json.logsBloom); - block.header.difficulty = utils.toBuffer("0x" + json.totalDifficulty.toString(16)); // BigNumber - block.header.number = utils.toBuffer(json.number); - block.header.gasLimit = utils.toBuffer(json.gasLimit); - block.header.gasUsed = utils.toBuffer(json.gasUsed); - block.header.timestamp = utils.toBuffer(json.timestamp); - block.header.extraData = utils.toBuffer(json.extraData); - - (json.transactions || []).forEach(function(tx_json, index) { - block.transactions.push(txhelper.fromJSON(tx_json)); - }); - - // Fake block. Let's do the worst. - // TODO: Attempt to fill out all block data so as to produce the same hash! (can we?) - block.hash = function() { - return utils.toBuffer(json.hash); - } - - cb(null, block); - }); -} - - -ForkedBlockchain.prototype.getBlock = function(number, callback) { - var self = this; - - this.isFallbackBlockHash(number, function(err, isFallbackBlockHash) { - if (err) return callback(err); - if (isFallbackBlockHash) { - return self.getFallbackBlock(number, callback); - } - - self.isFallbackBlock(number, function(err, isFallbackBlock) { - if (err) return callback(err); - - if (isFallbackBlock) { - return self.getFallbackBlock(number, callback); - } - - // If we don't have string-based a block hash, turn what we do have into a number - // before sending it to getBlock. - function getBlockReference(value, callback) { - if (!self.isBlockHash(value)) { - self.getRelativeBlockNumber(value, callback); - } else { - callback(null, value); - } - } - - getBlockReference(number, function(err, blockReference) { - if (err) return callback(err); - - BlockchainDouble.prototype.getBlock.call(self, blockReference, callback); - }); - }); - }); -}; - -ForkedBlockchain.prototype.getStorage = function(address, key, number, callback) { - this.lookupStorageTrie(address, function(err, trie) { - if (err) return callback(err); - trie.get(key, callback); - }); -}; - -ForkedBlockchain.prototype.getCode = function(address, number, callback) { - var self = this; - - if (typeof number == "function") { - callback = number; - number = "latest"; - } - - if (!number) { - number = "latest"; - } - - this.getEffectiveBlockNumber(number, function(err, effective) { - number = effective; - - self.stateTrie.keyExists(address, function(err, exists) { - // If we've stored the value and we're looking at one of our stored blocks, - // get it from our stored data. - if (exists && number > to.number(self.fork_block_number)) { - BlockchainDouble.prototype.getCode.call(self, address, number, callback); - } else { - - // Else, we need to fetch it from web3. If our number is greater than - // the fork, let's just use "latest". - if (number > to.number(self.fork_block_number)) { - number = "latest"; - } - - self.fetchCodeFromFallback(address, number, function(err, code) { - if (code) { - code = utils.toBuffer(code); - } - callback(err, code); - }); - } - }); - }); -}; - -ForkedBlockchain.prototype.putCode = function(address, value, callback) { - // This is a bit of a hack. We need to bypass the vm's - // _lookupAccount call that vm.stateManager.putContractCode() uses. - // This means we have to do some things ourself. The last call - // to self.stateTrie.put() at the bottom is important because - // we can't just be satisfied putting it in the cache. - - var self = this; - self.vm.stateManager.cache.flush(() => { - address = utils.toBuffer(address); - this.stateTrie.get(address, function(err, data) { - if (err) return callback(err); - - var account = new Account(data); - account.setCode(self.stateTrie, value, function(err, result) { - if (err) return callback(err); - - self.stateTrie.put(address, account.serialize(), function(err) { - if (err) return callback(err); - - // Ensure the cache updates as well. - self.vm.stateManager.putAccount(address, account, callback); - }); - }); - }) - }); -}; - -ForkedBlockchain.prototype.getAccount = function(address, number, callback) { - var self = this; - - if (typeof number == "function") { - callback = number; - number = "latest"; - } - - this.getEffectiveBlockNumber(number, function(err, effective) { - if (err) return callback(err); - number = effective; - - // If the account doesn't exist in our state trie, get it off the wire. - self.stateTrie.keyExists(address, function(err, exists) { - if (err) return callback(err); - - if (exists && number > to.number(self.fork_block_number)) { - BlockchainDouble.prototype.getAccount.call(self, address, number, function(err, acc) { - if (err) return callback(err); - callback(null, acc); - }); - } else { - self.fetchAccountFromFallback(address, number, callback); - } - }); - }); -}; - -ForkedBlockchain.prototype.getTransaction = function(hash, callback) { - var self = this; - BlockchainDouble.prototype.getTransaction.call(this, hash, function(err, tx) { - if (err) return callback(err); - if (tx != null) return callback(null, tx); - - self.web3.eth.getTransaction(hash, function(err, result) { - if (err) return callback(err); - - if (result) { - result = txhelper.fromJSON(result); - } - - callback(null, result); - }); - }); -}; - -ForkedBlockchain.prototype.getTransactionReceipt = function(hash, callback) { - var self = this; - BlockchainDouble.prototype.getTransactionReceipt.call(this, hash, function(err, receipt) { - if (err) return callback(err); - if (receipt) return callback(null, receipt); - - self.web3.eth.getTransactionReceipt(hash, function(err, receipt_json) { - if (err) return callback(err); - if (!receipt_json) return callback(); - - async.parallel({ - tx: self.getTransaction.bind(self, hash), - block: self.getBlock.bind(self, receipt_json.blockNumber) - }, function(err, result) { - if (err) return callback(err); - - var logs = receipt_json.logs.map(function(log) { - return new Log(log); - }); - var receipt = new Receipt(result.tx, result.block, logs, receipt_json.gasUsed, receipt_json.cumulativeGasUsed, - receipt_json.contractAddress, receipt_json.status, to.hex(receipt_json.logsBloom)); - - callback(null, receipt); - }); - }); - }); -}; - -ForkedBlockchain.prototype.fetchAccountFromFallback = function(address, block_number, callback) { - var self = this; - address = to.hex(address); - - async.parallel({ - code: this.fetchCodeFromFallback.bind(this, address, block_number), - balance: this.fetchBalanceFromFallback.bind(this, address, block_number), - nonce: this.fetchNonceFromFallback.bind(this, address, block_number) - }, function(err, results) { - if (err) return callback(err); - - var code = results.code; - var balance = results.balance; - var nonce = results.nonce; - - var account = new Account({ - nonce: nonce, - balance: balance - }); - - account.exists = code != "0x0" || balance != "0x0" || nonce != "0x0"; - - // This puts the code on the trie, keyed by the hash of the code. - // It does not actually link an account to code in the trie. - account.setCode(self.stateTrie, utils.toBuffer(code), function(err) { - if (err) return callback(err); - callback(null, account); - }); - }); -}; - -ForkedBlockchain.prototype.fetchCodeFromFallback = function(address, block_number, callback) { - var self = this; - address = to.hex(address); - - // Allow an optional block_number - if (typeof block_number == "function") { - callback = block_number; - block_number = this.fork_block_number; - } - - this.getSafeFallbackBlockNumber(block_number, function(err, safe_block_number) { - if (err) return callback(err); - - self.web3.eth.getCode(address, safe_block_number, function(err, code) { - if (err) return callback(err); - - code = "0x" + utils.toBuffer(code).toString("hex"); - callback(null, code); - }); - }); -} - -ForkedBlockchain.prototype.fetchBalanceFromFallback = function(address, block_number, callback) { - var self = this; - address = to.hex(address); - - // Allow an optional block_number - if (typeof block_number == "function") { - callback = block_number; - block_number = this.fork_block_number; - } - - this.getSafeFallbackBlockNumber(block_number, function(err, safe_block_number) { - if (err) return callback(err); - - self.web3.eth.getBalance(address, safe_block_number, function(err, balance) { - if (err) return callback(err); - - balance = "0x" + new BN(balance).toString(16); - callback(null, balance); - }); - }); -} - -ForkedBlockchain.prototype.fetchNonceFromFallback = function(address, block_number, callback) { - var self = this; - address = to.hex(address); - - // Allow an optional block_number - if (typeof block_number == "function") { - callback = block_number; - block_number = this.fork_block_number; - } - - this.getSafeFallbackBlockNumber(block_number, function(err, safe_block_number) { - if (err) return callback(err); - - self.web3.eth.getTransactionCount(address, safe_block_number, function(err, nonce) { - if (err) return callback(err); - - nonce = "0x" + self.web3.utils.toBN(nonce).toString(16); - callback(null, nonce); - }); - }); -} - -ForkedBlockchain.prototype.getHeight = function(callback) { - var self = this; - this.latestBlock(function(err, block) { - if (err) return callback(err); - callback(null, to.number(block.header.number)); - }); -}; - -ForkedBlockchain.prototype.getRelativeBlockNumber = function(number, callback) { - var self = this; - this.getEffectiveBlockNumber(number, function(err, effective) { - if (err) return callback(err); - callback(null, effective - to.number(self.fork_block_number) - 1) - }); -}; - -ForkedBlockchain.prototype.getSafeFallbackBlockNumber = function(block_number, callback) { - var fork_block_number = to.number(this.fork_block_number); - - if (block_number == null) { - return callback(null, fork_block_number); - }; - - this.getEffectiveBlockNumber(block_number, function(err, effective) { - if (effective > fork_block_number) { - effective = fork_block_number - } - - callback(null, effective); - }); -}; - -ForkedBlockchain.prototype.getBlockLogs = function(number, callback) { - var self = this; - - this.getEffectiveBlockNumber(number, function(err, effective) { - if (err) return callback(err); - - self.getRelativeBlockNumber(effective, function(err, relative) { - if (err) return callback(err); - - if (relative < 0) { - self.getBlock(number, function(err, block) { - if (err) return callback(err); - - self.web3.currentProvider.send({ - jsonrpc: "2.0", - method: "eth_getLogs", - params: [{ - fromBlock: to.hex(number), - toBlock: to.hex(number) - }], - id: new Date().getTime() - }, function(err, res) { - if (err) return callback(err); - - var logs = res.result.map(function(log) { - // To make this result masquerade as the right information. - log.block = block; - return new Log(log); - }); - - callback(null, logs); - }); - }); - } else { - BlockchainDouble.prototype.getBlockLogs.call(self, relative, callback); - } - }); - }); -}; - -ForkedBlockchain.prototype._checkpointTrie = function() { - var self = this; - - BlockchainDouble.prototype._checkpointTrie.call(this); - - Object.keys(this.storageTrieCache).forEach(function(address) { - var trie = self.storageTrieCache[address]; - trie.customCheckpoint(); - }); -}; - -ForkedBlockchain.prototype._revertTrie = function() { - var self = this; - - BlockchainDouble.prototype._revertTrie.call(this); - - Object.keys(this.storageTrieCache).forEach(function(address) { - var trie = self.storageTrieCache[address]; - - // We're trying to revert to a point before this trie was created. - // Let's just remove the trie. - if (trie.checkpoints.length == 0) { - delete self.storageTrieCache[address]; - } else { - trie.customRevert(); - } - }); -}; - -module.exports = ForkedBlockchain; diff --git a/lib/utils/forkedstoragetrie.js b/lib/utils/forkedstoragetrie.js deleted file mode 100644 index 7d22d1b962..0000000000 --- a/lib/utils/forkedstoragetrie.js +++ /dev/null @@ -1,96 +0,0 @@ -var MerklePatriciaTree = require("merkle-patricia-tree"); -var Account = require("ethereumjs-account"); -var utils = require('ethereumjs-util') -var inherits = require("util").inherits; -var Web3 = require("web3"); -var to = require("./to.js"); -var async = require("async"); - -inherits(ForkedStorageTrie, MerklePatriciaTree) - -function ForkedStorageTrie(db, root, options) { - MerklePatriciaTree.call(this, db, root); - - this.address = options.address; - - this.fork = options.fork; - this.fork_block_number = options.fork_block_number; - - this.blockchain = options.blockchain; - - this.web3 = new Web3(); - this.web3.setProvider(this.fork); - - this.checkpoints = []; -} - -ForkedStorageTrie.prototype.keyExists = function(key, callback) { - key = utils.toBuffer(key); - - this.findPath(key, function (err, node, remainder, stack) { - var exists = false; - if (node && remainder.length === 0) { - exists = true; - } - callback(err, exists) - }) -}; - -// Note: This overrides a standard method whereas the other methods do not. -ForkedStorageTrie.prototype.get = function(key, block_number, callback) { - var self = this; - - // Allow an optional block_number - if (typeof block_number == "function") { - callback = block_number; - block_number = self.fork_block_number; - } - - // For geth; https://github.com/ethereumjs/ethereumjs-util/issues/79 - block_number = to.rpcQuantityHexString(block_number); - - key = utils.toBuffer(key); - - // If the account doesn't exist in our state trie, get it off the wire. - this.keyExists(key, function(err, exists) { - if (err) return callback(err); - - if (exists) { - MerklePatriciaTree.prototype.get.call(self, key, function(err, r) { - callback(err, r); - }); - } else { - // If this is the main trie, get the whole account. - if (self.address == null) { - self.blockchain.fetchAccountFromFallback(key, block_number, function(err, account) { - if (err) return callback(err); - - callback(null, account.serialize()); - }); - } else { - self.web3.eth.getStorageAt(to.hex(self.address), to.hex(key), block_number, function(err, value) { - if (err) return callback(err); - - value = utils.toBuffer(value); - value = utils.rlp.encode(value); - - callback(null, value); - }); - } - } - }); -}; - -// I don't want checkpoints to be removed by commits. -// Note: For some reason, naming this function checkpoint() -// -- overriding the default function -- prevents it from -// being called. -ForkedStorageTrie.prototype.customCheckpoint = function() { - this.checkpoints.push(this.root); -}; - -ForkedStorageTrie.prototype.customRevert = function() { - this.root = this.checkpoints.pop(); -}; - -module.exports = ForkedStorageTrie; diff --git a/lib/utils/log.js b/lib/utils/log.js deleted file mode 100644 index d1f803d32e..0000000000 --- a/lib/utils/log.js +++ /dev/null @@ -1,38 +0,0 @@ -var to = require("./to.js"); - -// Expects: -// -// logIndex: ... -// transactionIndex: ... -// transactionHash: ... -// block: ... -// address: ... -// data: ... -// topics: ... -// type: ... - -function Log(data) { - var self = this; - Object.keys(data).forEach(function(key) { - self[key] = data[key]; - }); -} - -Log.prototype.toJSON = function() { - // RPC quantity values like this.transactionIndex can be set to "0x00", - // use the explicit rpcQuantityHexString to properly format the JSON, removing leading zeroes. - // See RPC log format spec: https://github.com/ethereum/wiki/wiki/JSON-RPC - return { - logIndex: to.rpcQuantityHexString(this.logIndex), - transactionIndex: to.rpcQuantityHexString(this.transactionIndex), - transactionHash: to.rpcDataHexString(this.transactionHash), - blockHash: to.rpcDataHexString(this.block.hash()), - blockNumber: to.rpcQuantityHexString(this.block.header.number), - address: to.rpcDataHexString(this.address), - data: to.rpcDataHexString(this.data), - topics: this.topics, - type: "mined" - }; -}; - -module.exports = Log; diff --git a/lib/utils/random.js b/lib/utils/random.js deleted file mode 100644 index 893c81ebbc..0000000000 --- a/lib/utils/random.js +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = { - // Mimics crypto.random bytes, but takes in a random number generator - // as its second parameter. rng is expected to be a function that takes - // no parameters and returns a result like Math.random(). - // This is important because it allows for a seeded random number generator. - // Since this is a mock RPC library, the rng doesn't need to be cryptographically secure. - randomBytes: function(length, rng) { - var buf = []; - - for (var i = 0; i < length; i++) { - buf.push(rng()*255); - } - - return Buffer.from(buf); - }, - - randomAlphaNumericString: function(length, rng) { - const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - - let text = ''; - - for (var i = 0; i < length; i++) { - text += alphabet.charAt(Math.floor((rng || Math.random)() * alphabet.length)); - } - - return text; - } - -} diff --git a/lib/utils/receipt.js b/lib/utils/receipt.js deleted file mode 100644 index 47061e3492..0000000000 --- a/lib/utils/receipt.js +++ /dev/null @@ -1,46 +0,0 @@ -var to = require("./to"); - -function Receipt(tx, block, logs, gasUsed, cumulativeGasUsed, contractAddress, status, logsBloom) { - this.tx = tx; - this.block = block; - this.logs = logs; - this.gasUsed = gasUsed; - this.cumulativeGasUsed = cumulativeGasUsed; - this.contractAddress = contractAddress; - this.status = status; - this.logsBloom = logsBloom; - - - this.transactionIndex = 0; - - for (var i = 0; i < block.transactions.length; i++) { - var current = block.transactions[i]; - if (current.hash().equals(tx.hash())) { - this.transactionIndex = i; - break; - } - } -} - -Receipt.prototype.toJSON = function() { - if (this.data != null) return data; - - // Enforce Hex formatting as defined in the RPC spec. - return { - transactionHash: to.rpcDataHexString(this.tx.hash()), - transactionIndex: to.rpcQuantityHexString(this.transactionIndex), - blockHash: to.rpcDataHexString(this.block.hash()), - blockNumber: to.rpcQuantityHexString(this.block.header.number), - gasUsed: to.rpcQuantityHexString(this.gasUsed), - cumulativeGasUsed: to.rpcQuantityHexString(this.cumulativeGasUsed), - contractAddress: this.contractAddress != null ? to.rpcDataHexString(this.contractAddress) : null, - logs: this.logs.map(function(log) {return log.toJSON()}), - status: to.rpcQuantityHexString(this.status), - logsBloom: to.rpcDataHexString(this.logsBloom), - v: to.rpcDataHexString(this.tx.v), - r: to.rpcDataHexString(this.tx.r), - s: to.rpcDataHexString(this.tx.s) - } -}; - -module.exports = Receipt; diff --git a/lib/utils/runtimeerror.js b/lib/utils/runtimeerror.js deleted file mode 100644 index 1ebbef303c..0000000000 --- a/lib/utils/runtimeerror.js +++ /dev/null @@ -1,100 +0,0 @@ -var inherits = require("util").inherits; -var to = require("./to"); -var abi = require("ethereumjs-abi"); - -inherits(RuntimeError, Error); - -// Note: ethereumjs-vm will return an object that has a "results" and "receipts" keys. -// You should pass in the whole object. -function RuntimeError(transactions, vm_output) { - - // Why not just Error.apply(this, [message])? See - // https://gist.github.com/justmoon/15511f92e5216fa2624b#anti-patterns - Error.captureStackTrace(this, this.constructor) - this.name = this.constructor.name; - - this.results = {}; - this.hashes = []; - - // handles creating this.message - this.combine(transactions, vm_output); -}; - -RuntimeError.prototype.combine = function(transactions, vm_output) { - // Can be combined with vm_output or another RuntimeError. - if (transactions instanceof RuntimeError) { - var err = transactions; - var keys = Object.keys(err.results); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - this.results[key] = err.results[key]; - Array.prototype.push.apply(this.hashes, err.hashes); - } - } else { - var results = vm_output.results; - - for (var i = 0; i < transactions.length; i++) { - var tx = transactions[i]; - var result = results[i]; - - // 1 means no error, oddly. - if (result.vm.exception != 1) { - var hash = to.hex(tx.hash()); - - this.hashes.push(hash); - var reason = undefined; - var returnData = result.vm.return; - if (returnData && returnData.slice(0, 4).toString("hex") === "08c379a0") { - reason = abi.rawDecode(["string"], returnData.slice(4))[0]; - } - - this.results[hash] = { - error: result.vm.exceptionError.error || result.vm.exceptionError, - program_counter: result.vm.runState.programCounter, - return: to.hex(result.vm.return), - reason: reason - }; - } - } - } - - // Once combined, set the message - if (this.hashes.length == 1) { - var exceptionResult = this.results[this.hashes[0]]; - var message = "VM Exception while processing transaction: " + exceptionResult.error; - if (exceptionResult.reason) { - message += " " + exceptionResult.reason; - } - this.message = message; - } else { - var message = "Multiple VM Exceptions while processing transactions: \n\n"; - - for (var i = 0; i < this.hashes.length; i++) { - var hash = this.hashes[i]; - var exceptionResult = this.results[hash]; - message += hash + ": " + exceptionResult.error; - if (exceptionResult.reason) { - message += " " + exceptionResult.reason; - } - message += "\n"; - } - this.message = message; - } -}; - -RuntimeError.prototype.count = function() { - return Object.keys(this.results).length; -}; - -RuntimeError.fromResults = function(transactions, vm_output) { - var err = new RuntimeError(transactions, vm_output); - - if (err.count() == 0) { - return null; - } - - return err; -}; - -module.exports = RuntimeError; diff --git a/lib/utils/to.js b/lib/utils/to.js deleted file mode 100644 index 1861795def..0000000000 --- a/lib/utils/to.js +++ /dev/null @@ -1,80 +0,0 @@ -var utils = require("ethereumjs-util"); - -module.exports = { - // Note: Do not use to.hex() when you really mean utils.addHexPrefix(). - hex: function(val) { - if (typeof val == "string") { - if (val.indexOf("0x") == 0) { - return val; - } else { - val = new utils.BN(val); - } - } - - if (typeof val == "boolean") { - val = val ? 1 : 0; - } - - if (typeof val == "number") { - val = utils.intToHex(val); - } - - // Support Buffer, BigInteger and BN library - // Hint: BN is used in ethereumjs - if (typeof val == "object") { - val = val.toString("hex"); - } - - return utils.addHexPrefix(val); - }, - - rpcQuantityHexString: function(val) { - val = this.hex(val); - val = "0x" + val.replace("0x", "").replace(/^0+/, ""); - - if (val == "0x") { - val = "0x0"; - } - - return val; - }, - - rpcDataHexString: function(val, length) { - if(typeof(length) == "number") { - val = this.hex(val).replace("0x", ""); - - val = new Array(length-val.length).fill("0").join("") + val; - } else { - if(val.length == 0) { - return "0x"; - } - val = this.hex(val).replace("0x", ""); - - if(val.length % 2 != 0) { - val = "0" + val; - } - } - return "0x" + val; - }, - - hexWithZeroPadding: function(val) { - val = this.hex(val); - const digits = val.replace("0x", ""); - if (digits.length & 0x1) { - return "0x0" + digits; - } - return val; - }, - - number: function(val) { - if (typeof val == "number") { - return val; - } - if (typeof val == "string") { - if (val.indexOf('0x') != 0) { - return parseInt(val) - } - } - return utils.bufferToInt(utils.toBuffer(val)); - } -}; diff --git a/lib/utils/txhelper.js b/lib/utils/txhelper.js deleted file mode 100644 index b90d6272de..0000000000 --- a/lib/utils/txhelper.js +++ /dev/null @@ -1,68 +0,0 @@ -var to = require("./to"); -var FakeTransaction = require('ethereumjs-tx/fake.js'); -var utils = require("ethereumjs-util"); - -module.exports = { - toJSON: function(tx, block) { - var transactionIndex = 0 - for (var i = 0; i < block.transactions.length; i++) { - var current = block.transactions[i]; - if (current.hash().equals(tx.hash())) { - transactionIndex = i; - break; - } - } - var resultJSON = { - hash: to.rpcDataHexString(tx.hash()), - nonce: to.rpcQuantityHexString(tx.nonce), - blockHash: to.rpcDataHexString(block.hash()), - blockNumber: to.rpcQuantityHexString(block.header.number), - transactionIndex: to.rpcQuantityHexString(transactionIndex), - from: to.rpcDataHexString(tx.from), - to: to.rpcDataHexString(tx.to), - value: to.rpcQuantityHexString(tx.value), - gas: to.rpcQuantityHexString(tx.gasLimit), - gasPrice: to.rpcQuantityHexString(tx.gasPrice), - input: to.rpcDataHexString(tx.data), - }; - - if (tx.v && tx.v.length > 0 && - tx.r && tx.r.length > 0 && - tx.s && tx.s.length > 0) { - resultJSON.v = to.hex(tx.v); - resultJSON.r = to.hex(tx.r); - resultJSON.s = to.hex(tx.s); - } - - return resultJSON; - }, - - fromJSON: function(json) { - var tx = new FakeTransaction({ - nonce: utils.toBuffer(to.hex(json.nonce)), - from: utils.toBuffer(to.hex(json.from)), - value: utils.toBuffer(to.hex(json.value)), - gasLimit: utils.toBuffer(to.hex(json.gas)), - gasPrice: utils.toBuffer(to.hex(json.gasPrice)), - data: utils.toBuffer(to.hex(json.input)) - }); - - if (json.v && json.v.length > 0 && - json.r && json.r.length > 0 && - json.s && json.s.length > 0) { - tx.v = utils.toBuffer(to.hex(json.v)); - tx.r = utils.toBuffer(to.hex(json.r)); - tx.s = utils.toBuffer(to.hex(json.s)); - } - - if (json.to) { - // Remove all padding and make it easily comparible. - var buf = utils.toBuffer(to.hex(json.to)); - if (!buf.equals(utils.toBuffer('0x0'))) { - tx.to = utils.setLengthLeft(buf, 20); - } - } - - return tx; - } -}; diff --git a/lib/utils/txrejectederror.js b/lib/utils/txrejectederror.js deleted file mode 100644 index 270b20c081..0000000000 --- a/lib/utils/txrejectederror.js +++ /dev/null @@ -1,15 +0,0 @@ -var inherits = require("util").inherits; - -// raised when the transaction is rejected prior to running it in the EVM. -function TXRejectedError(message) { - - // Why not just Error.apply(this, [message])? See - // https://gist.github.com/justmoon/15511f92e5216fa2624b#anti-patterns - Error.captureStackTrace(this, this.constructor) - this.name = this.constructor.name; - this.message = message; -}; - -inherits(TXRejectedError, Error); - -module.exports = TXRejectedError; diff --git a/lib/webSocketServer.js b/lib/webSocketServer.js deleted file mode 100644 index 17813eaa1b..0000000000 --- a/lib/webSocketServer.js +++ /dev/null @@ -1,130 +0,0 @@ -var WebSocketServer = require('websocket').server; -var to = require("./utils/to.js"); - -module.exports = function (httpServer, provider, logger) { - var connectionManager = new ConnectionManager(provider, logger); - - var wsServer = new WebSocketServer({ - httpServer: httpServer, - autoAcceptConnections: true, - }); - - wsServer.on('connect', connectionManager.manageConnection); - - return wsServer; -}; - - -function ConnectionManager(provider, logger) { - const self = this; - self.provider = provider; - self.logger = logger; - self.connectionsBySubscriptionId = {} - self.connections = {}; - self.connectionCounter = 0; - - self._updateSubscriptions = self._updateSubscriptions.bind(self) - self.manageConnection = self.manageConnection.bind(self); - self._logPayload = self._logPayload.bind(self); - self._handleRequest = self._handleRequest.bind(self); - - provider.on('data', function (err, notification) { - self._updateSubscriptions.call(self, notification); - }); -} - - -ConnectionManager.prototype.manageConnection = function (connection) { - const self = this; - connection.id = ++self.connectionCounter; - self.connections[ connection.id ] = { - connection: connection, - subscriptions: {} - }; - - connection.on('message', function (message) { - try { - var payload = JSON.parse(message.utf8Data); - } catch (e) { - connection.reject(400, 'Bad Request'); - } - - self._logPayload(payload); - self._handleRequest(connection, payload); - }); - - connection.on('close', function () { - console.log(`handling connection close: id ${connection.id}`) - // remove subscriptions - Object.keys(self.connections[connection.id].subscriptions).forEach((subscriptionId) => { - self.provider.send({ - jsonrpc: "2.0", - method: "eth_unsubscribe", - params: [subscriptionId], - id: new Date().getTime() - }, function(err, result) { - delete self.connectionsBySubscriptionId[subscriptionId]; - }); - }); - - delete self.connections[ connection.id ]; - }); - - console.log(`opened connection: id ${connection.id}`) -}; - - -ConnectionManager.prototype._handleRequest = function (connection, payload) { - const self = this; - - // handle subscription requests, otherwise delegate to provider - switch (payload.method) { - case 'eth_subscribe': - self.provider.send(payload, function (err, result) { - if (!err && result.result) { - self.connections[connection.id].subscriptions[result.result] = true; - self.connectionsBySubscriptionId[result.result] = self.connections[connection.id]; - } - connection.send(JSON.stringify(result)); - }); - break; - case 'eth_unsubscribe': - console.log(`handling unsubscribe: id ${connection.id}, ${payload.params[0]}`) - self.provider.send(payload, function (err, result) { - if (err || result.error) { - if (connection && connection.send) { - connection.send(JSON.stringify(result)) - } - return - } - - delete self.connections[connection.id].subscriptions[payload.params[0]] - delete self.connectionsBySubscriptionId[payload.params[0]]; - - connection.send(JSON.stringify(result)); - }); - break; - default: - self.provider.send(payload, function (err, result) { - connection.send(JSON.stringify(result)); - }); - } -}; - -// Log messages that come into the TestRPC via http -ConnectionManager.prototype._logPayload = function (payload) { - const self = this; - if (payload instanceof Array) { - // Batch request - for (var i = 0; i < payload.length; i++) { - var item = payload[ i ]; - self.logger.log(item.method); - } - } else { - self.logger.log(payload.method); - } -}; - -ConnectionManager.prototype._updateSubscriptions = function (notification) { - this.connectionsBySubscriptionId[notification.params.subscription].connection.send(JSON.stringify(notification)); -}; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 73d33730a5..b2abc0e357 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4,8863 +4,399 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@webassemblyjs/ast": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.5.13.tgz", - "integrity": "sha512-49nwvW/Hx9i+OYHg+mRhKZfAlqThr11Dqz8TsrvqGKMhdI2ijy3KBJOun2Z4770TPjrIJhR6KxChQIDaz8clDA==", - "dev": true, - "requires": { - "@webassemblyjs/helper-module-context": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/wast-parser": "1.5.13", - "debug": "^3.1.0", - "mamacro": "^0.0.3" - } + "@types/chai": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz", + "integrity": "sha512-CBk7KTZt3FhPsEkYioG6kuCIpWISw+YI8o+3op4+NXwTpvAPxE1ES8+PY8zfaK2L98b1z5oq03UHa4VYpeUxnw==", + "dev": true }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.5.13.tgz", - "integrity": "sha512-vrvvB18Kh4uyghSKb0NTv+2WZx871WL2NzwMj61jcq2bXkyhRC+8Q0oD7JGVf0+5i/fKQYQSBCNMMsDMRVAMqA==", + "@types/mocha": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", + "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", "dev": true }, - "@webassemblyjs/helper-api-error": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.5.13.tgz", - "integrity": "sha512-dBh2CWYqjaDlvMmRP/kudxpdh30uXjIbpkLj9HQe+qtYlwvYjPRjdQXrq1cTAAOUSMTtzqbXIxEdEZmyKfcwsg==", + "@types/node": { + "version": "10.12.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.0.tgz", + "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==", "dev": true }, - "@webassemblyjs/helper-buffer": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.5.13.tgz", - "integrity": "sha512-v7igWf1mHcpJNbn4m7e77XOAWXCDT76Xe7Is1VQFXc4K5jRcFrl9D0NrqM4XifQ0bXiuTSkTKMYqDxu5MhNljA==", - "dev": true, - "requires": { - "debug": "^3.1.0" - } + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, - "@webassemblyjs/helper-code-frame": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.5.13.tgz", - "integrity": "sha512-yN6ScQQDFCiAXnVctdVO/J5NQRbwyTbQzsGzEgXsAnrxhjp0xihh+nNHQTMrq5UhOqTb5LykpJAvEv9AT0jnAQ==", + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "@webassemblyjs/wast-printer": "1.5.13" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "@webassemblyjs/helper-fsm": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.5.13.tgz", - "integrity": "sha512-hSIKzbXjVMRvy3Jzhgu+vDd/aswJ+UMEnLRCkZDdknZO3Z9e6rp1DAs0tdLItjCFqkz9+0BeOPK/mk3eYvVzZg==", + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "@webassemblyjs/helper-module-context": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.5.13.tgz", - "integrity": "sha512-zxJXULGPLB7r+k+wIlvGlXpT4CYppRz8fLUM/xobGHc9Z3T6qlmJD9ySJ2jknuktuuiR9AjnNpKYDECyaiX+QQ==", - "dev": true, - "requires": { - "debug": "^3.1.0", - "mamacro": "^0.0.3" - } + "chnl": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/chnl/-/chnl-0.4.1.tgz", + "integrity": "sha512-74sahZgoyc266kwg3OZv1O1aaaGjGAOPx4J2crt5lm+Dmo8o0b0D+tHdF60EQSmym77FFPKMRZnIPb3vAKT5Mw==" }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.5.13.tgz", - "integrity": "sha512-0n3SoNGLvbJIZPhtMFq0XmmnA/YmQBXaZKQZcW8maGKwLpVcgjNrxpFZHEOLKjXJYVN5Il8vSfG7nRX50Zn+aw==", + "commander": { + "version": "2.15.1", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.5.13.tgz", - "integrity": "sha512-IJ/goicOZ5TT1axZFSnlAtz4m8KEjYr12BNOANAwGFPKXM4byEDaMNXYowHMG0yKV9a397eU/NlibFaLwr1fbw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-buffer": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/wasm-gen": "1.5.13", - "debug": "^3.1.0" - } + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, - "@webassemblyjs/ieee754": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.5.13.tgz", - "integrity": "sha512-TseswvXEPpG5TCBKoLx9tT7+/GMACjC1ruo09j46ULRZWYm8XHpDWaosOjTnI7kr4SRJFzA6MWoUkAB+YCGKKg==", + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { - "ieee754": "^1.1.11" + "ms": "2.0.0" } }, - "@webassemblyjs/leb128": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.5.13.tgz", - "integrity": "sha512-0NRMxrL+GG3eISGZBmLBLAVjphbN8Si15s7jzThaw1UE9e5BY1oH49/+MA1xBzxpf1OW5sf9OrPDOclk9wj2yg==", - "dev": true, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "requires": { - "long": "4.0.0" - }, - "dependencies": { - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", - "dev": true - } + "object-keys": "^1.0.12" } }, - "@webassemblyjs/utf8": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.5.13.tgz", - "integrity": "sha512-Ve1ilU2N48Ew0lVGB8FqY7V7hXjaC4+PeZM+vDYxEd+R2iQ0q+Wb3Rw8v0Ri0+rxhoz6gVGsnQNb4FjRiEH/Ng==", + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "@webassemblyjs/wasm-edit": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.5.13.tgz", - "integrity": "sha512-X7ZNW4+Hga4f2NmqENnHke2V/mGYK/xnybJSIXImt1ulxbCOEs/A+ZK/Km2jgihjyVxp/0z0hwIcxC6PrkWtgw==", - "dev": true, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-buffer": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/helper-wasm-section": "1.5.13", - "@webassemblyjs/wasm-gen": "1.5.13", - "@webassemblyjs/wasm-opt": "1.5.13", - "@webassemblyjs/wasm-parser": "1.5.13", - "@webassemblyjs/wast-printer": "1.5.13", - "debug": "^3.1.0" + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" } }, - "@webassemblyjs/wasm-gen": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.5.13.tgz", - "integrity": "sha512-yfv94Se8R73zmr8GAYzezFHc3lDwE/lBXQddSiIZEKZFuqy7yWtm3KMwA1uGbv5G1WphimJxboXHR80IgX1hQA==", - "dev": true, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/ieee754": "1.5.13", - "@webassemblyjs/leb128": "1.5.13", - "@webassemblyjs/utf8": "1.5.13" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" } }, - "@webassemblyjs/wasm-opt": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.5.13.tgz", - "integrity": "sha512-IkXSkgzVhQ0QYAdIayuCWMmXSYx0dHGU8Ah/AxJf1gBvstMWVnzJnBwLsXLyD87VSBIcsqkmZ28dVb0mOC3oBg==", + "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=", + "dev": true + }, + "flat-options": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/flat-options/-/flat-options-0.1.3.tgz", + "integrity": "sha512-z1vH9mb4ly55dWUZZFUeLNqhFWhwSQNngHpK8RQOhFuNw/sWcNDZhkHl3GS1YTHiYxB5qvcbSRbH7X6ThzX9UA==" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-buffer": "1.5.13", - "@webassemblyjs/wasm-gen": "1.5.13", - "@webassemblyjs/wasm-parser": "1.5.13", - "debug": "^3.1.0" + "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" } }, - "@webassemblyjs/wasm-parser": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.5.13.tgz", - "integrity": "sha512-XnYoIcu2iqq8/LrtmdnN3T+bRjqYFjRHqWbqK3osD/0r/Fcv4d9ecRzjVtC29ENEuNTK4mQ9yyxCBCbK8S/cpg==", - "dev": true, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-api-error": "1.5.13", - "@webassemblyjs/helper-wasm-bytecode": "1.5.13", - "@webassemblyjs/ieee754": "1.5.13", - "@webassemblyjs/leb128": "1.5.13", - "@webassemblyjs/utf8": "1.5.13" + "function-bind": "^1.1.1" } }, - "@webassemblyjs/wast-parser": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.5.13.tgz", - "integrity": "sha512-Lbz65T0LQ1LgzKiUytl34CwuhMNhaCLgrh0JW4rJBN6INnBB8NMwUfQM+FxTnLY9qJ+lHJL/gCM5xYhB9oWi4A==", + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/floating-point-hex-parser": "1.5.13", - "@webassemblyjs/helper-api-error": "1.5.13", - "@webassemblyjs/helper-code-frame": "1.5.13", - "@webassemblyjs/helper-fsm": "1.5.13", - "long": "^3.2.0", - "mamacro": "^0.0.3" + "once": "^1.3.0", + "wrappy": "1" } }, - "@webassemblyjs/wast-printer": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.5.13.tgz", - "integrity": "sha512-QcwogrdqcBh8Z+eUF8SG+ag5iwQSXxQJELBEHmLkk790wgQgnIMmntT2sMAMw53GiFNckArf5X0bsCA44j3lWQ==", - "dev": true, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/wast-parser": "1.5.13", - "long": "^3.2.0" + "has": "^1.0.1" } }, - "abstract-leveldown": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz", - "integrity": "sha512-KUWx9UWGQD12zsmLNj64/pndaz4iJh/Pj7nopgkfDG6RlCcbMZvT6+9l7dchK4idog2Is8VdC/PvNbFuFmalIQ==", + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", "requires": { - "xtend": "~4.0.0" + "has-symbols": "^1.0.0" } }, - "accepts": { + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "make-error": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "mime-types": "~2.1.18", - "negotiator": "0.6.1" + "brace-expansion": "^1.1.7" } }, - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, - "acorn-dynamic-import": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", - "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { - "acorn": "^5.0.0" + "minimist": "0.0.8" } }, - "aes-js": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.1.tgz", - "integrity": "sha512-cEA0gBelItZZV7iBiL8ApCiNgc+gBWJJ4uoORhbu6vOqAJ0UL9wIlxr4RI7ij9SSVzy6AnPwiu37kVYiHCl3nw==", + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", "dev": true, - "optional": true - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" } }, - "ajv-keywords": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", - "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", - "dev": true - }, - "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + "nan": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", + "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", - "dev": true + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" + "wrappy": "1" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "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=", "dev": true }, - "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==", - "dev": true + "promise-controller": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/promise-controller/-/promise-controller-0.3.0.tgz", + "integrity": "sha512-w1RTaOwD5bNtYjIj5L8+ruDtMgnKC0pLtOogA3kcS4LRtiwLOpAdokjYbkjJMa6AGV0oasHa8RRNa8qEpG1qyw==" }, - "arr-union": { + "promise.prototype.finally": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "resolved": "https://registry.npmjs.org/promise.prototype.finally/-/promise.prototype.finally-3.1.0.tgz", + "integrity": "sha512-7p/K2f6dI+dM8yjRQEGrTQs5hTQixUAdOGpMEA3+pVxpX5oHKRSKAXyLw9Q9HUWDTdwtoo39dSHGQtN90HcEwQ==", "requires": { - "safer-buffer": "~2.1.0" + "define-properties": "^1.1.2", + "es-abstract": "^1.9.0", + "function-bind": "^1.1.1" } }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", "dev": true, "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "util": "0.10.3" + "has-flag": "^3.0.0" } }, - "assert-match": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/assert-match/-/assert-match-1.1.1.tgz", - "integrity": "sha512-c0QY2kpYVrH/jis6cCq9Mnt4/bIdGALDh1N8HY9ZARZedsMs5LSbgywxkjd5A1uNVLN0L8evANxBPxKiabVoZw==", + "ts-node": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", + "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", "dev": true, "requires": { - "assert": "^1.4.1", - "babel-runtime": "^6.23.0", - "es-to-primitive": "^1.1.1", - "lodash.merge": "^4.6.0" + "arrify": "^1.0.0", + "buffer-from": "^1.1.0", + "diff": "^3.1.0", + "make-error": "^1.1.1", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "source-map-support": "^0.5.6", + "yn": "^2.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } } }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "requires": { - "lodash": "^4.17.10" - } - }, - "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", - "dev": true - }, - "async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "requires": { - "async": "^2.4.0" - } - }, - "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } - }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" - } - } - }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", - "requires": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", - "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", - "requires": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=" - }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=" - }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=" - }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", - "requires": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", - "requires": { - "babel-helper-define-map": "^6.24.1", - "babel-helper-function-name": "^6.24.1", - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-helper-replace-supers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", - "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } - }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", - "requires": { - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "requires": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - } - }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", - "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", - "requires": { - "regenerator-transform": "^0.10.0" - } - }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-preset-env": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", - "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", - "requires": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-syntax-trailing-function-commas": "^6.22.0", - "babel-plugin-transform-async-to-generator": "^6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.23.0", - "babel-plugin-transform-es2015-classes": "^6.23.0", - "babel-plugin-transform-es2015-computed-properties": "^6.22.0", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", - "babel-plugin-transform-es2015-for-of": "^6.23.0", - "babel-plugin-transform-es2015-function-name": "^6.22.0", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-umd": "^6.23.0", - "babel-plugin-transform-es2015-object-super": "^6.22.0", - "babel-plugin-transform-es2015-parameters": "^6.23.0", - "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", - "babel-plugin-transform-exponentiation-operator": "^6.22.0", - "babel-plugin-transform-regenerator": "^6.22.0", - "browserslist": "^3.2.6", - "invariant": "^2.2.2", - "semver": "^5.3.0" - } - }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", - "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" - }, - "dependencies": { - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "requires": { - "source-map": "^0.5.6" - } - } - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babelify": { - "version": "7.3.0", - "resolved": "http://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", - "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", - "requires": { - "babel-core": "^6.0.14", - "object-assign": "^4.0.0" - }, - "dependencies": { - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - } - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" - }, - "backoff": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", - "integrity": "sha1-9hbtqdPktmuMp/ynn2lXIsX44m8=", - "requires": { - "precond": "0.2" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "base-x": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", - "integrity": "sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "base64-js": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", - "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", - "dev": true - }, - "binary-extensions": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", - "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", - "dev": true - }, - "bindings": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", - "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" - }, - "bip39": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-2.5.0.tgz", - "integrity": "sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA==", - "requires": { - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1", - "safe-buffer": "^5.0.1", - "unorm": "^1.3.3" - } - }, - "bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "bl": { - "version": "1.2.2", - "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", - "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", - "dev": true, - "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "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=", - "dev": true, - "optional": true, - "requires": { - "inherits": "~2.0.0" - } - }, - "bluebird": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", - "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==", - "dev": true - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "body-parser": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", - "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", - "dev": true, - "requires": { - "bytes": "3.0.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "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" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "browserfs": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/browserfs/-/browserfs-1.4.3.tgz", - "integrity": "sha512-tz8HClVrzTJshcyIu8frE15cjqjcBIu15Bezxsvl/i+6f59iNCN3kznlWjz0FEb3DlnDx3gW5szxeT6D1x0s0w==", - "dev": true, - "requires": { - "async": "^2.1.4", - "pako": "^1.0.4" - } - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sha3": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.1.tgz", - "integrity": "sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE=", - "requires": { - "js-sha3": "^0.3.1" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "^4.1.1", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.2", - "elliptic": "^6.0.0", - "inherits": "^2.0.1", - "parse-asn1": "^5.0.0" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "browserslist": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", - "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", - "requires": { - "caniuse-lite": "^1.0.30000844", - "electron-to-chromium": "^1.3.47" - } - }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", - "dev": true, - "optional": true, - "requires": { - "base-x": "^3.0.2" - } - }, - "bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "dev": true, - "optional": true, - "requires": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, - "buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", - "dev": true, - "optional": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "dev": true, - "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", - "dev": true - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", - "dev": true, - "optional": true - }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", - "dev": true - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" - }, - "buffer-to-arraybuffer": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", - "integrity": "sha1-YGSkD6dutDxyOrqe+PbhIW0QURo=", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", - "dev": true - }, - "bytewise": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", - "integrity": "sha1-HRPL/3F65xWAlKqIGzXQgbOHJT4=", - "requires": { - "bytewise-core": "^1.2.2", - "typewise": "^1.0.3" - } - }, - "bytewise-core": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", - "integrity": "sha1-P7QQx+kVWOsasiqCg0V3qmvWHUI=", - "requires": { - "typewise-core": "^1.2" - } - }, - "cacache": { - "version": "10.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", - "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", - "dev": true, - "requires": { - "bluebird": "^3.5.1", - "chownr": "^1.0.1", - "glob": "^7.1.2", - "graceful-fs": "^4.1.11", - "lru-cache": "^4.1.1", - "mississippi": "^2.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.2", - "ssri": "^5.2.4", - "unique-filename": "^1.1.0", - "y18n": "^4.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "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" - } - }, - "cachedown": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cachedown/-/cachedown-1.0.0.tgz", - "integrity": "sha1-1D8DbkUQaWsxJG19sx6/D3rDLRU=", - "requires": { - "abstract-leveldown": "^2.4.1", - "lru-cache": "^3.2.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" - }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" - }, - "caniuse-lite": { - "version": "1.0.30000892", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000892.tgz", - "integrity": "sha512-X9rxMaWZNbJB5qjkDqPtNv/yfViTeUL6ILk0QJNxLV3OhKC5Acn5vxsuUvllR6B48mog8lmS+whwHq/QIYSL9w==" - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "chalk": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "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" - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "checkpoint-store": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", - "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", - "requires": { - "functional-red-black-tree": "^1.0.1" - } - }, - "chokidar": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", - "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.0", - "braces": "^2.3.0", - "fsevents": "^1.2.2", - "glob-parent": "^3.1.0", - "inherits": "^2.0.1", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "lodash.debounce": "^4.0.8", - "normalize-path": "^2.1.1", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.0.0", - "upath": "^1.0.5" - } - }, - "chownr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", - "dev": true - }, - "chrome-trace-event": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz", - "integrity": "sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "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==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "coinstring": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/coinstring/-/coinstring-2.3.0.tgz", - "integrity": "sha1-zbYzY6lhUCQEolr7gsLibV/2J6Q=", - "dev": true, - "optional": true, - "requires": { - "bs58": "^2.0.1", - "create-hash": "^1.1.1" - }, - "dependencies": { - "bs58": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-2.0.1.tgz", - "integrity": "sha1-VZCNWPGYKrogCPob7Y+RmYopv40=", - "dev": true, - "optional": true - } - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.8.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", - "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", - "dev": true, - "requires": { - "graceful-readlink": ">= 1.0.0" - } - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "^0.1.4" - } - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", - "dev": true - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", - "dev": true - }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", - "dev": true - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", - "dev": true - }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", - "dev": true - }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-js": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" - }, - "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=" - }, - "cors": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", - "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", - "dev": true, - "requires": { - "object-assign": "^4", - "vary": "^1" - }, - "dependencies": { - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - } - } - }, - "create-ecdh": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", - "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.0.0" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-env": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz", - "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.5", - "is-windows": "^1.0.0" - } - }, - "cross-fetch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.2.tgz", - "integrity": "sha1-pH/09/xxLauo9qaVoRyUhEDUVyM=", - "requires": { - "node-fetch": "2.1.2", - "whatwg-fetch": "2.0.4" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true - } - } - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "cyclist": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", - "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", - "dev": true - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "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=", - "dev": true - }, - "decompress": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz", - "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", - "dev": true, - "optional": true, - "requires": { - "decompress-tar": "^4.0.0", - "decompress-tarbz2": "^4.0.0", - "decompress-targz": "^4.0.0", - "decompress-unzip": "^4.0.1", - "graceful-fs": "^4.1.10", - "make-dir": "^1.0.0", - "pify": "^2.3.0", - "strip-dirs": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true, - "optional": true - } - } - }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "decompress-tar": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", - "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", - "dev": true, - "requires": { - "file-type": "^5.2.0", - "is-stream": "^1.1.0", - "tar-stream": "^1.5.2" - } - }, - "decompress-tarbz2": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", - "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", - "dev": true, - "optional": true, - "requires": { - "decompress-tar": "^4.1.0", - "file-type": "^6.1.0", - "is-stream": "^1.1.0", - "seek-bzip": "^1.0.5", - "unbzip2-stream": "^1.0.9" - }, - "dependencies": { - "file-type": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", - "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==", - "dev": true, - "optional": true - } - } - }, - "decompress-targz": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", - "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", - "dev": true, - "optional": true, - "requires": { - "decompress-tar": "^4.1.1", - "file-type": "^5.2.0", - "is-stream": "^1.1.0" - } - }, - "decompress-unzip": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", - "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", - "dev": true, - "optional": true, - "requires": { - "file-type": "^3.8.0", - "get-stream": "^2.2.0", - "pify": "^2.3.0", - "yauzl": "^2.4.2" - }, - "dependencies": { - "file-type": { - "version": "3.9.0", - "resolved": "http://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", - "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", - "dev": true, - "optional": true - }, - "get-stream": { - "version": "2.3.1", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", - "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", - "dev": true, - "optional": true, - "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - } - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "optional": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true, - "optional": true - } - } - }, - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" - }, - "deferred-leveldown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", - "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", - "requires": { - "abstract-leveldown": "~2.6.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - }, - "dependencies": { - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" - } - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "requires": { - "repeating": "^2.0.0" - } - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "dom-walk": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", - "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=" - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", - "requires": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - } - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true - }, - "duplexify": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.1.tgz", - "integrity": "sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, - "electron-to-chromium": { - "version": "1.3.79", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.79.tgz", - "integrity": "sha512-LQdY3j4PxuUl6xfxiFruTSlCniTrTrzAd8/HfsLEMi0PUpaQ0Iy+Pr4N4VllDYjs0Hyu2lkTbvzqlG+PX9NsNw==" - }, - "elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "emojis-list": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", - "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", - "dev": true - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true - }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "requires": { - "iconv-lite": "~0.4.13" - } - }, - "encoding-down": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", - "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", - "requires": { - "abstract-leveldown": "^5.0.0", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "xtend": "^4.0.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "requires": { - "once": "^1.4.0" - } - }, - "enhanced-resolve": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", - "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", - "tapable": "^1.0.0" - } - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "requires": { - "prr": "~1.0.1" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", - "requires": { - "es-to-primitive": "^1.1.1", - "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" - } - }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, - "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=" - }, - "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "^4.1.0" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true - }, - "eth-block-tracker": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz", - "integrity": "sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug==", - "requires": { - "eth-query": "^2.1.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.3", - "ethjs-util": "^0.1.3", - "json-rpc-engine": "^3.6.0", - "pify": "^2.3.0", - "tape": "^4.6.3" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, - "eth-json-rpc-infura": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/eth-json-rpc-infura/-/eth-json-rpc-infura-3.1.2.tgz", - "integrity": "sha512-IuK5Iowfs6taluA/3Okmu6EfZcFMq6MQuyrUL1PrCoJstuuBr3TvVeSy3keDyxfbrjFB34nCo538I8G+qMtsbw==", - "requires": { - "cross-fetch": "^2.1.1", - "eth-json-rpc-middleware": "^1.5.0", - "json-rpc-engine": "^3.4.0", - "json-rpc-error": "^2.0.0", - "tape": "^4.8.0" - } - }, - "eth-json-rpc-middleware": { - "version": "1.6.0", - "resolved": "http://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz", - "integrity": "sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q==", - "requires": { - "async": "^2.5.0", - "eth-query": "^2.1.2", - "eth-tx-summary": "^3.1.2", - "ethereumjs-block": "^1.6.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.2", - "ethereumjs-vm": "^2.1.0", - "fetch-ponyfill": "^4.0.0", - "json-rpc-engine": "^3.6.0", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "tape": "^4.6.3" - }, - "dependencies": { - "ethereum-common": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", - "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==" - }, - "ethereumjs-block": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz", - "integrity": "sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg==", - "requires": { - "async": "^2.0.1", - "ethereum-common": "0.2.0", - "ethereumjs-tx": "^1.2.2", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - } - } - }, - "eth-lib": { - "version": "0.1.27", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.27.tgz", - "integrity": "sha512-B8czsfkJYzn2UIEMwjc7Mbj+Cy72V+/OXH/tb44LV8jhrjizQJJ325xMOMyk3+ETa6r6oi0jsUY14+om8mQMWA==", - "dev": true, - "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "keccakjs": "^0.2.1", - "nano-json-stream-parser": "^0.1.2", - "servify": "^0.1.12", - "ws": "^3.0.0", - "xhr-request-promise": "^0.1.2" - } - }, - "eth-query": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/eth-query/-/eth-query-2.1.2.tgz", - "integrity": "sha1-1nQdkAAQa1FRDHLbktY2VFam2l4=", - "requires": { - "json-rpc-random-id": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "eth-sig-util": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.0.2.tgz", - "integrity": "sha512-tB6E8jf/aZQ943bo3+iojl8xRe3Jzcl+9OT6v8K7kWis6PdIX19SB2vYvN849cB9G9m/XLjYFK381SgdbsnpTA==", - "requires": { - "ethereumjs-abi": "0.6.5", - "ethereumjs-util": "^5.1.1" - } - }, - "eth-tx-summary": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/eth-tx-summary/-/eth-tx-summary-3.2.3.tgz", - "integrity": "sha512-1gZpA5fKarJOVSb5OUlPnhDQuIazqAkI61zlVvf5LdG47nEgw+/qhyZnuj3CUdE/TLTKuRzPLeyXLjaB4qWTRQ==", - "requires": { - "async": "^2.1.2", - "bn.js": "^4.11.8", - "clone": "^2.0.0", - "concat-stream": "^1.5.1", - "end-of-stream": "^1.1.0", - "eth-query": "^2.0.2", - "ethereumjs-block": "^1.4.1", - "ethereumjs-tx": "^1.1.1", - "ethereumjs-util": "^5.0.1", - "ethereumjs-vm": "2.3.4", - "through2": "^2.0.3", - "treeify": "^1.0.1", - "web3-provider-engine": "^13.3.2" - }, - "dependencies": { - "eth-block-tracker": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-2.3.1.tgz", - "integrity": "sha512-NamWuMBIl8kmkJFVj8WzGatySTzQPQag4Xr677yFxdVtIxACFbL/dQowk0MzEqIKk93U1TwY3MjVU6mOcwZnKA==", - "requires": { - "async-eventemitter": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", - "eth-query": "^2.1.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.3", - "ethjs-util": "^0.1.3", - "json-rpc-engine": "^3.6.0", - "pify": "^2.3.0", - "tape": "^4.6.3" - }, - "dependencies": { - "async-eventemitter": { - "version": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", - "from": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", - "requires": { - "async": "^2.4.0" - } - } - } - }, - "eth-sig-util": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz", - "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", - "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#00ba8463a7f7a67fcad737ff9c2ebd95643427f7", - "ethereumjs-util": "^5.1.1" - } - }, - "ethereum-common": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", - "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==" - }, - "ethereumjs-abi": { - "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#00ba8463a7f7a67fcad737ff9c2ebd95643427f7", - "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", - "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^5.0.0" - } - }, - "ethereumjs-block": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz", - "integrity": "sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg==", - "requires": { - "async": "^2.0.1", - "ethereum-common": "0.2.0", - "ethereumjs-tx": "^1.2.2", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - }, - "ethereumjs-vm": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.3.4.tgz", - "integrity": "sha512-Y4SlzNDqxrCO58jhp98HdnZVdjOqB+HC0hoU+N/DEp1aU+hFkRX/nru5F7/HkQRPIlA6aJlQp/xIA6xZs1kspw==", - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "ethereum-common": "0.2.0", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~1.7.0", - "ethereumjs-util": "^5.1.3", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.1.2", - "rustbn.js": "~0.1.1", - "safe-buffer": "^5.1.1" - } - }, - "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "rustbn.js": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.1.2.tgz", - "integrity": "sha512-bAkNqSHYdJdFsBC7Z11JgzYktL31HIpB2o70jZcGiL1U1TVtPyvaVhDrGWwS8uZtaqwW2k6NOPGZCqW/Dgh5Lg==" - }, - "solc": { - "version": "0.4.25", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.25.tgz", - "integrity": "sha512-jU1YygRVy6zatgXrLY2rRm7HW1d7a8CkkEgNJwvH2VLpWhMFsMdWcJn6kUqZwcSz/Vm+w89dy7Z/aB5p6AFTrg==", - "requires": { - "fs-extra": "^0.30.0", - "memorystream": "^0.3.1", - "require-from-string": "^1.1.0", - "semver": "^5.3.0", - "yargs": "^4.7.1" - } - }, - "web3-provider-engine": { - "version": "13.8.0", - "resolved": "http://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz", - "integrity": "sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ==", - "requires": { - "async": "^2.5.0", - "clone": "^2.0.0", - "eth-block-tracker": "^2.2.2", - "eth-sig-util": "^1.4.2", - "ethereumjs-block": "^1.2.2", - "ethereumjs-tx": "^1.2.0", - "ethereumjs-util": "^5.1.1", - "ethereumjs-vm": "^2.0.2", - "fetch-ponyfill": "^4.0.0", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "readable-stream": "^2.2.9", - "request": "^2.67.0", - "semaphore": "^1.0.3", - "solc": "^0.4.2", - "tape": "^4.4.0", - "xhr": "^2.2.0", - "xtend": "^4.0.1" - } - } - } - }, - "ethereum-common": { - "version": "0.0.16", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.16.tgz", - "integrity": "sha1-mh4Wnq00q3XgifUMpRK/0PvRJlU=" - }, - "ethereumjs-abi": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz", - "integrity": "sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE=", - "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^4.3.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "4.5.0", - "resolved": "http://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", - "integrity": "sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=", - "requires": { - "bn.js": "^4.8.0", - "create-hash": "^1.1.2", - "keccakjs": "^0.2.0", - "rlp": "^2.0.0", - "secp256k1": "^3.0.1" - } - } - } - }, - "ethereumjs-account": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", - "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", - "requires": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-block": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-1.2.2.tgz", - "integrity": "sha1-LsdTSlkCG47JuDww5JaQxuuu3aE=", - "requires": { - "async": "^1.5.2", - "ethereum-common": "0.0.16", - "ethereumjs-tx": "^1.0.0", - "ethereumjs-util": "^4.0.1", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "ethereumjs-util": { - "version": "4.5.0", - "resolved": "http://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", - "integrity": "sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=", - "requires": { - "bn.js": "^4.8.0", - "create-hash": "^1.1.2", - "keccakjs": "^0.2.0", - "rlp": "^2.0.0", - "secp256k1": "^3.0.1" - } - } - } - }, - "ethereumjs-common": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-0.4.1.tgz", - "integrity": "sha512-ywYGsOeGCsMNWso5Y4GhjWI24FJv9FK7+VyVKiQgXg8ZRDPXJ7F/kJ1CnjtkjTvDF4e0yqU+FWswlqR3bmZQ9Q==" - }, - "ethereumjs-tx": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.4.tgz", - "integrity": "sha512-kOgUd5jC+0tgV7t52UDECMMz9Uf+Lro+6fSpCvzWemtXfMEcwI3EOxf5mVPMRbTFkMMhuERokNNVF3jItAjidg==", - "requires": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - }, - "dependencies": { - "ethereum-common": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", - "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=" - } - } - }, - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "ethereumjs-vm": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.4.0.tgz", - "integrity": "sha512-MJ4lCWa5c6LhahhhvoDKW+YGjK00ZQn0RHHLh4L+WaH1k6Qv7/q3uTluew6sJGNCZdlO0yYMDXYW9qyxLHKlgQ==", - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~1.7.0", - "ethereumjs-common": "~0.4.0", - "ethereumjs-util": "^5.2.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.1.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "ethereum-common": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", - "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==" - }, - "ethereumjs-block": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz", - "integrity": "sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg==", - "requires": { - "async": "^2.0.1", - "ethereum-common": "0.2.0", - "ethereumjs-tx": "^1.2.2", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - } - } - }, - "ethereumjs-wallet": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/ethereumjs-wallet/-/ethereumjs-wallet-0.6.2.tgz", - "integrity": "sha512-DHEKPV9lYORM7dL8602dkb+AgdfzCYz2lxpdYQoD3OwG355LLDuivW9rGuLpDMCry/ORyBYV6n+QCo/71SwACg==", - "dev": true, - "optional": true, - "requires": { - "aes-js": "^3.1.1", - "bs58check": "^2.1.2", - "ethereumjs-util": "^5.2.0", - "hdkey": "^1.0.0", - "safe-buffer": "^5.1.2", - "scrypt.js": "^0.2.0", - "utf8": "^3.0.0", - "uuid": "^3.3.2" - } - }, - "ethjs-unit": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", - "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", - "dev": true, - "requires": { - "bn.js": "4.11.6", - "number-to-bn": "1.7.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true - } - } - }, - "ethjs-util": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "requires": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - } - }, - "eventemitter3": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.1.1.tgz", - "integrity": "sha1-R3hr2qCHyvext15zq8XH1UAVjNA=", - "dev": true - }, - "events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", - "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==" - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "execa": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", - "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "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": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "express": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", - "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", - "dev": true, - "requires": { - "accepts": "~1.3.5", - "array-flatten": "1.1.1", - "body-parser": "1.18.3", - "content-disposition": "0.5.2", - "content-type": "~1.0.4", - "cookie": "0.3.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "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", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.4", - "qs": "6.5.2", - "range-parser": "~1.2.0", - "safe-buffer": "5.1.2", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "~1.4.0", - "type-is": "~1.6.16", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "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==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "external-editor": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", - "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fake-merkle-patricia-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", - "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", - "requires": { - "checkpoint-store": "^1.1.0" - } - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "dev": true, - "optional": true, - "requires": { - "pend": "~1.2.0" - } - }, - "fetch-ponyfill": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz", - "integrity": "sha1-rjzl9zLGReq4fkroeTQUcJsjmJM=", - "requires": { - "node-fetch": "~1.7.1" - }, - "dependencies": { - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - } - } - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-type": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", - "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", - "dev": true - }, - "filesize": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", - "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==", - "dev": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "finalhandler": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", - "dev": true, - "requires": { - "debug": "2.6.9", - "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": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true - } - } - }, - "find-cache-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", - "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^1.0.0", - "pkg-dir": "^2.0.0" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "flush-write-stream": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", - "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.4" - } - }, - "for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "requires": { - "is-callable": "^1.1.3" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "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": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "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=", - "dev": true - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true - }, - "fs-extra": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", - "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0" - } - }, - "fs-promise": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/fs-promise/-/fs-promise-2.0.3.tgz", - "integrity": "sha1-9k5PhUvPaJqovdy6JokW2z20aFQ=", - "dev": true, - "optional": true, - "requires": { - "any-promise": "^1.3.0", - "fs-extra": "^2.0.0", - "mz": "^2.6.0", - "thenify-all": "^1.6.0" - } - }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "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" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "^2.1.0" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.5.1", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true - } - } - }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" - }, - "get-stream": { - "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "requires": { - "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" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "global": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", - "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", - "requires": { - "min-document": "^2.19.0", - "process": "~0.5.1" - } - }, - "global-modules-path": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/global-modules-path/-/global-modules-path-2.3.0.tgz", - "integrity": "sha512-HchvMJNYh9dGSCy8pOQ2O8u/hoXaL+0XhnrwH0RyLiSXMMTl9W3N6KUU73+JFOg5PGjtzl6VZzUQsnrpm7Szag==", - "dev": true - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" - }, - "got": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", - "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", - "dev": true, - "requires": { - "decompress-response": "^3.2.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-plain-obj": "^1.1.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "p-cancelable": "^0.3.0", - "p-timeout": "^1.1.1", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "url-parse-lax": "^1.0.0", - "url-to-options": "^1.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" - }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", - "requires": { - "ajv": "^5.3.0", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "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" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbol-support-x": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", - "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", - "dev": true - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" - }, - "has-to-string-tag-x": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", - "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", - "dev": true, - "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "hash.js": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", - "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hdkey": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.0.tgz", - "integrity": "sha512-E7aU8pNlWUJbXGjTz/+lKf1LkMcA3hUrC5ZleeizrmLSd++kvf8mSOe3q8CmBDA9j4hdfXO5iY6hGiTUCOV2jQ==", - "dev": true, - "optional": true, - "requires": { - "coinstring": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "heap": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.6.tgz", - "integrity": "sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=" - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, - "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" - }, - "http-errors": { - "version": "1.6.3", - "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "http-https": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", - "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=", - "dev": true - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "humanize": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/humanize/-/humanize-0.0.9.tgz", - "integrity": "sha1-GZT/rs3+nEQe0r2sdFK3u0yeQaQ=", - "dev": true - }, - "iconv-lite": { - "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" - } - }, - "ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" - }, - "import-local": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", - "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", - "dev": true, - "requires": { - "pkg-dir": "^2.0.0", - "resolve-cwd": "^2.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "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=" - }, - "inquirer": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", - "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", - "dev": true, - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.0", - "figures": "^2.0.0", - "lodash": "^4.17.10", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.1.0", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "intercept-require": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/intercept-require/-/intercept-require-1.1.0.tgz", - "integrity": "sha1-6OJAnUrbJTXDGn5KBc9gzadE9mU=", - "requires": { - "callsite": "^1.0.0", - "object-assign": "^2.0.0" - } - }, - "interpret": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", - "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", - "dev": true - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "requires": { - "loose-envify": "^1.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=", - "dev": true - }, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "requires": { - "builtin-modules": "^1.0.0" - } - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" - }, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "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==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-fn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fn/-/is-fn-1.0.0.tgz", - "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-function": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", - "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" - }, - "is-glob": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-hex-prefixed": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" - }, - "is-natural-number": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", - "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=", - "dev": true, - "optional": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", - "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", - "dev": true - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "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==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "requires": { - "has": "^1.0.1" - } - }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "requires": { - "has-symbols": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "isurl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", - "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", - "dev": true, - "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - } - }, - "js-sha3": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.3.1.tgz", - "integrity": "sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=" - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-rpc-engine": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz", - "integrity": "sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA==", - "requires": { - "async": "^2.0.1", - "babel-preset-env": "^1.7.0", - "babelify": "^7.3.0", - "json-rpc-error": "^2.0.0", - "promise-to-callback": "^1.0.0", - "safe-event-emitter": "^1.0.1" - } - }, - "json-rpc-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/json-rpc-error/-/json-rpc-error-2.0.0.tgz", - "integrity": "sha1-p6+cICg4tekFxyUOVH8a/3cligI=", - "requires": { - "inherits": "^2.0.1" - } - }, - "json-rpc-random-id": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz", - "integrity": "sha1-uknZat7RRE27jaPSA3SKy7zeyMg=" - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" - }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "requires": { - "jsonify": "~0.0.0" - } - }, - "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=" - }, - "json5": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "keccakjs": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.1.tgz", - "integrity": "sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0=", - "requires": { - "browserify-sha3": "^0.0.1", - "sha3": "^1.1.0" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, - "level-codec": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.0.tgz", - "integrity": "sha512-OIpVvjCcZNP5SdhcNupnsI1zo5Y9Vpm+k/F1gfG5kXrtctlrwanisakweJtE0uA0OpLukRfOQae+Fg0M5Debhg==" - }, - "level-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.0.tgz", - "integrity": "sha512-AmY4HCp9h3OiU19uG+3YWkdELgy05OTP/r23aNHaQKWv8DO787yZgsEuGVkoph40uwN+YdUKnANlrxSsoOaaxg==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "level-errors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.1.2.tgz", - "integrity": "sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w==", - "requires": { - "errno": "~0.1.1" - } - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, - "level-post": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/level-post/-/level-post-1.0.7.tgz", - "integrity": "sha512-PWYqG4Q00asOrLhX7BejSajByB4EmG2GaKHfj3h5UmmZ2duciXLPGYWIjBzLECFWUGOZWlm5B20h/n3Gs3HKew==", - "requires": { - "ltgt": "^2.1.2" - } - }, - "level-sublevel": { - "version": "6.6.4", - "resolved": "https://registry.npmjs.org/level-sublevel/-/level-sublevel-6.6.4.tgz", - "integrity": "sha512-pcCrTUOiO48+Kp6F1+UAzF/OtWqLcQVTVF39HLdZ3RO8XBoXt+XVPKZO1vVr1aUoxHZA9OtD2e1v7G+3S5KFDA==", - "requires": { - "bytewise": "~1.1.0", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "level-iterator-stream": "^2.0.3", - "ltgt": "~2.1.1", - "pull-defer": "^0.2.2", - "pull-level": "^2.0.3", - "pull-stream": "^3.6.8", - "typewiselite": "~1.0.0", - "xtend": "~4.0.0" - }, - "dependencies": { - "level-iterator-stream": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz", - "integrity": "sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig==", - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.5", - "xtend": "^4.0.0" - } - }, - "ltgt": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.1.3.tgz", - "integrity": "sha1-EIUaBtmWS5cReEQcI8nlJpjuzjQ=" - } - } - }, - "level-ws": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", - "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } - } - } - }, - "levelup": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", - "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", - "requires": { - "deferred-leveldown": "~4.0.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~3.0.0", - "xtend": "~4.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", - "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", - "requires": { - "abstract-leveldown": "~5.0.0", - "inherits": "^2.0.3" - } - }, - "level-iterator-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.0.tgz", - "integrity": "sha512-2tpBjsNZtvST8eJIy3R9Sk13aC84omgqvT4sQObZaUb4hDyDe4woWAMudXX3eCsaydOGVaaI5WMpRRBFSzz5WA==", - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.5", - "xtend": "^4.0.0" - } - } - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, - "loader-runner": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.1.tgz", - "integrity": "sha512-By6ZFY7ETWOc9RFaAIb23IjJVcM4dvJC/N57nmdz9RSkMXvAXGI7SyVlAw3v8vjtDRlqThgVDVmTnr9fqMlxkw==", - "dev": true - }, - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "^3.1.3", - "emojis-list": "^2.0.0", - "json5": "^0.5.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } - } - }, - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" - }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==", - "dev": true - }, - "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=", - "dev": true - }, - "looper": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/looper/-/looper-2.0.0.tgz", - "integrity": "sha1-Zs0Md0rz1P7axTeU90LbVtqPCew=" - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true - }, - "lru-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", - "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", - "requires": { - "pseudomap": "^1.0.1" - } - }, - "ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "mamacro": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", - "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", - "dev": true - }, - "map-age-cleaner": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", - "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", - "dev": true - }, - "mem": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", - "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", - "p-is-promise": "^1.1.0" - } - }, - "memdown": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.3.1.tgz", - "integrity": "sha512-Qr0bqzSQWUEU0/nwSOOo3j7Gt/I3lKUoUENmsZiJ7YZoPtt0WrfV4h1Qbv/XurwBCN9qt3zR68Vfk0iY5cBDSQ==", - "dev": true, - "requires": { - "abstract-leveldown": "2.7.0", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.0.tgz", - "integrity": "sha512-maam3ZrTeORbXKEJUeJZkYOsorEwr060WitXuQlUuIFlg0RofyyHts49wtaVmShJ6l0wEWB0ZtPhf6QYBA7D2w==", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, - "memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true - }, - "merkle-patricia-tree": { - "version": "2.3.1", - "resolved": "http://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.1.tgz", - "integrity": "sha512-Qp9Mpb3xazznXzzGQBqHbqCpT2AR9joUOHYYPiQjYCarrdCPCnLWXo4BFv77y4xN26KR224xoU1n/qYY7RYYgw==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "requires": { - "xtend": "~4.0.0" - } - }, - "async": { - "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "level-codec": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", - "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" - }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "memdown": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", - "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - } - } - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "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" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "dev": true - }, - "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==" - }, - "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", - "requires": { - "mime-db": "~1.36.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true - }, - "min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", - "requires": { - "dom-walk": "^0.1.0" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - }, - "mississippi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", - "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^2.0.1", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - } - }, - "mkdirp-promise": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", - "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", - "dev": true, - "optional": true, - "requires": { - "mkdirp": "*" - } - }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "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.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "mock-fs": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.7.0.tgz", - "integrity": "sha512-WlQNtUlzMRpvLHf8dqeUmNqfdPjGY29KrJF50Ldb4AcL+vQeR8QH3wQcFMgrhTwb1gHjZn9xggho+84tBskLgA==", - "dev": true, - "optional": true - }, - "mout": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/mout/-/mout-0.11.1.tgz", - "integrity": "sha1-ujYR318OWx/7/QEWa48C0fX6K5k=", - "dev": true, - "optional": true - }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "optional": true, - "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - }, - "dependencies": { - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "optional": true - } - } - }, - "nan": { - "version": "2.10.0", - "resolved": "http://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" - }, - "nano-json-stream-parser": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", - "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=", - "dev": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "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-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", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", - "dev": true - }, - "neo-async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", - "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-fetch": { - "version": "2.1.2", - "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", - "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=" - }, - "node-libs-browser": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", - "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^1.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.0", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.10.3", - "vm-browserify": "0.0.4" - }, - "dependencies": { - "buffer": { - "version": "4.9.1", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "events": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "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.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "number-to-bn": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", - "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", - "dev": true, - "requires": { - "bn.js": "4.11.6", - "strip-hex-prefix": "1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true - } - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "object-assign": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz", - "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=" - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "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=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "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" - } - } - } - }, - "object-inspect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==" - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "oboe": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.3.tgz", - "integrity": "sha1-K0hl29Rr6BIlcT9Om/5Lz09oCk8=", - "dev": true, - "requires": { - "http-https": "^1.0.0" - } - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, - "os-locale": { - "version": "1.4.0", - "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "^1.0.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, - "p-cancelable": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", - "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", - "dev": true - }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-timeout": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", - "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", - "dev": true, - "requires": { - "p-finally": "^1.0.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "pako": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", - "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", - "dev": true - }, - "parallel-transform": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", - "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", - "dev": true, - "requires": { - "cyclist": "~0.2.2", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, - "parse-asn1": { - "version": "5.1.1", - "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", - "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", - "dev": true, - "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3" - } - }, - "parse-headers": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", - "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", - "requires": { - "for-each": "^0.3.2", - "trim": "0.0.1" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, - "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "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-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", - "dev": true - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - } - } - }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true, - "optional": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "pify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.0.tgz", - "integrity": "sha512-zrSP/KDf9DH3K3VePONoCstgPiYJy9z0SCatZuTpOc7YdnWIqwkWdXOuwlr4uDc7em8QZRsFWsT/685x5InjYg==", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "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.0" - } - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.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=", - "dev": true - }, - "precond": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", - "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=" - }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", - "dev": true - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" - }, - "process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=" - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "promise-to-callback": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/promise-to-callback/-/promise-to-callback-1.0.0.tgz", - "integrity": "sha1-XSp0kBC/tn2WNZj805YHRqaP7vc=", - "requires": { - "is-fn": "^1.0.0", - "set-immediate-shim": "^1.0.1" - } - }, - "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", - "dev": true, - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.8.0" - } - }, - "prr": { - "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", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "pull-cat": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/pull-cat/-/pull-cat-1.1.11.tgz", - "integrity": "sha1-tkLdElXaN2pwa220+pYvX9t0wxs=" - }, - "pull-defer": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/pull-defer/-/pull-defer-0.2.3.tgz", - "integrity": "sha512-/An3KE7mVjZCqNhZsr22k1Tx8MACnUnHZZNPSJ0S62td8JtYr/AiRG42Vz7Syu31SoTLUzVIe61jtT/pNdjVYA==" - }, - "pull-level": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pull-level/-/pull-level-2.0.4.tgz", - "integrity": "sha512-fW6pljDeUThpq5KXwKbRG3X7Ogk3vc75d5OQU/TvXXui65ykm+Bn+fiktg+MOx2jJ85cd+sheufPL+rw9QSVZg==", - "requires": { - "level-post": "^1.0.7", - "pull-cat": "^1.1.9", - "pull-live": "^1.0.1", - "pull-pushable": "^2.0.0", - "pull-stream": "^3.4.0", - "pull-window": "^2.1.4", - "stream-to-pull-stream": "^1.7.1" - } - }, - "pull-live": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pull-live/-/pull-live-1.0.1.tgz", - "integrity": "sha1-pOzuAeMwFV6RJLu89HYfIbOPUfU=", - "requires": { - "pull-cat": "^1.1.9", - "pull-stream": "^3.4.0" - } - }, - "pull-pushable": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pull-pushable/-/pull-pushable-2.2.0.tgz", - "integrity": "sha1-Xy867UethpGfAbEqLpnW8b13ZYE=" - }, - "pull-stream": { - "version": "3.6.9", - "resolved": "https://registry.npmjs.org/pull-stream/-/pull-stream-3.6.9.tgz", - "integrity": "sha512-hJn4POeBrkttshdNl0AoSCVjMVSuBwuHocMerUdoZ2+oIUzrWHFTwJMlbHND7OiKLVgvz6TFj8ZUVywUMXccbw==" - }, - "pull-window": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/pull-window/-/pull-window-2.1.4.tgz", - "integrity": "sha1-/DuG/uvRkgx64pdpHiP3BfiFUvA=", - "requires": { - "looper": "^2.0.0" - } - }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - } - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "query-string": { - "version": "5.1.1", - "resolved": "http://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", - "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", - "dev": true, - "requires": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - }, - "dependencies": { - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - } - } - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "randomhex": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", - "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=", - "dev": true - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", - "dev": true - }, - "raw-body": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", - "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", - "dev": true, - "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.3", - "iconv-lite": "0.4.23", - "unpipe": "1.0.0" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==" - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - }, - "regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", - "requires": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=" - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "requires": { - "jsesc": "~0.5.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=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-from-string": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", - "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=" - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" - }, - "resolve": { - "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" - } - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "resumer": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", - "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", - "requires": { - "through": "~2.3.4" - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "requires": { - "glob": "^7.0.5" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rlp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.1.0.tgz", - "integrity": "sha512-93U7IKH5j7nmXFVg19MeNBGzQW5uXW1pmCuKY8veeKIhYTE32C2d0mOegfiIAfXcHOKJjjPlJisn8iHDF5AezA==", - "requires": { - "safe-buffer": "^5.1.1" - } - }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } - }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, - "rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" - }, - "rxjs": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", - "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-event-emitter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz", - "integrity": "sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg==", - "requires": { - "events": "^3.0.0" - } - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "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==" - }, - "schema-utils": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", - "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-keywords": "^3.1.0" - }, - "dependencies": { - "ajv": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", - "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } - } - }, - "scrypt": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz", - "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.0.8" - } - }, - "scrypt.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.2.0.tgz", - "integrity": "sha1-r40UZbcemZARC+38WTuUeeA6ito=", - "dev": true, - "optional": true, - "requires": { - "scrypt": "^6.0.2", - "scryptsy": "^1.2.1" - } - }, - "scryptsy": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", - "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", - "dev": true, - "optional": true, - "requires": { - "pbkdf2": "^3.0.3" - } - }, - "secp256k1": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.5.2.tgz", - "integrity": "sha512-iin3kojdybY6NArd+UFsoTuapOF7bnJNf2UbcWXaY3z+E1sJDipl60vtzB5hbO/uquBu7z0fd4VC4Irp+xoFVQ==", - "requires": { - "bindings": "^1.2.1", - "bip66": "^1.1.3", - "bn.js": "^4.11.3", - "create-hash": "^1.1.2", - "drbg.js": "^1.0.1", - "elliptic": "^6.2.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "seedrandom": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-2.4.4.tgz", - "integrity": "sha512-9A+PDmgm+2du77B5i0Ip2cxOqqHjgNxnBgglxLcX78A2D6c2rTo61z4jnVABpF4cKeDMDG+cmXXvdnqse2VqMA==" - }, - "seek-bzip": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", - "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", - "dev": true, - "optional": true, - "requires": { - "commander": "~2.8.1" - } - }, - "semaphore": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", - "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" - }, - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" - }, - "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "dev": true, - "requires": { - "debug": "2.6.9", - "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", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true - } - } - }, - "serialize-javascript": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz", - "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==", - "dev": true - }, - "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "dev": true, - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" - } - }, - "servify": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", - "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", - "dev": true, - "requires": { - "body-parser": "^1.16.0", - "cors": "^2.8.1", - "express": "^4.14.0", - "request": "^2.79.0", - "xhr": "^2.3.3" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, - "requires": { - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "sha3": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.2.tgz", - "integrity": "sha1-pmxQmN5MJbyIM27ItIF9AFvKe6k=", - "requires": { - "nan": "2.10.0" - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", - "dev": true - }, - "simple-get": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", - "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", - "dev": true, - "requires": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "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==", - "dev": true, - "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": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "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==", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "solc": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.24.tgz", - "integrity": "sha512-2xd7Cf1HeVwrIb6Bu1cwY2/TaLRodrppCq3l7rhLimFQgmxptXhTC3+/wesVLpB09F1A2kZgvbMOgH7wvhFnBQ==", - "dev": true, - "requires": { - "fs-extra": "^0.30.0", - "memorystream": "^0.3.1", - "require-from-string": "^1.1.0", - "semver": "^5.3.0", - "yargs": "^4.7.1" - }, - "dependencies": { - "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - } - } - }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - }, - "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==", - "dev": true, - "requires": { - "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" - } - }, - "source-map-support": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", - "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "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=", - "dev": true - }, - "spdx-correct": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", - "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", - "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==" - }, - "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==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sshpk": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.1.tgz", - "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", - "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", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "ssri": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", - "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.1" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", - "dev": true - }, - "stream-browserify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, - "stream-to-pull-stream": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/stream-to-pull-stream/-/stream-to-pull-stream-1.7.2.tgz", - "integrity": "sha1-dXYJrhzr0zx0MtSvvjH/eGULnd4=", - "requires": { - "looper": "^3.0.0", - "pull-stream": "^3.2.3" - }, - "dependencies": { - "looper": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/looper/-/looper-3.0.0.tgz", - "integrity": "sha1-LvpUw7HLq6m5Su4uWRSwvlf7t0k=" - } - } - }, - "strict-uri-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", - "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", - "dev": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string.prototype.trim": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", - "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.0", - "function-bind": "^1.0.2" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-dirs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", - "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", - "dev": true, - "optional": true, - "requires": { - "is-natural-number": "^4.0.1" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-hex-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", - "requires": { - "is-hex-prefixed": "1.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=" - }, - "swarm-js": { - "version": "0.1.37", - "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.37.tgz", - "integrity": "sha512-G8gi5fcXP/2upwiuOShJ258sIufBVztekgobr3cVgYXObZwJ5AXLqZn52AI+/ffft29pJexF9WNdUxjlkVehoQ==", - "dev": true, - "optional": true, - "requires": { - "bluebird": "^3.5.0", - "buffer": "^5.0.5", - "decompress": "^4.0.0", - "eth-lib": "^0.1.26", - "fs-extra": "^2.1.2", - "fs-promise": "^2.0.0", - "got": "^7.1.0", - "mime-types": "^2.1.16", - "mkdirp-promise": "^5.0.1", - "mock-fs": "^4.1.0", - "setimmediate": "^1.0.5", - "tar.gz": "^1.0.5", - "xhr-request-promise": "^0.1.2" - } - }, - "tapable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.0.tgz", - "integrity": "sha512-IlqtmLVaZA2qab8epUXbVWRn3aB1imbDMJtjB3nu4X0NqPkcY/JH9ZtCBWKHWPxs8Svi9tyo8w2dBoi07qZbBA==", - "dev": true - }, - "tape": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.1.tgz", - "integrity": "sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw==", - "requires": { - "deep-equal": "~1.0.1", - "defined": "~1.0.0", - "for-each": "~0.3.3", - "function-bind": "~1.1.1", - "glob": "~7.1.2", - "has": "~1.0.3", - "inherits": "~2.0.3", - "minimist": "~1.2.0", - "object-inspect": "~1.6.0", - "resolve": "~1.7.1", - "resumer": "~0.0.0", - "string.prototype.trim": "~1.1.2", - "through": "~2.3.8" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - } - } - }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "dev": true, - "optional": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" - } - }, - "tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "dev": true, - "requires": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", - "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" - } - }, - "tar.gz": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/tar.gz/-/tar.gz-1.0.7.tgz", - "integrity": "sha512-uhGatJvds/3diZrETqMj4RxBR779LKlIE74SsMcn5JProZsfs9j0QBwWO1RW+IWNJxS2x8Zzra1+AW6OQHWphg==", - "dev": true, - "optional": true, - "requires": { - "bluebird": "^2.9.34", - "commander": "^2.8.1", - "fstream": "^1.0.8", - "mout": "^0.11.0", - "tar": "^2.1.1" - }, - "dependencies": { - "bluebird": { - "version": "2.11.0", - "resolved": "http://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", - "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=", - "dev": true, - "optional": true - } - } - }, - "temp": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz", - "integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=", - "dev": true, - "requires": { - "os-tmpdir": "^1.0.0", - "rimraf": "~2.2.6" - }, - "dependencies": { - "rimraf": { - "version": "2.2.8", - "resolved": "http://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", - "dev": true - } - } - }, - "thenify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", - "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", - "dev": true, - "requires": { - "any-promise": "^1.0.0" - } - }, - "thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "dev": true, - "requires": { - "thenify": ">= 3.1.0 < 4" - } - }, - "through": { - "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "requires": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" - } - }, - "timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", - "dev": true - }, - "timers-browserify": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", - "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "to-buffer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", - "dev": true - }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" - }, - "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=", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - }, - "treeify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", - "integrity": "sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==" - }, - "trim": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", - "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", - "dev": true - }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", - "dev": true, - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.18" - } - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "typewise": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", - "integrity": "sha1-EGeTZUCvl5N8xdz5kiSG6fooRlE=", - "requires": { - "typewise-core": "^1.2.0" - } - }, - "typewise-core": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", - "integrity": "sha1-l+uRgFx/VdL5QXSPpQ0xXZke8ZU=" - }, - "typewiselite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typewiselite/-/typewiselite-1.0.0.tgz", - "integrity": "sha1-yIgvobsQksBgBal/NO9chQjjZk4=" - }, - "uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", - "dev": true, - "requires": { - "commander": "~2.13.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "uglifyjs-webpack-plugin": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.3.0.tgz", - "integrity": "sha512-ovHIch0AMlxjD/97j9AYovZxG5wnHOPkL7T1GKochBADp/Zwc44pEWNqpKl1Loupp1WhFg7SlYmHZRUfdAacgw==", - "dev": true, - "requires": { - "cacache": "^10.0.4", - "find-cache-dir": "^1.0.0", - "schema-utils": "^0.4.5", - "serialize-javascript": "^1.4.0", - "source-map": "^0.6.1", - "uglify-es": "^3.3.4", - "webpack-sources": "^1.1.0", - "worker-farm": "^1.5.2" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", - "dev": true - }, - "unbzip2-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.1.tgz", - "integrity": "sha512-fIZnvdjblYs7Cru/xC6tCPVhz7JkYcVQQkePwMLyQELzYTds2Xn8QefPVnvdVhhZqubxNA1cASXEH5wcK0Bucw==", - "dev": true, - "optional": true, - "requires": { - "buffer": "^3.0.1", - "through": "^2.3.6" - }, - "dependencies": { - "base64-js": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", - "integrity": "sha1-EQHpVE9KdrG8OybUUsqW16NeeXg=", - "dev": true, - "optional": true - }, - "buffer": { - "version": "3.6.0", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-3.6.0.tgz", - "integrity": "sha1-pyyTb3e5a/UvX357RnGAYoVR3vs=", - "dev": true, - "optional": true, - "requires": { - "base64-js": "0.0.8", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - } - } - }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", - "dev": true - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.1.tgz", - "integrity": "sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "unorm": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.4.1.tgz", - "integrity": "sha1-NkIA1fE2RsqLzURJAnEzVhR5IwA=" - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } - } - }, - "upath": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", - "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", - "dev": true - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "dev": true, - "requires": { - "prepend-http": "^1.0.1" - } - }, - "url-set-query": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", - "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=", - "dev": true - }, - "url-to-options": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", - "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", - "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", - "dev": true, - "optional": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "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-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "v8-compile-cache": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz", - "integrity": "sha512-1wFuMUIM16MDJRCrpbpuEPTUGmM5QMUg0cr3KFwra2XgOgFcPGDQHDh3CszSCD2Zewc/dh/pamNEW8CbfDebUw==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" + "is-typedarray": "^1.0.0" } }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "typescript": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.3.tgz", + "integrity": "sha512-+81MUSyX+BaSo+u2RbozuQk/UWx6hfG0a5gHu4ANEM4sU96XbuIyAB+rWBW1u70c6a5QuZfuYICn3s2UjuHUpA==", "dev": true }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "vm-browserify": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", - "dev": true, - "requires": { - "indexof": "0.0.1" - } - }, - "watchpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", - "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", - "dev": true, - "requires": { - "chokidar": "^2.0.2", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" - } - }, - "web3": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3/-/web3-1.0.0-beta.35.tgz", - "integrity": "sha512-xwDmUhvTcHQvvNnOPcPZZgCxKUsI2e+GbHy7JkTK3/Rmnutazy8x7fsAXT9myw7V1qpi3GgLoZ3fkglSUbg1Mg==", - "dev": true, - "optional": true, - "requires": { - "web3-bzz": "1.0.0-beta.35", - "web3-core": "1.0.0-beta.35", - "web3-eth": "1.0.0-beta.35", - "web3-eth-personal": "1.0.0-beta.35", - "web3-net": "1.0.0-beta.35", - "web3-shh": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - } - }, - "web3-bzz": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.0.0-beta.35.tgz", - "integrity": "sha512-BhAU0qhlr8zltm4gs/+P1gki2VkxHJaM2Rrh4DGesDW0lzwufRoNvWFlwx1bKHoFPWNbSmm9PRkHOYOINL/Tgw==", - "dev": true, - "optional": true, - "requires": { - "got": "7.1.0", - "swarm-js": "0.1.37", - "underscore": "1.8.3" - } - }, - "web3-core": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.0.0-beta.35.tgz", - "integrity": "sha512-ayGavbgVk4KL9Y88Uv411fBJ0SVgVfKhKEBweKYzmP0zOqneMzWt6YsyD1n6kRvjAbqA0AfUPEOKyMNjcx2tjw==", - "dev": true, - "requires": { - "web3-core-helpers": "1.0.0-beta.35", - "web3-core-method": "1.0.0-beta.35", - "web3-core-requestmanager": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - } - }, - "web3-core-helpers": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.0.0-beta.35.tgz", - "integrity": "sha512-APOu3sEsamyqWt//8o4yq9KF25/uqGm+pQShson/sC4gKzmfJB07fLo2ond0X30E8fIqAPeVCotPXQxGciGUmA==", - "dev": true, - "requires": { - "underscore": "1.8.3", - "web3-eth-iban": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - } - }, - "web3-core-method": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.0.0-beta.35.tgz", - "integrity": "sha512-jidImCide8q0GpfsO4L73qoHrbkeWgwU3uOH5DKtJtv0ccmG086knNMRgryb/o9ZgetDWLmDEsJnHjBSoIwcbA==", - "dev": true, - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.35", - "web3-core-promievent": "1.0.0-beta.35", - "web3-core-subscriptions": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - } - }, - "web3-core-promievent": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.0.0-beta.35.tgz", - "integrity": "sha512-GvqXqKq07OmHuVi5uNRg6k79a1/CI0ViCC+EtNv4CORHtDRmYEt5Bvdv6z6FJEiaaQkD0lKbFwNhLxutx7HItw==", - "dev": true, - "requires": { - "any-promise": "1.3.0", - "eventemitter3": "1.1.1" - } - }, - "web3-core-requestmanager": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.0.0-beta.35.tgz", - "integrity": "sha512-S+zW2h17ZZQU9oe3yaCJE0E7aJS4C3Kf4kGPDv+nXjW0gKhQQhgVhw1Doq/aYQGqNSWJp7f1VHkz5gQWwg6RRg==", - "dev": true, - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.35", - "web3-providers-http": "1.0.0-beta.35", - "web3-providers-ipc": "1.0.0-beta.35", - "web3-providers-ws": "1.0.0-beta.35" - } - }, - "web3-core-subscriptions": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.0.0-beta.35.tgz", - "integrity": "sha512-gXzLrWvcGkGiWq1y33Z4Y80XI8XMrwowiQJkrPSjQ81K5PBKquOGwcMffLaKcwdmEy/NpsOXDeFo3eLE1Ghvvw==", - "dev": true, - "requires": { - "eventemitter3": "1.1.1", - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.35" - } - }, - "web3-eth": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.0.0-beta.35.tgz", - "integrity": "sha512-04mcb2nGPXThawuuYICPOxv0xOHofvQKsjZeIq+89nyOC8DQMGTAErDkGyMHQYtjpth5XDhic0wuEsA80AmFZA==", - "dev": true, - "optional": true, - "requires": { - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.35", - "web3-core-helpers": "1.0.0-beta.35", - "web3-core-method": "1.0.0-beta.35", - "web3-core-subscriptions": "1.0.0-beta.35", - "web3-eth-abi": "1.0.0-beta.35", - "web3-eth-accounts": "1.0.0-beta.35", - "web3-eth-contract": "1.0.0-beta.35", - "web3-eth-iban": "1.0.0-beta.35", - "web3-eth-personal": "1.0.0-beta.35", - "web3-net": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - } - }, - "web3-eth-abi": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.0.0-beta.35.tgz", - "integrity": "sha512-KUDC+EtFFYG8z01ZleKrASdjj327/rtWHzEt6RWsEj7bBa0bGp9nEh+nqdZx/Sdgz1O8tnfFzJlrRcXpfr1vGg==", - "dev": true, - "requires": { - "bn.js": "4.11.6", - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true - } - } - }, - "web3-eth-accounts": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.0.0-beta.35.tgz", - "integrity": "sha512-duIgRsfht/0kAW/eQ0X9lKtVIykbETrnM2H7EnvplCzPHtQLodpib4o9JXfh9n6ZDgdDC7cuJoiVB9QJg089ew==", - "dev": true, - "optional": true, - "requires": { - "any-promise": "1.3.0", - "crypto-browserify": "3.12.0", - "eth-lib": "0.2.7", - "scrypt.js": "0.2.0", - "underscore": "1.8.3", - "uuid": "2.0.1", - "web3-core": "1.0.0-beta.35", - "web3-core-helpers": "1.0.0-beta.35", - "web3-core-method": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - }, - "dependencies": { - "eth-lib": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", - "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - }, - "uuid": { - "version": "2.0.1", - "resolved": "http://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", - "dev": true, - "optional": true - } - } - }, - "web3-eth-contract": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.0.0-beta.35.tgz", - "integrity": "sha512-foPohOg5O1UCGKGZOIs+kQK5IZdV2QQ7pAWwNxH8WHplUA+fre1MurXNpoxknUmH6mYplFhXjqgYq2MsrBpHrA==", - "dev": true, - "optional": true, - "requires": { - "underscore": "1.8.3", - "web3-core": "1.0.0-beta.35", - "web3-core-helpers": "1.0.0-beta.35", - "web3-core-method": "1.0.0-beta.35", - "web3-core-promievent": "1.0.0-beta.35", - "web3-core-subscriptions": "1.0.0-beta.35", - "web3-eth-abi": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - } - }, - "web3-eth-iban": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.0.0-beta.35.tgz", - "integrity": "sha512-H5wkcNcAIc+h/WoDIKv7ZYmrM2Xqu3O7jBQl1IWo73EDVQji+AoB2i3J8tuwI1yZRInRwrfpI3Zuwuf54hXHmQ==", - "dev": true, - "requires": { - "bn.js": "4.11.6", - "web3-utils": "1.0.0-beta.35" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true - } - } - }, - "web3-eth-personal": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.0.0-beta.35.tgz", - "integrity": "sha512-AcM9nnlxu7ZRRxPvkrFB9eLxMM4A2cPfj2aCg21Wb2EpMnhR+b/O1cT33k7ApRowoMpM+T9M8vx2oPNwXfaCOQ==", - "dev": true, - "requires": { - "web3-core": "1.0.0-beta.35", - "web3-core-helpers": "1.0.0-beta.35", - "web3-core-method": "1.0.0-beta.35", - "web3-net": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - } - }, - "web3-net": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.0.0-beta.35.tgz", - "integrity": "sha512-bbwaQ/KohGjIJ6HAKbZ6KrklCAaG6/B7hIbAbVLSFLxF+Yz9lmAgQYaDInpidpC/NLb3WOmcbRF+P77J4qMVIA==", - "dev": true, - "requires": { - "web3-core": "1.0.0-beta.35", - "web3-core-method": "1.0.0-beta.35", - "web3-utils": "1.0.0-beta.35" - } - }, - "web3-provider-engine": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-14.1.0.tgz", - "integrity": "sha512-vGZtqhSUzGTiMGhJXNnB/aRDlrPZLhLnBZ2NPArkZtr8XSrwg9m08tw4+PuWg5za0TJuoE/vuPQc501HddZZWw==", - "requires": { - "async": "^2.5.0", - "backoff": "^2.5.0", - "clone": "^2.0.0", - "cross-fetch": "^2.1.0", - "eth-block-tracker": "^3.0.0", - "eth-json-rpc-infura": "^3.1.0", - "eth-sig-util": "^1.4.2", - "ethereumjs-block": "^1.2.2", - "ethereumjs-tx": "^1.2.0", - "ethereumjs-util": "^5.1.5", - "ethereumjs-vm": "^2.3.4", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "readable-stream": "^2.2.9", - "request": "^2.85.0", - "semaphore": "^1.0.3", - "ws": "^5.1.1", - "xhr": "^2.2.0", - "xtend": "^4.0.1" - }, - "dependencies": { - "eth-sig-util": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz", - "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", - "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#00ba8463a7f7a67fcad737ff9c2ebd95643427f7", - "ethereumjs-util": "^5.1.1" - } - }, - "ethereumjs-abi": { - "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#00ba8463a7f7a67fcad737ff9c2ebd95643427f7", - "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", - "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^5.0.0" - } - }, - "ws": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", - "requires": { - "async-limiter": "~1.0.0" - } - } - } - }, - "web3-providers-http": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.0.0-beta.35.tgz", - "integrity": "sha512-DcIMFq52Fb08UpWyZ3ZlES6NsNqJnco4hBS/Ej6eOcASfuUayPI+GLkYVZsnF3cBYqlH+DOKuArcKSuIxK7jIA==", - "dev": true, - "requires": { - "web3-core-helpers": "1.0.0-beta.35", - "xhr2-cookies": "1.1.0" - } - }, - "web3-providers-ipc": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.0.0-beta.35.tgz", - "integrity": "sha512-iB0FG0HcpUnayfa8pn4guqEQ4Y1nrroi/jffdtQgFkrNt0sD3fMSwwC0AbmECqj3tDLl0e1slBR0RENll+ZF0g==", - "dev": true, - "requires": { - "oboe": "2.1.3", - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.35" - } - }, - "web3-providers-ws": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.0.0-beta.35.tgz", - "integrity": "sha512-Cx64NgDStynKaUGDIIOfaCd0fZusL8h5avKTkdTjUu2aHhFJhZoVBGVLhoDtUaqZGWIZGcBJOoVf2JkGUOjDRQ==", - "dev": true, - "requires": { - "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.35", - "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "websocket": { - "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", - "from": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible", - "dev": true, - "requires": { - "debug": "^2.2.0", - "nan": "^2.3.3", - "typedarray-to-buffer": "^3.1.2", - "yaeti": "^0.0.6" - } - } - } - }, - "web3-shh": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.0.0-beta.35.tgz", - "integrity": "sha512-8qSonk/x0xabERS9Sr6AIADN/Ty+5KwARkkGIfSYHKqFpdMDz+76F7cUCxtoCZoS8K04xgZlDKYe0TJXLYA0Fw==", - "dev": true, - "optional": true, - "requires": { - "web3-core": "1.0.0-beta.35", - "web3-core-method": "1.0.0-beta.35", - "web3-core-subscriptions": "1.0.0-beta.35", - "web3-net": "1.0.0-beta.35" - } - }, - "web3-utils": { - "version": "1.0.0-beta.35", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.0.0-beta.35.tgz", - "integrity": "sha512-Dq6f0SOKj3BDFRgOPnE6ALbzBDCKVIW8mKWVf7tGVhTDHf+wQaWwQSC3aArFSqdExB75BPBPyDpuMTNszhljpA==", - "dev": true, - "requires": { - "bn.js": "4.11.6", - "eth-lib": "0.1.27", - "ethjs-unit": "0.1.6", - "number-to-bn": "1.7.0", - "randomhex": "0.1.5", - "underscore": "1.8.3", - "utf8": "2.1.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", - "dev": true - }, - "utf8": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.1.tgz", - "integrity": "sha1-LgHbAvfY0JRPdxBPFgnrDDBM92g=", - "dev": true - } - } - }, - "webpack": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.17.1.tgz", - "integrity": "sha512-vdPYogljzWPhFKDj3Gcp01Vqgu7K3IQlybc3XIdKSQHelK1C3eIQuysEUR7MxKJmdandZlQB/9BG2Jb1leJHaw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.5.13", - "@webassemblyjs/helper-module-context": "1.5.13", - "@webassemblyjs/wasm-edit": "1.5.13", - "@webassemblyjs/wasm-opt": "1.5.13", - "@webassemblyjs/wasm-parser": "1.5.13", - "acorn": "^5.6.2", - "acorn-dynamic-import": "^3.0.0", - "ajv": "^6.1.0", - "ajv-keywords": "^3.1.0", - "chrome-trace-event": "^1.0.0", - "enhanced-resolve": "^4.1.0", - "eslint-scope": "^4.0.0", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.3.0", - "loader-utils": "^1.1.0", - "memory-fs": "~0.4.1", - "micromatch": "^3.1.8", - "mkdirp": "~0.5.0", - "neo-async": "^2.5.0", - "node-libs-browser": "^2.0.0", - "schema-utils": "^0.4.4", - "tapable": "^1.0.0", - "uglifyjs-webpack-plugin": "^1.2.4", - "watchpack": "^1.5.0", - "webpack-sources": "^1.0.1" - }, - "dependencies": { - "ajv": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", - "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } - } - }, - "webpack-bundle-size-analyzer": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/webpack-bundle-size-analyzer/-/webpack-bundle-size-analyzer-2.7.0.tgz", - "integrity": "sha1-LsBTn9V/hxYIOJizi4kv6UyIxrw=", - "dev": true, - "requires": { - "commander": "^2.7.1", - "filesize": "^3.1.2", - "humanize": "0.0.9" - } - }, - "webpack-cli": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.1.0.tgz", - "integrity": "sha512-p5NeKDtYwjZozUWq6kGNs9w+Gtw/CPvyuXjXn2HMdz8Tie+krjEg8oAtonvIyITZdvpF7XG9xDHwscLr2c+ugQ==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "cross-spawn": "^6.0.5", - "enhanced-resolve": "^4.0.0", - "global-modules-path": "^2.1.0", - "import-local": "^1.0.0", - "inquirer": "^6.0.0", - "interpret": "^1.1.0", - "loader-utils": "^1.1.0", - "supports-color": "^5.4.0", - "v8-compile-cache": "^2.0.0", - "yargs": "^12.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - } - }, - "decamelize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", - "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==", - "dev": true, - "requires": { - "xregexp": "4.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "os-locale": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", - "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", - "dev": true, - "requires": { - "execa": "^0.10.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, - "p-limit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", - "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "yargs": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz", - "integrity": "sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^2.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^10.1.0" - } - }, - "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } - }, - "webpack-sources": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz", - "integrity": "sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA==", - "dev": true, - "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "websocket": { - "version": "1.0.26", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.26.tgz", - "integrity": "sha512-fjcrYDPIQxpTnqFQ9JjxUQcdvR89MFAOjPBlF+vjOt49w/XW4fJknUoMz/mDIn2eK1AdslVojcaOxOqyZZV8rw==", + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.28.tgz", + "integrity": "sha512-00y/20/80P7H4bCYkzuuvvfDvh+dgtXi5kzDf3UcZwN6boTYaKvsrtZ5lIYm1Gsg48siMErd9M4zjSYfYFHTrA==", "requires": { "debug": "^2.2.0", - "nan": "^2.3.3", - "typedarray-to-buffer": "^3.1.2", + "nan": "^2.11.0", + "typedarray-to-buffer": "^3.1.5", "yaeti": "^0.0.6" }, "dependencies": { @@ -8874,183 +410,33 @@ } } }, - "whatwg-fetch": { - "version": "2.0.4", - "resolved": "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", - "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" - }, - "window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" - }, - "worker-farm": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", - "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", - "dev": true, - "requires": { - "errno": "~0.1.7" - } - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "websocket-as-promised": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/websocket-as-promised/-/websocket-as-promised-0.9.0.tgz", + "integrity": "sha512-6Pm5Tl528UloGWY13gTphOYBknH/+kjMEAVmS/oFVKHc9LMAVy5xWpFRZWiu+qOjQk14NOTxvHTBCBEzvUZFlA==", "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "chnl": "^0.4.1", + "flat-options": "^0.1.3", + "promise-controller": "^0.3.0", + "promise.prototype.finally": "^3.1.0" } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - } - }, - "xhr": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", - "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", - "requires": { - "global": "~4.3.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "xhr-request": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", - "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", - "dev": true, - "requires": { - "buffer-to-arraybuffer": "^0.0.5", - "object-assign": "^4.1.1", - "query-string": "^5.0.1", - "simple-get": "^2.7.0", - "timed-out": "^4.0.1", - "url-set-query": "^1.0.0", - "xhr": "^2.0.4" - }, - "dependencies": { - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - } - } - }, - "xhr-request-promise": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz", - "integrity": "sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0=", - "dev": true, - "requires": { - "xhr-request": "^1.0.1" - } - }, - "xhr2-cookies": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", - "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", - "dev": true, - "requires": { - "cookiejar": "^2.1.1" - } - }, - "xregexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz", - "integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, "yaeti": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "yn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", "dev": true - }, - "yargs": { - "version": "4.8.1", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", - "requires": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" - } - }, - "yargs-parser": { - "version": "2.4.1", - "resolved": "http://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", - "requires": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" - } - }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "dev": true, - "optional": true, - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } } } } diff --git a/package.json b/package.json index da5dd55e9c..0cab4a85af 100644 --- a/package.json +++ b/package.json @@ -3,69 +3,30 @@ "version": "2.2.1", "main": "./index.js", "engines": { - "node": ">=8.9.0" + "node": ">=8.9.0", + "npm": ">=6.4.1" }, "directories": { "lib": "./lib" }, "scripts": { - "build": "npm run build-core", - "build-core": "webpack-cli --config ./webpack/node/core.webpack.config.js", - "build-provider": "webpack-cli --config ./webpack/node/provider.webpack.config.js", - "build-server": "webpack-cli --config ./webpack/node/server.webpack.config.js", - "build-web": "webpack-cli --config ./webpack/web-experimental/core.webpack.config.js && webpack-cli --config ./webpack/web-experimental/server.webpack.config.js && webpack-cli --config ./webpack/web-experimental/provider.webpack.config.js", - "prepublishOnly": "npm run test && npm run build && npm run test-build", - "test": "mocha --check-leaks --recursive --globals _scratch,sanitizedData", - "test-build": "cross-env TEST_BUILD=node mocha --check-leaks --recursive --globals _scratch,sanitizedData", - "test-web-experimental": "cross-env TEST_BUILD=web-experimental mocha --check-leaks --recursive --globals _scratch,sanitizedData" + "build": "tsc", + "test": "mocha -r ts-node/register test/**.* --recursive" }, "dependencies": { - "abstract-leveldown": "3.0.0", - "async": "2.6.1", - "bip39": "2.5.0", - "bn.js": "4.11.8", - "cachedown": "1.0.0", - "clone": "2.1.2", - "debug": "3.1.0", - "encoding-down": "5.0.4", - "eth-sig-util": "2.0.2", - "ethereumjs-abi": "0.6.5", - "ethereumjs-account": "2.0.5", - "ethereumjs-block": "1.2.2", - "ethereumjs-tx": "1.3.4", - "ethereumjs-util": "5.2.0", - "ethereumjs-vm": "2.4.0", - "heap": "0.2.6", - "intercept-require": "^1.1.0", - "level-sublevel": "6.6.4", - "levelup": "3.1.1", - "lodash": "4.17.10", - "merkle-patricia-tree": "2.3.1", - "seedrandom": "2.4.4", - "tmp": "0.0.33", - "web3-provider-engine": "^14.0.6", - "websocket": "1.0.26" + "websocket": "1.0.28", + "websocket-as-promised": "0.9.0" }, "devDependencies": { - "ethereumjs-wallet": "0.6.2", - "assert-match": "1.1.1", - "browserfs": "1.4.3", - "cross-env": "5.2.0", - "memdown": "1.3.1", - "mocha": "5.2.0", - "pify": "4.0.0", - "solc": "0.4.24", - "source-map-support": "^0.5.9", - "temp": "0.8.3", - "webpack": "4.17.1", - "webpack-bundle-size-analyzer": "2.7.0", - "webpack-cli": "3.1.0", - "web3": "1.0.0-beta.35" - }, - "optionalDependencies": { - "ethereumjs-wallet": "0.6.2", - "web3": "1.0.0-beta.35" + "@types/bn.js": "^4.11.2", + "@types/chai": "^4.1.6", + "@types/mocha": "^5.2.5", + "@types/node": "^10.12.0", + "mocha": "^5.2.0", + "ts-node": "^7.0.1", + "typescript": "^3.1.3" }, + "optionalDependencies": {}, "repository": { "type": "git", "url": "https://github.com/trufflesuite/ganache-core" diff --git a/perf/transactions.js b/perf/transactions.js deleted file mode 100755 index 7d6096e259..0000000000 --- a/perf/transactions.js +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env node -var TestRPC = require("../"); -var Web3 = require("web3"); -var async = require("async") - -var server = TestRPC.server(); -var port = 12345; -var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:" + port)); - -function runTest(times, fn, callback) { - var start = new Date(); - - async.timesSeries(times, fn, function(err) { - if (err) return callback(err); - - var end = new Date(); - var actualTime = end.getTime() - start.getTime(); - - callback(null, actualTime); - }); -} - -function runAverage(title, number_of_runs, fn_times, fn, callback) { - var results = new Array(number_of_runs); - - async.timesSeries(number_of_runs, function(n, next) { - process.stdout.write(title + " " + (n + 1) + "..."); - - runTest(fn_times, fn, function(err, totalTime) { - if (err) return next(err); - results[n] = totalTime; - - console.log((totalTime / 1000) + " seconds"); - next(); - }); - }, function(err) { - if (err) return callback(err); - - var sum = results.reduce(function(a, b) { - return a + b; - }, 0); - - var average = sum / number_of_runs; - - console.log("Average " + (average / 1000) + " seconds"); - - callback(null, average); - }); -}; - -function bailIfError(err) { - if (err) { - console.log(err); - process.exit(1); - } -} - -server.listen(port, function(err) { - bailIfError(err); - - web3.eth.getAccounts(function(err, accounts) { - bailIfError(err); - - runAverage("Running transactions test", 4, 1000, function(n, cb) { - web3.eth.sendTransaction({ - from: accounts[0], - to: accounts[1], - value: 500, // wei - gas: 90000 - }, cb); - }, function(err) { - bailIfError(err); - server.close(); - }); - }); -}); diff --git a/public-exports.js b/public-exports.js deleted file mode 100644 index 8fad25264d..0000000000 --- a/public-exports.js +++ /dev/null @@ -1,16 +0,0 @@ -// make sourcemaps work! -require('source-map-support/register'); - -const Provider = require("./lib/provider"); -const Server = require("./lib/server"); - -// This interface exists so as not to cause breaking changes. -module.exports = { - server: function(options) { - return Server.create(options); - }, - provider: function(options) { - return new Provider(options); - }, - _webpacked: true -}; \ No newline at end of file diff --git a/src/options/options.ts b/src/options/options.ts new file mode 100644 index 0000000000..87073f36af --- /dev/null +++ b/src/options/options.ts @@ -0,0 +1,124 @@ +import Account from "../types/account"; +import HexData from "../types/hex-data"; +import HexQuantity from "../types/hex-quantity"; + +interface Logger { + log(...args: any[]): void; +} + +export default class Options { + /** + * Array of Accounts. Each object should have a balance key with a hexadecimal + * value. The key secretKey can also be specified, which represents the + * account's private key. If no secretKey, the address is auto-generated with + * the given balance. If specified, the key is used to determine the account's + * address. + */ + public accounts: Array = null + + /** + * Output VM opcodes for debugging. Defaults to `false` + */ + public debug: boolean = false + + /** + * An object, like console, that implements a log() function. + */ + public logger: {log: Logger} = null + + /** + * Use a specific HD wallet mnemonic to generate initial addresses. + */ + public mnemonic: string = null + + /** + * Use arbitrary data to generate the HD wallet mnemonic to be used. + */ + public seed: string = null + + /** + * The default account balance, specified in ether. Defaults to `100` ether + */ + public default_balance_ether: number = 100 + + /** + * Number of accounts to generate at startup. Default to `10`. + */ + public total_accounts: number = 10 + + /** + * When a string, same as --fork option above. Can also be a Web3 Provider + * object, optionally used in conjunction with the fork_block_number + */ + public fork: string | object = null + + /** + * Block number the provider should fork from, when the fork option is + * specified. If the fork option is specified as a string including the @ + * sign and a block number, the block number in the fork parameter takes + * precedence. + */ + public fork_block_number: string | number = null + + /** + * Same as --networkId option above. + */ + public network_id: number = null + + /** + * Date that the first block should start. Use this feature, along with the + * evm_increaseTime method to test time-dependent code. + */ + public time: Date = null + + /** + * Whether or not accounts are locked by default. Defaults to `false` + */ + public locked: boolean = false + + /** + * Array of addresses or address indexes specifying which accounts should be unlocked. + */ + public unlocked_accounts: Array = null + + /** + * Specify a path to a directory to save the chain database. If a database + * already exists, that chain will be initialized instead of creating a new + * one. + */ + public db_path: String = null + + /** + * Specify an alternative database instance, for instance MemDOWN. + */ + public db: Object = null + + /** + * Whether to report runtime errors from EVM code as RPC errors. + * This is `true` by default to replicate the error reporting behavior of + * previous versions of ganache. + */ + public vmErrorsOnRPCResponse: boolean = true + + /** + * The hierarchical deterministic path to use when generating accounts. + * Default: "m/44'/60'/0'/0/" + */ + public hdPath: string = "m/44'/60'/0'/0/" + + /** + * Allows unlimited contract sizes while debugging. By setting this to true, the check within the EVM for contract size limit of 24KB (see EIP-170) is bypassed. Setting this to true will cause ganache-core to behave differently than production environments. (default: false; ONLY set to true during debugging). + */ + public allowUnlimitedContractSize: boolean = true + /** + * Sets the default gas price for transactions if not otherwise specified. + * Must be specified as a hex string in wei. Defaults to "0x77359400", or 2 gwei. + */ + public gasPrice: HexQuantity = new HexQuantity("0x77359400") + + /** + * Sets the block gas limit. Must be specified as a hex string. Defaults to + * "0x6691b7". + */ + public gasLimit: HexQuantity = new HexQuantity("0x6691b7") +} diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts new file mode 100644 index 0000000000..1279b693aa --- /dev/null +++ b/src/options/provider-options.ts @@ -0,0 +1,5 @@ +import Options from "./options"; + +export default class ProviderOptions extends Options { + +} diff --git a/src/options/server-options.ts b/src/options/server-options.ts new file mode 100644 index 0000000000..00f0aefc61 --- /dev/null +++ b/src/options/server-options.ts @@ -0,0 +1,23 @@ +import Options from "./options"; + +export default class ServerOptions extends Options { + /** + * The number of milliseconds of inactivity the http server needs to wait for + * additional incoming data, after it has finished writing the last response, + * before a socket will be destroyed. This does not affect the websocket + * server. + * + * A value of 0 will disable the keep-alive timeout behavior on incoming connections. + */ + public readonly keepAliveTimeout: number = 5000 + + /** + * Port number to listen on when running as a server. Defaults to `8545` + */ + public readonly port: number = 8545 + + /** + * Enable a websocket server. This is `true` by default. + */ + public ws: boolean = true +} diff --git a/src/provider.ts b/src/provider.ts new file mode 100644 index 0000000000..2948f9bf75 --- /dev/null +++ b/src/provider.ts @@ -0,0 +1,24 @@ +import _ProviderOptions from "./options/provider-options"; +import { EventEmitter } from "events"; + +export type ProviderOptions = _ProviderOptions; +export const ProviderOptions = _ProviderOptions; + +/** + * + */ +export default class Provider extends EventEmitter { + public options: Object; + constructor(options: ProviderOptions) { + super(); + this.options = options; + } + public async send(payload: Object, callback?: (err: Error, response: any) => void): Promise { + if (!callback) { + return new Promise((resolve, reject) => { + resolve({}); + }); + } + return; + } +} diff --git a/src/server.ts b/src/server.ts new file mode 100644 index 0000000000..bc6b38434e --- /dev/null +++ b/src/server.ts @@ -0,0 +1,13 @@ +import _ServerOptions from "./options/server-options"; + +export type ServerOptions = _ServerOptions; +export const ServerOptions = _ServerOptions; + +/** + * + */ +export default class Server { + constructor(options: ServerOptions) { + + } +} diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/servers/ws-server..ts b/src/servers/ws-server..ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/types/account.ts b/src/types/account.ts new file mode 100644 index 0000000000..3da8157f34 --- /dev/null +++ b/src/types/account.ts @@ -0,0 +1,11 @@ +import HexData from "./hex-data"; +import HexQuantity from "./hex-quantity"; + +export default class Account { + public address: HexData + public balance: HexQuantity = new HexQuantity("0x0") + public secretKey: HexData + constructor(address: HexData) { + this.address = address; + } +} diff --git a/src/types/hex-data.ts b/src/types/hex-data.ts new file mode 100644 index 0000000000..c36c69a31b --- /dev/null +++ b/src/types/hex-data.ts @@ -0,0 +1,12 @@ +export default class HexData { + private data: any; + constructor(data: string) { + if(data.indexOf("0x") !== -1) { + throw new TypeError("Invalid hex data"); + } + this.data = data + } + toString() { + return this.data; + } +} diff --git a/src/types/hex-quantity.ts b/src/types/hex-quantity.ts new file mode 100644 index 0000000000..02535308df --- /dev/null +++ b/src/types/hex-quantity.ts @@ -0,0 +1,35 @@ +export default class HexQuantity { + private data: any; + + constructor(quantity: Buffer | number | string) { + + if (quantity instanceof Buffer) { + // TODO: totally wrong + this.data = quantity; + } else { + switch (typeof quantity) { + case "number": + this.data = quantity; + break; + case "string": + if (quantity.indexOf("0x") !== -1) { + throw new TypeError("Invalid hex data"); + } else { + // TODO: handle big numbers + const num = Number(quantity); + if (isNaN(num)) { + throw new Error("quantity string is not a number.") + } else { + this.data = num; + } + } + break; + default: + throw new TypeError("quantity is not a Buffer, number, or string"); + } + } + } + toString() { + return this.data; + } +} diff --git a/test/DebugContract.sol b/test/DebugContract.sol deleted file mode 100644 index fdfcb91077..0000000000 --- a/test/DebugContract.sol +++ /dev/null @@ -1,12 +0,0 @@ -pragma solidity ^0.4.2; - -// Changes to this file will make tests fail. -contract DebugContract { - uint public value = 5; - uint public otherValue = 5; - - function setValue(uint _val) { - value = _val; - otherValue += _val; - } -} diff --git a/test/EstimateGas.sol b/test/EstimateGas.sol deleted file mode 100644 index 6e087f5bca..0000000000 --- a/test/EstimateGas.sol +++ /dev/null @@ -1,89 +0,0 @@ -pragma solidity ^0.4.2; - -// From https://github.com/ethereumjs/testrpc/issues/58 -contract EstimateGas { - event Add(bytes32 name, bytes32 description, uint value, address owner); - - struct Test { - bytes32 name; - bytes32 description; - uint[] balances; - mapping(address => uint) owners; - } - - uint256 public x; - function reset() public { - x = 0; - } - function triggerRsclearRefund() public { - x = gasleft(); - reset(); - } - function triggerRselfdestructRefund() public { - selfdestruct(msg.sender); - } - function triggerAllRefunds() public { - triggerRsclearRefund(); - triggerRselfdestructRefund(); - } - - - // https://github.com/trufflesuite/ganache-cli/issues/294 - mapping (uint => uint) public uints; - // Sets the uints[1] slot to a value; - function store(uint _uint) public { uints[1] = _uint;} - function clear() public { delete uints[1]; } - - mapping(bytes32 => uint) index; - Test[] tests; - - function EstimateGas() { - tests.length++; - } - - function add(bytes32 _name, bytes32 _description, uint _value) returns(bool) { - if (index[_name] != 0) { - return false; - } - uint pos = tests.length++; - tests[pos].name = _name; - tests[pos].description = _description; - tests[pos].balances.length = 2; - tests[pos].balances[1] = _value; - tests[pos].owners[msg.sender] = 1; - index[_name] = pos; - Add(_name, _description, _value, msg.sender); - return true; - } - - function transfer(address _to, uint _value, bytes32 _name) returns(bool) { - uint pos = index[_name]; - if (pos == 0) { - return false; - } - - uint posFrom = tests[pos].owners[msg.sender]; - if (posFrom == 0) { - return false; - } - - if (tests[pos].balances[posFrom] < _value) { - return false; - } - - uint posTo = tests[pos].owners[_to]; - if (posTo == 0) { - uint posBal = tests[pos].balances.length++; - tests[pos].owners[_to] = posBal; - posTo = posBal; - } - - if (tests[pos].balances[posTo] + _value < tests[pos].balances[posTo]) { - return false; - } - tests[pos].balances[posFrom] -= _value; - tests[pos].balances[posTo] += _value; - - return true; - } -} diff --git a/test/Example.sol b/test/Example.sol deleted file mode 100644 index 87cf253013..0000000000 --- a/test/Example.sol +++ /dev/null @@ -1,16 +0,0 @@ -pragma solidity ^0.4.2; - -contract Example { - uint public value; - - event ValueSet(uint); - - function Example() payable { - value = 5; - } - - function setValue(uint val) { - value = val; - ValueSet(val); - } -} diff --git a/test/LargeContract.sol b/test/LargeContract.sol deleted file mode 100644 index e85e677231..0000000000 --- a/test/LargeContract.sol +++ /dev/null @@ -1,8 +0,0 @@ -pragma solidity ^0.4.2; - -// Changes to this file will make tests fail. -contract LargeContract { - function LargeFunction() public pure returns (string) { - return "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - } -} \ No newline at end of file diff --git a/test/Oracle.sol b/test/Oracle.sol deleted file mode 100644 index 6a357e9960..0000000000 --- a/test/Oracle.sol +++ /dev/null @@ -1,15 +0,0 @@ -pragma solidity ^0.4.2; - -contract Oracle{ - bytes32 public blockhash0; - uint public lastBlock; - function Oracle(){ - blockhash0 = block.blockhash(0); - } - function currentBlock() returns (uint) { - return block.number; - } - function setCurrentBlock() { - lastBlock = block.number; - } -} diff --git a/test/Revert.sol b/test/Revert.sol deleted file mode 100644 index bb923510d4..0000000000 --- a/test/Revert.sol +++ /dev/null @@ -1,13 +0,0 @@ -pragma solidity ^0.4.18; - -contract Revert { - uint public value; - - event ValueSet(uint); - - function alwaysReverts(uint val) public { - value = val; - ValueSet(val); - revert(); - } -} diff --git a/test/RuntimeError.sol b/test/RuntimeError.sol deleted file mode 100644 index cc390010de..0000000000 --- a/test/RuntimeError.sol +++ /dev/null @@ -1,22 +0,0 @@ -pragma solidity ^0.4.2; - -// Changes to this file will make tests fail. -contract RuntimeError { - function error() { - for (uint i = 0; i < 3; ) { - i++; - } - throw; - } - - function errorWithMessage() { - for (uint i = 0; i < 3; ) { - i++; - } - revert("Message"); - } - - function success() { - - } -} diff --git a/test/accounts.js b/test/accounts.js deleted file mode 100644 index c00ec3b3bf..0000000000 --- a/test/accounts.js +++ /dev/null @@ -1,220 +0,0 @@ -var BN = require('bn.js'); -var Web3 = require('web3'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var assert = require('assert'); - -describe("Accounts", function() { - var expected_address = "0x604a95C9165Bc95aE016a5299dd7d400dDDBEa9A"; - var mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; - - it("should respect the BIP99 mnemonic", function(done) { - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - mnemonic: mnemonic, - })); - - web3.eth.getAccounts(function(err, accounts) { - if (err) return done(err); - - assert(accounts[0].toLowerCase(), expected_address.toLowerCase()); - done(); - }); - }); - - it("should lock all accounts when specified", function(done) { - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - mnemonic: mnemonic, - secure: true, - })); - - web3.eth.sendTransaction({ - from: expected_address, - to: "0x1234567890123456789012345678901234567890", // doesn't need to exist - value: web3.utils.toWei(new BN(1), "ether"), - gasLimit: 90000 - }, function(err, tx) { - if (!err) return done(new Error("We expected the account to be locked, which should throw an error when sending a transaction")); - assert(err.message.toLowerCase().indexOf("could not unlock signer account") >= 0, - 'Expected error message containing "could not unlock signer account" ' + - '(case insensitive check). Received the following error message, instead. ' + - `"${err.message}"`) - done(); - }); - }); - - it("should unlock specified accounts, in conjunction with --secure", function(done) { - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - mnemonic: mnemonic, - secure: true, - unlocked_accounts: [expected_address], - })); - - web3.eth.sendTransaction({ - from: expected_address, - to: "0x1234567890123456789012345678901234567890", // doesn't need to exist - value: web3.utils.toWei(new BN(1), "ether"), - gasLimit: 90000 - }, function(err, tx) { - if (err) return done(err); - // We should have no error here because the account is unlocked. - done(); - }); - }); - - it("should unlock specified accounts, in conjunction with --secure, using array indexes", function(done) { - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - mnemonic: mnemonic, - secure: true, - unlocked_accounts: [0] - })); - - web3.eth.sendTransaction({ - from: expected_address, - to: "0x1234567890123456789012345678901234567890", // doesn't need to exist - value: web3.utils.toWei(new BN(1), "ether"), - gasLimit: 90000 - }, function(err, tx) { - if (err) return done(err); - // We should have no error here because the account is unlocked. - done(); - }); - }); - - it("should unlock accounts even if private key isn't managed by the testrpc (impersonation)", function() { - var second_address = "0x1234567890123456789012345678901234567890"; - - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - mnemonic: mnemonic, - secure: true, - unlocked_accounts: [0, second_address], - })); - - // Set up: give second address some ether - return web3.eth.sendTransaction({ - from: expected_address, - to: second_address, - value: web3.utils.toWei(new BN(10), "ether"), - gasLimit: 90000 - }).then(() => { - // Now we should be able to send a transaction from second address without issue. - return web3.eth.sendTransaction({ - from: second_address, - to: expected_address, - value: web3.utils.toWei(new BN(5), "ether"), - gasLimit: 90000 - }); - }).then(tx => { - // And for the heck of it let's check the balance just to make sure it went through - return web3.eth.getBalance(second_address); - }).then(balance => { - var balanceInEther = web3.utils.fromWei(new BN(balance), "ether"); - - if (typeof balanceInEther === 'string') { - balanceInEther = parseFloat(balanceInEther); - } else { - balanceInEther.toNumber(); - } - - // Can't check the balance exactly. It cost some ether to send the transaction. - assert(balanceInEther > 4); - assert(balanceInEther < 5); - }); - }); - - it("errors when we try to sign a transaction from an account we're impersonating", function() { - var second_address = "0x1234567890123456789012345678901234567890"; - - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - mnemonic: mnemonic, - secure: true, - unlocked_accounts: [0, second_address], - })); - - return web3.eth.sign("some data", second_address) - .then(result => { - assert.fail("Expected an error while signing when not managing the private key") - }).catch(err => { - assert(err.message.toLowerCase().indexOf("cannot sign data; no private key") >= 0); - }); - }); - - it("should create a 2 accounts when passing an object to provider", function(done) { - - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - accounts: [ - { balance: '0x12' }, - { balance: '0x13' } - ], - })); - - web3.eth.getAccounts(function(err, result) { - if (err) return done(err); - assert(result.length, 2, "The number of accounts created should be 2"); - done(); - }) - }) - - - it("should create a 7 accounts when ", function(done) { - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - total_accounts: 7, - })); - - web3.eth.getAccounts(function(err, result) { - if (err) return done(err); - assert(result.length, 7, "The number of accounts created should be 7"); - done(); - }) - }) - - it("should respect the default_balance_ether option", function(done) { - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - default_balance_ether: 1.23456, - })); - - web3.eth.getAccounts(function(err, accounts) { - if (err) return done(err); - - function checkBalance(account) { - return new Promise(function(accept, reject) { - web3.eth.getBalance(accounts[0], function(err, balance) { - if (err) return reject(err); - - var balanceInEther = web3.utils.fromWei(balance, "Ether"); - - assert.equal(balanceInEther, 1.23456); - return accept(balance); - }); - }); - } - - accounts.reduce((promise, account, index) => { - var returnVal; - - if (promise) { - returnVal = promise.then(checkBalance(account)); - } else { - returnVal = checkBalance(account); - } - - if (index == accounts.length - 1) { - returnVal.then(done()) - .catch((err) => { done(err); }); - } - - return returnVal; - }, null); - - }); - }); - - -}); diff --git a/test/bad_input.js b/test/bad_input.js deleted file mode 100644 index cce46fff53..0000000000 --- a/test/bad_input.js +++ /dev/null @@ -1,176 +0,0 @@ -var Web3 = require('web3'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var assert = require('assert-match'); -var regex = require('assert-match/matchers').regex; - - -var tests = function(web3) { - var accounts; - - // The second request, after the first in each of these tests, - // informs us whether or not the provider crashed. - function secondRequest(callback) { - web3.eth.getAccounts(callback); - } - - describe("bad input", function() { - before(function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs; - done(); - }); - }); - - it("recovers after to address that isn't a string", function(done) { - var provider = web3.currentProvider; - - provider.send({ - "jsonrpc": "2.0", - "method": "eth_sendTransaction", - "params": [ - { - "value": "0x0", - "gas": "0xf4240", - "from": accounts[0], - // Buffers have been sent in the past - "to": { - "type": "Buffer", - "data": [ - // ... - ] - }, - "data": "0xe1fa8e84666f6f0000000000000000000000000000000000000000000000000000000000" - } - ], - "id": 2 - }, function() { - // Ignore any errors, but make sure we can make the second request - secondRequest(done); - }); - }); - - it("recovers after bad nonce (too high)", function(done) { - var provider = web3.currentProvider; - - var request = { - "jsonrpc": "2.0", - "method": "eth_sendTransaction", - "params": [ - { - "value": "0x10000000", - "gas": "0xf4240", - "from": accounts[0], - "to": accounts[1], - "nonce": "0xffffffff", // too big nonce - } - ], - "id": 2 - } - - provider.send(request, function(err, result) { - // We're supposed to get an error the first time. Let's assert we get the right one. - // Note that if using the Ganache as a provider, err will be non-null when there's - // an error. However, when using it as a server it won't be. In both cases, however, - // result.error should be set with the same error message. We'll check for that. - assert(result.error.message.indexOf("the tx doesn't have the correct nonce. account has nonce of: 0 tx has nonce of: 4294967295") >= 0); - - delete request.params[0].nonce - provider.send(request, done) - }); - }); - - it("recovers after bad nonce (too low)", function(done) { - var provider = web3.currentProvider; - - var request = { - "jsonrpc": "2.0", - "method": "eth_sendTransaction", - "params": [ - { - "value": "0x10000000", - "gas": "0xf4240", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x00", // too low nonce - } - ], - "id": 2 - } - - provider.send(request, function(err, result) { - // We're supposed to get an error the first time. Let's assert we get the right one. - // Note that if using the Ganache as a provider, err will be non-null when there's - // an error. However, when using it as a server it won't be. In both cases, however, - // result.error should be set with the same error message. We'll check for that. - assert(/the tx doesn't have the correct nonce. account has nonce of: 1 tx has nonce of: 0/.test(result.error.message), - `Expected incorrect nonce error, got '${result.error.message}', instead.`) - - delete request.params[0].nonce - provider.send(request, done) - }); - }); - - it("recovers after bad balance", function(done) { - web3.eth.getBalance(accounts[0], function(err, balance) { - if (err) return done(err); - - var provider = web3.currentProvider; - - var request = { - "jsonrpc": "2.0", - "method": "eth_sendTransaction", - "params": [ - { - "value": "0x1000000000000000000000000000", - "gas": "0xf4240", - "from": accounts[0], - "to": accounts[1] - } - ], - "id": 2 - } - - provider.send(request, function(err, result) { - // We're supposed to get an error the first time. Let's assert we get the right one. - // Note that if using the Ganache as a provider, err will be non-null when there's - // an error. However, when using it as a server it won't be. In both cases, however, - // result.error should be set with the same error message. We'll check for that. - assert.deepEqual(result.error.message, regex(/sender doesn't have enough funds to send tx. The upfront cost is: \d+ and the sender's account only has: \d+/), - `Unexpected error message. Got ${result.error.message}.`); - - request.params[0].value = "0x5"; - provider.send(request, done) - }); - }) - }); - }) -}; - -describe("Provider:", function() { - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - })); - tests(web3); -}); - -describe("Server:", function(done) { - var web3 = new Web3(); - var port = 12345; - var server; - - before("Initialize Ganache server", function(done) { - server = Ganache.server({ - }); - server.listen(port, function() { - web3.setProvider(new Web3.providers.HttpProvider("http://localhost:" + port)); - done(); - }); - }); - - after("Shutdown server", function(done) { - server.close(done); - }); - - tests(web3); -}); diff --git a/test/block_tags.js b/test/block_tags.js deleted file mode 100644 index c5b4324ec0..0000000000 --- a/test/block_tags.js +++ /dev/null @@ -1,141 +0,0 @@ -var Web3 = require('web3'); -var utils = require('ethereumjs-util'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var fs = require("fs"); -var solc = require("solc"); -var async = require("async"); -var to = require("../lib/utils/to.js"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -var logger = { - log: function(msg) { /*noop*/ } -}; - -var source = fs.readFileSync("./test/Example.sol", {encoding: "utf8"}); -var result = solc.compile(source, 1); - -// Note: Certain properties of the following contract data are hardcoded to -// maintain repeatable tests. If you significantly change the solidity code, -// make sure to update the resulting contract data with the correct values. -var contract = { - solidity: source, - abi: result.contracts[":Example"].interface, - binary: "0x" + result.contracts[":Example"].bytecode, - position_of_value: "0x0000000000000000000000000000000000000000000000000000000000000000", - expected_default_value: 5, - call_data: { - gas: '0x2fefd8', - gasPrice: '0x01', // This is important, as passing it has exposed errors in the past. - to: null, // set by test - data: '0x3fa4f245' - }, - transaction_data: { - from: null, // set by test - gas: '0x2fefd8', - to: null, // set by test - data: '0x552410770000000000000000000000000000000000000000000000000000000000000019' // sets value to 25 (base 10) - } -}; - -describe("Block Tags", function() { - var accounts; - var web3 = new Web3(Ganache.provider()); - var contractAddress; - - var initial_block_number; - var initial = {}; - - before("Gather accounts", function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs; - done(); - }); - }); - - before("Get initial block number", function(done) { - web3.eth.getBlockNumber(function(err, n) { - if (err) return done(err); - initial_block_number = to.number(n); - done(); - }); - }); - - before("Get initial balance and nonce", function(done) { - async.parallel({ - balance: web3.eth.getBalance.bind(web3.eth, accounts[0]), - nonce: web3.eth.getTransactionCount.bind(web3.eth, accounts[0]) - }, function(err, result) { - if (err) return done(err); - initial = result; - initial.nonce = to.number(initial.nonce); - done(); - }); - }); - - before("Make transaction that changes balance, nonce and code", function(done) { - web3.eth.sendTransaction({ - from: accounts[0], - data: contract.binary, - gas: 3141592 - }, function(err, tx) { - if (err) return done(err); - - web3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - - contractAddress = receipt.contractAddress; - done(); - }); - }); - }); - - it("should return the initial nonce at the previous block number", function(done) { - web3.eth.getTransactionCount(accounts[0], initial_block_number, function(err, nonce) { - if (err) return done(err); - assert.equal(nonce, initial.nonce); - - // Check that the nonce incremented with the block number, just to be sure. - web3.eth.getTransactionCount(accounts[0], initial_block_number + 1, function(err, nonce) { - if (err) return done(err); - assert.equal(nonce, initial.nonce + 1); - done(); - }); - }); - }); - - it("should return the initial balance at the previous block number", function(done) { - web3.eth.getBalance(accounts[0], initial_block_number, function(err, balance) { - if (err) return done(err); - assert.equal(balance, initial.balance); - - // Check that the balance incremented with the block number, just to be sure. - web3.eth.getBalance(accounts[0], initial_block_number + 1, function(err, balance) { - if (err) return done(err); - var initialBalanceInEther = parseFloat(web3.utils.fromWei(initial.balance, 'ether')); - var balanceInEther = parseFloat(web3.utils.fromWei(balance, 'ether')); - assert(balanceInEther < initialBalanceInEther); - done(); - }); - }); - }); - - it("should return the no code at the previous block number", function(done) { - web3.eth.getCode(contractAddress, initial_block_number, function(err, code) { - if (err) return done(err); - assert.equal(code, "0x"); - - // Check that the code incremented with the block number, just to be sure. - web3.eth.getCode(contractAddress, initial_block_number + 1, function(err, code) { - if (err) return done(err); - assert.notEqual(code, "0x"); - assert(code.length > 20); // Just because we don't know the actual code we're supposed to get back - done(); - }); - }); - }); -}); diff --git a/test/call.js b/test/call.js deleted file mode 100644 index e6b2bf7c7f..0000000000 --- a/test/call.js +++ /dev/null @@ -1,71 +0,0 @@ -var Web3 = require('web3'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var fs = require("fs"); -var path = require("path"); -var solc = require("solc"); -var to = require("../lib/utils/to.js"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -describe("eth_call", function() { - var web3 = new Web3(Ganache.provider({})); - var accounts; - var estimateGasContractData; - var estimateGasContractAbi; - var EstimateGasContract; - var estimateGasInstance; - var deploymentReceipt; - var source = fs.readFileSync(path.join(__dirname, "EstimateGas.sol"), "utf8"); - - before("get accounts", function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs; - done(); - }); - }); - - before("compile source and deploy", function() { - this.timeout(10000); - var result = solc.compile({sources: {"EstimateGas.sol": source}}, 1); - - estimateGasContractData = "0x" + result.contracts["EstimateGas.sol:EstimateGas"].bytecode; - estimateGasContractAbi = JSON.parse(result.contracts["EstimateGas.sol:EstimateGas"].interface); - - EstimateGasContract = new web3.eth.Contract(estimateGasContractAbi); - return EstimateGasContract.deploy({data: estimateGasContractData}) - .send({from: accounts[0], gas: 3141592}) - .on('receipt', function (receipt) { - deploymentReceipt = receipt; - }) - .then(function(instance) { - // TODO: ugly workaround - not sure why this is necessary. - if (!instance._requestManager.provider) { - instance._requestManager.setProvider(web3.eth._provider); - } - estimateGasInstance = instance; - }); - }); - - it("should use the block gas limit if no gas limit is specified", function() { - // this call uses more than the default transaction gas limit and will - // therefore fail if the block gas limit isn't used for calls - return estimateGasInstance.methods.add(toBytes("Tim"), toBytes("A great guy"), 5) - .call({from: accounts[0]}) - .then(result => { - assert.equal(result, true) - }) - }) - - function toBytes(s) { - let bytes = Array.prototype.map.call(s, function(c) { - return c.codePointAt(0) - }) - - return to.hex(Buffer.from(bytes)) - } - -}); diff --git a/test/custom_gas_limit.js b/test/custom_gas_limit.js deleted file mode 100644 index 2d220d8d83..0000000000 --- a/test/custom_gas_limit.js +++ /dev/null @@ -1,23 +0,0 @@ -var Web3 = require('web3'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); - -describe("Custom Gas Limit", function() { - var web3; - - before("Init the Web3 provider", function(done){ - web3 = new Web3(); - web3.setProvider(Ganache.provider({ - gasLimit: 5000000 - })); - done(); - }); - - it("The block should show the correct custom Gas Limit", function(done) { - web3.eth.getBlock(0, function(err, block) { - if (err) return done(err); - assert.deepEqual(block.gasLimit, 5000000); - done(); - }); - }); -}); diff --git a/test/custom_gas_price.js b/test/custom_gas_price.js deleted file mode 100644 index a6078001f4..0000000000 --- a/test/custom_gas_price.js +++ /dev/null @@ -1,32 +0,0 @@ -var Web3 = require('web3'); -var utils = require('ethereumjs-util'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); - -var logger = { - log: function() {} -}; - -describe("Custom Gas Price", function() { - it("should return gas price of 0xf when specified as a decimal", function(done) { - var provider = Ganache.provider({gasPrice: 15, logger: logger}); - var web3 = new Web3(); - web3.setProvider(provider); - web3.eth.getGasPrice(function(err, result) { - if (err) return done(err); - assert.equal(parseFloat(result), 15); - done(); - }); - }); - - it("should return gas price of 0xf when specified as hex", function(done) { - var provider = Ganache.provider({gasPrice: 0xf, logger: logger}); - var web3 = new Web3(); - web3.setProvider(provider); - web3.eth.getGasPrice(function(err, result) { - if (err) return done(err); - assert.equal(parseFloat(result), 15); - done(); - }); - }); -}); diff --git a/test/debug.js b/test/debug.js deleted file mode 100644 index c463d2631b..0000000000 --- a/test/debug.js +++ /dev/null @@ -1,125 +0,0 @@ -var Web3 = require('web3'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var fs = require("fs"); -var path = require("path"); -var solc = require("solc"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -describe("Debug", function() { - var provider; - var web3 - var accounts; - var DebugContract; - var debugContract; - var source = fs.readFileSync(path.join(__dirname, "DebugContract.sol"), "utf8"); - var hashToTrace = null; - var expectedValueBeforeTrace = 1234; - - before("init web3", function() { - provider = Ganache.provider(); - web3 = new Web3(provider); - }); - - before("get accounts", function() { - return web3.eth.getAccounts().then(accs => { - accounts = accs; - }); - }); - - before("compile source", function() { - this.timeout(10000); - var result = solc.compile({sources: {"DebugContract.sol": source}}, 1); - - var code = "0x" + result.contracts["DebugContract.sol:DebugContract"].bytecode; - var abi = JSON.parse(result.contracts["DebugContract.sol:DebugContract"].interface); - - DebugContract = new web3.eth.Contract(abi); - DebugContract._code = code; - - return DebugContract.deploy({ data: code }).send({from: accounts[0], gas: 3141592}).then(instance => { - debugContract = instance; - - // TODO: ugly workaround - not sure why this is necessary. - if (!debugContract._requestManager.provider) { - debugContract._requestManager.setProvider(web3.eth._provider); - } - }); - }); - - before("set up transaction that should be traced", function() { - // This should execute immediately. - var setValueTx = debugContract.methods.setValue(26) - var tx; - return setValueTx.send({from: accounts[0], gas: 3141592}).then(result => { - // Check the value first to make sure it's 26 - tx = result; - return debugContract.methods.value().call({from: accounts[0], gas: 3141592}); - }).then(value => { - assert.equal(value, 26); - - // Set the hash to trace to the transaction we made, so we know preconditions - // are set correctly. - hashToTrace = tx.transactionHash; - }); - }); - - before("change state of contract to ensure trace doesn't overwrite data", function() { - // This should execute immediately. - return debugContract.methods.setValue(expectedValueBeforeTrace).send({from: accounts[0], gas: 3141592}).then(tx => { - // Make sure we set it right. - return debugContract.methods.value().call({from: accounts[0], gas: 3141592}) - }).then(value => { - // Now that it's 85, we can trace the transaction that set it to 26. - assert.equal(value, expectedValueBeforeTrace); - }); - }); - - it("should trace a successful transaction without changing state", function() { - // We want to trace the transaction that sets the value to 26 - return new Promise((accept, reject) => { - provider.send({ - jsonrpc: "2.0", - method: "debug_traceTransaction", - params: [hashToTrace, []], - id: new Date().getTime() - }, function(err, response) { - if (err) reject(err); - if (response.error) reject(response.error); - - var result = response.result; - - // To at least assert SOMETHING, let's assert the last opcode - assert(result.structLogs.length > 0); - - for (let op of result.structLogs) { - if (op.stack.length > 0) { - // check formatting of stack - // formatting was broken when updating to ethereumjs-vm v2.3.3 - assert.equal(op.stack[0].length, 64) - assert.notEqual(op.stack[0].substr(0, 2), '0x') - break - } - } - var lastop = result.structLogs[result.structLogs.length - 1]; - - assert.equal(lastop.op, "STOP"); - assert.equal(lastop.gasCost, 1); - assert.equal(lastop.pc, 145); - assert.equal(lastop.storage['0000000000000000000000000000000000000000000000000000000000000000'], '000000000000000000000000000000000000000000000000000000000000001a') - assert.equal(lastop.storage['0000000000000000000000000000000000000000000000000000000000000001'], '000000000000000000000000000000000000000000000000000000000000001f') - - accept(); - }); - }).then(() => { - // Now let's make sure rerunning this transaction trace didn't change state - return debugContract.methods.value().call({from: accounts[0], gas: 3141592}) - });then(value => { - // Did it change state? - assert.equal(value, expectedValueBeforeTrace); - }); - }); -}) diff --git a/test/ethereum.js b/test/ethereum.js deleted file mode 100644 index 55362d59e9..0000000000 --- a/test/ethereum.js +++ /dev/null @@ -1,20 +0,0 @@ -var Web3 = require('web3'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); - - -describe("Ethereum", function(done) { - var web3 = new Web3(); - var provider; - - before("Initialize the provider", function() { - provider = Ganache.provider(); - web3.setProvider(provider); - }); - - it("should get ethereum version (eth_protocolVersion)", function() { - return web3.eth.getProtocolVersion().then(result => { - assert.equal(result, "63", "Network Version should be 63"); - }) - }); -}); diff --git a/test/events.js b/test/events.js deleted file mode 100644 index a99d5ef4c2..0000000000 --- a/test/events.js +++ /dev/null @@ -1,291 +0,0 @@ -var Web3 = require('web3'); -var Web3WsProvider = require('web3-providers-ws'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var assert = require('assert'); -var solc = require("solc"); -var async = require("async"); -var util = require("util") - -var source = " \ -pragma solidity ^0.4.24; \ -contract EventTest { \ - event ExampleEvent(uint indexed first, uint indexed second); \ - \ - function triggerEvent(uint _first, uint _second) public { \ - emit ExampleEvent(_first, _second); \ - } \ -}" - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -var tests = function(web3, EventTest) { - var accounts; - var EventTest; - var instance; - - describe("events", function() { - before(function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs; - done(); - }); - }); - - before(function(done) { - this.timeout(10000) - var result = solc.compile(source, 1); - - if (result.errors != null) { - done(result.errors[0]) - return - } - - var abi = JSON.parse(result.contracts[":EventTest"].interface); - EventTest = new web3.eth.Contract(abi); - EventTest._data = "0x" + result.contracts[":EventTest"].bytecode; - done(); - }); - - before(function() { - return EventTest.deploy({data: EventTest._data}) - .send({from: accounts[0], gas: 3141592}) - .then(contract => { - instance = contract; - - // TODO: ugly workaround - not sure why this is necessary. - if (!instance._requestManager.provider) { - instance._requestManager.setProvider(web3.eth._provider); - } - }); - }); - - it("should handle events properly via the data event handler", function(done) { - var expectedValue = 1; - - var event = instance.events.ExampleEvent({ filter: {first: expectedValue}}); - - var listener = function(result) { - assert.equal(result.returnValues.first, expectedValue); - done() - } - - event.once('data', listener); - event.once('error', (err) => done(err)); - - instance.methods.triggerEvent(1, 6) - .send({ from: accounts[0], gas: 3141592 }) - .catch(err => { cleanup(err); }) - }); - - // NOTE! This test relies on the events triggered in the tests above. - it("grabs events in the past", function(done) { - var expectedValue = 2; - - var event = instance.events.ExampleEvent({filter: {first: expectedValue}, fromBlock: 0}); - - var listener = function(result) { - assert.equal(result.returnValues.first, expectedValue) - done(); - } - - var errHandler = (err) => { cleanup(err) }; - event.once('data', listener); - event.once('error', errHandler); - - instance.methods.triggerEvent(2, 6) - .send({ from: accounts[0], gas: 3141592 }) - .catch(err => { cleanup(err); }) - }); - - // NOTE! This test relies on the events triggered in the tests above. - it("accepts an array of topics as a filter", function(done) { - var expectedValueA = 3; - var expectedValueB = 4; - var expectedValue = expectedValueA; - - var event = instance.events.ExampleEvent({filter: {first: [expectedValueA, expectedValueB]}, fromBlock: 0}); - - var waitingFor = {} - waitingFor[expectedValueA] = true - waitingFor[expectedValueB] = true - - var listener = function(result) { - assert(waitingFor.hasOwnProperty(result.returnValues.first)) - delete waitingFor[result.returnValues.first] - - if (Object.keys(waitingFor).length == 0) { - event.removeAllListeners() - done() - } - } - - event.on('data', listener); - - event.once('error', (err) => { - event.removeAllListeners() - done(err) - }); - - instance.methods.triggerEvent(expectedValueA, 6) - .send({ from: accounts[0], gas: 3141592 }) - .then((result) => { - return instance.methods.triggerEvent(expectedValueB, 7) - .send({ from: accounts[0], gas: 3141592 }) - }) - }); - - it("only returns logs for the expected address", function(done) { - var expectedValue = 1; - var event; - - EventTest.deploy({ data: EventTest._data }) - .send({ from: accounts[0], gas: 3141592 }) - .then(newInstance => { - // TODO: ugly workaround - not sure why this is necessary. - if (!newInstance._requestManager.provider) { - newInstance._requestManager.setProvider(web3.eth._provider); - } - - var event = newInstance.events.ExampleEvent({ filter: { first: expectedValue }, fromBlock: 0 }); - - event.on('data', function (result) { - assert(result.returnValues.first == expectedValue) - //event.removeAllListeners() - done(); - }); - - instance.methods.triggerEvent(5, 6) - .send({ from: accounts[0], gas: 3141592 }).then(() => { - newInstance.methods.triggerEvent(expectedValue, 6) - .send({ from: accounts[0], gas: 3141592 }) - }); - }); - - }); - - it("always returns a change for every new block subscription when instamining", function (done) { - var provider = web3.currentProvider; - - provider.send({ - jsonrpc: "2.0", - method: "eth_subscribe", - params: ['newHeads'], - id: new Date().getTime() - }, function (err, result) { - if (err) return done(err); - let filter_id = result.result; - - let listener = function (err, result) { - if(result == undefined) { - // If there's only one argument, it's the result, not an error - result = err; - } else if (err) { - return done(err); - } - let first_changes = result.params.result.hash; - assert.equal(first_changes.length, 66); // Ensure we have a hash - provider.removeAllListeners('data') - done(); - } - - // can't use `once` here because Web3WsProvider only has `on` :-( - provider.on('data', listener); - - web3.currentProvider.send({ - jsonrpc: "2.0", - method: "evm_mine", - id: new Date().getTime() - }, function (err) { - if (err) done(err); - }) - }) - }); - - // NOTE! This test relies on the events triggered in the tests above. - it("ensures topics are respected in past events, using `event.get()` (exclusive)", function(done) { - var unexpectedValue = 1337; - var event = instance.events.ExampleEvent({filter: {first: unexpectedValue}, fromBlock: 0}); - - // There should be no logs because we provided a different number. - var listener = function(result) { - assert.fail('Event should not have fired'); - }; - - event.once('data', listener); - - instance.methods.triggerEvent(6, 6) - .send({ from: accounts[0], gas: 3141592 }) - .then(() => { - // have to finish somehow... - setTimeout(() => { - event.removeAllListeners() - done(); - }, 250) - }) - }); - - // TODO: web3 1.0 drops fromBlock on a subscription request - stop skipping this when that is fixed - it.skip("will not fire if logs are requested when fromBlock doesn't exist", function(done) { - var event = instance.events.ExampleEvent({fromBlock: 100000}); - - // fromBlock doesn't exist, hence no logs - var listener = function(result) { - assert.fail('Event should not have fired'); - }; - - event.on('data', listener); - - instance.methods.triggerEvent(8, 6) - .send({ from: accounts[0], gas: 3141592 }) - .then(() => { - // have to finish somehow... - setTimeout(() => { - event.removeAllListeners - done(); - }, 250) - }) - }); - }) -}; - -var logger = { - log: function(message) { - //console.log(message); - } -}; - -describe("Provider:", function() { - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - logger: logger - })); - tests(web3); -}); - -describe("Server:", function(done) { - var web3 = new Web3(); - var port = 12345; - var server; - - before("Initialize Ganache server", function(done) { - server = Ganache.server({ - logger: logger, - ws: true - }); - server.listen(port, function() { - web3.setProvider(new Web3WsProvider("ws://localhost:" + port)); - done(); - }); - }); - - tests(web3); - - after("Shutdown server", function(done) { - web3._provider.connection.close() - server.close(done); - }); - -}); diff --git a/test/forking.js b/test/forking.js deleted file mode 100644 index 643049dc0e..0000000000 --- a/test/forking.js +++ /dev/null @@ -1,630 +0,0 @@ -var Web3 = require('web3'); -var Web3WsProvider = require('web3-providers-ws'); -var utils = require('ethereumjs-util'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var fs = require("fs"); -var solc = require("solc"); -var to = require("../lib/utils/to.js"); -var async = require("async"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -var logger = { - log: function(msg) { /*console.log(msg)*/ } -}; - -/** - * NOTE: Naming in these tests is a bit confusing. Here, the "main chain" - * is the main chain the tests interact with; and the "forked chain" is the - * chain that _was forked_. This is in contrast to general naming, where the - * main chain represents the main chain to be forked (like the Ethereum live - * network) and the fork chaing being "the fork". - */ - -describe("Forking", function() { - var contract; - var contractAddress; - var secondContractAddress; // used sparingly - var forkedServer; - var mainAccounts; - var forkedAccounts; - - var initialFallbackAccountState = {}; - - var forkedWeb3 = new Web3(); - var mainWeb3 = new Web3(); - - var forkedTargetUrl = "ws://localhost:21345"; - var forkBlockNumber; - - var initialDeployTransactionHash; - - before("set up test data", function() { - this.timeout(10000) - var source = fs.readFileSync("./test/Example.sol", {encoding: "utf8"}); - var result = solc.compile(source, 1); - - // Note: Certain properties of the following contract data are hardcoded to - // maintain repeatable tests. If you significantly change the solidity code, - // make sure to update the resulting contract data with the correct values. - contract = { - solidity: source, - abi: result.contracts[":Example"].interface, - binary: "0x" + result.contracts[":Example"].bytecode, - position_of_value: "0x0000000000000000000000000000000000000000000000000000000000000000", - expected_default_value: 5, - call_data: { - gas: '0x2fefd8', - gasPrice: '0x01', // This is important, as passing it has exposed errors in the past. - to: null, // set by test - data: '0x3fa4f245' - }, - transaction_data: { - from: null, // set by test - gas: '0x2fefd8', - to: null, // set by test - data: '0x552410770000000000000000000000000000000000000000000000000000000000000019' // sets value to 25 (base 10) - } - }; - }); - - before("Initialize Fallback Ganache server", function(done) { - this.timeout(10000) - forkedServer = Ganache.server({ - // Do not change seed. Determinism matters for these tests. - seed: "let's make this deterministic", - ws: true, - logger: logger - }); - - forkedServer.listen(21345, function(err) { - if (err) return done(err); - done(); - }); - }); - - before("set forkedWeb3 provider", function(done) { - forkedWeb3.setProvider(new Web3WsProvider(forkedTargetUrl)); - done(); - }); - - before("Gather forked accounts", function(done) { - this.timeout(5000) - forkedWeb3.eth.getAccounts(function(err, f) { - if (err) return done(err); - forkedAccounts = f; - done(); - }); - }); - - before("Deploy initial contracts", function(done) { - forkedWeb3.eth.sendTransaction({ - from: forkedAccounts[0], - data: contract.binary, - gas: 3141592 - }, function(err, tx) { - if (err) { return done(err); } - - // Save this for a later test. - initialDeployTransactionHash = tx; - - forkedWeb3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - - contractAddress = receipt.contractAddress; - - forkedWeb3.eth.getCode(contractAddress, function(err, code) { - if (err) return done(err); - - // Ensure there's *something* there. - assert.notEqual(code, null); - assert.notEqual(code, "0x"); - assert.notEqual(code, "0x0"); - - // Deploy a second one, which we won't use often. - forkedWeb3.eth.sendTransaction({ - from: forkedAccounts[0], - data: contract.binary, - gas: 3141592 - }, function(err, tx) { - if (err) { return done(err); } - forkedWeb3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - - secondContractAddress = receipt.contractAddress; - done(); - }); - }); - }) - }); - }); - }); - - before("Make a transaction on the forked chain that produces a log", function(done) { - this.timeout(10000) - - var forkedExample = new forkedWeb3.eth.Contract(JSON.parse(contract.abi), contractAddress); - - // TODO: ugly workaround - not sure why this is necessary. - if (!forkedExample._requestManager.provider) { - forkedExample._requestManager.setProvider(forkedWeb3.eth._provider); - } - - var interval; - - var event = forkedExample.events.ValueSet({}); - - event.once('data', function(logs) { - done() - }); - - forkedExample.methods.setValue(7).send({from: forkedAccounts[0]}, function(err, tx) { - if (err) return done(err); - }); - }); - - before("Get initial balance and nonce", function(done) { - async.parallel({ - balance: forkedWeb3.eth.getBalance.bind(forkedWeb3.eth, forkedAccounts[0]), - nonce: forkedWeb3.eth.getTransactionCount.bind(forkedWeb3.eth, forkedAccounts[0]) - }, function(err, result) { - if (err) return done(err); - initialFallbackAccountState = result; - initialFallbackAccountState.nonce = to.number(initialFallbackAccountState.nonce); - done(); - }); - }); - - before("Set main web3 provider, forking from forked chain at this point", function(done) { - mainWeb3.setProvider(Ganache.provider({ - fork: forkedTargetUrl.replace('ws', 'http'), - logger, - verbose: true, - - // Do not change seed. Determinism matters for these tests. - seed: "a different seed" - })); - - forkedWeb3.eth.getBlockNumber(function(err, number) { - if (err) return done(err); - forkBlockNumber = number; - done(); - }); - }); - - before("Gather main accounts", function(done) { - this.timeout(5000) - mainWeb3.eth.getAccounts(function(err, m) { - if (err) return done(err); - mainAccounts = m; - done(); - }); - }); - - it("should fetch a contract from the forked provider via the main provider", function(done) { - mainWeb3.eth.getCode(contractAddress, function(err, mainCode) { - if (err) return done(err); - - // Ensure there's *something* there. - assert.notEqual(mainCode, null); - assert.notEqual(mainCode, "0x"); - assert.notEqual(mainCode, "0x0"); - - // Now make sure it matches exactly. - forkedWeb3.eth.getCode(contractAddress, function(err, forkedCode) { - if (err) return done(err); - - assert.equal(mainCode, forkedCode); - done(); - }); - }); - }); - - it("should be able to get the balance of an address in the forked provider via the main provider", function(done) { - // Assert preconditions - var first_forked_account = forkedAccounts[0]; - assert(mainAccounts.indexOf(first_forked_account) < 0); - - // Now for the real test: Get the balance of a forked account through the main provider. - mainWeb3.eth.getBalance(first_forked_account, function(err, balance) { - if (err) return done(err); - - // We don't assert the exact balance as transactions cost eth - assert(balance > 999999); - done(); - }); - }); - - it("should be able to get storage values on the forked provider via the main provider", function(done) { - mainWeb3.eth.getStorageAt(contractAddress, contract.position_of_value, function(err, result) { - if (err) return done(err); - assert.equal(mainWeb3.utils.hexToNumber(result), 7); - done(); - }); - }); - - it("should be able to execute calls against a contract on the forked provider via the main provider", function(done) { - var example = new mainWeb3.eth.Contract(JSON.parse(contract.abi), contractAddress); - - // TODO: ugly workaround - not sure why this is necessary. - if (!example._requestManager.provider) { - example._requestManager.setProvider(web3.eth._provider); - } - - example.methods.value().call({from: mainAccounts[0]}, function(err, result){ - if (err) return done(err); - assert.equal(mainWeb3.utils.hexToNumber(result), 7); - - // Make the call again to ensure caches updated and the call still works. - example.methods.value().call({from: mainAccounts[0]}, function(err, result){ - if (err) return done(err); - assert.equal(mainWeb3.utils.hexToNumber(result), 7); - done(err); - }); - }); - }); - - it("should be able to make a transaction on the main provider while not transacting on the forked provider", function(done) { - var example = new mainWeb3.eth.Contract(JSON.parse(contract.abi), contractAddress); - - // TODO: ugly workaround - not sure why this is necessary. - if (!example._requestManager.provider) { - example._requestManager.setProvider(web3.eth._provider); - } - - var forkedExample = new forkedWeb3.eth.Contract(JSON.parse(contract.abi), contractAddress); - - // TODO: ugly workaround - not sure why this is necessary. - if (!forkedExample._requestManager.provider) { - forkedExample._requestManager.setProvider(forkedWeb3.eth._provider); - } - - example.methods.setValue(25).send({from: mainAccounts[0]}, function(err) { - if (err) return done(err); - - // It insta-mines, so we can make a call directly after. - example.methods.value().call({from: mainAccounts[0]}, function(err, result) { - if (err) return done(err); - assert.equal(mainWeb3.utils.hexToNumber(result), 25); - - // Now call back to the forked to ensure it's value stayed 5 - forkedExample.methods.value().call({from: forkedAccounts[0]}, function(err, result) { - if (err) return done(err); - assert.equal(forkedWeb3.utils.hexToNumber(result), 7); - done(); - }) - }); - }); - }); - - it("should ignore continued transactions on the forked blockchain by pegging the forked block number", function(done) { - // In this test, we're going to use the second contract address that we haven't - // used previously. This ensures the data hasn't been cached on the main web3 trie - // yet, and it will require it forked to the forked provider at a specific block. - // If that block handling is done improperly, this should fail. - - var example = new mainWeb3.eth.Contract(JSON.parse(contract.abi), secondContractAddress); - - // TODO: ugly workaround - not sure why this is necessary. - if (!example._requestManager.provider) { - example._requestManager.setProvider(web3.eth._provider); - } - - var forkedExample = new forkedWeb3.eth.Contract(JSON.parse(contract.abi), secondContractAddress); - - // TODO: ugly workaround - not sure why this is necessary. - if (!forkedExample._requestManager.provider) { - forkedExample._requestManager.setProvider(forkedWeb3.eth._provider); - } - - // This transaction happens entirely on the forked chain after forking. - // It should be ignored by the main chain. - forkedExample.methods.setValue(800).send({from: forkedAccounts[0]}, function(err, result) { - if (err) return done(err); - // Let's assert the value was set correctly. - forkedExample.methods.value().call({from: forkedAccounts[0]}, function(err, result) { - if (err) return done(err); - assert.equal(forkedWeb3.utils.hexToNumber(result), 800); - - // Now lets check the value on the main chain. It shouldn't be 800. - example.methods.value().call({from: mainAccounts[0]}, function(err, result) { - if (err) return done(err); - - assert.equal(mainWeb3.utils.hexToNumber(result), 5); - done(); - }) - }) - }); - }); - - it("should maintain a block number that includes new blocks PLUS the existing chain", function(done) { - // Note: The main provider should be at block 5 at this test. Reasoning: - // - The forked chain has an initial block, which is block 0. - // - The forked chain performed a transaction that produced a log, resulting in block 1. - // - The forked chain had two transactions initially, resulting blocks 2 and 3. - // - The main chain forked from there, creating its own initial block, block 4. - // - Then the main chain performed a transaction, putting it at block 5. - - mainWeb3.eth.getBlockNumber(function(err, result) { - if (err) return done(err); - - assert.equal(mainWeb3.utils.hexToNumber(result), 5); - - // Now lets get a block that exists on the forked chain. - mainWeb3.eth.getBlock(0, function(err, mainBlock) { - if (err) return done(err); - - // And compare it to the forked chain's block - forkedWeb3.eth.getBlock(0, function(err, forkedBlock) { - if (err) return done(err); - - // Block hashes should be the same. - assert.equal(mainBlock.hash, forkedBlock.hash); - - // Now make sure we can get the block by hash as well. - mainWeb3.eth.getBlock(mainBlock.hash, function(err, mainBlockByHash) { - if (err) return done(err); - - assert.equal(mainBlock.hash, mainBlockByHash.hash); - done(); - }); - }); - }); - }); - }); - - it("should have a genesis block whose parent is the last block from the forked provider", function(done) { - forkedWeb3.eth.getBlock(forkBlockNumber, function(err, forkedBlock) { - if (err) return done(err); - - var parentHash = forkedBlock.hash; - - var mainGenesisNumber = mainWeb3.utils.hexToNumber(forkBlockNumber) + 1; - mainWeb3.eth.getBlock(mainGenesisNumber, function(err, mainGenesis) { - if (err) return done(err); - - assert.equal(mainGenesis.parentHash, parentHash); - done(); - }) - }); - }); - - // Note: This test also puts a new contract on the forked chain, which is a good test. - it("should represent the block number correctly in the Oracle contract (oracle.blockhash0), providing forked block hash and number", function() { - this.timeout(10000) - var oracleSol = fs.readFileSync("./test/Oracle.sol", {encoding: "utf8"}); - var solcResult = solc.compile(oracleSol); - var oracleOutput = solcResult.contracts[":Oracle"]; - - return new mainWeb3.eth.Contract(JSON.parse(oracleOutput.interface)) - .deploy({ data: oracleOutput.bytecode }) - .send({ from: mainAccounts[0], gas: 3141592 }) - .then(function(oracle){ - // TODO: ugly workaround - not sure why this is necessary. - if (!oracle._requestManager.provider) { - oracle._requestManager.setProvider(mainWeb3.eth._provider); - } - return mainWeb3.eth.getBlock(0).then(function(block){ - return oracle.methods.blockhash0().call() - .then(function(blockhash) { - assert.equal(blockhash, block.hash); - // Now check the block number. - return mainWeb3.eth.getBlockNumber() - }) - }).then(function(expected_number) { - return oracle.methods.currentBlock().call() - .then(function(number) { - assert.equal(number, expected_number + 1); - return oracle.methods.setCurrentBlock().send({from: mainAccounts[0], gas: 3141592}) - }).then(function(tx) { - return oracle.methods.lastBlock().call({from: mainAccounts[0]}) - }).then(function(val) { - assert.equal(to.number(val), expected_number + 1); - }); - }); - }); - }); - - // TODO - it("should be able to get logs across the fork boundary", function(done) { - this.timeout(30000) - - var example = new mainWeb3.eth.Contract(JSON.parse(contract.abi), contractAddress); - - // TODO: ugly workaround - not sure why this is necessary. - if (!example._requestManager.provider) { - example._requestManager.setProvider(web3.eth._provider); - } - - var event = example.events.ValueSet({fromBlock: 0, toBlock: "latest"}); - - var callcount = 0 - event.on('data', function(log) { - callcount++ - if (callcount == 2) { - event.removeAllListeners() - done() - } - }); - }); - - it("should return the correct nonce based on block number", function(done) { - // Note for the first two requests, we choose the block numbers 1 before and after the fork to - // ensure we're pulling data off the correct provider in both cases. - async.parallel({ - nonceBeforeFork: mainWeb3.eth.getTransactionCount.bind(mainWeb3.eth, forkedAccounts[0], forkBlockNumber - 1), - nonceAtFork: mainWeb3.eth.getTransactionCount.bind(mainWeb3.eth, forkedAccounts[0], forkBlockNumber + 1), - nonceLatestMain: mainWeb3.eth.getTransactionCount.bind(mainWeb3.eth, forkedAccounts[0], "latest"), - nonceLatestFallback: forkedWeb3.eth.getTransactionCount.bind(forkedWeb3.eth, forkedAccounts[0], "latest") - }, function(err, results) { - if (err) return done(err); - - var nonceBeforeFork = results.nonceBeforeFork; - var nonceAtFork = results.nonceAtFork; - var nonceLatestMain = results.nonceLatestMain; - var nonceLatestFallback = results.nonceLatestFallback; - - // First ensure our nonces for the block before the fork - // Note that we're asking for the block *before* the forked block, - // which automatically means we sacrifice a transaction (i.e., one nonce value) - assert.equal(nonceBeforeFork, initialFallbackAccountState.nonce - 1); - - // Now check at the fork. We should expect our initial state. - assert.equal(nonceAtFork, initialFallbackAccountState.nonce); - - // Make sure the main web3 provider didn't alter the state of the forked account. - // This means the nonce should stay the same. - assert.equal(nonceLatestMain, initialFallbackAccountState.nonce); - - // And since we made one additional transaction with this account on the forked - // provider AFTER the fork, it's nonce should be one ahead, and the main provider's - // nonce for that address shouldn't acknowledge it. - assert.equal(nonceLatestFallback, nonceLatestMain + 1); - - done(); - }); - }); - - it("should return the correct balance based on block number", function(done) { - // Note for the first two requests, we choose the block numbers 1 before and after the fork to - // ensure we're pulling data off the correct provider in both cases. - async.parallel({ - balanceBeforeFork: mainWeb3.eth.getBalance.bind(mainWeb3.eth, forkedAccounts[0], forkBlockNumber - 1), - balanceAfterFork: mainWeb3.eth.getBalance.bind(mainWeb3.eth, forkedAccounts[0], forkBlockNumber + 1), - balanceLatestMain: mainWeb3.eth.getBalance.bind(mainWeb3.eth, forkedAccounts[0], "latest"), - balanceLatestFallback: forkedWeb3.eth.getBalance.bind(forkedWeb3.eth, forkedAccounts[0], "latest") - }, function(err, results) { - if (err) return done(err); - - var balanceBeforeFork = mainWeb3.utils.toBN(results.balanceBeforeFork); - var balanceAfterFork = mainWeb3.utils.toBN(results.balanceAfterFork); - var balanceLatestMain = mainWeb3.utils.toBN(results.balanceLatestMain); - var balanceLatestFallback = mainWeb3.utils.toBN(results.balanceLatestFallback); - - // First ensure our balances for the block before the fork - // We do this by simply ensuring the balance has decreased since exact values - // are hard to assert in this case. - assert(balanceBeforeFork.gt(balanceAfterFork)); - - // Make sure it's not substantially larger. it should only be larger by a small - // amount (<2%). This assertion was added since forked balances were previously - // incorrectly being converted between decimal and hex - assert(balanceBeforeFork.muln(0.95).lt(balanceAfterFork)); - - // Since the forked provider had once extra transaction for this account, - // it should have a lower balance, and the main provider shouldn't acknowledge - // that transaction. - assert(balanceLatestMain.gt(balanceLatestFallback)); - - // Make sure it's not substantially larger. it should only be larger by a small - // amount (<2%). This assertion was added since forked balances were previously - // incorrectly being converted between decimal and hex - assert(balanceLatestMain.muln(0.95).lt(balanceLatestFallback)); - - done(); - }); - }); - - it("should return the correct code based on block number", function(done) { - // This one is simpler than the previous two. Either the code exists or doesn't. - async.parallel({ - codeEarliest: mainWeb3.eth.getCode.bind(mainWeb3.eth, contractAddress, "earliest"), - codeAfterFork: mainWeb3.eth.getCode.bind(mainWeb3.eth, contractAddress, forkBlockNumber + 1), - codeLatest: mainWeb3.eth.getCode.bind(mainWeb3.eth, contractAddress, "latest") - }, function(err, results) { - if (err) return done(err); - - var codeEarliest = results.codeEarliest; - var codeAfterFork = results.codeAfterFork; - var codeLatest = results.codeLatest; - - // There should be no code initially. - assert.equal(to.number(codeEarliest), 0) - - // Arbitrary length check since we can't assert the exact value - assert(codeAfterFork.length > 20); - assert(codeLatest.length > 20); - - // These should be the same since code can't change. - assert.equal(codeAfterFork, codeLatest); - - done(); - }) - }); - - it("should return transactions for blocks requested before the fork", function(done) { - forkedWeb3.eth.getTransactionReceipt(initialDeployTransactionHash, function(err, receipt) { - if (err) return done(err); - - forkedWeb3.eth.getBlock(receipt.blockNumber, true, function(err, referenceBlock) { - if (err) return done(err); - - mainWeb3.eth.getBlock(receipt.blockNumber, true, function(err, forkedBlock) { - if (err) return done(err); - - assert.equal(forkedBlock.transactions.length, referenceBlock.transactions.length) - assert.deepEqual(forkedBlock.transactions, referenceBlock.transactions); - done(); - }); - }); - }); - }); - - it("should return a transaction for transactions made before the fork", function(done) { - forkedWeb3.eth.getTransaction(initialDeployTransactionHash, function(err, referenceTransaction) { - if (err) return done(err); - - mainWeb3.eth.getTransaction(initialDeployTransactionHash, function(err, forkedTransaction) { - if (err) return done(err); - - assert.deepEqual(referenceTransaction, forkedTransaction); - done(); - }); - }); - }); - - it("should return a transaction receipt for transactions made before the fork", function(done) { - forkedWeb3.eth.getTransactionReceipt(initialDeployTransactionHash, function(err, referenceReceipt) { - if (err) return done(err); - assert.deepEqual(referenceReceipt.transactionHash, initialDeployTransactionHash) - - mainWeb3.eth.getTransactionReceipt(initialDeployTransactionHash, function(err, forkedReceipt) { - if (err) return done(err); - - assert.deepEqual(forkedReceipt.transactionHash, initialDeployTransactionHash) - assert.deepEqual(referenceReceipt, forkedReceipt); - done(); - }); - }); - }) - - it("should return the same network version as the chain it forked from", function(done) { - forkedWeb3.eth.net.getId(function(err, forkedNetwork) { - if (err) return done(err); - - mainWeb3.eth.net.getId(function(err, mainNetwork) { - if (err) return done(err); - - assert.equal(mainNetwork, forkedNetwork); - done(); - }); - }) - }); - - after("Shutdown server", function(done) { - forkedWeb3._provider.connection.close() - forkedServer.close(function(serverCloseErr) { - forkedWeb3.setProvider(); - let mainProvider = mainWeb3._provider; - mainWeb3.setProvider(); - mainProvider.close(function(providerCloseErr) { - if (serverCloseErr) return done(serverCloseErr); - if (providerCloseErr) return done(providerCloseErr); - done() - }); - }); - }); -}); diff --git a/test/forking_deploy_after_fork.js b/test/forking_deploy_after_fork.js deleted file mode 100644 index e25bbc224a..0000000000 --- a/test/forking_deploy_after_fork.js +++ /dev/null @@ -1,135 +0,0 @@ -var Web3 = require('web3'); -var Web3WsProvider = require('web3-providers-ws'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var fs = require("fs"); -var solc = require("solc"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -var logger = { - log: function(msg) { /*console.log(msg)*/ } -}; - -/** - * NOTE: Naming in these tests is a bit confusing. Here, the "main chain" - * is the main chain the tests interact with; and the "forked chain" is the - * chain that _was forked_. This is in contrast to general naming, where the - * main chain represents the main chain to be forked (like the Ethereum live - * network) and the fork chaing being "the fork". - */ - -describe("Contract Deployed on Main Chain After Fork", function() { - var contract; - var contractAddress; - var forkedServer; - var mainAccounts; - - var forkedWeb3 = new Web3(); - var mainWeb3 = new Web3(); - - var forkedTargetUrl = "ws://localhost:21345"; - - before("set up test data", function() { - this.timeout(10000) - var source = fs.readFileSync("./test/Example.sol", {encoding: "utf8"}); - var result = solc.compile(source, 1); - - // Note: Certain properties of the following contract data are hardcoded to - // maintain repeatable tests. If you significantly change the solidity code, - // make sure to update the resulting contract data with the correct values. - contract = { - solidity: source, - abi: result.contracts[":Example"].interface, - binary: "0x" + result.contracts[":Example"].bytecode, - position_of_value: "0x0000000000000000000000000000000000000000000000000000000000000000", - expected_default_value: 5, - call_data: { - gas: '0x2fefd8', - gasPrice: '0x01', // This is important, as passing it has exposed errors in the past. - to: null, // set by test - data: '0x3fa4f245' - }, - transaction_data: { - from: null, // set by test - gas: '0x2fefd8', - to: null, // set by test - data: '0x552410770000000000000000000000000000000000000000000000000000000000000019' // sets value to 25 (base 10) - } - }; - }); - - before("Initialize Fallback Ganache server", function(done) { - this.timeout(10000) - forkedServer = Ganache.server({ - // Do not change seed. Determinism matters for these tests. - seed: "let's make this deterministic", - ws: true, - logger: logger - }); - - forkedServer.listen(21345, function(err) { - if (err) return done(err); - done(); - }); - }); - - before("set forkedWeb3 provider", function() { - forkedWeb3.setProvider(new Web3WsProvider(forkedTargetUrl)); - }); - - before("Set main web3 provider, forking from forked chain at this point", function() { - mainWeb3.setProvider(Ganache.provider({ - fork: forkedTargetUrl.replace('ws', 'http'), - logger, - verbose: true, - - // Do not change seed. Determinism matters for these tests. - seed: "a different seed" - })); - }); - - before("Gather main accounts", async function() { - this.timeout(5000) - mainAccounts = await mainWeb3.eth.getAccounts(); - }); - - before("Deploy initial contract", async function() { - const receipt = await mainWeb3.eth.sendTransaction({ - from: mainAccounts[0], - data: contract.binary, - gas: 3141592, - value: mainWeb3.utils.toWei('1', 'ether') - }); - - contractAddress = receipt.contractAddress; - - // Ensure there's *something* there. - const code = await mainWeb3.eth.getCode(contractAddress); - assert.notEqual(code, null); - assert.notEqual(code, "0x"); - assert.notEqual(code, "0x0"); - }); - - it("should send 1 ether to the created contract, checked on the forked chain", async function() { - const balance = await mainWeb3.eth.getBalance(contractAddress); - - assert.equal(balance, mainWeb3.utils.toWei('1', 'ether')); - }) - - after("Shutdown server", function(done) { - forkedWeb3._provider.connection.close() - forkedServer.close(function(serverCloseErr) { - forkedWeb3.setProvider(); - let mainProvider = mainWeb3._provider; - mainWeb3.setProvider(); - mainProvider.close(function(providerCloseErr) { - if (serverCloseErr) return done(serverCloseErr); - if (providerCloseErr) return done(providerCloseErr); - done() - }); - }); - }); -}); diff --git a/test/forkingasprovider.js b/test/forkingasprovider.js deleted file mode 100644 index e5ff07537e..0000000000 --- a/test/forkingasprovider.js +++ /dev/null @@ -1,133 +0,0 @@ -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var solc = require("solc"); -var to = require("../lib/utils/to.js"); -var async = require("async"); -var Web3 = require('web3'); -var fs = require("fs"); -var assert = require("assert"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -var logger = { - log: function(msg) { /*noop*/ } -}; - -/** - * NOTE: Naming in these tests is a bit confusing. Here, the "main chain" - * is the main chain the tests interact with; and the "forked chain" is the - * chain that _was forked_. This is in contrast to general naming, where the - * main chain represents the main chain to be forked (like the Ethereum live - * network) and the fork chaing being "the fork". - */ - -describe("Forking using a Provider", function() { - var contract; - var forkedProvider = Ganache.provider({ - logger: logger, - seed: "main provider" - }); - var mainProvider; - var forkedWeb3 = new Web3(forkedProvider); - var mainWeb3; - var forkedAccounts; - var contractAddress; - - var forkBlockNumber; - var initialDeployTransactionHash; - - before("set up test data", function() { - this.timeout(5000) - var source = fs.readFileSync("./test/Example.sol", {encoding: "utf8"}); - var result = solc.compile(source, 1); - - // Note: Certain properties of the following contract data are hardcoded to - // maintain repeatable tests. If you significantly change the solidity code, - // make sure to update the resulting contract data with the correct values. - contract = { - solidity: source, - abi: result.contracts[":Example"].interface, - binary: "0x" + result.contracts[":Example"].bytecode, - position_of_value: "0x0000000000000000000000000000000000000000000000000000000000000000", - expected_default_value: 5, - call_data: { - gas: '0x2fefd8', - gasPrice: '0x01', // This is important, as passing it has exposed errors in the past. - to: null, // set by test - data: '0x3fa4f245' - }, - transaction_data: { - from: null, // set by test - gas: '0x2fefd8', - to: null, // set by test - data: '0x552410770000000000000000000000000000000000000000000000000000000000000019' // sets value to 25 (base 10) - } - }; - }); - - before("Gather forked accounts", function(done) { - forkedWeb3.eth.getAccounts(function(err, f) { - if (err) return done(err); - forkedAccounts = f; - done(); - }); - }); - - before("Deploy initial contracts", function(done) { - forkedWeb3.eth.sendTransaction({ - from: forkedAccounts[0], - data: contract.binary, - gas: 3141592 - }, function(err, tx) { - if (err) { return done(err); } - - // Save this for a later test. - initialDeployTransactionHash = tx; - - forkedWeb3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - - contractAddress = receipt.contractAddress; - - forkedWeb3.eth.getCode(contractAddress, function(err, code) { - if (err) return done(err); - - // Ensure there's *something* there. - assert.notEqual(code, null); - assert.notEqual(code, "0x"); - assert.notEqual(code, "0x0"); - - done(); - }); - }); - }); - }); - - before("Set up main provider and web3 instance", function() { - mainProvider = Ganache.provider({ - fork: forkedProvider, - logger: logger, - seed: "forked provider" - }); - mainWeb3 = new Web3(mainProvider); - }); - - // NOTE: This is the only real test in this file. Since we have another forking test file filled - // with good tests, this one simply ensures the forked feature still works by testing that we can - // grab data from the forked chain when a provider instance is passed (instead of a URL). If this - // one passes, it should follow that the rest of the forking features should work as normal. - it("gets code correctly via the main chain (i.e., internally requests it from forked chain)", function(done) { - mainWeb3.eth.getCode(contractAddress, function(err, code) { - if (err) return done(err); - - // Ensure there's *something* there. - assert.notEqual(code, null); - assert.notEqual(code, "0x"); - assert.notEqual(code, "0x0"); - - done(); - }); - }); - -}); diff --git a/test/gas.js b/test/gas.js deleted file mode 100644 index 1b577c6044..0000000000 --- a/test/gas.js +++ /dev/null @@ -1,423 +0,0 @@ -const Web3 = require('web3'); -const assert = require('assert'); -const Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -const fs = require("fs"); -const path = require("path"); -const solc = require("solc"); -const to = require("../lib/utils/to.js"); -const pify = require("pify"); -const RSCLEAR_REFUND = 15000; -const RSELFDESTRUCT_REFUND = 24000; - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -let mnemonic = 'candy maple cake sugar pudding cream honey rich smooth crumble sweet treat' - -describe("Gas", function() { - let estimateGasContractData; - let estimateGasContractAbi; - let EstimateGasContract; - let estimateGasInstance; - let deploymentReceipt; - - const provider = new Ganache.provider({mnemonic}); - const web3 = new Web3(provider); - let accounts = []; - - before("get accounts", async function() { - accounts = await web3.eth.getAccounts(); - }); - - before("compile source", async function() { - this.timeout(10000); - const source = fs.readFileSync(path.join(__dirname, "EstimateGas.sol"), "utf8"); - const result = solc.compile({sources: {"EstimateGas.sol": source}}, 1); - - estimateGasContractData = "0x" + result.contracts["EstimateGas.sol:EstimateGas"].bytecode; - estimateGasContractAbi = JSON.parse(result.contracts["EstimateGas.sol:EstimateGas"].interface); - - EstimateGasContract = new web3.eth.Contract(estimateGasContractAbi); - let promiEvent = EstimateGasContract.deploy({data: estimateGasContractData}) - .send({from: accounts[0], gas: 3141592}); - - promiEvent.on('receipt', function (receipt) { - deploymentReceipt = receipt; - }) - - estimateGasInstance = await promiEvent; - }); - - after("cleanup", function() { - web3.setProvider(null); - provider.close(() => {}); - }); - - async function deployContract(tempWeb3){ - let contract = new tempWeb3.eth.Contract(estimateGasContractAbi); - - return await (contract.deploy({ data: estimateGasContractData }) - .send({ from: accounts[0], gas: 3141592 })); - } - - describe("Refunds", function() { - it("accounts for Rsclear Refund in gasEstimate", async () => { - const from = accounts[0]; - const options = {from, gas: 5000000}; - - await estimateGasInstance.methods.reset().send(options); // prime storage by making sure it is set to 0 - - const method = estimateGasInstance.methods.triggerRsclearRefund(); - - let gasEstimate = await method.estimateGas(options); - - let receipt = await method.send({from, gas: gasEstimate}); - - assert.strictEqual(receipt.gasUsed, gasEstimate - RSCLEAR_REFUND); - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - }); - - - it("accounts for Rselfdestruct Refund in gasEstimate", async () => { - const from = accounts[0]; - const options = {from, gas: 5000000}; - - const instance = await deployContract(web3); - await instance.methods.reset().send(options); // prime storage by making sure it is set to 0 - - const method = instance.methods.triggerRselfdestructRefund(); - - let gasEstimate = await method.estimateGas(options); - - let receipt = await method.send({from, gas: gasEstimate}); - - assert.strictEqual(receipt.gasUsed, gasEstimate - RSELFDESTRUCT_REFUND); - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - }); - - it("accounts for Rsclear and Rselfdestruct Refunds in gasEstimate", async () => { - const from = accounts[0]; - - const instance = await deployContract(web3); - await instance.methods.reset().send({from, gas: 5000000}); // prime storage by making sure it is set to 0 - - const method = instance.methods.triggerAllRefunds(); - - const gasEstimate = await method.estimateGas({from}); - - let receipt = await method.send({from, gas: gasEstimate}); - - assert.strictEqual(receipt.gasUsed, gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND); - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - }) - - - it("accounts for Rsclear and Rselfdestruct Refunds in gasEstimate with multiple transaction in the block", async () => { - const ganacheProvider = Ganache.provider({ - blockTime: .5, // seconds - mnemonic: mnemonic - }) - - let tempWeb3; - - try { - tempWeb3 = new Web3(ganacheProvider); - - const from = (await tempWeb3.eth.getAccounts())[0]; - - let transactions = [{ - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[2], - "to": accounts[1], - "nonce": "0x0" - }, { - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[2], - "to": accounts[1], - "nonce": "0x1" - }, { - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[1],// < - "to": accounts[2], // <^ reversed tx order - "nonce": "0x0" - }] - - // Precondition - const initialBlockNumber = await tempWeb3.eth.getBlockNumber(); - assert.deepStrictEqual(initialBlockNumber, 0, 'Current Block Should be 0'); - - - const localGasInstance = await deployContract(tempWeb3); - - await localGasInstance.methods.reset().send({from, gas: 5000000}); // prime storage by making sure it is set to 0 - const method = localGasInstance.methods.triggerAllRefunds(); - const gasEstimate = await method.estimateGas({from}); - - let hashes = await Promise.all(transactions.map((transaction) => { - let promiEvent = tempWeb3.eth.sendTransaction(transaction); - - return new Promise((accept) => { - promiEvent.once('transactionHash', async (hash) => { - - // Ensure there's no receipt since the transaction hasn't yet been processed. Ensure IntervalMining - let receipt = await tempWeb3.eth.getTransactionReceipt(hash); - assert.equal(receipt, null, "No receipt since the transaction hasn't yet been processed."); - - accept(hash); - }) - }); - })); - let currentBlockNumber = await tempWeb3.eth.getBlockNumber(); - assert.deepStrictEqual(currentBlockNumber, 2, 'Current Block Should be 2'); - - const receipt = await method.send({from, gas: gasEstimate}); - - let transactionCostMinusRefund = gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND; - assert.strictEqual(receipt.gasUsed, transactionCostMinusRefund); - - - let receipts = await Promise.all(hashes.map((hash) => tempWeb3.eth.getTransactionReceipt(hash))); - assert.deepStrictEqual(receipts[0].gasUsed, receipts[1].gasUsed, 'Tx1 and Tx2 should cost the same gas.'); - assert.deepStrictEqual(receipts[1].gasUsed, receipts[2].gasUsed, 'Tx2 and Tx3 should cost the same gas. -> Tx1 gas === Tx3 gas Transitive'); - assert.deepStrictEqual(receipts[1].transactionIndex > receipts[2].transactionIndex, true, '(Tx3 has a lower nonce) -> (Tx3 index is < Tx2 index)'); - let currentBlock = await tempWeb3.eth.getBlock(receipts[0].blockNumber); - - // ( Tx3 has a lower nonce -> Tx3 index is < Tx2 index ) -> cumulative gas Tx2 > Tx3 > Tx1 - let isAccumulating = (receipts[1].cumulativeGasUsed > receipts[2].cumulativeGasUsed) && (receipts[2].cumulativeGasUsed > receipts[0].cumulativeGasUsed); - assert.deepStrictEqual(isAccumulating, true, 'Cumulative gas should be accumulating for any transactions in the same block.'); - assert.deepStrictEqual(receipts[0].gasUsed, receipts[0].cumulativeGasUsed, 'Gas and cumulative gas should be equal for the FIRST Tx.'); - assert.notDeepStrictEqual(receipts[1].gasUsed, receipts[1].cumulativeGasUsed, 'Gas and cumulative gas should NOT be equal for the Second Tx.'); - assert.notDeepStrictEqual(receipts[2].gasUsed, receipts[2].cumulativeGasUsed, 'Gas and cumulative gas should NOT be equal for the Third Tx.'); - - let totalGas = receipts[0].gasUsed + receipts[1].gasUsed + receipts[2].gasUsed; - assert.deepStrictEqual(totalGas + transactionCostMinusRefund, receipts[1].cumulativeGasUsed, "Total Gas should equal the final tx.cumulativeGas") - assert.deepStrictEqual(totalGas + transactionCostMinusRefund, currentBlock.gasUsed, "Total Gas should be equal to the currentBlock.gasUsed") - - } catch (e){ - assert(false, e); - } finally { - // clean up after ourselves - if (tempWeb3) { - tempWeb3.setProvider(null); - } - await pify(ganacheProvider.close)(); - } - }); - - it("clears mapping storage slots", async () =>{ - const options = {from: accounts[0]}; - - await estimateGasInstance.methods.reset().send({from: options.from, gas: 5000000}); - - const uintsa = await estimateGasInstance.methods.uints(1).call(); - assert.equal(uintsa, "0", "initial value is not correct"); - - const receipta = await estimateGasInstance.methods.store(1).send(options); - assert.equal(receipta.status, true, "storing value did not work"); - - const uintsb = await estimateGasInstance.methods.uints(1).call(); - assert.equal(uintsb, "1", "set value is incorrect"); - - const receiptb = await estimateGasInstance.methods.clear().send(options); - assert.equal(receiptb.status, true, "clearing value did not work"); - - const uintsc = await estimateGasInstance.methods.uints(1).call(); - assert.equal(uintsc, "0", "cleared value is not correct"); - }); - }); - - describe("Estimation", function() { - - async function testTransactionEstimate(contractFn, args, options) { - await estimateGasInstance.methods.reset().send({from: options.from, gas: 5000000}); - const method = contractFn(...args); - const gasEstimate = await method.estimateGas(options); - const receipt = await method.send(options); - - assert.equal(receipt.status, 1, 'Transaction must succeed'); - assert.equal(receipt.gasUsed, gasEstimate, "gasUsed"); - assert.equal(receipt.cumulativeGasUsed, gasEstimate, "estimate"); - } - - it("matches estimate for deployment", async function() { - let gasEstimate = await EstimateGasContract.deploy({ data: estimateGasContractData }) - .estimateGas({ from: accounts[1]}) - - assert.deepStrictEqual(deploymentReceipt.gasUsed, gasEstimate); - assert.deepStrictEqual(deploymentReceipt.cumulativeGasUsed, gasEstimate); - }); - - it("matches usage for complex function call (add)", async function() { - this.timeout(10000) - await testTransactionEstimate(estimateGasInstance.methods.add, [toBytes("Tim"), toBytes("A great guy"), 10], {from: accounts[0], gas: 3141592}); - }); - - it("matches usage for complex function call (transfer)", async function() { - this.timeout(10000) - await testTransactionEstimate(estimateGasInstance.methods.transfer, ["0x0123456789012345678901234567890123456789", 5, toBytes("Tim")], {from: accounts[0], gas: 3141592}); - }); - - function toBytes(s) { - let bytes = Array.prototype.map.call(s, function(c) { - return c.codePointAt(0) - }) - - return to.hex(Buffer.from(bytes)) - } - - }); - - describe('Expenditure', function() { - async function testGasExpenseIsCorrect(expectedGasPrice, setGasPriceOnTransaction = false, w3 = web3) { - const transferAmount = w3.utils.toBN(w3.utils.toWei('5', 'finney')); - - expectedGasPrice = w3.utils.toBN(expectedGasPrice); - - const initialBalance = await w3.utils.toBN(await w3.eth.getBalance(accounts[0])); - - let params = { - from: accounts[0], - to: accounts[1], - value: transferAmount - } - - if (setGasPriceOnTransaction) { - params.gasPrice = expectedGasPrice - } - - const receipt = await w3.eth.sendTransaction(params); - const gasUsed = w3.utils.toBN(receipt.gasUsed); - - const finalBalance = w3.utils.toBN(await w3.eth.getBalance(accounts[0])); - const deltaBalance = initialBalance.sub(finalBalance) - - // the amount we paid in excess of our transferAmount is what we spent on gas - const gasExpense = deltaBalance.sub(transferAmount) - - assert(!gasExpense.eq(w3.utils.toBN('0')), 'Calculated gas expense must be nonzero.') - - // gas expense is just gasPrice * gasUsed, so just solve accordingly - const actualGasPrice = gasExpense.div(gasUsed) - - assert(expectedGasPrice.eq(actualGasPrice), - `Gas price used by EVM (${to.hex(actualGasPrice)}) was different from expected gas price (${to.hex(expectedGasPrice)})`) - } - - it('should calculate gas expenses correctly in consideration of the default gasPrice', async function() { - await testGasExpenseIsCorrect(await web3.eth.getGasPrice()) - }) - - it('should calculate gas expenses correctly in consideration of the requested gasPrice', async function() { - await testGasExpenseIsCorrect('0x10000', true) - }) - - it('should calculate gas expenses correctly in consideration of a user-defined default gasPrice', async function() { - let gasPrice = '0x2000' - let provider = new Ganache.provider({ mnemonic, gasPrice }); - let tempWeb3; - try { - tempWeb3 = new Web3(provider); - await testGasExpenseIsCorrect(gasPrice, false, new Web3(Ganache.provider({ mnemonic, gasPrice }))) - } catch (e) { - if (tempWeb3) { - tempWeb3.setProvider(null); - } - provider.stop(() => {}) - } - }) - - it('should calculate cumalativeGas and gasUsed correctly when multiple transactions are in a block', async function (){ - let provider = Ganache.provider({ - blockTime: .5, // seconds - mnemonic: mnemonic - }); - - let tempWeb3; - - try { - tempWeb3 = new Web3(provider); - - let transactions = [{ - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x0" - }, { - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x1" - }, { - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[1],// < - "to": accounts[0], // <^ reversed tx order - "nonce": "0x0" - }] - - // Precondition - const initialBlockNumber = await tempWeb3.eth.getBlockNumber(); - assert.deepStrictEqual(initialBlockNumber, 0, 'Current Block Should be 0'); - - let hashes = await Promise.all(transactions.map((transaction) => { - let promiEvent = tempWeb3.eth.sendTransaction(transaction); - - return new Promise((accept) => { - promiEvent.once('transactionHash', async (hash) => { - - // Ensure there's no receipt since the transaction hasn't yet been processed. Ensure IntervalMining - let receipt = await tempWeb3.eth.getTransactionReceipt(hash); - assert.equal(receipt, null, "No receipt since the transaction hasn't yet been processed."); - - accept(hash); - }) - }); - })); - - // Wait .75 seconds (1.5x the mining interval) then get the receipt. It should be processed. - await delay(750) - - let currentBlockNumber = await tempWeb3.eth.getBlockNumber(); - assert.deepStrictEqual(currentBlockNumber, 1, 'Current Block Should be 1'); - - let currentBlock = await tempWeb3.eth.getBlock(currentBlockNumber); - - let receipts = await Promise.all(hashes.map((hash) => tempWeb3.eth.getTransactionReceipt(hash))) - - assert.deepStrictEqual(receipts[0].gasUsed, receipts[1].gasUsed, 'Tx1 and Tx2 should cost the same gas.'); - assert.deepStrictEqual(receipts[1].gasUsed, receipts[2].gasUsed, 'Tx2 and Tx3 should cost the same gas. -> Tx1 gas === Tx3 gas Transitive'); - assert.deepStrictEqual(receipts[1].transactionIndex > receipts[2].transactionIndex, true, '(Tx3 has a lower nonce) -> (Tx3 index is < Tx2 index)'); - - // ( Tx3 has a lower nonce -> Tx3 index is < Tx2 index ) -> cumulative gas Tx2 > Tx3 > Tx1 - let isAccumulating = (receipts[1].cumulativeGasUsed > receipts[2].cumulativeGasUsed) && (receipts[2].cumulativeGasUsed > receipts[0].cumulativeGasUsed); - assert.deepStrictEqual(isAccumulating, true, 'Cumulative gas should be accumulating for any transactions in the same block.'); - assert.deepStrictEqual(receipts[0].gasUsed, receipts[0].cumulativeGasUsed, 'Gas and cumulative gas should be equal for the FIRST Tx.'); - assert.notDeepStrictEqual(receipts[1].gasUsed, receipts[1].cumulativeGasUsed, 'Gas and cumulative gas should NOT be equal for the Second Tx.'); - assert.notDeepStrictEqual(receipts[2].gasUsed, receipts[2].cumulativeGasUsed, 'Gas and cumulative gas should NOT be equal for the Third Tx.'); - - let totalGas = receipts[0].gasUsed + receipts[1].gasUsed + receipts[2].gasUsed; - assert.deepStrictEqual(totalGas, receipts[1].cumulativeGasUsed, "Total Gas should be equal the final tx.cumulativeGas") - assert.deepStrictEqual(totalGas, currentBlock.gasUsed, "Total Gas should be equal to the currentBlock.gasUsed") - } catch (e){ - assert(false, e) - } finally { - if (tempWeb3) { - tempWeb3.setProvider(null); - } - await pify(provider.close)(); - } - }); - }); -}); - -async function delay(duration) { - await new Promise((accept) => { - setTimeout(accept, duration) - }); -} diff --git a/test/helpers/contracts.js b/test/helpers/contracts.js deleted file mode 100644 index 1fd1bf87a1..0000000000 --- a/test/helpers/contracts.js +++ /dev/null @@ -1,41 +0,0 @@ -const fs = require('fs') -const solc = require('solc') -const path = require('path') - -async function compileAndDeploy(contractPath, contractName, web3) { - let contractFilename = path.basename(contractPath) - - let source = fs.readFileSync(contractPath, "utf8"); - - let result = solc.compile({sources: {[contractFilename]: source}}, 1); - - let bytecode = "0x" + result.contracts[`${contractFilename}:${contractName}`].bytecode; - let abi = JSON.parse(result.contracts[`${contractFilename}:${contractName}`].interface); - - let contract = new web3.eth.Contract(abi); - - let accounts = await web3.eth.getAccounts() - let block = await web3.eth.getBlock("latest"); - let gasLimit = block.gasLimit; - - - let instance = await contract.deploy({data: bytecode}).send({from: accounts[0], gas: gasLimit}) - - // TODO: ugly workaround - not sure why this is necessary. - if (!instance._requestManager.provider) { - instance._requestManager.setProvider(web3.eth._provider); - } - - return { - source, - bytecode, - abi, - contract, - instance - } -} - -exports = module.exports = { - compileAndDeploy -} - diff --git a/test/hex.js b/test/hex.js deleted file mode 100644 index 2f27b88bdd..0000000000 --- a/test/hex.js +++ /dev/null @@ -1,136 +0,0 @@ -var assert = require("assert"); -var Web3 = require("web3"); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var to = require("../lib/utils/to.js"); - -describe("to.rpcQuantityHexString", function() { - it("should print '0x0' for input 0", function(done) { - assert.equal(to.rpcQuantityHexString(0), "0x0"); - done(); - }); - - it("should print '0x0' for input '0'", function(done) { - assert.equal(to.rpcQuantityHexString("0"), "0x0"); - done(); - }); - - it("should print '0x0' for input '000'", function(done) { - assert.equal(to.rpcQuantityHexString("000"), "0x0"); - done(); - }); - - it("should print '0x0' for input '0x000'", function(done) { - assert.equal(to.rpcQuantityHexString("0x000"), "0x0"); - done(); - }); - - it("should print '0x20' for input '0x0020'", function(done) { - assert.equal(to.rpcQuantityHexString("0x0020"), "0x20"); - done(); - }); -}); - -describe("to.rpcDataHexString", function() { - it("should differentiate between a list of 0 items and a list of one 0", function(done) { - assert.notEqual(to.rpcDataHexString(Buffer.from("", "hex")), to.rpcDataHexString(Buffer.from("00", "hex"))); - done(); - }) -}) - -function noLeadingZeros(method, result, path) { - if (!path) { - path = 'result' - } - - if (typeof result === "string") { - if (/^0x/.test(result)) { - assert.equal(result, to.rpcQuantityHexString(result), `Field ${path} in ${method} response has leading zeroes.`); - } - } else if (typeof result === "object") { - for (var key in result) { - if (result.hasOwnProperty(key)) { - if (Array.isArray(result)) { - path += [key] - } else { - path += '.' + key - } - noLeadingZeros(method, result[key], path + (path ? '.' : '') + key); - } - } - } -} - -describe("JSON-RPC Response", function() { - var web3 = new Web3(); - var provider = Ganache.provider(); - web3.setProvider(provider); - - var accounts; - before(function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs; - done(); - }); - }); - - // skipping this test for now as they aren't verifying the right thing that - // is, leading zeroes are fine in some response fields. we need a better model - // of expected response formatting/padding. - it.skip("should not have leading zeros in rpc quantity hex strings", function(done) { - var request = { - "jsonrpc": "2.0", - "method": "eth_getTransactionCount", - "params": [ - accounts[0], - "pending" - ], - "id": 1 - }; - - provider.sendAsync(request, function(err, result) { - noLeadingZeros('eth_getTransactionCount', result); - - request = { - "jsonrpc": "2.0", - "method": "eth_sendTransaction", - "params": [ - { - "from": accounts[0], - "to": accounts[1], - "value": "0x100000000" - } - ], - "id": 2 - }; - - provider.sendAsync(request, function() { - // Ignore eth_sendTransaction result, it returns the transaction hash. - // A transaction hash is a 'DATA' type, which can have leading zeroes - // to pad it to an even string length (4 bit per char, so whole bytes). - - request = { - "jsonrpc": "2.0", - "method": "eth_getTransactionCount", - "params": [ - accounts[0], - "pending" - ], - "id": 3 - }; - - provider.sendAsync(request, function(err, result) { - noLeadingZeros('eth_getTransactionCount', result); - done(); - }); - }); - }); - }); -}); - -describe("to.hex", function() { - it("should print '0x' for input '' (blank)", function(done) { - assert.equal(to.hex(Buffer("")), "0x"); - done(); - }); -}) \ No newline at end of file diff --git a/test/interface.ts b/test/interface.ts new file mode 100644 index 0000000000..7bfd147a05 --- /dev/null +++ b/test/interface.ts @@ -0,0 +1,11 @@ +import Ganache from "../index" +import * as assert from "assert"; + +describe("interface", () => { + it("has an interface", ()=>{ + assert(Ganache.server); + assert(Ganache.provider); + assert(Ganache.Server); + assert(Ganache.Provider); + }) +}); diff --git a/test/interval_mining.js b/test/interval_mining.js deleted file mode 100644 index 4c7da5092e..0000000000 --- a/test/interval_mining.js +++ /dev/null @@ -1,176 +0,0 @@ -var BN = require('bn.js'); -var Web3 = require('web3'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var assert = require('assert'); -var to = require("../lib/utils/to.js"); -var solc = require("solc"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -describe("Interval Mining", function() { - var web3; - - var mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; - var first_address = "0x604a95C9165Bc95aE016a5299dd7d400dDDBEa9A"; - - it("should mine a block on the interval", function(done) { - this.timeout(5000); - - web3 = new Web3(Ganache.provider({ - blockTime: 0.5, // seconds - mnemonic: mnemonic - })); - - // Get the first block (pre-condition) - web3.eth.getBlockNumber(function(err, number) { - if (err) return done(err); - assert.equal(number, 0); - - // Wait 1.25 seconds (two and a half mining intervals) then get the next block. - // It should be block number 2 (the third block). We wait more than one iteration - // to ensure the timeout gets reset. - - setTimeout(function() { - // Get the first block (pre-condition) - web3.eth.getBlockNumber(function(err, latest_number) { - assert.equal(latest_number, 2); - done(); - }); - }, 1250); - }); - }); - - it("shouldn't instamine when mining on an interval", function(done) { - this.timeout(5000); - - web3 = new Web3(Ganache.provider({ - blockTime: 0.25, // seconds - mnemonic: mnemonic - })); - - // Get the first block (pre-condition) - web3.eth.getBlockNumber(function(err, number) { - if (err) return done(err); - assert.equal(number, 0); - - // Queue a transaction - web3.eth.sendTransaction({ - from: first_address, - to: "0x1234567890123456789012345678901234567890", - value: web3.utils.toWei(new BN(1), "ether"), - gas: 90000 - }, function(err, tx) { - if (err) return done(err); - - // Ensure there's no receipt since the transaction hasn't yet been processed. - web3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - - assert.equal(receipt, null); - - // Wait .75 seconds (one and a half mining intervals) then get the receipt. It should be processed. - - setTimeout(function() { - // Get the first block (pre-condition) - web3.eth.getTransactionReceipt(tx, function(err, new_receipt) { - assert.notEqual(new_receipt, null); - done(); - }); - }, 750); - }); - - }); - }); - }); - - it("miner_stop should stop interval mining, and miner_start should start it again", function(done) { - this.timeout(5000); - - web3 = new Web3(Ganache.provider({ - blockTime: 0.5, // seconds - mnemonic: mnemonic - })); - - // Stop mining - web3.currentProvider.send({ - jsonrpc: "2.0", - method: "miner_stop", - id: new Date().getTime() - }, function(err, result) { - if (err) return done(err); - if (result.error) return done(result.error.message); - - // Get the first block (pre-condition) - web3.eth.getBlockNumber(function(err, initial_number) { - if (err) return done(err); - - // Wait .75 seconds (one and a half mining intervals) and ensure - // the block number hasn't increased. - setTimeout(function() { - web3.eth.getBlockNumber(function(err, stopped_number) { - if (err) return done(err); - assert.equal(stopped_number, initial_number); - - // Start mining again - web3.currentProvider.send({ - jsonrpc: "2.0", - method: "miner_start", - params: [1], - id: new Date().getTime() - }, function(err, result) { - if (err) return done(err); - if (result.error) return done(result.error.message); - - // Wait .75 seconds (one and a half mining intervals) and ensure - // the block number has increased by one. - setTimeout(function() { - web3.eth.getBlockNumber(function(err, last_number) { - if (err) return done(err); - - assert(last_number > stopped_number); - done(); - }); - }, 750) - - }); - }); - }, 750) - - }); - }); - }); - - it("should log runtime errors to the log", async function() { - this.timeout(5000); - - var logData = ""; - var logger = { - log: function(message) { - logData += message + "\n"; - } - }; - - web3 = new Web3(Ganache.provider({ - blockTime: 0.5, // seconds - mnemonic: mnemonic, - logger: logger - })); - - var result = solc.compile({sources: {"Example.sol": "pragma solidity ^0.4.2; contract Example { function Example() {throw;} }"}}, 1); - var bytecode = "0x" + result.contracts["Example.sol:Example"].bytecode; - - try { - let receipt = await web3.eth.sendTransaction({ - from: first_address, - data: bytecode, - gas: 3141592 - }); - assert.fail("Contract deploy promise should have rejected"); - } catch (e) { - assert(logData.indexOf("Runtime Error: revert") >= 0); - } - }); - -}); diff --git a/test/mining.js b/test/mining.js deleted file mode 100644 index 2fd85ead6f..0000000000 --- a/test/mining.js +++ /dev/null @@ -1,337 +0,0 @@ -var BN = require('bn.js'); -var Web3 = require('web3'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var assert = require('assert'); -var to = require("../lib/utils/to.js"); -var solc = require("solc"); -var pify = require("pify"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -describe("Mining", function() { - var web3 = new Web3(Ganache.provider({ - vmErrorsOnRPCResponse: true - //logger: console, - })); - var accounts; - var snapshot_id; - var badBytecode; - var goodBytecode; - - before("compile solidity code that causes runtime errors", async function() { - this.timeout(10000) - let result = await compileSolidity("pragma solidity ^0.4.2; contract Example { function Example() {throw;} }"); - badBytecode = result.code; - }); - - before("compile solidity code that causes an event", async function() { - this.timeout(10000) - let result = await compileSolidity("pragma solidity ^0.4.2; contract Example { event Event(); function Example() { Event(); } }"); - goodBytecode = result.code; - }); - - beforeEach("checkpoint, so that we can revert later", async function() { - let res = await pify(web3.currentProvider.send)({ - jsonrpc: "2.0", - method: "evm_snapshot", - id: new Date().getTime() - }); - - snapshot_id = res.result; - }); - - afterEach("revert back to checkpoint", async function() { - await pify(web3.currentProvider.send)({ - jsonrpc: "2.0", - method: "evm_revert", - params: [snapshot_id], - id: new Date().getTime() - }); - }); - - // Everything's a Promise to add in readibility. - async function getBlockNumber() { - return to.number(await web3.eth.getBlockNumber()) - }; - - async function startMining() { - await pify(web3.currentProvider.send)({ - jsonrpc: "2.0", - method: "miner_start", - params: [1], - id: new Date().getTime() - }); - } - - async function stopMining() { - await pify(web3.currentProvider.send)({ - jsonrpc: "2.0", - method: "miner_stop", - id: new Date().getTime() - }); - } - - async function checkMining() { - let response = await pify(web3.currentProvider.send)({ - jsonrpc: "2.0", - method: "eth_mining", - id: new Date().getTime() - }); - - return response.result; - } - - async function mineSingleBlock() { - let result = await pify(web3.currentProvider.send)({ - jsonrpc: "2.0", - method: "evm_mine", - id: new Date().getTime() - }); - assert.deepEqual(result.result, "0x0"); - } - - async function queueTransaction(from, to, gasLimit, value, data) { - let response = await pify(web3.currentProvider.send)({ - jsonrpc: "2.0", - method: "eth_sendTransaction", - id: new Date().getTime(), - params: [{ - from: from, - to: to, - gas: gasLimit, - value: value, - data: data - }] - }) - if (response.error) { - throw new Error(response.error.message) - } - return response.result - } - - async function getCode(address) { - return await web3.eth.getCode(address); - }; - - function compileSolidity(source) { - let result = solc.compile({sources: {"Contract.sol": source}}); - return Promise.resolve({code: "0x" + result.contracts[Object.keys(result.contracts)[0]].bytecode}) - }; - - before(async function() { - accounts = await web3.eth.getAccounts() - }); - - it("should mine a single block with two queued transactions", async function() { - await stopMining() - let blockNumber = await getBlockNumber(); - - let tx1 = await queueTransaction(accounts[0], accounts[1], 90000, web3.utils.toWei(new BN(2), "ether")); - let receipt1 = await web3.eth.getTransactionReceipt(tx1); - assert.equal(receipt1, null); - - let tx2 = await queueTransaction(accounts[0], accounts[1], 90000, web3.utils.toWei(new BN(3), "ether")); - let receipt2 = await web3.eth.getTransactionReceipt(tx2); - assert.equal(receipt2, null); - - await startMining(); - - let receipts = await Promise.all([web3.eth.getTransactionReceipt(tx1), web3.eth.getTransactionReceipt(tx2)]); - - assert.equal(receipts.length, 2); - - assert.notEqual(receipts[0], null); - assert.equal(receipts[0].transactionHash, tx1); - assert.notEqual(receipts[1], null); - assert.equal(receipts[1].transactionHash, tx2); - assert.equal(receipts[0].blockNumber, receipts[1].blockNumber, "Transactions should be mined in the same block."); - - let number = await getBlockNumber(); - assert.equal(number, blockNumber + 1); - }); - - it("should mine two blocks when two queued transactions won't fit into a single block", async function() { - // This is a very similar test to the above, except the gas limits are much higher - // per transaction. This means the Ganache will react differently and process - // each transaction it its own block. - - await stopMining(); - let blockNumber = await getBlockNumber(); - - let tx1 = await queueTransaction(accounts[0], accounts[1], 4000000, web3.utils.toWei(new BN(2), "ether")); - let receipt1 = await web3.eth.getTransactionReceipt(tx1); - assert.equal(receipt1, null); - - let tx2 = await queueTransaction(accounts[0], accounts[1], 4000000, web3.utils.toWei(new BN(3), "ether")); - let receipt2 = await web3.eth.getTransactionReceipt(tx2); - assert.equal(receipt2, null); - - await startMining(); - - let receipts = await Promise.all([web3.eth.getTransactionReceipt(tx1), web3.eth.getTransactionReceipt(tx2)]); - - assert.equal(receipts.length, 2); - - assert.notEqual(receipts[0], null); - assert.equal(receipts[0].transactionHash, tx1); - - assert.notEqual(receipts[1], null); - assert.equal(receipts[1].transactionHash, tx2); - - assert.notEqual(receipts[0].blockNumber, receipts[1].blockNumber, "Transactions should not be mined in the same block."); - - let number = await getBlockNumber(); - assert.equal(number, blockNumber + 2); - }); - - it("should mine one block when requested, and only one transaction, when two queued transactions together are larger than a single block", async function() { - // This is a very similar test to the above, except we don't start mining again, - // we only mine one block by request. - - await stopMining() - let blockNumber = await getBlockNumber(); - let tx1 = await queueTransaction(accounts[0], accounts[1], 4000000, web3.utils.toWei(new BN(2), "ether")); - let receipt1 = await web3.eth.getTransactionReceipt(tx1); - assert.equal(receipt1, null); - - let tx2 = await queueTransaction(accounts[0], accounts[1], 4000000, web3.utils.toWei(new BN(3), "ether")); - let receipt2 = await web3.eth.getTransactionReceipt(tx2); - assert.equal(receipt2, null); - - await mineSingleBlock(); - - let receipts = await Promise.all([web3.eth.getTransactionReceipt(tx1), web3.eth.getTransactionReceipt(tx2)]); - - assert.equal(receipts.length, 2); - - assert.notEqual(receipts[0], null); - assert.equal(receipts[0].transactionHash, tx1); - - assert.equal(receipts[1], null); - - let number = await getBlockNumber(); - assert.equal(number, blockNumber + 1); - }); - - it("should error if queued transaction exceeds the block gas limit", async function() { - try { - await stopMining() - let tx1 = await queueTransaction(accounts[0], accounts[1], 10000000, web3.utils.toWei(new BN(2), "ether")); - assert.fail("Transaction was processed without erroring; gas limit should have been too high"); - } catch (err) { - // We caught an error like we expected. Ensure it's the right error, or rethrow. - if (err.message.toLowerCase().indexOf("exceeds block gas limit") < 0) { - assert.fail("Did not receive expected error; instead received: " + err); - } - } - }); - - it("should error via instamining when queued transaction throws a runtime errors", async function() { - try { - await startMining() - // This transaction should be processed immediately. - let tx1 = await queueTransaction(accounts[0], null, 3141592, 0, badBytecode); - assert.fail("Execution should never get here as we expected `eth_sendTransaction` to throw an error") - } catch (err) { - if (err.message.indexOf("VM Exception while processing transaction") != 0) { - assert.fail("Received error we didn't expect: " + err); - } - } - }); - - it("should error via evm_mine when queued transaction throws a runtime errors", async function() { - try { - await stopMining() - await queueTransaction(accounts[0], null, 3141592, 0, badBytecode); - await mineSingleBlock(); - assert.fail("Execution should never get here as we expected `evm_mine` to throw an error") - } catch (err) { - if (err.message.indexOf("VM Exception while processing transaction") != 0) { - assert.fail("Received error we didn't expect: " + err); - } - } - }); - - it("should error via evm_mine when multiple queued transactions throw runtime errors in a single block", async function() { - // Note: The two transactions queued in this test do not exceed the block gas limit - // and thus should fit within a single block. - - try { - await stopMining() - await queueTransaction(accounts[0], null, 1000000, 0, badBytecode); - await queueTransaction(accounts[0], null, 1000000, 0, badBytecode); - await mineSingleBlock(); - assert.fail("Execution should never get here as we expected `evm_mine` to throw an error") - } catch (err) { - if (err.message.indexOf("Multiple VM Exceptions while processing transactions") != 0) { - assert.fail("Received error we didn't expect: " + err); - } - // We got the error we wanted. Test passed! - } - }); - - it("should error via miner_start when multiple queued transactions throw runtime errors in multiple blocks", async function() { - // Note: The two transactions queued in this test together DO exceed the block gas limit - // and thus will fit in two blocks, one block each. - - try { - await stopMining() - await queueTransaction(accounts[0], null, 3141592, 0, badBytecode); - await queueTransaction(accounts[0], null, 3141592, 0, badBytecode); - await startMining(); - assert.fail("Execution should never get here as we expected `miner_start` to throw an error") - } catch (err) { - if (err.message.indexOf("Multiple VM Exceptions while processing transactions") != 0) { - assert.fail("Received error we didn't expect: " + err); - } - // We got the error we wanted. Test passed! - } - }); - - it("even if we receive a runtime error, logs for successful transactions need to be processed", async function() { - // Note: The two transactions queued in this test should exist within the same block. - let tx1, tx2; - - try { - await stopMining() - - tx1 = await queueTransaction(accounts[0], null, 1000000, 0, badBytecode); - tx2 = await queueTransaction(accounts[0], null, 1000000, 0, goodBytecode); - - await startMining(); - assert.fail("Execution should never get here as we expected `miner_start` to throw an error") - } catch (err) { - if (err.message.indexOf("VM Exception while processing transaction") != 0) { - assert.fail("Received error we didn't expect: " + err); - } - - // We got the error we wanted. Now check to see if the transaction was processed correctly. - let receiptTx2 = await web3.eth.getTransactionReceipt(tx2) - - // We should have a receipt for the second transaction - it should have been processed. - assert.notEqual(receiptTx2, null); - assert.notEqual(receiptTx2, {}); - - // It also should have logs. - assert.notEqual(receiptTx2.logs.length, 0); - - // Now check that there's code at the address, which means it deployed successfully. - let code = await getCode(receiptTx2.contractAddress); - - // Convert hex to a big number and ensure it's not zero. - assert(web3.utils.toBN(code).eq(0) == false); - - } - }); - - it("should return the correct value for eth_mining when miner started and stopped", async function() { - await stopMining() - let isMining = await checkMining(); - assert(!isMining); - await startMining(); - isMining = await checkMining(); - assert(isMining); - }); -}); diff --git a/test/options/gasLimit.js b/test/options/gasLimit.js deleted file mode 100644 index 66f8775064..0000000000 --- a/test/options/gasLimit.js +++ /dev/null @@ -1,30 +0,0 @@ -const Web3 = require('web3'); -const assert = require('assert'); -const Ganache = require("../../index.js"); -const path = require("path"); - -const mnemonic = 'candy maple cake sugar pudding cream honey rich smooth crumble sweet treat' - -describe('options:gasLimit', function() { - let options = {mnemonic} - let provider = null - let web3 = null - let accounts = [] - - before ('setup web3', async function() { - provider = new Ganache.provider(options) - web3 = new Web3(provider) - }) - - before('get accounts', async function() { - accounts = await web3.eth.getAccounts() - }) - - it('should respect the assigned gasLimit', async function() { - let assignedGasLimit = provider.engine.manager.state.blockchain.blockGasLimit; - let block = await web3.eth.getBlock('latest') - assert.deepEqual(block.gasLimit, assignedGasLimit) - }) -}); - - diff --git a/test/options/gasPrice.js b/test/options/gasPrice.js deleted file mode 100644 index 4a999cfe79..0000000000 --- a/test/options/gasPrice.js +++ /dev/null @@ -1,79 +0,0 @@ -const to = require('../../lib/utils/to'); -const Web3 = require('web3'); -const assert = require('assert'); -const Ganache = require("../../index"); -const path = require("path"); - -const compileAndDeploy = require ('../helpers/contracts').compileAndDeploy - -const mnemonic = 'candy maple cake sugar pudding cream honey rich smooth crumble sweet treat' - -function setUp(options = {mnemonic}, contractName = 'Example') { - let context = { - options: options, - provider: null, - web3: null, - accounts: [], - contractArtifact: {}, - instance: null - } - - before ('setup web3', async function() { - context.provider = new Ganache.provider(context.options) - context.web3 = new Web3(context.provider) - }) - - before('get accounts', async function() { - context.accounts = await context.web3.eth.getAccounts() - }) - - before("compile source", async function() { - this.timeout(10000) - context.contractArtifact = await compileAndDeploy(path.join(__dirname, '..', `${contractName}.sol`), contractName, context.web3) - context.instance = context.contractArtifact.instance - }) - - return context -} - -describe('options:gasPrice', function() { - describe('default gasPrice', function() { - - let context = setUp() - - it('should respect the default gasPrice', async function() { - let assignedGasPrice = context.provider.engine.manager.state.gasPriceVal; - - let receipt = await context.instance.methods.setValue('0x10').send({from: context.accounts[0], gas: 3141592}) - - let transactionHash = receipt.transactionHash; - let tx = await context.web3.eth.getTransaction(transactionHash) - let gasPrice = tx.gasPrice - - assert.deepEqual(to.hex(gasPrice), to.hex(assignedGasPrice)) - }) - - }) - - describe('zero gasPrice', function() { - - let context = setUp({mnemonic, gasPrice: 0}) - - it('should be possible to set a zero gas price', async function() { - let assignedGasPrice = context.provider.engine.manager.state.gasPriceVal; - - assert.deepEqual(assignedGasPrice, '0x0') - - let receipt = await context.instance.methods.setValue('0x10').send({from: context.accounts[0], gas: 3141592}) - - let transactionHash = receipt.transactionHash; - let tx = await context.web3.eth.getTransaction(transactionHash) - let gasPrice = tx.gasPrice - - assert.deepEqual(to.hex(gasPrice), to.hex(assignedGasPrice)) - }) - - }) -}); - - diff --git a/test/persistence.js b/test/persistence.js deleted file mode 100644 index 59f93b164b..0000000000 --- a/test/persistence.js +++ /dev/null @@ -1,167 +0,0 @@ -var Web3 = require('web3'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var assert = require('assert'); -var temp = require("temp").track(); -var fs = require("fs"); -var solc = require("solc"); -var memdown = require("memdown"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -var source = fs.readFileSync("./test/Example.sol", {encoding: "utf8"}); -var result = solc.compile(source, 1); -var provider - -// Note: Certain properties of the following contract data are hardcoded to -// maintain repeatable tests. If you significantly change the solidity code, -// make sure to update the resulting contract data with the correct values. -var contract = { - solidity: source, - abi: result.contracts[":Example"].interface, - binary: "0x" + result.contracts[":Example"].bytecode, - position_of_value: "0x0000000000000000000000000000000000000000000000000000000000000000", - expected_default_value: 5, - call_data: { - gas: '0x2fefd8', - gasPrice: '0x01', // This is important, as passing it has exposed errors in the past. - to: null, // set by test - data: '0x3fa4f245' - }, - transaction_data: { - from: null, // set by test - gas: '0x2fefd8', - to: null, // set by test - data: '0x552410770000000000000000000000000000000000000000000000000000000000000019' // sets value to 25 (base 10) - } -}; - -var runTests = function(providerInit) { - describe("Persistence ", function() { - var web3 = new Web3(); - var accounts; - var tx_hash; - var provider; - - before('init provider', function (done) { - providerInit(function(p) { - provider = p; - web3.setProvider(p); - done(); - }); - }); - - before("Gather accounts", function(done) { - web3.eth.getAccounts(function(err, a) { - if (err) return done(err); - accounts = a; - done(); - }); - }); - - before("send transaction", function (done) { - web3.eth.sendTransaction({ - from: accounts[0], - gas: '0x2fefd8', - data: contract.binary - }, function(err, hash) { - if (err) return done(err); - tx_hash = hash; - done(); - }); - }); - - it("should have block height 1", function (done) { - this.timeout(5000); - web3.eth.getBlockNumber(function(err, res) { - if (err) return done(err); - - assert(res == 1); - - // Close the first provider now that we've gotten where we need to be. - // Note: we specifically close the provider so we can read from the same db. - provider.close(done); - }); - }); - - it("should reopen the provider", function (done) { - providerInit(function(p) { - provider = p; - web3.setProvider(provider); - done(); - }); - }); - - it("should still be on block height 1", function (done) { - this.timeout(5000); - web3.eth.getBlockNumber(function(err, result) { - if (err) return done(err); - assert(result == 1); - done(); - }); - }); - - it("should still have block data for first block", function (done) { - web3.eth.getBlock(1, function(err, result) { - if (err) return done(err); - done(); - }); - }); - - it("should have a receipt for the previous transaction", function(done) { - web3.eth.getTransactionReceipt(tx_hash, function(err, receipt) { - if (err) return done(err); - - assert.notEqual(receipt, null, "Receipt shouldn't be null!"); - assert.equal(receipt.transactionHash, tx_hash); - done(); - }) - }); - - it("should maintain the balance of the original accounts", function (done) { - web3.eth.getBalance(accounts[0], function(err, balance) { - if (err) return done(err); - assert(balance > 98); - done(); - }); - }); - - }); -} - -var mnemonic = "debris electric learn dove warrior grow pistol carry either curve radio hidden"; - -describe("Default DB", function() { - var dbPath = temp.mkdirSync('testrpc-db-'); - // initialize a persistent provider - - var providerInit = function(cb) { - provider = Ganache.provider({ - db_path: dbPath, - mnemonic - }); - - cb(provider); - } - - runTests(providerInit); - -}); - -describe("Custom DB", function() { - var db = memdown(); - - // initialize a custom persistence provider - var providerInit = function(cb) { - provider = Ganache.provider({ - db, - mnemonic - }); - - cb(provider); - } - - runTests(providerInit); - -}); diff --git a/test/public-exports.js b/test/public-exports.js deleted file mode 100644 index e2103ef8fc..0000000000 --- a/test/public-exports.js +++ /dev/null @@ -1,8 +0,0 @@ -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var assert = require("assert"); - -describe("BuildType", function() { - it("Tests that we are using the right version", () =>{ - assert(process.env.TEST_BUILD ? Ganache._webpacked === true : Ganache._webpacked === false); - }); -}); \ No newline at end of file diff --git a/test/requests.js b/test/requests.js deleted file mode 100644 index 4b9ecc88aa..0000000000 --- a/test/requests.js +++ /dev/null @@ -1,1523 +0,0 @@ -var Web3 = require('web3'); -var Web3WsProvider = require('web3-providers-ws'); -var Transaction = require('ethereumjs-tx'); -var utils = require('ethereumjs-util'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var solc = require("solc"); -var fs = require("fs"); -var to = require("../lib/utils/to"); -var _ = require("lodash"); - -var source = fs.readFileSync("./test/Example.sol", {encoding: "utf8"}); -var result = solc.compile(source, 1); -var secretKeys = [ - '0xda09f8cdec20b7c8334ce05b27e6797bef01c1ad79c59381666467552c5012e3', - '0x0d14f32c8e3ed7417fb7db52ebab63572bf7cfcd557351d4ccf19a05edeecfa5', - '0x0d80aca78bfaf3ab47865a53e5977e285c41c028a15313f917fe78abe5a50ef7', - '0x00af8067d4c69abca7234194f154d7f31e13c0e53dae9260432f1bcc6d1d13fb', - '0x8939a6a37b48c47f9bc683c371dd96e819d65f6138f3b376a622ecb40379bd22', - '0x4a3665bf95efd38cb9820ce129a26fee03927f17930924c98908c8885ca53606', - '0x111bd4b380f2eeb0d00b025d574908d59c1bfa0030d7a69f69445c171d8cfa27', - '0x6aff34e843c3a99fe21dcc014e3b5bf6a160a4bb8c4c470ea79acd33d9bea41f', - '0x12ae0eb585babc60c88a74190a6074488a0d2f296124ce37f85dbec1d693906f', - '0xd46dc75904628a0b0eaffdda6acbe2687924299995708e30d05a1e8a2a1c5d45' -]; - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - - -// Note: Certain properties of the following contract data are hardcoded to -// maintain repeatable tests. If you significantly change the solidity code, -// make sure to update the resulting contract data with the correct values. -var contract = { - solidity: source, - abi: result.contracts[":Example"].interface, - binary: "0x" + result.contracts[":Example"].bytecode, - runtimeBinary: '0x' + result.contracts[":Example"].runtimeBytecode, - position_of_value: "0x0000000000000000000000000000000000000000000000000000000000000000", - expected_default_value: 5, - call_data: { - gasPrice: '0x01', // This is important, as passing it has exposed errors in the past. - to: null, // set by test - data: '0x3fa4f245' - }, - transaction_data: { - from: null, // set by test - to: null, // set by test - data: '0x552410770000000000000000000000000000000000000000000000000000000000000019', // sets value to 25 (base 10) - gas: 3141592 - } -}; - -var tests = function(web3) { - var accounts; - var personalAccount; - - before('create and fund personal account', function() { - return web3.eth.getAccounts() - .then(function(accs) { - - accounts = accs.map(function(val) { - return val.toLowerCase(); - }); - - return web3.eth.personal.newAccount("password") - }).then(function(acct) { - personalAccount = acct - }) - }); - - describe("eth_accounts", function() { - it("should return 10 addresses", function(done) { - assert.deepEqual(accounts.length, 10); - done(); - }); - }); - - describe("eth_getCompilers", function() { - it("should return an empty array", function() { - return web3.eth.getCompilers() - .then(function(compilers) { - assert(Array.isArray(compilers)); - assert.equal(0, compilers.length); - }) - }); - }); - - describe("eth_blockNumber", function() { - it("should return initial block number of zero", function(done) { - var number = web3.eth.getBlockNumber(function(err, result) { - if (err) return done(err); - - assert.deepEqual(result, 0); - done(); - }); - - // Note: We'll assert the block number changes on transactions. - }); - }); - - describe("eth_coinbase", function() { - it("should return correct address", function(done) { - web3.eth.getCoinbase(function(err, coinbase) { - if (err) return done(err); - - assert.equal(coinbase, accounts[0]); - done(); - }); - }); - }); - - describe("eth_mining", function() { - it("should return true", function(done) { - web3.eth.isMining(function(err, result) { - if (err) return done(err); - - assert.deepEqual(result, true); - done(); - }); - }); - }); - - describe("eth_hashrate", function() { - it("should return hashrate of zero", function(done) { - web3.eth.getHashrate(function(err, result) { - if (err) return done(err); - - assert.deepEqual(result, 0); - done(); - }); - }); - }); - - describe("eth_gasPrice", function() { - it("should return gas price of 2 gwei", function(done) { - web3.eth.getGasPrice(function(err, result) { - if (err) return done(err); - - assert.equal(to.hexWithZeroPadding(result), to.hexWithZeroPadding(2000000000)); - done(); - }); - }); - }); - - describe("eth_getBalance", function() { - it("should return initial balance", function(done) { - web3.eth.getBalance(accounts[0], function(err, result) { - if (err) return done(err); - - assert.deepEqual(result, "100000000000000000000"); - done(); - }); - }); - - it("should return 0 for non-existent account", function(done) { - web3.eth.getBalance("0x1234567890123456789012345678901234567890", function(err, result) { - if (err) return done(err); - - assert.equal("0x" + result.toString(16), "0x0"); - done(); - }); - }); - }); - - describe("eth_getBlockByNumber", function() { - it("should return block given the block number", function(done) { - web3.eth.getBlock(0, true, function(err, block) { - if (err) return done(err); - - var expectedFirstBlock = { - number: 0, - hash: block.hash, // Don't test this one - mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000", - parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000', - nonce: '0x0000000000000000', - sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347', - logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - transactionsRoot: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', - stateRoot: '0x7caba99698b405652a6bcb1038efa16db54b3338af71fa832a0b99a3e6c344bc', - receiptsRoot: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', - miner: '0x0000000000000000000000000000000000000000', - difficulty: "0", - totalDifficulty: "0", - extraData: '0x', - size: 1000, - gasLimit: 6721975, - gasUsed: 0, - timestamp: block.timestamp, // Don't test this one. - transactions: [], - uncles: [] - }; - - assert.deepEqual(block, expectedFirstBlock); - - var now = (new Date()).getTime(); - var then = block.timestamp * 1000; // block.timestamp is in seconds. - - assert.equal(then.toString().length, now.toString().length, "Invalid timestamp length"); - assert(then < now, "Time returned was greater than the current time"); - done(); - }); - }); - - it("should return null given a future block number", function(done) { - web3.eth.getBlock(10000, true, function(err, block) { - if (err) return done(err); - - assert.deepEqual(block, null); - done(); - }); - }); - - it("should return transactions in the block as well", function(done) { - web3.eth.sendTransaction({ - from: accounts[0], - data: contract.binary, - gas: 3141592 - }, function(err, tx_hash) { - if (err) return done(err); - - // Assume it was processed correctly. - assert.deepEqual(tx_hash.length, 66); - - web3.eth.getBlock("latest", true, function(err, block) { - if (err) return done(err); - - assert.equal(block.transactions.length, 1, "Latest block should have one transaction"); - assert.equal(block.transactions[0].hash, tx_hash, "Transaction hashes don't match"); - - //Retest, with transaction only as hash - web3.eth.getBlock("latest", false, function(err, block) { - if (err) return done(err); - - assert.equal(block.transactions.length, 1, "Latest block should have one transaction"); - assert.equal(block.transactions[0], tx_hash, "Transaction hashes don't match"); - - done() - }); - }); - }); - }); - }); - - // Relies on the validity of eth_getBlockByNumber above. - describe("eth_getBlockByHash", function() { - it("should return block given the block hash", function(done) { - web3.eth.getBlock(0, true, function(err, blockByNumber) { - if (err) return done(err); - - web3.eth.getBlock(blockByNumber.hash, true, function(err, blockByHash) { - if (err) return done(err); - - assert.deepEqual(blockByHash, blockByNumber); - done(); - }); - }); - }); - }); - - describe("eth_getBlockTransactionCountByNumber", function(){ - it("should return the number of transactions given the block number (0 transactions)", function(done) { - //Block 0 should have 0 transactions as per test eth_getBlockByNumber - web3.eth.getBlock(0, true, function(err, block) { - if (err) return done(err); - web3.eth.getBlockTransactionCount(0, function(err, blockTransactionCount) { - assert.equal(block.transactions.length, blockTransactionCount, "Block transaction count should be 0."); - assert.equal(0, blockTransactionCount, "Block transaction count should be 0."); - done(); - }); - }); - }); - - it("should return the number of transactions given the block number (1 transaction)", function(done) { - // Create a transaction and check - // Account 0 seems to be running out of gas before all tests are complete - var payingAccount = 2; - - web3.eth.sendTransaction({ - from: accounts[payingAccount], - data: contract.binary, - gas: 3141592 - }, function(err, tx_hash) { - if (err) return done(err); - // Assume it was processed correctly. - assert.deepEqual(tx_hash.length, 66); - - web3.eth.getBlock("latest", true, function(err, block) { - if (err) return done(err); - web3.eth.getBlockTransactionCount(block.number , function(err, blockTransactionCount) { - if (err) return done(err); - assert.equal(block.transactions.length, blockTransactionCount, "Block transaction count should be 1."); - assert.equal(1, blockTransactionCount, "Block transaction count should be 1."); - done(); - }); - }); - }); - }); - - it("should return 0 transactions when the block doesn't exist", function(done) { - web3.eth.getBlockTransactionCount(1000000, function(err, blockTransactionCount) { - if (err) return done(err); - assert.equal(0, blockTransactionCount, "Block transaction count should be 0."); - done(); - }); - }); - }); - - // Dependent upon validity of eth_getBlockTransactionCountByNumber - describe("eth_getBlockTransactionCountByHash", function(){ - it("should return the number of transactions given the hash", function(done) { - web3.eth.getBlock(0, true, function(err, blockByNumber) { - if (err) return done(err); - web3.eth.getBlockTransactionCount(blockByNumber.number, true, function(err, txCountByHash) { - if (err) return done(err); - web3.eth.getBlockTransactionCount(blockByNumber.hash , function(err, txCountByNumber) { - if (err) return done(err); - assert.equal(txCountByHash, txCountByNumber, "Txn count for block retrieved by hash should equal count retrieved by number."); - done(); - }); - }); - }); - }); - }); - - describe("eth_getCode", function() { - it("should return 0x for eth_getCode called on a non-contract", function(done) { - web3.eth.getCode("0x000000000000000000000000000000000000dEaD", function(err, code) { - assert.equal(code, "0x"); - done(); - }); - }); - }); - - describe("eth_sign", function() { - var accounts; - var signingWeb3; - - // This account produces an edge case signature when it signs the hex-encoded buffer: - // '0x07091653daf94aafce9acf09e22dbde1ddf77f740f9844ac1f0ab790334f0627'. (See Issue #190) - var acc = { - balance: "0x00", - secretKey: "0xe6d66f02cd45a13982b99a5abf3deab1f67cf7be9fee62f0a072cb70896342e4" - }; - - // Load account. - before(function( done ){ - signingWeb3 = new Web3(); - signingWeb3.setProvider(Ganache.provider({ - accounts: [ acc ] - })); - signingWeb3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs.map(function(val) { - return val.toLowerCase(); - }); - done(); - }); - }); - - it("should produce a signature whose signer can be recovered", function() { - var msg = utils.toBuffer("asparagus"); - var msgHash = utils.hashPersonalMessage(msg); - - return signingWeb3.eth.sign(utils.bufferToHex(msg), accounts[0]).then(sgn => { - sgn = utils.stripHexPrefix(sgn); - var r = Buffer.from(sgn.slice(0, 64), 'hex'); - var s = Buffer.from(sgn.slice(64, 128), 'hex'); - var v = parseInt(sgn.slice(128, 130), 16) + 27; - var pub = utils.ecrecover(msgHash, v, r, s); - var addr = utils.setLength(utils.fromSigned(utils.pubToAddress(pub)), 20); - addr = to.hex(addr); - assert.deepEqual(addr, accounts[0]); - }); - }); - - it("should work if ecsign produces 'r' or 's' components that start with 0", function() { - // This message produces a zero prefixed 'r' component when signed by ecsign - // w/ the account set in this test's 'before' block. - var msgHex = '0x07091653daf94aafce9acf09e22dbde1ddf77f740f9844ac1f0ab790334f0627'; - var edgeCaseMsg = utils.toBuffer(msgHex); - var msgHash = utils.hashPersonalMessage(edgeCaseMsg); - return signingWeb3.eth.sign(msgHex, accounts[0]).then(sgn => { - sgn = utils.stripHexPrefix(sgn); - var r = Buffer.from(sgn.slice(0, 64), 'hex'); - var s = Buffer.from(sgn.slice(64, 128), 'hex'); - var v = parseInt(sgn.slice(128, 130), 16) + 27; - var pub = utils.ecrecover(msgHash, v, r, s); - var addr = utils.setLength(utils.fromSigned(utils.pubToAddress(pub)), 20); - addr = to.hex(addr); - assert.deepEqual(addr, accounts[0]); - }); - }) - - after("shutdown", function(done) { - let provider = signingWeb3._provider; - signingWeb3.setProvider() - provider.close(done) - }); - - }); - - describe("eth_signTypedData", function() { - var accounts; - var signingWeb3; - - // Account based on https://github.com/ethereum/EIPs/blob/master/assets/eip-712/Example.js - var acc = { - balance: "0x00", - secretKey: web3.utils.sha3('cow') - }; - - // Load account. - before(function( done ){ - signingWeb3 = new Web3(); - signingWeb3.setProvider(Ganache.provider({ - accounts: [ acc ] - })); - signingWeb3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs.map(function(val) { - return val.toLowerCase(); - }); - done(); - }); - }); - - it("should produce a signature whose signer can be recovered", function(done) { - var typedData = {"types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Person":[{"name":"name","type":"string"},{"name":"wallet","type":"address"}],"Mail":[{"name":"from","type":"Person"},{"name":"to","type":"Person"},{"name":"contents","type":"string"}]},"primaryType":"Mail","domain":{"name":"Ether Mail","version":"1","chainId":1,"verifyingContract":"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},"message":{"from":{"name":"Cow","wallet":"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"},"to":{"name":"Bob","wallet":"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"},"contents":"Hello, Bob!"}} - var msg = utils.toBuffer("asparagus"); - var msgHash = utils.hashPersonalMessage(msg); - - signingWeb3.currentProvider.sendAsync({ - jsonrpc: "2.0", - method: "eth_signTypedData", - params: [accounts[0], typedData], - id: new Date().getTime() - }, function(err, response) { - if (err) { - return done(err); - } - console.log(response); - assert.equal(response.result, "0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c"); - done(); - }); - }); - - after("shutdown", function(done) { - let provider = signingWeb3._provider; - signingWeb3.setProvider() - provider.close(done) - }); - - }); - - describe('eth_sendTransaction', () => { - - it("should fail with bad nonce (too low)", function(done) { - var transaction = { - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x00", // too low nonce - } - - web3.eth.sendTransaction(transaction, function(err, result) { - assert(err.message.indexOf("the tx doesn't have the correct nonce. account has nonce of: 1 tx has nonce of: 0") >= 0, `Incorrect error message: ${err.message}`); - done() - }) - - }); - - it("should fail with bad nonce (too high)", function(done) { - var transaction = { - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0xff", // too high nonce - } - - web3.eth.sendTransaction(transaction, function(err, result) { - assert(err.message.indexOf("the tx doesn't have the correct nonce. account has nonce of: 1 tx has nonce of: 255") >= 0); - done() - }); - - }); - - it("should succeed with right nonce (1)", function(done) { - var transaction = { - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x01" - } - - web3.eth.sendTransaction(transaction, function(err, result) { - done(err) - }) - - }) - - it("should fail with bad nonce (skipped value)", function(done) { - let tempWeb3 = new Web3(Ganache.provider({ - blockTime: .5, // seconds - mnemonic: "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat" - })); - - const accounts = [ // configured with mnemonic - '0x627306090abab3a6e1400e9345bc60c78a8bef57', - '0xf17f52151ebef6c7334fad080c5704d77216b732', - ]; - const secretKeys = [ // configured with mnemonic - '0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3' - ]; - - let transaction = { - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x00" - } - - let transaction2 = { - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x02" // Skipped nonce 1 - } - - tempWeb3.eth.sendTransaction(transaction, function(err, hash) { - if (err) return done(err); - // Ensure there's no receipt since the transaction hasn't yet been processed. - tempWeb3.eth.getTransactionReceipt(hash, function(err, receipt) { - if (err) return done(err); - assert.equal(receipt, null, "No receipt since the transaction hasn't yet been processed."); - // Issue second transaction - tempWeb3.eth.sendTransaction(transaction2, function(err2, hash2) { - assert.notDeepEqual(err2, null, 'Incorrect nonce, tx should fail.'); - setTimeout(function() { - // Wait .75 seconds (1.5x the mining interval) then get the receipt. It should be processed. - tempWeb3.eth.getTransactionReceipt(hash, function(err3, receipt1) { - assert.notDeepEqual(receipt1, null, 'First tx should be processed'); - done() - }); - }, 750); - }); - }); - }); - }) - }) - - describe('eth_sendRawTransaction', () => { - - it("should fail with bad nonce (too low)", function(done) { - var transaction = new Transaction({ - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x00", // too low nonce - }) - - var secretKeyBuffer = Buffer.from(secretKeys[0].substr(2), 'hex') - transaction.sign(secretKeyBuffer) - - web3.eth.sendSignedTransaction(transaction.serialize(), function(err, result) { - assert(err.message.indexOf("the tx doesn't have the correct nonce. account has nonce of: 2 tx has nonce of: 0") >= 0, `Incorrect error message: ${err.message}`); - done() - }) - - }) - - it("should fail with bad nonce (too high)", function(done) { - var transaction = new Transaction({ - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0xff", // too high nonce - }) - - var secretKeyBuffer = Buffer.from(secretKeys[0].substr(2), 'hex') - transaction.sign(secretKeyBuffer) - - web3.eth.sendSignedTransaction(transaction.serialize(), function(err, result) { - assert(err.message.indexOf("the tx doesn't have the correct nonce. account has nonce of: 2 tx has nonce of: 255") >= 0); - done() - }) - - }) - - it("should succeed with right nonce (1)", function(done) { - var transaction = new Transaction({ - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x02" - }) - - var secretKeyBuffer = Buffer.from(secretKeys[0].substr(2), 'hex') - transaction.sign(secretKeyBuffer) - - web3.eth.sendSignedTransaction(transaction.serialize(), function(err, result) { - done(err) - }) - }) - - it("should fail with bad nonce (skipped value)", function(done) { - let tempWeb3 = new Web3(Ganache.provider({ - blockTime: .5, // seconds - mnemonic: "candy maple cake sugar pudding cream honey rich smooth crumble sweet treat" - })); - - const accounts = [ // configured with mnemonic - '0x627306090abab3a6e1400e9345bc60c78a8bef57', - '0xf17f52151ebef6c7334fad080c5704d77216b732', - ]; - const secretKeys = [ // configured with mnemonic - '0xc87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3' - ]; - - let transaction = new Transaction({ - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x00" - }) - let transaction2 = new Transaction({ - "value": "0x10000000", - "gasLimit": "0x33450", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x02" // Skipped nonce 1 - }) - - let secretKeyBuffer = Buffer.from(secretKeys[0].substr(2), 'hex') - transaction.sign(secretKeyBuffer) - transaction2.sign(secretKeyBuffer) - - - tempWeb3.eth.sendSignedTransaction(transaction.serialize(), function(err, tx) { - if (err) return done(err); - // Ensure there's no receipt since the transaction hasn't yet been processed. - tempWeb3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - assert.equal(receipt, null, "No receipt since the transaction hasn't yet been processed."); - // Issue second transaction - tempWeb3.eth.sendSignedTransaction(transaction2.serialize(), function(err2, tx2) { - assert.notDeepEqual(err2, null, 'Incorrect nonce, tx should fail.'); - setTimeout(function() { - // Wait .75 seconds (1.5x the mining interval) then get the receipt. It should be processed. - tempWeb3.eth.getTransactionReceipt(tx, function(err3, receipt1) { - assert.notDeepEqual(receipt1, null, 'First tx should be processed'); - done() - }); - }, 750); - }); - }); - }); - }) - - - it("should respond with correct txn hash", function(done) { - var provider = web3.currentProvider; - var transaction = new Transaction({ - "value": "0x00", - "gasLimit": "0x5208", - "from": accounts[0], - "to": accounts[1], - "nonce": "0x03" - }) - - var secretKeyBuffer = Buffer.from(secretKeys[0].substr(2), 'hex') - transaction.sign(secretKeyBuffer) - - web3.eth.sendSignedTransaction(transaction.serialize(), function(err, result) { - assert.equal(result, to.hex(transaction.hash())) - done(err) - }) - }) - }) - - describe("contract scenario", function() { - - // These are expected to be run in order. - var initialTransaction; - var contractAddress; - var contractCreationBlockNumber; - - it("should add a contract to the network (eth_sendTransaction)", function(done) { - web3.eth.sendTransaction({ - from: accounts[0], - data: contract.binary, - gas: 3141592, - value: 1 - }, function(err, hash) { - if (err) return done(err); - - assert.deepEqual(hash.length, 66); - initialTransaction = hash - web3.eth.getTransactionReceipt(hash, function(err, receipt) { - if (err) return done(err); - contractCreationBlockNumber = receipt.blockNumber; // For defaultBlock test - assert(receipt) - done(); - }) - }); - }); - - it("should verify the transaction immediately (eth_getTransactionReceipt)", function(done) { - web3.eth.getTransactionReceipt(initialTransaction, function(err, receipt) { - if (err) return done(err); - - contractAddress = receipt.contractAddress; - - assert.notEqual(receipt, null, "Transaction receipt shouldn't be null"); - assert.notEqual(contractAddress, null, "Transaction did not create a contract"); - done(); - }); - }); - - it("should return null if asked for a receipt for a nonexistent transaction (eth_getTransactionReceipt)", function(done) { - web3.eth.getTransactionReceipt("0xdeadbeef", function(err, receipt) { - if (err) return done(err); - - assert.equal(receipt, null, "Transaction receipt should be null"); - done(); - }); - }); - - it("should verify the code at the address matches the runtimeBinary (eth_getCode)", function(done) { - web3.eth.getCode(contractAddress, function(err, result) { - if (err) return done(err); - assert.equal(result, contract.runtimeBinary); - done(); - }); - }); - - it("should have balance of 1 (eth_getBalance)", function(done) { - web3.eth.getBalance(contractAddress, function(err, result) { - if (err) return done(err); - assert.equal(result, 1); - done(); - }); - }); - - it("should be able to read data via a call (eth_call)", function(done) { - var call_data = contract.call_data; - call_data.to = contractAddress; - call_data.from = accounts[0]; - - var starting_block_number = null; - - // TODO: Removing this callback hell would be nice. - web3.eth.getBlockNumber(function(err, result) { - if (err) return done(err); - - starting_block_number = result; - - web3.eth.call(call_data, function(err, result) { - if (err) return done(err); - assert.equal(to.number(result), 5); - - web3.eth.getBlockNumber(function(err, result) { - if (err) return done(err); - - assert.equal(result, starting_block_number, "eth_call increased block count when it shouldn't have"); - done(); - }); - }); - }); - }); - - it("should get back a runtime error on a bad call (eth_call)", function(done) { - var call_data = _.cloneDeep(contract.call_data); - call_data.to = contractAddress; - call_data.from = accounts[0]; - - // TODO: Removing this callback hell would be nice. - web3.eth.estimateGas(call_data, function (err, result) { - if (err) return done(err); - // set a low gas limit to force a runtime error - call_data.gas = result - 1; - - web3.eth.call(call_data, function (err, result) { - // should have received an error - assert(err, "did not return runtime error"); - assert(/.*out of gas.*/.test(err.message), `Did not receive an 'out of gas' error. got '${err.message}' instead.`) - done(); - }); - }); - }); - - it("should be able to make a call from an address not in the accounts list (eth_call)", function(done) { - var from = "0x1234567890123456789012345678901234567890"; - - // Assert precondition: Ensure from address isn't in the accounts list. - accounts.forEach(function(account) { - assert.notEqual(from, account, "Test preconditions not met: from address must not be within the accounts list, please rerun"); - }); - - var call_data = contract.call_data; - call_data.to = contractAddress; - call_data.from = from; - - web3.eth.call(call_data, function(err, result) { - if (err) return done(err); - assert.equal(to.number(result), 5); - - done(); - }); - }); - - it("should be able to make a call when no address is listed (eth_call)", function(done) { - var call_data = contract.call_data; - call_data.to = contractAddress; - delete call_data.from; - - web3.eth.call(call_data, function(err, result) { - if (err) return done(err); - assert.equal(to.number(result), 5); - - done(); - }); - }); - - it("should represent the block number correctly in the Oracle contract (oracle.blockhash0)", function(done){ - var oracleSol = fs.readFileSync("./test/Oracle.sol", {encoding: "utf8"}); - var oracleOutput = solc.compile(oracleSol).contracts[":Oracle"] - web3.eth.personal.unlockAccount(accounts[0], "password", function(err, result) { - var contract = new web3.eth.Contract(JSON.parse(oracleOutput.interface)); - contract.deploy({ - data: oracleOutput.bytecode, - }).send({ - from: accounts[0], - gas: 3141592 - }).then(function(oracle) { - // TODO: ugly workaround - not sure why this is necessary. - if (!oracle._requestManager.provider) { - oracle._requestManager.setProvider(web3.eth._provider); - } - web3.eth.getBlock(0, true, function(err, block){ - if (err) return done(err) - oracle.methods.blockhash0().call(function(err, blockhash){ - if (err) return done(err) - assert.equal(blockhash, block.hash); - done() - }); - }); - }); - }); - }); - - it("should be able to estimate gas of a transaction (eth_estimateGas)", function(done){ - var tx_data = contract.transaction_data; - tx_data.to = contractAddress; - tx_data.from = accounts[0]; - - var starting_block_number = null; - - // TODO: Removing this callback hell would be nice. - web3.eth.getBlockNumber(function(err, result) { - if (err) return done(err); - - starting_block_number = result; - - web3.eth.estimateGas(tx_data, function(err, result) { - if (err) return done(err); - assert.equal(result, 27693); - - web3.eth.getBlockNumber(function(err, result) { - if (err) return done(err); - - assert.equal(result, starting_block_number, "eth_estimateGas increased block count when it shouldn't have"); - done(); - }); - }); - }); - }); - - it("should be able to estimate gas from an account not within the accounts list (eth_estimateGas)", function(done){ - var tx_data = contract.transaction_data; - tx_data.to = contractAddress; - tx_data.from = "0x1234567890123456789012345678901234567890";; - - var starting_block_number = null; - - web3.eth.estimateGas(tx_data, function(err, result) { - if (err) return done(err); - assert.equal(result, 27693); - done(); - }); - }); - - it("should be able to estimate gas when no account is listed (eth_estimateGas)", function(done){ - var tx_data = contract.transaction_data; - tx_data.to = contractAddress; - delete tx_data.from; - - var starting_block_number = null; - - web3.eth.estimateGas(tx_data, function(err, result) { - if (err) return done(err); - assert.equal(result, 27693); - done(); - }); - }); - - it("should be able to send a state changing transaction (eth_sendTransaction)", function(done) { - var tx_data = contract.transaction_data; - tx_data.to = contractAddress; - tx_data.from = accounts[0]; - - var call_data = contract.call_data; - call_data.from = accounts[0]; - call_data.to = contractAddress; - - web3.eth.sendTransaction(tx_data, function(err, tx) { - if (err) return done(err); - // Now double check the data was set properly. - // NOTE: Because ethereumjs-testrpc processes transactions immediately, - // we can do this. Calling the call immediately after the transaction would - // fail on a different Ethereum client. - - web3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - - assert.equal(receipt.logs.length, 1, "Receipt had wrong amount of logs"); - assert.equal(receipt.logs[0].blockHash, receipt.blockHash, "Logs blockhash doesn't match block blockhash"); - - //console.log(call_data); - web3.eth.call(call_data, function(err, result) { - if (err) return done(err); - - assert.equal(to.number(result), 25); - done(); - }); - }); - }); - }); - - // NB: relies on the previous test setting value to 25 and the contract deployment setting - // original value to 5. `contractCreationBlockNumber` is set in the first test of this - // describe block. - it("should read data via a call at a specified blockNumber (eth_call)", function(done){ - var startingBlockNumber = null; - var call_data = contract.call_data; - - web3.eth.getBlockNumber().then(function(result){ - - startingBlockNumber = result; - return web3.eth.call(call_data) - - }).then(function(result){ - - assert.equal(to.number(result), 25, "value retrieved from latest block should be 25"); - return web3.eth.call(call_data, contractCreationBlockNumber) - - }).then(function(result){ - - assert.equal(to.number(result), 5, "value retrieved from contract creation block should be 5"); - return web3.eth.getBlockNumber() - - }).then(function(result){ - - assert.equal(result, startingBlockNumber, "eth_call w/defaultBlock increased block count"); - return web3.eth.call(call_data); - - }).then(function(result){ - - assert.equal(to.number(result), 25, "stateTrie root was corrupted by defaultBlock call"); - done(); - }); - }); - - it('should read data via a call when specified blockNumber is "earliest" (eth_call)', function(done) { - var call_data = contract.call_data; - - web3.eth.call(call_data, "earliest").then(function(result){ - assert.equal(to.number(result), 0, "value retrieved from earliest block should be zero"); - done(); - }) - }); - - it('should read data via a call when specified blockNumber is "pending" (eth_call)', function(done){ - var call_data = contract.call_data; - - web3.eth.call(call_data, "pending").then(function(result){ - assert.equal(to.number(result), 25, "value retrieved from pending block should be 25"); - done(); - }); - }); - - it("should error when reading data via a call at a non-existent blockNumber (eth_call)", function(done){ - var nonExistentBlock; - var call_data = contract.call_data; - - web3.eth.getBlockNumber().then(function(result){ - - nonExistentBlock = result + 1; - return web3.eth.call(call_data, nonExistentBlock); - - }).then(function(result){ - assert.fail(); - - }).catch(function(error){ - - assert(error.message.includes('index out of range')); - assert(error.message.includes(nonExistentBlock)); - done(); - }); - }); - - it("should only be able to send an unsigned state changing transaction from an address within the accounts list (eth_sendTransaction)", function(done) { - var badAddress = "0x1234567890123456789012345678901234567890"; - - var tx_data = {}; - tx_data.to = "0x1111111111000000000011111111110000000000"; - tx_data.from = badAddress; - tx_data.value = "0x1"; - - web3.eth.sendTransaction(tx_data, function(err, result) { - if (err) { - assert(/sender account not recognized/.test(err.message), `Expected error message containing 'sender account not recognized', but got ${err.message}`) - done(); - } else { - assert.fail("Should have received an error") - } - }); - }); - - it("should get the data from storage (eth_getStorageAt) with padded hex", function(done) { - web3.eth.getStorageAt(contractAddress, contract.position_of_value, function(err, result) { - assert.equal(to.number(result), 25); - done(); - }); - }); - - it("should get the data from storage (eth_getStorageAt) with unpadded hex", function(done) { - web3.eth.getStorageAt(contractAddress, '0x0', function(err, result) { - assert.equal(to.number(result), 25); - done(); - }); - }); - - it("should get the data from storage (eth_getStorageAt) with number", function(done) { - web3.eth.getStorageAt(contractAddress, 0, function(err, result) { - assert.equal(to.number(result), 25); - done(); - }); - }); - - }); - - describe("contract scenario (raw tx)", function() { - - var tx = new Transaction({ - data: contract.binary, - gasLimit: to.hex(3141592) - }) - var privateKey = Buffer.from('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex') - var senderAddress = '0x'+utils.privateToAddress(privateKey).toString('hex') - tx.sign(privateKey) - var rawTx = '0x'+tx.serialize().toString('hex') - - // These are expected to be run in order. - var initialTransaction; - var blockHash; - var blockNumber; - var contractAddress; - - it("should first populate senders address", function(done) { - // populate senders balance - web3.eth.sendTransaction({ - from: accounts[0], - to: senderAddress, - value: '0x3141592', - gas: 3141592 - }, function(err, hash) { - if (err) return done(err); - web3.eth.getTransactionReceipt(hash, function(err, receipt) { - if (err) return done(err) - assert(receipt); - done(); - }) - }); - }); - - it("should add a contract to the network (eth_sendRawTransaction)", function(done) { - web3.eth.sendSignedTransaction(rawTx, function(err, result) { - if (err) return done(err); - initialTransaction = result; - done(); - }); - }); - - it("should verify the transaction immediately (eth_getTransactionReceipt)", function(done) { - web3.eth.getTransactionReceipt(initialTransaction, function(err, receipt) { - if (err) return done(err); - - contractAddress = receipt.contractAddress; - blockHash = receipt.blockHash; - blockNumber = receipt.blockNumber; - - assert.notEqual(receipt, null, "Transaction receipt shouldn't be null"); - assert.notEqual(contractAddress, null, "Transaction did not create a contract"); - assert.equal(receipt.hasOwnProperty('v'), true, "Transaction includes v signature parameter"); - assert.equal(receipt.hasOwnProperty('r'), true, "Transaction includes r signature parameter"); - assert.equal(receipt.hasOwnProperty('s'), true, "Transaction includes s signature parameter"); - done(); - }); - }); - - it("should verify the transaction immediately (eth_getTransactionByHash)", function(done) { - web3.eth.getTransaction(initialTransaction, function(err, result) { - if (err) return done(err); - - assert.notEqual(result, null, "Transaction result shouldn't be null"); - assert.equal(result.hash, initialTransaction, "Resultant hash isn't what we expected") - assert.equal(result.hasOwnProperty('v'), true, "Transaction includes v signature parameter"); - assert.equal(result.hasOwnProperty('r'), true, "Transaction includes r signature parameter"); - assert.equal(result.hasOwnProperty('s'), true, "Transaction includes s signature parameter"); - done(); - }); - }); - - it("should return null if transaction doesn't exist (eth_getTransactionByHash)", function(done) { - web3.eth.getTransaction("0x401b8ebb563ec9425b052aba8896cb74e07635563111b5a0663289d1baa8eb12", function(err, result) { - if (err) return done(err); - - assert.equal(result, null, "Receipt should be null"); - - done(); - }); - }); - - it("should verify there's code at the address (eth_getCode)", function(done) { - web3.eth.getCode(contractAddress, function(err, result) { - if (err) return done(err); - assert.notEqual(result, null); - assert.notEqual(result, "0x"); - - // NOTE: We can't test the code returned is correct because the results - // of getCode() are *supposed* to be different than the code that was - // added to the chain. - - done(); - }); - }); - - it("should be able to get the transaction from the block (eth_getTransactionByBlockHashAndIndex)", function(done) { - web3.eth.getTransactionFromBlock(blockHash, 0, function(err, result) { - if (err) return done(err); - - assert.equal(result.hash, initialTransaction); - assert.equal(result.blockNumber, blockNumber); - assert.equal(result.blockHash, blockHash); - done(); - }); - }); - - it("should return null if block doesn't exist (eth_getTransactionByBlockHashAndIndex)", function(done) { - var badBlockHash = "0xaaaaaaeb03ec5e3c000d150df2c9e7ffc31e728d12aaaedc5f6cccaca5aaaaaa"; - web3.eth.getTransactionFromBlock(badBlockHash, 0, function(err, result) { - if (err) return done(err); - - assert.equal(result, null); - - done(); - }); - }); - - it("should be able to get the transaction from the block (eth_getTransactionByBlockNumberAndIndex)", function(done) { - web3.eth.getTransactionFromBlock(blockNumber, 0, function(err, result) { - if (err) return done(err); - - assert.equal(result.hash, initialTransaction); - assert.equal(result.blockNumber, blockNumber); - assert.equal(result.blockHash, blockHash); - done(); - }); - }); - - it("should throw error for transactions that don't exist in block (eth_getTransactionByBlockNumberAndIndex)", function(done) { - web3.eth.getTransactionFromBlock(blockNumber, 3, function(err, result) { - // We want an error because there is no transaction with id 3. - if (err) return done(); - - done(new Error("We didn't receive an error like we expected")); - }); - }); - }); - - describe("eth_getTransactionCount", function() { - it("should return 0 for non-existent account", function(done) { - web3.eth.getTransactionCount("0x1234567890123456789012345678901234567890", function(err, result) { - if (err) return done(err); - - assert.equal(result, "0x0"); - done(); - }); - }); - }); - - describe("eth_getTransactionCount", function() { - it("should error for non-existent block", function(done) { - web3.eth.getTransactionCount("0x1234567890123456789012345678901234567890", 9999999, function(err, result) { - assert(err, "Error with message 'Unknown block number' expected, instead no error was returned"); - assert(err.message.indexOf("Unknown block number") > -1); - done(); - }); - }); - }); - - describe("eth_compileSolidity (not supported)", function() { - this.timeout(5000); - it("correctly compiles solidity code", function(done) { - web3.eth.compile.solidity(source, function(err, result) { - assert(err != null) - assert(err.message.indexOf("Method eth_compileSolidity not supported") >= 0); - done(); - }); - }); - }); - - describe("miner_stop", function(){ - it("should stop mining", function(done){ - web3.currentProvider.send({ - id: new Date().getTime(), - jsonrpc: "2.0", - method: "miner_stop", - }, function(err,result){ - var tx_data = {} - tx_data.to = accounts[1]; - tx_data.from = accounts[0]; - tx_data.value = '0x1'; - - // we don't use web3.eth.sendTransaction here because it gets huffy waiting for a receipt, - // then winds up w/ an unhandled rejection on server.close later on - web3._provider.send({ - id: new Date().getTime(), - jsonrpc: "2.0", - method: "eth_sendTransaction", - params: [tx_data] - }, function(err, result) { - if (err) return done(err); - let tx = result.result - - web3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - - assert.equal(receipt, null); - web3.currentProvider.send({ - id: new Date().getTime(), - jsonrpc: "2.0", - method: "miner_start", - params: [1] - }, function(err, result){ - if (err) return done(err); - done(); - }) - }); - }); - }) - }) - }); - - describe("miner_start", function(){ - it("should start mining", function(done){ - web3.currentProvider.send({ - id: new Date().getTime(), - jsonrpc: "2.0", - method: "miner_stop", - }, function(err,result){ - web3.currentProvider.send({ - id: new Date().getTime(), - jsonrpc: "2.0", - method: "miner_start", - params: [1] - }, function(err,result){ - var tx_data = {} - tx_data.to = accounts[1]; - tx_data.from = accounts[0]; - tx_data.value = 0x1; - - web3.eth.sendTransaction(tx_data, function(err, tx) { - if (err) return done(err); - //Check the receipt - web3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - assert.notEqual(receipt, null); //i.e. receipt exists, so transaction was mined - done(); - }); - }); - }) - }) - }) - - it("should treat the threads argument as optional", function(done){ - web3.currentProvider.send({ - id: new Date().getTime(), - jsonrpc: "2.0", - method: "miner_stop", - }, function(err,result){ - web3.currentProvider.send({ - id: new Date().getTime(), - jsonrpc: "2.0", - method: "miner_start", - params: [] - }, function(err,result){ - var tx_data = {} - tx_data.to = accounts[1]; - tx_data.from = accounts[0]; - tx_data.value = 0x1; - - web3.eth.sendTransaction(tx_data, function(err, tx) { - if (err) return done(err); - //Check the receipt - web3.eth.getTransactionReceipt(tx, function(err, receipt) { - if (err) return done(err); - assert.notEqual(receipt, null); //i.e. receipt exists, so transaction was mined - done(); - }); - }); - }) - }) - }) - }); - - describe("web3_sha3", function() { - it("should hash the given input", function(done) { - var input = "Tim is a swell guy."; - - // web3.sha3() doesn't actually call the function, so we need to call it ourselves. - web3.currentProvider.send({ - jsonrpc: "2.0", - method: "web3_sha3", - params: [input], - id: new Date().getTime() - }, function(err, result) { - if (err) return done(err); - if (result.error) return done(result.error); - - assert.equal(result.result, web3.utils.sha3(input)); - done(); - }) - }); - }); - - describe("net_version", function() { - it("should return a version very close to the current time", function(done) { - web3.eth.net.getId(function(err, result) { - if (err) return done(err); - - var dateAsInt = new Date().getTime() + ""; - var strResult = to.number(result) + ""; - assert.equal(strResult.length, dateAsInt.length, `net_version result, ${result}, doesn't appear to be similar in length the current time as an integer, ${dateAsInt}`) - done(); - }); - }); - }); - - describe("personal_newAccount", function() { - it("should return the new address", function(done) { - web3.eth.personal.newAccount("password", function(err, result) { - if (err) return done(err); - assert.notEqual(result.toLowerCase().match("0x[0-9a-f]{39}"), null, "Invalid address received"); - done(); - }); - }); - }); - - describe("personal_importRawKey", function() { - it("should return the known account address", function(done) { - web3._provider.send({ - jsonrpc: "2.0", - id: 1234, - method: 'personal_importRawKey', - params: ["0x0123456789012345678901234567890123456789012345678901234567890123", "password"] - }, function(err, result) { - if (err) return done(err); - assert.equal(result.result, '0x14791697260e4c9a71f18484c9f997b308e59325', "Raw account not imported correctly"); - done(); - }); - }); - }); - - describe("personal_listAccounts", function() { - it("should return more than 0 accounts", function(done) { - web3.eth.personal.getAccounts(function(err, result) { - if (err) return done(err); - assert.equal(result.length, 13); - done(); - }); - }); - }); - - describe("personal_unlockAccount", function() { - it("should unlock account", function(done) { - web3.eth.personal.unlockAccount(personalAccount, "password", function(err, result) { - if (err) return done(err); - assert.equal(result, true); - done(); - }); - }); - }); - - describe("personal_lockAccount", function() { - it("should lock account", function(done) { - web3.eth.personal.lockAccount(personalAccount, function(err, result) { - if (err) return done(err) - assert.equal(result, true); - done() - }); - }); - }); - - /*describe("personal_sendTransaction", function() { - it("should send transaction", function(done) { - web3.eth.sendTransaction({value: web3.utils.toWei('5', 'ether'), from: accounts[0], to: personalAccount }, function(err, result){ - if (err) return done(err) - - web3.eth.personal.sendTransaction({ - from: personalAccount, - to: accounts[0], - value: 1 - }, "password", function(err, receipt) { - if (err) return done(err); - assert(receipt); - setTimeout(done, 500); - }); - }); - }); - })*/ -} - -var logger = { - log: function(message) { - //console.log(message); - } -}; - -describe("Provider:", function() { - var Web3 = require('web3'); - var web3 = new Web3(); - web3.setProvider(Ganache.provider({ - logger: logger, - seed: "1337", - // so that the runtime errors on call test passes - })); - tests(web3); - - after("shutdown provider", function(done) { - let provider = web3._provider; - web3.setProvider(); - provider.close(done); - }); -}); - -describe("HTTP Server:", function(done) { - var Web3 = require('web3'); - var web3 = new Web3(); - var port = 12345; - var server; - - before("Initialize Ganache server", function(done) { - server = Ganache.server({ - logger: logger, - seed: "1337", - // so that the runtime errors on call test passes - }); - - server.listen(port, function(err) { - web3.setProvider(new Web3.providers.HttpProvider("http://localhost:" + port)); - done(); - }); - }); - - after("Shutdown server", function(done) { - server.close(done); - }); - - tests(web3); -}); - -describe("WebSockets Server:", function(done) { - var Web3 = require('web3'); - var web3 = new Web3(); - var port = 12345; - var server; - - before("Initialize Ganache server", function(done) { - server = Ganache.server({ - logger: logger, - seed: "1337", - // so that the runtime errors on call test passes - }); - server.listen(port, function(err) { - var provider = new Web3WsProvider("ws://localhost:" + port); - var Web3 = require('web3'); - web3.setProvider(provider); - done(); - }); - }); - - tests(web3); - - after("Shutdown server", function(done) { - let provider = web3._provider - web3.setProvider() - provider.connection.close() - server.close(done); - }); - -}); diff --git a/test/runtime_errors.js b/test/runtime_errors.js deleted file mode 100644 index 6834edc079..0000000000 --- a/test/runtime_errors.js +++ /dev/null @@ -1,234 +0,0 @@ -var Web3 = require('web3'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var fs = require("fs"); -var path = require("path"); -var solc = require("solc"); -var to = require("../lib/utils/to"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - - -function runTests(web3, provider, extraTests) { - var testState = { - accounts: null, - ErrorContract: null, - errorInstance: null, - code: null - } - - before("get accounts", function() { - return web3.eth.getAccounts().then(function(accs) { - testState.accounts = accs; - }); - }); - - before("compile source", function(done) { - this.timeout(10000); - - var source = fs.readFileSync(path.join(__dirname, "RuntimeError.sol"), "utf8"); - var result = solc.compile({sources: {"RuntimeError.sol": source}}, 1); - - testState.code = "0x" + result.contracts["RuntimeError.sol:RuntimeError"].bytecode; - var abi = JSON.parse(result.contracts["RuntimeError.sol:RuntimeError"].interface); - - testState.ErrorContract = new web3.eth.Contract(abi); - testState.ErrorContract._code = testState.code; - testState.ErrorContract.deploy({data: testState.code}) - .send({from: testState.accounts[0], gas: 3141592}) - .then(function(instance) { - // TODO: ugly workaround - not sure why this is necessary. - if (!instance._requestManager.provider) { - instance._requestManager.setProvider(web3.eth._provider); - } - testState.errorInstance = instance; - done(); - }); - }); - - it("should output the transaction hash even if an runtime error occurs (out of gas)", function(done) { - // we can't use `web3.eth.sendTransaction` because it will obfuscate the result - web3.currentProvider.send({ - jsonrpc: "2.0", - method: "eth_sendTransaction", - params: [{ - from: testState.accounts[0], - data: testState.code - }], - id: 1 - }, function(err, result) { - if (provider.options.vmErrorsOnRPCResponse) { - // null & undefined are equivalent for equality tests, but I'm being - // pedantic here for readability's sake - assert(result.error !== null) - assert(result.error !== undefined) - } else { - assert(result.error === undefined) - } - - // null & undefined are equivalent for equality tests, but I'm being - // pedantic here for readability's sake - assert(result.result !== null); - assert(result.result !== undefined); - - assert.equal(result.result.length, 66); // transaction hash - done(); - }); - }); - - it("should output the transaction hash even if a runtime error occurs (revert)", function(done) { - // we can't use `web3.eth.sendTransaction` because it will obfuscate the result - provider.send({ - jsonrpc: '2.0', - id: new Date().getTime(), - method: 'eth_sendTransaction', - params: [{ - from: testState.accounts[0], - to: testState.errorInstance.options.address, - // calls error() - data: '0xc79f8b62', - gas: to.hex(3141592) - }] - }, function(err, response) { - if (provider.options.vmErrorsOnRPCResponse) { - // null & undefined are equivalent for equality tests, but I'm being - // pedantic here for readability's sake - assert(response.error !== null) - assert(response.error !== undefined) - - assert(/revert/.test(response.error.message), `Expected error message (${response.error.message}) to contain 'revert'`); - - } else { - assert(response.error === undefined) - } - - // null & undefined are equivalent for equality tests, but I'm being - // pedantic here for readability's sake - assert(response.result !== null); - assert(response.result !== undefined); - - assert.equal(response.result.length, 66); // transaction hash - - done(); - }); - }); - - it("should have correct return value when calling a method that reverts without message", function(done) { - provider.send({ - jsonrpc: '2.0', - id: new Date().getTime(), - method: 'eth_call', - params: [{ - from: testState.accounts[0], - to: testState.errorInstance.options.address, - // calls error() - data: '0xc79f8b62', - gas: to.hex(3141592) - }] - }, function(err, response) { - if (provider.options.vmErrorsOnRPCResponse) { - // null & undefined are equivalent for equality tests, but I'm being - // pedantic here for readability's sake - assert(response.error !== null) - assert(response.error !== undefined) - assert(response.result === undefined || response.result === null) - - assert(/revert/.test(response.error.message), `Expected error message (${response.error.message}) to contain 'revert'`); - - } else { - assert(response.error === undefined) - assert(response.result === "0x") - } - - done(); - }); - }); - - it("should have correct return value when calling a method that reverts with message", function(done) { - provider.send({ - jsonrpc: '2.0', - id: new Date().getTime(), - method: 'eth_call', - params: [{ - from: testState.accounts[0], - to: testState.errorInstance.options.address, - // calls error() - data: '0xcd4aed30', - gas: to.hex(3141592) - }] - }, function(err, response) { - if (provider.options.vmErrorsOnRPCResponse) { - // null & undefined are equivalent for equality tests, but I'm being - // pedantic here for readability's sake - assert(response.error !== null) - assert(response.error !== undefined) - assert(response.result === undefined || response.result === null) - - // RuntimeError.sol reverts with revert("Message") - assert(/Message/.test(response.error.message), `Expected error message (${response.error.message}) to contain revert reason "Message"`); - assert(/revert/.test(response.error.message), `Expected error message (${response.error.message}) to contain 'revert'`); - - } else { - assert(response.error === undefined) - assert(response.result === "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000074d65737361676500000000000000000000000000000000000000000000000000") - } - - done(); - }); - }); - - if (extraTests) { - extraTests(testState) - } - - after('shutdown', function(done) { - let provider = web3._provider; - web3.setProvider(); - provider.close(done); - }); -} - -describe("Runtime Errors with vmErrorsOnRPCResponse = true:", function() { - var provider = Ganache.provider({ - vmErrorsOnRPCResponse: true - }); - - var web3 = new Web3(provider); - - runTests(web3, provider, function(testState) { - it("should output instruction index on runtime errors", function(done) { - provider.send({ - jsonrpc: '2.0', - id: new Date().getTime(), - method: 'eth_sendTransaction', - params: [{ - from: testState.accounts[0], - to: testState.errorInstance.options.address, - // calls error() - data: '0xc79f8b62', - gas: to.hex(3141592) - }] - }, function(err, response) { - - let txHash = response.result - - assert(response.error); - assert(response.error.data[txHash]); - assert.equal(response.error.data[txHash].program_counter, 91); // magic number, will change if compiler changes. - done(); - }); - }); - }); - -}) - -describe("Runtime Errors with vmErrorsOnRPCResponse = false:", function() { - var provider = Ganache.provider({ - vmErrorsOnRPCResponse: false - }); - - var web3 = new Web3(provider); - runTests(web3, provider) -}) diff --git a/test/server.js b/test/server.js deleted file mode 100644 index 64355ed2bd..0000000000 --- a/test/server.js +++ /dev/null @@ -1,17 +0,0 @@ -const assert = require("assert"); -const pify = require("pify"); - -const Ganache = require("../index.js"); -const StateManager = require("../lib/statemanager.js"); - -describe('server', () => { - it ('should return instance of StateManager on start', async () => { - const server = Ganache.server(); - try { - const stateManager = await pify(server.listen)(8945); - assert(stateManager instanceof StateManager, 'server.listen must return instance of StateManager'); - } finally { - await pify(server.close)(); - } - }); -}); diff --git a/test/snapshotting.js b/test/snapshotting.js deleted file mode 100644 index 035a2e2f80..0000000000 --- a/test/snapshotting.js +++ /dev/null @@ -1,110 +0,0 @@ -var BN = require("bn.js"); -var Ganache = require("../"); -var async = require("async"); -var Web3 = require("web3"); -var assert = require("assert"); - -describe("Checkpointing / Reverting", function() { - var provider; - var accounts; - var web3 = new Web3(); - var startingBalance; - var snapshotId; - - before("create provider", function() { - provider = Ganache.provider(); - web3.setProvider(provider); - }); - - before("get accounts", function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs; - done(); - }); - }); - - before("send a transaction then make a checkpoint", function(done) { - web3.eth.sendTransaction({ - from: accounts[0], - to: accounts[1], - value: web3.utils.toWei(new BN(1), "ether"), - gas: 90000 - }, function() { - // Since transactions happen immediately, we can assert the balance. - web3.eth.getBalance(accounts[0], function(err, balance) { - if (err) return done(err); - - balance = parseFloat(web3.utils.fromWei(balance, "ether")) - - // Assert the starting balance is where we think it is, including tx costs. - assert(balance > 98.9 && balance < 99); - - startingBalance = balance; - - // Now checkpoint. - provider.send({ - jsonrpc: "2.0", - method: "evm_snapshot", - params: [], - id: new Date().getTime() - }, function(err, result) { - if (err) return done(err); - snapshotId = result.result; - done(); - }); - }) - }); - }); - - it("rolls back successfully", function(done) { - // Send another transaction, check the balance, then roll it back to the old one and check the balance again. - web3.eth.sendTransaction({ - from: accounts[0], - to: accounts[1], - value: web3.utils.toWei(new BN(1), "ether"), - gas: 90000 - }, function(err, tx_hash) { - if (err) return done(err); - - // Since transactions happen immediately, we can assert the balance. - web3.eth.getBalance(accounts[0], function(err, balance) { - if (err) return done(err); - - balance = parseFloat(web3.utils.fromWei(balance, "ether")) - - // Assert the starting balance is where we think it is, including tx costs. - assert(balance > 97.9 && balance < 98); - - // Now revert. - provider.send({ - jsonrpc: "2.0", - method: "evm_revert", - params: [snapshotId], - id: new Date().getTime() - }, function(err, result) { - if (err) return done(err); - assert(result, "Snapshot should have returned true"); - - // Now check the balance one more time. - web3.eth.getBalance(accounts[0], function(err, balance) { - if (err) return done(err); - - balance = parseFloat(web3.utils.fromWei(balance, "ether")) - - assert(balance == startingBalance, "Should have reverted back to the starting balance"); - - // Now check that the receipt is gone. - web3.eth.getTransactionReceipt(tx_hash, function(err, receipt) { - if (err) return done(err); - - assert.equal(receipt, null, "Receipt should be null as it should have been removed"); - - done(); - }); - }); - }); - }) - }); - }) -}); diff --git a/test/stability.js b/test/stability.js deleted file mode 100644 index b9cafc3be8..0000000000 --- a/test/stability.js +++ /dev/null @@ -1,189 +0,0 @@ -var BN = require('bn.js'); -var Web3 = require('web3'); -var assert = require('assert-match'); -var matchers = require('assert-match/matchers'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var utils = require('ethereumjs-util'); -var pify = require('pify'); - -var regex = matchers.regex - -var logger = { - log: function(message) { - //console.log(message); - } -}; - -describe("stability", function(done) { - var web3 = new Web3(); - var provider; - var port = 12345; - var server; - var accounts; - - before("Initialize the provider", function() { - provider = Ganache.provider({ - }); - web3.setProvider(provider); - }); - - before(function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - - accounts = accs; - done(); - }); - }); - - it("should be able to handle multiple transactions at once and manage nonces accordingly", function(done) { - var expected = 5; - var received = 0; - - var txHandler = function(err, result) { - received += 1; - - if (received > expected) { - throw new Error('Callback called too many times'); - } - - if (err || received == expected) { - return done(err); - } - }; - - // Fire off transaction at once - for (var i = 0; i < expected; i++) { - web3.eth.sendTransaction({ - from: accounts[0], - to: accounts[1], - value: web3.utils.toWei(new BN(1), "ether") - }, txHandler); - } - }); - - it("should be able to handle batch transactions", function(done) { - var expected = 5; - var received = 0; - - var request = [] - - for (var i = 0; i < expected; i++) { - let req = web3.eth.sendTransaction.request({ - from: accounts[0], - to: accounts[1], - value: web3.utils.toWei(new BN(1), "ether") - }) - - req.jsonrpc = '2.0' - req.id = 100 + i - - request.push(req) - } - - provider.sendAsync(request, function(err, result) { - assert.deepEqual(err, undefined) - assert(Array.isArray(result)) - assert.deepEqual(result.length, expected) - done(); - }) - - }); - - it("should not crash when receiving transactions which don't pass FakeTransaction validation", function(done) { - provider.send({ - jsonrpc: 2.0, - id: 123, - method: 'eth_sendTransaction', - params:[{ - from: accounts[0], - to: '0x123', //bad address - value: '1000000000000000000' // 1 ETH - }] - }, function(err, result) { - assert.notEqual(err, undefined) - assert.notEqual(result.error, undefined) - done() - }) - }) - - it('should not crash when receiving a request with too many arguments', function() { - // At time of writing, `evm_mine` takes 0 arguments - return pify(provider.send)({ - jsonrpc: 2.0, - id: 123, - method: 'evm_mine', - params:[ - '0x1', - '0x2', - '0x3', - '0x4', - '0x5', - '0x6', - '0x7', - '0x8', - '0x9', - '0xA' - // 10 oughtta do it! - ] - }).catch(err => { - assert.deepEqual(err.message, regex(/Incorrect number of arguments\. Method \'evm_mine\' requires between \d+ and \d+ arguments\. Request specified \d+ arguments: \[[^\]]*\]\./)); - });// nothing to check from here, if the promise rejects, test fails - }) - - //TODO: remove `.skip` when working on and/or submitting fix for issue #453 - describe.skip("race conditions", function(done) { - var web3 = new Web3(); - var provider; - var accounts; - - before("initialize the provider", function() { - provider = Ganache.provider({ - }); - web3.setProvider(provider); - }); - - before("get accounts", function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - - accounts = accs; - done(); - }); - }); - - it("should not cause 'get' of undefined", function(done) { - process.prependOnceListener('uncaughtException', function(err) { - done(err); - }); - - var blockchain = provider.manager.state.blockchain; - blockchain.vm.stateManager.checkpoint(); // processCall or processBlock - blockchain.stateTrie.get(utils.toBuffer(accounts[0]), function() {}); // getCode (or any function that calls trie.get) - blockchain.vm.stateManager.revert(function() { - done(); - }); // processCall or processBlock - }); - - it("should not cause 'pop' of undefined", function(done) { - process.prependOnceListener('uncaughtException', function(err) { - done(err); - }); - - var blockchain = provider.manager.state.blockchain; - blockchain.vm.stateManager.checkpoint(); // processCall #1 - // processNextBlock triggered by interval mining which at some point calls vm.stateManager.commit() and blockchain.putBlock() - blockchain.processNextBlock(function(err, tx, results) { - blockchain.vm.stateManager.revert(function() { // processCall #1 finishes - blockchain.latestBlock(function (err, latestBlock) { - blockchain.stateTrie.root = latestBlock.header.stateRoot; // getCode #1 (or any function with this logic) - web3.eth.call({}, function() { - done(); - }); // processCall #2 - }); - }); - }); - }); - }); -}); - diff --git a/test/swarm.js b/test/swarm.js deleted file mode 100644 index e6e34120ed..0000000000 --- a/test/swarm.js +++ /dev/null @@ -1,27 +0,0 @@ -var Web3 = require('web3'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); - -describe("Swarm", function(done) { - var web3 = new Web3(); - var provider; - - before("Initialize the provider", function() { - provider = Ganache.provider(); - web3.setProvider(provider); - }); - - it.skip("should get swarm info (bzz_info)", function(done) { - web3.bzz.getInfo(function(err, result){ - assert.isArray(result, "Stub returns empty array") - done(); - }) - }); - - it.skip("should get swarm hive (bzz_hive)", function(done) { - web3.bzz.getHive(function(err, result){ - assert.isArray(result, "Stub returns empty array") - done(); - }) - }); -}); diff --git a/test/time_adjust.js b/test/time_adjust.js deleted file mode 100644 index ad633235bf..0000000000 --- a/test/time_adjust.js +++ /dev/null @@ -1,142 +0,0 @@ -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var assert = require('assert-match'); -var matchers = require('assert-match/matchers'); -var gte = matchers.gte -var lte = matchers.lte -var Web3 = require("web3"); - -describe('Time adjustment', function() { - var startTime = new Date("Wed Aug 24 2016 00:00:00 GMT-0700 (PDT)"); - var provider = Ganache.provider({ - time: startTime - }); - var web3 = new Web3(provider); - var secondsToJump = 5 * 60 * 60; - - var timestampBeforeJump; - - function send(method, params, callback) { - if (typeof params == "function") { - callback = params; - params = []; - } - - provider.send({ - jsonrpc: "2.0", - method: method, - params: params || [], - id: new Date().getTime() - }, callback); - }; - - before('get current time', function(done) { - web3.eth.getBlock('latest', function(err, block){ - if(err) return done(err) - timestampBeforeJump = block.timestamp - done() - }) - }) - - it('should mine the first block at the time provided', function(done) { - web3.eth.getBlock(0, function(err, result) { - // give ourselves a 25ms window for this to succeed - let acceptableStartTime = startTime / 1000 | 0; - let acceptableEndTime = acceptableStartTime + 25; - assert.deepEqual(result.timestamp, gte(acceptableStartTime)); - assert.deepEqual(result.timestamp, lte(acceptableEndTime)); - done(); - }); - }); - - it('should jump 5 hours', function(done) { - this.timeout(5000) // this is timing out on travis for some reason :-( - // Adjust time - send("evm_increaseTime", [secondsToJump], function(err, result) { - if (err) return done(err); - - // Mine a block so new time is recorded. - send("evm_mine", function(err, result) { - if (err) return done(err); - - web3.eth.getBlock('latest', function(err, block){ - if(err) return done(err) - var secondsJumped = block.timestamp - timestampBeforeJump - - // Somehow it jumps an extra 18 seconds, ish, when run inside the whole - // test suite. It might have something to do with when the before block - // runs and when the test runs. Likely the last block didn't occur for - // awhile. - assert(secondsJumped >= secondsToJump) - done() - }) - }) - }) - }) - - it('should mine a block at the given timestamp', function(done) { - // Adjust time - var expectedMinedTimestamp = 1000000; - send("evm_mine", [expectedMinedTimestamp], function(err, result) { - if (err) return done(err); - - web3.eth.getBlock('latest', function(err, block) { - if(err) return done(err); - assert(block.timestamp == expectedMinedTimestamp); - done(); - }); - }); - }); - - it('should revert time adjustments when snapshot is reverted', function(done) { - // Adjust time - web3.eth.getBlock('latest', function(err, block) { - if(err) return done(err); - var previousBlockTime = block.timestamp; - var originalTimeAdjustment = provider.manager.state.blockchain.timeAdjustment; - - send("evm_snapshot", function(err, result) { - // jump forward another 5 hours - send("evm_increaseTime", [secondsToJump], function(err, result) { - if (err) return done(err); - - var currentTimeAdjustment = provider.manager.state.blockchain.timeAdjustment; - assert.equal(currentTimeAdjustment, originalTimeAdjustment + secondsToJump); - - // Mine a block so new time is recorded. - send("evm_mine", function(err, result) { - if (err) return done(err); - - send("evm_revert", [1], function(err, result) { - var revertedTimeAdjustment = provider.manager.state.blockchain.timeAdjustment; - assert.equal(revertedTimeAdjustment, originalTimeAdjustment); - done() - }) - }) - }) - }) - }) - }) - - it('should allow setting of time', function(done) { - web3.eth.getBlock('latest', function(err, block) { - if (err) return done(err) - - var previousTime = block.timestamp - - send("evm_setTime", [new Date(previousTime - secondsToJump)], function(err, result) { - if (err) return done(err); - - // Mine a block so new time is recorded. - send("evm_mine", function(err, result) { - if (err) return done(err); - - web3.eth.getBlock('latest', function(err, block){ - if(err) return done(err) - assert(previousTime > block.timestamp); - done() - }) - }) - }) - }) - }); -}) diff --git a/test/transaction_ordering.js b/test/transaction_ordering.js deleted file mode 100644 index 4d6ab76187..0000000000 --- a/test/transaction_ordering.js +++ /dev/null @@ -1,90 +0,0 @@ -var Web3 = require('web3'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var assert = require('assert'); -var to = require('../lib/utils/to.js'); - -describe("Transaction Ordering", function() { - var accounts; - var web3 = new Web3(Ganache.provider()); - - before(function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - - accounts = accs; - done(); - }); - }); - - beforeEach(function(done){ - web3.currentProvider.send({ - jsonrpc: "2.0", - method: "miner_stop", - }, done) - }); - - afterEach(function(done){ - web3.currentProvider.send({ - jsonrpc: "2.0", - method: "miner_start", - params: [1] - }, done) - }); - - it("should order queued transactions correctly by nonce before adding to the block", function(done) { - var tx_data = {} - tx_data.to = accounts[1]; - tx_data.from = accounts[0]; - tx_data.value = 0x1; - tx_data.nonce = 0; - tx_data.gas = 21000; - web3.eth.sendTransaction(tx_data, function(err, tx) { - if (err){return done(err)} - tx_data.nonce=1; - web3.eth.sendTransaction(tx_data, function(err, tx){ - if (err){return done(err)} - web3.currentProvider.send({ - jsonrpc: "2.0", - method: "miner_start", - params: [1] - }, function(err,tx){ - web3.eth.getBlock("latest", function(err, block) { - if (err) return done(err); - assert.equal(block.transactions.length, 2, "Latest block should have two transactions"); - done(); - }); - }) - }) - }) - }); - - it("should order queued transactions correctly by price before adding to the block", function(done) { - var tx_data = {} - tx_data.to = accounts[1]; - tx_data.from = accounts[0]; - tx_data.value = 0x1; - tx_data.gas = 21000; - tx_data.gasPrice = 0x1 - web3.eth.sendTransaction(tx_data, function(err, tx) { - if (err){return done(err)} - tx_data.gasPrice=2; - tx_data.from = accounts[1]; - web3.eth.sendTransaction(tx_data, function(err, tx){ - if (err){return done(err)} - web3.currentProvider.send({ - jsonrpc: "2.0", - method: "miner_start", - params: [1] - }, function(err,tx){ - web3.eth.getBlock("latest", true, function(err, block) { - if (err) return done(err); - assert.equal(block.transactions.length, 2, "Latest block should have two transactions"); - assert.equal(to.number(block.transactions[0].gasPrice), 2) - assert.equal(to.number(block.transactions[1].gasPrice), 1) - done(); - }); - }) - }) - }) - }); -}); diff --git a/test/transaction_rejection.js b/test/transaction_rejection.js deleted file mode 100644 index fa92cda208..0000000000 --- a/test/transaction_rejection.js +++ /dev/null @@ -1,149 +0,0 @@ -var Web3 = require('web3'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var fs = require("fs"); -var path = require("path"); -var solc = require("solc"); -var to = require("../lib/utils/to") - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -describe("Transaction rejection", function() { - var provider = Ganache.provider({ - // important: we want to make sure we get tx rejections as rpc errors even - // if we don't want runtime errors as RPC erros - vmErrorsOnRPCResponse: false - }) - - var web3 = new Web3(provider); - - var accounts; - var estimateGasContractData; - var estimateGasContractAbi; - var EstimateGasContract; - var EstimateGasContractAddress; - var estimateGasInstance; - var deploymentReceipt; - var estimateGasContractAddress; - var source = fs.readFileSync(path.join(__dirname, "EstimateGas.sol"), "utf8"); - - before("get accounts", function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs; - done(); - }); - }); - - before("lock account 1", function() { - return web3.eth.personal.lockAccount(accounts[1]) - }) - - before("compile source", function() { - this.timeout(10000); - var result = solc.compile({sources: {"EstimateGas.sol": source}}, 1); - - estimateGasContractData = "0x" + result.contracts["EstimateGas.sol:EstimateGas"].bytecode; - estimateGasContractAbi = JSON.parse(result.contracts["EstimateGas.sol:EstimateGas"].interface); - - EstimateGasContract = new web3.eth.Contract(estimateGasContractAbi); - return EstimateGasContract.deploy({data: estimateGasContractData}) - .send({from: accounts[0], gas: 3141592}) - .on('receipt', function (receipt) { - deploymentReceipt = receipt; - }) - .then(function(instance) { - // TODO: ugly workaround - not sure why this is necessary. - if (!instance._requestManager.provider) { - instance._requestManager.setProvider(web3.eth._provider); - } - estimateGasInstance = instance; - estimateGasContractAddress = to.hex(instance.options.address); - }); - }); - - it("should reject transaction if nonce is incorrect", function(done) { - testTransactionForRejection({ - nonce: 0xffff - }, /the tx doesn't have the correct nonce/, done) - }); - - it("should reject transaction if from account is missing", function(done) { - testTransactionForRejection({ - from: undefined - }, /from not found; is required/, done) - }); - - it("should reject transaction if from account is invalid/unknown", function(done) { - testTransactionForRejection({ - from: '0x0000000000000000000000000000000000000001' - }, /sender account not recognized/, done) - }); - - it("should reject transaction if from known account which is locked", function(done) { - testTransactionForRejection({ - from: accounts[1], - }, /signer account is locked/, done) - }); - - it("should reject transaction if gas limit exceeds block gas limit", function(done) { - testTransactionForRejection({ - gas: 0xFFFFFFFF, - }, /Exceeds block gas limit/, done) - }); - - it("should reject transaction if insufficient funds", function(done) { - testTransactionForRejection({ - value: web3.utils.toWei('100000', 'ether') - }, /sender doesn't have enough funds to send tx/, done) - }); - - function testTransactionForRejection(paramsOverride, messageRegex, done) { - let params = Object.assign({ - from: accounts[0], - to: estimateGasContractAddress, - gas: to.hex(3141592), - data: '0x91ea8a0554696d000000000000000000000000000000000000000000000000000000000041206772656174206775790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005' - }, paramsOverride) - - let request = { - jsonrpc: 2.0, - id: new Date().getTime(), - method: 'eth_sendTransaction', - params: [ params ] - } - - // don't send with web3 because it'll inject its own checks - provider.send(request, (err, response) => { - // cyclomatic complexity? what's that? :-( - if (response.error) { - if (response.error.message) { - if (messageRegex.test(response.error.message)) { - // success! - return done() - } else { - // wrong error message - return done(new Error(`Expected error message matching ${messageRegex}, got ${response.error.message}`)) - } - } else { - return done(new Error(`Error was returned which had no message`)) - } - } else if (response.result) { - web3.eth.getTransactionReceipt(response.result) - .then((result) => { - if (to.number(result.status) == 0) { - return done(new Error('TX rejections should return error, but returned receipt with zero status instead')) - } else { - return done(new Error(`TX should have rejected prior to running. Instead transaction ran successfully (receipt.status == ${to.number(result.status)})`)) - } - }).catch(error => { - return done(error) - }) - } else { - return done(new Error('eth_sendTransaction responded with empty RPC response')) - } - }) - } -}) diff --git a/test/unlimited_contract_size.js b/test/unlimited_contract_size.js deleted file mode 100644 index c5e870dc42..0000000000 --- a/test/unlimited_contract_size.js +++ /dev/null @@ -1,88 +0,0 @@ -var Web3 = require('web3'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var fs = require("fs"); -var path = require("path"); -var solc = require("solc"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -let mnemonic = 'candy maple cake sugar pudding cream honey rich smooth crumble sweet treat' - -describe("Unlimited Contract Size", function() { - let contract; - - before("compile contract", function() { - var result = solc.compile({sources: {"LargeContract.sol": fs.readFileSync(path.join(__dirname, "LargeContract.sol"), "utf8")}}, 1); - contract = { - bytecode: "0x" + result.contracts["LargeContract.sol:LargeContract"].bytecode, - abi: JSON.parse(result.contracts["LargeContract.sol:LargeContract"].interface) - } - }); - - describe("Disallow Unlimited Contract Size", function() { - var provider = new Ganache.provider({ - mnemonic, - allowUnlimitedContractSize: false, - gasLimit: 20000000 - }); - var web3 = new Web3(provider); - var accounts; - - before("get accounts", function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs; - done(); - }); - }); - - it("should fail deployment", function(done) { - let DummyContract = new web3.eth.Contract(contract.abi); - DummyContract.deploy({ - data: contract.bytecode - }) - .send({from: accounts[0], gas: 20000000}) - .then(function(instance) { - done(new Error("succeeded deployment when it should have failed")); - }) - .catch(function(error) { - done(); - }); - }); - }); - - describe("Allow Unlimited Contract Size", function() { - var provider = new Ganache.provider({ - mnemonic, - allowUnlimitedContractSize: true, - gasLimit: 20000000 - }); - var web3 = new Web3(provider); - var accounts; - - before("get accounts", function(done) { - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - accounts = accs; - done(); - }); - }); - - it("should succeed deployment", function(done) { - let DummyContract = new web3.eth.Contract(contract.abi); - DummyContract.deploy({ - data: contract.bytecode - }) - .send({from: accounts[0], gas: 20000000}) - .then(function(instance) { - done() - }) - .catch(function(error) { - console.log(error); - done(new Error("failed deployment when it should have succeeded")); - }); - }); - }); -}); \ No newline at end of file diff --git a/test/vm.js b/test/vm.js deleted file mode 100644 index 6a5c55d5cd..0000000000 --- a/test/vm.js +++ /dev/null @@ -1,75 +0,0 @@ -var Web3 = require('web3'); -var Transaction = require('ethereumjs-tx'); -var utils = require('ethereumjs-util'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); -var solc = require("solc"); -var fs = require("fs"); -var to = require("../lib/utils/to"); - -// Thanks solc. At least this works! -// This removes solc's overzealous uncaughtException event handler. -process.removeAllListeners("uncaughtException"); - -var logger = { - log: function(message) { - //console.log(message); - } -}; - -var web3 = new Web3(); -web3.setProvider(Ganache.provider({ - /*blockTime: 100,*/ - logger: logger, - seed: "1337" -})); - -describe("revert opcode", function() { - var testContext = {}; - - before(function (done) { - this.timeout(10000); - testContext.source = fs.readFileSync("./test/Revert.sol", {encoding: "utf8"}); - testContext.solcResult = solc.compile(testContext.source, false); - - testContext.revertContract = { - solidity: testContext.source, - abi: testContext.solcResult.contracts[":Revert"].interface, - binary: "0x" + testContext.solcResult.contracts[":Revert"].bytecode, - runtimeBinary: '0x' + testContext.solcResult.contracts[":Revert"].runtimeBytecode - }; - - web3.eth.getAccounts(function(err, accs) { - if (err) return done(err); - - testContext.accounts = accs; - - return done(); - }); - }); - - it("should return a transaction receipt with status 0 on REVERT", function() { - var revertCode = testContext.revertContract.binary; - var revertAbi = JSON.parse(testContext.revertContract.abi); - - var RevertContract = new web3.eth.Contract(revertAbi); - RevertContract._code = revertCode; - return RevertContract.deploy({ data: revertCode }) - .send({from: testContext.accounts[0], gas: 3141592 }) - .then(function (instance) { - // TODO: ugly workaround - not sure why this is necessary. - if (!instance._requestManager.provider) { - instance._requestManager.setProvider(web3.eth._provider); - } - return instance.methods.alwaysReverts(5).send({ from: testContext.accounts[0] }) - }) - .catch(function(err){ - assert.equal(err.results[err.hashes[0]].error, "revert", "Expected error result not returned."); - return web3.eth.getTransactionReceipt(err.hashes[0]) - }) - .then(function(receipt) { - assert.notEqual(receipt, null, "Transaction receipt shouldn't be null"); - assert.equal(receipt.status, 0, "Reverted (failed) transactions should have a status of 0."); - }); - }); -}); diff --git a/test/whisper.js b/test/whisper.js deleted file mode 100644 index 9046cc5744..0000000000 --- a/test/whisper.js +++ /dev/null @@ -1,19 +0,0 @@ -var Web3 = require('web3'); -var assert = require('assert'); -var Ganache = require(process.env.TEST_BUILD ? "../build/ganache.core." + process.env.TEST_BUILD + ".js" : "../index.js"); - -describe("Whisper", function(done) { - var web3 = new Web3(); - var provider; - - before("Initialize the provider", function() { - provider = Ganache.provider(); - web3.setProvider(provider); - }); - - it("should call get whisper version (shh_version)", function() { - return web3.shh.getVersion(function(err, result){ - assert.equal(result, "2", "Whisper version should be 2"); - }) - }); -}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..8baa5e1c2d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "esModuleInterop": true, + "target": "es6", + "noImplicitAny": true, + "moduleResolution": "node", + "sourceMap": true, + "outDir": "dist", + "baseUrl": ".", + "lib": ["es2017"], + "rootDir": "./" + }, + "include": [ + "./index.ts" + ] +} diff --git a/webpack/base.webpack.config.js b/webpack/base.webpack.config.js deleted file mode 100644 index e9af1c8d34..0000000000 --- a/webpack/base.webpack.config.js +++ /dev/null @@ -1,49 +0,0 @@ -const { merge } = require("lodash"); -const { resolve } = require("path"); -const { IgnorePlugin } = require("webpack"); - -const outputDir = resolve(__dirname, "..", "build"); - -module.exports = (override) => { - return merge({}, { - output: { - path: outputDir - }, - devtool: "source-map", - externals: [ - (context, request, callback) => { - // webpack these modules: - // we actually only care about scrypt and eth-block-tracker here, as those are the only native modules - // but webpack won't detect them if we don't traverse the dependency tree to get to them - if (/^(ethereumjs-wallet|scrypt|web3|eth-block-tracker)(\/.*)?$/.test(request)) { - return callback(); - } - - // we want to webpack all local files (files starting with a .) - if(/^\./.test(request)){ - return callback(); - } - - // we don't want to webpack any other modules - return callback(null, 'commonjs ' + request); - } - ], - resolve: { - alias: { - // eth-block-tracker is es6 but automatically builds an es5 version for us on install. thanks eth-block-tracker! - "eth-block-tracker": "eth-block-tracker/dist/es5/index.js", - - // replace native `scrypt` module with pure js `js-scrypt` - "scrypt": "js-scrypt", - - // replace native `secp256k1` with pure js `elliptic.js` - "secp256k1": "secp256k1/elliptic.js" - } - }, - plugins: [ - // ignore these plugins completely - new IgnorePlugin(/^(?:electron|ws)$/) - ], - mode: "production" - }, override); -}; \ No newline at end of file diff --git a/webpack/node/core.webpack.config.js b/webpack/node/core.webpack.config.js deleted file mode 100644 index 4ef34c77eb..0000000000 --- a/webpack/node/core.webpack.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const { join } = require("path"); -const applyBaseConfig = require("../base.webpack.config"); - -const outputDir = join(__dirname, "..", "..", "build"); -const outputFilename = "ganache.core.node.js"; - -module.exports = applyBaseConfig({ - entry: "./public-exports.js", - target: "node", - output: { - path: outputDir, - filename: outputFilename, - library: "Ganache", - libraryTarget: "umd", - umdNamedDefine: true - } -}); \ No newline at end of file diff --git a/webpack/node/provider.webpack.config.js b/webpack/node/provider.webpack.config.js deleted file mode 100644 index 9c477d6696..0000000000 --- a/webpack/node/provider.webpack.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const { join } = require("path"); -const applyBaseConfig = require("../base.webpack.config"); - -const outputDir = join(__dirname, "..", "..", "build"); -const outputFilename = "ganache.provider.node.js"; - -module.exports = applyBaseConfig({ - entry: "./lib/provider.js", - target: "node", - output: { - path: outputDir, - filename: outputFilename, - library: "GanacheProvider", - libraryTarget: "umd", - umdNamedDefine: true - } -}); \ No newline at end of file diff --git a/webpack/node/server.webpack.config.js b/webpack/node/server.webpack.config.js deleted file mode 100644 index ddadd9d455..0000000000 --- a/webpack/node/server.webpack.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const { join } = require("path"); -const applyBaseConfig = require("../base.webpack.config"); - -const outputDir = join(__dirname, "..", "..", "build"); -const outputFilename = "ganache.server.node.js"; - -module.exports = applyBaseConfig({ - entry: "./lib/server.js", - target: "node", - output: { - path: outputDir, - filename: outputFilename, - library: "GanacheServer", - libraryTarget: "umd", - umdNamedDefine: true - } -}); \ No newline at end of file diff --git a/webpack/web-experimental/core.webpack.config.js b/webpack/web-experimental/core.webpack.config.js deleted file mode 100644 index 5f0bbc368c..0000000000 --- a/webpack/web-experimental/core.webpack.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const { join } = require("path"); -const applyBaseConfig = require("./webbase.webpack.config"); - -const outputDir = join(__dirname, "..", "..", "build"); -const outputFilename = "ganache.core.web-experimental.js"; - -module.exports = applyBaseConfig({ - entry: ["core-js/fn/promise", "./index.js"], - target: "web", - output: { - path: outputDir, - filename: outputFilename, - library: "Ganache", - libraryTarget: "umd", - umdNamedDefine: true - } -}); \ No newline at end of file diff --git a/webpack/web-experimental/provider.webpack.config.js b/webpack/web-experimental/provider.webpack.config.js deleted file mode 100644 index 84f13cfa6e..0000000000 --- a/webpack/web-experimental/provider.webpack.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const { join } = require("path"); -const applyBaseConfig = require("./webbase.webpack.config"); - -const outputDir = join(__dirname, "..", "..", "build"); -const outputFilename = "ganache.provider.web-experimental.js"; - -module.exports = applyBaseConfig({ - entry: "./lib/provider.js", - target: "web", - output: { - path: outputDir, - filename: outputFilename, - library: "GanacheProvider", - libraryTarget: "umd", - umdNamedDefine: true - } -}); \ No newline at end of file diff --git a/webpack/web-experimental/server.webpack.config.js b/webpack/web-experimental/server.webpack.config.js deleted file mode 100644 index 1886420ae1..0000000000 --- a/webpack/web-experimental/server.webpack.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const { join } = require("path"); -const applyBaseConfig = require("./webbase.webpack.config"); - -const outputDir = join(__dirname, "..", "..", "build"); -const outputFilename = "ganache.server.web-experimental.js"; - -module.exports = applyBaseConfig({ - entry: "./lib/server.js", - target: "web", - output: { - path: outputDir, - filename: outputFilename, - library: "GanacheServer", - libraryTarget: "umd", - umdNamedDefine: true - } -}); \ No newline at end of file diff --git a/webpack/web-experimental/webbase.webpack.config.js b/webpack/web-experimental/webbase.webpack.config.js deleted file mode 100644 index 3a304f36c2..0000000000 --- a/webpack/web-experimental/webbase.webpack.config.js +++ /dev/null @@ -1,12 +0,0 @@ -const { merge } = require("lodash"); -const applyBaseConfig = require("../base.webpack.config"); - -module.exports = (override) => { - return merge({}, applyBaseConfig({ - resolve: { - alias: { - 'fs': 'browserfs/dist/shims/fs.js' - } - } - }), override); -}; \ No newline at end of file From f08fd54f846c3b339cd85e413cc10dae805e5032 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Oct 2018 20:45:40 -0400 Subject: [PATCH 002/691] still just figuring things out. nothing solid here. move along. --- index.js | 11 - npm-shrinkwrap.json | 2886 ++++++++++++++++- package.json | 5 + src/engine.ts | 177 + src/ledgers/ethereum/ethereum.js | 0 src/options/options.ts | 14 +- src/options/provider-options.ts | 6 +- src/options/server-options.ts | 5 + src/provider.ts | 35 +- src/utils/queue.ts | 15 + src/utils/request-processor.ts | 57 + tsconfig.json | 3 +- .../subproviders/subprovider.d.ts | 13 + 13 files changed, 3131 insertions(+), 96 deletions(-) delete mode 100644 index.js create mode 100644 src/engine.ts create mode 100644 src/ledgers/ethereum/ethereum.js create mode 100644 src/utils/queue.ts create mode 100644 src/utils/request-processor.ts create mode 100644 typings/web3-provider-engine/subproviders/subprovider.d.ts diff --git a/index.js b/index.js deleted file mode 100644 index 77ce1acc4f..0000000000 --- a/index.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -exports.__esModule = true; -var provider_1 = require("./src/provider"); -var server_1 = require("./src/server"); -// `server` and `provider` are here for backwards compatability -exports["default"] = { - server: function (options) { return new server_1["default"](options); }, - provider: function (options) { return new provider_1["default"](options); }, - Server: server_1["default"], - Provider: provider_1["default"] -}; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b2abc0e357..0b97dba396 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4,12 +4,29 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/bn.js": { + "version": "4.11.2", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.2.tgz", + "integrity": "sha512-OC3E/26kp/+JSOE4eJo86KivQM95MKPgnkug3uSCt+pXTWPovVBhixL1GwK1MLLsxgR3uZmTGjQQd8uKJEnurA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/chai": { "version": "4.1.6", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz", "integrity": "sha512-CBk7KTZt3FhPsEkYioG6kuCIpWISw+YI8o+3op4+NXwTpvAPxE1ES8+PY8zfaK2L98b1z5oq03UHa4VYpeUxnw==", "dev": true }, + "@types/ethereum-protocol": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/ethereum-protocol/-/ethereum-protocol-1.0.0.tgz", + "integrity": "sha512-3DiI3Zxf81CgX+VhxNNFJBv/sfr1BFBKQK2sQ85hU9FwWJJMWV5gRDV79OUNShiwj3tYYIezU94qpucsb3dThQ==", + "requires": { + "bignumber.js": "7.2.1" + } + }, "@types/mocha": { "version": "5.2.5", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", @@ -22,45 +39,925 @@ "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==", "dev": true }, + "@types/underscore": { + "version": "1.8.9", + "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.8.9.tgz", + "integrity": "sha512-vfzZGgZKRFy7KEWcBGfIFk+h6B+thDCLfkD1exMBMRlUsx2icA+J6y4kAbZs/TjSTeY1duw89QUU133TSzr60Q==", + "dev": true + }, + "@types/web3": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/web3/-/web3-1.0.10.tgz", + "integrity": "sha512-7rje36GsWAz1cow7/2PB4FAvDpMCAmSgDGSAmhB+Qi9pE/ROMQvzlvGAkDSwkKZ+WAK68WreJFwc3PLCawpYXw==", + "dev": true, + "requires": { + "@types/bn.js": "*", + "@types/underscore": "*" + } + }, + "@types/web3-provider-engine": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@types/web3-provider-engine/-/web3-provider-engine-14.0.0.tgz", + "integrity": "sha512-yHr8mX2SoX3JNyfqdLXdO1UobsGhfiwSgtekbVxKLQrzD7vtpPkKbkIVsPFOhvekvNbPsCmDyeDCLkpeI9gSmA==", + "requires": { + "@types/ethereum-protocol": "*" + } + }, + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "~4.0.0" + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "requires": { + "lodash": "^4.17.10" + } + }, + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "requires": { + "async": "^2.4.0" + } + }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=" + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=" + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=" + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "requires": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "requires": { + "regenerator-transform": "^0.10.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-to-generator": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^3.2.6", + "invariant": "^2.2.2", + "semver": "^5.3.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "requires": { + "source-map": "^0.5.6" + } + } + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babelify": { + "version": "7.3.0", + "resolved": "http://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", + "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", + "requires": { + "babel-core": "^6.0.14", + "object-assign": "^4.0.0" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + }, + "backoff": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", + "integrity": "sha1-9hbtqdPktmuMp/ynn2lXIsX44m8=", + "requires": { + "precond": "0.2" + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bignumber.js": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", + "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" + }, + "bindings": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", + "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" + }, + "bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, "brace-expansion": { "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", "concat-map": "0.0.1" } }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserslist": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "requires": { + "caniuse-lite": "^1.0.30000844", + "electron-to-chromium": "^1.3.47" + } + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + }, + "caniuse-lite": { + "version": "1.0.30000898", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000898.tgz", + "integrity": "sha512-ytlTZqO4hYe4rNAJhMynUAIUI33jsP2Bb1two/9OVC39wZjPZ8exIO0eCLw5mqAtegOGiGF0kkTWTn3B02L+mw==" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "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" + }, + "dependencies": { + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + } + } + }, + "checkpoint-store": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", + "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", + "requires": { + "functional-red-black-tree": "^1.0.1" + } }, "chnl": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/chnl/-/chnl-0.4.1.tgz", "integrity": "sha512-74sahZgoyc266kwg3OZv1O1aaaGjGAOPx4J2crt5lm+Dmo8o0b0D+tHdF60EQSmym77FFPKMRZnIPb3vAKT5Mw==" }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "commander": { "version": "2.15.1", "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", @@ -70,8 +967,78 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "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=" + }, + "create-hash": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-fetch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.2.tgz", + "integrity": "sha1-pH/09/xxLauo9qaVoRyUhEDUVyM=", + "requires": { + "node-fetch": "2.1.2", + "whatwg-fetch": "2.0.4" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } }, "debug": { "version": "3.1.0", @@ -82,69 +1049,568 @@ "ms": "2.0.0" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "requires": { - "object-keys": "^1.0.12" + "object-keys": "^1.0.12" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "requires": { + "repeating": "^2.0.0" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "dom-walk": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", + "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=" + }, + "drbg.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", + "requires": { + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "electron-to-chromium": { + "version": "1.3.81", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.81.tgz", + "integrity": "sha512-+rym2xtzwPWmoi8AYRrCdW65QOT0vfUHjZb5mjgh0VLyj31pGM3CpP3znKhQNBzQaWujR/KEl/mfC2lnKYgADA==" + }, + "elliptic": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", + "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "requires": { + "iconv-lite": "~0.4.13" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "^1.4.0" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "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=" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + }, + "eth-block-tracker": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz", + "integrity": "sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug==", + "requires": { + "eth-query": "^2.1.0", + "ethereumjs-tx": "^1.3.3", + "ethereumjs-util": "^5.1.3", + "ethjs-util": "^0.1.3", + "json-rpc-engine": "^3.6.0", + "pify": "^2.3.0", + "tape": "^4.6.3" + } + }, + "eth-json-rpc-infura": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eth-json-rpc-infura/-/eth-json-rpc-infura-3.1.2.tgz", + "integrity": "sha512-IuK5Iowfs6taluA/3Okmu6EfZcFMq6MQuyrUL1PrCoJstuuBr3TvVeSy3keDyxfbrjFB34nCo538I8G+qMtsbw==", + "requires": { + "cross-fetch": "^2.1.1", + "eth-json-rpc-middleware": "^1.5.0", + "json-rpc-engine": "^3.4.0", + "json-rpc-error": "^2.0.0", + "tape": "^4.8.0" + } + }, + "eth-json-rpc-middleware": { + "version": "1.6.0", + "resolved": "http://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz", + "integrity": "sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q==", + "requires": { + "async": "^2.5.0", + "eth-query": "^2.1.2", + "eth-tx-summary": "^3.1.2", + "ethereumjs-block": "^1.6.0", + "ethereumjs-tx": "^1.3.3", + "ethereumjs-util": "^5.1.2", + "ethereumjs-vm": "^2.1.0", + "fetch-ponyfill": "^4.0.0", + "json-rpc-engine": "^3.6.0", + "json-rpc-error": "^2.0.0", + "json-stable-stringify": "^1.0.1", + "promise-to-callback": "^1.0.0", + "tape": "^4.6.3" + } + }, + "eth-query": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/eth-query/-/eth-query-2.1.2.tgz", + "integrity": "sha1-1nQdkAAQa1FRDHLbktY2VFam2l4=", + "requires": { + "json-rpc-random-id": "^1.0.0", + "xtend": "^4.0.1" + } + }, + "eth-sig-util": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz", + "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", + "requires": { + "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799", + "ethereumjs-util": "^5.1.1" + } + }, + "eth-tx-summary": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/eth-tx-summary/-/eth-tx-summary-3.2.3.tgz", + "integrity": "sha512-1gZpA5fKarJOVSb5OUlPnhDQuIazqAkI61zlVvf5LdG47nEgw+/qhyZnuj3CUdE/TLTKuRzPLeyXLjaB4qWTRQ==", + "requires": { + "async": "^2.1.2", + "bn.js": "^4.11.8", + "clone": "^2.0.0", + "concat-stream": "^1.5.1", + "end-of-stream": "^1.1.0", + "eth-query": "^2.0.2", + "ethereumjs-block": "^1.4.1", + "ethereumjs-tx": "^1.1.1", + "ethereumjs-util": "^5.0.1", + "ethereumjs-vm": "2.3.4", + "through2": "^2.0.3", + "treeify": "^1.0.1", + "web3-provider-engine": "^13.3.2" + }, + "dependencies": { + "eth-block-tracker": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-2.3.1.tgz", + "integrity": "sha512-NamWuMBIl8kmkJFVj8WzGatySTzQPQag4Xr677yFxdVtIxACFbL/dQowk0MzEqIKk93U1TwY3MjVU6mOcwZnKA==", + "requires": { + "async-eventemitter": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", + "eth-query": "^2.1.0", + "ethereumjs-tx": "^1.3.3", + "ethereumjs-util": "^5.1.3", + "ethjs-util": "^0.1.3", + "json-rpc-engine": "^3.6.0", + "pify": "^2.3.0", + "tape": "^4.6.3" + }, + "dependencies": { + "async-eventemitter": { + "version": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", + "from": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", + "requires": { + "async": "^2.4.0" + } + } + } + }, + "ethereum-common": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", + "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==" + }, + "ethereumjs-vm": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.3.4.tgz", + "integrity": "sha512-Y4SlzNDqxrCO58jhp98HdnZVdjOqB+HC0hoU+N/DEp1aU+hFkRX/nru5F7/HkQRPIlA6aJlQp/xIA6xZs1kspw==", + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "ethereum-common": "0.2.0", + "ethereumjs-account": "^2.0.3", + "ethereumjs-block": "~1.7.0", + "ethereumjs-util": "^5.1.3", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.1.2", + "rustbn.js": "~0.1.1", + "safe-buffer": "^5.1.1" + } + }, + "web3-provider-engine": { + "version": "13.8.0", + "resolved": "http://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz", + "integrity": "sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ==", + "requires": { + "async": "^2.5.0", + "clone": "^2.0.0", + "eth-block-tracker": "^2.2.2", + "eth-sig-util": "^1.4.2", + "ethereumjs-block": "^1.2.2", + "ethereumjs-tx": "^1.2.0", + "ethereumjs-util": "^5.1.1", + "ethereumjs-vm": "^2.0.2", + "fetch-ponyfill": "^4.0.0", + "json-rpc-error": "^2.0.0", + "json-stable-stringify": "^1.0.1", + "promise-to-callback": "^1.0.0", + "readable-stream": "^2.2.9", + "request": "^2.67.0", + "semaphore": "^1.0.3", + "solc": "^0.4.2", + "tape": "^4.4.0", + "xhr": "^2.2.0", + "xtend": "^4.0.1" + } + } + } + }, + "ethereum-common": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", + "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=" + }, + "ethereumjs-abi": { + "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799", + "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", + "requires": { + "bn.js": "^4.10.0", + "ethereumjs-util": "^5.0.0" + } + }, + "ethereumjs-account": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", + "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", + "requires": { + "ethereumjs-util": "^5.0.0", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-block": { + "version": "1.7.1", + "resolved": "http://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz", + "integrity": "sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg==", + "requires": { + "async": "^2.0.1", + "ethereum-common": "0.2.0", + "ethereumjs-tx": "^1.2.2", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereum-common": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", + "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==" + } + } + }, + "ethereumjs-common": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-0.4.1.tgz", + "integrity": "sha512-ywYGsOeGCsMNWso5Y4GhjWI24FJv9FK7+VyVKiQgXg8ZRDPXJ7F/kJ1CnjtkjTvDF4e0yqU+FWswlqR3bmZQ9Q==" + }, + "ethereumjs-tx": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", + "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", + "requires": { + "ethereum-common": "^0.0.18", + "ethereumjs-util": "^5.0.0" + } + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "ethereumjs-vm": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.4.0.tgz", + "integrity": "sha512-MJ4lCWa5c6LhahhhvoDKW+YGjK00ZQn0RHHLh4L+WaH1k6Qv7/q3uTluew6sJGNCZdlO0yYMDXYW9qyxLHKlgQ==", + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "ethereumjs-account": "^2.0.3", + "ethereumjs-block": "~1.7.0", + "ethereumjs-common": "~0.4.0", + "ethereumjs-util": "^5.2.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.1.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + } + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", + "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==" + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fake-merkle-patricia-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", + "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", + "requires": { + "checkpoint-store": "^1.1.0" } }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" }, - "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "fetch-ponyfill": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz", + "integrity": "sha1-rjzl9zLGReq4fkroeTQUcJsjmJM=", "requires": { - "es-to-primitive": "^1.1.1", - "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" + "node-fetch": "~1.7.1" + }, + "dependencies": { + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + } } }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, - "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=", - "dev": true - }, "flat-options": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/flat-options/-/flat-options-0.1.3.tgz", "integrity": "sha512-z1vH9mb4ly55dWUZZFUeLNqhFWhwSQNngHpK8RQOhFuNw/sWcNDZhkHl3GS1YTHiYxB5qvcbSRbH7X6ThzX9UA==" }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "requires": { + "is-callable": "^1.1.3" + } + }, + "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": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, "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.4", @@ -154,12 +1620,45 @@ "path-is-absolute": "^1.0.0" } }, + "global": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", + "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", + "requires": { + "min-document": "^2.19.0", + "process": "~0.5.1" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" + }, + "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.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -168,6 +1667,14 @@ "function-bind": "^1.1.1" } }, + "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" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -179,17 +1686,81 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", + "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, "he": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -198,51 +1769,485 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "requires": { + "builtin-modules": "^1.0.0" + } }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fn/-/is-fn-1.0.0.tgz", + "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-function": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", + "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "requires": { + "has-symbols": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + }, + "json-rpc-engine": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz", + "integrity": "sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA==", + "requires": { + "async": "^2.0.1", + "babel-preset-env": "^1.7.0", + "babelify": "^7.3.0", + "json-rpc-error": "^2.0.0", + "promise-to-callback": "^1.0.0", + "safe-event-emitter": "^1.0.1" + } + }, + "json-rpc-error": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/json-rpc-error/-/json-rpc-error-2.0.0.tgz", + "integrity": "sha1-p6+cICg4tekFxyUOVH8a/3cligI=", + "requires": { + "inherits": "^2.0.1" + } + }, + "json-rpc-random-id": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz", + "integrity": "sha1-uknZat7RRE27jaPSA3SKy7zeyMg=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "requires": { + "jsonify": "~0.0.0" + } + }, + "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=" + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "http://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + }, + "dependencies": { + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + } + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + }, + "make-error": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "dev": true + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + } + } + }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", "requires": { - "has": "^1.0.1" + "mime-db": "~1.37.0" } }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", "requires": { - "has-symbols": "^1.0.0" + "dom-walk": "^0.1.0" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, - "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", - "dev": true + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "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.7" } @@ -250,14 +2255,12 @@ "minimist": { "version": "0.0.8", "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mkdirp": { "version": "0.5.1", "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" } @@ -291,6 +2294,42 @@ "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" }, + "node-fetch": { + "version": "2.1.2", + "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", + "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=" + }, + "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.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-inspect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", + "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==" + }, "object-keys": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", @@ -300,22 +2339,130 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-locale": { + "version": "1.4.0", + "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "^1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "parse-headers": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", + "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", + "requires": { + "for-each": "^0.3.2", + "trim": "0.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, "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=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "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.0" + } + }, + "precond": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", + "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=" + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + }, + "process": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", + "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "promise-controller": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/promise-controller/-/promise-controller-0.3.0.tgz", "integrity": "sha512-w1RTaOwD5bNtYjIj5L8+ruDtMgnKC0pLtOogA3kcS4LRtiwLOpAdokjYbkjJMa6AGV0oasHa8RRNa8qEpG1qyw==" }, + "promise-to-callback": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/promise-to-callback/-/promise-to-callback-1.0.0.tgz", + "integrity": "sha1-XSp0kBC/tn2WNZj805YHRqaP7vc=", + "requires": { + "is-fn": "^1.0.0", + "set-immediate-shim": "^1.0.1" + } + }, "promise.prototype.finally": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/promise.prototype.finally/-/promise.prototype.finally-3.1.0.tgz", @@ -326,6 +2473,277 @@ "function-bind": "^1.1.1" } }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==" + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=" + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "requires": { + "jsesc": "~0.5.0" + } + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-from-string": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "resolve": { + "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" + } + }, + "resumer": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "requires": { + "through": "~2.3.4" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "^7.0.5" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.1.0.tgz", + "integrity": "sha512-93U7IKH5j7nmXFVg19MeNBGzQW5uXW1pmCuKY8veeKIhYTE32C2d0mOegfiIAfXcHOKJjjPlJisn8iHDF5AezA==", + "requires": { + "safe-buffer": "^5.1.1" + } + }, + "rustbn.js": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.1.2.tgz", + "integrity": "sha512-bAkNqSHYdJdFsBC7Z11JgzYktL31HIpB2o70jZcGiL1U1TVtPyvaVhDrGWwS8uZtaqwW2k6NOPGZCqW/Dgh5Lg==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safe-event-emitter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz", + "integrity": "sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg==", + "requires": { + "events": "^3.0.0" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "secp256k1": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.5.2.tgz", + "integrity": "sha512-iin3kojdybY6NArd+UFsoTuapOF7bnJNf2UbcWXaY3z+E1sJDipl60vtzB5hbO/uquBu7z0fd4VC4Irp+xoFVQ==", + "requires": { + "bindings": "^1.2.1", + "bip66": "^1.1.3", + "bn.js": "^4.11.3", + "create-hash": "^1.1.2", + "drbg.js": "^1.0.1", + "elliptic": "^6.2.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "semaphore": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", + "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + }, + "solc": { + "version": "0.4.25", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.25.tgz", + "integrity": "sha512-jU1YygRVy6zatgXrLY2rRm7HW1d7a8CkkEgNJwvH2VLpWhMFsMdWcJn6kUqZwcSz/Vm+w89dy7Z/aB5p6AFTrg==", + "requires": { + "fs-extra": "^0.30.0", + "memorystream": "^0.3.1", + "require-from-string": "^1.1.0", + "semver": "^5.3.0", + "yargs": "^4.7.1" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -342,6 +2760,102 @@ "source-map": "^0.6.0" } }, + "spdx-correct": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", + "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", + "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==" + }, + "sshpk": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.1.tgz", + "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", + "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", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string.prototype.trim": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", + "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.0", + "function-bind": "^1.0.2" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", @@ -351,6 +2865,76 @@ "has-flag": "^3.0.0" } }, + "tape": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.1.tgz", + "integrity": "sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw==", + "requires": { + "deep-equal": "~1.0.1", + "defined": "~1.0.0", + "for-each": "~0.3.3", + "function-bind": "~1.1.1", + "glob": "~7.1.2", + "has": "~1.0.3", + "inherits": "~2.0.3", + "minimist": "~1.2.0", + "object-inspect": "~1.6.0", + "resolve": "~1.7.1", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.1.2", + "through": "~2.3.8" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, + "through": { + "version": "2.3.8", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + }, + "treeify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", + "integrity": "sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==" + }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" + }, "ts-node": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", @@ -375,6 +2959,24 @@ } } }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -389,6 +2991,62 @@ "integrity": "sha512-+81MUSyX+BaSo+u2RbozuQk/UWx6hfG0a5gHu4ANEM4sU96XbuIyAB+rWBW1u70c6a5QuZfuYICn3s2UjuHUpA==", "dev": true }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "web3-provider-engine": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-14.1.0.tgz", + "integrity": "sha512-vGZtqhSUzGTiMGhJXNnB/aRDlrPZLhLnBZ2NPArkZtr8XSrwg9m08tw4+PuWg5za0TJuoE/vuPQc501HddZZWw==", + "requires": { + "async": "^2.5.0", + "backoff": "^2.5.0", + "clone": "^2.0.0", + "cross-fetch": "^2.1.0", + "eth-block-tracker": "^3.0.0", + "eth-json-rpc-infura": "^3.1.0", + "eth-sig-util": "^1.4.2", + "ethereumjs-block": "^1.2.2", + "ethereumjs-tx": "^1.2.0", + "ethereumjs-util": "^5.1.5", + "ethereumjs-vm": "^2.3.4", + "json-rpc-error": "^2.0.0", + "json-stable-stringify": "^1.0.1", + "promise-to-callback": "^1.0.0", + "readable-stream": "^2.2.9", + "request": "^2.85.0", + "semaphore": "^1.0.3", + "ws": "^5.1.1", + "xhr": "^2.2.0", + "xtend": "^4.0.1" + } + }, "websocket": { "version": "1.0.28", "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.28.tgz", @@ -421,17 +3079,99 @@ "promise.prototype.finally": "^3.1.0" } }, + "whatwg-fetch": { + "version": "2.0.4", + "resolved": "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "requires": { + "async-limiter": "~1.0.0" + } + }, + "xhr": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", + "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", + "requires": { + "global": "~4.3.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" }, "yaeti": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" }, + "yargs": { + "version": "4.8.1", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "requires": { + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "http://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "requires": { + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" + } + }, "yn": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", diff --git a/package.json b/package.json index 0cab4a85af..9ee22f33f6 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,10 @@ "test": "mocha -r ts-node/register test/**.* --recursive" }, "dependencies": { + "@types/ethereum-protocol": "^1.0.0", + "@types/web3-provider-engine": "^14.0.0", + "ethereumjs-vm": "2.4.0", + "web3-provider-engine": "14.1.0", "websocket": "1.0.28", "websocket-as-promised": "0.9.0" }, @@ -22,6 +26,7 @@ "@types/chai": "^4.1.6", "@types/mocha": "^5.2.5", "@types/node": "^10.12.0", + "@types/web3": "^1.0.10", "mocha": "^5.2.0", "ts-node": "^7.0.1", "typescript": "^3.1.3" diff --git a/src/engine.ts b/src/engine.ts new file mode 100644 index 0000000000..215f5976d0 --- /dev/null +++ b/src/engine.ts @@ -0,0 +1,177 @@ +import {EventEmitter} from "events"; + +ProviderEngine + +export default class ProviderEngine extends EventEmitter { + public constructor(opts: object){ + super(); + + this.setMaxListeners(30) + // parse options + opts = opts || {} + + // block polling + const directProvider = { sendAsync: self._handleAsync.bind(self) } + const blockTrackerProvider = opts.blockTrackerProvider || directProvider + this._blockTracker = opts.blockTracker || new EthBlockTracker({ + provider: blockTrackerProvider, + pollingInterval: opts.pollingInterval || 4000, + }) + + // handle new block + this._blockTracker.on('block', (jsonBlock) => { + const bufferBlock = toBufferBlock(jsonBlock) + this._setCurrentBlock(bufferBlock) + }) + + // emit block events from the block tracker + this._blockTracker.on('block', self.emit.bind(self, 'rawBlock')) + this._blockTracker.on('sync', self.emit.bind(self, 'sync')) + this._blockTracker.on('latest', self.emit.bind(self, 'latest')) + + // set initialization blocker + this._ready = new Stoplight() + // unblock initialization after first block + this._blockTracker.once('block', () => { + this._ready.go() + }) + // local state + this.currentBlock = null + this._providers = [] + } + + + // public + public start(cb = noop){ + // start block polling + this._blockTracker.start().then(cb).catch(cb) + } + + public stop(){ + // stop block polling + this._blockTracker.stop() + } + + public addProvider(source){ + this._providers.push(source) + source.setEngine(this) + } + + public send(payload){ + throw new Error('Web3ProviderEngine does not support synchronous requests.'); + } + + + public sendAsync (payload, cb) { + this._ready.await(function(){ + + if (Array.isArray(payload)) { + // handle batch + map(payload, this._handleAsync.bind(self), cb) + } else { + // handle single + this._handleAsync(payload, cb) + } + + }) + } + +// private + + private _handleAsync (payload, finished) { + var self = this + var currentProvider = -1 + var result = null + var error = null + + var stack = [] + + next() + + function next(after) { + currentProvider += 1 + stack.unshift(after) + + // Bubbled down as far as we could go, and the request wasn't + // handled. Return an error. + if (currentProvider >= self._providers.length) { + end(new Error('Request for method "' + payload.method + '" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.')) + } else { + try { + var provider = self._providers[currentProvider] + provider.handleRequest(payload, next, end) + } catch (e) { + end(e) + } + } + } + + function end(_error, _result) { + error = _error + result = _result + + eachSeries(stack, function(fn, callback) { + + if (fn) { + fn(error, result, callback) + } else { + callback() + } + }, function() { + // console.log('COMPLETED:', payload) + // console.log('RESULT: ', result) + + var resultObj = { + id: payload.id, + jsonrpc: payload.jsonrpc, + result: result + } + + if (error != null) { + resultObj.error = { + message: error.stack || error.message || error, + code: -32000 + } + // respond with both error formats + finished(error, resultObj) + } else { + finished(null, resultObj) + } + }) + } + } + + // + // from remote-data + // + + private _setCurrentBlock(block){ + this.currentBlock = block + this.emit('block', block) + } +} +// util + +function toBufferBlock (jsonBlock) { + return { + number: ethUtil.toBuffer(jsonBlock.number), + hash: ethUtil.toBuffer(jsonBlock.hash), + parentHash: ethUtil.toBuffer(jsonBlock.parentHash), + nonce: ethUtil.toBuffer(jsonBlock.nonce), + mixHash: ethUtil.toBuffer(jsonBlock.mixHash), + sha3Uncles: ethUtil.toBuffer(jsonBlock.sha3Uncles), + logsBloom: ethUtil.toBuffer(jsonBlock.logsBloom), + transactionsRoot: ethUtil.toBuffer(jsonBlock.transactionsRoot), + stateRoot: ethUtil.toBuffer(jsonBlock.stateRoot), + receiptsRoot: ethUtil.toBuffer(jsonBlock.receiptRoot || jsonBlock.receiptsRoot), + miner: ethUtil.toBuffer(jsonBlock.miner), + difficulty: ethUtil.toBuffer(jsonBlock.difficulty), + totalDifficulty: ethUtil.toBuffer(jsonBlock.totalDifficulty), + size: ethUtil.toBuffer(jsonBlock.size), + extraData: ethUtil.toBuffer(jsonBlock.extraData), + gasLimit: ethUtil.toBuffer(jsonBlock.gasLimit), + gasUsed: ethUtil.toBuffer(jsonBlock.gasUsed), + timestamp: ethUtil.toBuffer(jsonBlock.timestamp), + transactions: jsonBlock.transactions, + } +} diff --git a/src/ledgers/ethereum/ethereum.js b/src/ledgers/ethereum/ethereum.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/options/options.ts b/src/options/options.ts index 87073f36af..70002e6d94 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -3,7 +3,7 @@ import HexData from "../types/hex-data"; import HexQuantity from "../types/hex-quantity"; interface Logger { - log(...args: any[]): void; + log(message?: any, ...optionalParams: any[]): void; } export default class Options { @@ -24,7 +24,7 @@ export default class Options { /** * An object, like console, that implements a log() function. */ - public logger: {log: Logger} = null + public logger: Logger = {log: () => {}} /** * Use a specific HD wallet mnemonic to generate initial addresses. @@ -121,4 +121,14 @@ export default class Options { * "0x6691b7". */ public gasLimit: HexQuantity = new HexQuantity("0x6691b7") + + /** + * + */ + public verbose: boolean = false + + /** + * + */ + public asyncRequestProcessing: boolean = false } diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 1279b693aa..f0c7442da8 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -1,5 +1,9 @@ import Options from "./options"; +import Subprovider from "web3-provider-engine/subproviders/subprovider"; export default class ProviderOptions extends Options { - + /** + * Array of strings to installed subproviders + */ + public subProviders: Subprovider[] } diff --git a/src/options/server-options.ts b/src/options/server-options.ts index 00f0aefc61..14112f91e2 100644 --- a/src/options/server-options.ts +++ b/src/options/server-options.ts @@ -20,4 +20,9 @@ export default class ServerOptions extends Options { * Enable a websocket server. This is `true` by default. */ public ws: boolean = true + + /** + * Array of strings to installed subproviders + */ + public subProviders: string[] } diff --git a/src/provider.ts b/src/provider.ts index 2948f9bf75..cef276d11a 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,5 +1,8 @@ +import Engine from "./engine"; +import RequestProcessor from "./utils/request-processors"; import _ProviderOptions from "./options/provider-options"; import { EventEmitter } from "events"; +import {Provider as _Provider} from "ethereum-protocol"; export type ProviderOptions = _ProviderOptions; export const ProviderOptions = _ProviderOptions; @@ -7,18 +10,34 @@ export const ProviderOptions = _ProviderOptions; /** * */ -export default class Provider extends EventEmitter { - public options: Object; +export default class Provider extends EventEmitter implements _Provider { + private options: ProviderOptions; + private engine: Engine; + private requestProcessor: RequestProcessor; constructor(options: ProviderOptions) { super(); this.options = options; + + // set up our request processor to either use FIFO or or async requst processing + this.requestProcessor = new RequestProcessor(options.asyncRequestProcessing ? 1 : 0); } - public async send(payload: Object, callback?: (err: Error, response: any) => void): Promise { - if (!callback) { - return new Promise((resolve, reject) => { - resolve({}); - }); + + public async send(payload: object, callback?: (err: Error, response?: any) => void): Promise { + const _send = this.sendAsync(payload); + if (callback) { + _send.catch(callback).then(callback.bind(this, null)); + return; } - return; + else { + return await _send; + } + } + + public async sendAsync(payload: Array|object) { + if (this.options.verbose) { + this.options.logger.log(" > " + JSON.stringify(payload, null, 2).split("\n").join("\n > ")); + } + + this.requestProcessor.queue(this.engine.send, payload); } } diff --git a/src/utils/queue.ts b/src/utils/queue.ts new file mode 100644 index 0000000000..6d019860a8 --- /dev/null +++ b/src/utils/queue.ts @@ -0,0 +1,15 @@ +export default class Queue { + private queue: Array + public get length(): number { + return this.queue.length; + } + constructor() { + + } + public push(args): Promise{ + return new Promise((resolve, reject) => { + resolve(); + }); + setImmediate() + } +} diff --git a/src/utils/request-processor.ts b/src/utils/request-processor.ts new file mode 100644 index 0000000000..83f3ee7937 --- /dev/null +++ b/src/utils/request-processor.ts @@ -0,0 +1,57 @@ +// todo: make this better +export default class RequestProcessor { + public limit: number = 0 + public pending: any[] = []; + public running: any[] = []; + private _processing: boolean; + private _paused: boolean = false; + public get paused(): boolean { + return this._paused; + } + + constructor(limit?: number) { + if(limit !== undefined) { + if (!Number.isInteger(limit) || limit < 0 || limit > Number.MAX_SAFE_INTEGER) { + throw new RangeError("`limit` must be an integer and between 0 - Number.MAX_SAFE_INTEGER, inclusive.") + } + this.limit = limit; + } + + this.process(); + } + + public pause() { + this._paused = true; + } + + public resume() { + this._paused = false; + this.process(); + } + + private process() { + if(this._processing) return; + this._processing = true; + + // if we aren't paused and the number of things we're processing is under + // our limit and we have things to process: do it! + while(!this.paused && this.limit && this.running.length < this.limit && this.pending.length > 0) { + let current = this.pending.shift(); + this.running.push(current); + current().then(() => { + this.running.slice(); + }); + } + this._processing = false; + } + + public queue = async function(fn: ({}) => Promise<{}>, ...args: any[]): Promise<{}> { + const self = this; + const executor = (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { + fn.apply(self, args).then(resolve); + } + this.pending.push(executor); + this.process(); + return new Promise(executor); + } +} diff --git a/tsconfig.json b/tsconfig.json index 8baa5e1c2d..a6e80cbc19 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ "rootDir": "./" }, "include": [ - "./index.ts" + "./index.ts", + "./typings/**/*.d.ts" ] } diff --git a/typings/web3-provider-engine/subproviders/subprovider.d.ts b/typings/web3-provider-engine/subproviders/subprovider.d.ts new file mode 100644 index 0000000000..0037afe51f --- /dev/null +++ b/typings/web3-provider-engine/subproviders/subprovider.d.ts @@ -0,0 +1,13 @@ +declare module "web3-provider-engine/subproviders/subprovider" { + import { + JSONRPCRequestPayload, + } from "ethereum-protocol"; + import Web3ProviderEngine from "web3-provider-engine"; + + export class Subprovider { + public setEngine(engine: Web3ProviderEngine): void; + public handleRequest(payload: JSONRPCRequestPayload, next: () => void, end: () => void): void; + public emitPayload(payload: JSONRPCRequestPayload, cb: () => void): void; + } + export default Subprovider; +} From 34259b8e90e7753e65604265cd7b37c24cdf923a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 26 Mar 2019 19:14:35 -0400 Subject: [PATCH 003/691] wip --- index.ts | 6 +- npm-shrinkwrap.json | 358 ++++++++++++++++++++++++------- package.json | 11 +- src/engine.ts | 186 ++-------------- src/interfaces/ledger.ts | 4 + src/ledgers/ethereum/ethereum.js | 0 src/ledgers/ethereum/ethereum.ts | 35 +++ src/options/options.ts | 14 +- src/options/provider-options.ts | 3 +- src/provider.ts | 72 +++++-- src/server.ts | 170 +++++++++++++++ src/types/hex-quantity.ts | 31 ++- src/utils/queue.ts | 15 -- src/utils/request-processor.ts | 6 +- test/interface.ts | 8 +- test/provider.ts | 10 + test/server.ts | 52 +++++ 17 files changed, 659 insertions(+), 322 deletions(-) create mode 100644 src/interfaces/ledger.ts delete mode 100644 src/ledgers/ethereum/ethereum.js create mode 100644 src/ledgers/ethereum/ethereum.ts delete mode 100644 src/utils/queue.ts create mode 100644 test/provider.ts create mode 100644 test/server.ts diff --git a/index.ts b/index.ts index 78a023026f..3a9bd51eea 100644 --- a/index.ts +++ b/index.ts @@ -1,11 +1,11 @@ import Provider from "./src/provider"; -import ProviderOptions from "./src/options/server-options"; +import ProviderOptions from "./src/options/provider-options"; import Server, {ServerOptions} from "./src/server"; // `server` and `provider` are here for backwards compatability export default { - server: (options: ServerOptions) => new Server(options), - provider: (options: ProviderOptions) => new Provider(options), + server: (options?: ServerOptions) => new Server(options), + provider: (options?: ProviderOptions) => new Provider(options), Server, Provider }; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0b97dba396..888d48a587 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -19,6 +19,11 @@ "integrity": "sha512-CBk7KTZt3FhPsEkYioG6kuCIpWISw+YI8o+3op4+NXwTpvAPxE1ES8+PY8zfaK2L98b1z5oq03UHa4VYpeUxnw==", "dev": true }, + "@types/cookiejar": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz", + "integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==" + }, "@types/ethereum-protocol": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/ethereum-protocol/-/ethereum-protocol-1.0.0.tgz", @@ -27,6 +32,12 @@ "bignumber.js": "7.2.1" } }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, "@types/mocha": { "version": "5.2.5", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", @@ -36,8 +47,16 @@ "@types/node": { "version": "10.12.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.0.tgz", - "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==", - "dev": true + "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==" + }, + "@types/superagent": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.1.tgz", + "integrity": "sha512-NetXrraTWPcdGG6IwYJhJ5esUGx8AYNiozbc1ENWEsF6BsD4JmNODJczI6Rm1xFPVp6HZESds9YCfqz4zIsM6A==", + "requires": { + "@types/cookiejar": "*", + "@types/node": "*" + } }, "@types/underscore": { "version": "1.8.9", @@ -63,6 +82,16 @@ "@types/ethereum-protocol": "*" } }, + "@types/ws": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.1.tgz", + "integrity": "sha512-EzH8k1gyZ4xih/MaZTXwT2xOkPiIMSrhQ9b8wrlX88L0T02eYsddatQlwVFlEPyEqV0ChpdpNnE51QPH6NVT4Q==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/node": "*" + } + }, "abstract-leveldown": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", @@ -72,14 +101,14 @@ } }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "ansi-regex": { @@ -368,12 +397,12 @@ }, "babel-plugin-syntax-async-functions": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=" }, "babel-plugin-syntax-exponentiation-operator": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=" }, "babel-plugin-syntax-trailing-function-commas": { @@ -756,7 +785,7 @@ }, "babelify": { "version": "7.3.0", - "resolved": "http://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", + "resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", "requires": { "babel-core": "^6.0.14", @@ -834,7 +863,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "requires": { "buffer-xor": "^1.0.3", @@ -864,6 +893,15 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, + "bufferutil": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz", + "integrity": "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==", + "dev": true, + "requires": { + "node-gyp-build": "~3.7.0" + } + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -886,7 +924,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { "ansi-styles": "^2.2.1", @@ -940,11 +978,6 @@ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -964,6 +997,12 @@ "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -988,6 +1027,12 @@ "safe-buffer": "~5.1.1" } }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true + }, "core-js": { "version": "2.5.7", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", @@ -1000,7 +1045,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "requires": { "cipher-base": "^1.0.1", @@ -1012,7 +1057,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "requires": { "cipher-base": "^1.0.3", @@ -1234,7 +1279,7 @@ }, "eth-json-rpc-middleware": { "version": "1.6.0", - "resolved": "http://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz", + "resolved": "https://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz", "integrity": "sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q==", "requires": { "async": "^2.5.0", @@ -1266,7 +1311,7 @@ "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz", "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799", + "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "ethereumjs-util": "^5.1.1" } }, @@ -1339,7 +1384,7 @@ }, "web3-provider-engine": { "version": "13.8.0", - "resolved": "http://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz", + "resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz", "integrity": "sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ==", "requires": { "async": "^2.5.0", @@ -1374,8 +1419,35 @@ "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799", "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^5.0.0" + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + } } }, "ethereumjs-account": { @@ -1433,6 +1505,19 @@ "rlp": "^2.0.0", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" + }, + "dependencies": { + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + } } }, "ethereumjs-vm": { @@ -1502,9 +1587,9 @@ } }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" }, "fast-json-stable-stringify": { "version": "2.0.0", @@ -1567,6 +1652,12 @@ "mime-types": "^2.1.12" } }, + "formidable": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", + "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", + "dev": true + }, "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", @@ -1651,11 +1742,11 @@ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" }, "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "requires": { - "ajv": "^5.3.0", + "ajv": "^6.5.5", "har-schema": "^2.0.0" } }, @@ -1884,6 +1975,11 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" }, + "jsbi": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-2.0.5.tgz", + "integrity": "sha512-TzO/62Hxeb26QMb4IGlI/5X+QLr9Uqp1FPkwp2+KOICW+Q+vSuFj61c8pkT6wAns4WcK56X7CmSHhJeDGWOqxQ==" + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -1926,9 +2022,9 @@ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stable-stringify": { "version": "1.0.1", @@ -1945,12 +2041,12 @@ }, "json5": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" }, "jsonfile": { "version": "2.4.0", - "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "requires": { "graceful-fs": "^4.1.6" @@ -1973,9 +2069,9 @@ } }, "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.0.0.tgz", + "integrity": "sha512-rKe/lRr0KGhjoz97cwg+oeT1Rj/Y4cjae6glArioUC8JBF9ROGZctwIaaruM7d7naovME4Q8WcQSO908A8qcyQ==", "requires": { "bindings": "^1.2.1", "inherits": "^2.0.3", @@ -2014,7 +2110,7 @@ }, "level-iterator-stream": { "version": "1.3.1", - "resolved": "http://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", "requires": { "inherits": "^2.0.1", @@ -2030,7 +2126,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { "core-util-is": "~1.0.0", @@ -2067,7 +2163,7 @@ }, "readable-stream": { "version": "1.0.34", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { "core-util-is": "~1.0.0", @@ -2114,7 +2210,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "requires": { "graceful-fs": "^4.1.2", @@ -2208,22 +2304,34 @@ "dependencies": { "async": { "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" } } }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "mime": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", + "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==", + "dev": true + }, "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" }, "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "version": "2.1.22", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", + "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", "requires": { - "mime-db": "~1.37.0" + "mime-db": "~1.38.0" } }, "min-document": { @@ -2254,12 +2362,12 @@ }, "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -2296,9 +2404,15 @@ }, "node-fetch": { "version": "2.1.2", - "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=" }, + "node-gyp-build": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", + "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "dev": true + }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -2350,7 +2464,7 @@ }, "os-locale": { "version": "1.4.0", - "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "requires": { "lcid": "^1.0.0" @@ -2479,14 +2593,14 @@ "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "qs": { "version": "6.5.2", @@ -2514,7 +2628,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", @@ -2720,7 +2834,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "requires": { "inherits": "^2.0.1", @@ -2789,9 +2903,9 @@ "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==" }, "sshpk": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.1.tgz", - "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -2834,7 +2948,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { "ansi-regex": "^2.0.0" @@ -2856,6 +2970,57 @@ "is-hex-prefixed": "1.0.0" } }, + "superagent": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-4.1.0.tgz", + "integrity": "sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==", + "dev": true, + "requires": { + "component-emitter": "^1.2.0", + "cookiejar": "^2.1.2", + "debug": "^4.1.0", + "form-data": "^2.3.3", + "formidable": "^1.2.0", + "methods": "^1.1.1", + "mime": "^2.4.0", + "qs": "^6.6.0", + "readable-stream": "^3.0.6" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + }, + "readable-stream": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", + "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", @@ -2887,14 +3052,14 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } }, "through": { "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "through2": { @@ -2918,6 +3083,13 @@ "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } } }, "treeify": { @@ -2991,6 +3163,27 @@ "integrity": "sha512-+81MUSyX+BaSo+u2RbozuQk/UWx6hfG0a5gHu4ANEM4sU96XbuIyAB+rWBW1u70c6a5QuZfuYICn3s2UjuHUpA==", "dev": true }, + "uWebSockets.js": { + "version": "github:uNetworking/uWebSockets.js#d96159d2ffc1517cdab39fe169d88dd55a2aeba7", + "from": "github:uNetworking/uWebSockets.js#v15.8.0" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "utf-8-validate": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", + "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", + "dev": true, + "requires": { + "node-gyp-build": "~3.7.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -3045,6 +3238,16 @@ "ws": "^5.1.1", "xhr": "^2.2.0", "xtend": "^4.0.1" + }, + "dependencies": { + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "requires": { + "async-limiter": "~1.0.0" + } + } } }, "websocket": { @@ -3081,7 +3284,7 @@ }, "whatwg-fetch": { "version": "2.0.4", - "resolved": "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" }, "which-module": { @@ -3096,7 +3299,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "requires": { "string-width": "^1.0.1", @@ -3109,9 +3312,10 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", + "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", + "dev": true, "requires": { "async-limiter": "~1.0.0" } @@ -3144,7 +3348,7 @@ }, "yargs": { "version": "4.8.1", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", "requires": { "cliui": "^3.2.0", @@ -3165,7 +3369,7 @@ }, "yargs-parser": { "version": "2.4.1", - "resolved": "http://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", "requires": { "camelcase": "^3.0.0", diff --git a/package.json b/package.json index 9ee22f33f6..625e92dd6a 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,12 @@ }, "dependencies": { "@types/ethereum-protocol": "^1.0.0", + "@types/superagent": "^4.1.1", "@types/web3-provider-engine": "^14.0.0", "ethereumjs-vm": "2.4.0", + "jsbi": "^2.0.5", + "keccak": "2.0.0", + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.8.0", "web3-provider-engine": "14.1.0", "websocket": "1.0.28", "websocket-as-promised": "0.9.0" @@ -27,9 +31,14 @@ "@types/mocha": "^5.2.5", "@types/node": "^10.12.0", "@types/web3": "^1.0.10", + "@types/ws": "^6.0.1", + "bufferutil": "^4.0.1", "mocha": "^5.2.0", + "superagent": "4.1.0", "ts-node": "^7.0.1", - "typescript": "^3.1.3" + "typescript": "^3.1.3", + "utf-8-validate": "^5.0.2", + "ws": "^6.2.0" }, "optionalDependencies": {}, "repository": { diff --git a/src/engine.ts b/src/engine.ts index 215f5976d0..2d5bdd76d6 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -1,177 +1,19 @@ -import {EventEmitter} from "events"; +import ILedger from "./interfaces/ledger"; -ProviderEngine - -export default class ProviderEngine extends EventEmitter { - public constructor(opts: object){ - super(); - - this.setMaxListeners(30) - // parse options - opts = opts || {} - - // block polling - const directProvider = { sendAsync: self._handleAsync.bind(self) } - const blockTrackerProvider = opts.blockTrackerProvider || directProvider - this._blockTracker = opts.blockTracker || new EthBlockTracker({ - provider: blockTrackerProvider, - pollingInterval: opts.pollingInterval || 4000, - }) - - // handle new block - this._blockTracker.on('block', (jsonBlock) => { - const bufferBlock = toBufferBlock(jsonBlock) - this._setCurrentBlock(bufferBlock) - }) - - // emit block events from the block tracker - this._blockTracker.on('block', self.emit.bind(self, 'rawBlock')) - this._blockTracker.on('sync', self.emit.bind(self, 'sync')) - this._blockTracker.on('latest', self.emit.bind(self, 'latest')) - - // set initialization blocker - this._ready = new Stoplight() - // unblock initialization after first block - this._blockTracker.once('block', () => { - this._ready.go() - }) - // local state - this.currentBlock = null - this._providers = [] - } - - - // public - public start(cb = noop){ - // start block polling - this._blockTracker.start().then(cb).catch(cb) - } - - public stop(){ - // stop block polling - this._blockTracker.stop() - } - - public addProvider(source){ - this._providers.push(source) - source.setEngine(this) - } - - public send(payload){ - throw new Error('Web3ProviderEngine does not support synchronous requests.'); - } - - - public sendAsync (payload, cb) { - this._ready.await(function(){ - - if (Array.isArray(payload)) { - // handle batch - map(payload, this._handleAsync.bind(self), cb) - } else { - // handle single - this._handleAsync(payload, cb) - } - - }) - } - -// private - - private _handleAsync (payload, finished) { - var self = this - var currentProvider = -1 - var result = null - var error = null - - var stack = [] - - next() - - function next(after) { - currentProvider += 1 - stack.unshift(after) - - // Bubbled down as far as we could go, and the request wasn't - // handled. Return an error. - if (currentProvider >= self._providers.length) { - end(new Error('Request for method "' + payload.method + '" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.')) - } else { - try { - var provider = self._providers[currentProvider] - provider.handleRequest(payload, next, end) - } catch (e) { - end(e) +export default class Engine { + private ledger:ILedger; + constructor(ledger: ILedger){ + if (!ledger){ + throw new Error("yah, that's not right"); } - } + this.ledger = ledger; } - - function end(_error, _result) { - error = _error - result = _result - - eachSeries(stack, function(fn, callback) { - - if (fn) { - fn(error, result, callback) - } else { - callback() + public async send(method: string, params: Array): Promise { + if(this.ledger.__proto__.hasOwnProperty(method)){ + const fn = this.ledger[method]; + if (typeof fn === "function") { + return this.ledger[method].apply(this.ledger, params); + } } - }, function() { - // console.log('COMPLETED:', payload) - // console.log('RESULT: ', result) - - var resultObj = { - id: payload.id, - jsonrpc: payload.jsonrpc, - result: result - } - - if (error != null) { - resultObj.error = { - message: error.stack || error.message || error, - code: -32000 - } - // respond with both error formats - finished(error, resultObj) - } else { - finished(null, resultObj) - } - }) } - } - - // - // from remote-data - // - - private _setCurrentBlock(block){ - this.currentBlock = block - this.emit('block', block) - } -} -// util - -function toBufferBlock (jsonBlock) { - return { - number: ethUtil.toBuffer(jsonBlock.number), - hash: ethUtil.toBuffer(jsonBlock.hash), - parentHash: ethUtil.toBuffer(jsonBlock.parentHash), - nonce: ethUtil.toBuffer(jsonBlock.nonce), - mixHash: ethUtil.toBuffer(jsonBlock.mixHash), - sha3Uncles: ethUtil.toBuffer(jsonBlock.sha3Uncles), - logsBloom: ethUtil.toBuffer(jsonBlock.logsBloom), - transactionsRoot: ethUtil.toBuffer(jsonBlock.transactionsRoot), - stateRoot: ethUtil.toBuffer(jsonBlock.stateRoot), - receiptsRoot: ethUtil.toBuffer(jsonBlock.receiptRoot || jsonBlock.receiptsRoot), - miner: ethUtil.toBuffer(jsonBlock.miner), - difficulty: ethUtil.toBuffer(jsonBlock.difficulty), - totalDifficulty: ethUtil.toBuffer(jsonBlock.totalDifficulty), - size: ethUtil.toBuffer(jsonBlock.size), - extraData: ethUtil.toBuffer(jsonBlock.extraData), - gasLimit: ethUtil.toBuffer(jsonBlock.gasLimit), - gasUsed: ethUtil.toBuffer(jsonBlock.gasUsed), - timestamp: ethUtil.toBuffer(jsonBlock.timestamp), - transactions: jsonBlock.transactions, - } -} +} \ No newline at end of file diff --git a/src/interfaces/ledger.ts b/src/interfaces/ledger.ts new file mode 100644 index 0000000000..64ac573000 --- /dev/null +++ b/src/interfaces/ledger.ts @@ -0,0 +1,4 @@ +export default interface ILedger { + options: any; + readonly [key: string]: (params?: Array) => Promise; +} \ No newline at end of file diff --git a/src/ledgers/ethereum/ethereum.js b/src/ledgers/ethereum/ethereum.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/ledgers/ethereum/ethereum.ts b/src/ledgers/ethereum/ethereum.ts new file mode 100644 index 0000000000..0d1a0d5baa --- /dev/null +++ b/src/ledgers/ethereum/ethereum.ts @@ -0,0 +1,35 @@ +const createKeccakHash = require("keccak"); +import ILedger from "../../interfaces/ledger"; +const hash = createKeccakHash("keccak256"); +import JSBI from "jsbi"; + +export default class Ethereum implements ILedger{ + readonly [index: string]: (...args: any) => Promise<{}>; + + options: any; + private _netVersion: any; + constructor(options: any){ + this.options = options; + this._netVersion = (this.options.networkId || Date.now()).toString(); + } + + async net_version(): Promise { + return this._netVersion; + } + + async net_listening(): Promise { + return true; + } + + async net_peerCount(): Promise { + return JSBI.BigInt(0); + } + + async web3_clientVersion(): Promise { + return "EthereumJS canache-core/v" + 0 + "/ethereum-js"; + }; + + async web3_sha3(string: string): Promise { + return hash(string).digest(); + }; +} \ No newline at end of file diff --git a/src/options/options.ts b/src/options/options.ts index 70002e6d94..8cfc51368f 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -1,12 +1,16 @@ import Account from "../types/account"; import HexData from "../types/hex-data"; import HexQuantity from "../types/hex-quantity"; +import ILedger from "../interfaces/ledger"; +import Ethereum from "../ledgers/ethereum/ethereum"; +import JSBI from "jsbi"; interface Logger { log(message?: any, ...optionalParams: any[]): void; } export default class Options { + public ledger: ILedger = new Ethereum({networkId: Date.now()}); /** * Array of Accounts. Each object should have a balance key with a hexadecimal * value. The key secretKey can also be specified, which represents the @@ -39,12 +43,12 @@ export default class Options { /** * The default account balance, specified in ether. Defaults to `100` ether */ - public default_balance_ether: number = 100 + public default_balance_ether: JSBI = JSBI.BigInt(100) /** * Number of accounts to generate at startup. Default to `10`. */ - public total_accounts: number = 10 + public total_accounts: JSBI = JSBI.BigInt(10) /** * When a string, same as --fork option above. Can also be a Web3 Provider @@ -58,12 +62,12 @@ export default class Options { * sign and a block number, the block number in the fork parameter takes * precedence. */ - public fork_block_number: string | number = null + public fork_block_number: string | JSBI = null /** * Same as --networkId option above. */ - public network_id: number = null + public network_id: number = Date.now() /** * Date that the first block should start. Use this feature, along with the @@ -79,7 +83,7 @@ export default class Options { /** * Array of addresses or address indexes specifying which accounts should be unlocked. */ - public unlocked_accounts: Array = null + public unlocked_accounts: Array = null /** * Specify a path to a directory to save the chain database. If a database diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index f0c7442da8..ea7e7eadf0 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -1,9 +1,8 @@ import Options from "./options"; -import Subprovider from "web3-provider-engine/subproviders/subprovider"; export default class ProviderOptions extends Options { /** * Array of strings to installed subproviders */ - public subProviders: Subprovider[] + public subProviders: Array } diff --git a/src/provider.ts b/src/provider.ts index cef276d11a..2bf14aacc4 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,43 +1,75 @@ import Engine from "./engine"; -import RequestProcessor from "./utils/request-processors"; +import RequestProcessor from "./utils/request-processor"; import _ProviderOptions from "./options/provider-options"; import { EventEmitter } from "events"; -import {Provider as _Provider} from "ethereum-protocol"; +import Ethereum from "./ledgers/ethereum/ethereum" export type ProviderOptions = _ProviderOptions; export const ProviderOptions = _ProviderOptions; -/** - * - */ -export default class Provider extends EventEmitter implements _Provider { +interface Payload { + method: string + params: Array +} + +interface Callback { + (err: Error, response?: any): void; +} + +export default class Provider extends EventEmitter { private options: ProviderOptions; private engine: Engine; private requestProcessor: RequestProcessor; - constructor(options: ProviderOptions) { + constructor(options = new ProviderOptions()) { super(); this.options = options; - // set up our request processor to either use FIFO or or async requst processing + // set up our request processor to either use FIFO or or async request processing this.requestProcessor = new RequestProcessor(options.asyncRequestProcessing ? 1 : 0); + + this.engine = new Engine(options.ledger || new Ethereum({networkId: Date.now()})); } - public async send(payload: object, callback?: (err: Error, response?: any) => void): Promise { - const _send = this.sendAsync(payload); - if (callback) { - _send.catch(callback).then(callback.bind(this, null)); - return; - } - else { - return await _send; + public send(payload: Payload, callback?: Callback): void + public async send(method: string, params?: Array): Promise; + public async send(arg1: string | Payload, arg2?: any): Promise { + let method: string; + let params: Array; + let response: Promise<{}>; + const send = this.engine.send.bind(this.engine); + if (typeof arg1 === "string") { + method = arg1; + params = arg2; + response = this.requestProcessor.queue(send, method, params); + } else { + // handle backward compatibility with callback-style ganache-core + const payload: Payload = arg1 as Payload; + method = payload.method; + params = payload.params; + const callback = arg2; + + if (typeof callback !== "function") { + throw new Error( + "No callback provided to provider's send function. As of web3 1.0, provider.send " + + "is no longer synchronous and must be passed a callback as its final argument." + ); + } + + this.requestProcessor.queue(send, method, params).then((response: any)=>{ + callback(null, response); + }).catch(callback); + + response = undefined; } - } - public async sendAsync(payload: Array|object) { if (this.options.verbose) { - this.options.logger.log(" > " + JSON.stringify(payload, null, 2).split("\n").join("\n > ")); + this.options.logger.log(` > ${method}: ${JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); } - this.requestProcessor.queue(this.engine.send, payload); + return response; + } + + public sendAsync(payload: Payload, callback?: Callback): void { + this.send(payload, callback); } } diff --git a/src/server.ts b/src/server.ts index bc6b38434e..444f9cbdde 100644 --- a/src/server.ts +++ b/src/server.ts @@ -2,12 +2,182 @@ import _ServerOptions from "./options/server-options"; export type ServerOptions = _ServerOptions; export const ServerOptions = _ServerOptions; +import uWS, { HttpResponse, HttpRequest, RecognizedString, us_listen_socket } from "uWebSockets.js"; +import Provider from "./provider" +import ProviderOptions from "./options/provider-options"; +function rpcError(id: string, code: string, msg: any) { + return JSON.stringify({ + jsonrpc: "2.0", + id: id, + error: { + code: code, + message: msg + } + }); +} + +function sendResponse(response:HttpResponse, statusCode:number, data?: RecognizedString): void { + response + .writeStatus(statusCode.toString()) + .end(data); +} /** * */ export default class Server { + private _listenSocket: us_listen_socket; + private _app: any; + private _provider: Provider; constructor(options: ServerOptions) { + this._provider = new Provider(options as ProviderOptions); + + const app = this._app = uWS.App({}); + app + .ws("/", { + /* Options */ + compression: 0, + maxPayloadLength: 16 * 1024 * 1024, + idleTimeout: 10, + /* Handlers */ + open: (ws, req) => { + console.log('A WebSocket connected via URL: ' + req.getUrl() + '!'); + }, + message: (ws, message: ArrayBuffer, isBinary) => { + const payload = JSON.parse(Buffer.from(message) as any); + this._provider.send(payload.method as string, payload.params as Array).then((result:any) => { + //this._provider.send(payload.method as string, payload.params as Array).then((result:any) => { + /* Ok is false if backpressure was built up, wait for drain */ + const json = { + "id": payload.id, + "jsonrpc":"2.0", + "result": result + }; + let ok = ws.send(JSON.stringify(json), false, true); + }); + }, + drain: (ws) => { + console.log('WebSocket backpressure: ' + ws.getBufferedAmount()); + }, + close: (ws, code, message) => { + console.log('WebSocket closed'); + } + }) + .post("/", (response: HttpResponse, request: HttpRequest) => { + createCORSResponseHeaders("POST", response, request); + + let buffer: Buffer; + response.onData(async (ab: ArrayBuffer, isLast: boolean) => { + const chunk = Buffer.from(ab); + if(isLast) { + let payload: any; + try { + payload = JSON.parse((buffer ? Buffer.concat([buffer, chunk]) : chunk) as any); + } catch (e) { + response.writeHeader("Content-Type", "text/plain"); + sendResponse(response, 400, "400 Bad Request"); + return; + } + const method = payload.method; + + // http connections do not support subscriptions + if (method === "eth_subscribe" || method === "eth_unsubscribe") { + response.writeHeader("Content-Type", "application/json"); + sendResponse(response, 400, rpcError(payload.id, "-32000", "notifications not supported")); + } else { + this._provider.send(payload.method as string, payload.params as Array).then((result:any) => { + if(!response.aborted){ + const json = { + "id": payload.id, + "jsonrpc":"2.0", + "result": result + }; + response.writeHeader("Content-Type", "application/json"); + sendResponse(response, 200, JSON.stringify(json)); + } + }); + } + } else { + if (buffer) { + buffer = Buffer.concat([buffer, chunk]); + } else { + buffer = Buffer.concat([chunk]); + } + } + }); + response.onAborted(() => { + response.aborted = true; + }); + }).options("/", (response: HttpResponse, request: HttpRequest) => { + createCORSResponseHeaders("OPTIONS", response, request); + sendResponse(response, 204); + }).any("/*", (response: HttpResponse) => { + response.writeHeader("Content-Type", "text/plain"); + sendResponse(response, 400, "400 Bad Request"); + }); + } + + async listen(port: number, callback?: () => void): Promise { + this._listenSocket = await new Promise((resolve) => { + this._app.listen(port, resolve); + }); + if (typeof callback === "function") { + callback(); + } + } + async close(): Promise { + if (this._listenSocket) { + uWS.us_listen_socket_close(this._listenSocket); + this._listenSocket = undefined; + } } } + + +function createCORSResponseHeaders(method: string, response: HttpResponse, request: HttpRequest) { + // https://fetch.spec.whatwg.org/#http-requests + const origin = request.getHeader("origin"); + const isCORSRequest = true || origin !== ""; + if (isCORSRequest) { + // OPTIONS preflight requests need a little extra treatment + if (method === "OPTIONS") { + // we only allow POST requests, so it doesn't matter which method the request is asking for + response.writeHeader("Access-Control-Allow-Methods", "POST"); + // echo all requested access-control-request-headers back to the response + if (request.hasOwnProperty("access-control-request-headers")) { + const acrh = request.getHeader("access-control-request-headers"); + response.writeHeader("Access-Control-Allow-Headers", acrh); + } + // Safari needs Content-Length = 0 for a 204 response otherwise it hangs forever + // https://github.com/expressjs/cors/pull/121#issue-130260174 + response.writeHeader("Content-Length", "0"); + + // Make browsers and compliant clients cache the OPTIONS preflight response for 10 + // minutes (this is the maximum time Chromium allows) + response.writeHeader("Access-Control-Max-Age", "600"); // seconds + } + + // From the spec: https://fetch.spec.whatwg.org/#http-responses + // "For a CORS-preflight request, request’s credentials mode is always "omit", + // but for any subsequent CORS requests it might not be. Support therefore + // needs to be indicated as part of the HTTP response to the CORS-preflight request as well.", so this + // header is added to all requests. + // Additionally, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials, + // states that there aren't any HTTP Request headers that indicate you whether or not Request.withCredentials + // is set. Because web3@1.0.0-beta.35-? always sets `request.withCredentials = true` while Safari requires it be + // returned even when no credentials are set in the browser this header must always be return on all requests. + // (I've found that Chrome and Firefox don't actually require the header when credentials aren't set) + // Regression Commit: https://github.com/ethereum/web3.js/pull/1722 + // Open Web3 Issue: https://github.com/ethereum/web3.js/issues/1802 + response.writeHeader("Access-Control-Allow-Credentials", "true"); + + // From the spec: "It cannot be reliably identified as participating in the CORS protocol + // as the `Origin` header is also included for all requests whose method is neither + // `GET` nor `HEAD`." + // Explicitly set the origin instead of using *, since credentials + // can't be used in conjunction with *. This will always be set + /// for valid preflight requests. + response.writeHeader("Access-Control-Allow-Origin", origin); + } +} \ No newline at end of file diff --git a/src/types/hex-quantity.ts b/src/types/hex-quantity.ts index 02535308df..bff8bd6566 100644 --- a/src/types/hex-quantity.ts +++ b/src/types/hex-quantity.ts @@ -1,35 +1,28 @@ -export default class HexQuantity { - private data: any; +import JSBI from "jsbi"; - constructor(quantity: Buffer | number | string) { +export default class HexQuantity { + private data: JSBI; + constructor(quantity: JSBI | Buffer | number | string) { if (quantity instanceof Buffer) { - // TODO: totally wrong - this.data = quantity; + this.data = JSBI.BigInt(quantity.toString("hex")); + } else if (quantity instanceof JSBI) { + this.data = quantity; } else { switch (typeof quantity) { case "number": - this.data = quantity; - break; case "string": - if (quantity.indexOf("0x") !== -1) { - throw new TypeError("Invalid hex data"); - } else { - // TODO: handle big numbers - const num = Number(quantity); - if (isNaN(num)) { - throw new Error("quantity string is not a number.") - } else { - this.data = num; - } - } + this.data = JSBI.BigInt(quantity); break; default: throw new TypeError("quantity is not a Buffer, number, or string"); } } } - toString() { + toBigNum(): JSBI { return this.data; } + toString(): string { + return `$0x${this.data.toString(16)}`; + } } diff --git a/src/utils/queue.ts b/src/utils/queue.ts deleted file mode 100644 index 6d019860a8..0000000000 --- a/src/utils/queue.ts +++ /dev/null @@ -1,15 +0,0 @@ -export default class Queue { - private queue: Array - public get length(): number { - return this.queue.length; - } - constructor() { - - } - public push(args): Promise{ - return new Promise((resolve, reject) => { - resolve(); - }); - setImmediate() - } -} diff --git a/src/utils/request-processor.ts b/src/utils/request-processor.ts index 83f3ee7937..e06699aa94 100644 --- a/src/utils/request-processor.ts +++ b/src/utils/request-processor.ts @@ -1,4 +1,3 @@ -// todo: make this better export default class RequestProcessor { public limit: number = 0 public pending: any[] = []; @@ -45,10 +44,9 @@ export default class RequestProcessor { this._processing = false; } - public queue = async function(fn: ({}) => Promise<{}>, ...args: any[]): Promise<{}> { - const self = this; + public queue = async function(fn: (...args: any[]) => Promise<{}>, ...args: any[]): Promise<{}> { const executor = (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { - fn.apply(self, args).then(resolve); + return fn.apply(null, args).then(resolve).catch(reject); } this.pending.push(executor); this.process(); diff --git a/test/interface.ts b/test/interface.ts index 7bfd147a05..ab6703f723 100644 --- a/test/interface.ts +++ b/test/interface.ts @@ -3,9 +3,9 @@ import * as assert from "assert"; describe("interface", () => { it("has an interface", ()=>{ - assert(Ganache.server); - assert(Ganache.provider); - assert(Ganache.Server); - assert(Ganache.Provider); + assert.ok(Ganache.server); + assert.ok(Ganache.provider); + assert.ok(Ganache.Server); + assert.ok(Ganache.Provider); }) }); diff --git a/test/provider.ts b/test/provider.ts new file mode 100644 index 0000000000..845da2c925 --- /dev/null +++ b/test/provider.ts @@ -0,0 +1,10 @@ +import Ganache from "../index" +import * as assert from "assert"; + +describe("provider", () => { + it("returns things", async ()=>{ + const p = Ganache.provider(); + const version = await p.send("net_version"); + assert.ok(version); + }); +}); diff --git a/test/server.ts b/test/server.ts new file mode 100644 index 0000000000..45a109d002 --- /dev/null +++ b/test/server.ts @@ -0,0 +1,52 @@ +import Ganache from "../index" +import * as assert from "assert"; +import request from "superagent"; +import WebSocket from "ws"; +import Server from "../src/server"; +import { ServerOptions } from "../src/server"; + + +describe("server", () => { + const jsonRpcJson: any = { + jsonrpc: "2.0", + id: "1", + method: "net_version", + params: [] + }; + let s: Server; + beforeEach("setup", async ()=>{ + s = Ganache.server(); + await s.listen(8545); + }) + it("returns things", async ()=>{ + const s = Ganache.server(); + await s.listen(8545); + const response = await request + .post('http://127.0.0.1:8545') + .send(jsonRpcJson) + .set('accept', 'json'); + const json = JSON.stringify(response.text) + assert.ok(json); + }); + + it("returns things over a websocket", async ()=>{ + const s = Ganache.server({ + network_id: 1234 + } as ServerOptions); + await s.listen(8545); + const ws = new WebSocket('ws://127.0.0.1:8545'); + + const result: any = await new Promise((resolve) => { + ws.on("open", function open() { + ws.send(JSON.stringify(jsonRpcJson)); + }); + ws.on('message', resolve); + }); + const json = JSON.parse(result); + assert.ok(json); + }) + + afterEach("teardown", ()=>{ + s && s.close(); + }) +}); From b5447a8e6efd38530d25071518f487bafc811993 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 27 Mar 2019 14:41:38 -0400 Subject: [PATCH 004/691] UPdates --- npm-shrinkwrap.json | 3960 ++++++++--------- package.json | 38 +- src/options/options.ts | 79 +- src/options/provider-options.ts | 13 +- src/options/server-options.ts | 25 +- src/provider.ts | 29 +- src/server.ts | 363 +- test/server.ts | 88 +- tsconfig.json | 2 +- .../subproviders/subprovider.d.ts | 13 - 10 files changed, 2325 insertions(+), 2285 deletions(-) delete mode 100644 typings/web3-provider-engine/subproviders/subprovider.d.ts diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 888d48a587..1a8993cb60 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4,39 +4,16 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@types/bn.js": { - "version": "4.11.2", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.2.tgz", - "integrity": "sha512-OC3E/26kp/+JSOE4eJo86KivQM95MKPgnkug3uSCt+pXTWPovVBhixL1GwK1MLLsxgR3uZmTGjQQd8uKJEnurA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/chai": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz", - "integrity": "sha512-CBk7KTZt3FhPsEkYioG6kuCIpWISw+YI8o+3op4+NXwTpvAPxE1ES8+PY8zfaK2L98b1z5oq03UHa4VYpeUxnw==", - "dev": true - }, "@types/cookiejar": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz", - "integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==" - }, - "@types/ethereum-protocol": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/ethereum-protocol/-/ethereum-protocol-1.0.0.tgz", - "integrity": "sha512-3DiI3Zxf81CgX+VhxNNFJBv/sfr1BFBKQK2sQ85hU9FwWJJMWV5gRDV79OUNShiwj3tYYIezU94qpucsb3dThQ==", - "requires": { - "bignumber.js": "7.2.1" - } + "integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==", + "dev": true }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" }, "@types/mocha": { "version": "5.2.5", @@ -53,33 +30,19 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.1.tgz", "integrity": "sha512-NetXrraTWPcdGG6IwYJhJ5esUGx8AYNiozbc1ENWEsF6BsD4JmNODJczI6Rm1xFPVp6HZESds9YCfqz4zIsM6A==", + "dev": true, "requires": { "@types/cookiejar": "*", "@types/node": "*" } }, - "@types/underscore": { - "version": "1.8.9", - "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.8.9.tgz", - "integrity": "sha512-vfzZGgZKRFy7KEWcBGfIFk+h6B+thDCLfkD1exMBMRlUsx2icA+J6y4kAbZs/TjSTeY1duw89QUU133TSzr60Q==", - "dev": true - }, - "@types/web3": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@types/web3/-/web3-1.0.10.tgz", - "integrity": "sha512-7rje36GsWAz1cow7/2PB4FAvDpMCAmSgDGSAmhB+Qi9pE/ROMQvzlvGAkDSwkKZ+WAK68WreJFwc3PLCawpYXw==", - "dev": true, - "requires": { - "@types/bn.js": "*", - "@types/underscore": "*" - } - }, - "@types/web3-provider-engine": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@types/web3-provider-engine/-/web3-provider-engine-14.0.0.tgz", - "integrity": "sha512-yHr8mX2SoX3JNyfqdLXdO1UobsGhfiwSgtekbVxKLQrzD7vtpPkKbkIVsPFOhvekvNbPsCmDyeDCLkpeI9gSmA==", + "@types/uws": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", + "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", "requires": { - "@types/ethereum-protocol": "*" + "@types/events": "*", + "@types/node": "*" } }, "@types/ws": { @@ -98,54 +61,84 @@ "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", "requires": { "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } } }, - "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "arg": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", + "integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==", "dev": true }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, "requires": { - "safer-buffer": "~2.1.0" + "sprintf-js": "~1.0.2" } }, - "assert-plus": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "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==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "assign-symbols": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true }, "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "requires": { - "lodash": "^4.17.10" + "lodash": "^4.17.11" } }, "async-eventemitter": { @@ -159,670 +152,93 @@ "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "dev": true }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, "requires": { "chalk": "^1.1.3", "esutils": "^2.0.2", "js-tokens": "^3.0.2" } }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - } - } + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" + "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": { - "jsesc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - } - } - }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", - "requires": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", - "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", - "requires": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=" - }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=" - }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=" - }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", - "requires": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", - "requires": { - "babel-helper-define-map": "^6.24.1", - "babel-helper-function-name": "^6.24.1", - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-helper-replace-supers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", - "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } - }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", - "requires": { - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "requires": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - } - }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", - "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", - "requires": { - "regenerator-transform": "^0.10.0" - } - }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-preset-env": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", - "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", - "requires": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-syntax-trailing-function-commas": "^6.22.0", - "babel-plugin-transform-async-to-generator": "^6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.23.0", - "babel-plugin-transform-es2015-classes": "^6.23.0", - "babel-plugin-transform-es2015-computed-properties": "^6.22.0", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", - "babel-plugin-transform-es2015-for-of": "^6.23.0", - "babel-plugin-transform-es2015-function-name": "^6.22.0", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-umd": "^6.23.0", - "babel-plugin-transform-es2015-object-super": "^6.22.0", - "babel-plugin-transform-es2015-parameters": "^6.23.0", - "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", - "babel-plugin-transform-exponentiation-operator": "^6.22.0", - "babel-plugin-transform-regenerator": "^6.22.0", - "browserslist": "^3.2.6", - "invariant": "^2.2.2", - "semver": "^5.3.0" - } - }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", - "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "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==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } }, - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "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==", + "dev": true, "requires": { - "source-map": "^0.5.6" + "kind-of": "^6.0.0" } - } - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, "requires": { - "ms": "2.0.0" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babelify": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz", - "integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=", - "requires": { - "babel-core": "^6.0.14", - "object-assign": "^4.0.0" - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" - }, - "backoff": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz", - "integrity": "sha1-9hbtqdPktmuMp/ynn2lXIsX44m8=", - "requires": { - "precond": "0.2" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bignumber.js": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", - "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" - }, "bindings": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", @@ -845,11 +261,41 @@ "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", "concat-map": "0.0.1" } }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -874,19 +320,11 @@ "safe-buffer": "^5.0.1" } }, - "browserslist": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", - "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", - "requires": { - "caniuse-lite": "^1.0.30000844", - "electron-to-chromium": "^1.3.47" - } - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true }, "buffer-xor": { "version": "1.0.3", @@ -905,27 +343,37 @@ "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" - }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true }, - "caniuse-lite": { - "version": "1.0.30000898", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000898.tgz", - "integrity": "sha512-ytlTZqO4hYe4rNAJhMynUAIUI33jsP2Bb1two/9OVC39wZjPZ8exIO0eCLw5mqAtegOGiGF0kkTWTn3B02L+mw==" + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "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" + } }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "camelcase": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", + "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", + "dev": true }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, "requires": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -937,7 +385,8 @@ "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true } } }, @@ -949,11 +398,6 @@ "functional-red-black-tree": "^1.0.1" } }, - "chnl": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/chnl/-/chnl-0.4.1.tgz", - "integrity": "sha512-74sahZgoyc266kwg3OZv1O1aaaGjGAOPx4J2crt5lm+Dmo8o0b0D+tHdF60EQSmym77FFPKMRZnIPb3vAKT5Mw==" - }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -963,30 +407,93 @@ "safe-buffer": "^5.0.1" } }, + "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==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true }, "combined-stream": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -1006,26 +513,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "requires": { - "safe-buffer": "~5.1.1" - } + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "cookiejar": { "version": "2.1.2", @@ -1033,10 +522,11 @@ "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", "dev": true }, - "core-js": { - "version": "2.5.7", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", - "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -1068,41 +558,39 @@ "sha.js": "^2.4.8" } }, - "cross-fetch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.2.tgz", - "integrity": "sha1-pH/09/xxLauo9qaVoRyUhEDUVyM=", - "requires": { - "node-fetch": "2.1.2", - "whatwg-fetch": "2.0.4" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, "requires": { - "assert-plus": "^1.0.0" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true }, - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" + "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=", + "dev": true }, "deferred-leveldown": { "version": "1.2.2", @@ -1116,27 +604,63 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, "requires": { "object-keys": "^1.0.12" } }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=" + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "requires": { - "repeating": "^2.0.0" - } + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true }, "diff": { "version": "3.5.0", @@ -1144,11 +668,6 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "dom-walk": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", - "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=" - }, "drbg.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", @@ -1159,20 +678,6 @@ "create-hmac": "^1.1.4" } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "electron-to-chromium": { - "version": "1.3.81", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.81.tgz", - "integrity": "sha512-+rym2xtzwPWmoi8AYRrCdW65QOT0vfUHjZb5mjgh0VLyj31pGM3CpP3znKhQNBzQaWujR/KEl/mfC2lnKYgADA==" - }, "elliptic": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", @@ -1187,18 +692,11 @@ "minimalistic-crypto-utils": "^1.0.0" } }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "requires": { - "iconv-lite": "~0.4.13" - } - }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, "requires": { "once": "^1.4.0" } @@ -1211,30 +709,25 @@ "prr": "~1.0.1" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, "requires": { - "es-to-primitive": "^1.1.1", + "es-to-primitive": "^1.2.0", "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" } }, "es-to-primitive": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -1244,193 +737,44 @@ "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=" + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" - }, - "eth-block-tracker": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz", - "integrity": "sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug==", - "requires": { - "eth-query": "^2.1.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.3", - "ethjs-util": "^0.1.3", - "json-rpc-engine": "^3.6.0", - "pify": "^2.3.0", - "tape": "^4.6.3" - } - }, - "eth-json-rpc-infura": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/eth-json-rpc-infura/-/eth-json-rpc-infura-3.1.2.tgz", - "integrity": "sha512-IuK5Iowfs6taluA/3Okmu6EfZcFMq6MQuyrUL1PrCoJstuuBr3TvVeSy3keDyxfbrjFB34nCo538I8G+qMtsbw==", - "requires": { - "cross-fetch": "^2.1.1", - "eth-json-rpc-middleware": "^1.5.0", - "json-rpc-engine": "^3.4.0", - "json-rpc-error": "^2.0.0", - "tape": "^4.8.0" - } - }, - "eth-json-rpc-middleware": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz", - "integrity": "sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q==", - "requires": { - "async": "^2.5.0", - "eth-query": "^2.1.2", - "eth-tx-summary": "^3.1.2", - "ethereumjs-block": "^1.6.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.2", - "ethereumjs-vm": "^2.1.0", - "fetch-ponyfill": "^4.0.0", - "json-rpc-engine": "^3.6.0", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "tape": "^4.6.3" - } - }, - "eth-query": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/eth-query/-/eth-query-2.1.2.tgz", - "integrity": "sha1-1nQdkAAQa1FRDHLbktY2VFam2l4=", - "requires": { - "json-rpc-random-id": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "eth-sig-util": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz", - "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", - "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git", - "ethereumjs-util": "^5.1.1" - } - }, - "eth-tx-summary": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/eth-tx-summary/-/eth-tx-summary-3.2.3.tgz", - "integrity": "sha512-1gZpA5fKarJOVSb5OUlPnhDQuIazqAkI61zlVvf5LdG47nEgw+/qhyZnuj3CUdE/TLTKuRzPLeyXLjaB4qWTRQ==", - "requires": { - "async": "^2.1.2", - "bn.js": "^4.11.8", - "clone": "^2.0.0", - "concat-stream": "^1.5.1", - "end-of-stream": "^1.1.0", - "eth-query": "^2.0.2", - "ethereumjs-block": "^1.4.1", - "ethereumjs-tx": "^1.1.1", - "ethereumjs-util": "^5.0.1", - "ethereumjs-vm": "2.3.4", - "through2": "^2.0.3", - "treeify": "^1.0.1", - "web3-provider-engine": "^13.3.2" - }, - "dependencies": { - "eth-block-tracker": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-2.3.1.tgz", - "integrity": "sha512-NamWuMBIl8kmkJFVj8WzGatySTzQPQag4Xr677yFxdVtIxACFbL/dQowk0MzEqIKk93U1TwY3MjVU6mOcwZnKA==", - "requires": { - "async-eventemitter": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", - "eth-query": "^2.1.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.3", - "ethjs-util": "^0.1.3", - "json-rpc-engine": "^3.6.0", - "pify": "^2.3.0", - "tape": "^4.6.3" - }, - "dependencies": { - "async-eventemitter": { - "version": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", - "from": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c", - "requires": { - "async": "^2.4.0" - } - } - } - }, - "ethereum-common": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", - "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==" - }, - "ethereumjs-vm": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.3.4.tgz", - "integrity": "sha512-Y4SlzNDqxrCO58jhp98HdnZVdjOqB+HC0hoU+N/DEp1aU+hFkRX/nru5F7/HkQRPIlA6aJlQp/xIA6xZs1kspw==", - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "ethereum-common": "0.2.0", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~1.7.0", - "ethereumjs-util": "^5.1.3", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.1.2", - "rustbn.js": "~0.1.1", - "safe-buffer": "^5.1.1" - } - }, - "web3-provider-engine": { - "version": "13.8.0", - "resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz", - "integrity": "sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ==", - "requires": { - "async": "^2.5.0", - "clone": "^2.0.0", - "eth-block-tracker": "^2.2.2", - "eth-sig-util": "^1.4.2", - "ethereumjs-block": "^1.2.2", - "ethereumjs-tx": "^1.2.0", - "ethereumjs-util": "^5.1.1", - "ethereumjs-vm": "^2.0.2", - "fetch-ponyfill": "^4.0.0", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "readable-stream": "^2.2.9", - "request": "^2.67.0", - "semaphore": "^1.0.3", - "solc": "^0.4.2", - "tape": "^4.4.0", - "xhr": "^2.2.0", - "xtend": "^4.0.1" - } - } - } + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true }, "ethereum-common": { "version": "0.0.18", "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=" }, - "ethereumjs-abi": { - "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799", - "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", + "ethereumjs-account": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", + "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", "requires": { - "bn.js": "^4.11.8", - "ethereumjs-util": "^6.0.0" + "ethereumjs-util": "^5.0.0", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" }, "dependencies": { "ethereumjs-util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", - "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", "requires": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", + "ethjs-util": "^0.1.3", "keccak": "^1.0.2", "rlp": "^2.0.0", "safe-buffer": "^5.1.1", @@ -1450,39 +794,49 @@ } } }, - "ethereumjs-account": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", - "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", - "requires": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, "ethereumjs-block": { - "version": "1.7.1", - "resolved": "http://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz", - "integrity": "sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.0.tgz", + "integrity": "sha512-Ye+uG/L2wrp364Zihdlr/GfC3ft+zG8PdHcRtsBFNNH1CkOhxOwdB8friBU85n89uRZ9eIMAywCq0F4CwT1wAw==", "requires": { "async": "^2.0.1", - "ethereum-common": "0.2.0", + "ethereumjs-common": "^1.1.0", "ethereumjs-tx": "^1.2.2", "ethereumjs-util": "^5.0.0", "merkle-patricia-tree": "^2.1.2" }, "dependencies": { - "ethereum-common": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.2.0.tgz", - "integrity": "sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA==" + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, "ethereumjs-common": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-0.4.1.tgz", - "integrity": "sha512-ywYGsOeGCsMNWso5Y4GhjWI24FJv9FK7+VyVKiQgXg8ZRDPXJ7F/kJ1CnjtkjTvDF4e0yqU+FWswlqR3bmZQ9Q==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.1.0.tgz", + "integrity": "sha512-LUmYkKV/HcZbWRyu3OU9YOevsH3VJDXtI6kEd8VZweQec+JjDGKCmAVKUyzhYUHqxRJu7JNALZ3A/b3NXOP6tA==" }, "ethereumjs-tx": { "version": "1.3.7", @@ -1491,16 +845,43 @@ "requires": { "ethereum-common": "^0.0.18", "ethereumjs-util": "^5.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + } } }, "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", "requires": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", + "ethjs-util": "0.1.6", "keccak": "^1.0.2", "rlp": "^2.0.0", "safe-buffer": "^5.1.1", @@ -1521,19 +902,19 @@ } }, "ethereumjs-vm": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.4.0.tgz", - "integrity": "sha512-MJ4lCWa5c6LhahhhvoDKW+YGjK00ZQn0RHHLh4L+WaH1k6Qv7/q3uTluew6sJGNCZdlO0yYMDXYW9qyxLHKlgQ==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz", + "integrity": "sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw==", "requires": { "async": "^2.1.2", "async-eventemitter": "^0.2.2", "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~1.7.0", - "ethereumjs-common": "~0.4.0", - "ethereumjs-util": "^5.2.0", + "ethereumjs-block": "~2.2.0", + "ethereumjs-common": "^1.1.0", + "ethereumjs-util": "^6.0.0", "fake-merkle-patricia-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.1.2", + "merkle-patricia-tree": "^2.3.2", "rustbn.js": "~0.2.0", "safe-buffer": "^5.1.1" }, @@ -1554,11 +935,6 @@ "strip-hex-prefix": "1.0.0" } }, - "events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", - "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==" - }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -1568,15 +944,165 @@ "safe-buffer": "^5.1.1" } }, - "extend": { + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "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": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend-shallow": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "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==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } }, "fake-merkle-patricia-tree": { "version": "1.0.1", @@ -1586,66 +1112,78 @@ "checkpoint-store": "^1.1.0" } }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fetch-ponyfill": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz", - "integrity": "sha1-rjzl9zLGReq4fkroeTQUcJsjmJM=", + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, "requires": { - "node-fetch": "~1.7.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" + "is-extendable": "^0.1.0" } } } }, "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" + "locate-path": "^3.0.0" } }, - "flat-options": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/flat-options/-/flat-options-0.1.3.tgz", - "integrity": "sha512-z1vH9mb4ly55dWUZZFUeLNqhFWhwSQNngHpK8RQOhFuNw/sWcNDZhkHl3GS1YTHiYxB5qvcbSRbH7X6ThzX9UA==" + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } }, - "for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, "requires": { - "is-callable": "^1.1.3" + "is-buffer": "~2.0.3" + }, + "dependencies": { + "is-buffer": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "dev": true + } } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -1658,27 +1196,26 @@ "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", "dev": true }, - "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" + "map-cache": "^0.2.2" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "functional-red-black-tree": { "version": "1.0.1", @@ -1688,20 +1225,29 @@ "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, "requires": { - "assert-plus": "^1.0.0" + "pump": "^3.0.0" } }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, "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.4", @@ -1711,24 +1257,29 @@ "path-is-absolute": "^1.0.0" } }, - "global": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", - "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, "requires": { - "min-document": "^2.19.0", - "process": "~0.5.1" + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" } }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } }, "growl": { "version": "1.10.5", @@ -1736,24 +1287,11 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -1762,6 +1300,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -1774,8 +1313,41 @@ }, "has-symbols": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } }, "hash-base": { "version": "3.0.4", @@ -1787,18 +1359,18 @@ } }, "hash.js": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.5.tgz", - "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, "hmac-drbg": { @@ -1811,36 +1383,13 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, - "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "parse-passwd": "^1.0.0" } }, "immediate": { @@ -1852,6 +1401,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -1862,77 +1412,161 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "requires": { - "loose-envify": "^1.0.0" - } + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true }, "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "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=", + "dev": true, "requires": { - "builtin-modules": "^1.0.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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } } }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "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=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, "requires": { - "number-is-nan": "^1.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==", + "dev": true + } } }, - "is-fn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fn/-/is-fn-1.0.0.tgz", - "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=" + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, "requires": { - "number-is-nan": "^1.0.0" + "is-extglob": "^2.1.0" } }, - "is-function": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", - "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=" - }, "is-hex-prefixed": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "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==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, "requires": { "has": "^1.0.1" } @@ -1940,134 +1574,62 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true }, "is-symbol": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, "requires": { "has-symbols": "^1.0.0" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true }, "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", + "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } }, "jsbi": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-2.0.5.tgz", "integrity": "sha512-TzO/62Hxeb26QMb4IGlI/5X+QLr9Uqp1FPkwp2+KOICW+Q+vSuFj61c8pkT6wAns4WcK56X7CmSHhJeDGWOqxQ==" }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" - }, - "json-rpc-engine": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz", - "integrity": "sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA==", - "requires": { - "async": "^2.0.1", - "babel-preset-env": "^1.7.0", - "babelify": "^7.3.0", - "json-rpc-error": "^2.0.0", - "promise-to-callback": "^1.0.0", - "safe-event-emitter": "^1.0.1" - } - }, - "json-rpc-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/json-rpc-error/-/json-rpc-error-2.0.0.tgz", - "integrity": "sha1-p6+cICg4tekFxyUOVH8a/3cligI=", - "requires": { - "inherits": "^2.0.1" - } - }, - "json-rpc-random-id": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz", - "integrity": "sha1-uknZat7RRE27jaPSA3SKy7zeyMg=" - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "requires": { - "jsonify": "~0.0.0" - } - }, - "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=" - }, - "json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "keccak": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.0.0.tgz", @@ -2079,20 +1641,19 @@ "safe-buffer": "^5.1.0" } }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "requires": { - "graceful-fs": "^4.1.9" - } + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true }, "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, "requires": { - "invert-kv": "^1.0.0" + "invert-kv": "^2.0.0" } }, "level-codec": { @@ -2119,11 +1680,6 @@ "xtend": "^4.0.0" }, "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", @@ -2139,6 +1695,11 @@ "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" } } }, @@ -2151,16 +1712,6 @@ "xtend": "~2.1.1" }, "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - }, "readable-stream": { "version": "1.0.34", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", @@ -2176,14 +1727,6 @@ "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } } } }, @@ -2205,19 +1748,22 @@ "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" } } }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -2225,17 +1771,35 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" + "chalk": "^2.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } } }, "ltgt": { @@ -2249,6 +1813,30 @@ "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", "dev": true }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -2259,6 +1847,17 @@ "safe-buffer": "^5.1.2" } }, + "mem": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz", + "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, "memdown": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", @@ -2279,14 +1878,14 @@ "requires": { "xtend": "~4.0.0" } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" } } }, - "memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" - }, "merkle-patricia-tree": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", @@ -2306,6 +1905,31 @@ "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, @@ -2315,6 +1939,27 @@ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", "dev": true }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "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": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", @@ -2324,23 +1969,23 @@ "mime-db": { "version": "1.38.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==", + "dev": true }, "mime-types": { "version": "2.1.22", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "dev": true, "requires": { "mime-db": "~1.38.0" } }, - "min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", - "requires": { - "dom-walk": "^0.1.0" - } + "mimic-fn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.0.0.tgz", + "integrity": "sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA==", + "dev": true }, "minimalistic-assert": { "version": "1.0.1", @@ -2356,6 +2001,7 @@ "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.7" } @@ -2363,49 +2009,149 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { "minimist": "0.0.8" } }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.2.tgz", + "integrity": "sha512-RtTJsmmToGyeTznSOMoM6TPEk1A84FQaHIciKrRqARZx+B5ccJ5tXlmJzEKGBxZdqk9UjpRsesZTUkZmR5YnuQ==", "dev": true, "requires": { + "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", + "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "findup-sync": "2.0.0", + "glob": "7.1.3", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "3.12.0", + "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "ms": "2.1.1", + "node-environment-flags": "1.0.4", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "12.0.5", + "yargs-parser": "11.1.1", + "yargs-unparser": "1.5.0" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "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" + } + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true }, "nan": { "version": "2.11.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" }, - "node-fetch": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", - "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=" + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "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-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" + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-environment-flags": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.4.tgz", + "integrity": "sha512-M9rwCnWVLW7PX+NUWe3ejEdiLYinRpsEre9hMkU/6NS4h+EEulYaDH1gCEZ2gyXsmw+RXYDaV2JkkTNcsPDJ0Q==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3" + } }, "node-gyp-build": { "version": "3.7.0", @@ -2413,217 +2159,220 @@ "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", "dev": true }, - "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==", + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "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" + } + } + } }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "object-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", + "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "dev": true }, - "object-inspect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==" + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, "requires": { - "lcid": "^1.0.0" + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true }, - "parse-headers": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", - "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", - "requires": { - "for-each": "^0.3.2", - "trim": "0.0.1" - } + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", + "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", + "dev": true }, - "parse-json": { + "p-limit": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "dev": true, "requires": { - "error-ex": "^1.2.0" + "p-try": "^2.0.0" } }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, "requires": { - "pinkie-promise": "^2.0.0" + "p-limit": "^2.0.0" } }, - "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-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "p-try": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.1.0.tgz", + "integrity": "sha512-H2RyIJ7+A3rjkwKC2l5GGtU4H1vkxKCAGsWasNVd0Set+6i4znxbWy6/j16YDPJDWxhsgZiKAstMEP8wCdSpjA==", + "dev": true }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true }, - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + "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=", + "dev": true }, - "pinkie-promise": { + "path-key": { "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.0" - } - }, - "precond": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", - "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=" + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true }, - "process": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", - "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=" + "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=", + "dev": true }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, - "promise-controller": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/promise-controller/-/promise-controller-0.3.0.tgz", - "integrity": "sha512-w1RTaOwD5bNtYjIj5L8+ruDtMgnKC0pLtOogA3kcS4LRtiwLOpAdokjYbkjJMa6AGV0oasHa8RRNa8qEpG1qyw==" - }, - "promise-to-callback": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/promise-to-callback/-/promise-to-callback-1.0.0.tgz", - "integrity": "sha1-XSp0kBC/tn2WNZj805YHRqaP7vc=", - "requires": { - "is-fn": "^1.0.0", - "set-immediate-shim": "^1.0.1" - } - }, - "promise.prototype.finally": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/promise.prototype.finally/-/promise.prototype.finally-3.1.0.tgz", - "integrity": "sha512-7p/K2f6dI+dM8yjRQEGrTQs5hTQixUAdOGpMEA3+pVxpX5oHKRSKAXyLw9Q9HUWDTdwtoo39dSHGQtN90HcEwQ==", - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.9.0", - "function-bind": "^1.1.1" - } - }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, "readable-stream": { @@ -2638,124 +2387,79 @@ "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + } } }, - "regenerate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", - "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==" - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - }, - "regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", - "requires": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" - } - }, - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=" - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "requires": { - "jsesc": "~0.5.0" - } + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-from-string": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", - "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=" + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true }, "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true }, "resolve": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "dev": true, "requires": { "path-parse": "^1.0.5" } }, - "resumer": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", - "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, "requires": { - "through": "~2.3.4" + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" } }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "requires": { - "glob": "^7.0.5" - } + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true }, "ripemd160": { "version": "2.0.2", @@ -2767,40 +2471,32 @@ } }, "rlp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.1.0.tgz", - "integrity": "sha512-93U7IKH5j7nmXFVg19MeNBGzQW5uXW1pmCuKY8veeKIhYTE32C2d0mOegfiIAfXcHOKJjjPlJisn8iHDF5AezA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", + "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", "requires": { + "bn.js": "^4.11.1", "safe-buffer": "^5.1.1" } }, - "rustbn.js": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.1.2.tgz", - "integrity": "sha512-bAkNqSHYdJdFsBC7Z11JgzYktL31HIpB2o70jZcGiL1U1TVtPyvaVhDrGWwS8uZtaqwW2k6NOPGZCqW/Dgh5Lg==" - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "safe-event-emitter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz", - "integrity": "sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg==", + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, "requires": { - "events": "^3.0.0" + "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==" - }, "secp256k1": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.5.2.tgz", - "integrity": "sha512-iin3kojdybY6NArd+UFsoTuapOF7bnJNf2UbcWXaY3z+E1sJDipl60vtzB5hbO/uquBu7z0fd4VC4Irp+xoFVQ==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.6.2.tgz", + "integrity": "sha512-90nYt7yb0LmI4A2jJs1grglkTAXrBwxYAjP9bpeKjvJKOjG2fOeH/YI/lchDMIvjrOasd5QXwvV2jwN168xNng==", "requires": { "bindings": "^1.2.1", "bip66": "^1.1.3", @@ -2820,122 +2516,294 @@ "semver": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "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": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "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==", + "dev": true, "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "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=", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } } }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" - }, - "solc": { - "version": "0.4.25", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.25.tgz", - "integrity": "sha512-jU1YygRVy6zatgXrLY2rRm7HW1d7a8CkkEgNJwvH2VLpWhMFsMdWcJn6kUqZwcSz/Vm+w89dy7Z/aB5p6AFTrg==", + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, "requires": { - "fs-extra": "^0.30.0", - "memorystream": "^0.3.1", - "require-from-string": "^1.1.0", - "semver": "^5.3.0", - "yargs": "^4.7.1" + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } } }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, - "source-map-support": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", - "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "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==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "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-correct": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", - "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "source-map-support": { + "version": "0.5.11", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz", + "integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==", + "dev": true, "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + "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=", + "dev": true }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "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==", + "dev": true, "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "extend-shallow": "^3.0.0" } }, - "spdx-license-ids": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", - "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==" + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "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", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } } }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string.prototype.trim": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", - "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.0", - "function-bind": "^1.0.2" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "string_decoder": { @@ -2950,17 +2818,16 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, "requires": { "ansi-regex": "^2.0.0" } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true }, "strip-hex-prefix": { "version": "1.0.0", @@ -2970,6 +2837,12 @@ "is-hex-prefixed": "1.0.0" } }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "superagent": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/superagent/-/superagent-4.1.0.tgz", @@ -3030,356 +2903,373 @@ "has-flag": "^3.0.0" } }, - "tape": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.1.tgz", - "integrity": "sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw==", + "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=", + "dev": true, "requires": { - "deep-equal": "~1.0.1", - "defined": "~1.0.0", - "for-each": "~0.3.3", - "function-bind": "~1.1.1", - "glob": "~7.1.2", - "has": "~1.0.3", - "inherits": "~2.0.3", - "minimist": "~1.2.0", - "object-inspect": "~1.6.0", - "resolve": "~1.7.1", - "resumer": "~0.0.0", - "string.prototype.trim": "~1.1.2", - "through": "~2.3.8" + "kind-of": "^3.0.2" }, "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "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" + } } } }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, "requires": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" } }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "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=", + "dev": true, "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, - "treeify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", - "integrity": "sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==" - }, - "trim": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", - "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" - }, "ts-node": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", - "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.0.3.tgz", + "integrity": "sha512-2qayBA4vdtVRuDo11DEFSsD/SFsBXQBRZZhbRGSIkmYmVkWjULn/GGMdG10KVqkaGndljfaTD8dKjWgcejO8YA==", "dev": true, "requires": { - "arrify": "^1.0.0", - "buffer-from": "^1.1.0", + "arg": "^4.1.0", "diff": "^3.1.0", "make-error": "^1.1.1", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", "source-map-support": "^0.5.6", - "yn": "^2.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } + "yn": "^3.0.0" } }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "tslint": { + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", + "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", + "dev": true, "requires": { - "safe-buffer": "^5.0.1" + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } } }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, "requires": { - "is-typedarray": "^1.0.0" + "tslib": "^1.8.1" } }, "typescript": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.3.tgz", - "integrity": "sha512-+81MUSyX+BaSo+u2RbozuQk/UWx6hfG0a5gHu4ANEM4sU96XbuIyAB+rWBW1u70c6a5QuZfuYICn3s2UjuHUpA==", + "version": "3.3.4000", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", + "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", "dev": true }, "uWebSockets.js": { "version": "github:uNetworking/uWebSockets.js#d96159d2ffc1517cdab39fe169d88dd55a2aeba7", "from": "github:uNetworking/uWebSockets.js#v15.8.0" }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, - "utf-8-validate": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", - "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "dev": true, "requires": { - "node-gyp-build": "~3.7.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "web3-provider-engine": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-14.1.0.tgz", - "integrity": "sha512-vGZtqhSUzGTiMGhJXNnB/aRDlrPZLhLnBZ2NPArkZtr8XSrwg9m08tw4+PuWg5za0TJuoE/vuPQc501HddZZWw==", - "requires": { - "async": "^2.5.0", - "backoff": "^2.5.0", - "clone": "^2.0.0", - "cross-fetch": "^2.1.0", - "eth-block-tracker": "^3.0.0", - "eth-json-rpc-infura": "^3.1.0", - "eth-sig-util": "^1.4.2", - "ethereumjs-block": "^1.2.2", - "ethereumjs-tx": "^1.2.0", - "ethereumjs-util": "^5.1.5", - "ethereumjs-vm": "^2.3.4", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "readable-stream": "^2.2.9", - "request": "^2.85.0", - "semaphore": "^1.0.3", - "ws": "^5.1.1", - "xhr": "^2.2.0", - "xtend": "^4.0.1" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" }, "dependencies": { - "ws": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, "requires": { - "async-limiter": "~1.0.0" + "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=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" } } } }, - "websocket": { - "version": "1.0.28", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.28.tgz", - "integrity": "sha512-00y/20/80P7H4bCYkzuuvvfDvh+dgtXi5kzDf3UcZwN6boTYaKvsrtZ5lIYm1Gsg48siMErd9M4zjSYfYFHTrA==", + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, "requires": { - "debug": "^2.2.0", - "nan": "^2.11.0", - "typedarray-to-buffer": "^3.1.5", - "yaeti": "^0.0.6" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, "requires": { - "ms": "2.0.0" + "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=", + "dev": true, + "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=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true } } }, - "websocket-as-promised": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/websocket-as-promised/-/websocket-as-promised-0.9.0.tgz", - "integrity": "sha512-6Pm5Tl528UloGWY13gTphOYBknH/+kjMEAVmS/oFVKHc9LMAVy5xWpFRZWiu+qOjQk14NOTxvHTBCBEzvUZFlA==", + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "utf-8-validate": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", + "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", + "dev": true, "requires": { - "chnl": "^0.4.1", - "flat-options": "^0.1.3", - "promise-controller": "^0.3.0", - "promise.prototype.finally": "^3.1.0" + "node-gyp-build": "~3.7.0" } }, - "whatwg-fetch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", - "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } }, "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true }, - "window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + } } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "ws": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.0.tgz", - "integrity": "sha512-deZYUNlt2O4buFCa3t5bKLf8A7FPP/TVjwOeVNpw818Ma5nk4MLXls2eoEGS39o8119QIYxTrTDoPQ5B/gTD6w==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", "dev": true, "requires": { "async-limiter": "~1.0.0" } }, - "xhr": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", - "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", "requires": { - "global": "~4.3.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" + "object-keys": "~0.4.0" + }, + "dependencies": { + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + } } }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - }, "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" - }, - "yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true }, "yargs": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, "requires": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", + "os-locale": "^3.0.0", "require-directory": "^2.1.1", "require-main-filename": "^1.0.1", "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" } }, "yargs-parser": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", + "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "dev": true, "requires": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" + "flat": "^4.1.0", + "lodash": "^4.17.11", + "yargs": "^12.0.5" } }, "yn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.0.0.tgz", + "integrity": "sha512-+Wo/p5VRfxUgBUGy2j/6KX2mj9AYJWOHuhMjMcbBFc3y54o9/4buK1ksBvuiK01C3kby8DH9lSmJdSxw+4G/2Q==", "dev": true } } diff --git a/package.json b/package.json index 625e92dd6a..7f0a6d12e0 100644 --- a/package.json +++ b/package.json @@ -11,34 +11,28 @@ }, "scripts": { "build": "tsc", - "test": "mocha -r ts-node/register test/**.* --recursive" + "test": "mocha --require ts-node/register --watch-extensions ts 'test/**/*.{ts}' --recursive --check-leaks" }, "dependencies": { - "@types/ethereum-protocol": "^1.0.0", - "@types/superagent": "^4.1.1", - "@types/web3-provider-engine": "^14.0.0", - "ethereumjs-vm": "2.4.0", - "jsbi": "^2.0.5", + "@types/uws": "^0.13.2", + "ethereumjs-vm": "2.6.0", + "jsbi": "2.0.5", "keccak": "2.0.0", - "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.8.0", - "web3-provider-engine": "14.1.0", - "websocket": "1.0.28", - "websocket-as-promised": "0.9.0" + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.8.0" }, "devDependencies": { - "@types/bn.js": "^4.11.2", - "@types/chai": "^4.1.6", - "@types/mocha": "^5.2.5", - "@types/node": "^10.12.0", - "@types/web3": "^1.0.10", - "@types/ws": "^6.0.1", - "bufferutil": "^4.0.1", - "mocha": "^5.2.0", + "@types/mocha": "5.2.5", + "@types/node": "10.12.0", + "@types/ws": "6.0.1", + "@types/superagent": "^4.1.1", + "bufferutil": "4.0.1", + "mocha": "6.0.2", + "tslint": "5.14.0", "superagent": "4.1.0", - "ts-node": "^7.0.1", - "typescript": "^3.1.3", - "utf-8-validate": "^5.0.2", - "ws": "^6.2.0" + "ts-node": "8.0.3", + "typescript": "3.3.4000", + "utf-8-validate": "5.0.2", + "ws": "6.2.1" }, "optionalDependencies": {}, "repository": { diff --git a/src/options/options.ts b/src/options/options.ts index 8cfc51368f..6ed7615871 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -9,8 +9,8 @@ interface Logger { log(message?: any, ...optionalParams: any[]): void; } -export default class Options { - public ledger: ILedger = new Ethereum({networkId: Date.now()}); +export default interface Options { + ledger: ILedger, /** * Array of Accounts. Each object should have a balance key with a hexadecimal * value. The key secretKey can also be specified, which represents the @@ -18,43 +18,43 @@ export default class Options { * the given balance. If specified, the key is used to determine the account's * address. */ - public accounts: Array = null + accounts: Array, /** * Output VM opcodes for debugging. Defaults to `false` */ - public debug: boolean = false + debug: boolean, /** * An object, like console, that implements a log() function. */ - public logger: Logger = {log: () => {}} + logger: Logger, /** * Use a specific HD wallet mnemonic to generate initial addresses. */ - public mnemonic: string = null + mnemonic: string, /** * Use arbitrary data to generate the HD wallet mnemonic to be used. */ - public seed: string = null + seed: string, /** * The default account balance, specified in ether. Defaults to `100` ether */ - public default_balance_ether: JSBI = JSBI.BigInt(100) + default_balance_ether: JSBI, /** * Number of accounts to generate at startup. Default to `10`. */ - public total_accounts: JSBI = JSBI.BigInt(10) + total_accounts: JSBI, /** * When a string, same as --fork option above. Can also be a Web3 Provider * object, optionally used in conjunction with the fork_block_number */ - public fork: string | object = null + fork: string | object, /** * Block number the provider should fork from, when the fork option is @@ -62,77 +62,106 @@ export default class Options { * sign and a block number, the block number in the fork parameter takes * precedence. */ - public fork_block_number: string | JSBI = null + fork_block_number: string | JSBI, /** * Same as --networkId option above. */ - public network_id: number = Date.now() + network_id: number, /** * Date that the first block should start. Use this feature, along with the * evm_increaseTime method to test time-dependent code. */ - public time: Date = null + time: Date, /** * Whether or not accounts are locked by default. Defaults to `false` */ - public locked: boolean = false + locked: boolean, /** * Array of addresses or address indexes specifying which accounts should be unlocked. */ - public unlocked_accounts: Array = null + unlocked_accounts: Array, /** * Specify a path to a directory to save the chain database. If a database * already exists, that chain will be initialized instead of creating a new * one. */ - public db_path: String = null + db_path: String, /** * Specify an alternative database instance, for instance MemDOWN. */ - public db: Object = null + db: Object, /** * Whether to report runtime errors from EVM code as RPC errors. * This is `true` by default to replicate the error reporting behavior of * previous versions of ganache. */ - public vmErrorsOnRPCResponse: boolean = true + vmErrorsOnRPCResponse: boolean, /** * The hierarchical deterministic path to use when generating accounts. * Default: "m/44'/60'/0'/0/" */ - public hdPath: string = "m/44'/60'/0'/0/" + hdPath: string, /** * Allows unlimited contract sizes while debugging. By setting this to true, the check within the EVM for contract size limit of 24KB (see EIP-170) is bypassed. Setting this to true will cause ganache-core to behave differently than production environments. (default: false; ONLY set to true during debugging). */ - public allowUnlimitedContractSize: boolean = true + allowUnlimitedContractSize: boolean, /** * Sets the default gas price for transactions if not otherwise specified. * Must be specified as a hex string in wei. Defaults to "0x77359400", or 2 gwei. */ - public gasPrice: HexQuantity = new HexQuantity("0x77359400") + gasPrice: HexQuantity, /** * Sets the block gas limit. Must be specified as a hex string. Defaults to * "0x6691b7". */ - public gasLimit: HexQuantity = new HexQuantity("0x6691b7") + gasLimit: HexQuantity, /** * */ - public verbose: boolean = false + verbose: boolean, /** * */ - public asyncRequestProcessing: boolean = false -} + asyncRequestProcessing: boolean, +}; + +export const getDefault: ()=> Options = () => { + const now = Date.now(); + return { + ledger: new Ethereum({networkId: now}), + accounts: null, + debug: false, + logger: {log: () => {}}, + mnemonic: null, + seed: null, + default_balance_ether: JSBI.BigInt(100), + total_accounts: JSBI.BigInt(10), + fork: null, + fork_block_number: null, + network_id: now, + time: null, + locked: false, + unlocked_accounts: null, + db_path: null, + db: null, + vmErrorsOnRPCResponse: true, + hdPath: "m/44'/60'/0'/0/", + allowUnlimitedContractSize:true, + gasPrice: new HexQuantity("0x77359400"), + gasLimit: new HexQuantity("0x6691b7"), + verbose: false, + asyncRequestProcessing: false + } as Options; +} \ No newline at end of file diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index ea7e7eadf0..b2f2e5cb10 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -1,8 +1,15 @@ -import Options from "./options"; +import Options, {getDefault as getDefaultOptions} from "./options"; -export default class ProviderOptions extends Options { +export default interface ProviderOptions extends Options { /** * Array of strings to installed subproviders */ - public subProviders: Array + subProviders: Array +} + +export const getDefault : () => ProviderOptions = () => { + return { + ...getDefaultOptions(), + subProviders: [] + } as ProviderOptions; } diff --git a/src/options/server-options.ts b/src/options/server-options.ts index 14112f91e2..e8e771c63a 100644 --- a/src/options/server-options.ts +++ b/src/options/server-options.ts @@ -1,28 +1,33 @@ -import Options from "./options"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "./provider-options"; -export default class ServerOptions extends Options { +export default interface ServerOptions extends ProviderOptions { /** * The number of milliseconds of inactivity the http server needs to wait for * additional incoming data, after it has finished writing the last response, * before a socket will be destroyed. This does not affect the websocket * server. * - * A value of 0 will disable the keep-alive timeout behavior on incoming connections. + * A value of 0 will disable the keep-alive timeout behavior on incoming connections. Defaults to `5000` */ - public readonly keepAliveTimeout: number = 5000 + keepAliveTimeout: number, /** * Port number to listen on when running as a server. Defaults to `8545` */ - public readonly port: number = 8545 + port: number, /** * Enable a websocket server. This is `true` by default. */ - public ws: boolean = true + ws: boolean +} - /** - * Array of strings to installed subproviders - */ - public subProviders: string[] +export const getDefault : () => ServerOptions = () => { + return { + ...getDefaultProviderOptions(), + keepAliveTimeout: 5000, + port: 8545, + ws: true + } as ServerOptions; } + diff --git a/src/provider.ts b/src/provider.ts index 2bf14aacc4..aabf3f44e2 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,11 +1,10 @@ import Engine from "./engine"; import RequestProcessor from "./utils/request-processor"; -import _ProviderOptions from "./options/provider-options"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "./options/provider-options"; import { EventEmitter } from "events"; import Ethereum from "./ledgers/ethereum/ethereum" -export type ProviderOptions = _ProviderOptions; -export const ProviderOptions = _ProviderOptions; +export type ProviderOptions = ProviderOptions; interface Payload { method: string @@ -17,17 +16,17 @@ interface Callback { } export default class Provider extends EventEmitter { - private options: ProviderOptions; - private engine: Engine; - private requestProcessor: RequestProcessor; - constructor(options = new ProviderOptions()) { + private _options: ProviderOptions; + private _engine: Engine; + private _requestProcessor: RequestProcessor; + constructor(options?: ProviderOptions) { super(); - this.options = options; + const _options = this._options = Object.assign(getDefaultProviderOptions(), options); // set up our request processor to either use FIFO or or async request processing - this.requestProcessor = new RequestProcessor(options.asyncRequestProcessing ? 1 : 0); + this._requestProcessor = new RequestProcessor(_options.asyncRequestProcessing ? 1 : 0); - this.engine = new Engine(options.ledger || new Ethereum({networkId: Date.now()})); + this._engine = new Engine(_options.ledger || new Ethereum({networkId: Date.now()})); } public send(payload: Payload, callback?: Callback): void @@ -36,11 +35,11 @@ export default class Provider extends EventEmitter { let method: string; let params: Array; let response: Promise<{}>; - const send = this.engine.send.bind(this.engine); + const send = this._engine.send.bind(this._engine); if (typeof arg1 === "string") { method = arg1; params = arg2; - response = this.requestProcessor.queue(send, method, params); + response = this._requestProcessor.queue(send, method, params); } else { // handle backward compatibility with callback-style ganache-core const payload: Payload = arg1 as Payload; @@ -55,15 +54,15 @@ export default class Provider extends EventEmitter { ); } - this.requestProcessor.queue(send, method, params).then((response: any)=>{ + this._requestProcessor.queue(send, method, params).then((response: any)=>{ callback(null, response); }).catch(callback); response = undefined; } - if (this.options.verbose) { - this.options.logger.log(` > ${method}: ${JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); + if (this._options.verbose) { + this._options.logger.log(` > ${method}: ${JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); } return response; diff --git a/src/server.ts b/src/server.ts index 444f9cbdde..a50f029d52 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,10 +1,44 @@ -import _ServerOptions from "./options/server-options"; +import ServerOptions, {getDefault as getDefaultServerOptions} from "./options/server-options"; -export type ServerOptions = _ServerOptions; -export const ServerOptions = _ServerOptions; -import uWS, { HttpResponse, HttpRequest, RecognizedString, us_listen_socket } from "uWebSockets.js"; -import Provider from "./provider" -import ProviderOptions from "./options/provider-options"; +export type ServerOptions = ServerOptions; + +import uWS, { HttpResponse, HttpRequest, RecognizedString, us_listen_socket, WebSocket } from "uWebSockets.js"; +import Provider from "./provider"; + +const noop = ()=>{}; + +type JsonRpc = { + id: string, + jsonrpc: string, +} + +interface JsonRpcRequestPayload extends JsonRpc { + params: Array +} + +interface JsonRpcError { + code: number, + message: string +} + +interface JsonRpcResponsePayload extends JsonRpc { + id: string, + jsonrpc: string, + result?: any, + error?: JsonRpcError +} + + // 1001 indicates that an endpoint is "going away", such as a server + // going down or a browser having navigated away from a page. +enum WebSocketCloseCodes { + CLOSE_GOING_AWAY = 1001, + CLOSE_PROTOCOL_ERROR = 1002 +}; + +enum ContentTypes { + PLAIN = "text/plain", + JSON = "application/json" +} function rpcError(id: string, code: string, msg: any) { return JSON.stringify({ @@ -17,167 +51,222 @@ function rpcError(id: string, code: string, msg: any) { }); } -function sendResponse(response:HttpResponse, statusCode:number, data?: RecognizedString): void { - response - .writeStatus(statusCode.toString()) - .end(data); +function sendResponse(response:HttpResponse, statusCode: number, contentType?: string, data?: RecognizedString, writeHeaders: (response:HttpResponse)=>void = noop): void { + response.writeStatus(statusCode.toString()); + writeHeaders(response); + if (contentType) { + response.writeHeader("Content-Type", contentType); + } + response.end(data) } + /** * */ export default class Server { + private _options: ServerOptions; private _listenSocket: us_listen_socket; private _app: any; private _provider: Provider; - constructor(options: ServerOptions) { - this._provider = new Provider(options as ProviderOptions); + private _connections: Set = new Set(); + constructor(options?: ServerOptions) { + const _options = this._options = Object.assign(getDefaultServerOptions(), options); + this._provider = new Provider(_options); + + const app = this._app = uWS.App(null); - const app = this._app = uWS.App({}); + if (_options.ws) { + app + .ws("/", { + /* Options */ + compression: (uWS as any).SHARED_COMPRESSOR, + maxPayloadLength: 16 * 1024 * 1024, + idleTimeout: 10, //seconds + /* Handlers */ + open: (ws: any) => { + console.log("A WebSocket connected"); + this._connections.add(ws); + }, + message: async (ws: any, message: ArrayBuffer, isBinary: boolean) => { + let payload: any; + try { + payload = JSON.parse(Buffer.from(message) as any); + } catch (e) { + ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); + return; + } + const method = payload.method; + const result = await this._provider.send(method, payload.params); + // The socket may have closed while we were waiting for the response + // Don't bother trying to send to it now. + if (!ws.closed) { + const json = { + "id": payload.id, + "jsonrpc":"2.0", + "result": result + }; + ws.send(JSON.stringify(json), isBinary, true); + } + }, + drain: (ws: WebSocket) => { + console.log("WebSocket backpressure: " + ws.getBufferedAmount()); + }, + close: (ws: WebSocket) => { + console.log("A WebSocket disconnected"); + this._connections.delete(ws); + ws.closed = true; + } + }); + } app - .ws("/", { - /* Options */ - compression: 0, - maxPayloadLength: 16 * 1024 * 1024, - idleTimeout: 10, - /* Handlers */ - open: (ws, req) => { - console.log('A WebSocket connected via URL: ' + req.getUrl() + '!'); - }, - message: (ws, message: ArrayBuffer, isBinary) => { - const payload = JSON.parse(Buffer.from(message) as any); - this._provider.send(payload.method as string, payload.params as Array).then((result:any) => { - //this._provider.send(payload.method as string, payload.params as Array).then((result:any) => { - /* Ok is false if backpressure was built up, wait for drain */ - const json = { - "id": payload.id, - "jsonrpc":"2.0", - "result": result - }; - let ok = ws.send(JSON.stringify(json), false, true); - }); - }, - drain: (ws) => { - console.log('WebSocket backpressure: ' + ws.getBufferedAmount()); - }, - close: (ws, code, message) => { - console.log('WebSocket closed'); - } - }) .post("/", (response: HttpResponse, request: HttpRequest) => { - createCORSResponseHeaders("POST", response, request); - - let buffer: Buffer; - response.onData(async (ab: ArrayBuffer, isLast: boolean) => { - const chunk = Buffer.from(ab); - if(isLast) { - let payload: any; - try { - payload = JSON.parse((buffer ? Buffer.concat([buffer, chunk]) : chunk) as any); - } catch (e) { - response.writeHeader("Content-Type", "text/plain"); - sendResponse(response, 400, "400 Bad Request"); - return; - } - const method = payload.method; + const writeHeaders = prepareCORSResponseHeaders("POST", request); + + let buffer: Buffer; + response.onData((message: ArrayBuffer, isLast: boolean) => { + const chunk = Buffer.from(message); + if (isLast) { + let payload: any; + try { + const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; + payload = JSON.parse(message); + } catch (e) { + sendResponse(response, 400, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); + return; + } + const method = payload.method as string; - // http connections do not support subscriptions - if (method === "eth_subscribe" || method === "eth_unsubscribe") { - response.writeHeader("Content-Type", "application/json"); - sendResponse(response, 400, rpcError(payload.id, "-32000", "notifications not supported")); - } else { - this._provider.send(payload.method as string, payload.params as Array).then((result:any) => { - if(!response.aborted){ - const json = { - "id": payload.id, - "jsonrpc":"2.0", - "result": result - }; - response.writeHeader("Content-Type", "application/json"); - sendResponse(response, 200, JSON.stringify(json)); - } - }); - } - } else { - if (buffer) { - buffer = Buffer.concat([buffer, chunk]); + // http connections do not support subscriptions + if (method === "eth_subscribe" || method === "eth_unsubscribe") { + sendResponse(response, 400, ContentTypes.JSON, rpcError(payload.id, "-32000", "notifications not supported"), writeHeaders); + } else { + this._provider.send(method, payload.params).then((result) => { + if(!response.aborted){ + const json = { + "id": payload.id, + "jsonrpc":"2.0", + "result": result + }; + sendResponse(response, 200, ContentTypes.JSON, JSON.stringify(json), writeHeaders); + } + }); + } } else { - buffer = Buffer.concat([chunk]); + if (buffer) { + buffer = Buffer.concat([buffer, chunk]); + } else { + buffer = Buffer.concat([chunk]); + } } - } - }); - response.onAborted(() => { - response.aborted = true; + }); + response.onAborted(() => { + response.aborted = true; + }); + }).options("/", (response: HttpResponse, request: HttpRequest) => { + const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); + // OPTIONS responses don't have a body, so respond with `204 No Content` + sendResponse(response, 204, null, null, writeHeaders); + }).get("/418", (response: HttpResponse) => { + // Because Easter Eggs are fun. + sendResponse(response, 418, ContentTypes.PLAIN, "418 I'm a teapot"); + }) + .any("/", (response: HttpResponse) => { + // any other request to "/" is not allowed, so respond with `405 Method Not Allowed` + sendResponse(response, 405, ContentTypes.PLAIN, "405 Method Not Allowed"); + }) + .any("/*", (response: HttpResponse) => { + // all other requests don't mean anything to us, so respond with `404 NOT FOUND` + sendResponse(response, 404, ContentTypes.PLAIN, "404 Not Found"); }); - }).options("/", (response: HttpResponse, request: HttpRequest) => { - createCORSResponseHeaders("OPTIONS", response, request); - sendResponse(response, 204); - }).any("/*", (response: HttpResponse) => { - response.writeHeader("Content-Type", "text/plain"); - sendResponse(response, 400, "400 Bad Request"); - }); } - async listen(port: number, callback?: () => void): Promise { - this._listenSocket = await new Promise((resolve) => { - this._app.listen(port, resolve); - }); + async listen(port: number, callback?: (err: Error) => void): Promise { + let err; + if (this._listenSocket) { + err = new Error("Server is already listening."); + } else { + const listenSocket = await new Promise((resolve) => { + this._app.listen(port, resolve); + }); + + if(listenSocket){ + this._listenSocket = listenSocket; + err = null; + } else { + err = new Error("Failed to listen on port: " + port); + } + } + if (typeof callback === "function") { - callback(); + callback(err); + } else if (err){ + throw err; } } - async close(): Promise { - if (this._listenSocket) { - uWS.us_listen_socket_close(this._listenSocket); + close() { + const listenSocket = this._listenSocket; + if (listenSocket) { + this._listenSocket = undefined; + // close the socket to prevent any more connections + uWS.us_listen_socket_close(listenSocket); + // close all the currently connection websockets: + this._connections.forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); this._listenSocket = undefined; } } } - -function createCORSResponseHeaders(method: string, response: HttpResponse, request: HttpRequest) { +/** + * uWS doesn't let us use the request after the + * @param method + * @param request + */ +function prepareCORSResponseHeaders(method: string, request: HttpRequest) { // https://fetch.spec.whatwg.org/#http-requests const origin = request.getHeader("origin"); - const isCORSRequest = true || origin !== ""; - if (isCORSRequest) { - // OPTIONS preflight requests need a little extra treatment - if (method === "OPTIONS") { - // we only allow POST requests, so it doesn't matter which method the request is asking for - response.writeHeader("Access-Control-Allow-Methods", "POST"); - // echo all requested access-control-request-headers back to the response - if (request.hasOwnProperty("access-control-request-headers")) { - const acrh = request.getHeader("access-control-request-headers"); - response.writeHeader("Access-Control-Allow-Headers", acrh); + const acrh = request.getHeader("access-control-request-headers"); + return (response: HttpResponse) => { + const isCORSRequest = true || origin !== ""; + if (isCORSRequest) { + // OPTIONS preflight requests need a little extra treatment + if (method === "OPTIONS") { + // we only allow POST requests, so it doesn't matter which method the request is asking for + response.writeHeader("Access-Control-Allow-Methods", "POST"); + // echo all requested access-control-request-headers back to the response + if (acrh !== "") { + response.writeHeader("Access-Control-Allow-Headers", acrh); + } + // Safari needs Content-Length = 0 for a 204 response otherwise it hangs forever + // https://github.com/expressjs/cors/pull/121#issue-130260174 + response.writeHeader("Content-Length", "0"); + + // Make browsers and compliant clients cache the OPTIONS preflight response for 10 + // minutes (this is the maximum time Chromium allows) + response.writeHeader("Access-Control-Max-Age", "600"); // seconds } - // Safari needs Content-Length = 0 for a 204 response otherwise it hangs forever - // https://github.com/expressjs/cors/pull/121#issue-130260174 - response.writeHeader("Content-Length", "0"); - // Make browsers and compliant clients cache the OPTIONS preflight response for 10 - // minutes (this is the maximum time Chromium allows) - response.writeHeader("Access-Control-Max-Age", "600"); // seconds - } + // From the spec: https://fetch.spec.whatwg.org/#http-responses + // "For a CORS-preflight request, request’s credentials mode is always "omit", + // but for any subsequent CORS requests it might not be. Support therefore + // needs to be indicated as part of the HTTP response to the CORS-preflight request as well.", so this + // header is added to all requests. + // Additionally, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials, + // states that there aren't any HTTP Request headers that indicate you whether or not Request.withCredentials + // is set. Because web3@1.0.0-beta.35-? always sets `request.withCredentials = true` while Safari requires it be + // returned even when no credentials are set in the browser this header must always be return on all requests. + // (I've found that Chrome and Firefox don't actually require the header when credentials aren't set) + // Regression Commit: https://github.com/ethereum/web3.js/pull/1722 + // Open Web3 Issue: https://github.com/ethereum/web3.js/issues/1802 + response.writeHeader("Access-Control-Allow-Credentials", "true"); - // From the spec: https://fetch.spec.whatwg.org/#http-responses - // "For a CORS-preflight request, request’s credentials mode is always "omit", - // but for any subsequent CORS requests it might not be. Support therefore - // needs to be indicated as part of the HTTP response to the CORS-preflight request as well.", so this - // header is added to all requests. - // Additionally, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials, - // states that there aren't any HTTP Request headers that indicate you whether or not Request.withCredentials - // is set. Because web3@1.0.0-beta.35-? always sets `request.withCredentials = true` while Safari requires it be - // returned even when no credentials are set in the browser this header must always be return on all requests. - // (I've found that Chrome and Firefox don't actually require the header when credentials aren't set) - // Regression Commit: https://github.com/ethereum/web3.js/pull/1722 - // Open Web3 Issue: https://github.com/ethereum/web3.js/issues/1802 - response.writeHeader("Access-Control-Allow-Credentials", "true"); - - // From the spec: "It cannot be reliably identified as participating in the CORS protocol - // as the `Origin` header is also included for all requests whose method is neither - // `GET` nor `HEAD`." - // Explicitly set the origin instead of using *, since credentials - // can't be used in conjunction with *. This will always be set - /// for valid preflight requests. - response.writeHeader("Access-Control-Allow-Origin", origin); + // From the spec: "It cannot be reliably identified as participating in the CORS protocol + // as the `Origin` header is also included for all requests whose method is neither + // `GET` nor `HEAD`." + // Explicitly set the origin instead of using *, since credentials + // can't be used in conjunction with *. This will always be set + /// for valid preflight requests. + response.writeHeader("Access-Control-Allow-Origin", origin); + } } } \ No newline at end of file diff --git a/test/server.ts b/test/server.ts index 45a109d002..cecefbfca5 100644 --- a/test/server.ts +++ b/test/server.ts @@ -7,6 +7,7 @@ import { ServerOptions } from "../src/server"; describe("server", () => { + const port = 8545; const jsonRpcJson: any = { jsonrpc: "2.0", id: "1", @@ -15,38 +16,77 @@ describe("server", () => { }; let s: Server; beforeEach("setup", async ()=>{ - s = Ganache.server(); - await s.listen(8545); + s = Ganache.server({ + network_id: 1234 + } as ServerOptions); + await s.listen(port); }) - it("returns things", async ()=>{ - const s = Ganache.server(); - await s.listen(8545); - const response = await request - .post('http://127.0.0.1:8545') - .send(jsonRpcJson) - .set('accept', 'json'); - const json = JSON.stringify(response.text) - assert.ok(json); + describe("http", () => { + it.only("returns things", async () => { + const response = await request + .post('http://localhost:' + port) + .send(jsonRpcJson) + .set('accept', 'json'); + const json = JSON.parse(response.text) + assert.ok(json); + }); }); - it("returns things over a websocket", async ()=>{ - const s = Ganache.server({ - network_id: 1234 - } as ServerOptions); - await s.listen(8545); - const ws = new WebSocket('ws://127.0.0.1:8545'); + describe("websocket", () => { + it("returns things over a websocket", async () => { + const ws = new WebSocket('ws://localhost:' + port); - const result: any = await new Promise((resolve) => { - ws.on("open", function open() { - ws.send(JSON.stringify(jsonRpcJson)); + const result: any = await new Promise((resolve) => { + ws.on("open", () => { + ws.send(JSON.stringify(jsonRpcJson)); + }); + ws.on('message', resolve); }); - ws.on('message', resolve); + const json = JSON.parse(result); + assert.ok(json); }); - const json = JSON.parse(result); - assert.ok(json); - }) + + it("returns things over a websocket as binary", async () => { + const ws = new WebSocket('ws://localhost:' + port); + const result: any = await new Promise((resolve) => { + ws.on("open", () => { + const strToAB = (str: string) => new Uint8Array(str.split('').map(c => c.charCodeAt(0))).buffer; + ws.send(strToAB(JSON.stringify(jsonRpcJson))); + }); + ws.on('message', resolve); + }); + const json = JSON.parse(result); + assert.ok(json); + }); + + it("doesn't crash when sending bad data over http", async () => { + await assert.rejects(request + .post('http://localhost:' + port) + .send("This is _not_ pudding") + , /^Error: Bad Request$/); + + const response = await request + .post('http://localhost:' + port) + .send(jsonRpcJson) + .set('accept', 'json'); + const json = JSON.parse(response.text) + assert.ok(json); + }); + + it("doesn't crash when sending bad data over websocket", async () => { + const ws = new WebSocket('ws://localhost:' + port); + const result: number = await new Promise((resolve) => { + ws.on("open", () => { + ws.on("close", resolve); + ws.send("What is it?"); + }); + }); + assert.strictEqual(result, 1002, "Did not receive expected close code 1002"); + }); + }); afterEach("teardown", ()=>{ s && s.close(); + s = undefined; }) }); diff --git a/tsconfig.json b/tsconfig.json index a6e80cbc19..fa4d3a86af 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "sourceMap": true, "outDir": "dist", "baseUrl": ".", - "lib": ["es2017"], + "lib": ["dom", "es2017"], "rootDir": "./" }, "include": [ diff --git a/typings/web3-provider-engine/subproviders/subprovider.d.ts b/typings/web3-provider-engine/subproviders/subprovider.d.ts deleted file mode 100644 index 0037afe51f..0000000000 --- a/typings/web3-provider-engine/subproviders/subprovider.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare module "web3-provider-engine/subproviders/subprovider" { - import { - JSONRPCRequestPayload, - } from "ethereum-protocol"; - import Web3ProviderEngine from "web3-provider-engine"; - - export class Subprovider { - public setEngine(engine: Web3ProviderEngine): void; - public handleRequest(payload: JSONRPCRequestPayload, next: () => void, end: () => void): void; - public emitPayload(payload: JSONRPCRequestPayload, cb: () => void): void; - } - export default Subprovider; -} From 7f3c1b07cb3f2688d80d4866e170576fb0762f47 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 27 Mar 2019 17:25:19 -0400 Subject: [PATCH 005/691] moar! --- README.md | 2 +- src/interfaces/ledger-options.ts | 2 + src/interfaces/ledger.ts | 5 +- .../ethereum/{ethereum.ts => ledger.ts} | 19 +- src/ledgers/ethereum/options.ts | 10 + src/options/options.ts | 16 +- src/options/provider-options.ts | 12 +- src/options/server-options.ts | 16 +- src/provider.ts | 6 +- src/server.ts | 213 ++---------------- src/server/content-types.ts | 5 + src/server/http-server.ts | 175 ++++++++++++++ src/server/rpc-error.ts | 10 + src/server/websocket-close-codes.ts | 7 + src/server/websocket-server.ts | 54 +++++ test/server.ts | 42 ++-- 16 files changed, 339 insertions(+), 255 deletions(-) create mode 100644 src/interfaces/ledger-options.ts rename src/ledgers/ethereum/{ethereum.ts => ledger.ts} (59%) create mode 100644 src/ledgers/ethereum/options.ts create mode 100644 src/server/content-types.ts create mode 100644 src/server/http-server.ts create mode 100644 src/server/rpc-error.ts create mode 100644 src/server/websocket-close-codes.ts create mode 100644 src/server/websocket-server.ts diff --git a/README.md b/README.md index a64423402f..5b6b4456d7 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Both `.provider()` and `.server()` take a single object which allows you to spec * `"total_accounts"`: `number` - Number of accounts to generate at startup. * `"fork"`: `string` or `object` - When a `string`, same as `--fork` option above. Can also be a Web3 Provider object, optionally used in conjunction with the `fork_block_number` option below. * `"fork_block_number"`: `string` or `number` - Block number the provider should fork from, when the `fork` option is specified. If the `fork` option is specified as a string including the `@` sign and a block number, the block number in the `fork` parameter takes precedence. -* `"network_id"`: `integer` - Same as `--networkId` option above. +* `"network_id"`: `string` - Same as `--networkId` option above. * `"time"`: `Date` - Date that the first block should start. Use this feature, along with the `evm_increaseTime` method to test time-dependent code. * `"locked"`: `boolean` - whether or not accounts are locked by default. * `"unlocked_accounts"`: `Array` - array of addresses or address indexes specifying which accounts should be unlocked. diff --git a/src/interfaces/ledger-options.ts b/src/interfaces/ledger-options.ts new file mode 100644 index 0000000000..7a908d418a --- /dev/null +++ b/src/interfaces/ledger-options.ts @@ -0,0 +1,2 @@ +export default interface LedgerOptions { +} \ No newline at end of file diff --git a/src/interfaces/ledger.ts b/src/interfaces/ledger.ts index 64ac573000..7fa4ad72f3 100644 --- a/src/interfaces/ledger.ts +++ b/src/interfaces/ledger.ts @@ -1,4 +1,5 @@ +export const optionsSymbol = Symbol("options"); export default interface ILedger { - options: any; + readonly [optionsSymbol]: any; readonly [key: string]: (params?: Array) => Promise; -} \ No newline at end of file +} diff --git a/src/ledgers/ethereum/ethereum.ts b/src/ledgers/ethereum/ledger.ts similarity index 59% rename from src/ledgers/ethereum/ethereum.ts rename to src/ledgers/ethereum/ledger.ts index 0d1a0d5baa..f116322aaa 100644 --- a/src/ledgers/ethereum/ethereum.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,20 +1,17 @@ const createKeccakHash = require("keccak"); -import ILedger from "../../interfaces/ledger"; +import ILedger, {optionsSymbol} from "../../interfaces/ledger"; +import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options" const hash = createKeccakHash("keccak256"); import JSBI from "jsbi"; -export default class Ethereum implements ILedger{ - readonly [index: string]: (...args: any) => Promise<{}>; - - options: any; - private _netVersion: any; - constructor(options: any){ - this.options = options; - this._netVersion = (this.options.networkId || Date.now()).toString(); +export default class Ethereum implements ILedger { + readonly [optionsSymbol]: EthereumOptions; + constructor(options: EthereumOptions){ + this[optionsSymbol] = Object.assign(getDefaultEthereumOptions(), options); } async net_version(): Promise { - return this._netVersion; + return this[optionsSymbol].net_version; } async net_listening(): Promise { @@ -32,4 +29,6 @@ export default class Ethereum implements ILedger{ async web3_sha3(string: string): Promise { return hash(string).digest(); }; + + readonly [index: string]: (...args: any) => Promise<{}>; } \ No newline at end of file diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts new file mode 100644 index 0000000000..38e1df645f --- /dev/null +++ b/src/ledgers/ethereum/options.ts @@ -0,0 +1,10 @@ +import LedgerOptions from "../../interfaces/ledger-options" + +interface EthereumOptions extends LedgerOptions { + net_version: string +} + +export default EthereumOptions; +export const getDefaultOptions : () => EthereumOptions = () => { + return {} as EthereumOptions; +} \ No newline at end of file diff --git a/src/options/options.ts b/src/options/options.ts index 6ed7615871..97ee1745e8 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -2,7 +2,7 @@ import Account from "../types/account"; import HexData from "../types/hex-data"; import HexQuantity from "../types/hex-quantity"; import ILedger from "../interfaces/ledger"; -import Ethereum from "../ledgers/ethereum/ethereum"; +import Ethereum from "../ledgers/ethereum/ledger"; import JSBI from "jsbi"; interface Logger { @@ -67,7 +67,7 @@ export default interface Options { /** * Same as --networkId option above. */ - network_id: number, + network_id: string, /** * Date that the first block should start. Use this feature, along with the @@ -137,10 +137,10 @@ export default interface Options { asyncRequestProcessing: boolean, }; -export const getDefault: ()=> Options = () => { - const now = Date.now(); - return { - ledger: new Ethereum({networkId: now}), +export const getDefault: (options: Options)=> Options = (options) => { + const network_id = options.network_id || Date.now().toString(); + return Object.assign({ + ledger: new Ethereum({net_version: network_id}), accounts: null, debug: false, logger: {log: () => {}}, @@ -150,7 +150,7 @@ export const getDefault: ()=> Options = () => { total_accounts: JSBI.BigInt(10), fork: null, fork_block_number: null, - network_id: now, + network_id, time: null, locked: false, unlocked_accounts: null, @@ -163,5 +163,5 @@ export const getDefault: ()=> Options = () => { gasLimit: new HexQuantity("0x6691b7"), verbose: false, asyncRequestProcessing: false - } as Options; + }, options); } \ No newline at end of file diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index b2f2e5cb10..097e5407ef 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -7,9 +7,11 @@ export default interface ProviderOptions extends Options { subProviders: Array } -export const getDefault : () => ProviderOptions = () => { - return { - ...getDefaultOptions(), - subProviders: [] - } as ProviderOptions; +export const getDefault : (options: ProviderOptions) => ProviderOptions = (options) => { + return Object.assign( + { + subProviders: [] + }, + getDefaultOptions(options) + ); } diff --git a/src/options/server-options.ts b/src/options/server-options.ts index e8e771c63a..ec40e480d5 100644 --- a/src/options/server-options.ts +++ b/src/options/server-options.ts @@ -22,12 +22,14 @@ export default interface ServerOptions extends ProviderOptions { ws: boolean } -export const getDefault : () => ServerOptions = () => { - return { - ...getDefaultProviderOptions(), - keepAliveTimeout: 5000, - port: 8545, - ws: true - } as ServerOptions; +export const getDefault : (options: ServerOptions) => ServerOptions = (options) => { + return Object.assign( + { + keepAliveTimeout: 5000, + port: 8545, + ws: true + }, + getDefaultProviderOptions(options as ProviderOptions) + ) as ServerOptions; } diff --git a/src/provider.ts b/src/provider.ts index aabf3f44e2..7f1de31e8c 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -2,7 +2,7 @@ import Engine from "./engine"; import RequestProcessor from "./utils/request-processor"; import ProviderOptions, {getDefault as getDefaultProviderOptions} from "./options/provider-options"; import { EventEmitter } from "events"; -import Ethereum from "./ledgers/ethereum/ethereum" +import Ethereum from "./ledgers/ethereum/ledger" export type ProviderOptions = ProviderOptions; @@ -21,12 +21,12 @@ export default class Provider extends EventEmitter { private _requestProcessor: RequestProcessor; constructor(options?: ProviderOptions) { super(); - const _options = this._options = Object.assign(getDefaultProviderOptions(), options); + const _options = this._options = getDefaultProviderOptions(options); // set up our request processor to either use FIFO or or async request processing this._requestProcessor = new RequestProcessor(_options.asyncRequestProcessing ? 1 : 0); - this._engine = new Engine(_options.ledger || new Ethereum({networkId: Date.now()})); + this._engine = new Engine(_options.ledger || new Ethereum({net_version: _options.network_id})); } public send(payload: Payload, callback?: Callback): void diff --git a/src/server.ts b/src/server.ts index a50f029d52..42524d96b4 100644 --- a/src/server.ts +++ b/src/server.ts @@ -2,10 +2,10 @@ import ServerOptions, {getDefault as getDefaultServerOptions} from "./options/se export type ServerOptions = ServerOptions; -import uWS, { HttpResponse, HttpRequest, RecognizedString, us_listen_socket, WebSocket } from "uWebSockets.js"; +import uWS, { TemplatedApp, us_listen_socket } from "uWebSockets.js"; import Provider from "./provider"; - -const noop = ()=>{}; +import WebsocketServer from "./server/websocket-server"; +import HttpServer from "./server/http-server"; type JsonRpc = { id: string, @@ -28,157 +28,24 @@ interface JsonRpcResponsePayload extends JsonRpc { error?: JsonRpcError } - // 1001 indicates that an endpoint is "going away", such as a server - // going down or a browser having navigated away from a page. -enum WebSocketCloseCodes { - CLOSE_GOING_AWAY = 1001, - CLOSE_PROTOCOL_ERROR = 1002 -}; - -enum ContentTypes { - PLAIN = "text/plain", - JSON = "application/json" -} - -function rpcError(id: string, code: string, msg: any) { - return JSON.stringify({ - jsonrpc: "2.0", - id: id, - error: { - code: code, - message: msg - } - }); -} - -function sendResponse(response:HttpResponse, statusCode: number, contentType?: string, data?: RecognizedString, writeHeaders: (response:HttpResponse)=>void = noop): void { - response.writeStatus(statusCode.toString()); - writeHeaders(response); - if (contentType) { - response.writeHeader("Content-Type", contentType); - } - response.end(data) -} -/** - * - */ export default class Server { private _options: ServerOptions; private _listenSocket: us_listen_socket; - private _app: any; + private _app: TemplatedApp; private _provider: Provider; - private _connections: Set = new Set(); + private _websocketServer: WebsocketServer; + private _httpServer: HttpServer; constructor(options?: ServerOptions) { - const _options = this._options = Object.assign(getDefaultServerOptions(), options); - this._provider = new Provider(_options); + const _options = this._options = getDefaultServerOptions(options); + const provider = this._provider = new Provider(_options); const app = this._app = uWS.App(null); if (_options.ws) { - app - .ws("/", { - /* Options */ - compression: (uWS as any).SHARED_COMPRESSOR, - maxPayloadLength: 16 * 1024 * 1024, - idleTimeout: 10, //seconds - /* Handlers */ - open: (ws: any) => { - console.log("A WebSocket connected"); - this._connections.add(ws); - }, - message: async (ws: any, message: ArrayBuffer, isBinary: boolean) => { - let payload: any; - try { - payload = JSON.parse(Buffer.from(message) as any); - } catch (e) { - ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); - return; - } - const method = payload.method; - - const result = await this._provider.send(method, payload.params); - // The socket may have closed while we were waiting for the response - // Don't bother trying to send to it now. - if (!ws.closed) { - const json = { - "id": payload.id, - "jsonrpc":"2.0", - "result": result - }; - ws.send(JSON.stringify(json), isBinary, true); - } - }, - drain: (ws: WebSocket) => { - console.log("WebSocket backpressure: " + ws.getBufferedAmount()); - }, - close: (ws: WebSocket) => { - console.log("A WebSocket disconnected"); - this._connections.delete(ws); - ws.closed = true; - } - }); + this._websocketServer = new WebsocketServer(app, provider); } - app - .post("/", (response: HttpResponse, request: HttpRequest) => { - const writeHeaders = prepareCORSResponseHeaders("POST", request); - - let buffer: Buffer; - response.onData((message: ArrayBuffer, isLast: boolean) => { - const chunk = Buffer.from(message); - if (isLast) { - let payload: any; - try { - const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; - payload = JSON.parse(message); - } catch (e) { - sendResponse(response, 400, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); - return; - } - const method = payload.method as string; - - // http connections do not support subscriptions - if (method === "eth_subscribe" || method === "eth_unsubscribe") { - sendResponse(response, 400, ContentTypes.JSON, rpcError(payload.id, "-32000", "notifications not supported"), writeHeaders); - } else { - this._provider.send(method, payload.params).then((result) => { - if(!response.aborted){ - const json = { - "id": payload.id, - "jsonrpc":"2.0", - "result": result - }; - sendResponse(response, 200, ContentTypes.JSON, JSON.stringify(json), writeHeaders); - } - }); - } - } else { - if (buffer) { - buffer = Buffer.concat([buffer, chunk]); - } else { - buffer = Buffer.concat([chunk]); - } - } - }); - response.onAborted(() => { - response.aborted = true; - }); - }).options("/", (response: HttpResponse, request: HttpRequest) => { - const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); - // OPTIONS responses don't have a body, so respond with `204 No Content` - sendResponse(response, 204, null, null, writeHeaders); - }).get("/418", (response: HttpResponse) => { - // Because Easter Eggs are fun. - sendResponse(response, 418, ContentTypes.PLAIN, "418 I'm a teapot"); - }) - .any("/", (response: HttpResponse) => { - // any other request to "/" is not allowed, so respond with `405 Method Not Allowed` - sendResponse(response, 405, ContentTypes.PLAIN, "405 Method Not Allowed"); - }) - .any("/*", (response: HttpResponse) => { - // all other requests don't mean anything to us, so respond with `404 NOT FOUND` - sendResponse(response, 404, ContentTypes.PLAIN, "404 Not Found"); - }); + this._httpServer = new HttpServer(app, provider); } async listen(port: number, callback?: (err: Error) => void): Promise { @@ -190,7 +57,7 @@ export default class Server { this._app.listen(port, resolve); }); - if(listenSocket){ + if (listenSocket) { this._listenSocket = listenSocket; err = null; } else { @@ -198,6 +65,7 @@ export default class Server { } } + // support legacy callback style if (typeof callback === "function") { callback(err); } else if (err){ @@ -211,62 +79,9 @@ export default class Server { // close the socket to prevent any more connections uWS.us_listen_socket_close(listenSocket); // close all the currently connection websockets: - this._connections.forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); + this._websocketServer.close() + this._httpServer.close(); this._listenSocket = undefined; } } } - -/** - * uWS doesn't let us use the request after the - * @param method - * @param request - */ -function prepareCORSResponseHeaders(method: string, request: HttpRequest) { - // https://fetch.spec.whatwg.org/#http-requests - const origin = request.getHeader("origin"); - const acrh = request.getHeader("access-control-request-headers"); - return (response: HttpResponse) => { - const isCORSRequest = true || origin !== ""; - if (isCORSRequest) { - // OPTIONS preflight requests need a little extra treatment - if (method === "OPTIONS") { - // we only allow POST requests, so it doesn't matter which method the request is asking for - response.writeHeader("Access-Control-Allow-Methods", "POST"); - // echo all requested access-control-request-headers back to the response - if (acrh !== "") { - response.writeHeader("Access-Control-Allow-Headers", acrh); - } - // Safari needs Content-Length = 0 for a 204 response otherwise it hangs forever - // https://github.com/expressjs/cors/pull/121#issue-130260174 - response.writeHeader("Content-Length", "0"); - - // Make browsers and compliant clients cache the OPTIONS preflight response for 10 - // minutes (this is the maximum time Chromium allows) - response.writeHeader("Access-Control-Max-Age", "600"); // seconds - } - - // From the spec: https://fetch.spec.whatwg.org/#http-responses - // "For a CORS-preflight request, request’s credentials mode is always "omit", - // but for any subsequent CORS requests it might not be. Support therefore - // needs to be indicated as part of the HTTP response to the CORS-preflight request as well.", so this - // header is added to all requests. - // Additionally, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials, - // states that there aren't any HTTP Request headers that indicate you whether or not Request.withCredentials - // is set. Because web3@1.0.0-beta.35-? always sets `request.withCredentials = true` while Safari requires it be - // returned even when no credentials are set in the browser this header must always be return on all requests. - // (I've found that Chrome and Firefox don't actually require the header when credentials aren't set) - // Regression Commit: https://github.com/ethereum/web3.js/pull/1722 - // Open Web3 Issue: https://github.com/ethereum/web3.js/issues/1802 - response.writeHeader("Access-Control-Allow-Credentials", "true"); - - // From the spec: "It cannot be reliably identified as participating in the CORS protocol - // as the `Origin` header is also included for all requests whose method is neither - // `GET` nor `HEAD`." - // Explicitly set the origin instead of using *, since credentials - // can't be used in conjunction with *. This will always be set - /// for valid preflight requests. - response.writeHeader("Access-Control-Allow-Origin", origin); - } - } -} \ No newline at end of file diff --git a/src/server/content-types.ts b/src/server/content-types.ts new file mode 100644 index 0000000000..cbb8a65492 --- /dev/null +++ b/src/server/content-types.ts @@ -0,0 +1,5 @@ +enum ContentTypes { + PLAIN = "text/plain", + JSON = "application/json" +} +export default ContentTypes; diff --git a/src/server/http-server.ts b/src/server/http-server.ts new file mode 100644 index 0000000000..590d23afb6 --- /dev/null +++ b/src/server/http-server.ts @@ -0,0 +1,175 @@ +import { TemplatedApp, HttpResponse, HttpRequest, RecognizedString } from "uWebSockets.js"; +import ContentTypes from "./content-types"; +import rpcError from "./rpc-error"; +import Provider from "../provider"; + +const _handlePost = Symbol("handlePost"); +const _handleOptions = Symbol("handleOptions"); +const _provider = Symbol("provider"); +const noop = () => { }; + +/** + * uWS doesn't let us use the request after the request method has completed. + * But we can't set headers until after the statusCode is set. But we don't + * know the status code until the provider returns asynchronously. + * So this does request-related work immediately and returns a function to do the + * rest of the work later. + * @param method + * @param request + */ +function prepareCORSResponseHeaders(method: string, request: HttpRequest) { + // https://fetch.spec.whatwg.org/#http-requests + const origin = request.getHeader("origin"); + const acrh = request.getHeader("access-control-request-headers"); + return (response: HttpResponse) => { + const isCORSRequest = true || origin !== ""; + if (isCORSRequest) { + // OPTIONS preflight requests need a little extra treatment + if (method === "OPTIONS") { + // we only allow POST requests, so it doesn't matter which method the request is asking for + response.writeHeader("Access-Control-Allow-Methods", "POST"); + // echo all requested access-control-request-headers back to the response + if (acrh !== "") { + response.writeHeader("Access-Control-Allow-Headers", acrh); + } + // Safari needs Content-Length = 0 for a 204 response otherwise it hangs forever + // https://github.com/expressjs/cors/pull/121#issue-130260174 + response.writeHeader("Content-Length", "0"); + + // Make browsers and compliant clients cache the OPTIONS preflight response for 10 + // minutes (this is the maximum time Chromium allows) + response.writeHeader("Access-Control-Max-Age", "600"); // seconds + } + + // From the spec: https://fetch.spec.whatwg.org/#http-responses + // "For a CORS-preflight request, request’s credentials mode is always "omit", + // but for any subsequent CORS requests it might not be. Support therefore + // needs to be indicated as part of the HTTP response to the CORS-preflight request as well.", so this + // header is added to all requests. + // Additionally, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials, + // states that there aren't any HTTP Request headers that indicate you whether or not Request.withCredentials + // is set. Because web3@1.0.0-beta.35-? always sets `request.withCredentials = true` while Safari requires it be + // returned even when no credentials are set in the browser this header must always be return on all requests. + // (I've found that Chrome and Firefox don't actually require the header when credentials aren't set) + // Regression Commit: https://github.com/ethereum/web3.js/pull/1722 + // Open Web3 Issue: https://github.com/ethereum/web3.js/issues/1802 + response.writeHeader("Access-Control-Allow-Credentials", "true"); + + // From the spec: "It cannot be reliably identified as participating in the CORS protocol + // as the `Origin` header is also included for all requests whose method is neither + // `GET` nor `HEAD`." + // Explicitly set the origin instead of using *, since credentials + // can't be used in conjunction with *. This will always be set + /// for valid preflight requests. + response.writeHeader("Access-Control-Allow-Origin", origin); + } + } +} + + +function sendResponse(response: HttpResponse, statusCode: number, contentType?: RecognizedString, data?: RecognizedString, writeHeaders: (response: HttpResponse) => void = noop): void { + response.writeStatus(statusCode.toString()); + writeHeaders(response); + if (contentType) { + response.writeHeader("Content-Type", contentType); + } + response.end(data) +} + +type JsonRpcRequest = { + id: string, + jsonrpc: string, + method: string, + params?: Array +} + +function parse(message: string): JsonRpcRequest { + return JSON.parse(message); +} + +export default class HttpServer { + private [_provider]: Provider; + constructor(app: TemplatedApp, provider: Provider) { + this[_provider] = provider; + + // JSON-RPC routes... + app + .post("/", this[_handlePost].bind(this)) + .options("/", this[_handleOptions].bind(this)); + + // because Easter Eggs are fun... + app.get("/418", (response: HttpResponse) => { + sendResponse(response, 418, ContentTypes.PLAIN, "418 I'm a teapot"); + }); + + // fallback routes... + app + .any("/", (response: HttpResponse) => { + // any other request to "/" is not allowed, so respond with `405 Method Not Allowed`... + sendResponse(response, 405, ContentTypes.PLAIN, "405 Method Not Allowed"); + }) + .any("/*", (response: HttpResponse) => { + // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... + sendResponse(response, 404, ContentTypes.PLAIN, "404 Not Found"); + }); + } + + private [_handlePost](response: HttpResponse, request: HttpRequest) { + // handle JSONRPC post requests... + const writeHeaders = prepareCORSResponseHeaders("POST", request); + + let buffer: Buffer; + response.onData((message: ArrayBuffer, isLast: boolean) => { + const chunk = Buffer.from(message); + if (isLast) { + let payload: JsonRpcRequest; + try { + const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; + payload = parse(message); + } catch (e) { + sendResponse(response, 400, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); + return; + } + const method = payload.method; + + // http connections do not support subscriptions + if (method === "eth_subscribe" || method === "eth_unsubscribe") { + sendResponse(response, 400, ContentTypes.JSON, rpcError(payload.id, "-32000", "notifications not supported"), writeHeaders); + } else { + // `await`ing the `provider.send` instead of using `then` + // causes uWS to delay cleaning up the `request` object + this[_provider].send(method, payload.params) + .then((result) => { + if (!response.aborted) { + const json = { + "id": payload.id, + "jsonrpc": "2.0", + "result": result + }; + sendResponse(response, 200, ContentTypes.JSON, JSON.stringify(json), writeHeaders); + } + }); + } + } else { + if (buffer) { + buffer = Buffer.concat([buffer, chunk]); + } else { + buffer = Buffer.concat([chunk]); + } + } + }); + response.onAborted(() => { + response.aborted = true; + }); + } + + private [_handleOptions](response: HttpResponse, request: HttpRequest) { + // handle CORS preflight requests... + const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); + // OPTIONS responses don't have a body, so respond with `204 No Content`... + sendResponse(response, 204, null, null, writeHeaders); + } + public close() { + // currently a no op. + } +}; diff --git a/src/server/rpc-error.ts b/src/server/rpc-error.ts new file mode 100644 index 0000000000..179433bed5 --- /dev/null +++ b/src/server/rpc-error.ts @@ -0,0 +1,10 @@ +export default function rpcError(id: string, code: string, msg: any) { + return JSON.stringify({ + jsonrpc: "2.0", + id: id, + error: { + code: code, + message: msg + } + }); +} \ No newline at end of file diff --git a/src/server/websocket-close-codes.ts b/src/server/websocket-close-codes.ts new file mode 100644 index 0000000000..7ddd05d9ac --- /dev/null +++ b/src/server/websocket-close-codes.ts @@ -0,0 +1,7 @@ +// 1001 indicates that an endpoint is "going away", such as a server +// going down or a browser having navigated away from a page. +enum WebSocketCloseCodes { + CLOSE_GOING_AWAY = 1001, + CLOSE_PROTOCOL_ERROR = 1002 +}; +export default WebSocketCloseCodes; diff --git a/src/server/websocket-server.ts b/src/server/websocket-server.ts new file mode 100644 index 0000000000..1217dd7073 --- /dev/null +++ b/src/server/websocket-server.ts @@ -0,0 +1,54 @@ +import uWS, { TemplatedApp, WebSocket } from "uWebSockets.js"; +import WebSocketCloseCodes from "./websocket-close-codes"; +import Provider from "../provider"; + +const connections = Symbol("connections"); + +export default class WebsocketServer { + private [connections] = new Set(); + constructor(app: TemplatedApp, provider: Provider) { + app.ws("/", { + /* WS Options */ + compression: (uWS as any).SHARED_COMPRESSOR, // Zero memory overhead compression + maxPayloadLength: 16 * 1024, // 128 Kibibits + idleTimeout: 120, // in seconds + + /* Handlers */ + open: (ws: any) => { + this[connections].add(ws); + }, + message: async (ws: any, message: ArrayBuffer, isBinary: boolean) => { + let payload: any; + try { + payload = JSON.parse(Buffer.from(message) as any); + } catch (e) { + ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); + return; + } + const method = payload.method; + + const result = await provider.send(method, payload.params); + // The socket may have closed while we were waiting for the response + // Don't bother trying to send to it now. + if (!ws.closed) { + const json = { + "id": payload.id, + "jsonrpc": "2.0", + "result": result + }; + ws.send(JSON.stringify(json), isBinary, true); + } + }, + drain: (ws: WebSocket) => { + console.log("WebSocket backpressure: " + ws.getBufferedAmount()); + }, + close: (ws: WebSocket) => { + this[connections].delete(ws); + ws.closed = true; + } + }); + } + close() { + this[connections].forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); + } +}; diff --git a/test/server.ts b/test/server.ts index cecefbfca5..0c9bec0520 100644 --- a/test/server.ts +++ b/test/server.ts @@ -6,8 +6,9 @@ import Server from "../src/server"; import { ServerOptions } from "../src/server"; -describe("server", () => { +describe.only("server", () => { const port = 8545; + const netVersion = "1234"; const jsonRpcJson: any = { jsonrpc: "2.0", id: "1", @@ -17,60 +18,61 @@ describe("server", () => { let s: Server; beforeEach("setup", async ()=>{ s = Ganache.server({ - network_id: 1234 + network_id: netVersion } as ServerOptions); await s.listen(port); }) describe("http", () => { - it.only("returns things", async () => { + it("returns the net_version", async () => { const response = await request .post('http://localhost:' + port) - .send(jsonRpcJson) - .set('accept', 'json'); + .send(jsonRpcJson); const json = JSON.parse(response.text) - assert.ok(json); + assert.strictEqual(json.result, netVersion); }); }); describe("websocket", () => { - it("returns things over a websocket", async () => { + it("returns the net_version over a websocket", async () => { const ws = new WebSocket('ws://localhost:' + port); - const result: any = await new Promise((resolve) => { + const response: any = await new Promise((resolve) => { ws.on("open", () => { ws.send(JSON.stringify(jsonRpcJson)); }); ws.on('message', resolve); }); - const json = JSON.parse(result); - assert.ok(json); + const json = JSON.parse(response); + assert.strictEqual(json.result, netVersion); }); - it("returns things over a websocket as binary", async () => { + it("returns the net_version over a websocket as binary", async () => { const ws = new WebSocket('ws://localhost:' + port); - const result: any = await new Promise((resolve) => { + const response: any = await new Promise((resolve) => { ws.on("open", () => { const strToAB = (str: string) => new Uint8Array(str.split('').map(c => c.charCodeAt(0))).buffer; ws.send(strToAB(JSON.stringify(jsonRpcJson))); }); ws.on('message', resolve); }); - const json = JSON.parse(result); - assert.ok(json); + assert.strictEqual(response.constructor, Buffer, "response doesn't seem to be a Buffer as expect"); + const json = JSON.parse(response); + assert.strictEqual(json.result, netVersion, "Binary data result is not as expected"); }); it("doesn't crash when sending bad data over http", async () => { await assert.rejects(request .post('http://localhost:' + port) - .send("This is _not_ pudding") - , /^Error: Bad Request$/); + .send("This is _not_ pudding.") + , { + message: "Bad Request" + }); const response = await request .post('http://localhost:' + port) - .send(jsonRpcJson) - .set('accept', 'json'); + .send(jsonRpcJson); const json = JSON.parse(response.text) - assert.ok(json); + assert.strictEqual(json.result, netVersion); }); it("doesn't crash when sending bad data over websocket", async () => { @@ -88,5 +90,5 @@ describe("server", () => { afterEach("teardown", ()=>{ s && s.close(); s = undefined; - }) + }); }); From 990ccce5eecec0838b9941bdcce09ecdcf49e36b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 27 Mar 2019 18:39:28 -0400 Subject: [PATCH 006/691] fixes --- src/options/options.ts | 59 ++++++++++++++-------------------- src/provider.ts | 2 +- src/server/websocket-server.ts | 2 +- test/provider.ts | 8 +++-- test/server.ts | 2 +- tsconfig.json | 4 +-- typings/index.d.ts | 7 ++++ 7 files changed, 41 insertions(+), 43 deletions(-) create mode 100644 typings/index.d.ts diff --git a/src/options/options.ts b/src/options/options.ts index 97ee1745e8..c43581f713 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -10,7 +10,7 @@ interface Logger { } export default interface Options { - ledger: ILedger, + ledger?: ILedger, /** * Array of Accounts. Each object should have a balance key with a hexadecimal * value. The key secretKey can also be specified, which represents the @@ -18,43 +18,43 @@ export default interface Options { * the given balance. If specified, the key is used to determine the account's * address. */ - accounts: Array, + accounts?: Array, /** * Output VM opcodes for debugging. Defaults to `false` */ - debug: boolean, + debug?: boolean, /** * An object, like console, that implements a log() function. */ - logger: Logger, + logger?: Logger, /** * Use a specific HD wallet mnemonic to generate initial addresses. */ - mnemonic: string, + mnemonic?: string, /** * Use arbitrary data to generate the HD wallet mnemonic to be used. */ - seed: string, + seed?: string, /** * The default account balance, specified in ether. Defaults to `100` ether */ - default_balance_ether: JSBI, + default_balance_ether?: JSBI, /** * Number of accounts to generate at startup. Default to `10`. */ - total_accounts: JSBI, + total_accounts?: JSBI, /** * When a string, same as --fork option above. Can also be a Web3 Provider * object, optionally used in conjunction with the fork_block_number */ - fork: string | object, + fork?: string | object, /** * Block number the provider should fork from, when the fork option is @@ -62,103 +62,94 @@ export default interface Options { * sign and a block number, the block number in the fork parameter takes * precedence. */ - fork_block_number: string | JSBI, + fork_block_number?: string | JSBI, /** * Same as --networkId option above. */ - network_id: string, + network_id?: string | number, /** * Date that the first block should start. Use this feature, along with the * evm_increaseTime method to test time-dependent code. */ - time: Date, + time?: Date, /** * Whether or not accounts are locked by default. Defaults to `false` */ - locked: boolean, + locked?: boolean, /** * Array of addresses or address indexes specifying which accounts should be unlocked. */ - unlocked_accounts: Array, + unlocked_accounts?: Array, /** * Specify a path to a directory to save the chain database. If a database * already exists, that chain will be initialized instead of creating a new * one. */ - db_path: String, + db_path?: string, /** * Specify an alternative database instance, for instance MemDOWN. */ - db: Object, + db?: object, /** * Whether to report runtime errors from EVM code as RPC errors. * This is `true` by default to replicate the error reporting behavior of * previous versions of ganache. */ - vmErrorsOnRPCResponse: boolean, + vmErrorsOnRPCResponse?: boolean, /** * The hierarchical deterministic path to use when generating accounts. * Default: "m/44'/60'/0'/0/" */ - hdPath: string, + hdPath?: string, /** * Allows unlimited contract sizes while debugging. By setting this to true, the check within the EVM for contract size limit of 24KB (see EIP-170) is bypassed. Setting this to true will cause ganache-core to behave differently than production environments. (default: false; ONLY set to true during debugging). */ - allowUnlimitedContractSize: boolean, + allowUnlimitedContractSize?: boolean, /** * Sets the default gas price for transactions if not otherwise specified. * Must be specified as a hex string in wei. Defaults to "0x77359400", or 2 gwei. */ - gasPrice: HexQuantity, + gasPrice?: HexQuantity, /** * Sets the block gas limit. Must be specified as a hex string. Defaults to * "0x6691b7". */ - gasLimit: HexQuantity, + gasLimit?: HexQuantity, /** * */ - verbose: boolean, + verbose?: boolean, /** * */ - asyncRequestProcessing: boolean, + asyncRequestProcessing?: boolean, }; export const getDefault: (options: Options)=> Options = (options) => { - const network_id = options.network_id || Date.now().toString(); + const network_id = (options.network_id || Date.now()).toString(); return Object.assign({ ledger: new Ethereum({net_version: network_id}), - accounts: null, debug: false, logger: {log: () => {}}, - mnemonic: null, - seed: null, default_balance_ether: JSBI.BigInt(100), total_accounts: JSBI.BigInt(10), - fork: null, - fork_block_number: null, network_id, - time: null, locked: false, - unlocked_accounts: null, - db_path: null, - db: null, vmErrorsOnRPCResponse: true, hdPath: "m/44'/60'/0'/0/", - allowUnlimitedContractSize:true, + allowUnlimitedContractSize: true, gasPrice: new HexQuantity("0x77359400"), gasLimit: new HexQuantity("0x6691b7"), verbose: false, diff --git a/src/provider.ts b/src/provider.ts index 7f1de31e8c..8b59e820c1 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -26,7 +26,7 @@ export default class Provider extends EventEmitter { // set up our request processor to either use FIFO or or async request processing this._requestProcessor = new RequestProcessor(_options.asyncRequestProcessing ? 1 : 0); - this._engine = new Engine(_options.ledger || new Ethereum({net_version: _options.network_id})); + this._engine = new Engine(_options.ledger || new Ethereum({net_version: _options.network_id.toString()})); } public send(payload: Payload, callback?: Callback): void diff --git a/src/server/websocket-server.ts b/src/server/websocket-server.ts index 1217dd7073..1460fe3ad1 100644 --- a/src/server/websocket-server.ts +++ b/src/server/websocket-server.ts @@ -9,7 +9,7 @@ export default class WebsocketServer { constructor(app: TemplatedApp, provider: Provider) { app.ws("/", { /* WS Options */ - compression: (uWS as any).SHARED_COMPRESSOR, // Zero memory overhead compression + compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression maxPayloadLength: 16 * 1024, // 128 Kibibits idleTimeout: 120, // in seconds diff --git a/test/provider.ts b/test/provider.ts index 845da2c925..fb9bf4b49e 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -2,9 +2,11 @@ import Ganache from "../index" import * as assert from "assert"; describe("provider", () => { - it("returns things", async ()=>{ - const p = Ganache.provider(); + it("returns things", async () => { + const p = Ganache.provider({ + network_id: "1234" + }); const version = await p.send("net_version"); - assert.ok(version); + assert.strictEqual(version, "1234"); }); }); diff --git a/test/server.ts b/test/server.ts index 0c9bec0520..9eecdefe35 100644 --- a/test/server.ts +++ b/test/server.ts @@ -6,7 +6,7 @@ import Server from "../src/server"; import { ServerOptions } from "../src/server"; -describe.only("server", () => { +describe("server", () => { const port = 8545; const netVersion = "1234"; const jsonRpcJson: any = { diff --git a/tsconfig.json b/tsconfig.json index fa4d3a86af..52208b3587 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,9 +7,7 @@ "moduleResolution": "node", "sourceMap": true, "outDir": "dist", - "baseUrl": ".", - "lib": ["dom", "es2017"], - "rootDir": "./" + "lib": ["dom", "es2017"] }, "include": [ "./index.ts", diff --git a/typings/index.d.ts b/typings/index.d.ts new file mode 100644 index 0000000000..78655cf6cb --- /dev/null +++ b/typings/index.d.ts @@ -0,0 +1,7 @@ +import "uWebSockets.js" + +declare module "uWebSockets.js" { + export const DISABLED:number; + export const SHARED_COMPRESSOR:number; + export const DEDICATED_COMPRESSOR:number; +} From 907222f40eea859a1dcc77513a0b7488688ae5e3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 27 Mar 2019 18:39:51 -0400 Subject: [PATCH 007/691] make optional --- src/options/provider-options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 097e5407ef..58f2d2ae92 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -4,7 +4,7 @@ export default interface ProviderOptions extends Options { /** * Array of strings to installed subproviders */ - subProviders: Array + subProviders?: Array } export const getDefault : (options: ProviderOptions) => ProviderOptions = (options) => { From 6bbdd5f203c7b4df6d4cc2895c32d055da674547 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 28 Mar 2019 15:41:00 -0400 Subject: [PATCH 008/691] lots --- npm-shrinkwrap.json | 785 +++++++++++++++--- package.json | 14 +- src/engine.ts | 16 +- src/interfaces/ledger-options.ts | 3 + src/interfaces/ledger.ts | 2 +- src/ledgers/ethereum/blockchain.ts | 63 ++ src/ledgers/ethereum/ledger.ts | 152 +++- src/ledgers/ethereum/options.ts | 5 +- src/options/options.ts | 15 +- src/options/provider-options.ts | 2 +- src/provider.ts | 52 +- src/server.ts | 82 +- src/server/http-server.ts | 175 ---- src/servers/http-server.ts | 181 ++++ .../utils}/content-types.ts | 0 src/{server => servers/utils}/rpc-error.ts | 0 .../utils}/websocket-close-codes.ts | 0 src/servers/ws-server..ts | 0 .../ws-server.ts} | 12 +- src/types/hex-data.ts | 48 +- src/types/hex-quantity.ts | 17 +- src/types/tags.ts | 35 + test/provider.ts | 49 +- tsconfig.json | 6 +- typings/ethereumjs-block/header.d.ts | 55 ++ typings/ethereumjs-block/index.d.ts | 40 + typings/ethereumjs-blockchain/index.d.ts | 31 + typings/levelup/index.d.ts | 83 ++ typings/merkle-patricia-tree/baseTrie.d.ts | 41 + typings/merkle-patricia-tree/index.d.ts | 28 + typings/merkle-patricia-tree/readStream.d.ts | 10 + typings/merkle-patricia-tree/trieNode.d.ts | 41 + typings/superagent.d.ts | 4 + typings/{index.d.ts => uWebsockets.js.ts} | 0 34 files changed, 1629 insertions(+), 418 deletions(-) create mode 100644 src/ledgers/ethereum/blockchain.ts delete mode 100644 src/server/http-server.ts rename src/{server => servers/utils}/content-types.ts (100%) rename src/{server => servers/utils}/rpc-error.ts (100%) rename src/{server => servers/utils}/websocket-close-codes.ts (100%) delete mode 100644 src/servers/ws-server..ts rename src/{server/websocket-server.ts => servers/ws-server.ts} (82%) create mode 100644 src/types/tags.ts create mode 100644 typings/ethereumjs-block/header.d.ts create mode 100644 typings/ethereumjs-block/index.d.ts create mode 100644 typings/ethereumjs-blockchain/index.d.ts create mode 100644 typings/levelup/index.d.ts create mode 100644 typings/merkle-patricia-tree/baseTrie.d.ts create mode 100644 typings/merkle-patricia-tree/index.d.ts create mode 100644 typings/merkle-patricia-tree/readStream.d.ts create mode 100644 typings/merkle-patricia-tree/trieNode.d.ts create mode 100644 typings/superagent.d.ts rename typings/{index.d.ts => uWebsockets.js.ts} (100%) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 1a8993cb60..a068cd7c78 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4,16 +4,39 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/abstract-leveldown": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-5.0.1.tgz", + "integrity": "sha512-wYxU3kp5zItbxKmeRYCEplS2MW7DzyBnxPGj+GJVHZEUZiK/nn5Ei1sUFgURDh+X051+zsGe28iud3oHjrYWQQ==" + }, + "@types/bn.js": { + "version": "4.11.4", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.4.tgz", + "integrity": "sha512-AO8WW+aRcKWKQAYTfKLzwnpL6U+TfPqS+haRrhCy5ff04Da8WZud3ZgVjspQXaEXJDcTlsjUEVvL39wegDek5w==", + "requires": { + "@types/node": "*" + } + }, "@types/cookiejar": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz", "integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==", "dev": true }, + "@types/ethereumjs-tx": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/ethereumjs-tx/-/ethereumjs-tx-1.0.1.tgz", + "integrity": "sha512-UtucmY/WoMCDhNebyFJQ+AevyFGeTgh8UYZE1aWqIRkk90E+eKWgGV2lAVjkg/gXqxLkJYZ0RcV1J09K9xlSvw==", + "requires": { + "@types/bn.js": "*", + "@types/node": "*" + } + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true }, "@types/mocha": { "version": "5.2.5", @@ -40,6 +63,7 @@ "version": "0.13.2", "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", + "dev": true, "requires": { "@types/events": "*", "@types/node": "*" @@ -56,18 +80,12 @@ } }, "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.1.tgz", + "integrity": "sha512-8ccQIKHwmh7rIRWvKGgSTM2LByLWpLZgAYRjDNOh1ZTXvlR0gtm2Ir7aD8rEUre8DMllchJJTAZhhN5aUBN7XA==", "requires": { + "level-concat-iterator": "~2.0.0", "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } } }, "ansi-colors": { @@ -320,6 +338,15 @@ "safe-buffer": "^5.0.1" } }, + "browserify-sha3": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.4.tgz", + "integrity": "sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY=", + "requires": { + "js-sha3": "^0.6.1", + "safe-buffer": "^5.1.1" + } + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -593,11 +620,12 @@ "dev": true }, "deferred-leveldown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", - "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.0.0.tgz", + "integrity": "sha512-QtTcNm2PX7elim5bGl+i3px2kVbpI49BV+Q62CFh0AaMlrdlbMXyozBg31p2zJqAAT35FUw4eccC+drr3D0+vQ==", "requires": { - "abstract-leveldown": "~2.6.0" + "abstract-leveldown": "~6.0.0", + "inherits": "^2.0.3" } }, "define-properties": { @@ -692,6 +720,46 @@ "minimalistic-crypto-utils": "^1.0.0" } }, + "encoding-down": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", + "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", + "requires": { + "abstract-leveldown": "^5.0.0", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0", + "xtend": "^4.0.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "level-codec": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.0.tgz", + "integrity": "sha512-OIpVvjCcZNP5SdhcNupnsI1zo5Y9Vpm+k/F1gfG5kXrtctlrwanisakweJtE0uA0OpLukRfOQae+Fg0M5Debhg==" + }, + "level-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.0.tgz", + "integrity": "sha512-AmY4HCp9h3OiU19uG+3YWkdELgy05OTP/r23aNHaQKWv8DO787yZgsEuGVkoph40uwN+YdUKnANlrxSsoOaaxg==", + "requires": { + "errno": "~0.1.1" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } + } + }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -752,6 +820,36 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, + "ethashjs": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.7.tgz", + "integrity": "sha1-ML/kGWcmaQoMWdO4Jy5w1NDDS64=", + "requires": { + "async": "^1.4.2", + "buffer-xor": "^1.0.3", + "ethereumjs-util": "^4.0.1", + "miller-rabin": "^4.0.0" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", + "integrity": "sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=", + "requires": { + "bn.js": "^4.8.0", + "create-hash": "^1.1.2", + "keccakjs": "^0.2.0", + "rlp": "^2.0.0", + "secp256k1": "^3.0.1" + } + } + } + }, "ethereum-common": { "version": "0.0.18", "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", @@ -806,6 +904,29 @@ "merkle-patricia-tree": "^2.1.2" }, "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, "ethereumjs-util": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", @@ -820,6 +941,175 @@ "secp256k1": "^3.0.1" } }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + } + } + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "ethereumjs-blockchain": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-3.4.0.tgz", + "integrity": "sha512-wxPSmt6EQjhbywkFbftKcb0qRFIZWocHMuDa8/AB4eWL/UPYalNcDyLaxYbrDytmhHid3Uu8G/tA3C/TxZBuOQ==", + "requires": { + "async": "^2.6.1", + "ethashjs": "~0.0.7", + "ethereumjs-block": "~2.2.0", + "ethereumjs-common": "^1.1.0", + "ethereumjs-util": "~6.0.0", + "flow-stoplight": "^1.0.0", + "level-mem": "^3.0.1", + "lru-cache": "^5.1.1", + "safe-buffer": "^5.1.2", + "semaphore": "^1.1.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.0.0.tgz", + "integrity": "sha512-E3yKUyl0Fs95nvTFQZe/ZSNcofhDzUsDlA5y2uoRmf1+Ec7gpGhNCsgKkZBRh7Br5op8mJcYF/jFbmjj909+nQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.6", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, "keccak": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", @@ -919,10 +1209,183 @@ "safe-buffer": "^5.1.1" }, "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + } + } + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + }, "rustbn.js": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } } } }, @@ -1173,6 +1636,11 @@ } } }, + "flow-stoplight": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", + "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -1609,6 +2077,11 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, + "js-sha3": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", + "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" + }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -1625,11 +2098,6 @@ "esprima": "^4.0.0" } }, - "jsbi": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-2.0.5.tgz", - "integrity": "sha512-TzO/62Hxeb26QMb4IGlI/5X+QLr9Uqp1FPkwp2+KOICW+Q+vSuFj61c8pkT6wAns4WcK56X7CmSHhJeDGWOqxQ==" - }, "keccak": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.0.0.tgz", @@ -1641,6 +2109,15 @@ "safe-buffer": "^5.1.0" } }, + "keccakjs": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.3.tgz", + "integrity": "sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg==", + "requires": { + "browserify-sha3": "^0.0.4", + "sha3": "^1.2.2" + } + }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -1661,41 +2138,39 @@ "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" }, + "level-concat-iterator": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.0.tgz", + "integrity": "sha512-gMs7JtWp479SOBjJQteQ+WMctfiQXG1SX5EuIGWTTUP37mKqs6BcYcjfZVVzAdTq0lAcSYpL2xGwmCG/hbjOcg==" + }, "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.0.tgz", + "integrity": "sha512-AmY4HCp9h3OiU19uG+3YWkdELgy05OTP/r23aNHaQKWv8DO787yZgsEuGVkoph40uwN+YdUKnANlrxSsoOaaxg==", "requires": { "errno": "~0.1.1" } }, "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.0.tgz", + "integrity": "sha512-CHMqFgIGXmqbdfvZcNADxRBXrl2W2EN8stxZnxEDQfEN+oNULcbX1OSK7VqJutp51Z0yJtA4Ym3JJMOuEslTrA==", "requires": { "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", + "readable-stream": "^3.0.2", "xtend": "^4.0.0" }, "dependencies": { "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", + "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", @@ -1703,52 +2178,126 @@ } } }, - "level-ws": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", - "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "level-mem": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", + "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" + "level-packager": "~4.0.0", + "memdown": "~3.0.0" }, "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "memdown": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", + "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", "requires": { - "core-util-is": "~1.0.0", + "abstract-leveldown": "~5.0.0", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" } } }, + "level-packager": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", + "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", + "requires": { + "encoding-down": "~5.0.0", + "levelup": "^3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", + "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", + "requires": { + "abstract-leveldown": "~5.0.0", + "inherits": "^2.0.3" + } + }, + "level-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.0.tgz", + "integrity": "sha512-AmY4HCp9h3OiU19uG+3YWkdELgy05OTP/r23aNHaQKWv8DO787yZgsEuGVkoph40uwN+YdUKnANlrxSsoOaaxg==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", + "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "xtend": "^4.0.0" + } + }, + "levelup": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", + "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", + "requires": { + "deferred-leveldown": "~4.0.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~3.0.0", + "xtend": "~4.0.0" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + } + } + }, + "level-ws": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", + "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.2.8", + "xtend": "^4.0.1" + } + }, "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.0.0.tgz", + "integrity": "sha512-RcWkjtMj1DGs8ftNs4U7MEZeHFnC9QcHn/fmBlOypHXCx02zwukZROzyUwRiu9dgw9y1tCDLFMmXQHEhCChi4w==", + "requires": { + "deferred-leveldown": "~5.0.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", "xtend": "~4.0.0" }, "dependencies": { - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" - }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", @@ -1802,6 +2351,14 @@ } } }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, "ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", @@ -1878,34 +2435,23 @@ "requires": { "xtend": "~4.0.0" } - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" } } }, "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", + "integrity": "sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==", + "requires": { + "async": "^2.6.1", + "ethereumjs-util": "^5.2.0", + "level-mem": "^3.0.1", + "level-ws": "^1.0.0", + "readable-stream": "^3.0.6", "rlp": "^2.0.0", "semaphore": ">=1.0.1" }, "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, "ethereumjs-util": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", @@ -1930,6 +2476,16 @@ "nan": "^2.2.1", "safe-buffer": "^5.1.0" } + }, + "readable-stream": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", + "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } } } }, @@ -1960,6 +2516,15 @@ "to-regex": "^3.0.2" } }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, "mime": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", @@ -2557,6 +3122,21 @@ "safe-buffer": "^5.0.1" } }, + "sha3": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.2.tgz", + "integrity": "sha1-pmxQmN5MJbyIM27ItIF9AFvKe6k=", + "requires": { + "nan": "2.10.0" + }, + "dependencies": { + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" + } + } + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -3205,19 +3785,9 @@ } }, "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - }, - "dependencies": { - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - } - } + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" }, "y18n": { "version": "4.0.0", @@ -3225,6 +3795,11 @@ "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + }, "yargs": { "version": "12.0.5", "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", diff --git a/package.json b/package.json index 7f0a6d12e0..4488879500 100644 --- a/package.json +++ b/package.json @@ -14,17 +14,25 @@ "test": "mocha --require ts-node/register --watch-extensions ts 'test/**/*.{ts}' --recursive --check-leaks" }, "dependencies": { - "@types/uws": "^0.13.2", + "@types/abstract-leveldown": "^5.0.1", + "@types/ethereumjs-tx": "^1.0.1", + "abstract-leveldown": "^6.0.1", + "bn.js": "4.11.8", + "ethereumjs-block": "2.2.0", + "ethereumjs-blockchain": "^3.4.0", + "ethereumjs-tx": "1.3.7", "ethereumjs-vm": "2.6.0", - "jsbi": "2.0.5", "keccak": "2.0.0", + "levelup": "4.0.0", + "merkle-patricia-tree": "3.0.0", "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.8.0" }, "devDependencies": { + "@types/uws": "0.13.2", "@types/mocha": "5.2.5", "@types/node": "10.12.0", "@types/ws": "6.0.1", - "@types/superagent": "^4.1.1", + "@types/superagent": "4.1.1", "bufferutil": "4.0.1", "mocha": "6.0.2", "tslint": "5.14.0", diff --git a/src/engine.ts b/src/engine.ts index 2d5bdd76d6..1f2a3df049 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -1,19 +1,23 @@ import ILedger from "./interfaces/ledger"; +const _ledger = Symbol("ledger"); + export default class Engine { - private ledger:ILedger; + private [_ledger]:ILedger; constructor(ledger: ILedger){ if (!ledger){ throw new Error("yah, that's not right"); } - this.ledger = ledger; + this[_ledger] = ledger; } - public async send(method: string, params: Array): Promise { - if(this.ledger.__proto__.hasOwnProperty(method)){ - const fn = this.ledger[method]; + public async send(method: string, params: any[]): Promise { + const ledger = this[_ledger]; + if (ledger.__proto__.hasOwnProperty(method)) { + const fn = ledger[method]; if (typeof fn === "function") { - return this.ledger[method].apply(this.ledger, params); + return fn.apply(ledger, params); } } + throw new Error(`Invalid method: ${method}`); } } \ No newline at end of file diff --git a/src/interfaces/ledger-options.ts b/src/interfaces/ledger-options.ts index 7a908d418a..da0ede0a13 100644 --- a/src/interfaces/ledger-options.ts +++ b/src/interfaces/ledger-options.ts @@ -1,2 +1,5 @@ +import HexData from "../types/hex-data"; + export default interface LedgerOptions { + accounts?: HexData[] } \ No newline at end of file diff --git a/src/interfaces/ledger.ts b/src/interfaces/ledger.ts index 7fa4ad72f3..d61585a43b 100644 --- a/src/interfaces/ledger.ts +++ b/src/interfaces/ledger.ts @@ -1,5 +1,5 @@ export const optionsSymbol = Symbol("options"); export default interface ILedger { readonly [optionsSymbol]: any; - readonly [key: string]: (params?: Array) => Promise; + readonly [key: string]: (params?: any[]) => Promise; } diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts new file mode 100644 index 0000000000..2849af8299 --- /dev/null +++ b/src/ledgers/ethereum/blockchain.ts @@ -0,0 +1,63 @@ +import EthereumJsBLock from "ethereumjs-block"; +import Tag from "../../types/tags"; +import HexData from "../../types/hex-data"; + +class Account { + public balance: bigint +} + +type AccountManager = { + readonly [index: string]: Promise; +} + +class Block extends EthereumJsBLock { + private _accounts: any; + public accounts: AccountManager + constructor(data: Buffer) { + super(data); + + const self = this; + + this._accounts = { + async getAccount(number: HexData): Promise { + return new Account(); + } + } + this.accounts = new Proxy(this, { + async get (obj, key: any): Promise{ + return self._accounts.getAccount(key); + } + }) as any; + } + +} + +type BlockManager = { + readonly [index: string]: Promise; +} + +export default class Blockchain { + public blocks: BlockManager; + private _blocks: any; + + constructor(){ + const self = this; + this._blocks = { + async getBlock(number: bigint|Tag): Promise { + const b = new Block(Buffer.from([])); + b.header.number = Buffer.from(number.toString(16)); + return b; + } + } + this.blocks = new Proxy(this, { + async get (obj, key: any): Promise{ + return self._blocks.getBlock(key); + } + }) as any; + } + public async latest() { + const block = new Block(Buffer.from([])); + block.header.number = Buffer.from([1]); + return block; + } +} \ No newline at end of file diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index f116322aaa..afa60ec314 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,34 +1,148 @@ +import ILedger, {optionsSymbol as _options} from "../../interfaces/ledger"; +import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options"; +import HexData from "../../types/hex-data"; +import Blockchain from "./blockchain"; +import Tag from "../../types/tags"; + const createKeccakHash = require("keccak"); -import ILedger, {optionsSymbol} from "../../interfaces/ledger"; -import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options" + const hash = createKeccakHash("keccak256"); -import JSBI from "jsbi"; + +const _isMining = Symbol("isMining"); +const _blockchain = Symbol("blockchain"); export default class Ethereum implements ILedger { - readonly [optionsSymbol]: EthereumOptions; + readonly [_options]: EthereumOptions; + private [_isMining]: boolean = false; + private readonly [_blockchain]: Blockchain; constructor(options: EthereumOptions){ - this[optionsSymbol] = Object.assign(getDefaultEthereumOptions(), options); - } - - async net_version(): Promise { - return this[optionsSymbol].net_version; - } - - async net_listening(): Promise { - return true; - } - - async net_peerCount(): Promise { - return JSBI.BigInt(0); + this[_options] = Object.assign(getDefaultEthereumOptions(), options); + this[_blockchain] = new Blockchain(); } + /** + * Returns the current client version. + * @returns The current client version. + */ async web3_clientVersion(): Promise { return "EthereumJS canache-core/v" + 0 + "/ethereum-js"; }; + /** + * Returns Keccak-256 (not the standardized SHA3-256) of the given data. + * @param {string} the data to convert into a SHA3 hash. + * @returns The SHA3 result of the given string. + */ async web3_sha3(string: string): Promise { return hash(string).digest(); }; - readonly [index: string]: (...args: any) => Promise<{}>; -} \ No newline at end of file + /** + * Returns number of peers currently connected to the client. + * @returns {QUANTITY} integer of the number of connected peers. + */ + async net_peerCount(): Promise{ + return 0n; + } + + /** + * Returns the current network id. + * @returns The current network id. + */ + async net_version(): Promise { + return this[_options].net_version; + } + + /** + * Returns true if client is actively listening for network connections. + * @returns true when listening, otherwise false. + */ + async net_listening(): Promise { + return true; + } + + /** + * Returns the current ethereum protocol version. + * @returns The current ethereum protocol version. + */ + async eth_protocolVersion(): Promise { + return "63"; + } + + + /** + * Returns an object with data about the sync status or false. + * @returns An object with sync status data or false, when not syncing: + * startingBlock: {bigint} - The block at which the import started (will only be reset, after the sync reached his head) + * currentBlock: {bigint} - The current block, same as eth_blockNumber + * highestBlock: {bigint} - The estimated highest block + */ + async eth_syncing(): Promise { + return false; + } + + /** + * Returns the client coinbase address. + * @returns 20 bytes - the current coinbase address. + */ + async eth_coinbase(): Promise{ + return this[_options].coinbase; + } + + /** + * Returns true if client is actively mining new blocks. + * @returns returns true of the client is mining, otherwise false. + */ + async eth_mining(): Promise{ + return this[_isMining]; + } + + /** + * Returns the number of hashes per second that the node is mining with. + * @returns number of hashes per second. + */ + async eth_hashrate(): Promise { + return 0n; + } + + /** + * Returns the current price per gas in wei. + * @returns integer of the current gas price in wei. + */ + async eth_gasPrice(): Promise{ + return this[_options].gasPrice; + } + + /** + * Returns a list of addresses owned by client. + * @returns Array of 20 Bytes - addresses owned by the client. + */ + async eth_accounts(): Promise{ + return this[_options].accounts; + } + + /** + * Returns the number of most recent block. + * @returns integer of the current block number the client is on. + */ + async eth_blockNumber(): Promise { + return this[_blockchain].blocks[Tag.LATEST].then((block) => BigInt(block.header.number)); + } + + /** + * Returns the balance of the account of given address. + * @param address 20 Bytes - address to check for balance. + * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter + */ + async eth_getBalance(address: string, blockNumber: bigint|Tag = Tag.LATEST): Promise { + const chain = this[_blockchain]; + const block = await chain.blocks[123]; + const account = await block.accounts[address]; + return BigInt(123); + } + + [index: string]: (...args: any) => Promise<{}>; +} + + +const e = new Ethereum(getDefaultEthereumOptions()); \ No newline at end of file diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 38e1df645f..74ed044ad7 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,7 +1,10 @@ import LedgerOptions from "../../interfaces/ledger-options" +import HexData from "../../types/hex-data"; interface EthereumOptions extends LedgerOptions { - net_version: string + net_version: string, + coinbase?: HexData, + gasPrice?: bigint } export default EthereumOptions; diff --git a/src/options/options.ts b/src/options/options.ts index c43581f713..822354d879 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -3,7 +3,6 @@ import HexData from "../types/hex-data"; import HexQuantity from "../types/hex-quantity"; import ILedger from "../interfaces/ledger"; import Ethereum from "../ledgers/ethereum/ledger"; -import JSBI from "jsbi"; interface Logger { log(message?: any, ...optionalParams: any[]): void; @@ -18,7 +17,7 @@ export default interface Options { * the given balance. If specified, the key is used to determine the account's * address. */ - accounts?: Array, + accounts?: Account[], /** * Output VM opcodes for debugging. Defaults to `false` @@ -43,12 +42,12 @@ export default interface Options { /** * The default account balance, specified in ether. Defaults to `100` ether */ - default_balance_ether?: JSBI, + default_balance_ether?: bigint, /** * Number of accounts to generate at startup. Default to `10`. */ - total_accounts?: JSBI, + total_accounts?: bigint, /** * When a string, same as --fork option above. Can also be a Web3 Provider @@ -62,7 +61,7 @@ export default interface Options { * sign and a block number, the block number in the fork parameter takes * precedence. */ - fork_block_number?: string | JSBI, + fork_block_number?: string | bigint, /** * Same as --networkId option above. @@ -83,7 +82,7 @@ export default interface Options { /** * Array of addresses or address indexes specifying which accounts should be unlocked. */ - unlocked_accounts?: Array, + unlocked_accounts?: HexData[]|bigint[], /** * Specify a path to a directory to save the chain database. If a database @@ -143,8 +142,8 @@ export const getDefault: (options: Options)=> Options = (options) => { ledger: new Ethereum({net_version: network_id}), debug: false, logger: {log: () => {}}, - default_balance_ether: JSBI.BigInt(100), - total_accounts: JSBI.BigInt(10), + default_balance_ether: 100n, + total_accounts: 10n, network_id, locked: false, vmErrorsOnRPCResponse: true, diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 58f2d2ae92..90d1b74722 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -4,7 +4,7 @@ export default interface ProviderOptions extends Options { /** * Array of strings to installed subproviders */ - subProviders?: Array + subProviders?: any[] } export const getDefault : (options: ProviderOptions) => ProviderOptions = (options) => { diff --git a/src/provider.ts b/src/provider.ts index 8b59e820c1..0265283458 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,14 +1,18 @@ import Engine from "./engine"; import RequestProcessor from "./utils/request-processor"; -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "./options/provider-options"; +import ProviderOptions, { getDefault as getDefaultProviderOptions } from "./options/provider-options"; import { EventEmitter } from "events"; import Ethereum from "./ledgers/ethereum/ledger" export type ProviderOptions = ProviderOptions; +const options = Symbol("options"); +const engine = Symbol("engine"); +const requestProcessor = Symbol("requestProcessor"); + interface Payload { method: string - params: Array + params: any[] } interface Callback { @@ -16,30 +20,30 @@ interface Callback { } export default class Provider extends EventEmitter { - private _options: ProviderOptions; - private _engine: Engine; - private _requestProcessor: RequestProcessor; - constructor(options?: ProviderOptions) { + private [options]: ProviderOptions; + private [engine]: Engine; + private [requestProcessor]: RequestProcessor; + constructor(providerOptions?: ProviderOptions) { super(); - const _options = this._options = getDefaultProviderOptions(options); + const _providerOptions = this[options] = getDefaultProviderOptions(providerOptions); // set up our request processor to either use FIFO or or async request processing - this._requestProcessor = new RequestProcessor(_options.asyncRequestProcessing ? 1 : 0); + this[requestProcessor] = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 1 : 0); - this._engine = new Engine(_options.ledger || new Ethereum({net_version: _options.network_id.toString()})); + this[engine] = new Engine(_providerOptions.ledger || new Ethereum({ net_version: _providerOptions.network_id.toString() })); } - public send(payload: Payload, callback?: Callback): void - public async send(method: string, params?: Array): Promise; - public async send(arg1: string | Payload, arg2?: any): Promise { + public send(payload: Payload, callback?: Callback): void; + public send(method: string, params?: any[]): Promise; + public send(arg1: string | Payload, arg2?: any): Promise { let method: string; - let params: Array; + let params: any[]; let response: Promise<{}>; - const send = this._engine.send.bind(this._engine); + const send = this[engine].send.bind(this[engine]); if (typeof arg1 === "string") { method = arg1; params = arg2; - response = this._requestProcessor.queue(send, method, params); + response = this[requestProcessor].queue(send, method, params); } else { // handle backward compatibility with callback-style ganache-core const payload: Payload = arg1 as Payload; @@ -50,19 +54,23 @@ export default class Provider extends EventEmitter { if (typeof callback !== "function") { throw new Error( "No callback provided to provider's send function. As of web3 1.0, provider.send " + - "is no longer synchronous and must be passed a callback as its final argument." + "is no longer synchronous and must be passed a callback as its final argument." ); } - - this._requestProcessor.queue(send, method, params).then((response: any)=>{ - callback(null, response); + + this[requestProcessor].queue(send, method, params).then((response: any) => { + callback(null, { + id: (arg1 as any).id, + jsonrpc: "2.0", + result: response + }); }).catch(callback); - + response = undefined; } - if (this._options.verbose) { - this._options.logger.log(` > ${method}: ${JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); + if (this[options].verbose) { + this[options].logger.log(` > ${method}: ${JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); } return response; diff --git a/src/server.ts b/src/server.ts index 42524d96b4..fd44df43ea 100644 --- a/src/server.ts +++ b/src/server.ts @@ -4,61 +4,48 @@ export type ServerOptions = ServerOptions; import uWS, { TemplatedApp, us_listen_socket } from "uWebSockets.js"; import Provider from "./provider"; -import WebsocketServer from "./server/websocket-server"; -import HttpServer from "./server/http-server"; +import WebsocketServer from "./servers/ws-server"; +import HttpServer from "./servers/http-server"; -type JsonRpc = { - id: string, - jsonrpc: string, -} - -interface JsonRpcRequestPayload extends JsonRpc { - params: Array -} - -interface JsonRpcError { - code: number, - message: string -} - -interface JsonRpcResponsePayload extends JsonRpc { - id: string, - jsonrpc: string, - result?: any, - error?: JsonRpcError -} +const options = Symbol("options"); +const listenSocket = Symbol("listenSocket"); +const app = Symbol("app"); +const provider = Symbol("provider"); +const websocketServer = Symbol("websocketServer"); +const httpServer = Symbol("httpServer"); export default class Server { - private _options: ServerOptions; - private _listenSocket: us_listen_socket; - private _app: TemplatedApp; - private _provider: Provider; - private _websocketServer: WebsocketServer; - private _httpServer: HttpServer; - constructor(options?: ServerOptions) { - const _options = this._options = getDefaultServerOptions(options); - const provider = this._provider = new Provider(_options); + private [app]: TemplatedApp; + private [provider]: Provider; + private [options]: ServerOptions; + private [httpServer]: HttpServer; + private [listenSocket]: us_listen_socket; + private [websocketServer]: WebsocketServer; + + constructor(serverOptions?: ServerOptions) { + this[options] = getDefaultServerOptions(serverOptions); + this[provider] = new Provider(this[options]); - const app = this._app = uWS.App(null); + const _app = this[app] = uWS.App(null); - if (_options.ws) { - this._websocketServer = new WebsocketServer(app, provider); + if (this[options].ws) { + this[websocketServer] = new WebsocketServer(_app, this[provider]); } - this._httpServer = new HttpServer(app, provider); + this[httpServer] = new HttpServer(_app, this[provider]); } async listen(port: number, callback?: (err: Error) => void): Promise { let err; - if (this._listenSocket) { + if (this[listenSocket]) { err = new Error("Server is already listening."); } else { - const listenSocket = await new Promise((resolve) => { - this._app.listen(port, resolve); + const _listenSocket = await new Promise((resolve) => { + this[app].listen(port, resolve); }); - if (listenSocket) { - this._listenSocket = listenSocket; + if (_listenSocket) { + this[listenSocket] = _listenSocket; err = null; } else { err = new Error("Failed to listen on port: " + port); @@ -73,15 +60,16 @@ export default class Server { } } close() { - const listenSocket = this._listenSocket; - if (listenSocket) { - this._listenSocket = undefined; + const _listenSocket = this[listenSocket]; + if (_listenSocket) { + this[listenSocket] = undefined; // close the socket to prevent any more connections - uWS.us_listen_socket_close(listenSocket); + uWS.us_listen_socket_close(_listenSocket); + // close all the currently connection websockets: - this._websocketServer.close() - this._httpServer.close(); - this._listenSocket = undefined; + this[websocketServer].close() + // and do all http cleanup, if any + this[httpServer].close(); } } } diff --git a/src/server/http-server.ts b/src/server/http-server.ts deleted file mode 100644 index 590d23afb6..0000000000 --- a/src/server/http-server.ts +++ /dev/null @@ -1,175 +0,0 @@ -import { TemplatedApp, HttpResponse, HttpRequest, RecognizedString } from "uWebSockets.js"; -import ContentTypes from "./content-types"; -import rpcError from "./rpc-error"; -import Provider from "../provider"; - -const _handlePost = Symbol("handlePost"); -const _handleOptions = Symbol("handleOptions"); -const _provider = Symbol("provider"); -const noop = () => { }; - -/** - * uWS doesn't let us use the request after the request method has completed. - * But we can't set headers until after the statusCode is set. But we don't - * know the status code until the provider returns asynchronously. - * So this does request-related work immediately and returns a function to do the - * rest of the work later. - * @param method - * @param request - */ -function prepareCORSResponseHeaders(method: string, request: HttpRequest) { - // https://fetch.spec.whatwg.org/#http-requests - const origin = request.getHeader("origin"); - const acrh = request.getHeader("access-control-request-headers"); - return (response: HttpResponse) => { - const isCORSRequest = true || origin !== ""; - if (isCORSRequest) { - // OPTIONS preflight requests need a little extra treatment - if (method === "OPTIONS") { - // we only allow POST requests, so it doesn't matter which method the request is asking for - response.writeHeader("Access-Control-Allow-Methods", "POST"); - // echo all requested access-control-request-headers back to the response - if (acrh !== "") { - response.writeHeader("Access-Control-Allow-Headers", acrh); - } - // Safari needs Content-Length = 0 for a 204 response otherwise it hangs forever - // https://github.com/expressjs/cors/pull/121#issue-130260174 - response.writeHeader("Content-Length", "0"); - - // Make browsers and compliant clients cache the OPTIONS preflight response for 10 - // minutes (this is the maximum time Chromium allows) - response.writeHeader("Access-Control-Max-Age", "600"); // seconds - } - - // From the spec: https://fetch.spec.whatwg.org/#http-responses - // "For a CORS-preflight request, request’s credentials mode is always "omit", - // but for any subsequent CORS requests it might not be. Support therefore - // needs to be indicated as part of the HTTP response to the CORS-preflight request as well.", so this - // header is added to all requests. - // Additionally, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials, - // states that there aren't any HTTP Request headers that indicate you whether or not Request.withCredentials - // is set. Because web3@1.0.0-beta.35-? always sets `request.withCredentials = true` while Safari requires it be - // returned even when no credentials are set in the browser this header must always be return on all requests. - // (I've found that Chrome and Firefox don't actually require the header when credentials aren't set) - // Regression Commit: https://github.com/ethereum/web3.js/pull/1722 - // Open Web3 Issue: https://github.com/ethereum/web3.js/issues/1802 - response.writeHeader("Access-Control-Allow-Credentials", "true"); - - // From the spec: "It cannot be reliably identified as participating in the CORS protocol - // as the `Origin` header is also included for all requests whose method is neither - // `GET` nor `HEAD`." - // Explicitly set the origin instead of using *, since credentials - // can't be used in conjunction with *. This will always be set - /// for valid preflight requests. - response.writeHeader("Access-Control-Allow-Origin", origin); - } - } -} - - -function sendResponse(response: HttpResponse, statusCode: number, contentType?: RecognizedString, data?: RecognizedString, writeHeaders: (response: HttpResponse) => void = noop): void { - response.writeStatus(statusCode.toString()); - writeHeaders(response); - if (contentType) { - response.writeHeader("Content-Type", contentType); - } - response.end(data) -} - -type JsonRpcRequest = { - id: string, - jsonrpc: string, - method: string, - params?: Array -} - -function parse(message: string): JsonRpcRequest { - return JSON.parse(message); -} - -export default class HttpServer { - private [_provider]: Provider; - constructor(app: TemplatedApp, provider: Provider) { - this[_provider] = provider; - - // JSON-RPC routes... - app - .post("/", this[_handlePost].bind(this)) - .options("/", this[_handleOptions].bind(this)); - - // because Easter Eggs are fun... - app.get("/418", (response: HttpResponse) => { - sendResponse(response, 418, ContentTypes.PLAIN, "418 I'm a teapot"); - }); - - // fallback routes... - app - .any("/", (response: HttpResponse) => { - // any other request to "/" is not allowed, so respond with `405 Method Not Allowed`... - sendResponse(response, 405, ContentTypes.PLAIN, "405 Method Not Allowed"); - }) - .any("/*", (response: HttpResponse) => { - // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... - sendResponse(response, 404, ContentTypes.PLAIN, "404 Not Found"); - }); - } - - private [_handlePost](response: HttpResponse, request: HttpRequest) { - // handle JSONRPC post requests... - const writeHeaders = prepareCORSResponseHeaders("POST", request); - - let buffer: Buffer; - response.onData((message: ArrayBuffer, isLast: boolean) => { - const chunk = Buffer.from(message); - if (isLast) { - let payload: JsonRpcRequest; - try { - const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; - payload = parse(message); - } catch (e) { - sendResponse(response, 400, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); - return; - } - const method = payload.method; - - // http connections do not support subscriptions - if (method === "eth_subscribe" || method === "eth_unsubscribe") { - sendResponse(response, 400, ContentTypes.JSON, rpcError(payload.id, "-32000", "notifications not supported"), writeHeaders); - } else { - // `await`ing the `provider.send` instead of using `then` - // causes uWS to delay cleaning up the `request` object - this[_provider].send(method, payload.params) - .then((result) => { - if (!response.aborted) { - const json = { - "id": payload.id, - "jsonrpc": "2.0", - "result": result - }; - sendResponse(response, 200, ContentTypes.JSON, JSON.stringify(json), writeHeaders); - } - }); - } - } else { - if (buffer) { - buffer = Buffer.concat([buffer, chunk]); - } else { - buffer = Buffer.concat([chunk]); - } - } - }); - response.onAborted(() => { - response.aborted = true; - }); - } - - private [_handleOptions](response: HttpResponse, request: HttpRequest) { - // handle CORS preflight requests... - const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); - // OPTIONS responses don't have a body, so respond with `204 No Content`... - sendResponse(response, 204, null, null, writeHeaders); - } - public close() { - // currently a no op. - } -}; diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index e69de29bb2..28a43c3912 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -0,0 +1,181 @@ +import { TemplatedApp, HttpResponse, HttpRequest, RecognizedString } from "uWebSockets.js"; +import ContentTypes from "./utils/content-types"; +import rpcError from "./utils/rpc-error"; +import Provider from "../provider"; + +const _handlePost = Symbol("handlePost"); +const _handleData = Symbol("handleData"); +const _handleOptions = Symbol("handleOptions"); +const _provider = Symbol("provider"); +const noop = () => { }; + +/** + * uWS doesn't let us use the request after the request method has completed. + * But we can't set headers until after the statusCode is set. But we don't + * know the status code until the provider returns asynchronously. + * So this does request-related work immediately and returns a function to do the + * rest of the work later. + * @param method + * @param request + */ +function prepareCORSResponseHeaders(method: string, request: HttpRequest) { + // https://fetch.spec.whatwg.org/#http-requests + const origin = request.getHeader("origin"); + const acrh = request.getHeader("access-control-request-headers"); + return (response: HttpResponse) => { + const isCORSRequest = true || origin !== ""; + if (isCORSRequest) { + // OPTIONS preflight requests need a little extra treatment + if (method === "OPTIONS") { + // we only allow POST requests, so it doesn't matter which method the request is asking for + response.writeHeader("Access-Control-Allow-Methods", "POST"); + // echo all requested access-control-request-headers back to the response + if (acrh !== "") { + response.writeHeader("Access-Control-Allow-Headers", acrh); + } + // Safari needs Content-Length = 0 for a 204 response otherwise it hangs forever + // https://github.com/expressjs/cors/pull/121#issue-130260174 + response.writeHeader("Content-Length", "0"); + + // Make browsers and compliant clients cache the OPTIONS preflight response for 10 + // minutes (this is the maximum time Chromium allows) + response.writeHeader("Access-Control-Max-Age", "600"); // seconds + } + + // From the spec: https://fetch.spec.whatwg.org/#http-responses + // "For a CORS-preflight request, request’s credentials mode is always "omit", + // but for any subsequent CORS requests it might not be. Support therefore + // needs to be indicated as part of the HTTP response to the CORS-preflight request as well.", so this + // header is added to all requests. + // Additionally, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials, + // states that there aren't any HTTP Request headers that indicate you whether or not Request.withCredentials + // is set. Because web3@1.0.0-beta.35-? always sets `request.withCredentials = true` while Safari requires it be + // returned even when no credentials are set in the browser this header must always be return on all requests. + // (I've found that Chrome and Firefox don't actually require the header when credentials aren't set) + // Regression Commit: https://github.com/ethereum/web3.js/pull/1722 + // Open Web3 Issue: https://github.com/ethereum/web3.js/issues/1802 + response.writeHeader("Access-Control-Allow-Credentials", "true"); + + // From the spec: "It cannot be reliably identified as participating in the CORS protocol + // as the `Origin` header is also included for all requests whose method is neither + // `GET` nor `HEAD`." + // Explicitly set the origin instead of using *, since credentials + // can't be used in conjunction with *. This will always be set + /// for valid preflight requests. + response.writeHeader("Access-Control-Allow-Origin", origin); + } + } +} + + +function sendResponse(response: HttpResponse, statusCode: number, contentType?: RecognizedString, data?: RecognizedString, writeHeaders: (response: HttpResponse) => void = noop): void { + response.writeStatus(statusCode.toString()); + writeHeaders(response); + if (contentType) { + response.writeHeader("Content-Type", contentType); + } + response.end(data) +} + +type JsonRpcRequest = { + id: string, + jsonrpc: string, + method: string, + params?: any[] +} + +function parse(message: string): JsonRpcRequest { + return JSON.parse(message); +} + +export default class HttpServer { + private [_provider]: Provider; + constructor(app: TemplatedApp, provider: Provider) { + this[_provider] = provider; + + // JSON-RPC routes... + app + .post("/", this[_handlePost].bind(this)) + .options("/", this[_handleOptions].bind(this)); + + // because Easter Eggs are fun... + app.get("/418", (response) => { + sendResponse(response, 418, ContentTypes.PLAIN, "418 I'm a teapot"); + }); + + // fallback routes... + app + .any("/", (response) => { + // TODO: send back the Ganache-UI + // any other request to "/" is not allowed, so respond with `405 Method Not Allowed`... + sendResponse(response, 405, ContentTypes.PLAIN, "405 Method Not Allowed"); + }) + .any("/*", (response) => { + // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... + sendResponse(response, 404, ContentTypes.PLAIN, "404 Not Found"); + }); + } + + private [_handlePost](response: HttpResponse, request: HttpRequest) { + // handle JSONRPC post requests... + const writeHeaders = prepareCORSResponseHeaders("POST", request); + + let buffer: Buffer; + response.onData(this[_handleData].bind(this, buffer, response, writeHeaders)); + response.onAborted(() => { + response.aborted = true; + }); + } + + private [_handleData](buffer: Buffer, response: HttpResponse, writeHeaders: (response: HttpResponse) => void, message: ArrayBuffer, isLast: boolean) { + const chunk = Buffer.from(message); + if (isLast) { + let payload: JsonRpcRequest; + try { + const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; + payload = parse(message); + } catch (e) { + sendResponse(response, 400, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); + return; + } + + const method = payload.method; + switch (method) { + // http connections do not support subscriptions + case "eth_subscribe": + case "eth_unsubscribe": + sendResponse(response, 400, ContentTypes.JSON, rpcError(payload.id, "-32000", "notifications not supported"), writeHeaders); + break; + default: + // `await`ing the `provider.send` instead of using `then` + // causes uWS to delay cleaning up the `request` object + this[_provider].send(method, payload.params).then((result) => { + if (response.aborted) return; + const json = { + "id": payload.id, + "jsonrpc": "2.0", + "result": result + }; + sendResponse(response, 200, ContentTypes.JSON, JSON.stringify(json), writeHeaders); + }); + break; + } + } else { + if (buffer) { + buffer = Buffer.concat([buffer, chunk]); + } else { + buffer = Buffer.concat([chunk]); + } + } + } + + private [_handleOptions](response: HttpResponse, request: HttpRequest) { + // handle CORS preflight requests... + const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); + // OPTIONS responses don't have a body, so respond with `204 No Content`... + sendResponse(response, 204, null, null, writeHeaders); + } + public close() { + // currently a no op. + } +}; diff --git a/src/server/content-types.ts b/src/servers/utils/content-types.ts similarity index 100% rename from src/server/content-types.ts rename to src/servers/utils/content-types.ts diff --git a/src/server/rpc-error.ts b/src/servers/utils/rpc-error.ts similarity index 100% rename from src/server/rpc-error.ts rename to src/servers/utils/rpc-error.ts diff --git a/src/server/websocket-close-codes.ts b/src/servers/utils/websocket-close-codes.ts similarity index 100% rename from src/server/websocket-close-codes.ts rename to src/servers/utils/websocket-close-codes.ts diff --git a/src/servers/ws-server..ts b/src/servers/ws-server..ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/server/websocket-server.ts b/src/servers/ws-server.ts similarity index 82% rename from src/server/websocket-server.ts rename to src/servers/ws-server.ts index 1460fe3ad1..db25f0f692 100644 --- a/src/server/websocket-server.ts +++ b/src/servers/ws-server.ts @@ -1,11 +1,11 @@ import uWS, { TemplatedApp, WebSocket } from "uWebSockets.js"; -import WebSocketCloseCodes from "./websocket-close-codes"; +import WebSocketCloseCodes from "./utils/websocket-close-codes"; import Provider from "../provider"; -const connections = Symbol("connections"); +const _connections = Symbol("connections"); export default class WebsocketServer { - private [connections] = new Set(); + private [_connections] = new Set(); constructor(app: TemplatedApp, provider: Provider) { app.ws("/", { /* WS Options */ @@ -15,7 +15,7 @@ export default class WebsocketServer { /* Handlers */ open: (ws: any) => { - this[connections].add(ws); + this[_connections].add(ws); }, message: async (ws: any, message: ArrayBuffer, isBinary: boolean) => { let payload: any; @@ -43,12 +43,12 @@ export default class WebsocketServer { console.log("WebSocket backpressure: " + ws.getBufferedAmount()); }, close: (ws: WebSocket) => { - this[connections].delete(ws); + this[_connections].delete(ws); ws.closed = true; } }); } close() { - this[connections].forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); + this[_connections].forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); } }; diff --git a/src/types/hex-data.ts b/src/types/hex-data.ts index c36c69a31b..8be74d127d 100644 --- a/src/types/hex-data.ts +++ b/src/types/hex-data.ts @@ -1,12 +1,42 @@ -export default class HexData { - private data: any; - constructor(data: string) { - if(data.indexOf("0x") !== -1) { - throw new TypeError("Invalid hex data"); - } - this.data = data + +// export type HexType = HexData & string; + +// export interface HexType { +// toString(): string +// valueOf(): string +// }; + +class HexData extends String{ + private data: Buffer; + constructor(data: string|Buffer) { + super(); + this.data = Buffer.isBuffer(data) ? data : Buffer.from(data as string); } - toString() { - return this.data; + toString(): string { + return this.data.toString("hex"); + } + valueOf(): string { + return this.toString(); + } +} + +const fn = ((data: string|Buffer): HexData => { + const d = Buffer.isBuffer(data) ? data : Buffer.from(data as string); + const s = "" as HexData; + s.toString = () => { + return d.toString("hex"); + } + + return s; +}); + +export const HexDataImpl = fn as any as String; + +export class thing { + constructor(data: string|Buffer){ + } } + +type HexData = string & thing; +export default HexData; \ No newline at end of file diff --git a/src/types/hex-quantity.ts b/src/types/hex-quantity.ts index bff8bd6566..d649c6f08a 100644 --- a/src/types/hex-quantity.ts +++ b/src/types/hex-quantity.ts @@ -1,25 +1,24 @@ -import JSBI from "jsbi"; - export default class HexQuantity { - private data: JSBI; + private data: bigint; - constructor(quantity: JSBI | Buffer | number | string) { + constructor(quantity: bigint | Buffer | number | string) { if (quantity instanceof Buffer) { - this.data = JSBI.BigInt(quantity.toString("hex")); - } else if (quantity instanceof JSBI) { - this.data = quantity; + const str = quantity.toString("hex") as string; + this.data = BigInt(str); } else { switch (typeof quantity) { + case "bigint": + this.data = quantity as bigint; case "number": case "string": - this.data = JSBI.BigInt(quantity); + this.data = BigInt(quantity); break; default: throw new TypeError("quantity is not a Buffer, number, or string"); } } } - toBigNum(): JSBI { + toBigNum(): bigint { return this.data; } toString(): string { diff --git a/src/types/tags.ts b/src/types/tags.ts new file mode 100644 index 0000000000..efc12d5a38 --- /dev/null +++ b/src/types/tags.ts @@ -0,0 +1,35 @@ +enum Tag { + EARLIEST, + LATEST, + PENDING +} +enum _Tag { + earliest, + latest, + pending +} + +namespace Tag { + export function normalize(tag: keyof typeof _Tag|Tag): Tag { + let t: Tag; + if(typeof tag === "string"){ + t = (Tag)[tag.toUpperCase()]; + } else { + switch (tag) { + case Tag.EARLIEST: + return Tag.EARLIEST; + case Tag.LATEST: + return Tag.LATEST; + case Tag.PENDING: + return Tag.PENDING; + } + } + + if (!t) { + throw new Error("Invalid tag: " + tag); + } + return t; + } +} + +export default Tag; diff --git a/test/provider.ts b/test/provider.ts index fb9bf4b49e..1304b3edd5 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -2,11 +2,54 @@ import Ganache from "../index" import * as assert from "assert"; describe("provider", () => { - it("returns things", async () => { + const networkId = "1234"; + it("returns things via EIP-1193", async () => { const p = Ganache.provider({ - network_id: "1234" + network_id: networkId }); const version = await p.send("net_version"); - assert.strictEqual(version, "1234"); + assert.strictEqual(version, networkId); + }); + it("returns things via legacy", (done) => { + const p = Ganache.provider({ + network_id: networkId + }); + const ret = p.send({ + id: "1", + jsonrpc: "2.0", + method: "net_version" + } as any, (_err: Error, result: any): void => { + assert.strictEqual(result.result, networkId); + done(); + }); + assert.strictEqual(ret, undefined); + }); + + it("returns rejects invalid rpc methods", async () => { + const p = Ganache.provider({ + network_id: networkId + }); + await assert.rejects(p.send("toString"), { + message: "Invalid method: toString" + }); + await assert.rejects(p.send("yo_mamma!"), { + message: "Invalid method: yo_mamma!" + }); + const str = Buffer.from([1]) as any as string; + await assert.rejects(new Promise((resolve, reject) => { + p.send({ + id: "1", + jsonrpc: "2.0", + method: str as any + } as any, (err: Error, result: any): void => { + if(err) { + reject(err); + } else { + resolve(result); + } + }) + }), { + message: "Invalid method: \u0001" + }); }); }); diff --git a/tsconfig.json b/tsconfig.json index 52208b3587..1ed2be385d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,15 +2,15 @@ "compilerOptions": { "module": "commonjs", "esModuleInterop": true, - "target": "es6", + "target": "esnext", "noImplicitAny": true, "moduleResolution": "node", "sourceMap": true, "outDir": "dist", - "lib": ["dom", "es2017"] + "lib": ["esnext"] }, "include": [ "./index.ts", - "./typings/**/*.d.ts" + "./typings/**/*.d.ts", "typings/uWebsockets.js.ts" ] } diff --git a/typings/ethereumjs-block/header.d.ts b/typings/ethereumjs-block/header.d.ts new file mode 100644 index 0000000000..970d20f4e4 --- /dev/null +++ b/typings/ethereumjs-block/header.d.ts @@ -0,0 +1,55 @@ + + +declare module 'ethereumjs-block/header' { + import BN from 'bn.js' + import { Block } from 'ethereumjs-block' + import { Blockchain } from 'ethereumjs-blockchain' + + type LargeNumber = string | Buffer | BN + type Callback = (err: Error | null, result: T) => void + + export interface IBlockHeader { + parentHash: Buffer + uncleHash: Buffer + coinbase: Buffer + stateRoot: Buffer + transactionTrie: Buffer + receiptTrie: Buffer + bloom: Buffer + difficulty: Buffer + number: Buffer + gasLimit: Buffer + gasUsed: Buffer + timestamp: Buffer + extraData: Buffer + } + + export class BlockHeader { + parentHash: Buffer + uncleHash: Buffer + coinbase: Buffer + stateRoot: Buffer + transactionTrie: Buffer + receiptTrie: Buffer + bloom: Buffer + difficulty: Buffer + number: Buffer + gasLimit: Buffer + gasUsed: Buffer + timestamp: Buffer + extraData: Buffer + raw: Buffer[] + + constructor(data: LargeNumber | IBlockHeader) + serialize(): Buffer + canonicalDifficulty(block: Block): BN + validateDifficulty(block: Block): boolean + validateGasLimit(block: Block): boolean + validate(blockChain: Blockchain, height: BN | Callback, cb?: Callback): void + hash(): Buffer + isGenesis(): boolean + toJSON(labeled: boolean): object + } + + export default BlockHeader + } \ No newline at end of file diff --git a/typings/ethereumjs-block/index.d.ts b/typings/ethereumjs-block/index.d.ts new file mode 100644 index 0000000000..f00979b534 --- /dev/null +++ b/typings/ethereumjs-block/index.d.ts @@ -0,0 +1,40 @@ +declare module 'ethereumjs-block' { + import BN from 'bn.js' + import { Blockchain } from 'ethereumjs-blockchain' + import Transaction from 'ethereumjs-tx' + import BlockHeader from 'ethereumjs-block/header' + import Trie from 'merkle-patricia-tree/baseTrie' + + type LargeNumber = string | Buffer | BN + type Callback = (err: Error | null, result: T) => void + + export interface IBlock { + transactions: Transaction[] + uncleHeaders: BlockHeader[] + txTrie: Trie + header: BlockHeader + } + + export class Block { + transactions: Transaction[] + uncleHeaders: BlockHeader[] + txTrie: Trie + header: BlockHeader + raw: Buffer[] + + constructor(data: string | Buffer | number[] | IBlock) + hash(): Buffer + isGenesis(): boolean + setGenesisParams(): void + serialize(rlpEncode: boolean): Buffer + genTxTrie(cb: Callback): void + validateTransactionTrie(): boolean + validateTransactions(sringError: boolean): boolean | string + validate(blockChain: Blockchain, cb: Callback): void + validateUnclesHash(): boolean + validateUncles(blockChain: Blockchain, cb: Callback): void + toJSON(labeled?: boolean): object + } + + export default Block + } \ No newline at end of file diff --git a/typings/ethereumjs-blockchain/index.d.ts b/typings/ethereumjs-blockchain/index.d.ts new file mode 100644 index 0000000000..76ae42e306 --- /dev/null +++ b/typings/ethereumjs-blockchain/index.d.ts @@ -0,0 +1,31 @@ +declare module 'ethereumjs-blockchain' { + import BN from 'bn.js' + import { LevelUp } from 'levelup' + import { Block } from 'ethereumjs-block' + + type BlockTag = Buffer | BN | number + type Callback = (err: Error | null, result: T) => void + type OnBlock = (block: Block, reorg: boolean, cb: Callback) => void + + export interface BlockchainOptions { + db: LevelUp + cb: Callback + } + + export class Blockchain { + constructor(opts: BlockchainOptions) + putGenesis(genesis: Block, cb: Callback): void + getHead(name: string, cb: Callback): void + getLatestHeader(cb: Callback): void + getLatestBlock(cb: Callback): void + putBlocks(blocks: Block[], cb: Callback): void + putBlock(block: Block, cb: Callback): void + getBlock(blockTag: BlockTag, cb: Callback): void + getBlocks(blockId: BlockTag, maxBlocks: number, skip: number, reverse: boolean, cb: Callback): void + selectNeededHashes(hashes: Buffer, cb: Callback): void + delBlock(blockHash: Buffer, cb: Callback): void + iterator(name: string, onBlock: OnBlock, cb: Callback): void + } + + export default Blockchain + } \ No newline at end of file diff --git a/typings/levelup/index.d.ts b/typings/levelup/index.d.ts new file mode 100644 index 0000000000..6ee9976ad7 --- /dev/null +++ b/typings/levelup/index.d.ts @@ -0,0 +1,83 @@ +/// + +declare module 'levelup' { + import { AbstractLevelDOWN } from 'abstract-leveldown' + + export = levelup; + + var levelup: levelup.LevelUpConstructor; + + namespace levelup { + interface CustomEncoding { + encode(val: any): Buffer| string; + decode(val: Buffer | string): any; + buffer: boolean; + type: string; + } + + type Encoding = string | CustomEncoding; + + interface Batch { + type: string; + key: any; + value?: any; + keyEncoding?: Encoding; + valueEncoding?: Encoding; + } + + interface LevelUpBase { + open(callback ?: (error : any) => any): void; + + close(callback ?: (error : any) => any): void; + + put(key: any, value: any): Promise; + put(key: any, value: any, callback: (error: any) => any): void; + put(key: any, value: any, options: { sync?: boolean }): Promise; + put(key: any, value: any, options: { sync?: boolean }, callback: (error: any) => any): void; + + get(key: any): Promise; + get(key: any, callback: (error: any, value: any) => any): void; + get(key: any, options: { keyEncoding?: Encoding; fillCache?: boolean }): Promise; + get(key: any, options: { keyEncoding?: Encoding; fillCache?: boolean }, callback: (error: any, value: any) => any): void; + + del(key: any): Promise; + del(key: any, callback: (error: any) => any): void; + del(key: any, options: { keyEncoding?: Encoding; sync?: boolean }): Promise; + del(key: any, options: { keyEncoding?: Encoding; sync?: boolean }, callback: (error: any) => any): void; + + + batch():LevelUpChain; + batch(array: BatchType[]): Promise; + batch(array: BatchType[], callback: (error?: any)=>any): void; + batch(array: BatchType[], options: { keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean }): Promise; + batch(array: BatchType[], options: { keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean }, callback: (error?: any)=>any): void; + + isOpen():boolean; + isClosed():boolean; + createReadStream(options?: any): any; + createKeyStream(options?: any): any; + createValueStream(options?: any): any; + } + + type LevelUp = LevelUpBase + + interface LevelUpChain { + put(key: any, value: any): LevelUpChain; + put(key: any, value: any, options?: { sync?: boolean }): LevelUpChain; + del(key: any): LevelUpChain; + del(key: any, options ?: { keyEncoding?: Encoding; sync?: boolean }): LevelUpChain; + clear(): LevelUpChain; + write(): Promise; + write(callback?: (error?: any)=>any): void; + } + + interface levelupOptions { + db?: (location: string) => AbstractLevelDOWN + } + + interface LevelUpConstructor { + (location: string, options?: levelupOptions): LevelUp; + (options: levelupOptions): LevelUp; + } + } +} diff --git a/typings/merkle-patricia-tree/baseTrie.d.ts b/typings/merkle-patricia-tree/baseTrie.d.ts new file mode 100644 index 0000000000..4fa12f2319 --- /dev/null +++ b/typings/merkle-patricia-tree/baseTrie.d.ts @@ -0,0 +1,41 @@ +declare module 'merkle-patricia-tree/baseTrie' { + import BN from 'bn.js' + + import TrieNode from 'merkle-patricia-tree/trieNode' + import ReadStream from 'merkle-patricia-tree/readStream' + + type Callback = (err: Error | null, result: T) => void + type FindPathCallback = (err: Error, node: TrieNode, keyRemainder: Buffer, stack: TrieNode[]) => void + type LargeNumber = string | Buffer | BN + + + // Rather than using LevelUp here, specify the minimal interface we need + // so that other structurally identical types can be used in its place + export interface Database { + get(key: Buffer, opt: any, cb: Callback): void + put(key: Buffer, val: Buffer, options: any, cb: Callback): void + del(key: Buffer, opt: any, cb: Callback): void + } + + export interface BatchOperation { + type: 'del' | 'put' + key: LargeNumber + value?: LargeNumber + } + + export class Trie { + root: Buffer + constructor(db: Database, root: Buffer) + get(key: LargeNumber, cb: Callback): void + put(key: LargeNumber, value: LargeNumber, cb: Callback): void + del(key: LargeNumber, cb: Callback): void + getRaw(key: LargeNumber, cb: Callback): void + findPath(key: LargeNumber, cb: FindPathCallback): void + createReadStream(): ReadStream + copy(): Trie + batch(ops: BatchOperation[], cb: (err: Error[]) => void): void + checkRoot(root: LargeNumber, cb: Callback): void + } + + export default Trie +} diff --git a/typings/merkle-patricia-tree/index.d.ts b/typings/merkle-patricia-tree/index.d.ts new file mode 100644 index 0000000000..10bd8c40b3 --- /dev/null +++ b/typings/merkle-patricia-tree/index.d.ts @@ -0,0 +1,28 @@ +declare module 'merkle-patricia-tree' { + import BN from 'bn.js' + import { Readable } from 'stream' + + import { Trie, Database } from 'merkle-patricia-tree/baseTrie' + import TrieNode from 'merkle-patricia-tree/trieNode' + + type MerkleProof = TrieNode[] + type Callback = (err: Error | null, result: T) => void + type LargeNumber = string | Buffer | BN + + export class ScratchReadStream extends Readable { + trie: Trie + } + + export class CheckpointTrie extends Trie { + readonly isCheckpoint: boolean + + checkpoint(): void + commit(cb: Callback): void + revert(cb: Callback): void + createScratchReadStream(scratch: Database): ScratchReadStream + static prove(trie: Trie, key: LargeNumber, cb: Callback): void + static verifyProof(rootHash: LargeNumber, key: LargeNumber, proof: MerkleProof, cb: Callback): void + } + + export default CheckpointTrie +} diff --git a/typings/merkle-patricia-tree/readStream.d.ts b/typings/merkle-patricia-tree/readStream.d.ts new file mode 100644 index 0000000000..ca05f2587f --- /dev/null +++ b/typings/merkle-patricia-tree/readStream.d.ts @@ -0,0 +1,10 @@ +declare module 'merkle-patricia-tree/readStream' { + import Trie from 'merkle-patricia-tree/baseTrie' + import { Readable } from 'stream' + + export class TrieReadStream extends Readable { + constructor(trie: Trie) + } + + export default TrieReadStream +} diff --git a/typings/merkle-patricia-tree/trieNode.d.ts b/typings/merkle-patricia-tree/trieNode.d.ts new file mode 100644 index 0000000000..08d616a359 --- /dev/null +++ b/typings/merkle-patricia-tree/trieNode.d.ts @@ -0,0 +1,41 @@ +declare module 'merkle-patricia-tree/trieNode' { + import BN from 'bn.js' + + type LargeNumber = string | Buffer | BN + type Callback = (err: Error | null, result: T) => void + type NodeType = 'branch' | 'leaf' | 'extension' + type NibbleArray = number[] + + export class TrieNode { + value: Buffer + key: Buffer + type: NodeType + raw: number[] + + constructor(type: NodeType | NibbleArray, key?: NibbleArray, value?: NibbleArray) + parseNode(node: NibbleArray): void + setValue(key: NibbleArray, value: NibbleArray): void + getValue(key: NibbleArray): NibbleArray + setKey(key: NibbleArray): void + getKey(): NibbleArray + serialize(): Buffer + hash(): Buffer + toString: string + getChildren(): TrieNode[] + static addHexPrefix(key: NibbleArray, terminator: boolean): NibbleArray + static removeHexPrefix(val: NibbleArray): NibbleArray + static isTerminator(key: NibbleArray): boolean + static stringToNibbles(key: LargeNumber): NibbleArray + static nibblesToBuffer(arr: NibbleArray): Buffer + static getNodeType(node: TrieNode): NodeType + } + + function addHexPrefix(key: NibbleArray, terminator: boolean): NibbleArray + function removeHexPrefix(val: NibbleArray): NibbleArray + function isTerminator(key: NibbleArray): boolean + function stringToNibbles(key: LargeNumber): NibbleArray + function nibblesToBuffer(arr: NibbleArray): Buffer + function getNodeType(node: TrieNode): NodeType + + export default TrieNode +} diff --git a/typings/superagent.d.ts b/typings/superagent.d.ts new file mode 100644 index 0000000000..196a8dc358 --- /dev/null +++ b/typings/superagent.d.ts @@ -0,0 +1,4 @@ +// error TS2304: Cannot find name 'XMLHttpRequest' +declare interface XMLHttpRequest {} +// error TS2304: Cannot find name 'Blob' +declare interface Blob {} \ No newline at end of file diff --git a/typings/index.d.ts b/typings/uWebsockets.js.ts similarity index 100% rename from typings/index.d.ts rename to typings/uWebsockets.js.ts From 6f4835731f0018aa7ef87d5a126dd648c28f1c61 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 28 Mar 2019 15:56:48 -0400 Subject: [PATCH 009/691] . --- src/servers/http-server.ts | 31 ++++++--------------- src/servers/utils/jsonrpc.ts | 51 ++++++++++++++++++++++++++++++++++ src/servers/utils/rpc-error.ts | 10 ------- 3 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 src/servers/utils/jsonrpc.ts delete mode 100644 src/servers/utils/rpc-error.ts diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 28a43c3912..b068946d0a 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -1,7 +1,7 @@ import { TemplatedApp, HttpResponse, HttpRequest, RecognizedString } from "uWebSockets.js"; import ContentTypes from "./utils/content-types"; -import rpcError from "./utils/rpc-error"; import Provider from "../provider"; +import JsonRpc from "./utils/jsonrpc" const _handlePost = Symbol("handlePost"); const _handleData = Symbol("handleData"); @@ -77,17 +77,6 @@ function sendResponse(response: HttpResponse, statusCode: number, contentType?: response.end(data) } -type JsonRpcRequest = { - id: string, - jsonrpc: string, - method: string, - params?: any[] -} - -function parse(message: string): JsonRpcRequest { - return JSON.parse(message); -} - export default class HttpServer { private [_provider]: Provider; constructor(app: TemplatedApp, provider: Provider) { @@ -130,32 +119,30 @@ export default class HttpServer { private [_handleData](buffer: Buffer, response: HttpResponse, writeHeaders: (response: HttpResponse) => void, message: ArrayBuffer, isLast: boolean) { const chunk = Buffer.from(message); if (isLast) { - let payload: JsonRpcRequest; + let payload: JsonRpc.Request; try { const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; - payload = parse(message); + payload = JsonRpc.Request(JSON.parse(message)); } catch (e) { sendResponse(response, 400, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); return; } + const id = payload.id; const method = payload.method; switch (method) { // http connections do not support subscriptions case "eth_subscribe": case "eth_unsubscribe": - sendResponse(response, 400, ContentTypes.JSON, rpcError(payload.id, "-32000", "notifications not supported"), writeHeaders); + const error = JsonRpc.Error(id, "-32000", "notifications not supported") + sendResponse(response, 400, ContentTypes.JSON, JSON.stringify(error), writeHeaders); break; default: - // `await`ing the `provider.send` instead of using `then` - // causes uWS to delay cleaning up the `request` object + // `await`ing the `provider.send` instead of using `then` causes uWS + // to delay cleaning up the `request` object, which we don't neccessarily want to delay. this[_provider].send(method, payload.params).then((result) => { if (response.aborted) return; - const json = { - "id": payload.id, - "jsonrpc": "2.0", - "result": result - }; + const json = JsonRpc.Response(id, result); sendResponse(response, 200, ContentTypes.JSON, JSON.stringify(json), writeHeaders); }); break; diff --git a/src/servers/utils/jsonrpc.ts b/src/servers/utils/jsonrpc.ts new file mode 100644 index 0000000000..6bcbf2b9e8 --- /dev/null +++ b/src/servers/utils/jsonrpc.ts @@ -0,0 +1,51 @@ +namespace JsonRpc { + const jsonrpc = "2.0"; + type JsonRpc = { + id: string, + jsonrpc: string, + toString(): string + } + export type Request = JsonRpc & { + id: string, + jsonrpc: string, + method: string, + params?: any[] + }; + export type Response = JsonRpc & { + result: any + }; + export type Error = JsonRpc & { + error: { + code: string, + message: any + } + }; + export const Request = (json: any): Request => { + return { + id: json.id, + jsonrpc, + method: json.method, + params: json.params + }; + } + export const Response = (id: string, result: any): Response => { + return { + id: id, + jsonrpc, + result + }; + } + export const Error = (id: string, code: string, message: any): Error => { + return { + id, + jsonrpc, + error: { + code, + message + } + }; + } + +} + +export default JsonRpc; diff --git a/src/servers/utils/rpc-error.ts b/src/servers/utils/rpc-error.ts deleted file mode 100644 index 179433bed5..0000000000 --- a/src/servers/utils/rpc-error.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default function rpcError(id: string, code: string, msg: any) { - return JSON.stringify({ - jsonrpc: "2.0", - id: id, - error: { - code: code, - message: msg - } - }); -} \ No newline at end of file From 29ab96780600402572a6ef395f23042038d084fc Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 28 Mar 2019 18:20:37 -0400 Subject: [PATCH 010/691] zoinks --- src/ledgers/ethereum/blockchain.ts | 11 ++- src/ledgers/ethereum/ledger.ts | 12 +-- src/servers/http-server.ts | 15 ++-- src/servers/utils/http-response-codes.ts | 9 ++ src/types/hex-data.ts | 103 ++++++++++++++++------- src/types/tags.ts | 6 +- 6 files changed, 108 insertions(+), 48 deletions(-) create mode 100644 src/servers/utils/http-response-codes.ts diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 2849af8299..111b110894 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -43,21 +43,24 @@ export default class Blockchain { constructor(){ const self = this; this._blocks = { - async getBlock(number: bigint|Tag): Promise { + async getBlock(number: string): Promise { const b = new Block(Buffer.from([])); - b.header.number = Buffer.from(number.toString(16)); + b.header.number = Buffer.from([number]); return b; } } this.blocks = new Proxy(this, { - async get (obj, key: any): Promise{ + async get (obj, key: string|Tag): Promise { + if (key === "latest" || key === "earliest" || key === "pending") { + return self._blocks.getBlock("111111"); + } return self._blocks.getBlock(key); } }) as any; } public async latest() { const block = new Block(Buffer.from([])); - block.header.number = Buffer.from([1]); + block.header.number = Buffer.from([111111]); return block; } } \ No newline at end of file diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index afa60ec314..ec66f44bfa 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,6 +1,6 @@ import ILedger, {optionsSymbol as _options} from "../../interfaces/ledger"; import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options"; -import HexData from "../../types/hex-data"; +import HexData, {IndexableHexData} from "../../types/hex-data"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; @@ -134,9 +134,10 @@ export default class Ethereum implements ILedger { * @param address 20 Bytes - address to check for balance. * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter */ - async eth_getBalance(address: string, blockNumber: bigint|Tag = Tag.LATEST): Promise { + async eth_getBalance(address: IndexableHexData, blockNumber: bigint|Tag = Tag.LATEST): Promise { const chain = this[_blockchain]; - const block = await chain.blocks[123]; + const str = blockNumber.toString(); + const block = await chain.blocks[str]; const account = await block.accounts[address]; return BigInt(123); } @@ -144,5 +145,6 @@ export default class Ethereum implements ILedger { [index: string]: (...args: any) => Promise<{}>; } - -const e = new Ethereum(getDefaultEthereumOptions()); \ No newline at end of file +const e = new Ethereum(getDefaultEthereumOptions()); +const d = new HexData((123n); +e.eth_getBalance(d, Tag.LATEST); \ No newline at end of file diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index b068946d0a..96eee579bf 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -2,6 +2,7 @@ import { TemplatedApp, HttpResponse, HttpRequest, RecognizedString } from "uWebS import ContentTypes from "./utils/content-types"; import Provider from "../provider"; import JsonRpc from "./utils/jsonrpc" +import HttpResponseCodes from "./utils/http-response-codes"; const _handlePost = Symbol("handlePost"); const _handleData = Symbol("handleData"); @@ -89,7 +90,7 @@ export default class HttpServer { // because Easter Eggs are fun... app.get("/418", (response) => { - sendResponse(response, 418, ContentTypes.PLAIN, "418 I'm a teapot"); + sendResponse(response, HttpResponseCodes.IM_A_TEAPOT, ContentTypes.PLAIN, "418 I'm a teapot"); }); // fallback routes... @@ -97,11 +98,11 @@ export default class HttpServer { .any("/", (response) => { // TODO: send back the Ganache-UI // any other request to "/" is not allowed, so respond with `405 Method Not Allowed`... - sendResponse(response, 405, ContentTypes.PLAIN, "405 Method Not Allowed"); + sendResponse(response, HttpResponseCodes.METHOD_NOT_ALLOWED, ContentTypes.PLAIN, "405 Method Not Allowed"); }) .any("/*", (response) => { // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... - sendResponse(response, 404, ContentTypes.PLAIN, "404 Not Found"); + sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); }); } @@ -124,7 +125,7 @@ export default class HttpServer { const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; payload = JsonRpc.Request(JSON.parse(message)); } catch (e) { - sendResponse(response, 400, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); + sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); return; } @@ -135,7 +136,7 @@ export default class HttpServer { case "eth_subscribe": case "eth_unsubscribe": const error = JsonRpc.Error(id, "-32000", "notifications not supported") - sendResponse(response, 400, ContentTypes.JSON, JSON.stringify(error), writeHeaders); + sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.JSON, JSON.stringify(error), writeHeaders); break; default: // `await`ing the `provider.send` instead of using `then` causes uWS @@ -143,7 +144,7 @@ export default class HttpServer { this[_provider].send(method, payload.params).then((result) => { if (response.aborted) return; const json = JsonRpc.Response(id, result); - sendResponse(response, 200, ContentTypes.JSON, JSON.stringify(json), writeHeaders); + sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, JSON.stringify(json), writeHeaders); }); break; } @@ -160,7 +161,7 @@ export default class HttpServer { // handle CORS preflight requests... const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); // OPTIONS responses don't have a body, so respond with `204 No Content`... - sendResponse(response, 204, null, null, writeHeaders); + sendResponse(response, HttpResponseCodes.NO_CONTENT, null, null, writeHeaders); } public close() { // currently a no op. diff --git a/src/servers/utils/http-response-codes.ts b/src/servers/utils/http-response-codes.ts new file mode 100644 index 0000000000..3b35193f57 --- /dev/null +++ b/src/servers/utils/http-response-codes.ts @@ -0,0 +1,9 @@ +enum HttpResponseCodes{ + OK = 200, + NO_CONTENT = 204, + BAD_REQUEST = 400, + NOT_FOUND = 404, + METHOD_NOT_ALLOWED = 405, + IM_A_TEAPOT = 418 +} +export default HttpResponseCodes; \ No newline at end of file diff --git a/src/types/hex-data.ts b/src/types/hex-data.ts index 8be74d127d..09975a3480 100644 --- a/src/types/hex-data.ts +++ b/src/types/hex-data.ts @@ -1,42 +1,87 @@ +const prefix = "0x"; -// export type HexType = HexData & string; +export type IndexableHexData = string & { + new(value: bigint|string|Buffer): IndexableHexData, + toString(): string +} -// export interface HexType { -// toString(): string -// valueOf(): string -// }; +class BaseHexData { + private _data: T; + private _str: string; + private _toString: () => string + constructor(data: T) { + if (Buffer.isBuffer(data)) { + this._toString = data.toString.bind(data, "hex"); + } else { + switch (typeof data) { + case "bigint": + this._toString = data.toString.bind(data, 16); + break; + case "string": { + if (data.indexOf("0x") === 0) { + this._str = data as string; + } else { + this._toString = () => { + const buf = Buffer.from(data); + return buf.toString("hex"); + } + } + break; + } + default: + throw new Error(`Cannot create a ${typeof data} as a HexData`); + } + } + this._data = data; + } -class HexData extends String{ - private data: Buffer; - constructor(data: string|Buffer) { - super(); - this.data = Buffer.isBuffer(data) ? data : Buffer.from(data as string); + public static from(data: bigint|string|Buffer) { + return new ExportableHexData(data); } + toString(): string { - return this.data.toString("hex"); + const str = this._str; + if (str !== undefined) { + return str; + } else { + return this._str = (prefix + this._toString()); + } } - valueOf(): string { - return this.toString(); + valueOf():T { + return this._data; } } -const fn = ((data: string|Buffer): HexData => { - const d = Buffer.isBuffer(data) ? data : Buffer.from(data as string); - const s = "" as HexData; - s.toString = () => { - return d.toString("hex"); - } - - return s; +type HexData = BaseHexData & IndexableHexData; +const ExportableHexData = BaseHexData as ({ + new (data: T): HexData, + from(data: T): HexData }); +interface ExportableHexData { + constructor(data: T): ExportableHexData + toString(): string + from(): ExportableHexData +} +export default ExportableHexData; -export const HexDataImpl = fn as any as String; +const num = ExportableHexData.from(123n); +console.log(num.toString() === "0x7b"); +console.log(num.valueOf() === 123n); +console.log(num + 1n); + +const hexString = ExportableHexData.from("0x12"); +console.log(hexString.toString() === "0x12"); +console.log(hexString.valueOf() === "0x12"); // true +console.log(hexString + " world"); // hello world + +const text = ExportableHexData.from("hello"); +console.log(text.toString() === "0x68656c6c6f"); // true +console.log(text.valueOf() === "hello"); // true +console.log(text + " world"); // hello world -export class thing { - constructor(data: string|Buffer){ - - } -} -type HexData = string & thing; -export default HexData; \ No newline at end of file +const _buf = Buffer.from([123,123]) +const buf = ExportableHexData.from(_buf); +console.log(buf.toString() === "0x7b7b"); // true +console.log(buf.valueOf() === _buf); // true +console.log(buf + " world"); // hello world \ No newline at end of file diff --git a/src/types/tags.ts b/src/types/tags.ts index efc12d5a38..a03e58ec2f 100644 --- a/src/types/tags.ts +++ b/src/types/tags.ts @@ -1,7 +1,7 @@ enum Tag { - EARLIEST, - LATEST, - PENDING + EARLIEST = "earliest", + LATEST = "latest", + PENDING = "pending" } enum _Tag { earliest, From c05fd59c29fe1c3e9b22d69d83efa17293c5dcc1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 28 Mar 2019 18:20:55 -0400 Subject: [PATCH 011/691] remove test code --- src/types/hex-data.ts | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/types/hex-data.ts b/src/types/hex-data.ts index 09975a3480..83d36fed64 100644 --- a/src/types/hex-data.ts +++ b/src/types/hex-data.ts @@ -63,25 +63,3 @@ interface ExportableHexData { from(): ExportableHexData } export default ExportableHexData; - -const num = ExportableHexData.from(123n); -console.log(num.toString() === "0x7b"); -console.log(num.valueOf() === 123n); -console.log(num + 1n); - -const hexString = ExportableHexData.from("0x12"); -console.log(hexString.toString() === "0x12"); -console.log(hexString.valueOf() === "0x12"); // true -console.log(hexString + " world"); // hello world - -const text = ExportableHexData.from("hello"); -console.log(text.toString() === "0x68656c6c6f"); // true -console.log(text.valueOf() === "hello"); // true -console.log(text + " world"); // hello world - - -const _buf = Buffer.from([123,123]) -const buf = ExportableHexData.from(_buf); -console.log(buf.toString() === "0x7b7b"); // true -console.log(buf.valueOf() === _buf); // true -console.log(buf + " world"); // hello world \ No newline at end of file From 10468bb2e32bda4259735fcb37f30e86e9dec798 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 28 Mar 2019 18:29:15 -0400 Subject: [PATCH 012/691] okay? --- src/ledgers/ethereum/ledger.ts | 4 ---- src/types/hex-data.ts | 8 +++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index ec66f44bfa..0c72fd258e 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -144,7 +144,3 @@ export default class Ethereum implements ILedger { [index: string]: (...args: any) => Promise<{}>; } - -const e = new Ethereum(getDefaultEthereumOptions()); -const d = new HexData((123n); -e.eth_getBalance(d, Tag.LATEST); \ No newline at end of file diff --git a/src/types/hex-data.ts b/src/types/hex-data.ts index 83d36fed64..2231263fa5 100644 --- a/src/types/hex-data.ts +++ b/src/types/hex-data.ts @@ -1,5 +1,7 @@ const prefix = "0x"; +type Valid = bigint|string|Buffer; + export type IndexableHexData = string & { new(value: bigint|string|Buffer): IndexableHexData, toString(): string @@ -54,10 +56,10 @@ class BaseHexData { type HexData = BaseHexData & IndexableHexData; const ExportableHexData = BaseHexData as ({ - new (data: T): HexData, - from(data: T): HexData + new (data: T): HexData, + from(data: T): HexData }); -interface ExportableHexData { +interface ExportableHexData { constructor(data: T): ExportableHexData toString(): string from(): ExportableHexData From 77873e80adb250a266593132f1df5fb5cc92e538 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 28 Mar 2019 18:30:08 -0400 Subject: [PATCH 013/691] maybe this time --- src/options/options.ts | 2 +- src/types/hex-data.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/options/options.ts b/src/options/options.ts index 822354d879..097bcbff67 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -154,4 +154,4 @@ export const getDefault: (options: Options)=> Options = (options) => { verbose: false, asyncRequestProcessing: false }, options); -} \ No newline at end of file +} diff --git a/src/types/hex-data.ts b/src/types/hex-data.ts index 2231263fa5..7e39d0b768 100644 --- a/src/types/hex-data.ts +++ b/src/types/hex-data.ts @@ -1,7 +1,5 @@ const prefix = "0x"; -type Valid = bigint|string|Buffer; - export type IndexableHexData = string & { new(value: bigint|string|Buffer): IndexableHexData, toString(): string @@ -56,8 +54,8 @@ class BaseHexData { type HexData = BaseHexData & IndexableHexData; const ExportableHexData = BaseHexData as ({ - new (data: T): HexData, - from(data: T): HexData + new (data: T): HexData, + from(data: T): HexData }); interface ExportableHexData { constructor(data: T): ExportableHexData From 501f5b0396bc487e18c6be7b153ddda915d8236b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 29 Mar 2019 13:45:12 -0400 Subject: [PATCH 014/691] add better data type --- src/interfaces/ledger-options.ts | 4 +- src/ledgers/ethereum/blockchain.ts | 4 +- src/ledgers/ethereum/ledger.ts | 6 +- src/ledgers/ethereum/options.ts | 4 +- src/options/options.ts | 13 ++--- src/types/account.ts | 11 ++-- src/types/base-hex-type.ts | 51 +++++++++++++++++ src/types/hex-data.ts | 90 +++++++++++++++++++++++++----- src/types/hex-quantity.ts | 28 +--------- src/types/indexable-hex-data.ts | 5 ++ 10 files changed, 153 insertions(+), 63 deletions(-) create mode 100644 src/types/base-hex-type.ts create mode 100644 src/types/indexable-hex-data.ts diff --git a/src/interfaces/ledger-options.ts b/src/interfaces/ledger-options.ts index da0ede0a13..4835ddcc9f 100644 --- a/src/interfaces/ledger-options.ts +++ b/src/interfaces/ledger-options.ts @@ -1,5 +1,5 @@ -import HexData from "../types/hex-data"; +import {JsonRpcData} from "../types/hex-data"; export default interface LedgerOptions { - accounts?: HexData[] + accounts?: JsonRpcData[] } \ No newline at end of file diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 111b110894..ffb28b9234 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,6 +1,6 @@ import EthereumJsBLock from "ethereumjs-block"; import Tag from "../../types/tags"; -import HexData from "../../types/hex-data"; +import {JsonRpcData} from "../../types/hex-data"; class Account { public balance: bigint @@ -19,7 +19,7 @@ class Block extends EthereumJsBLock { const self = this; this._accounts = { - async getAccount(number: HexData): Promise { + async getAccount(number: JsonRpcData): Promise { return new Account(); } } diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 0c72fd258e..b3d1873e37 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,6 +1,6 @@ import ILedger, {optionsSymbol as _options} from "../../interfaces/ledger"; import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options"; -import HexData, {IndexableHexData} from "../../types/hex-data"; +import {JsonRpcData, IndexableHexData} from "../../types/hex-data"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; @@ -85,7 +85,7 @@ export default class Ethereum implements ILedger { * Returns the client coinbase address. * @returns 20 bytes - the current coinbase address. */ - async eth_coinbase(): Promise{ + async eth_coinbase(): Promise{ return this[_options].coinbase; } @@ -117,7 +117,7 @@ export default class Ethereum implements ILedger { * Returns a list of addresses owned by client. * @returns Array of 20 Bytes - addresses owned by the client. */ - async eth_accounts(): Promise{ + async eth_accounts(): Promise{ return this[_options].accounts; } diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 74ed044ad7..4978c6d822 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,9 +1,9 @@ import LedgerOptions from "../../interfaces/ledger-options" -import HexData from "../../types/hex-data"; +import {JsonRpcData} from "../../types/hex-data"; interface EthereumOptions extends LedgerOptions { net_version: string, - coinbase?: HexData, + coinbase?: JsonRpcData, gasPrice?: bigint } diff --git a/src/options/options.ts b/src/options/options.ts index 097bcbff67..c23cb5bb6f 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -1,6 +1,5 @@ import Account from "../types/account"; -import HexData from "../types/hex-data"; -import HexQuantity from "../types/hex-quantity"; +import {JsonRpcData, JsonRpcQuantity} from "../types/hex-data"; import ILedger from "../interfaces/ledger"; import Ethereum from "../ledgers/ethereum/ledger"; @@ -82,7 +81,7 @@ export default interface Options { /** * Array of addresses or address indexes specifying which accounts should be unlocked. */ - unlocked_accounts?: HexData[]|bigint[], + unlocked_accounts?: JsonRpcData[]|bigint[], /** * Specify a path to a directory to save the chain database. If a database @@ -117,13 +116,13 @@ export default interface Options { * Sets the default gas price for transactions if not otherwise specified. * Must be specified as a hex string in wei. Defaults to "0x77359400", or 2 gwei. */ - gasPrice?: HexQuantity, + gasPrice?: JsonRpcQuantity, /** * Sets the block gas limit. Must be specified as a hex string. Defaults to * "0x6691b7". */ - gasLimit?: HexQuantity, + gasLimit?: JsonRpcQuantity, /** * @@ -149,8 +148,8 @@ export const getDefault: (options: Options)=> Options = (options) => { vmErrorsOnRPCResponse: true, hdPath: "m/44'/60'/0'/0/", allowUnlimitedContractSize: true, - gasPrice: new HexQuantity("0x77359400"), - gasLimit: new HexQuantity("0x6691b7"), + gasPrice: new JsonRpcQuantity("0x77359400"), + gasLimit: new JsonRpcQuantity("0x6691b7"), verbose: false, asyncRequestProcessing: false }, options); diff --git a/src/types/account.ts b/src/types/account.ts index 3da8157f34..51b3d47297 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -1,11 +1,10 @@ -import HexData from "./hex-data"; -import HexQuantity from "./hex-quantity"; +import { JsonRpcData, JsonRpcQuantity } from "./hex-data"; export default class Account { - public address: HexData - public balance: HexQuantity = new HexQuantity("0x0") - public secretKey: HexData - constructor(address: HexData) { + public address: JsonRpcData + public balance: JsonRpcQuantity = new JsonRpcQuantity("0x0") + public secretKey: JsonRpcData + constructor(address: JsonRpcData) { this.address = address; } } diff --git a/src/types/base-hex-type.ts b/src/types/base-hex-type.ts new file mode 100644 index 0000000000..d98b1ac8f0 --- /dev/null +++ b/src/types/base-hex-type.ts @@ -0,0 +1,51 @@ +const prefix = "0x"; + +import IndexableHexData from "./indexable-hex-data" +export type IndexableHexData = IndexableHexData; + +export class BaseHexData { + private _data: T; + private _str: string; + private _toString: () => string + constructor(data: T) { + if (Buffer.isBuffer(data)) { + this._toString = data.toString.bind(data, "hex"); + } else { + switch (typeof data) { + case "bigint": + this._toString = data.toString.bind(data, 16); + break; + case "string": { + if (data.indexOf("0x") === 0) { + this._str = data as string; + } else { + this._toString = () => { + const buf = Buffer.from(data); + return buf.toString("hex"); + } + } + break; + } + default: + throw new Error(`Cannot create a ${typeof data} as a HexData`); + } + } + this._data = data; + } + + public static from: (data: bigint|string|Buffer) => BaseHexData; + + toString(): string { + const str = this._str; + if (str !== undefined) { + return str; + } else { + return this._str = (prefix + this._toString()); + } + } + valueOf():T { + return this._data; + } +} + +export type HexData = BaseHexData & IndexableHexData; \ No newline at end of file diff --git a/src/types/hex-data.ts b/src/types/hex-data.ts index 7e39d0b768..e0f20797f5 100644 --- a/src/types/hex-data.ts +++ b/src/types/hex-data.ts @@ -6,9 +6,9 @@ export type IndexableHexData = string & { } class BaseHexData { - private _data: T; - private _str: string; - private _toString: () => string + protected _data: T; + protected _str: string; + protected _toString: () => string constructor(data: T) { if (Buffer.isBuffer(data)) { this._toString = data.toString.bind(data, "hex"); @@ -36,10 +36,59 @@ class BaseHexData { } public static from(data: bigint|string|Buffer) { - return new ExportableHexData(data); + return new BaseHexData(data); } toString(): string { + return this._toString() + } + toBuffer(): Buffer { + + } + valueOf():T { + return this._data; + } +} + +type HexData = BaseHexData & IndexableHexData; + + + + + + +class _JsonRpcData extends BaseHexData { + public toString(): string { + const str = this._str; + if (str !== undefined) { + return str; + } else { + const str = this._toString(); + if (str.length % 2 === 1) { + return this._str = `0x0${str}`; + } else { + return this._str = `0x${str}`; + } + } + } + public static from(data: bigint|string|Buffer) { + return new JsonRpcData(data); + } +} +const JsonRpcData = _JsonRpcData as ({ + new (data: T): JsonRpcData & HexData, + from(data: T): JsonRpcData & HexData +}); + +export interface JsonRpcData { + constructor(data: T): JsonRpcData + from(): JsonRpcData +} + + +// quantity +class _JsonRpcQuantity extends BaseHexData { + public toString(): string { const str = this._str; if (str !== undefined) { return str; @@ -47,19 +96,30 @@ class BaseHexData { return this._str = (prefix + this._toString()); } } - valueOf():T { - return this._data; + public static from(data: bigint|string|Buffer) { + return new JsonRpcQuantity(data); } } -type HexData = BaseHexData & IndexableHexData; -const ExportableHexData = BaseHexData as ({ - new (data: T): HexData, - from(data: T): HexData +const JsonRpcQuantity = _JsonRpcQuantity as ({ + new (data: T): JsonRpcQuantity & HexData, + from(data: T): JsonRpcQuantity & HexData }); -interface ExportableHexData { - constructor(data: T): ExportableHexData - toString(): string - from(): ExportableHexData +interface JsonRpcQuantity extends string { + constructor(data: T): JsonRpcQuantity + from(): JsonRpcQuantity +} + + +export {JsonRpcQuantity, JsonRpcData}; + + +class AccountManager { + [index: string]: string; } -export default ExportableHexData; +var a = new AccountManager(); +var q: JsonRpcQuantity = new JsonRpcQuantity("123"); +a[q] = "123"; + +console.log(balance.toString()); +console.log(balance.valueOf()); \ No newline at end of file diff --git a/src/types/hex-quantity.ts b/src/types/hex-quantity.ts index d649c6f08a..1a43c543a9 100644 --- a/src/types/hex-quantity.ts +++ b/src/types/hex-quantity.ts @@ -1,27 +1,3 @@ -export default class HexQuantity { - private data: bigint; +import {JsonRpcQuantity} from "./hex-data"; - constructor(quantity: bigint | Buffer | number | string) { - if (quantity instanceof Buffer) { - const str = quantity.toString("hex") as string; - this.data = BigInt(str); - } else { - switch (typeof quantity) { - case "bigint": - this.data = quantity as bigint; - case "number": - case "string": - this.data = BigInt(quantity); - break; - default: - throw new TypeError("quantity is not a Buffer, number, or string"); - } - } - } - toBigNum(): bigint { - return this.data; - } - toString(): string { - return `$0x${this.data.toString(16)}`; - } -} +export default JsonRpcQuantity; \ No newline at end of file diff --git a/src/types/indexable-hex-data.ts b/src/types/indexable-hex-data.ts new file mode 100644 index 0000000000..f9c5f04d78 --- /dev/null +++ b/src/types/indexable-hex-data.ts @@ -0,0 +1,5 @@ +type IndexableHexData = string & { + new(value: T): IndexableHexData, + toString(): string + } +export default IndexableHexData; \ No newline at end of file From b60005b2bd4029e0ac60b43a818cae00313f2e2e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 29 Mar 2019 16:27:14 -0400 Subject: [PATCH 015/691] tweaks --- src/interfaces/ledger-options.ts | 2 +- src/ledgers/ethereum/blockchain.ts | 30 +++--- src/ledgers/ethereum/ledger.ts | 6 +- src/ledgers/ethereum/options.ts | 2 +- src/options/options.ts | 2 +- src/types/account.ts | 9 +- src/types/address.ts | 29 +++++ src/types/base-hex-type.ts | 51 --------- src/types/hex-data.ts | 125 ---------------------- src/types/hex-quantity.ts | 3 - src/types/indexable-hex-data.ts | 5 - src/types/json-rpc/index.ts | 4 + src/types/json-rpc/json-rpc-base-types.ts | 52 +++++++++ src/types/json-rpc/json-rpc-data.ts | 67 ++++++++++++ src/types/json-rpc/json-rpc-quantity.ts | 51 +++++++++ 15 files changed, 227 insertions(+), 211 deletions(-) create mode 100644 src/types/address.ts delete mode 100644 src/types/base-hex-type.ts delete mode 100644 src/types/hex-data.ts delete mode 100644 src/types/hex-quantity.ts delete mode 100644 src/types/indexable-hex-data.ts create mode 100644 src/types/json-rpc/index.ts create mode 100644 src/types/json-rpc/json-rpc-base-types.ts create mode 100644 src/types/json-rpc/json-rpc-data.ts create mode 100644 src/types/json-rpc/json-rpc-quantity.ts diff --git a/src/interfaces/ledger-options.ts b/src/interfaces/ledger-options.ts index 4835ddcc9f..367056f059 100644 --- a/src/interfaces/ledger-options.ts +++ b/src/interfaces/ledger-options.ts @@ -1,4 +1,4 @@ -import {JsonRpcData} from "../types/hex-data"; +import {JsonRpcData} from "../types/json-rpc"; export default interface LedgerOptions { accounts?: JsonRpcData[] diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index ffb28b9234..cfd024dcb8 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,13 +1,11 @@ import EthereumJsBLock from "ethereumjs-block"; import Tag from "../../types/tags"; -import {JsonRpcData} from "../../types/hex-data"; - -class Account { - public balance: bigint -} +import {JsonRpcData} from "../../types/json-rpc"; +import Address from "../../types/address"; +import Account from "../../types/account"; type AccountManager = { - readonly [index: string]: Promise; + readonly [index: string]: Promise; } class Block extends EthereumJsBLock { @@ -19,8 +17,8 @@ class Block extends EthereumJsBLock { const self = this; this._accounts = { - async getAccount(number: JsonRpcData): Promise { - return new Account(); + async getAccount(number: Address): Promise { + return new Account(number); } } this.accounts = new Proxy(this, { @@ -40,21 +38,19 @@ export default class Blockchain { public blocks: BlockManager; private _blocks: any; - constructor(){ + constructor() { const self = this; - this._blocks = { - async getBlock(number: string): Promise { - const b = new Block(Buffer.from([])); - b.header.number = Buffer.from([number]); - return b; - } - } + const getBlock = async(number: string): Promise => { + const b = new Block(Buffer.from([])); + b.header.number = Buffer.from([number]); + return b; + }; this.blocks = new Proxy(this, { async get (obj, key: string|Tag): Promise { if (key === "latest" || key === "earliest" || key === "pending") { return self._blocks.getBlock("111111"); } - return self._blocks.getBlock(key); + return getBlock(key); } }) as any; } diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index b3d1873e37..b6e5aac5f0 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,6 +1,6 @@ import ILedger, {optionsSymbol as _options} from "../../interfaces/ledger"; import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options"; -import {JsonRpcData, IndexableHexData} from "../../types/hex-data"; +import {JsonRpcData, IndexableHexData, JsonRpcQuantity} from "../../types/json-rpc"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; @@ -134,12 +134,12 @@ export default class Ethereum implements ILedger { * @param address 20 Bytes - address to check for balance. * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter */ - async eth_getBalance(address: IndexableHexData, blockNumber: bigint|Tag = Tag.LATEST): Promise { + async eth_getBalance(address: IndexableHexData, blockNumber: bigint|Tag = Tag.LATEST): Promise { const chain = this[_blockchain]; const str = blockNumber.toString(); const block = await chain.blocks[str]; const account = await block.accounts[address]; - return BigInt(123); + return account.balance; } [index: string]: (...args: any) => Promise<{}>; diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 4978c6d822..8241fc8b4d 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,5 +1,5 @@ import LedgerOptions from "../../interfaces/ledger-options" -import {JsonRpcData} from "../../types/hex-data"; +import {JsonRpcData} from "../../types/json-rpc"; interface EthereumOptions extends LedgerOptions { net_version: string, diff --git a/src/options/options.ts b/src/options/options.ts index c23cb5bb6f..fccfee599c 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -1,5 +1,5 @@ import Account from "../types/account"; -import {JsonRpcData, JsonRpcQuantity} from "../types/hex-data"; +import {JsonRpcData, JsonRpcQuantity} from "../types/json-rpc"; import ILedger from "../interfaces/ledger"; import Ethereum from "../ledgers/ethereum/ledger"; diff --git a/src/types/account.ts b/src/types/account.ts index 51b3d47297..5022ee5879 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -1,10 +1,11 @@ -import { JsonRpcData, JsonRpcQuantity } from "./hex-data"; +import { JsonRpcData, JsonRpcQuantity } from "./json-rpc"; +import Address from "./address"; export default class Account { - public address: JsonRpcData - public balance: JsonRpcQuantity = new JsonRpcQuantity("0x0") + public address: Address + public balance: JsonRpcQuantity = new JsonRpcQuantity(0n) public secretKey: JsonRpcData - constructor(address: JsonRpcData) { + constructor(address: Address) { this.address = address; } } diff --git a/src/types/address.ts b/src/types/address.ts new file mode 100644 index 0000000000..2c673fb442 --- /dev/null +++ b/src/types/address.ts @@ -0,0 +1,29 @@ +import {IndexableHexData, HexData} from "./json-rpc"; +import {BaseJsonRpcData} from "./json-rpc/json-rpc-data"; + +export class BaseAddress extends BaseJsonRpcData { + constructor(value: T) { + // the super will check the rest of the types + if (typeof value === "bigint"){ + throw new Error(`Cannot create a ${typeof value} as a HexData`); + } + super(value); + } + public static from(value: string | Buffer) { + return new Address(value); + } + } + type $ = { + new(data: T): Address & HexData, + from(data: T): Address & HexData + } + const Address = BaseAddress as $; + + interface Address { + constructor(data: T): Address + from(): Address + } + + export type IndexableAddress = Address & IndexableHexData; + export default Address; + \ No newline at end of file diff --git a/src/types/base-hex-type.ts b/src/types/base-hex-type.ts deleted file mode 100644 index d98b1ac8f0..0000000000 --- a/src/types/base-hex-type.ts +++ /dev/null @@ -1,51 +0,0 @@ -const prefix = "0x"; - -import IndexableHexData from "./indexable-hex-data" -export type IndexableHexData = IndexableHexData; - -export class BaseHexData { - private _data: T; - private _str: string; - private _toString: () => string - constructor(data: T) { - if (Buffer.isBuffer(data)) { - this._toString = data.toString.bind(data, "hex"); - } else { - switch (typeof data) { - case "bigint": - this._toString = data.toString.bind(data, 16); - break; - case "string": { - if (data.indexOf("0x") === 0) { - this._str = data as string; - } else { - this._toString = () => { - const buf = Buffer.from(data); - return buf.toString("hex"); - } - } - break; - } - default: - throw new Error(`Cannot create a ${typeof data} as a HexData`); - } - } - this._data = data; - } - - public static from: (data: bigint|string|Buffer) => BaseHexData; - - toString(): string { - const str = this._str; - if (str !== undefined) { - return str; - } else { - return this._str = (prefix + this._toString()); - } - } - valueOf():T { - return this._data; - } -} - -export type HexData = BaseHexData & IndexableHexData; \ No newline at end of file diff --git a/src/types/hex-data.ts b/src/types/hex-data.ts deleted file mode 100644 index e0f20797f5..0000000000 --- a/src/types/hex-data.ts +++ /dev/null @@ -1,125 +0,0 @@ -const prefix = "0x"; - -export type IndexableHexData = string & { - new(value: bigint|string|Buffer): IndexableHexData, - toString(): string -} - -class BaseHexData { - protected _data: T; - protected _str: string; - protected _toString: () => string - constructor(data: T) { - if (Buffer.isBuffer(data)) { - this._toString = data.toString.bind(data, "hex"); - } else { - switch (typeof data) { - case "bigint": - this._toString = data.toString.bind(data, 16); - break; - case "string": { - if (data.indexOf("0x") === 0) { - this._str = data as string; - } else { - this._toString = () => { - const buf = Buffer.from(data); - return buf.toString("hex"); - } - } - break; - } - default: - throw new Error(`Cannot create a ${typeof data} as a HexData`); - } - } - this._data = data; - } - - public static from(data: bigint|string|Buffer) { - return new BaseHexData(data); - } - - toString(): string { - return this._toString() - } - toBuffer(): Buffer { - - } - valueOf():T { - return this._data; - } -} - -type HexData = BaseHexData & IndexableHexData; - - - - - - -class _JsonRpcData extends BaseHexData { - public toString(): string { - const str = this._str; - if (str !== undefined) { - return str; - } else { - const str = this._toString(); - if (str.length % 2 === 1) { - return this._str = `0x0${str}`; - } else { - return this._str = `0x${str}`; - } - } - } - public static from(data: bigint|string|Buffer) { - return new JsonRpcData(data); - } -} -const JsonRpcData = _JsonRpcData as ({ - new (data: T): JsonRpcData & HexData, - from(data: T): JsonRpcData & HexData -}); - -export interface JsonRpcData { - constructor(data: T): JsonRpcData - from(): JsonRpcData -} - - -// quantity -class _JsonRpcQuantity extends BaseHexData { - public toString(): string { - const str = this._str; - if (str !== undefined) { - return str; - } else { - return this._str = (prefix + this._toString()); - } - } - public static from(data: bigint|string|Buffer) { - return new JsonRpcQuantity(data); - } -} - -const JsonRpcQuantity = _JsonRpcQuantity as ({ - new (data: T): JsonRpcQuantity & HexData, - from(data: T): JsonRpcQuantity & HexData -}); -interface JsonRpcQuantity extends string { - constructor(data: T): JsonRpcQuantity - from(): JsonRpcQuantity -} - - -export {JsonRpcQuantity, JsonRpcData}; - - -class AccountManager { - [index: string]: string; -} -var a = new AccountManager(); -var q: JsonRpcQuantity = new JsonRpcQuantity("123"); -a[q] = "123"; - -console.log(balance.toString()); -console.log(balance.valueOf()); \ No newline at end of file diff --git a/src/types/hex-quantity.ts b/src/types/hex-quantity.ts deleted file mode 100644 index 1a43c543a9..0000000000 --- a/src/types/hex-quantity.ts +++ /dev/null @@ -1,3 +0,0 @@ -import {JsonRpcQuantity} from "./hex-data"; - -export default JsonRpcQuantity; \ No newline at end of file diff --git a/src/types/indexable-hex-data.ts b/src/types/indexable-hex-data.ts deleted file mode 100644 index f9c5f04d78..0000000000 --- a/src/types/indexable-hex-data.ts +++ /dev/null @@ -1,5 +0,0 @@ -type IndexableHexData = string & { - new(value: T): IndexableHexData, - toString(): string - } -export default IndexableHexData; \ No newline at end of file diff --git a/src/types/json-rpc/index.ts b/src/types/json-rpc/index.ts new file mode 100644 index 0000000000..6b7e9f26b4 --- /dev/null +++ b/src/types/json-rpc/index.ts @@ -0,0 +1,4 @@ +import {IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType} from "./json-rpc-base-types"; +import JsonRpcQuantity, {IndexableJsonRpcQuantity} from "./json-rpc-quantity"; +import JsonRpcData, {IndexableJsonRpcData} from "./json-rpc-data"; +export {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcType as IndexableHexData, JsonRpcType as HexData, BaseJsonRpcType as BaseHexData, IndexableJsonRpcQuantity, IndexableJsonRpcData}; \ No newline at end of file diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts new file mode 100644 index 0000000000..b516999b5f --- /dev/null +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -0,0 +1,52 @@ +export type IndexableJsonRpcType = string & { + new(value: T): IndexableJsonRpcType, + toString(): string + } + + export class BaseJsonRpcType { + protected _value: T; + protected _str: string; + protected _toString: () => string + constructor(value: T) { + if (Buffer.isBuffer(value)) { + this._toString = value.toString.bind(value, "hex"); + } else { + switch (typeof value) { + case "bigint": + this._toString = value.toString.bind(value, 16); + break; + case "string": { + this._toString = () => { + if (value.indexOf("0x") === 0) { + return this._str = value as string; + } else { + const buf = Buffer.from(value); + return buf.toString("hex"); + } + } + break; + } + default: + throw new Error(`Cannot create a ${typeof value} as a HexData`); + } + } + this._value = value; + } + + // public static from(value: T) { + // return new BaseJsonRpcType(value); + // } + + toString(): string { + return this._toString() + } + toBuffer(): Buffer { + return Buffer.from([]); + } + valueOf():T { + return this._value; + } + } + + export type JsonRpcType = BaseJsonRpcType & IndexableJsonRpcType; + \ No newline at end of file diff --git a/src/types/json-rpc/json-rpc-data.ts b/src/types/json-rpc/json-rpc-data.ts new file mode 100644 index 0000000000..7e9c619bc2 --- /dev/null +++ b/src/types/json-rpc/json-rpc-data.ts @@ -0,0 +1,67 @@ +import { BaseHexData, HexData, IndexableHexData } from "."; + +function validateByteLength(byteLength?: number){ + if (byteLength !== undefined && (typeof byteLength !== "number" || byteLength < 0)) { + throw new Error(`byteLength must be a number greater than 0`); + } +} +export class BaseJsonRpcData extends BaseHexData { + private _byteLength: number; + constructor(value: string | Buffer, byteLength?: number) { + if (typeof value === "bigint"){ + throw new Error(`Cannot create a ${typeof value} as a JsonRpcData`); + } + super(value); + validateByteLength(byteLength); + this._byteLength = byteLength | 0; + } + public toString(byteLength?: number): string { + const str = this._str; + if (str !== undefined) { + return str; + } else { + let str = this._toString(); + let length = str.length; + if (length % 2 === 1) { + length++; + str = `0${str}`; + } + + if (byteLength !== undefined) { + validateByteLength(byteLength); + } else { + byteLength = this._byteLength; + } + if (byteLength !== undefined) { + const strLength = byteLength * 2; + const padBy = strLength - length; + if (padBy < 0) { + // if our hex-encoded data is longer than it should be, truncate it: + str = str.slice(0, strLength); + } else if (padBy > 0) { + // if our hex-encoded data is shorter than it should be, pad it: + str = "0".repeat(padBy); + } + } + return `0x${str}`; + } + } + public static from(value: T) { + return new JsonRpcData(value); + } +} +type $ = { + new(value: T, byteLength?: number): JsonRpcData & HexData, + from(value: T): JsonRpcData & HexData, + toString(byteLength?: number): string +} +const JsonRpcData = BaseJsonRpcData as any as $; + +interface JsonRpcData { + constructor(value: T, byteLength?: number): JsonRpcData + from(): JsonRpcData, + toString(byteLength?: number): string +} + +export type IndexableJsonRpcData = JsonRpcData & IndexableHexData; +export default JsonRpcData; diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts new file mode 100644 index 0000000000..5be9f9a6d0 --- /dev/null +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -0,0 +1,51 @@ +import { BaseHexData, HexData, IndexableHexData } from "."; + + +class BaseJsonRpcQuantity extends BaseHexData { + + + + + + public toString(): string { + const str = this._str; + if (str !== undefined) { + return str; + } else { + return this._str = "0x" + this._toString(); + } + } + + + + + + + + + + + + + + + + + + public static from(value: bigint | string | Buffer) { + return new JsonRpcQuantity(value); + } +} +type $ = { + new(value: T): JsonRpcQuantity & HexData, + from(value: T): JsonRpcQuantity & HexData +} +const JsonRpcQuantity = BaseJsonRpcQuantity as $; + +interface JsonRpcQuantity { + constructor(value: T): JsonRpcQuantity + from(): JsonRpcQuantity +} + +export type IndexableJsonRpcQuantity = JsonRpcQuantity & IndexableHexData; +export default JsonRpcQuantity; From d593f6c4a6ddf2c5a9f2216032afed63fac38662 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 29 Mar 2019 23:58:41 -0400 Subject: [PATCH 016/691] wheeeeee --- npm-shrinkwrap.json | 6 +- package.json | 8 +- src/engine.ts | 4 +- src/ledgers/ethereum/ledger.ts | 29 +++++- src/types/address.ts | 34 ++----- src/types/json-rpc/index.ts | 2 +- src/types/json-rpc/json-rpc-base-types.ts | 106 +++++++++++++--------- src/types/json-rpc/json-rpc-data.ts | 43 +++++---- src/types/json-rpc/json-rpc-quantity.ts | 53 +++-------- test/provider.ts | 19 ++-- tsconfig.json | 3 +- 11 files changed, 153 insertions(+), 154 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a068cd7c78..9c31457682 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -3597,9 +3597,9 @@ } }, "typescript": { - "version": "3.3.4000", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.4000.tgz", - "integrity": "sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.1.tgz", + "integrity": "sha512-3NSMb2VzDQm8oBTLH6Nj55VVtUEpe/rgkIzMir0qVoLyjDZlnMBva0U6vDiV3IH+sl/Yu6oP5QwsAQtHPmDd2Q==", "dev": true }, "uWebSockets.js": { diff --git a/package.json b/package.json index 4488879500..929d8ba834 100644 --- a/package.json +++ b/package.json @@ -28,17 +28,17 @@ "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.8.0" }, "devDependencies": { - "@types/uws": "0.13.2", "@types/mocha": "5.2.5", "@types/node": "10.12.0", - "@types/ws": "6.0.1", "@types/superagent": "4.1.1", + "@types/uws": "0.13.2", + "@types/ws": "6.0.1", "bufferutil": "4.0.1", "mocha": "6.0.2", - "tslint": "5.14.0", "superagent": "4.1.0", "ts-node": "8.0.3", - "typescript": "3.3.4000", + "tslint": "5.14.0", + "typescript": "3.4.1", "utf-8-validate": "5.0.2", "ws": "6.2.1" }, diff --git a/src/engine.ts b/src/engine.ts index 1f2a3df049..f726c22e8d 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -15,7 +15,9 @@ export default class Engine { if (ledger.__proto__.hasOwnProperty(method)) { const fn = ledger[method]; if (typeof fn === "function") { - return fn.apply(ledger, params); + return fn.apply(ledger, params).then((result: any) => { + return JSON.stringify(result); + }); } } throw new Error(`Invalid method: ${method}`); diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index b6e5aac5f0..c87b112063 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,8 +1,9 @@ import ILedger, {optionsSymbol as _options} from "../../interfaces/ledger"; import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options"; -import {JsonRpcData, IndexableHexData, JsonRpcQuantity} from "../../types/json-rpc"; +import {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcData} from "../../types/json-rpc"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; +import { IndexableAddress } from "../../types/address"; const createKeccakHash = require("keccak"); @@ -134,7 +135,7 @@ export default class Ethereum implements ILedger { * @param address 20 Bytes - address to check for balance. * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter */ - async eth_getBalance(address: IndexableHexData, blockNumber: bigint|Tag = Tag.LATEST): Promise { + async eth_getBalance(address: IndexableAddress, blockNumber: bigint|Tag = Tag.LATEST): Promise { const chain = this[_blockchain]; const str = blockNumber.toString(); const block = await chain.blocks[str]; @@ -142,5 +143,29 @@ export default class Ethereum implements ILedger { return account.balance; } + /** + * Returns the information about a transaction requested by transaction hash. + * + * @param transasctionHash 32 Bytes - hash of a transaction + */ + async eth_getTransactionByHash(transasctionHash: IndexableJsonRpcData) { + return { + blockHash: JsonRpcData.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. + blockNumber: JsonRpcQuantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. + from: JsonRpcData.from("0x123456", 32), // 20 Bytes - address of the sender. + gas: JsonRpcQuantity.from(123n),// QUANTITY - gas provided by the sender. + gasPrice: JsonRpcQuantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. + hash: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. + input: JsonRpcData.from("0x123"),// DATA - the data send along with the transaction. + nonce: JsonRpcQuantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. + to: JsonRpcData.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. + transactionIndex: JsonRpcQuantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. + value: JsonRpcQuantity.from(123n),// QUANTITY - value transferred in Wei. + v: JsonRpcQuantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id + r: JsonRpcData.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r + s: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s + } + } + [index: string]: (...args: any) => Promise<{}>; } diff --git a/src/types/address.ts b/src/types/address.ts index 2c673fb442..6ca6f35a5e 100644 --- a/src/types/address.ts +++ b/src/types/address.ts @@ -1,29 +1,7 @@ -import {IndexableHexData, HexData} from "./json-rpc"; -import {BaseJsonRpcData} from "./json-rpc/json-rpc-data"; +import {IndexableJsonRpcType, JsonRpcData} from "./json-rpc"; -export class BaseAddress extends BaseJsonRpcData { - constructor(value: T) { - // the super will check the rest of the types - if (typeof value === "bigint"){ - throw new Error(`Cannot create a ${typeof value} as a HexData`); - } - super(value); - } - public static from(value: string | Buffer) { - return new Address(value); - } - } - type $ = { - new(data: T): Address & HexData, - from(data: T): Address & HexData - } - const Address = BaseAddress as $; - - interface Address { - constructor(data: T): Address - from(): Address - } - - export type IndexableAddress = Address & IndexableHexData; - export default Address; - \ No newline at end of file +const Address = JsonRpcData; + +interface Address extends JsonRpcData {} +export type IndexableAddress = Address & IndexableJsonRpcType; +export default Address; \ No newline at end of file diff --git a/src/types/json-rpc/index.ts b/src/types/json-rpc/index.ts index 6b7e9f26b4..60139bb251 100644 --- a/src/types/json-rpc/index.ts +++ b/src/types/json-rpc/index.ts @@ -1,4 +1,4 @@ import {IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType} from "./json-rpc-base-types"; import JsonRpcQuantity, {IndexableJsonRpcQuantity} from "./json-rpc-quantity"; import JsonRpcData, {IndexableJsonRpcData} from "./json-rpc-data"; -export {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcType as IndexableHexData, JsonRpcType as HexData, BaseJsonRpcType as BaseHexData, IndexableJsonRpcQuantity, IndexableJsonRpcData}; \ No newline at end of file +export {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType, IndexableJsonRpcQuantity, IndexableJsonRpcData}; \ No newline at end of file diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index b516999b5f..1a8c42948e 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -1,52 +1,70 @@ -export type IndexableJsonRpcType = string & { - new(value: T): IndexableJsonRpcType, - toString(): string +export type IndexableJsonRpcType = string & { + new(value: T): IndexableJsonRpcType, + toString(): string +} + +export const strCache = new WeakMap(); +export const toStrings = new WeakMap(); + +const inspect = Symbol.for('nodejs.util.inspect.custom'); + +export class BaseJsonRpcType { + protected value: T; + // used to make console.log debugging a little easier + private [inspect](depth: number, options: any):T { + return this.value; } - - export class BaseJsonRpcType { - protected _value: T; - protected _str: string; - protected _toString: () => string - constructor(value: T) { - if (Buffer.isBuffer(value)) { - this._toString = value.toString.bind(value, "hex"); - } else { - switch (typeof value) { - case "bigint": - this._toString = value.toString.bind(value, 16); - break; - case "string": { - this._toString = () => { - if (value.indexOf("0x") === 0) { - return this._str = value as string; - } else { - const buf = Buffer.from(value); - return buf.toString("hex"); - } + constructor(value: T) { + const self = this as any; + let toString: () => string; + if (Buffer.isBuffer(value)) { + toString = value.toString.bind(value, "hex"); + self[Symbol.toStringTag] = "Buffer"; + } else { + const type = typeof value; + switch (type) { + case "bigint": + toString = value.toString.bind(value, 16); + break; + case "string": { + toString = () => { + if ((value as string).indexOf("0x") === 0) { + return (value as string).slice(2); + } else { + const buf = Buffer.from(value as string); + return buf.toString("hex"); } - break; } - default: - throw new Error(`Cannot create a ${typeof value} as a HexData`); + break; } + default: + throw new Error(`Cannot create a ${typeof value} as a HexData`); } - this._value = value; + self[Symbol.toStringTag] = type; } - - // public static from(value: T) { - // return new BaseJsonRpcType(value); - // } - - toString(): string { - return this._toString() - } - toBuffer(): Buffer { - return Buffer.from([]); - } - valueOf():T { - return this._value; + + this.value = value; + toStrings.set(this, toString); + } + + toString(): string { + let str = strCache.get(this); + if (str === undefined) { + str = "0x" + toStrings.get(this)(); + strCache.set(this, str); } + return str; + } + toBuffer(): Buffer { + return Buffer.from([]); + } + valueOf(): T { + return this.value; + } + toJSON(): string { + return this.toString() } - - export type JsonRpcType = BaseJsonRpcType & IndexableJsonRpcType; - \ No newline at end of file + +} + +export type JsonRpcType = BaseJsonRpcType & IndexableJsonRpcType; diff --git a/src/types/json-rpc/json-rpc-data.ts b/src/types/json-rpc/json-rpc-data.ts index 7e9c619bc2..34c8b6a0cd 100644 --- a/src/types/json-rpc/json-rpc-data.ts +++ b/src/types/json-rpc/json-rpc-data.ts @@ -1,26 +1,29 @@ -import { BaseHexData, HexData, IndexableHexData } from "."; +import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; +import { strCache, toStrings } from "./json-rpc-base-types"; function validateByteLength(byteLength?: number){ - if (byteLength !== undefined && (typeof byteLength !== "number" || byteLength < 0)) { + if (typeof byteLength !== "number" || byteLength < 0) { throw new Error(`byteLength must be a number greater than 0`); } } -export class BaseJsonRpcData extends BaseHexData { - private _byteLength: number; +const byteLengths = new WeakMap(); +export class JsonRpcData extends BaseJsonRpcType { constructor(value: string | Buffer, byteLength?: number) { if (typeof value === "bigint"){ throw new Error(`Cannot create a ${typeof value} as a JsonRpcData`); } super(value); - validateByteLength(byteLength); - this._byteLength = byteLength | 0; + if(byteLength !== undefined){ + validateByteLength(byteLength); + byteLengths.set(this, byteLength | 0); + } } public toString(byteLength?: number): string { - const str = this._str; + const str = strCache.get(this) as string; if (str !== undefined) { return str; } else { - let str = this._toString(); + let str = toStrings.get(this)() as string; let length = str.length; if (length % 2 === 1) { length++; @@ -30,7 +33,7 @@ export class BaseJsonRpcData extends BaseHexData { if (byteLength !== undefined) { validateByteLength(byteLength); } else { - byteLength = this._byteLength; + byteLength = byteLengths.get(this); } if (byteLength !== undefined) { const strLength = byteLength * 2; @@ -40,28 +43,28 @@ export class BaseJsonRpcData extends BaseHexData { str = str.slice(0, strLength); } else if (padBy > 0) { // if our hex-encoded data is shorter than it should be, pad it: - str = "0".repeat(padBy); + str = "0".repeat(padBy) + str; } } return `0x${str}`; } } - public static from(value: T) { - return new JsonRpcData(value); + public static from(value: T, byteLength?: number) { + return new _JsonRpcData(value, byteLength); } } type $ = { - new(value: T, byteLength?: number): JsonRpcData & HexData, - from(value: T): JsonRpcData & HexData, + new(value: T, byteLength?: number): _JsonRpcData & JsonRpcType, + from(value: T, byteLength?: number): _JsonRpcData & JsonRpcType, toString(byteLength?: number): string } -const JsonRpcData = BaseJsonRpcData as any as $; +const _JsonRpcData = JsonRpcData as $; -interface JsonRpcData { - constructor(value: T, byteLength?: number): JsonRpcData - from(): JsonRpcData, +interface _JsonRpcData { + constructor(value: T, byteLength?: number): _JsonRpcData + from(value: T, byteLength?: number): _JsonRpcData, toString(byteLength?: number): string } -export type IndexableJsonRpcData = JsonRpcData & IndexableHexData; -export default JsonRpcData; +export type IndexableJsonRpcData = _JsonRpcData & IndexableJsonRpcType; +export default _JsonRpcData; diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index 5be9f9a6d0..d76d78415a 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -1,51 +1,20 @@ -import { BaseHexData, HexData, IndexableHexData } from "."; - - -class BaseJsonRpcQuantity extends BaseHexData { - - - - - - public toString(): string { - const str = this._str; - if (str !== undefined) { - return str; - } else { - return this._str = "0x" + this._toString(); - } - } - - - - - - - - - - - - - - - - +import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; +class JsonRpcQuantity extends BaseJsonRpcType { public static from(value: bigint | string | Buffer) { - return new JsonRpcQuantity(value); + return new _JsonRpcQuantity(value); } } type $ = { - new(value: T): JsonRpcQuantity & HexData, - from(value: T): JsonRpcQuantity & HexData + new(value: T): _JsonRpcQuantity & JsonRpcType, + from(value: T): _JsonRpcQuantity & JsonRpcType } -const JsonRpcQuantity = BaseJsonRpcQuantity as $; +const _JsonRpcQuantity = JsonRpcQuantity as $; -interface JsonRpcQuantity { - constructor(value: T): JsonRpcQuantity - from(): JsonRpcQuantity +interface _JsonRpcQuantity { + constructor(value: T): _JsonRpcQuantity + from(): _JsonRpcQuantity } -export type IndexableJsonRpcQuantity = JsonRpcQuantity & IndexableHexData; -export default JsonRpcQuantity; +export type IndexableJsonRpcQuantity = _JsonRpcQuantity & IndexableJsonRpcType; +export default _JsonRpcQuantity; diff --git a/test/provider.ts b/test/provider.ts index 1304b3edd5..700e69d998 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -1,19 +1,25 @@ import Ganache from "../index" import * as assert from "assert"; +import Provider from "../src/provider"; describe("provider", () => { const networkId = "1234"; - it("returns things via EIP-1193", async () => { - const p = Ganache.provider({ + let p: Provider; + beforeEach("set up", () =>{ + p = Ganache.provider({ network_id: networkId }); + }) + it("returns a transaction", async () => { + var result = await p.send("eth_getTransactionByHash", ["0x123"]); + const v = result.blockNumber; + // todo: figure things out + }) + it("returns things via EIP-1193", async () => { const version = await p.send("net_version"); assert.strictEqual(version, networkId); }); it("returns things via legacy", (done) => { - const p = Ganache.provider({ - network_id: networkId - }); const ret = p.send({ id: "1", jsonrpc: "2.0", @@ -26,9 +32,6 @@ describe("provider", () => { }); it("returns rejects invalid rpc methods", async () => { - const p = Ganache.provider({ - network_id: networkId - }); await assert.rejects(p.send("toString"), { message: "Invalid method: toString" }); diff --git a/tsconfig.json b/tsconfig.json index 1ed2be385d..cd153c666f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,8 @@ "moduleResolution": "node", "sourceMap": true, "outDir": "dist", - "lib": ["esnext"] + "lib": ["esnext"], + "incremental": true }, "include": [ "./index.ts", From 78bf6c628547b8d22791bc0beadab911c08cf656 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 4 Apr 2019 17:48:22 -0400 Subject: [PATCH 017/691] some stuff --- npm-shrinkwrap.json | 634 ++++++++++++++++-- package.json | 14 +- src/engine.ts | 32 +- src/ledgers/ethereum/blockchain.ts | 56 +- src/ledgers/ethereum/ledger.ts | 36 +- src/ledgers/ethereum/options.ts | 4 +- src/options/options.ts | 3 +- src/options/provider-options.ts | 41 +- src/provider.ts | 136 ++-- src/server.ts | 1 - src/servers/http-server.ts | 25 +- .../views/components/accounts/accounts.marko | 28 + .../components/accounts/components/info.marko | 10 + .../views/components/app-tabs/index.marko | 11 + .../views/components/app-tabs/marko-tag.json | 6 + src/servers/views/components/blocks.marko | 5 + src/servers/views/components/events.marko | 5 + src/servers/views/components/logs.marko | 5 + .../views/components/status-bar/index.marko | 34 + .../views/components/transactions.marko | 5 + src/servers/views/index.marko | 169 +++++ src/types/account.ts | 6 +- src/types/json-rpc/json-rpc-base-types.ts | 2 +- src/types/json-rpc/json-rpc-quantity.ts | 9 +- src/types/transaction.ts | 85 +++ test/server.ts | 2 +- 26 files changed, 1202 insertions(+), 162 deletions(-) create mode 100644 src/servers/views/components/accounts/accounts.marko create mode 100644 src/servers/views/components/accounts/components/info.marko create mode 100644 src/servers/views/components/app-tabs/index.marko create mode 100644 src/servers/views/components/app-tabs/marko-tag.json create mode 100644 src/servers/views/components/blocks.marko create mode 100644 src/servers/views/components/events.marko create mode 100644 src/servers/views/components/logs.marko create mode 100644 src/servers/views/components/status-bar/index.marko create mode 100644 src/servers/views/components/transactions.marko create mode 100644 src/servers/views/index.marko create mode 100644 src/types/transaction.ts diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9c31457682..4837ae49b5 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -88,6 +88,11 @@ "xtend": "~4.0.0" } }, + "aes-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", + "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" + }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -106,12 +111,22 @@ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, + "app-module-path": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", + "integrity": "sha1-ZBqlXft9am8KgUHEucCqULbCTdU=" + }, "arg": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", "integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==", "dev": true }, + "argly": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/argly/-/argly-1.2.0.tgz", + "integrity": "sha1-KydORVGin/XnGZ0u2XiOtm7TbmA=" + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -145,6 +160,11 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -199,8 +219,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base": { "version": "0.11.2", @@ -257,11 +276,37 @@ } } }, + "base-x": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.5.tgz", + "integrity": "sha512-C3picSgzPSLE+jW3tcBzJoGwitOtazb5B+5YmAxZm2ybmTi9LNgAtDO/jjVEBZwHoXmDBZ9m/IELj3elJVRBcA==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "bindings": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" }, + "bip39": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.0.tgz", + "integrity": "sha512-p1gHoZCAMfHRQLr57d/3AfillgPwV2nsBAnHpHUmr3BCRmThN9k18r5mUK/9R/zdFhZAlltYDzYe2GjnzXvMQA==", + "requires": { + "@types/node": "11.11.6", + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1" + }, + "dependencies": { + "@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" + } + } + }, "bip66": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", @@ -279,7 +324,6 @@ "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", "concat-map": "0.0.1" @@ -319,6 +363,11 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, + "browser-refresh-client": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/browser-refresh-client/-/browser-refresh-client-1.1.4.tgz", + "integrity": "sha1-jl/4R1/h1UHSroH3oa6gWuIaYhc=" + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -347,6 +396,24 @@ "safe-buffer": "^5.1.1" } }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -393,8 +460,17 @@ "camelcase": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", - "dev": true + "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==" + }, + "chai": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", + "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", + "requires": { + "assertion-error": "^1.0.1", + "deep-eql": "^0.1.3", + "type-detect": "^1.0.0" + } }, "chalk": { "version": "1.1.3", @@ -417,6 +493,11 @@ } } }, + "char-props": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/char-props/-/char-props-0.1.5.tgz", + "integrity": "sha1-W5UvniDqIc0Iyn/hNaEPb+kcEJ4=" + }, "checkpoint-store": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", @@ -491,6 +572,22 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "coinstring": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/coinstring/-/coinstring-2.3.0.tgz", + "integrity": "sha1-zbYzY6lhUCQEolr7gsLibV/2J6Q=", + "requires": { + "bs58": "^2.0.1", + "create-hash": "^1.1.1" + }, + "dependencies": { + "bs58": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-2.0.1.tgz", + "integrity": "sha1-VZCNWPGYKrogCPob7Y+RmYopv40=" + } + } + }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -531,6 +628,14 @@ "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, + "complain": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/complain/-/complain-1.3.0.tgz", + "integrity": "sha512-PA9uGpaS4BXKrhFx3rl2nZMWySnGoW1pWf+dpBqNdDx3uR6PA0EPxjD17H9OxvW5w/bODBSziQ516Guf59rW+w==", + "requires": { + "error-stack-parser": "^2.0.1" + } + }, "component-emitter": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", @@ -540,8 +645,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "cookiejar": { "version": "2.1.2", @@ -585,6 +689,16 @@ "sha.js": "^2.4.8" } }, + "cross-env": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz", + "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.5", + "is-windows": "^1.0.0" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -619,6 +733,26 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "requires": { + "type-detect": "0.1.1" + }, + "dependencies": { + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=" + } + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + }, "deferred-leveldown": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.0.0.tgz", @@ -684,6 +818,23 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, + "deresolve": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/deresolve/-/deresolve-1.1.2.tgz", + "integrity": "sha1-nPI3nI0tYx3EuZVylLkOSnLLbOA=", + "requires": { + "lasso-package-root": "^1.0.0", + "raptor-polyfill": "^1.0.2", + "resolve-from": "^1.0.1" + }, + "dependencies": { + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=" + } + } + }, "detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", @@ -777,6 +928,14 @@ "prr": "~1.0.1" } }, + "error-stack-parser": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.0.2.tgz", + "integrity": "sha512-E1fPutRDdIj/hohG0UpT5mayXNCxXP9d+snxFsPU9X0XgccOumKraa3juDMwTUyi7+Bu5+mCGagjg4IYeNbOdw==", + "requires": { + "stackframe": "^1.0.4" + } + }, "es-abstract": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", @@ -808,17 +967,45 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "escodegen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", + "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true + } + } + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "ethashjs": { "version": "0.0.7", @@ -856,40 +1043,13 @@ "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=" }, "ethereumjs-account": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", - "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", + "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", "requires": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", + "ethereumjs-util": "^6.0.0", + "rlp": "^2.2.1", "safe-buffer": "^5.1.1" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - } } }, "ethereumjs-block": { @@ -1192,14 +1352,15 @@ } }, "ethereumjs-vm": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz", - "integrity": "sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-3.0.0.tgz", + "integrity": "sha512-lNu+G/RWPRCrQM5s24MqgU75PEGiAhL4Ombw0ew6m08d+amsxf/vGAb98yDNdQqqHKV6JbwO/tCGfdqXGI6Cug==", "requires": { "async": "^2.1.2", "async-eventemitter": "^0.2.2", "ethereumjs-account": "^2.0.3", "ethereumjs-block": "~2.2.0", + "ethereumjs-blockchain": "^3.4.0", "ethereumjs-common": "^1.1.0", "ethereumjs-util": "^6.0.0", "fake-merkle-patricia-tree": "^1.0.1", @@ -1232,6 +1393,32 @@ "abstract-leveldown": "~2.6.0" } }, + "ethereumjs-account": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", + "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", + "requires": { + "ethereumjs-util": "^5.0.0", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + } + } + }, "keccak": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", @@ -1364,11 +1551,6 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" }, - "rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" - }, "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", @@ -1389,6 +1571,22 @@ } } }, + "ethereumjs-wallet": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/ethereumjs-wallet/-/ethereumjs-wallet-0.6.3.tgz", + "integrity": "sha512-qiXPiZOsStem+Dj/CQHbn5qex+FVkuPmGH7SvSnA9F3tdRDt8dLMyvIj3+U05QzVZNPYh4HXEdnzoYI4dZkr9w==", + "requires": { + "aes-js": "^3.1.1", + "bs58check": "^2.1.2", + "ethereumjs-util": "^6.0.0", + "hdkey": "^1.1.0", + "randombytes": "^2.0.6", + "safe-buffer": "^5.1.2", + "scrypt.js": "^0.3.0", + "utf8": "^3.0.0", + "uuid": "^3.3.2" + } + }, "ethjs-util": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", @@ -1398,6 +1596,19 @@ "strip-hex-prefix": "1.0.0" } }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" + }, + "events-light": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/events-light/-/events-light-1.0.5.tgz", + "integrity": "sha1-lk5jRQugr0prAiqpVbF//vZXte4=", + "requires": { + "chai": "^3.5.0" + } + }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -1575,6 +1786,11 @@ "checkpoint-store": "^1.1.0" } }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -1835,11 +2051,20 @@ "minimalistic-assert": "^1.0.1" } }, + "hdkey": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.1.tgz", + "integrity": "sha512-DvHZ5OuavsfWs5yfVJZestsnc3wzPvLWNk6c2nRUfo6X+OtxypGt20vDDf7Ba+MJzjL3KS1og2nw2eBbLCOUTA==", + "requires": { + "coinstring": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "hmac-drbg": { "version": "1.0.1", @@ -1860,6 +2085,15 @@ "parse-passwd": "^1.0.0" } }, + "htmljs-parser": { + "version": "2.6.6", + "resolved": "https://registry.npmjs.org/htmljs-parser/-/htmljs-parser-2.6.6.tgz", + "integrity": "sha512-cwIV9dkA5WgDuhZigrL6Aw1+sGdhlVi5b4csijnGVHe0GATGY0ibHt68q2O7nULTtg5HTMtR8tdvd2yVfPIZxg==", + "requires": { + "char-props": "^0.1.5", + "complain": "^1.0.0" + } + }, "immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", @@ -2124,6 +2358,31 @@ "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true }, + "lasso-caching-fs": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/lasso-caching-fs/-/lasso-caching-fs-1.0.2.tgz", + "integrity": "sha1-m+TrHwaqwSYDRMrq70LC8AhusQ0=", + "requires": { + "raptor-async": "^1.1.2" + } + }, + "lasso-modules-client": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/lasso-modules-client/-/lasso-modules-client-2.0.5.tgz", + "integrity": "sha1-2aBnJKkAl3Y2lxZn7pwXDS/E3Sg=", + "requires": { + "lasso-package-root": "^1.0.0", + "raptor-polyfill": "^1.0.2" + } + }, + "lasso-package-root": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lasso-package-root/-/lasso-package-root-1.0.1.tgz", + "integrity": "sha1-mX0OcfQdA8Xw+gmlvCmNeW+LLCM=", + "requires": { + "lasso-caching-fs": "^1.0.0" + } + }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", @@ -2305,6 +2564,20 @@ } } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "listener-tracker": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/listener-tracker/-/listener-tracker-2.0.0.tgz", + "integrity": "sha1-OWCLQ1wJAfpVECF8FFJyjWvBm18=" + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -2394,6 +2667,45 @@ "object-visit": "^1.0.0" } }, + "marko": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/marko/-/marko-4.16.6.tgz", + "integrity": "sha512-N3mjv37dZ1nne/TYovCGmQ4dW0AiKH/C4uusbLVZ46KVYbJabjer6B3wadPhJKmJYvmI+YEAVkHzmxcy1t+qOA==", + "requires": { + "app-module-path": "^2.2.0", + "argly": "^1.0.0", + "browser-refresh-client": "^1.0.0", + "camelcase": "^5.0.0", + "char-props": "~0.1.5", + "complain": "^1.3.0", + "deresolve": "^1.1.2", + "escodegen": "^1.8.1", + "esprima": "^4.0.0", + "estraverse": "^4.2.0", + "events": "^1.0.2", + "events-light": "^1.0.0", + "he": "^1.1.0", + "htmljs-parser": "^2.6.5", + "lasso-caching-fs": "^1.0.1", + "lasso-modules-client": "^2.0.4", + "lasso-package-root": "^1.0.1", + "listener-tracker": "^2.0.0", + "minimatch": "^3.0.2", + "object-assign": "^4.1.0", + "property-handlers": "^1.0.0", + "raptor-json": "^1.0.1", + "raptor-polyfill": "^1.0.0", + "raptor-promises": "^1.0.1", + "raptor-regexp": "^1.0.0", + "raptor-util": "^3.2.0", + "resolve-from": "^2.0.0", + "shorthash": "0.0.2", + "simple-sha1": "^2.1.0", + "strip-json-comments": "^2.0.1", + "try-require": "^1.2.1", + "warp10": "^2.0.1" + } + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -2566,7 +2878,6 @@ "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.7" } @@ -2739,6 +3050,11 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -2825,6 +3141,19 @@ "wrappy": "1" } }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "requires": { + "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" + } + }, "os-locale": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", @@ -2914,17 +3243,39 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, "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=", "dev": true }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, + "property-handlers": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/property-handlers/-/property-handlers-1.1.1.tgz", + "integrity": "sha1-yyDTIqq32U//rCj0bJGGvVlHtLQ=" + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -2940,6 +3291,71 @@ "once": "^1.3.1" } }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "raptor-async": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/raptor-async/-/raptor-async-1.1.3.tgz", + "integrity": "sha1-uDw8m2A9yYXCw6n3jStAc+b2Akw=" + }, + "raptor-json": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/raptor-json/-/raptor-json-1.1.0.tgz", + "integrity": "sha1-cL0JsU5k99MuxQzOg3fWApwPCHY=", + "requires": { + "raptor-strings": "^1.0.0" + } + }, + "raptor-polyfill": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/raptor-polyfill/-/raptor-polyfill-1.1.0.tgz", + "integrity": "sha512-VhFc5e6EuNGdax7FQ2QWlCdXFi5OBBsclDh0kzZtgBI7lauc8aFs7+htdi5Q3qCRoYXfsucSBsRKf7a3s+YGmA==" + }, + "raptor-promises": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/raptor-promises/-/raptor-promises-1.0.3.tgz", + "integrity": "sha1-1XaxEOBCNlT3/fFyHijULk3DwOs=", + "requires": { + "q": "^1.0.1", + "raptor-util": "^1.0.0" + }, + "dependencies": { + "raptor-util": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/raptor-util/-/raptor-util-1.1.2.tgz", + "integrity": "sha1-8u6AdqmuPq4uZWcuRqIgB0+i3/M=" + } + } + }, + "raptor-regexp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/raptor-regexp/-/raptor-regexp-1.0.1.tgz", + "integrity": "sha1-7PD2bGZxwM2fXkjDcFAmxVCZlcA=" + }, + "raptor-strings": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/raptor-strings/-/raptor-strings-1.0.2.tgz", + "integrity": "sha1-ks4ssBU6/pBHDYA5oCVbTPM6tfw=", + "requires": { + "raptor-polyfill": "^1.0.1" + } + }, + "raptor-util": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/raptor-util/-/raptor-util-3.2.0.tgz", + "integrity": "sha1-I7DIA8jxrIocrmfZpjiLSRYcl1g=" + }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", @@ -3014,6 +3430,11 @@ "global-modules": "^1.0.0" } }, + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -3044,6 +3465,16 @@ "safe-buffer": "^5.1.1" } }, + "rusha": { + "version": "0.8.13", + "resolved": "https://registry.npmjs.org/rusha/-/rusha-0.8.13.tgz", + "integrity": "sha1-mghOe4YLF7/zAVuSxnpqM2GRUTo=" + }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -3058,6 +3489,32 @@ "ret": "~0.1.10" } }, + "scrypt": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz", + "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", + "optional": true, + "requires": { + "nan": "^2.0.8" + } + }, + "scrypt.js": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz", + "integrity": "sha512-42LTc1nyFsyv/o0gcHtDztrn+aqpkaCNt5Qh7ATBZfhEZU7IC/0oT/qbBH+uRNoAPvs2fwiOId68FDEoSRA8/A==", + "requires": { + "scrypt": "^6.0.2", + "scryptsy": "^1.2.1" + } + }, + "scryptsy": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", + "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", + "requires": { + "pbkdf2": "^3.0.3" + } + }, "secp256k1": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.6.2.tgz", @@ -3073,6 +3530,16 @@ "safe-buffer": "^5.1.0" } }, + "seed-random": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", + "integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ=" + }, + "seedrandom": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.1.tgz", + "integrity": "sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg==" + }, "semaphore": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", @@ -3152,12 +3619,25 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shorthash": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/shorthash/-/shorthash-0.0.2.tgz", + "integrity": "sha1-WbJo7sveWQOLMNogK8+93rLEpOs=" + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "simple-sha1": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/simple-sha1/-/simple-sha1-2.1.2.tgz", + "integrity": "sha512-TQl9rm4rdKAVmhO++sXAb8TNN0D6JAD5iyI1mqEPNpxUzTRrtm4aOG1pDf/5W/qCFihiaoK6uuL9rvQz1x1VKw==", + "requires": { + "rusha": "^0.8.1" + } + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -3338,6 +3818,11 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "stackframe": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.0.4.tgz", + "integrity": "sha512-to7oADIniaYwS3MhtCa/sQhrxidCCQiF/qp4/m5iN3ipf0Y7Xlri0f6eG29r08aL7JYl8n32AF3Q5GYBZ7K8vw==" + }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -3420,8 +3905,7 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "superagent": { "version": "4.1.0", @@ -3525,6 +4009,11 @@ "repeat-string": "^1.6.1" } }, + "try-require": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/try-require/-/try-require-1.2.1.tgz", + "integrity": "sha1-NEiaLKwMCcHMEO2RugEVlNQzO+I=" + }, "ts-node": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.0.3.tgz", @@ -3596,6 +4085,19 @@ "tslib": "^1.8.1" } }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-detect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=" + }, "typescript": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.1.tgz", @@ -3708,11 +4210,26 @@ "node-gyp-build": "~3.7.0" } }, + "utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "warp10": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/warp10/-/warp10-2.0.1.tgz", + "integrity": "sha512-nS1KG2RCVTWepfSitZKzL+HYiqqMJag06KtOJF/LwklrJWeJYRWHjMYpd6GXMt09ot+HIEj+Y4dmQNnNNE0Bjg==" + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -3737,6 +4254,11 @@ "string-width": "^1.0.2 || 2" } }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", diff --git a/package.json b/package.json index 929d8ba834..e721a2465f 100644 --- a/package.json +++ b/package.json @@ -11,20 +11,27 @@ }, "scripts": { "build": "tsc", - "test": "mocha --require ts-node/register --watch-extensions ts 'test/**/*.{ts}' --recursive --check-leaks" + "test": "cross-env TS_NODE_FILES=true mocha --timeout 999999 --colors --require ts-node/register --watch-extensions ts --recursive --check-leaks 'test/**.ts'" }, "dependencies": { "@types/abstract-leveldown": "^5.0.1", "@types/ethereumjs-tx": "^1.0.1", "abstract-leveldown": "^6.0.1", + "bip39": "^3.0.0", "bn.js": "4.11.8", + "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.0", "ethereumjs-blockchain": "^3.4.0", "ethereumjs-tx": "1.3.7", - "ethereumjs-vm": "2.6.0", + "ethereumjs-util": "6.1.0", + "ethereumjs-vm": "3.0.0", + "ethereumjs-wallet": "0.6.3", "keccak": "2.0.0", "levelup": "4.0.0", + "marko": "4.16.6", "merkle-patricia-tree": "3.0.0", + "seed-random": "2.2.0", + "seedrandom": "3.0.1", "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.8.0" }, "devDependencies": { @@ -34,9 +41,10 @@ "@types/uws": "0.13.2", "@types/ws": "6.0.1", "bufferutil": "4.0.1", + "cross-env": "5.2.0", "mocha": "6.0.2", "superagent": "4.1.0", - "ts-node": "8.0.3", + "ts-node": "^8.0.3", "tslint": "5.14.0", "typescript": "3.4.1", "utf-8-validate": "5.0.2", diff --git a/src/engine.ts b/src/engine.ts index f726c22e8d..d6013f3243 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -3,23 +3,23 @@ import ILedger from "./interfaces/ledger"; const _ledger = Symbol("ledger"); export default class Engine { - private [_ledger]:ILedger; - constructor(ledger: ILedger){ - if (!ledger){ - throw new Error("yah, that's not right"); - } - this[_ledger] = ledger; + private [_ledger]: ILedger; + constructor(ledger: ILedger) { + if (!ledger) { + throw new Error("yah, that's not right"); } - public async send(method: string, params: any[]): Promise { - const ledger = this[_ledger]; - if (ledger.__proto__.hasOwnProperty(method)) { - const fn = ledger[method]; - if (typeof fn === "function") { - return fn.apply(ledger, params).then((result: any) => { - return JSON.stringify(result); - }); - } + this[_ledger] = ledger; + } + public async execute(method: string, params: any[]): Promise { + if (typeof method === "string") { + const ledger = this[_ledger]; + if (ledger.__proto__.hasOwnProperty(method)) { + const fn = ledger[method]; + if (typeof fn === "function") { + return fn.apply(ledger, params); } - throw new Error(`Invalid method: ${method}`); + } } + throw new Error(`Invalid method: ${method}`); + } } \ No newline at end of file diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index cfd024dcb8..8930240e62 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,18 +1,25 @@ -import EthereumJsBLock from "ethereumjs-block"; +// import EthereumJsBLock from "ethereumjs-block"; import Tag from "../../types/tags"; import {JsonRpcData} from "../../types/json-rpc"; import Address from "../../types/address"; import Account from "../../types/account"; +import Transaction from "../../types/transaction"; type AccountManager = { readonly [index: string]: Promise; } +type TransactionManager = { + readonly [index: string]: Promise; +} -class Block extends EthereumJsBLock { +class Block { // extends EthereumJsBLock { private _accounts: any; public accounts: AccountManager + private _transactions: any; + public transactions: TransactionManager; + public header: any = {}; constructor(data: Buffer) { - super(data); + // super(data); const self = this; @@ -22,17 +29,30 @@ class Block extends EthereumJsBLock { } } this.accounts = new Proxy(this, { - async get (obj, key: any): Promise{ + async get (obj, key: any): Promise{ return self._accounts.getAccount(key); } - }) as any; + }) as any as AccountManager; + + this._transactions = { + async getTransaction(number: Address): Promise { + return new Transaction(); + } + } + this.transactions = new Proxy(this, { + async get (obj, key: any): Promise{ + return self._transactions.getTransaction(key); + } + }) as any as TransactionManager; } } type BlockManager = { - readonly [index: string]: Promise; + readonly [index: string]: LivePromiseBlock; } +type LivePromiseBlock = Promise & Block; +type LivePromiseTransactionManager = Promise & TransactionManager; export default class Blockchain { public blocks: BlockManager; @@ -40,19 +60,29 @@ export default class Blockchain { constructor() { const self = this; - const getBlock = async(number: string): Promise => { - const b = new Block(Buffer.from([])); - b.header.number = Buffer.from([number]); - return b; + const getBlock = (number: string): LivePromiseBlock => { + var p = new Promise(async (resolve) => { + const b = new Block(Buffer.from([])); + b.header.number = Buffer.from([number]); + resolve(b); + }) as LivePromiseBlock; + p.transactions = new Proxy(this, { + get (obj, key: string|Tag): TransactionManager { + return p.then((block) => { + return block.transactions[key]; + }) as any as TransactionManager; + } + }) as any as TransactionManager; + return p; }; this.blocks = new Proxy(this, { - async get (obj, key: string|Tag): Promise { + get (obj, key: string|Tag): LivePromiseBlock { if (key === "latest" || key === "earliest" || key === "pending") { - return self._blocks.getBlock("111111"); + return getBlock("111111"); } return getBlock(key); } - }) as any; + }) as any as BlockManager; } public async latest() { const block = new Block(Buffer.from([])); diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index c87b112063..753bc74b7e 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -4,20 +4,26 @@ import {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcData} from "../../types/js import Blockchain from "./blockchain"; import Tag from "../../types/tags"; import { IndexableAddress } from "../../types/address"; +import Transaction from "../../types/transaction"; +import Account from "../../types/account"; const createKeccakHash = require("keccak"); const hash = createKeccakHash("keccak256"); +const _coinbase = Symbol("coinbase"); const _isMining = Symbol("isMining"); const _blockchain = Symbol("blockchain"); export default class Ethereum implements ILedger { + readonly [_coinbase]: Account; readonly [_options]: EthereumOptions; private [_isMining]: boolean = false; private readonly [_blockchain]: Blockchain; constructor(options: EthereumOptions){ - this[_options] = Object.assign(getDefaultEthereumOptions(), options); + const tmpOptions = Object.assign(getDefaultEthereumOptions(), options); + this[_coinbase] = tmpOptions.accounts[0]; + this[_options] = tmpOptions; this[_blockchain] = new Blockchain(); } @@ -86,8 +92,8 @@ export default class Ethereum implements ILedger { * Returns the client coinbase address. * @returns 20 bytes - the current coinbase address. */ - async eth_coinbase(): Promise{ - return this[_options].coinbase; + async eth_coinbase(): Promise { + return this[_coinbase] ? this[_coinbase].address : null; } /** @@ -148,23 +154,13 @@ export default class Ethereum implements ILedger { * * @param transasctionHash 32 Bytes - hash of a transaction */ - async eth_getTransactionByHash(transasctionHash: IndexableJsonRpcData) { - return { - blockHash: JsonRpcData.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. - blockNumber: JsonRpcQuantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. - from: JsonRpcData.from("0x123456", 32), // 20 Bytes - address of the sender. - gas: JsonRpcQuantity.from(123n),// QUANTITY - gas provided by the sender. - gasPrice: JsonRpcQuantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. - hash: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. - input: JsonRpcData.from("0x123"),// DATA - the data send along with the transaction. - nonce: JsonRpcQuantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. - to: JsonRpcData.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. - transactionIndex: JsonRpcQuantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. - value: JsonRpcQuantity.from(123n),// QUANTITY - value transferred in Wei. - v: JsonRpcQuantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id - r: JsonRpcData.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r - s: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s - } + async eth_getTransactionByHash(transasctionHash: IndexableJsonRpcData): Promise { + transasctionHash = JsonRpcData.from(transasctionHash); + + const chain = this[_blockchain]; + const block = chain.blocks[Tag.LATEST]; + const transaction = block.transactions[transasctionHash]; + return transaction; } [index: string]: (...args: any) => Promise<{}>; diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 8241fc8b4d..bc9f474e01 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -3,8 +3,8 @@ import {JsonRpcData} from "../../types/json-rpc"; interface EthereumOptions extends LedgerOptions { net_version: string, - coinbase?: JsonRpcData, - gasPrice?: bigint + gasPrice?: bigint, + accounts: any[] } export default EthereumOptions; diff --git a/src/options/options.ts b/src/options/options.ts index fccfee599c..c975c9a1e7 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -136,9 +136,8 @@ export default interface Options { }; export const getDefault: (options: Options)=> Options = (options) => { - const network_id = (options.network_id || Date.now()).toString(); + const network_id = (options && options.network_id || Date.now()).toString(); return Object.assign({ - ledger: new Ethereum({net_version: network_id}), debug: false, logger: {log: () => {}}, default_balance_ether: 100n, diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 90d1b74722..4ebc50837a 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -1,5 +1,31 @@ import Options, {getDefault as getDefaultOptions} from "./options"; +const bip39 = require("bip39"); +const seedrandom = require("seedrandom"); + + +function randomBytes(length: any, rng: any): any { + var buf = []; + + for (var i = 0; i < length; i++) { + buf.push(rng() * 255); + } + + return Buffer.from(buf); +} + +function randomAlphaNumericString (length:any, rng:any) { + const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + + let text = ""; + + for (var i = 0; i < length; i++) { + text += alphabet.charAt(Math.floor((rng || Math.random)() * alphabet.length)); + } + + return text; +} + export default interface ProviderOptions extends Options { /** * Array of strings to installed subproviders @@ -8,10 +34,23 @@ export default interface ProviderOptions extends Options { } export const getDefault : (options: ProviderOptions) => ProviderOptions = (options) => { - return Object.assign( + const _options = Object.assign( { subProviders: [] }, getDefaultOptions(options) ); + + // do this so that we can use the same seed on our next run and get the same + // results without explicitly setting a seed up front + if (!_options.seed) { + _options.seed = randomAlphaNumericString(10, seedrandom()); + } + + // generate a randomized default mnemonic + if (!_options.mnemonic) { + let _randomBytes = randomBytes(16, seedrandom(_options.seed)); + _options.mnemonic = bip39.entropyToMnemonic(_randomBytes.toString("hex")); + } + return _options; } diff --git a/src/provider.ts b/src/provider.ts index 0265283458..7df7a9c365 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -3,6 +3,14 @@ import RequestProcessor from "./utils/request-processor"; import ProviderOptions, { getDefault as getDefaultProviderOptions } from "./options/provider-options"; import { EventEmitter } from "events"; import Ethereum from "./ledgers/ethereum/ledger" +import utils from "ethereumjs-util"; +import Account from "./types/account"; +const bip39 = require("bip39"); +import { JsonRpcQuantity, JsonRpcData } from "./types/json-rpc"; +import Address from "./types/address"; +import JsonRpc from "./servers/utils/jsonrpc"; + +const hdkey = require("ethereumjs-wallet/hdkey"); export type ProviderOptions = ProviderOptions; @@ -10,19 +18,18 @@ const options = Symbol("options"); const engine = Symbol("engine"); const requestProcessor = Symbol("requestProcessor"); -interface Payload { - method: string - params: any[] -} - interface Callback { - (err: Error, response?: any): void; + (err?: Error, response?: JsonRpc.Response): void; } + export default class Provider extends EventEmitter { private [options]: ProviderOptions; private [engine]: Engine; private [requestProcessor]: RequestProcessor; + + private wallet:any; + private hdPath:string; constructor(providerOptions?: ProviderOptions) { super(); const _providerOptions = this[options] = getDefaultProviderOptions(providerOptions); @@ -30,53 +37,104 @@ export default class Provider extends EventEmitter { // set up our request processor to either use FIFO or or async request processing this[requestProcessor] = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 1 : 0); - this[engine] = new Engine(_providerOptions.ledger || new Ethereum({ net_version: _providerOptions.network_id.toString() })); + if(!_providerOptions.mnemonic){ + // TODO: this is a default and should be configured that way + _providerOptions.mnemonic = bip39.generateMnemonic(); + } + this.wallet = hdkey.fromMasterSeed(bip39.mnemonicToSeedSync(_providerOptions.mnemonic, null)); + + const accounts = this.initializeAccounts(); + const net_version = _providerOptions.network_id.toString(); + const _engine = this[engine] = new Engine(_providerOptions.ledger || new Ethereum({ + net_version, + accounts + })); } + private initializeAccounts(): Account[]{ + const _providerOptions = this[options]; + let accounts: Account[]; - public send(payload: Payload, callback?: Callback): void; + if (_providerOptions.accounts) { + accounts = _providerOptions.accounts.map((account) => { + return this.createAccount(account.balance, account.privateKey, account.address); + }); + } else if(_providerOptions.total_accounts) { + accounts = []; + const hdPath = this[options].hdPath; + const wallet = this.wallet; + + const ether = JsonRpcQuantity.from(_providerOptions.default_balance_ether); + for (let index = 0; index < _providerOptions.total_accounts; index++) { + const acct = wallet.derivePath(hdPath + index); + const accountWallet = acct.getWallet(); + const address = Address.from(accountWallet.getAddress()); + const privateKey = JsonRpcData.from(accountWallet.getPrivateKey()); + accounts.push(this.createAccount(ether, privateKey, address)); + } + } else { + throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); + } + return accounts; + } + private createAccount(balance: JsonRpcQuantity, privateKey: JsonRpcData, address?: Address) { + address = address || Address.from(utils.privateToAddress(Buffer.from(privateKey.toString(), "hex"))); + + const account = new Account(address); + account.privateKey = privateKey; + account.balance = balance; + + return account; + } + + public send(payload: JsonRpc.Request, callback?: Callback): void; public send(method: string, params?: any[]): Promise; - public send(arg1: string | Payload, arg2?: any): Promise { + public send(arg1: string | JsonRpc.Request, arg2?: Callback | any[]): Promise { let method: string; let params: any[]; let response: Promise<{}>; - const send = this[engine].send.bind(this[engine]); - if (typeof arg1 === "string") { - method = arg1; - params = arg2; - response = this[requestProcessor].queue(send, method, params); - } else { - // handle backward compatibility with callback-style ganache-core - const payload: Payload = arg1 as Payload; - method = payload.method; - params = payload.params; - const callback = arg2; - - if (typeof callback !== "function") { - throw new Error( - "No callback provided to provider's send function. As of web3 1.0, provider.send " + - "is no longer synchronous and must be passed a callback as its final argument." - ); + const _engine = this[engine]; + const execute = _engine.execute.bind(_engine); + switch (typeof arg1) { + case "string": { + method = arg1; + params = arg2 as any[]; + response = this[requestProcessor].queue(execute, method, params).then((result => { + // convert to JSON + return JSON.parse(JSON.stringify(result)); + })); } + break; + case "function": { + // handle backward compatibility with callback-style ganache-core + const callback = arg2 as Callback; + const payload = arg1 as JsonRpc.Request; + method = payload.method; + params = payload.params; - this[requestProcessor].queue(send, method, params).then((response: any) => { - callback(null, { - id: (arg1 as any).id, - jsonrpc: "2.0", - result: response - }); - }).catch(callback); - - response = undefined; + this[requestProcessor].queue(execute, method, params).then((result) => { + callback(null, JsonRpc.Response( + payload.id, + JSON.parse(JSON.stringify(result)) + )); + }).catch(callback); + } + break; + default: + throw new Error( + "No callback provided to provider's send function. As of web3 1.0, provider.send " + + "is no longer synchronous and must be passed a callback as its final argument." + ); } - if (this[options].verbose) { - this[options].logger.log(` > ${method}: ${JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); + const _options = this[options]; + if (_options.verbose) { + _options.logger.log(` > ${method}: ${JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); } return response; } - public sendAsync(payload: Payload, callback?: Callback): void { - this.send(payload, callback); + public sendAsync(payload: JsonRpc.Request, callback?: Callback): void { + return this.send(payload, callback); } } diff --git a/src/server.ts b/src/server.ts index fd44df43ea..cd9d6d6948 100644 --- a/src/server.ts +++ b/src/server.ts @@ -14,7 +14,6 @@ const provider = Symbol("provider"); const websocketServer = Symbol("websocketServer"); const httpServer = Symbol("httpServer"); - export default class Server { private [app]: TemplatedApp; private [provider]: Provider; diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 96eee579bf..d0ace968d8 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -10,6 +10,10 @@ const _handleOptions = Symbol("handleOptions"); const _provider = Symbol("provider"); const noop = () => { }; +if (!process.env.NODE_ENV) { + require("marko/node-require"); +} + /** * uWS doesn't let us use the request after the request method has completed. * But we can't set headers until after the statusCode is set. But we don't @@ -78,6 +82,7 @@ function sendResponse(response: HttpResponse, statusCode: number, contentType?: response.end(data) } +const template = require("./views/index"); export default class HttpServer { private [_provider]: Provider; constructor(app: TemplatedApp, provider: Provider) { @@ -95,10 +100,26 @@ export default class HttpServer { // fallback routes... app - .any("/", (response) => { + .any("/", async (response) => { + response.onAborted(() => {}); + // TODO: send back the Ganache-UI // any other request to "/" is not allowed, so respond with `405 Method Not Allowed`... - sendResponse(response, HttpResponseCodes.METHOD_NOT_ALLOWED, ContentTypes.PLAIN, "405 Method Not Allowed"); + + const accounts = await provider.send("eth_accounts"); + + // res.setHeader("content-type", "text/html"); + // render the output to the `res` output stream + response.writeHeader("Content-Type", "text/html"); + template.render({ + accounts: accounts, + blocks: [], + transactions: [], + events: [], + logs: [] + }, response); + + // sendResponse(response, HttpResponseCodes.METHOD_NOT_ALLOWED, ContentTypes.PLAIN, "405 Method Not Allowed"); }) .any("/*", (response) => { // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... diff --git a/src/servers/views/components/accounts/accounts.marko b/src/servers/views/components/accounts/accounts.marko new file mode 100644 index 0000000000..c4c2aab6c5 --- /dev/null +++ b/src/servers/views/components/accounts/accounts.marko @@ -0,0 +1,28 @@ + + + + + + + + + + + + + +
+ + ${item.address} +
+ + ${parseInt(item.balance)} ETH +
+ + 0 +
+ + ${i} +
+ +
\ No newline at end of file diff --git a/src/servers/views/components/accounts/components/info.marko b/src/servers/views/components/accounts/components/info.marko new file mode 100644 index 0000000000..929a807d47 --- /dev/null +++ b/src/servers/views/components/accounts/components/info.marko @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/src/servers/views/components/app-tabs/index.marko b/src/servers/views/components/app-tabs/index.marko new file mode 100644 index 0000000000..360f3ca878 --- /dev/null +++ b/src/servers/views/components/app-tabs/index.marko @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/src/servers/views/components/app-tabs/marko-tag.json b/src/servers/views/components/app-tabs/marko-tag.json new file mode 100644 index 0000000000..4af597513b --- /dev/null +++ b/src/servers/views/components/app-tabs/marko-tag.json @@ -0,0 +1,6 @@ +{ + "@tabs []": { + "@label": "string", + "@active": "bool" + } + } \ No newline at end of file diff --git a/src/servers/views/components/blocks.marko b/src/servers/views/components/blocks.marko new file mode 100644 index 0000000000..19ba6e62c6 --- /dev/null +++ b/src/servers/views/components/blocks.marko @@ -0,0 +1,5 @@ +
    + +
  • ${item.toString()}
  • + +
\ No newline at end of file diff --git a/src/servers/views/components/events.marko b/src/servers/views/components/events.marko new file mode 100644 index 0000000000..9f95aff8ae --- /dev/null +++ b/src/servers/views/components/events.marko @@ -0,0 +1,5 @@ +
    + +
  • ${item.toString()}
  • + +
\ No newline at end of file diff --git a/src/servers/views/components/logs.marko b/src/servers/views/components/logs.marko new file mode 100644 index 0000000000..1d27b921b3 --- /dev/null +++ b/src/servers/views/components/logs.marko @@ -0,0 +1,5 @@ +
    + +
  • ${item.toString()}
  • + +
\ No newline at end of file diff --git a/src/servers/views/components/status-bar/index.marko b/src/servers/views/components/status-bar/index.marko new file mode 100644 index 0000000000..e65d624d69 --- /dev/null +++ b/src/servers/views/components/status-bar/index.marko @@ -0,0 +1,34 @@ +
    +
  • +

    Current Block

    + 0 +
  • +
  • +

    Gas Price

    + 200000000 +
  • +
  • +

    GAS LIMIT

    + 6721975 +
  • +
  • +

    HARDFORK

    + PETERSBURG +
  • +
  • +

    NETWORK ID

    + 5777 +
  • +
  • +

    RPC SERVER

    + HTTP://127.0.0.1:7545 +
  • +
  • +

    MINING STATUS

    + AUTOMINING +
  • +
  • +

    WORKSPACE

    + CAPABLE-OATMEAL +
  • +
\ No newline at end of file diff --git a/src/servers/views/components/transactions.marko b/src/servers/views/components/transactions.marko new file mode 100644 index 0000000000..1c147e91c5 --- /dev/null +++ b/src/servers/views/components/transactions.marko @@ -0,0 +1,5 @@ +
    + +
  • ${item.toString()}
  • + +
\ No newline at end of file diff --git a/src/servers/views/index.marko b/src/servers/views/index.marko new file mode 100644 index 0000000000..d8c364fd38 --- /dev/null +++ b/src/servers/views/index.marko @@ -0,0 +1,169 @@ +$ const mediumBrown = "#403d3a"; +$ const appBarNavText = "rgba(151, 151, 151, 1)"; +$ const darkBrown = "rgb(51, 48, 46)"; +$ const primaryColor = "rgb(235, 182, 126)"; +$ const appCardLabel = "rgb(96, 92, 89)"; +$ const appCardDefaultBackground = "rgba(251, 249, 246, 1.000)" +$ const textColor = "rgba(54, 65, 83, 1.000)"; + + + + + Ganache - Accounts + + + + + + + + + + <@tab label="Accounts" active=true>Accounts + <@tab label="Blocks">Blocks + <@tab label="Transactions">Transactions + <@tab label="Events">Events + <@tab label="Logs">Logs + + + + + \ No newline at end of file diff --git a/src/types/account.ts b/src/types/account.ts index 5022ee5879..ed7b1ca651 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -2,9 +2,9 @@ import { JsonRpcData, JsonRpcQuantity } from "./json-rpc"; import Address from "./address"; export default class Account { - public address: Address - public balance: JsonRpcQuantity = new JsonRpcQuantity(0n) - public secretKey: JsonRpcData + public address: Address; + public balance: JsonRpcQuantity = new JsonRpcQuantity(0n); + public privateKey: JsonRpcData; constructor(address: Address) { this.address = address; } diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index 1a8c42948e..a9018edfe9 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -8,7 +8,7 @@ export const toStrings = new WeakMap(); const inspect = Symbol.for('nodejs.util.inspect.custom'); -export class BaseJsonRpcType { +export class BaseJsonRpcType { protected value: T; // used to make console.log debugging a little easier private [inspect](depth: number, options: any):T { diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index d76d78415a..f36ba6865b 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -4,16 +4,21 @@ class JsonRpcQuantity extends BaseJsonRpcType { public static from(value: bigint | string | Buffer) { return new _JsonRpcQuantity(value); } + public toBigInt(): bigint { + return BigInt(this.value); + } } type $ = { new(value: T): _JsonRpcQuantity & JsonRpcType, - from(value: T): _JsonRpcQuantity & JsonRpcType + from(value: T): _JsonRpcQuantity & JsonRpcType, + toBigInt(): bigint } const _JsonRpcQuantity = JsonRpcQuantity as $; interface _JsonRpcQuantity { constructor(value: T): _JsonRpcQuantity - from(): _JsonRpcQuantity + from(): _JsonRpcQuantity, + toBigInt(): bigint } export type IndexableJsonRpcQuantity = _JsonRpcQuantity & IndexableJsonRpcType; diff --git a/src/types/transaction.ts b/src/types/transaction.ts new file mode 100644 index 0000000000..ad7ddfa812 --- /dev/null +++ b/src/types/transaction.ts @@ -0,0 +1,85 @@ +import { JsonRpcData, JsonRpcQuantity } from "./json-rpc"; +import Address from "./address"; + +type TransactionDataObject = { + blockHash: string, + blockNumber: string, + from: string, + gas: string, + gasPrice: string, + hash: string, + input: string, + nonce: string, + to: string, + transactionIndex: string, + value: string, + v: string, + r: string, + s: string +} + +type TransactionData = { + blockHash: JsonRpcData, + blockNumber: JsonRpcData, + from: Address, + gas: JsonRpcQuantity, + gasPrice: JsonRpcQuantity, + hash: JsonRpcData, + input: JsonRpcData, + nonce: JsonRpcQuantity, + to: Address, + transactionIndex: JsonRpcQuantity, + value: JsonRpcQuantity, + v: JsonRpcQuantity, + r: JsonRpcData, + s: JsonRpcData +} + +export default class Transaction implements TransactionData{ + blockHash: JsonRpcData; + blockNumber: JsonRpcData; + from: JsonRpcData; + gas: JsonRpcQuantity; + gasPrice: JsonRpcQuantity; + hash: JsonRpcData; + input: JsonRpcData; + nonce: JsonRpcQuantity; + to: JsonRpcData; + transactionIndex: JsonRpcQuantity; + value: JsonRpcQuantity; + v: JsonRpcQuantity; + r: JsonRpcData; + s: JsonRpcData; + constructor() { + const obj = { + blockHash: JsonRpcData.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. + blockNumber: JsonRpcQuantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. + from: JsonRpcData.from("0x123456", 32), // 20 Bytes - address of the sender. + gas: JsonRpcQuantity.from(123n),// QUANTITY - gas provided by the sender. + gasPrice: JsonRpcQuantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. + hash: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. + input: JsonRpcData.from("0x123"),// DATA - the data send along with the transaction. + nonce: JsonRpcQuantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. + to: JsonRpcData.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. + transactionIndex: JsonRpcQuantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. + value: JsonRpcQuantity.from(123n),// QUANTITY - value transferred in Wei. + v: JsonRpcQuantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id + r: JsonRpcData.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r + s: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s + } as any; + Object.keys(obj).forEach((key) => { + (this as any)[key] = obj[key] as any; + }); + } + // https://github.com/fastify/fast-json-stringify + // https://github.com/YousefED/typescript-json-schema + toObject(): TransactionDataObject { + const a = JSON.stringify({ + gasPrice: this.gasPrice + }); + console.log(a); + return { + gasPrice: this.gasPrice.toString() + } as TransactionDataObject; + } +} \ No newline at end of file diff --git a/test/server.ts b/test/server.ts index 9eecdefe35..654ee41d6b 100644 --- a/test/server.ts +++ b/test/server.ts @@ -7,7 +7,7 @@ import { ServerOptions } from "../src/server"; describe("server", () => { - const port = 8545; + const port = 8547; const netVersion = "1234"; const jsonRpcJson: any = { jsonrpc: "2.0", From e2fbfa27efd2050fe4eb71a9be5ef7b250a2eda4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 8 Apr 2019 11:16:50 -0400 Subject: [PATCH 018/691] update uWebSockets.js --- npm-shrinkwrap.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4837ae49b5..ec71a6fed1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4105,8 +4105,8 @@ "dev": true }, "uWebSockets.js": { - "version": "github:uNetworking/uWebSockets.js#d96159d2ffc1517cdab39fe169d88dd55a2aeba7", - "from": "github:uNetworking/uWebSockets.js#v15.8.0" + "version": "github:uNetworking/uWebSockets.js#32749187bfefb94de69f1aa5a8275647c7ccf3aa", + "from": "github:uNetworking/uWebSockets.js#v15.9.0" }, "union-value": { "version": "1.0.0", diff --git a/package.json b/package.json index e721a2465f..0961e3357b 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "merkle-patricia-tree": "3.0.0", "seed-random": "2.2.0", "seedrandom": "3.0.1", - "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.8.0" + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.9.0" }, "devDependencies": { "@types/mocha": "5.2.5", From f04b925deff83f7de5dfb98772ce0a17de22ec41 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Apr 2019 18:35:31 -0400 Subject: [PATCH 019/691] Update gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index dacdbceb0b..bbf10c1b63 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ TODO .vscode build dist +.nyc_output +test/testdb/* +**/*.marko.js \ No newline at end of file From c406d601a7edc4ceb82cc843dfd04a176f5a1e59 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Apr 2019 18:42:35 -0400 Subject: [PATCH 020/691] cleanup --- src/provider.ts | 60 ++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/provider.ts b/src/provider.ts index 7df7a9c365..ff3eb804ef 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -3,9 +3,9 @@ import RequestProcessor from "./utils/request-processor"; import ProviderOptions, { getDefault as getDefaultProviderOptions } from "./options/provider-options"; import { EventEmitter } from "events"; import Ethereum from "./ledgers/ethereum/ledger" -import utils from "ethereumjs-util"; +import { privateToAddress } from "ethereumjs-util"; import Account from "./types/account"; -const bip39 = require("bip39"); +import { generateMnemonic, mnemonicToSeedSync } from "bip39"; import { JsonRpcQuantity, JsonRpcData } from "./types/json-rpc"; import Address from "./types/address"; import JsonRpc from "./servers/utils/jsonrpc"; @@ -39,9 +39,9 @@ export default class Provider extends EventEmitter { if(!_providerOptions.mnemonic){ // TODO: this is a default and should be configured that way - _providerOptions.mnemonic = bip39.generateMnemonic(); + _providerOptions.mnemonic = generateMnemonic(); } - this.wallet = hdkey.fromMasterSeed(bip39.mnemonicToSeedSync(_providerOptions.mnemonic, null)); + this.wallet = hdkey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); const accounts = this.initializeAccounts(); const net_version = _providerOptions.network_id.toString(); @@ -50,6 +50,7 @@ export default class Provider extends EventEmitter { accounts })); } + private initializeAccounts(): Account[]{ const _providerOptions = this[options]; let accounts: Account[]; @@ -76,8 +77,9 @@ export default class Provider extends EventEmitter { } return accounts; } + private createAccount(balance: JsonRpcQuantity, privateKey: JsonRpcData, address?: Address) { - address = address || Address.from(utils.privateToAddress(Buffer.from(privateKey.toString(), "hex"))); + address = address || Address.from(privateToAddress(Buffer.from(privateKey.toString(), "hex"))); const account = new Account(address); account.privateKey = privateKey; @@ -94,32 +96,28 @@ export default class Provider extends EventEmitter { let response: Promise<{}>; const _engine = this[engine]; const execute = _engine.execute.bind(_engine); - switch (typeof arg1) { - case "string": { - method = arg1; - params = arg2 as any[]; - response = this[requestProcessor].queue(execute, method, params).then((result => { - // convert to JSON - return JSON.parse(JSON.stringify(result)); - })); - } - break; - case "function": { - // handle backward compatibility with callback-style ganache-core - const callback = arg2 as Callback; - const payload = arg1 as JsonRpc.Request; - method = payload.method; - params = payload.params; - - this[requestProcessor].queue(execute, method, params).then((result) => { - callback(null, JsonRpc.Response( - payload.id, - JSON.parse(JSON.stringify(result)) - )); - }).catch(callback); - } - break; - default: + if (typeof arg1 === "string") { + method = arg1; + params = arg2 as any[]; + response = this[requestProcessor].queue(execute, method, params).then((result => { + // convert to JSON + return JSON.parse(JSON.stringify(result)); + })); + } else if (typeof arg2 === "function") { + // handle backward compatibility with callback-style ganache-core + const payload = arg1 as JsonRpc.Request; + const callback = arg2 as Callback; + method = payload.method; + params = payload.params; + + this[requestProcessor].queue(execute, method, params).then((result) => { + callback(null, JsonRpc.Response( + payload.id, + JSON.parse(JSON.stringify(result)) + )); + }).catch(callback); + } + else { throw new Error( "No callback provided to provider's send function. As of web3 1.0, provider.send " + "is no longer synchronous and must be passed a callback as its final argument." From d57f57873e4512d619b2d131a778edfa941a42a2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 11 Apr 2019 21:24:13 -0400 Subject: [PATCH 021/691] Lots of WIP --- npm-shrinkwrap.json | 1505 +++++----------------------- package.json | 7 +- src/engine.ts | 5 +- src/interfaces/ledger.ts | 3 +- src/ledgers/ethereum/blockchain.ts | 49 +- src/ledgers/ethereum/database.ts | 75 ++ src/ledgers/ethereum/ledger.ts | 30 +- src/provider.ts | 8 +- src/utils/request-processor.ts | 28 +- 9 files changed, 444 insertions(+), 1266 deletions(-) create mode 100644 src/ledgers/ethereum/database.ts diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ec71a6fed1..78135bfcfc 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -136,41 +136,11 @@ "sprintf-js": "~1.0.2" } }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "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==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, "async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", @@ -199,12 +169,6 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -221,61 +185,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "base-x": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.5.tgz", @@ -315,6 +224,11 @@ "safe-buffer": "^5.0.1" } }, + "bluebird": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz", + "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==" + }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", @@ -329,35 +243,6 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -440,21 +325,31 @@ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, + "cachedown": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cachedown/-/cachedown-1.0.0.tgz", + "integrity": "sha1-1D8DbkUQaWsxJG19sx6/D3rDLRU=", "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" + "abstract-leveldown": "^2.4.1", + "lru-cache": "^3.2.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "~4.0.0" + } + }, + "lru-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", + "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", + "requires": { + "pseudomap": "^1.0.1" + } + } } }, "camelcase": { @@ -515,29 +410,6 @@ "safe-buffer": "^5.0.1" } }, - "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==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -588,16 +460,6 @@ } } }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -653,12 +515,6 @@ "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", "dev": true }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -727,12 +583,6 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": 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=", - "dev": true - }, "deep-eql": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", @@ -754,9 +604,9 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, "deferred-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.0.0.tgz", - "integrity": "sha512-QtTcNm2PX7elim5bGl+i3px2kVbpI49BV+Q62CFh0AaMlrdlbMXyozBg31p2zJqAAT35FUw4eccC+drr3D0+vQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.0.1.tgz", + "integrity": "sha512-BXohsvTedWOLkj2n/TY+yqVlrCWa2Zs8LSxh3uCAgFOru7/pjxKyZAexGa1j83BaKloER4PqUyQ9rGPJLt9bqA==", "requires": { "abstract-leveldown": "~6.0.0", "inherits": "^2.0.3" @@ -771,46 +621,10 @@ "object-keys": "^1.0.12" } }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } + "defined": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", + "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=" }, "delayed-stream": { "version": "1.0.0", @@ -835,12 +649,6 @@ } } }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -871,6 +679,17 @@ "minimalistic-crypto-utils": "^1.0.0" } }, + "emittery": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.4.1.tgz", + "integrity": "sha512-r4eRSeStEGf6M5SKdrQhhLK5bOwOBxQhIE3YSTnZE3GpKiLfnnhE+tPtrJE79+eDJgm39BM6LSoI8SCx4HbwlQ==" + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "encoding-down": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", @@ -1633,151 +1452,6 @@ "strip-eof": "^1.0.0" } }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "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": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "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==", - "dev": true, - "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==", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "fake-merkle-patricia-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", @@ -1786,34 +1460,16 @@ "checkpoint-store": "^1.1.0" } }, + "fast-future": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fast-future/-/fast-future-1.0.2.tgz", + "integrity": "sha1-hDWpqqAteSSNF9cE52JZMB2ZKAo=" + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -1823,18 +1479,6 @@ "locate-path": "^3.0.0" } }, - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^3.1.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - } - }, "flat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", @@ -1842,14 +1486,6 @@ "dev": true, "requires": { "is-buffer": "~2.0.3" - }, - "dependencies": { - "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", - "dev": true - } } }, "flow-stoplight": { @@ -1857,12 +1493,6 @@ "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", @@ -1880,15 +1510,6 @@ "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", "dev": true }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1907,9 +1528,9 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-stream": { @@ -1921,12 +1542,6 @@ "pump": "^3.0.0" } }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -1941,30 +1556,6 @@ "path-is-absolute": "^1.0.0" } }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -2001,38 +1592,6 @@ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "hash-base": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", @@ -2076,15 +1635,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, "htmljs-parser": { "version": "2.6.6", "resolved": "https://registry.npmjs.org/htmljs-parser/-/htmljs-parser-2.6.6.tgz", @@ -2114,42 +1664,16 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", "dev": true }, "is-callable": { @@ -2158,112 +1682,23 @@ "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", "dev": true }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "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==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - }, "is-hex-prefixed": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "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==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", @@ -2305,12 +1740,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, "js-sha3": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", @@ -2352,12 +1781,6 @@ "sha3": "^1.2.2" } }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, "lasso-caching-fs": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/lasso-caching-fs/-/lasso-caching-fs-1.0.2.tgz", @@ -2403,17 +1826,17 @@ "integrity": "sha512-gMs7JtWp479SOBjJQteQ+WMctfiQXG1SX5EuIGWTTUP37mKqs6BcYcjfZVVzAdTq0lAcSYpL2xGwmCG/hbjOcg==" }, "level-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.0.tgz", - "integrity": "sha512-AmY4HCp9h3OiU19uG+3YWkdELgy05OTP/r23aNHaQKWv8DO787yZgsEuGVkoph40uwN+YdUKnANlrxSsoOaaxg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", "requires": { "errno": "~0.1.1" } }, "level-iterator-stream": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.0.tgz", - "integrity": "sha512-CHMqFgIGXmqbdfvZcNADxRBXrl2W2EN8stxZnxEDQfEN+oNULcbX1OSK7VqJutp51Z0yJtA4Ym3JJMOuEslTrA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.1.tgz", + "integrity": "sha512-pSZWqXK6/yHQkZKCHrR59nKpU5iqorKM22C/BOHTb/cwNQ2EOZG+bovmFFGcOgaBoF3KxqJEI27YwewhJQTzsw==", "requires": { "inherits": "^2.0.1", "readable-stream": "^3.0.2", @@ -2421,19 +1844,14 @@ }, "dependencies": { "readable-stream": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", - "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" } } }, @@ -2474,6 +1892,14 @@ } } }, + "level-option-wrap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/level-option-wrap/-/level-option-wrap-1.1.0.tgz", + "integrity": "sha1-rSDmjZ88IsiJdTHMaqevWWse0Sk=", + "requires": { + "defined": "~0.0.0" + } + }, "level-packager": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", @@ -2546,6 +1972,24 @@ "xtend": "^4.0.1" } }, + "leveldown": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.0.1.tgz", + "integrity": "sha512-G4iodNkOhJmZ3uHInsvr1OZrvxxn24+BmfgQCLXdYCFr6diGdshFGCVZfmA4vgcxqvuzPF2P+KnwXdbyeabWqA==", + "requires": { + "abstract-leveldown": "~6.0.0", + "fast-future": "~1.0.2", + "napi-macros": "~1.8.1", + "node-gyp-build": "~3.8.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.8.0.tgz", + "integrity": "sha512-bYbpIHyRqZ7sVWXxGpz8QIRug5JZc/hzZH4GbdT9HTZi6WmKCZ8GLvP8OZ9TTiIBvwPFKgtGrlWQSXDAvYdsPw==" + } + } + }, "levelup": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.0.0.tgz", @@ -2555,13 +1999,6 @@ "level-errors": "~2.0.0", "level-iterator-stream": "~4.0.0", "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } } }, "levn": { @@ -2652,21 +2089,6 @@ "p-defer": "^1.0.0" } }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, "marko": { "version": "4.16.6", "resolved": "https://registry.npmjs.org/marko/-/marko-4.16.6.tgz", @@ -2717,9 +2139,9 @@ } }, "mem": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz", - "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "requires": { "map-age-cleaner": "^0.1.1", @@ -2807,27 +2229,6 @@ "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", "dev": true }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "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" - } - }, "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", @@ -2859,9 +2260,9 @@ } }, "mimic-fn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.0.0.tgz", - "integrity": "sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimalistic-assert": { @@ -2888,27 +2289,6 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -2919,9 +2299,9 @@ } }, "mocha": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.2.tgz", - "integrity": "sha512-RtTJsmmToGyeTznSOMoM6TPEk1A84FQaHIciKrRqARZx+B5ccJ5tXlmJzEKGBxZdqk9UjpRsesZTUkZmR5YnuQ==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.2.tgz", + "integrity": "sha512-BgD2/RozoSC3uQK5R0isDcxjqaWw2n5HWdk8njYUyZf2NC79ErO5FtYVX52+rfqGoEgMfJf4fuG0IWh2TMzFoA==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -2929,11 +2309,11 @@ "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "findup-sync": "2.0.0", + "find-up": "3.0.0", "glob": "7.1.3", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.12.0", + "js-yaml": "3.13.0", "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", @@ -2944,8 +2324,8 @@ "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "12.0.5", - "yargs-parser": "11.1.1", + "yargs": "13.2.2", + "yargs-parser": "13.0.0", "yargs-unparser": "1.5.0" }, "dependencies": { @@ -2963,16 +2343,6 @@ "path-is-absolute": "^1.0.0" } }, - "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "supports-color": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", @@ -2995,24 +2365,10 @@ "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "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-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" - } + "napi-macros": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-1.8.2.tgz", + "integrity": "sha512-Tr0DNY4RzTaBG2W2m3l7ZtFuJChTH6VZhXVhkGGjF/4cZTt+i8GcM9ozD+30Lmr4mDoZ5Xx34t2o4GJqYWDGcg==" }, "nice-try": { "version": "1.0.5", @@ -3055,52 +2411,12 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "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=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "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" - } - } - } - }, "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, "object.assign": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", @@ -3123,15 +2439,6 @@ "es-abstract": "^1.5.1" } }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3165,6 +2472,11 @@ "mem": "^4.0.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -3178,9 +2490,9 @@ "dev": true }, "p-is-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", - "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "dev": true }, "p-limit": { @@ -3202,21 +2514,9 @@ } }, "p-try": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.1.0.tgz", - "integrity": "sha512-H2RyIJ7+A3rjkwKC2l5GGtU4H1vkxKCAGsWasNVd0Set+6i4znxbWy6/j16YDPJDWxhsgZiKAstMEP8wCdSpjA==", - "dev": true - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "path-exists": { @@ -3255,12 +2555,6 @@ "sha.js": "^2.4.8" } }, - "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=", - "dev": true - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -3281,6 +2575,11 @@ "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -3377,28 +2676,6 @@ } } }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3406,9 +2683,9 @@ "dev": true }, "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "resolve": { @@ -3420,33 +2697,11 @@ "path-parse": "^1.0.5" } }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, "resolve-from": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -3480,15 +2735,6 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, "scrypt": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz", @@ -3557,29 +2803,6 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, - "requires": { - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", @@ -3638,147 +2861,6 @@ "rusha": "^0.8.1" } }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "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": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "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==", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "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==", - "dev": true, - "requires": { - "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" - } - }, "source-map-support": { "version": "0.5.11", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz", @@ -3797,21 +2879,6 @@ } } }, - "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=", - "dev": true - }, - "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==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -3823,27 +2890,6 @@ "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.0.4.tgz", "integrity": "sha512-to7oADIniaYwS3MhtCa/sQhrxidCCQiF/qp4/m5iN3ipf0Y7Xlri0f6eG29r08aL7JYl8n32AF3Q5GYBZ7K8vw==" }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -3907,6 +2953,56 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, + "subleveldown": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-4.0.0.tgz", + "integrity": "sha512-Cvra766rz7lB+F4Lw5ofA1TTeiHNCUTdClH2mSWDtrpszNt2GHPRe7WTEQhti0WO+VngIi36NeNQOx1JA6IV1A==", + "requires": { + "abstract-leveldown": "^6.0.2", + "encoding-down": "^6.0.1", + "inherits": "^2.0.3", + "level-option-wrap": "^1.1.0", + "levelup": "^4.0.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.2.tgz", + "integrity": "sha512-AaEmQKBazexOeFp2tu+TnGWFhTudFMFK7yOdzJ5VlQyvZDmP6ff8R75JDDVtLCCi+hK5L8DVWaDe51w3uONqCA==", + "requires": { + "level-concat-iterator": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "encoding-down": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.0.2.tgz", + "integrity": "sha512-oAEANslmNb64AF4kvHXjTxB7KecwD7X0qf8MffMfhpjP6gjGcnCTOkRgps/1yUNeR4Bhe6ckN6aAzZz+RIYgTw==", + "requires": { + "abstract-leveldown": "^6.0.0", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0" + } + }, + "level-codec": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", + "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" + }, + "levelup": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.0.1.tgz", + "integrity": "sha512-l7KXOkINXHgNqmz0v9bxvRnMCUG4gmShFrzFSZXXhcqFnfvKAW8NerVsTICpZtVhGOMAmhY6JsVoVh/tUPBmdg==", + "requires": { + "deferred-leveldown": "~5.0.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", + "xtend": "~4.0.0" + } + } + } + }, "superagent": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/superagent/-/superagent-4.1.0.tgz", @@ -3967,46 +3063,21 @@ "has-flag": "^3.0.0" } }, - "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=", - "dev": true, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "os-tmpdir": "~1.0.2" } }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "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=", - "dev": true, + "tmp-promise": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-1.0.5.tgz", + "integrity": "sha512-hOabTz9Tp49wCozFwuJe5ISrOqkECm6kzw66XTP23DuzNU7QS/KiZq5LC9Y7QSy8f1rPSLy4bKaViP0OwGI1cA==", "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "bluebird": "^3.5.0", + "tmp": "0.0.33" } }, "try-require": { @@ -4108,99 +3179,6 @@ "version": "github:uNetworking/uWebSockets.js#32749187bfefb94de69f1aa5a8275647c7ccf3aa", "from": "github:uNetworking/uWebSockets.js#v15.9.0" }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, "utf-8-validate": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", @@ -4323,29 +3301,56 @@ "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" }, "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", + "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", "dev": true, "requires": { "cliui": "^4.0.0", - "decamelize": "^1.2.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" + "y18n": "^4.0.0", + "yargs-parser": "^13.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -4361,6 +3366,50 @@ "flat": "^4.1.0", "lodash": "^4.17.11", "yargs": "^12.0.5" + }, + "dependencies": { + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } } }, "yn": { diff --git a/package.json b/package.json index 0961e3357b..a1f30c5253 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ "abstract-leveldown": "^6.0.1", "bip39": "^3.0.0", "bn.js": "4.11.8", + "cachedown": "1.0.0", + "emittery": "0.4.1", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.0", "ethereumjs-blockchain": "^3.4.0", @@ -27,11 +29,14 @@ "ethereumjs-vm": "3.0.0", "ethereumjs-wallet": "0.6.3", "keccak": "2.0.0", + "leveldown": "5.0.1", "levelup": "4.0.0", "marko": "4.16.6", "merkle-patricia-tree": "3.0.0", "seed-random": "2.2.0", "seedrandom": "3.0.1", + "subleveldown": "4.0.0", + "tmp-promise": "1.0.5", "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.9.0" }, "devDependencies": { @@ -42,7 +47,7 @@ "@types/ws": "6.0.1", "bufferutil": "4.0.1", "cross-env": "5.2.0", - "mocha": "6.0.2", + "mocha": "^6.1.2", "superagent": "4.1.0", "ts-node": "^8.0.3", "tslint": "5.14.0", diff --git a/src/engine.ts b/src/engine.ts index d6013f3243..b3e9de4113 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -1,10 +1,13 @@ import ILedger from "./interfaces/ledger"; +import Emittery from "emittery"; const _ledger = Symbol("ledger"); -export default class Engine { +export default class Engine extends Emittery { private [_ledger]: ILedger; constructor(ledger: ILedger) { + super(); + if (!ledger) { throw new Error("yah, that's not right"); } diff --git a/src/interfaces/ledger.ts b/src/interfaces/ledger.ts index d61585a43b..10cb8104eb 100644 --- a/src/interfaces/ledger.ts +++ b/src/interfaces/ledger.ts @@ -1,5 +1,6 @@ + export const optionsSymbol = Symbol("options"); export default interface ILedger { readonly [optionsSymbol]: any; - readonly [key: string]: (params?: any[]) => Promise; + readonly [key: string]: (params?: any[]) => Promise | any; } diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 8930240e62..4e0e24fe7c 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,9 +1,19 @@ -// import EthereumJsBLock from "ethereumjs-block"; import Tag from "../../types/tags"; +import Database from "./database"; import {JsonRpcData} from "../../types/json-rpc"; import Address from "../../types/address"; import Account from "../../types/account"; import Transaction from "../../types/transaction"; +import Emittery from "emittery"; +import EthereumJsBLock from "ethereumjs-block"; + +// TODO: all the Promises stuff has got to go. I think we'll can just use get and set instead. +// and will very closely mimic what ganache already uses. We likely don't need to use our +// current serialization techniques, and can instead store the data as an RLP-encoded buffer. +// That said.. most ethereumjs-* stuff has a `raw` field that likely holds everything we want to serialize. +// If we can just efficiently (time, not so much space) encode/decode that into a flat buffer (which +// is part of what rlp encoding does, e.g. `block.serialize(true)`) maybe we can use that instead. +// Of course... maybe JSON is even faster. There is alsothe option of using protocol buffers in leveldb. type AccountManager = { readonly [index: string]: Promise; @@ -18,8 +28,10 @@ class Block { // extends EthereumJsBLock { private _transactions: any; public transactions: TransactionManager; public header: any = {}; + public block: EthereumJsBLock constructor(data: Buffer) { // super(data); + this.block = new EthereumJsBLock(data); const self = this; @@ -48,22 +60,34 @@ class Block { // extends EthereumJsBLock { } + type BlockManager = { - readonly [index: string]: LivePromiseBlock; + get: (key: string) => LivePromiseBlock, + set: (key: string, value: any) => LivePromiseBlock } type LivePromiseBlock = Promise & Block; type LivePromiseTransactionManager = Promise & TransactionManager; -export default class Blockchain { +export default class Blockchain extends Emittery { public blocks: BlockManager; private _blocks: any; constructor() { + super(); const self = this; + const db = new Database({}); const getBlock = (number: string): LivePromiseBlock => { - var p = new Promise(async (resolve) => { - const b = new Block(Buffer.from([])); - b.header.number = Buffer.from([number]); + var p = new Promise(async (resolve, reject) => { + const raw = await db.blocks.get(number).catch( e => { + return null; + }); + + // TODO: just POC stuff i was working on... + let b = null; + if (raw) { + b = new Block(raw); + } + resolve(b); }) as LivePromiseBlock; p.transactions = new Proxy(this, { @@ -75,14 +99,15 @@ export default class Blockchain { }) as any as TransactionManager; return p; }; - this.blocks = new Proxy(this, { - get (obj, key: string|Tag): LivePromiseBlock { - if (key === "latest" || key === "earliest" || key === "pending") { - return getBlock("111111"); - } + this.blocks = { + get(key: string): LivePromiseBlock { return getBlock(key); + }, + set(key: string, value: any): LivePromiseBlock { + return db.blocks.put(key, value) as any as LivePromiseBlock; } - }) as any as BlockManager; + } + db.on("ready", this.emit.bind(this, "ready")); } public async latest() { const block = new Block(Buffer.from([])); diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts new file mode 100644 index 0000000000..f4aa2d6186 --- /dev/null +++ b/src/ledgers/ethereum/database.ts @@ -0,0 +1,75 @@ +import Emittery from "emittery"; +const sub = require( "subleveldown"); +import { dir } from "tmp-promise"; +const leveldown = require("leveldown"); +import levelup from "levelup"; +const encode = require("encoding-down"); +const cachedown = require("cachedown"); + +async function getDir(db_path: string) { + if (db_path) { + return db_path; + } else { + await dir(); + } + } + +export default class Database extends Emittery{ + private options: any; + private directory: string = null; + private db: levelup.LevelUp; + public blocks: levelup.LevelUp; + private blockLogs: levelup.LevelUp; + private blockHashes: levelup.LevelUp; + private transactions: levelup.LevelUp; + private transactionReceipts: levelup.LevelUp; + private stateTrie: levelup.LevelUp; + private initialized: boolean; + constructor(options: any) { + super(); + + this.options = options; + this._initialize(); + } + private async _initialize(){ + const levelupOptions: any = { valueEncoding: "binary" }; + // delete levelupOptions.valueEncoding; + const store = this.options.db; + let db; + if (store) { + db = await levelup(store, levelupOptions); + } else { + let directory = this.options.db_path; + if (!directory) { + directory = (await dir()).path; + } + this.directory = directory; + const store = encode(leveldown(directory), levelupOptions); + db = await levelup(store, {}); + } + + const open = db.open(); + const self = this; + + // Blocks, keyed by array index (not necessarily by block number) (0-based) + self.blocks = sub(db, "blocks", {valueEncoding: "binary"}); + + // Logs triggered in each block, keyed by block id (ids in the blocks array; not necessarily block number) (0-based) + self.blockLogs = sub(db, "blockLogs"); + + // Block hashes -> block ids (ids in the blocks array; not necessarily block number) for quick lookup + self.blockHashes = sub(db, "blockHashes"); + + // Transaction hash -> transaction objects + self.transactions = sub(db, "transactions"); + + // Transaction hash -> transaction receipts + self.transactionReceipts = sub(db, "transactionReceipts"); + + self.stateTrie = sub(db, "stateTrie"); + + this.db = db; + await open; + this.emit("ready"); + } +} \ No newline at end of file diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 753bc74b7e..c4adbe8174 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,3 +1,4 @@ +import Emittery from "emittery"; import ILedger, {optionsSymbol as _options} from "../../interfaces/ledger"; import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options"; import {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcData} from "../../types/json-rpc"; @@ -6,6 +7,7 @@ import Tag from "../../types/tags"; import { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; +import Block from "ethereumjs-block"; const createKeccakHash = require("keccak"); @@ -20,11 +22,13 @@ export default class Ethereum implements ILedger { readonly [_options]: EthereumOptions; private [_isMining]: boolean = false; private readonly [_blockchain]: Blockchain; - constructor(options: EthereumOptions){ + constructor(options: EthereumOptions, ready: ()=>{}) { const tmpOptions = Object.assign(getDefaultEthereumOptions(), options); this[_coinbase] = tmpOptions.accounts[0]; this[_options] = tmpOptions; - this[_blockchain] = new Blockchain(); + const chain = new Blockchain(); + this[_blockchain] = chain; + chain.on("ready", ready); } /** @@ -133,7 +137,7 @@ export default class Ethereum implements ILedger { * @returns integer of the current block number the client is on. */ async eth_blockNumber(): Promise { - return this[_blockchain].blocks[Tag.LATEST].then((block) => BigInt(block.header.number)); + return this[_blockchain].blocks.get(Tag.LATEST).then((block) => BigInt(block.header.number)); } /** @@ -144,7 +148,8 @@ export default class Ethereum implements ILedger { async eth_getBalance(address: IndexableAddress, blockNumber: bigint|Tag = Tag.LATEST): Promise { const chain = this[_blockchain]; const str = blockNumber.toString(); - const block = await chain.blocks[str]; + const block = await chain.blocks.get(str); + const r = chain.blocks.set("123", "123"); const account = await block.accounts[address]; return account.balance; } @@ -158,10 +163,23 @@ export default class Ethereum implements ILedger { transasctionHash = JsonRpcData.from(transasctionHash); const chain = this[_blockchain]; - const block = chain.blocks[Tag.LATEST]; + const block = await chain.blocks.get(Tag.LATEST); + + // TODO: just POC stuff i was working on... + if (!block) { + const b = new Block(null as any); + b.header.number = Buffer.from("1234", "hex"); + const c = b.serialize(true); + const d = new Block(c); + await chain.blocks.set(Tag.LATEST, c); + } + const block2 = await chain.blocks.get(Tag.LATEST); + // END + + const transaction = block.transactions[transasctionHash]; return transaction; } - [index: string]: (...args: any) => Promise<{}>; + readonly [index: string]: (...args: any) => Promise<{}>; } diff --git a/src/provider.ts b/src/provider.ts index ff3eb804ef..36ca78e5ae 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,7 +1,7 @@ import Engine from "./engine"; import RequestProcessor from "./utils/request-processor"; import ProviderOptions, { getDefault as getDefaultProviderOptions } from "./options/provider-options"; -import { EventEmitter } from "events"; +import Emittery from "emittery"; import Ethereum from "./ledgers/ethereum/ledger" import { privateToAddress } from "ethereumjs-util"; import Account from "./types/account"; @@ -23,7 +23,7 @@ interface Callback { } -export default class Provider extends EventEmitter { +export default class Provider extends Emittery { private [options]: ProviderOptions; private [engine]: Engine; private [requestProcessor]: RequestProcessor; @@ -35,7 +35,7 @@ export default class Provider extends EventEmitter { const _providerOptions = this[options] = getDefaultProviderOptions(providerOptions); // set up our request processor to either use FIFO or or async request processing - this[requestProcessor] = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 1 : 0); + const _requestProcessor = this[requestProcessor] = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 1 : 0); if(!_providerOptions.mnemonic){ // TODO: this is a default and should be configured that way @@ -48,7 +48,7 @@ export default class Provider extends EventEmitter { const _engine = this[engine] = new Engine(_providerOptions.ledger || new Ethereum({ net_version, accounts - })); + }, _requestProcessor.resume.bind(_requestProcessor))); } private initializeAccounts(): Account[]{ diff --git a/src/utils/request-processor.ts b/src/utils/request-processor.ts index e06699aa94..e851c12154 100644 --- a/src/utils/request-processor.ts +++ b/src/utils/request-processor.ts @@ -1,9 +1,9 @@ export default class RequestProcessor { public limit: number = 0 public pending: any[] = []; - public running: any[] = []; + public runningTasks: number = 0; private _processing: boolean; - private _paused: boolean = false; + private _paused: boolean = true; public get paused(): boolean { return this._paused; } @@ -29,27 +29,29 @@ export default class RequestProcessor { } private process() { - if(this._processing) return; + if (this._processing) return; this._processing = true; // if we aren't paused and the number of things we're processing is under // our limit and we have things to process: do it! - while(!this.paused && this.limit && this.running.length < this.limit && this.pending.length > 0) { + while(!this.paused && this.pending.length > 0 && (!this.limit || this.runningTasks < this.limit)) { let current = this.pending.shift(); - this.running.push(current); + this.runningTasks++; current().then(() => { - this.running.slice(); + this.runningTasks--; }); } this._processing = false; } - public queue = async function(fn: (...args: any[]) => Promise<{}>, ...args: any[]): Promise<{}> { - const executor = (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { - return fn.apply(null, args).then(resolve).catch(reject); - } - this.pending.push(executor); - this.process(); - return new Promise(executor); + public queue = function(fn: (...args: any[]) => Promise<{}>, ...args: any[]): Promise<{}> { + const promise = new Promise((resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { + const executor = () => { + return fn.apply(null, args).then(resolve).catch(reject); + } + this.pending.push(executor); + this.process(); + }); + return promise; } } From 2aa8ef13fea327fdb53fd191a1b6c05fbf2642eb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 15 Apr 2019 15:29:47 -0400 Subject: [PATCH 022/691] experiements --- src/ledgers/ethereum/database.ts | 36 +++++++++++++++++++------------- src/ledgers/ethereum/ledger.ts | 22 +++++++++++++++++-- tsconfig.json | 1 + 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index f4aa2d6186..1ce39306a7 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -16,15 +16,15 @@ async function getDir(db_path: string) { export default class Database extends Emittery{ private options: any; - private directory: string = null; - private db: levelup.LevelUp; + public directory: string = null; + private _db: levelup.LevelUp = null; public blocks: levelup.LevelUp; - private blockLogs: levelup.LevelUp; - private blockHashes: levelup.LevelUp; - private transactions: levelup.LevelUp; - private transactionReceipts: levelup.LevelUp; - private stateTrie: levelup.LevelUp; - private initialized: boolean; + public blockLogs: levelup.LevelUp; + public blockHashes: levelup.LevelUp; + public transactions: levelup.LevelUp; + public transactionReceipts: levelup.LevelUp; + public stateTrie: levelup.LevelUp; + public initialized: boolean; constructor(options: any) { super(); @@ -52,24 +52,30 @@ export default class Database extends Emittery{ const self = this; // Blocks, keyed by array index (not necessarily by block number) (0-based) - self.blocks = sub(db, "blocks", {valueEncoding: "binary"}); + self.blocks = sub(db, "blocks", levelupOptions); // Logs triggered in each block, keyed by block id (ids in the blocks array; not necessarily block number) (0-based) - self.blockLogs = sub(db, "blockLogs"); + self.blockLogs = sub(db, "blockLogs", levelupOptions); // Block hashes -> block ids (ids in the blocks array; not necessarily block number) for quick lookup - self.blockHashes = sub(db, "blockHashes"); + self.blockHashes = sub(db, "blockHashes", levelupOptions); // Transaction hash -> transaction objects - self.transactions = sub(db, "transactions"); + self.transactions = sub(db, "transactions", levelupOptions); // Transaction hash -> transaction receipts - self.transactionReceipts = sub(db, "transactionReceipts"); + self.transactionReceipts = sub(db, "transactionReceipts", levelupOptions); - self.stateTrie = sub(db, "stateTrie"); + self.stateTrie = sub(db, "stateTrie", levelupOptions); - this.db = db; + this._db = db; await open; this.emit("ready"); } + public async close() { + const db = this._db; + if (db && db.isOpen()) { + db.close(); + } + } } \ No newline at end of file diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index c4adbe8174..3f5fc7afca 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,4 +1,3 @@ -import Emittery from "emittery"; import ILedger, {optionsSymbol as _options} from "../../interfaces/ledger"; import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options"; import {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcData} from "../../types/json-rpc"; @@ -149,7 +148,6 @@ export default class Ethereum implements ILedger { const chain = this[_blockchain]; const str = blockNumber.toString(); const block = await chain.blocks.get(str); - const r = chain.blocks.set("123", "123"); const account = await block.accounts[address]; return account.balance; } @@ -181,5 +179,25 @@ export default class Ethereum implements ILedger { return transaction; } + @sync + async eth_sendTransaction(transaction: any): Promise { + // todo: transaction stuff + return ""; + } + + @sync + async eth_sendRawTransaction(transaction: any): Promise { + // todo: transaction stuff + return ""; + } + readonly [index: string]: (...args: any) => Promise<{}>; } + +// make sync wrap the method in a FIFO queue +function sync(target: any, name: any, descriptor: any) { + const method = descriptor.value; + descriptor.value = function(...args: any[]) { + return method.apply(args); + } +} diff --git a/tsconfig.json b/tsconfig.json index cd153c666f..5a7bf4f262 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "experimentalDecorators": true, "module": "commonjs", "esModuleInterop": true, "target": "esnext", From df0c872b282990d0ee26d7ada168b15aa00f83c0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 15 Apr 2019 17:41:06 -0400 Subject: [PATCH 023/691] install and audit fix --- npm-shrinkwrap.json | 41 ++++++++++++++++++++++++++++++----------- package.json | 2 +- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 78135bfcfc..dc3ac194e1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1752,9 +1752,9 @@ "dev": true }, "js-yaml": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", - "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -2299,9 +2299,9 @@ } }, "mocha": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.2.tgz", - "integrity": "sha512-BgD2/RozoSC3uQK5R0isDcxjqaWw2n5HWdk8njYUyZf2NC79ErO5FtYVX52+rfqGoEgMfJf4fuG0IWh2TMzFoA==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.3.tgz", + "integrity": "sha512-QdE/w//EPHrqgT5PNRUjRVHy6IJAzAf1R8n2O8W8K2RZ+NbPfOD5cBDp+PGa2Gptep37C/TdBiaNwakppEzEbg==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -2318,7 +2318,7 @@ "minimatch": "3.0.4", "mkdirp": "0.5.1", "ms": "2.1.1", - "node-environment-flags": "1.0.4", + "node-environment-flags": "1.0.5", "object.assign": "4.1.0", "strip-json-comments": "2.0.1", "supports-color": "6.0.0", @@ -2343,6 +2343,16 @@ "path-is-absolute": "^1.0.0" } }, + "js-yaml": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", + "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "supports-color": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", @@ -2377,12 +2387,21 @@ "dev": true }, "node-environment-flags": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.4.tgz", - "integrity": "sha512-M9rwCnWVLW7PX+NUWe3ejEdiLYinRpsEre9hMkU/6NS4h+EEulYaDH1gCEZ2gyXsmw+RXYDaV2JkkTNcsPDJ0Q==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", + "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", "dev": true, "requires": { - "object.getownpropertydescriptors": "^2.0.3" + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "node-gyp-build": { diff --git a/package.json b/package.json index a1f30c5253..2c879dfa1d 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@types/ws": "6.0.1", "bufferutil": "4.0.1", "cross-env": "5.2.0", - "mocha": "^6.1.2", + "mocha": "^6.1.3", "superagent": "4.1.0", "ts-node": "^8.0.3", "tslint": "5.14.0", From 6e49af35394721b3d4543a2059f2ed766eb924d8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 16 Apr 2019 14:27:27 -0400 Subject: [PATCH 024/691] not going to work --- src/ledgers/ethereum/blockchain.ts | 112 ++---------------- src/ledgers/ethereum/database.ts | 16 +-- src/ledgers/ethereum/ledger.ts | 6 +- src/ledgers/ethereum/things/block-manager.ts | 21 ++++ src/ledgers/ethereum/things/manager.ts | 25 ++++ src/ledgers/ethereum/things/promise-chain.ts | 39 ++++++ .../ethereum/things/transaction-manager.ts | 19 +++ src/types/account.ts | 9 +- 8 files changed, 130 insertions(+), 117 deletions(-) create mode 100644 src/ledgers/ethereum/things/block-manager.ts create mode 100644 src/ledgers/ethereum/things/manager.ts create mode 100644 src/ledgers/ethereum/things/promise-chain.ts create mode 100644 src/ledgers/ethereum/things/transaction-manager.ts diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 4e0e24fe7c..f040ba3be2 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,117 +1,23 @@ import Tag from "../../types/tags"; import Database from "./database"; -import {JsonRpcData} from "../../types/json-rpc"; -import Address from "../../types/address"; -import Account from "../../types/account"; -import Transaction from "../../types/transaction"; import Emittery from "emittery"; -import EthereumJsBLock from "ethereumjs-block"; - -// TODO: all the Promises stuff has got to go. I think we'll can just use get and set instead. -// and will very closely mimic what ganache already uses. We likely don't need to use our -// current serialization techniques, and can instead store the data as an RLP-encoded buffer. -// That said.. most ethereumjs-* stuff has a `raw` field that likely holds everything we want to serialize. -// If we can just efficiently (time, not so much space) encode/decode that into a flat buffer (which -// is part of what rlp encoding does, e.g. `block.serialize(true)`) maybe we can use that instead. -// Of course... maybe JSON is even faster. There is alsothe option of using protocol buffers in leveldb. - -type AccountManager = { - readonly [index: string]: Promise; -} -type TransactionManager = { - readonly [index: string]: Promise; -} - -class Block { // extends EthereumJsBLock { - private _accounts: any; - public accounts: AccountManager - private _transactions: any; - public transactions: TransactionManager; - public header: any = {}; - public block: EthereumJsBLock - constructor(data: Buffer) { - // super(data); - this.block = new EthereumJsBLock(data); - - const self = this; - - this._accounts = { - async getAccount(number: Address): Promise { - return new Account(number); - } - } - this.accounts = new Proxy(this, { - async get (obj, key: any): Promise{ - return self._accounts.getAccount(key); - } - }) as any as AccountManager; - - this._transactions = { - async getTransaction(number: Address): Promise { - return new Transaction(); - } - } - this.transactions = new Proxy(this, { - async get (obj, key: any): Promise{ - return self._transactions.getTransaction(key); - } - }) as any as TransactionManager; - } - -} - - -type BlockManager = { - get: (key: string) => LivePromiseBlock, - set: (key: string, value: any) => LivePromiseBlock -} -type LivePromiseBlock = Promise & Block; -type LivePromiseTransactionManager = Promise & TransactionManager; +import BlockManager from "./things/block-manager"; +import TransactionManager from "./things/transaction-manager"; export default class Blockchain extends Emittery { - public blocks: BlockManager; - private _blocks: any; + public readonly blocks: BlockManager; + public readonly transactions: TransactionManager; constructor() { super(); - const self = this; const db = new Database({}); - const getBlock = (number: string): LivePromiseBlock => { - var p = new Promise(async (resolve, reject) => { - const raw = await db.blocks.get(number).catch( e => { - return null; - }); - - // TODO: just POC stuff i was working on... - let b = null; - if (raw) { - b = new Block(raw); - } - - resolve(b); - }) as LivePromiseBlock; - p.transactions = new Proxy(this, { - get (obj, key: string|Tag): TransactionManager { - return p.then((block) => { - return block.transactions[key]; - }) as any as TransactionManager; - } - }) as any as TransactionManager; - return p; - }; - this.blocks = { - get(key: string): LivePromiseBlock { - return getBlock(key); - }, - set(key: string, value: any): LivePromiseBlock { - return db.blocks.put(key, value) as any as LivePromiseBlock; - } - } + this.blocks = new BlockManager(db); + this.transactions = new TransactionManager(db); db.on("ready", this.emit.bind(this, "ready")); } public async latest() { - const block = new Block(Buffer.from([])); - block.header.number = Buffer.from([111111]); - return block; + // const block = new Block(Buffer.from([])); + // block.header.number = Buffer.from([111111]); + // return block; } } \ No newline at end of file diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index 1ce39306a7..faa86fb2ad 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -15,16 +15,15 @@ async function getDir(db_path: string) { } export default class Database extends Emittery{ - private options: any; - public directory: string = null; - private _db: levelup.LevelUp = null; - public blocks: levelup.LevelUp; + private readonly options: any; + public readonly directory: string = null; + public readonly db: levelup.LevelUp = null; public blockLogs: levelup.LevelUp; public blockHashes: levelup.LevelUp; public transactions: levelup.LevelUp; public transactionReceipts: levelup.LevelUp; - public stateTrie: levelup.LevelUp; - public initialized: boolean; + public readonly stateTrie: levelup.LevelUp; + public readonly initialized: boolean; constructor(options: any) { super(); @@ -51,9 +50,6 @@ export default class Database extends Emittery{ const open = db.open(); const self = this; - // Blocks, keyed by array index (not necessarily by block number) (0-based) - self.blocks = sub(db, "blocks", levelupOptions); - // Logs triggered in each block, keyed by block id (ids in the blocks array; not necessarily block number) (0-based) self.blockLogs = sub(db, "blockLogs", levelupOptions); @@ -68,7 +64,7 @@ export default class Database extends Emittery{ self.stateTrie = sub(db, "stateTrie", levelupOptions); - this._db = db; + this.db = db; await open; this.emit("ready"); } diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 3f5fc7afca..e0801c059e 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -7,6 +7,7 @@ import { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; import Block from "ethereumjs-block"; +import { resolve } from "dns"; const createKeccakHash = require("keccak"); @@ -136,7 +137,7 @@ export default class Ethereum implements ILedger { * @returns integer of the current block number the client is on. */ async eth_blockNumber(): Promise { - return this[_blockchain].blocks.get(Tag.LATEST).then((block) => BigInt(block.header.number)); + return this[_blockchain].blocks.get(Tag.LATEST).then((block: any) => BigInt(block.value.header.number)); } /** @@ -147,6 +148,7 @@ export default class Ethereum implements ILedger { async eth_getBalance(address: IndexableAddress, blockNumber: bigint|Tag = Tag.LATEST): Promise { const chain = this[_blockchain]; const str = blockNumber.toString(); + var t = chain.blocks.get("str"); const block = await chain.blocks.get(str); const account = await block.accounts[address]; return account.balance; @@ -169,7 +171,7 @@ export default class Ethereum implements ILedger { b.header.number = Buffer.from("1234", "hex"); const c = b.serialize(true); const d = new Block(c); - await chain.blocks.set(Tag.LATEST, c); + // await chain.blocks.set(Tag.LATEST, c); } const block2 = await chain.blocks.get(Tag.LATEST); // END diff --git a/src/ledgers/ethereum/things/block-manager.ts b/src/ledgers/ethereum/things/block-manager.ts new file mode 100644 index 0000000000..f0fefed567 --- /dev/null +++ b/src/ledgers/ethereum/things/block-manager.ts @@ -0,0 +1,21 @@ +import EthereumJsBlock from "ethereumjs-block"; +import Database from "../database"; +import Manager, {Executor} from "./manager"; +import PromiseChain from "./promise-chain"; + +export default class BlockManager extends Manager { + constructor(db: Database) { + super(db, Block); + } +} + +export class Block extends PromiseChain { + // public accounts: AccountManager; + + constructor(executor: Executor) + constructor(pendingRawBlock: Promise) + constructor(arg1: Executor | Promise, db?: Database) + { + super(arg1, EthereumJsBlock, db); + } +} diff --git a/src/ledgers/ethereum/things/manager.ts b/src/ledgers/ethereum/things/manager.ts new file mode 100644 index 0000000000..b344398096 --- /dev/null +++ b/src/ledgers/ethereum/things/manager.ts @@ -0,0 +1,25 @@ +const sub = require("subleveldown"); +import levelup from "levelup"; +import Database from "../database"; +const levelupOptions: any = { valueEncoding: "binary" }; + +export type Executor = (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void; + +export type Instantiable = {new(...args: any[]): T}; + +export default class Manager{ + private Type: Instantiable; + public db: Database; + private base: levelup.LevelUp; + constructor(db: Database, type: Instantiable){ + this.Type = type; + this.db = db; + this.base = sub(db, "blocks", levelupOptions); + } + get(key: string): T { + return new this.Type(this.base.get(key)); + } + set(key: string, value: Buffer): T { + return new this.Type(this.base.put(key, value)); + } +} \ No newline at end of file diff --git a/src/ledgers/ethereum/things/promise-chain.ts b/src/ledgers/ethereum/things/promise-chain.ts new file mode 100644 index 0000000000..86656d3eba --- /dev/null +++ b/src/ledgers/ethereum/things/promise-chain.ts @@ -0,0 +1,39 @@ +import {Executor, Instantiable} from "./manager"; +import Database from "../database"; + +export default class PromiseChain extends Promise { + public value: U; + protected db: Database + constructor(arg1: Executor | Promise, Type: Instantiable, db: Database) { + super((resolve, reject) => { + // if we don't have a type then the arg1 + // must be an `executor` + if (!Type) { + return new Promise(arg1 as Executor); + } + + // If arg1 is a Promise, await teh result of the promise then construct our `Type` + // from the result + if (arg1 instanceof Promise) { + arg1.then((rawBlock) => { + this.value = new Type(rawBlock); + resolve(this as any as T); + }, reject); + // If arg1 is an executor, create a new Promise, await the result, then construct our `Type` + // from the result + } else if(typeof arg1 === "function") { + new Promise(arg1).then((result) => { + if (Buffer.isBuffer(result)){ + this.value = new Type(result); + resolve(this as any as T); + } else { + resolve(result); + } + }, reject); + } else { + reject(new Error("Invalid arg passed to constuctor")); + } + }); + this.db = db; + } +} \ No newline at end of file diff --git a/src/ledgers/ethereum/things/transaction-manager.ts b/src/ledgers/ethereum/things/transaction-manager.ts new file mode 100644 index 0000000000..0856fba55b --- /dev/null +++ b/src/ledgers/ethereum/things/transaction-manager.ts @@ -0,0 +1,19 @@ +import _Transaction from "../../../types/transaction"; + +import Database from "../database"; +import Manager, {Executor} from "./manager"; +import PromiseChain from "./promise-chain"; + +export default class TransactionManager extends Manager { + constructor(db: Database) { + super(db, Transaction); + } +} + +export class Transaction extends PromiseChain { + constructor(executor: Executor) + constructor(pendingRawBlock: Promise) + constructor(arg1: Executor | Promise, db?: Database) { + super(arg1, _Transaction, db); + } +} diff --git a/src/types/account.ts b/src/types/account.ts index ed7b1ca651..7da45479ad 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -5,7 +5,12 @@ export default class Account { public address: Address; public balance: JsonRpcQuantity = new JsonRpcQuantity(0n); public privateKey: JsonRpcData; - constructor(address: Address) { - this.address = address; + + constructor(address: Address) + constructor(buffer: Buffer) + constructor(arg: Address | Buffer) { + if (arg instanceof Address){ + this.address = arg; + } } } From ca350d0c09380632041ea3aaf71efea555bcd47f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 17 Apr 2019 10:02:35 -0400 Subject: [PATCH 025/691] moar --- src/ledgers/ethereum/blockchain.ts | 98 ++++++++++++++++--- src/ledgers/ethereum/database.ts | 31 +++--- src/ledgers/ethereum/ledger.ts | 36 +++---- src/ledgers/ethereum/things/block-manager.ts | 29 ++++-- src/ledgers/ethereum/things/manager.ts | 18 ++-- src/ledgers/ethereum/things/promise-chain.ts | 80 ++++++++------- .../ethereum/things/transaction-manager.ts | 17 ++-- test/provider.ts | 2 +- 8 files changed, 195 insertions(+), 116 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index f040ba3be2..3204d1a7c4 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,23 +1,97 @@ -import Tag from "../../types/tags"; import Database from "./database"; import Emittery from "emittery"; import BlockManager from "./things/block-manager"; import TransactionManager from "./things/transaction-manager"; +import Trie from "merkle-patricia-tree"; +import { BN } from "ethereumjs-util"; +const VM = require("ethereumjs-vm"); export default class Blockchain extends Emittery { - public readonly blocks: BlockManager; - public readonly transactions: TransactionManager; + public blocks: BlockManager; + public transactions: TransactionManager; + public vm: any; + public trie: Trie; - constructor() { + constructor(hardfork: string, allowUnlimitedContractSize: boolean) { super(); + const db = new Database({}); - this.blocks = new BlockManager(db); - this.transactions = new TransactionManager(db); - db.on("ready", this.emit.bind(this, "ready")); + db.on("ready", () => { + this.blocks = new BlockManager(db); + this.transactions = new TransactionManager(db); + + const root:any = null; + this.trie = new Trie(db.trie, root); + + this.vm = new VM({ + state: this.trie, + activatePrecompiles: true, + hardfork, + allowUnlimitedContractSize, + blockchain: { + getBlock: async (number: BN, done) => { + const hash = await this.blockNumberToHash(number); + + hash(done); + } + } + }); + this.vm.on("step", this.emit.bind(this, "step")); + + this.emit("ready"); + }); } - public async latest() { - // const block = new Block(Buffer.from([])); - // block.header.number = Buffer.from([111111]); - // return block; + + blockNumberToHash(number: BN): Promise { + number.toString(); } -} \ No newline at end of file +} + +// BlockchainDouble.prototype.createVMFromStateTrie = function(state, activatePrecompiles) { +// const self = this; +// const vm = new VM({ +// state: state, +// blockchain: { +// // EthereumJS VM needs a blockchain object in order to get block information. +// // When calling getBlock() it will pass a number that's of a Buffer type. +// // Unfortunately, it uses a 64-character buffer (when converted to hex) to +// // represent block numbers as well as block hashes. Since it's very unlikely +// // any block number will get higher than the maximum safe Javascript integer, +// // we can convert this buffer to a number ahead of time before calling our +// // own getBlock(). If the conversion succeeds, we have a block number. +// // If it doesn't, we have a block hash. (Note: Our implementation accepts both.) +// getBlock: function(number, done) { +// try { +// number = to.number(number); +// } catch (e) { +// // Do nothing; must be a block hash. +// } + +// self.getBlock(number, done); +// } +// }, +// activatePrecompiles: activatePrecompiles || false, +// hardfork: self.options.hardfork, +// allowUnlimitedContractSize: self.options.allowUnlimitedContractSize +// }); + +// if (self.options.debug === true) { +// // log executed opcodes, including args as hex +// vm.on("step", function(info) { +// var name = info.opcode.name; +// var argsNum = info.opcode.in; +// if (argsNum) { +// var args = info.stack +// .slice(-argsNum) +// .map((arg) => to.hex(arg)) +// .join(" "); + +// self.logger.log(`${name} ${args}`); +// } else { +// self.logger.log(name); +// } +// }); +// } + +// return vm; +// }; \ No newline at end of file diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index faa86fb2ad..f2525b73cb 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -4,25 +4,16 @@ import { dir } from "tmp-promise"; const leveldown = require("leveldown"); import levelup from "levelup"; const encode = require("encoding-down"); -const cachedown = require("cachedown"); - -async function getDir(db_path: string) { - if (db_path) { - return db_path; - } else { - await dir(); - } - } export default class Database extends Emittery{ private readonly options: any; - public readonly directory: string = null; - public readonly db: levelup.LevelUp = null; + public directory: string = null; + public db: levelup.LevelUp = null; public blockLogs: levelup.LevelUp; public blockHashes: levelup.LevelUp; public transactions: levelup.LevelUp; public transactionReceipts: levelup.LevelUp; - public readonly stateTrie: levelup.LevelUp; + public trie: levelup.LevelUp; public readonly initialized: boolean; constructor(options: any) { super(); @@ -48,28 +39,28 @@ export default class Database extends Emittery{ } const open = db.open(); - const self = this; + //const self = this; // Logs triggered in each block, keyed by block id (ids in the blocks array; not necessarily block number) (0-based) - self.blockLogs = sub(db, "blockLogs", levelupOptions); + //self.blockLogs = sub(db, "blockLogs", levelupOptions); // Block hashes -> block ids (ids in the blocks array; not necessarily block number) for quick lookup - self.blockHashes = sub(db, "blockHashes", levelupOptions); + //self.blockHashes = sub(db, "blockHashes", levelupOptions); - // Transaction hash -> transaction objects - self.transactions = sub(db, "transactions", levelupOptions); + // // Transaction hash -> transaction objects + // self.transactions = sub(db, "transactions", levelupOptions); // Transaction hash -> transaction receipts - self.transactionReceipts = sub(db, "transactionReceipts", levelupOptions); + //self.transactionReceipts = sub(db, "transactionReceipts", levelupOptions); - self.stateTrie = sub(db, "stateTrie", levelupOptions); + this.trie = sub(db, "trie", levelupOptions); this.db = db; await open; this.emit("ready"); } public async close() { - const db = this._db; + const db = this.db; if (db && db.isOpen()) { db.close(); } diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index e0801c059e..af77728127 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -6,8 +6,6 @@ import Tag from "../../types/tags"; import { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; -import Block from "ethereumjs-block"; -import { resolve } from "dns"; const createKeccakHash = require("keccak"); @@ -22,7 +20,7 @@ export default class Ethereum implements ILedger { readonly [_options]: EthereumOptions; private [_isMining]: boolean = false; private readonly [_blockchain]: Blockchain; - constructor(options: EthereumOptions, ready: ()=>{}) { + constructor(options: EthereumOptions, ready: () => {}) { const tmpOptions = Object.assign(getDefaultEthereumOptions(), options); this[_coinbase] = tmpOptions.accounts[0]; this[_options] = tmpOptions; @@ -137,7 +135,8 @@ export default class Ethereum implements ILedger { * @returns integer of the current block number the client is on. */ async eth_blockNumber(): Promise { - return this[_blockchain].blocks.get(Tag.LATEST).then((block: any) => BigInt(block.value.header.number)); + const latest = this[_blockchain].blocks.get(Tag.LATEST); + return latest.then((block: any) => BigInt(block.value.header.number)); } /** @@ -150,8 +149,9 @@ export default class Ethereum implements ILedger { const str = blockNumber.toString(); var t = chain.blocks.get("str"); const block = await chain.blocks.get(str); - const account = await block.accounts[address]; - return account.balance; + //const account = await block.accounts.get(address); + //return account.balance; + return JsonRpcQuantity.from(BigInt(0)); } /** @@ -163,21 +163,21 @@ export default class Ethereum implements ILedger { transasctionHash = JsonRpcData.from(transasctionHash); const chain = this[_blockchain]; - const block = await chain.blocks.get(Tag.LATEST); + // const block = await chain.blocks.get(Tag.LATEST); - // TODO: just POC stuff i was working on... - if (!block) { - const b = new Block(null as any); - b.header.number = Buffer.from("1234", "hex"); - const c = b.serialize(true); - const d = new Block(c); - // await chain.blocks.set(Tag.LATEST, c); - } - const block2 = await chain.blocks.get(Tag.LATEST); - // END + // // TODO: just POC stuff I was working on... + // if (!block) { + // const b = new Block(null as any); + // b.header.number = Buffer.from("1234", "hex"); + // const c = b.serialize(true); + // const d = new Block(c); + // // await chain.blocks.set(Tag.LATEST, c); + // } + // const block2 = await chain.blocks.get(Tag.LATEST); + // // END - const transaction = block.transactions[transasctionHash]; + const transaction = await chain.transactions.get(transasctionHash); return transaction; } diff --git a/src/ledgers/ethereum/things/block-manager.ts b/src/ledgers/ethereum/things/block-manager.ts index f0fefed567..60f6297a88 100644 --- a/src/ledgers/ethereum/things/block-manager.ts +++ b/src/ledgers/ethereum/things/block-manager.ts @@ -1,21 +1,30 @@ import EthereumJsBlock from "ethereumjs-block"; import Database from "../database"; -import Manager, {Executor} from "./manager"; -import PromiseChain from "./promise-chain"; +import Manager from "./manager"; export default class BlockManager extends Manager { + + // We cache these: + public earliest: Block; + public latest: Block; + public pending: Block; + constructor(db: Database) { - super(db, Block); + super(db, Block, "block"); + + db.once("open").then(() => { + // TODO: get the last key, set as "earliest" + // TODO: get the first last key, set as "latest" + }); } } -export class Block extends PromiseChain { - // public accounts: AccountManager; - - constructor(executor: Executor) - constructor(pendingRawBlock: Promise) - constructor(arg1: Executor | Promise, db?: Database) +export class Block { + public readonly manager: BlockManager; + public readonly value: EthereumJsBlock; + constructor(raw: Buffer, manager?: BlockManager) { - super(arg1, EthereumJsBlock, db); + this.value = new EthereumJsBlock(raw); + this.manager = manager; } } diff --git a/src/ledgers/ethereum/things/manager.ts b/src/ledgers/ethereum/things/manager.ts index b344398096..6c5afe06f2 100644 --- a/src/ledgers/ethereum/things/manager.ts +++ b/src/ledgers/ethereum/things/manager.ts @@ -3,23 +3,21 @@ import levelup from "levelup"; import Database from "../database"; const levelupOptions: any = { valueEncoding: "binary" }; -export type Executor = (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void; - export type Instantiable = {new(...args: any[]): T}; -export default class Manager{ +export default class Manager { private Type: Instantiable; public db: Database; - private base: levelup.LevelUp; - constructor(db: Database, type: Instantiable){ + protected base: levelup.LevelUp; + constructor(db: Database, type: Instantiable, name: string){ this.Type = type; this.db = db; - this.base = sub(db, "blocks", levelupOptions); + this.base = sub(db.db, name, levelupOptions); } - get(key: string): T { - return new this.Type(this.base.get(key)); + get(key: string): Promise { + return this.base.get(key).then((raw) => new this.Type(raw)); } - set(key: string, value: Buffer): T { - return new this.Type(this.base.put(key, value)); + set(key: string, value: Buffer): Promise { + return this.base.put(key, value).then((raw) => new this.Type(raw)); } } \ No newline at end of file diff --git a/src/ledgers/ethereum/things/promise-chain.ts b/src/ledgers/ethereum/things/promise-chain.ts index 86656d3eba..65f9ed2c7f 100644 --- a/src/ledgers/ethereum/things/promise-chain.ts +++ b/src/ledgers/ethereum/things/promise-chain.ts @@ -1,39 +1,45 @@ -import {Executor, Instantiable} from "./manager"; -import Database from "../database"; +// import {Executor, Instantiable} from "./manager"; +// import Database from "../database"; +// import Block from "ethereumjs-block"; -export default class PromiseChain extends Promise { - public value: U; - protected db: Database - constructor(arg1: Executor | Promise, Type: Instantiable, db: Database) { - super((resolve, reject) => { - // if we don't have a type then the arg1 - // must be an `executor` - if (!Type) { - return new Promise(arg1 as Executor); - } +// export default class PromiseChain implements PromiseLike { +// public value: U; +// protected db: Database +// constructor(pending: Promise, Type: Instantiable, db: Database) { +// pending.then((rawBlock) => { +// this.resolved = true; +// this.value = new Type(rawBlock); +// this.resolutions.forEach(r => r(this)); +// }); +// // super((resolve, reject) => { +// // // if we don't have a type then the arg1 +// // // must be an `executor` +// // if (!Type) { +// // return new Promise(arg1 as Executor); +// // } - // If arg1 is a Promise, await teh result of the promise then construct our `Type` - // from the result - if (arg1 instanceof Promise) { - arg1.then((rawBlock) => { - this.value = new Type(rawBlock); - resolve(this as any as T); - }, reject); - // If arg1 is an executor, create a new Promise, await the result, then construct our `Type` - // from the result - } else if(typeof arg1 === "function") { - new Promise(arg1).then((result) => { - if (Buffer.isBuffer(result)){ - this.value = new Type(result); - resolve(this as any as T); - } else { - resolve(result); - } - }, reject); - } else { - reject(new Error("Invalid arg passed to constuctor")); - } - }); - this.db = db; - } -} \ No newline at end of file +// // // If arg1 is a Promise, await teh result of the promise then construct our `Type` +// // // from the result +// // if (arg1 instanceof Promise) { +// // arg1.then((rawBlock) => { +// // //this.value = new Type(rawBlock); +// // //resolve(this); +// // }, reject); +// // // If arg1 is an executor, create a new Promise, await the result, then construct our `Type` +// // // from the result +// // } else if(typeof arg1 === "function") { +// // new Promise(arg1).then((result) => { +// // if (Buffer.isBuffer(result)){ +// // //this.value = new Type(result); +// // // resolve((function(){return this;})()); +// // } else { +// // resolve(result); +// // } +// // }, reject); +// // } else { +// // reject(new Error("Invalid arg passed to constuctor")); +// // } +// // }); +// this.db = db; +// } +// } \ No newline at end of file diff --git a/src/ledgers/ethereum/things/transaction-manager.ts b/src/ledgers/ethereum/things/transaction-manager.ts index 0856fba55b..1f57f01eca 100644 --- a/src/ledgers/ethereum/things/transaction-manager.ts +++ b/src/ledgers/ethereum/things/transaction-manager.ts @@ -1,19 +1,20 @@ import _Transaction from "../../../types/transaction"; import Database from "../database"; -import Manager, {Executor} from "./manager"; -import PromiseChain from "./promise-chain"; +import Manager from "./manager"; export default class TransactionManager extends Manager { constructor(db: Database) { - super(db, Transaction); + super(db, Transaction, "transactions"); } } -export class Transaction extends PromiseChain { - constructor(executor: Executor) - constructor(pendingRawBlock: Promise) - constructor(arg1: Executor | Promise, db?: Database) { - super(arg1, _Transaction, db); +export class Transaction { + private readonly manager: TransactionManager; + public readonly value: _Transaction; + constructor(raw: Buffer, manager?: TransactionManager) { + // todo: make _Transaction take the raw Buffer + this.value = new _Transaction(/*raw*/); + this.manager = manager; } } diff --git a/test/provider.ts b/test/provider.ts index 700e69d998..2d4b78487f 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -10,7 +10,7 @@ describe("provider", () => { network_id: networkId }); }) - it("returns a transaction", async () => { + it.skip("returns a transaction", async () => { var result = await p.send("eth_getTransactionByHash", ["0x123"]); const v = result.blockNumber; // todo: figure things out From 5716d654fea20f4649b14e29cec6e5169f31fedf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 17:36:40 -0400 Subject: [PATCH 026/691] Add bigint support to Buffers --- index.ts | 4 ++++ npm-shrinkwrap.json | 6 +++++ package.json | 1 + src/utils/jsbi-helpers.ts | 50 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 src/utils/jsbi-helpers.ts diff --git a/index.ts b/index.ts index 3a9bd51eea..156c362b3a 100644 --- a/index.ts +++ b/index.ts @@ -1,3 +1,6 @@ +import * as jsbiHelpers from "./src/utils/jsbi-helpers"; +jsbiHelpers.install(); + import Provider from "./src/provider"; import ProviderOptions from "./src/options/provider-options"; import Server, {ServerOptions} from "./src/server"; @@ -9,3 +12,4 @@ export default { Server, Provider }; +; \ No newline at end of file diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index dc3ac194e1..976d50674e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1761,6 +1761,12 @@ "esprima": "^4.0.0" } }, + "jsbi": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-2.0.5.tgz", + "integrity": "sha512-TzO/62Hxeb26QMb4IGlI/5X+QLr9Uqp1FPkwp2+KOICW+Q+vSuFj61c8pkT6wAns4WcK56X7CmSHhJeDGWOqxQ==", + "dev": true + }, "keccak": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.0.0.tgz", diff --git a/package.json b/package.json index 2c879dfa1d..a36720eb3f 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "@types/ws": "6.0.1", "bufferutil": "4.0.1", "cross-env": "5.2.0", + "jsbi": "^2.0.5", "mocha": "^6.1.3", "superagent": "4.1.0", "ts-node": "^8.0.3", diff --git a/src/utils/jsbi-helpers.ts b/src/utils/jsbi-helpers.ts new file mode 100644 index 0000000000..b2c3f2ed74 --- /dev/null +++ b/src/utils/jsbi-helpers.ts @@ -0,0 +1,50 @@ +import JSBI from "jsbi"; + +declare global { + interface DataView { + setBigUint64(byteOffset: number, value: bigint | JSBI, littleEndian?: boolean): void; + getBigUint64(byteOffset: number, littleEndian?: boolean): void; + } +} + +/** + * Installs support for bigint helpers on the DataView prototype, allowing for + * converting bigint's to a Buffer, and vis-versa. + */ +export const install = () => { + DataView.prototype._setBigUint64 = DataView.prototype.setBigUint64; + DataView.prototype.setBigUint64 = function(byteOffset: number, value: bigint | JSBI, littleEndian: boolean = undefined) { + if (typeof value === 'bigint' && typeof this._setBigUint64 !== 'undefined') { + // the original native implementation for bigint + this._setBigUint64(byteOffset, value, littleEndian); + } else if (value.constructor === JSBI && typeof (value as any).sign === 'bigint' && typeof this._setBigUint64 !== 'undefined') { + // JSBI wrapping a native bigint + this._setBigUint64(byteOffset, (value as any).sign, littleEndian); + } else if (value.constructor === JSBI) { + // JSBI polyfill implementation + let lowWord = (value as any)[0], highWord = 0; + if ((value as any).length >= 2) { + highWord = (value as any)[1]; + } + this.setUint32(littleEndian ? 0 : 4, lowWord, littleEndian); + this.setUint32(littleEndian ? 4 : 0, highWord, littleEndian); + } else { + throw TypeError('Value needs to be BigInt or JSBI'); + } + } + + DataView.prototype._getBigUint64 = DataView.prototype.getBigUint64; + DataView.prototype.getBigUint64 = function(byteOffset: number, littleEndian: boolean = undefined) { + if (typeof this._setBigUint64 !== 'undefined') { + return BigInt(this._getBigUint64(byteOffset, littleEndian)); + } else { + let lowWord = 0, highWord = 0; + lowWord = this.getUint32(littleEndian ? 0 : 4, littleEndian); + highWord = this.getUint32(littleEndian ? 4 : 0, littleEndian); + const result = JSBI.BigInt(2); + (result as any).__setDigit(0, lowWord); + (result as any).__setDigit(1, highWord); + return result; + } + } +}; From 7d93b9b47a19bf299d025e7ed2230f7c8a0f9d29 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 17:37:04 -0400 Subject: [PATCH 027/691] Document engine.ts --- src/engine.ts | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/engine.ts b/src/engine.ts index b3e9de4113..996744dfee 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -4,25 +4,41 @@ import Emittery from "emittery"; const _ledger = Symbol("ledger"); export default class Engine extends Emittery { - private [_ledger]: ILedger; + private readonly [_ledger]: ILedger; + /** + * The Engine handles execution of methods on the given Ledger + * @param ledger + */ constructor(ledger: ILedger) { super(); if (!ledger) { - throw new Error("yah, that's not right"); + throw new Error("You must provide a ledger"); } this[_ledger] = ledger; } - public async execute(method: string, params: any[]): Promise { - if (typeof method === "string") { + + /** + * Executes the method with the given methodName on the Ledger + * @param methodName The name of the JSON-RPC method to execute. + * @param params The params to pass to the JSON-RPC method. + */ + public async execute(methodName: string, params: any[]): Promise { + // The methodName is user-entered data and can be all sorts of weird hackery + // Make sure we only accept what we expect to avoid headache and heartache + if (typeof methodName === "string") { const ledger = this[_ledger]; - if (ledger.__proto__.hasOwnProperty(method)) { - const fn = ledger[method]; + // Only allow executing our *own* methods: + if (ledger.__proto__.hasOwnProperty(methodName)) { + const fn = ledger[methodName]; + // just double check, in case a Ledger breaks the rules and adds non-fns + // to their Ledger interface. if (typeof fn === "function") { return fn.apply(ledger, params); } } } - throw new Error(`Invalid method: ${method}`); + + throw new Error(`Invalid or unsupported method: ${methodName}`); } -} \ No newline at end of file +} From 262d2c44cf8b482ef35bd0d02ceaded4463df18d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 17:37:54 -0400 Subject: [PATCH 028/691] Document provider sendAsync legacy fn --- src/provider.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/provider.ts b/src/provider.ts index 36ca78e5ae..2eca4960eb 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -132,6 +132,11 @@ export default class Provider extends Emittery { return response; } + /** + * Legacy callback style API + * @param payload JSON-RPC payload + * @param callback callback + */ public sendAsync(payload: JsonRpc.Request, callback?: Callback): void { return this.send(payload, callback); } From e14c045b25f3930fc8c0250bb7ee6d7983f128b8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 17:38:48 -0400 Subject: [PATCH 029/691] Document ledger interface --- src/interfaces/ledger.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/interfaces/ledger.ts b/src/interfaces/ledger.ts index 10cb8104eb..8157f888a6 100644 --- a/src/interfaces/ledger.ts +++ b/src/interfaces/ledger.ts @@ -1,6 +1,8 @@ -export const optionsSymbol = Symbol("options"); +/** + * Defines the interface for a Ledger. + * all properties must be `async` callable or return a `Promise` + */ export default interface ILedger { - readonly [optionsSymbol]: any; - readonly [key: string]: (params?: any[]) => Promise | any; + readonly [key: string]: (params?: any[]) => Promise; } From ef02571f89cc8736b42619cdf434e8611d233793 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 17:41:37 -0400 Subject: [PATCH 030/691] Lots of updates --- src/interfaces/ledger-options.ts | 9 +- src/ledgers/ethereum/blockchain.ts | 172 +++--- src/ledgers/ethereum/database.ts | 62 +- src/ledgers/ethereum/ledger.ts | 34 +- src/ledgers/ethereum/options.ts | 15 +- .../ethereum/things/account-manager.ts | 24 + src/ledgers/ethereum/things/block-manager.ts | 90 ++- src/ledgers/ethereum/things/errors.ts | 26 + src/ledgers/ethereum/things/manager.ts | 4 +- src/ledgers/ethereum/things/promise-chain.ts | 45 -- .../ethereum/things/transaction-manager.ts | 31 +- .../ethereum/things/transaction-pool.ts | 205 +++++++ src/options/options.ts | 7 +- src/provider.ts | 13 +- src/types/account.ts | 7 + src/types/json-rpc/json-rpc-base-types.ts | 60 +- src/types/json-rpc/json-rpc-data.ts | 8 +- src/types/json-rpc/json-rpc-quantity.ts | 12 +- src/types/transaction.ts | 529 +++++++++++++++--- src/utils/heap.ts | 187 +++++++ src/utils/request-processor.ts | 44 +- 21 files changed, 1295 insertions(+), 289 deletions(-) create mode 100644 src/ledgers/ethereum/things/account-manager.ts create mode 100644 src/ledgers/ethereum/things/errors.ts delete mode 100644 src/ledgers/ethereum/things/promise-chain.ts create mode 100644 src/ledgers/ethereum/things/transaction-pool.ts create mode 100644 src/utils/heap.ts diff --git a/src/interfaces/ledger-options.ts b/src/interfaces/ledger-options.ts index 367056f059..c6eed833fb 100644 --- a/src/interfaces/ledger-options.ts +++ b/src/interfaces/ledger-options.ts @@ -1,5 +1,8 @@ -import {JsonRpcData} from "../types/json-rpc"; +import Account from "../types/account"; -export default interface LedgerOptions { - accounts?: JsonRpcData[] +/** + * Options that ledger implementations must implement + */ +export default interface ILedgerOptions { + accounts?: Account[] } \ No newline at end of file diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 3204d1a7c4..8fc89f8b87 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,97 +1,125 @@ import Database from "./database"; import Emittery from "emittery"; -import BlockManager from "./things/block-manager"; +import BlockManager, { Block } from "./things/block-manager"; import TransactionManager from "./things/transaction-manager"; import Trie from "merkle-patricia-tree"; import { BN } from "ethereumjs-util"; +import Account from "../../types/account"; +import { promisify } from "util"; +import { JsonRpcQuantity, JsonRpcData } from "../../types/json-rpc"; +import EthereumJsAccount from "ethereumjs-account"; + const VM = require("ethereumjs-vm"); export default class Blockchain extends Emittery { public blocks: BlockManager; public transactions: TransactionManager; - public vm: any; - public trie: Trie; + private vm: any; + private trie: Trie; + private readonly database: Database - constructor(hardfork: string, allowUnlimitedContractSize: boolean) { + /** + * Initializes the underlying Database and handles synchronization between + * the ledger and the database. + * + * Emits a `ready` event once the database and + * all dependencies are fully initialized. + * @param db + * @param dbPath + * @param accounts + * @param hardfork + * @param allowUnlimitedContractSize + * @param blockGasLimit + * @param timestamp + */ + constructor(db: string | object, dbPath: string, accounts: Account[], hardfork: string, allowUnlimitedContractSize: boolean, blockGasLimit: JsonRpcQuantity, timestamp: Date) { super(); - const db = new Database({}); - db.on("ready", () => { - this.blocks = new BlockManager(db); - this.transactions = new TransactionManager(db); + const database = this.database = new Database({db, dbPath}, this); + database.on("ready", async () => { + // TODO: get the latest block from the database + // if we have a latest block, `root` will be that block's header.stateRoot + // and we will skip creating the genesis block alltogether const root:any = null; - this.trie = new Trie(db.trie, root); + this.trie = new Trie(database.trie, root); + this.blocks = this.database.blocks; + this.transactions = this.database.transactions; - this.vm = new VM({ - state: this.trie, - activatePrecompiles: true, - hardfork, - allowUnlimitedContractSize, - blockchain: { - getBlock: async (number: BN, done) => { - const hash = await this.blockNumberToHash(number); + this._initializeVM(hardfork, allowUnlimitedContractSize); - hash(done); - } - } - }); - this.vm.on("step", this.emit.bind(this, "step")); + await this._initializeAccounts(accounts); + await this._initializeGenesisBlock(timestamp, blockGasLimit); this.emit("ready"); }); } + _initializeVM(hardfork: string, allowUnlimitedContractSize: boolean) { + this.vm = new VM({ + state: this.trie, + activatePrecompiles: true, + hardfork, + allowUnlimitedContractSize, + blockchain: { + getBlock: async (number: BN, done: any) => { + const hash = await this.blockNumberToHash(number); + done(this.blocks.get(hash)); + } + } + }); + this.vm.on("step", this.emit.bind(this, "step")); + } + + async _initializeAccounts(accounts: Account[]) : Promise{ + const stateManager = this.vm.stateManager; + const putAccount = promisify(stateManager.putAccount.bind(stateManager)); + const checkpoint = promisify(stateManager.checkpoint.bind(stateManager)) + const commit = promisify(stateManager.commit.bind(stateManager)) + await checkpoint(); + const pendingAccounts = accounts + .map(account => { + const ethereumJsAccount = new EthereumJsAccount(); + ethereumJsAccount.nonce = account.nonce.toBuffer(), + ethereumJsAccount.balance = account.balance.toBuffer() + return { + account: ethereumJsAccount, + address: account.address + } + }) + .map(account => putAccount(account.address.toString(), account.account)); + await Promise.all(pendingAccounts); + return commit(); + } + + async _initializeGenesisBlock(timestamp: Date, blockGasLimit: JsonRpcQuantity): Promise { + // create the genesis block + const genesis = this.blocks.next({ + // If we were given a timestamp, use it instead of the `currentTime` + timestamp: ((timestamp as any) / 1000 | 0) || this.currentTime(), + gasLimit: blockGasLimit.toBuffer(), + stateRoot: this.trie.root + }); + + // store the genesis block in the database + return this.blocks.set(genesis); + } + + currentTime() { + // Take the floor of the current time + return (Date.now() / 1000) | 0; + } + + /** + * Given a block number, find it's hash in the database + * @param number + */ blockNumberToHash(number: BN): Promise { - number.toString(); + return number.toString() as any; } -} -// BlockchainDouble.prototype.createVMFromStateTrie = function(state, activatePrecompiles) { -// const self = this; -// const vm = new VM({ -// state: state, -// blockchain: { -// // EthereumJS VM needs a blockchain object in order to get block information. -// // When calling getBlock() it will pass a number that's of a Buffer type. -// // Unfortunately, it uses a 64-character buffer (when converted to hex) to -// // represent block numbers as well as block hashes. Since it's very unlikely -// // any block number will get higher than the maximum safe Javascript integer, -// // we can convert this buffer to a number ahead of time before calling our -// // own getBlock(). If the conversion succeeds, we have a block number. -// // If it doesn't, we have a block hash. (Note: Our implementation accepts both.) -// getBlock: function(number, done) { -// try { -// number = to.number(number); -// } catch (e) { -// // Do nothing; must be a block hash. -// } - -// self.getBlock(number, done); -// } -// }, -// activatePrecompiles: activatePrecompiles || false, -// hardfork: self.options.hardfork, -// allowUnlimitedContractSize: self.options.allowUnlimitedContractSize -// }); - -// if (self.options.debug === true) { -// // log executed opcodes, including args as hex -// vm.on("step", function(info) { -// var name = info.opcode.name; -// var argsNum = info.opcode.in; -// if (argsNum) { -// var args = info.stack -// .slice(-argsNum) -// .map((arg) => to.hex(arg)) -// .join(" "); - -// self.logger.log(`${name} ${args}`); -// } else { -// self.logger.log(name); -// } -// }); -// } - -// return vm; -// }; \ No newline at end of file + async queueTransaction(transaction: any): Promise { + await this.transactions.push(transaction); + return JsonRpcData.from(transaction.hash()); + } +} diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index f2525b73cb..c7eb58e013 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -1,35 +1,53 @@ import Emittery from "emittery"; -const sub = require( "subleveldown"); import { dir } from "tmp-promise"; -const leveldown = require("leveldown"); import levelup from "levelup"; +import AccountManager from "./things/account-manager"; +import BlockManager from "./things/block-manager"; +import TransactionManager from "./things/transaction-manager"; +import Blockchain from "./blockchain"; +const leveldown = require("leveldown"); +const sub = require( "subleveldown"); const encode = require("encoding-down"); +type DatabaseOptions = {db: string | object, dbPath: string} + export default class Database extends Emittery{ - private readonly options: any; + private readonly blockchain: Blockchain; + private readonly options: DatabaseOptions; public directory: string = null; public db: levelup.LevelUp = null; + public blocks: BlockManager; + public accounts: AccountManager; public blockLogs: levelup.LevelUp; public blockHashes: levelup.LevelUp; - public transactions: levelup.LevelUp; + public transactions: TransactionManager; public transactionReceipts: levelup.LevelUp; public trie: levelup.LevelUp; public readonly initialized: boolean; - constructor(options: any) { + /** + * The Database handles the creation of the database, and all access to it. + * Once the database has been fully initialized it will emit a `ready` + * event. + * Emit's a `close` event once complete. + * @param options Supports one of two options: `db` (a leveldown compliant + * store instance) or `dbPath` (the path to store/read the db instance) + * @param blockchain + */ + constructor(options: DatabaseOptions, blockchain: Blockchain) { super(); this.options = options; + this.blockchain = blockchain; this._initialize(); } private async _initialize(){ const levelupOptions: any = { valueEncoding: "binary" }; - // delete levelupOptions.valueEncoding; const store = this.options.db; let db; if (store) { - db = await levelup(store, levelupOptions); + db = await levelup(store as any, levelupOptions); } else { - let directory = this.options.db_path; + let directory = this.options.dbPath; if (!directory) { directory = (await dir()).path; } @@ -39,30 +57,24 @@ export default class Database extends Emittery{ } const open = db.open(); - //const self = this; - - // Logs triggered in each block, keyed by block id (ids in the blocks array; not necessarily block number) (0-based) - //self.blockLogs = sub(db, "blockLogs", levelupOptions); - - // Block hashes -> block ids (ids in the blocks array; not necessarily block number) for quick lookup - //self.blockHashes = sub(db, "blockHashes", levelupOptions); - - // // Transaction hash -> transaction objects - // self.transactions = sub(db, "transactions", levelupOptions); - - // Transaction hash -> transaction receipts - //self.transactionReceipts = sub(db, "transactionReceipts", levelupOptions); - this.trie = sub(db, "trie", levelupOptions); this.db = db; await open; - this.emit("ready"); + this.blocks = new BlockManager(this); + this.transactions = new TransactionManager(this); + this.accounts = new AccountManager(this); + return this.emit("ready"); } + /** + * Gracefully close the database and wait for it to fully shut down. + * Emit's a `close` event once complete. + */ public async close() { const db = this.db; if (db && db.isOpen()) { - db.close(); + await db.close(); } + return this.emit("close"); } -} \ No newline at end of file +} diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index af77728127..60a69839c7 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,4 +1,4 @@ -import ILedger, {optionsSymbol as _options} from "../../interfaces/ledger"; +import ILedger from "../../interfaces/ledger"; import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options"; import {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcData} from "../../types/json-rpc"; import Blockchain from "./blockchain"; @@ -11,21 +11,37 @@ const createKeccakHash = require("keccak"); const hash = createKeccakHash("keccak256"); +const _options = Symbol("options"); const _coinbase = Symbol("coinbase"); const _isMining = Symbol("isMining"); const _blockchain = Symbol("blockchain"); +const _accounts = Symbol("accounts"); + export default class Ethereum implements ILedger { - readonly [_coinbase]: Account; - readonly [_options]: EthereumOptions; - private [_isMining]: boolean = false; + private readonly [_options]: EthereumOptions; + private readonly [_coinbase]: Account; private readonly [_blockchain]: Blockchain; + private [_isMining]: boolean = false; + /** + * This is the Ethereum ledger that the provider interacts with. + * The only methods permitted on the prototype are the supported json-rpc + * methods. + * @param options + * @param ready Callback for when the ledger is fully initialized + */ constructor(options: EthereumOptions, ready: () => {}) { - const tmpOptions = Object.assign(getDefaultEthereumOptions(), options); + const tmpOptions = this[_options] = Object.assign(getDefaultEthereumOptions(), options); this[_coinbase] = tmpOptions.accounts[0]; - this[_options] = tmpOptions; - const chain = new Blockchain(); - this[_blockchain] = chain; + const chain = this[_blockchain] = new Blockchain( + tmpOptions.db, + tmpOptions.dbPath, + tmpOptions.accounts, + tmpOptions.hardfork, + tmpOptions.allowUnlimitedContractSize, + tmpOptions.gasLimit, + tmpOptions.timestamp + ); chain.on("ready", ready); } @@ -202,4 +218,6 @@ function sync(target: any, name: any, descriptor: any) { descriptor.value = function(...args: any[]) { return method.apply(args); } + + readonly [index: string]: (...args: any) => Promise<{}>; } diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index bc9f474e01..17fc770026 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,10 +1,17 @@ -import LedgerOptions from "../../interfaces/ledger-options" -import {JsonRpcData} from "../../types/json-rpc"; +import ILedgerOptions from "../../interfaces/ledger-options" +import Account from "../../types/account"; +import { JsonRpcQuantity } from "../../types/json-rpc"; -interface EthereumOptions extends LedgerOptions { +type EthereumOptions = ILedgerOptions & { net_version: string, gasPrice?: bigint, - accounts: any[] + accounts: Account[], + allowUnlimitedContractSize: boolean, + hardfork: string, + gasLimit: JsonRpcQuantity, + timestamp?: Date, + db?: object, + dbPath?: string } export default EthereumOptions; diff --git a/src/ledgers/ethereum/things/account-manager.ts b/src/ledgers/ethereum/things/account-manager.ts new file mode 100644 index 0000000000..39139d4d22 --- /dev/null +++ b/src/ledgers/ethereum/things/account-manager.ts @@ -0,0 +1,24 @@ +import Database from "../database"; +import Account from "../../../types/account"; +import Address from "../../../types/address"; + +export default class AccountManager { + + private db: Database; + constructor(db: Database) { + this.db = db; + } + + public async get(address: Address, blockTag: string = "latest"): Promise { + const block = await this.db.blocks.get(blockTag); + // this.db.trie. + + // trie.get(utils.toBuffer(address), function(err, data) { + // // Finally, put the stateRoot back for good + // trie.root = currentStateRoot; + + // var account = new Account(data); + + return new Account(address); + } +} diff --git a/src/ledgers/ethereum/things/block-manager.ts b/src/ledgers/ethereum/things/block-manager.ts index 60f6297a88..d5d859fc13 100644 --- a/src/ledgers/ethereum/things/block-manager.ts +++ b/src/ledgers/ethereum/things/block-manager.ts @@ -1,12 +1,23 @@ import EthereumJsBlock from "ethereumjs-block"; import Database from "../database"; import Manager from "./manager"; +const Heap: any = require("heap") export default class BlockManager extends Manager { - // We cache these: + /** + * The earliest block + */ public earliest: Block; + + /** + * The latest block + */ public latest: Block; + + /** + * The next block + */ public pending: Block; constructor(db: Database) { @@ -17,6 +28,45 @@ export default class BlockManager extends Manager { // TODO: get the first last key, set as "latest" }); } + + /** + * Gets or creates the next block (which might be the *pending* block). Uses the values in the optional `header` object to create the block + * @param header The values to set on the block's header. These typically come from the parent block. + */ + next(header?: {}) { + if (!this.pending) { + this.pending = this.createBlock(header); + } + return this.pending; + } + + /** + * Creates a Block object with the specified header values + * @param header + */ + createBlock(header: {}): Block { + const block = new Block(null); + // TODO: make better + Object.assign(block.value.header, header); + return block; + } + + /** + * Writes the block object to the underlying database. + * @param block + */ + set(block: Block): Promise + set(key: string | Buffer, value: Buffer): Promise + set(keyOrBlock: string | Buffer | Block, value?: Buffer | Block): Promise { + let key: string | Buffer; + if (keyOrBlock instanceof Block){ + key = keyOrBlock.value.header.number; + value = keyOrBlock.value.serialize(true); + } else if (value instanceof Block) { + value = value.value.serialize(true); + } + return super.set(key, value); + } } export class Block { @@ -26,5 +76,43 @@ export class Block { { this.value = new EthereumJsBlock(raw); this.manager = manager; + // const byAddresses:any = {}; + // this._transactions.byPriceAndNonce = new Heap((a:any, b:any) => { + // let aAccountOrder = byAddresses[a.address]; + // let first = aAccountOrder.peek(); + // if (first === a) { + // // sort by gasPrice + // return a.gasPrice - b.gasPrice; + // } + // if (a.address === b.address) { + // return b.nonce - a.nonce; + // } else { + // // otherwise sort by gasPrice + // return a.gasPrice - b.gasPrice; + // } + // }); + // this.transactions = { + // push: (transaction: any) => { + // // get the first tx by account (via nonce) + // // then sort by price + // let addressHeap = byAddresses[transaction.address]; + // if (!addressHeap) { // to check for equality and then compare by gasPrice. + // addressHeap = new Heap((a:any, b:any) => { + // return b.nonce - a.nonce; + // }); + // byAddresses[transaction.address] = addressHeap; + // } + // addressHeap.push(transaction); + + // this.transactions.byPriceAndNonce.push(transaction); + + // } + // }; } + // _transactions: { + // byAddresses: any, + // byPriceAndNonce: any, + // } + // // TODO: https://ethereum.stackexchange.com/a/2809/44640 + // transactions: any } diff --git a/src/ledgers/ethereum/things/errors.ts b/src/ledgers/ethereum/things/errors.ts new file mode 100644 index 0000000000..b9c4133964 --- /dev/null +++ b/src/ledgers/ethereum/things/errors.ts @@ -0,0 +1,26 @@ +export default { + /** + * Returned if the transaction contains an invalid signature. + */ + INVALID_SENDER: "invalid sender", + + /** + * Returned if the nonce of a transaction is lower than the one present in the local chain. + */ + NONCE_TOO_LOW: "nonce too low", + + /** + * Returned if a transaction's gas price is below the minimum configured for the transaction pool. + */ + UNDERPRICED: "transaction underpriced", + + /** + * Returned if the transaction is specified to use less gas than required to start the invocation. + */ + INTRINSIC_GAS_TOO_LOW: "intrinsic gas too low", + + /** + * Returned if a transaction's requested gas limit exceeds the maximum allowance of the current block. + */ + GAS_LIMIT: "exceeds block gas limit" +}; \ No newline at end of file diff --git a/src/ledgers/ethereum/things/manager.ts b/src/ledgers/ethereum/things/manager.ts index 6c5afe06f2..278e53c4c9 100644 --- a/src/ledgers/ethereum/things/manager.ts +++ b/src/ledgers/ethereum/things/manager.ts @@ -14,10 +14,10 @@ export default class Manager { this.db = db; this.base = sub(db.db, name, levelupOptions); } - get(key: string): Promise { + get(key: string | Buffer): Promise { return this.base.get(key).then((raw) => new this.Type(raw)); } - set(key: string, value: Buffer): Promise { + set(key: string | Buffer, value: Buffer): Promise { return this.base.put(key, value).then((raw) => new this.Type(raw)); } } \ No newline at end of file diff --git a/src/ledgers/ethereum/things/promise-chain.ts b/src/ledgers/ethereum/things/promise-chain.ts deleted file mode 100644 index 65f9ed2c7f..0000000000 --- a/src/ledgers/ethereum/things/promise-chain.ts +++ /dev/null @@ -1,45 +0,0 @@ -// import {Executor, Instantiable} from "./manager"; -// import Database from "../database"; -// import Block from "ethereumjs-block"; - -// export default class PromiseChain implements PromiseLike { -// public value: U; -// protected db: Database -// constructor(pending: Promise, Type: Instantiable, db: Database) { -// pending.then((rawBlock) => { -// this.resolved = true; -// this.value = new Type(rawBlock); -// this.resolutions.forEach(r => r(this)); -// }); -// // super((resolve, reject) => { -// // // if we don't have a type then the arg1 -// // // must be an `executor` -// // if (!Type) { -// // return new Promise(arg1 as Executor); -// // } - -// // // If arg1 is a Promise, await teh result of the promise then construct our `Type` -// // // from the result -// // if (arg1 instanceof Promise) { -// // arg1.then((rawBlock) => { -// // //this.value = new Type(rawBlock); -// // //resolve(this); -// // }, reject); -// // // If arg1 is an executor, create a new Promise, await the result, then construct our `Type` -// // // from the result -// // } else if(typeof arg1 === "function") { -// // new Promise(arg1).then((result) => { -// // if (Buffer.isBuffer(result)){ -// // //this.value = new Type(result); -// // // resolve((function(){return this;})()); -// // } else { -// // resolve(result); -// // } -// // }, reject); -// // } else { -// // reject(new Error("Invalid arg passed to constuctor")); -// // } -// // }); -// this.db = db; -// } -// } \ No newline at end of file diff --git a/src/ledgers/ethereum/things/transaction-manager.ts b/src/ledgers/ethereum/things/transaction-manager.ts index 1f57f01eca..881694a646 100644 --- a/src/ledgers/ethereum/things/transaction-manager.ts +++ b/src/ledgers/ethereum/things/transaction-manager.ts @@ -1,20 +1,31 @@ -import _Transaction from "../../../types/transaction"; - +import Transaction from "../../../types/transaction"; import Database from "../database"; import Manager from "./manager"; +import TransactionPool from "./transaction-pool"; export default class TransactionManager extends Manager { + public transactionPool: TransactionPool; + constructor(db: Database) { super(db, Transaction, "transactions"); + + this.transactionPool = new TransactionPool(db); + this.transactionPool.on("drain", (transactions: any[]) => { + transactions + }) } -} -export class Transaction { - private readonly manager: TransactionManager; - public readonly value: _Transaction; - constructor(raw: Buffer, manager?: TransactionManager) { - // todo: make _Transaction take the raw Buffer - this.value = new _Transaction(/*raw*/); - this.manager = manager; + public push(transaction: Transaction): Promise { + return this.transactionPool.insert(transaction); } } + +// export class Transaction { +// private readonly manager: TransactionManager; +// public readonly value: _Transaction; +// constructor(raw: Buffer, manager?: TransactionManager) { +// // todo: make _Transaction take the raw Buffer +// this.value = new _Transaction(/*raw*/); +// this.manager = manager; +// } +// } diff --git a/src/ledgers/ethereum/things/transaction-pool.ts b/src/ledgers/ethereum/things/transaction-pool.ts new file mode 100644 index 0000000000..95b869371b --- /dev/null +++ b/src/ledgers/ethereum/things/transaction-pool.ts @@ -0,0 +1,205 @@ +import Emittery from "emittery"; +import Database from "../database"; +import Errors from "./errors"; +import Heap from "../../../utils/heap"; +import Transaction from "../../../types/transaction"; + +// OLD insertion sort: +// function siftUp(comparator: (a:T, b:T) => boolean, array: T[], value: T, startingIndex = 0, endingIndex = array.length) { +// let i = startingIndex; +// for (; i < endingIndex; i++) { +// if (!comparator(value, array[i])) break; +// } +// array.splice(i, 0, value); +// return i; +// } + +function byNonce(values: Transaction[], a: number, b: number) { + return values[b].nonce.toBigInt() < values[a].nonce.toBigInt(); +} + +const params = { + /** + * Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. + */ + TRANSACTION_GAS: 21000n, + + /** + * Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. + */ + TRANSACTION_DATA_NON_ZERO_GAS: 68n, + /** + * Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. + */ + TRANSACTION_DATA_ZERO_GAS: 4n +} + +const MAX_UINT64 = (1n<<64n) - 1n; +/** + * Compute the 'intrinsic gas' for a message with the given data. + * @param data The transaction's data + */ +function calculateIntrinsicGas(data: Buffer): bigint { + // Set the starting gas for the raw transaction + let gas = params.TRANSACTION_GAS; + + // Bump the required gas by the amount of transactional data + const dataLength = data.byteLength; + if (dataLength > 0) { + // Zero and non-zero bytes are priced differently + let nonZeroBytes: bigint = 0n; + for (const b of data) { + if (b !== 0) { + nonZeroBytes++ + } + } + // Make sure we don't exceed uint64 for all data combinations. This + if ((MAX_UINT64 - gas) / params.TRANSACTION_DATA_NON_ZERO_GAS < nonZeroBytes) { + throw new Error(Errors.INTRINSIC_GAS_TOO_LOW); + } + gas += nonZeroBytes * params.TRANSACTION_DATA_NON_ZERO_GAS; + + let z = BigInt(dataLength) - nonZeroBytes; + if ( (MAX_UINT64 - gas) / params.TRANSACTION_DATA_ZERO_GAS < z) { + throw new Error(Errors.INTRINSIC_GAS_TOO_LOW); + } + gas += z * params.TRANSACTION_DATA_ZERO_GAS; + } + return gas; +} + +export default class TransactionPool extends Emittery { + /** + * Minimum gas price to enforce for acceptance into the pool + */ + public priceLimit: number = 1 + + /** + * Minimum price bump percentage to replace an already existing transaction (nonce) + */ + public priceBump: number = 10 + + /** + * Number of executable transaction slots guaranteed per account + */ + public accountSlots: number = 16 + + /** + * Maximum number of executable transaction slots for all accounts + */ + public globalSlots: number = 4096 + + /** + * Maximum number of non-executable transaction slots permitted per account + */ + public accountQueue: number = 64 + + /** + * Maximum number of non-executable transaction slots for all accounts + */ + public globalQueue: number = 1024 + + /** + * Maximum amount of time non-executable transaction are queued, in milliseconds + */ + public lifetime: number = 3 * 24 * 60 * 60 * 1000 + + private db: Database; + constructor(db: Database) { + super(); + this.db = db; + } + public length: number; + private hashes = new Set(); + private pending: Map> = new Map(); + private origins: Map> = new Map(); + + public async insert(transaction: Transaction) { + const hash = transaction.hash().toString(); + + // if this transaction is a duplicate, discard it + if (this.hashes.has(hash)) { + throw new Error(`known transaction: ${hash}`); + } + + const err = await this.validateTransaction(transaction); + if (err != null) { + throw err; + } + + const origin = transaction.from.toString(); + const orgins = this.origins; + let pendingOriginTransactions = orgins.get(origin); + + // TODO: If the transaction pool is full, discard underpriced transactions + if (this.length >= this.globalSlots + this.globalQueue) { + // TODO: If the new transaction is underpriced, don't accept it + // TODO: if the new transaction is better than our worse one, make + // room for it by discarding a cheaper transaction + } + // TODO: if the transaction is replacing an already pending transaction, + // do it now... + // a transaction can replace a *pending* transaction if the new tx's + // nonce matches the pending nonce + // AND the new tx's gasPrice is `this.priceBump` greater than the + // pending tx's. + // Also, if a transaction is at the correct `nonce` it is executable. + // we need to pull out the origin's transactions that are now executable + // from the `pendingOriginTransactions`, if it is available + // if (stuff) { + // this.pending ... + // return; + // } + + + // TODO: if we got here we have a transaction that *isn't* executable + // insert the transaction in its origin's (i.e., the `from` address's) + // Heap, which sorts by nonce + + if (!pendingOriginTransactions) { + pendingOriginTransactions = new Heap(byNonce); + pendingOriginTransactions.array = [transaction]; + pendingOriginTransactions.length = 1; + orgins.set(origin, pendingOriginTransactions); + } else { + pendingOriginTransactions.insert(transaction); + } + } + + public async validateTransaction(transaction: Transaction): Promise { + // // TODO: Check the transaction doesn't exceed the current block limit gas. + // if (this.blockchain.gasLimit < transaction.gasLimit) { + // return new Error("Transaction gasLimit is too low"); + // } + + // Transactions can't be negative. This may never happen using RLP + // decoded transactions but may occur if you create a transaction using + // the RPC for example. + // if (transaction.value.toBigInt() < 0) { + // return new Error("Transaction value cannot be negative"); + // } + + // Should supply enough intrinsic gas + // const gas = calculateIntrinsicGas(transaction.input.toBuffer()); + // if (transaction.gasPrice.toBigInt() < gas) { + // return new Error("intrisic gas too low"); + // } + + const from = transaction.from; + // todo: get the origin account + // const originAccount = await this.db.accounts.get(from); + + // TODO: Transactor should have enough funds to cover the costs + // cost == V + GP * GL + // if (originAccount.balance.toBigInt() < transaction.cost()) { + // return new Error("Account does not have enough funds to complete transaction"); + // } + + // TODO: check that the nonce isn't too low + + // if ( currentaccount.nonce.toBigInt() > transaction.nonce.toBigInt()) { + // return new Error("Transaction nonce is too low"); + // } + return null; + } +} \ No newline at end of file diff --git a/src/options/options.ts b/src/options/options.ts index c975c9a1e7..b1b9817fbd 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -133,6 +133,8 @@ export default interface Options { * */ asyncRequestProcessing?: boolean, + + hardfork?: "constantinople" | "byzantium" | "petersburg" }; export const getDefault: (options: Options)=> Options = (options) => { @@ -146,10 +148,11 @@ export const getDefault: (options: Options)=> Options = (options) => { locked: false, vmErrorsOnRPCResponse: true, hdPath: "m/44'/60'/0'/0/", - allowUnlimitedContractSize: true, + allowUnlimitedContractSize: false, gasPrice: new JsonRpcQuantity("0x77359400"), gasLimit: new JsonRpcQuantity("0x6691b7"), verbose: false, - asyncRequestProcessing: false + asyncRequestProcessing: false, + hardfork: "petersburg" }, options); } diff --git a/src/provider.ts b/src/provider.ts index 2eca4960eb..082f0d468a 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -45,10 +45,17 @@ export default class Provider extends Emittery { const accounts = this.initializeAccounts(); const net_version = _providerOptions.network_id.toString(); - const _engine = this[engine] = new Engine(_providerOptions.ledger || new Ethereum({ + const ledger = _providerOptions.ledger || new Ethereum({ + db: _providerOptions.db, + dbPath: _providerOptions.db_path, net_version, - accounts - }, _requestProcessor.resume.bind(_requestProcessor))); + accounts, + allowUnlimitedContractSize: _providerOptions.allowUnlimitedContractSize, + hardfork: _providerOptions.hardfork, + gasLimit: _providerOptions.gasLimit, + timestamp: _providerOptions.time + }, _requestProcessor.resume.bind(_requestProcessor)); + this[engine] = new Engine(ledger); } private initializeAccounts(): Account[]{ diff --git a/src/types/account.ts b/src/types/account.ts index 7da45479ad..a344fcfe9c 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -1,10 +1,14 @@ import { JsonRpcData, JsonRpcQuantity } from "./json-rpc"; import Address from "./address"; +import { rlp, KECCAK256_RLP, KECCAK256_NULL } from "ethereumjs-util"; export default class Account { public address: Address; public balance: JsonRpcQuantity = new JsonRpcQuantity(0n); public privateKey: JsonRpcData; + public nonce: JsonRpcQuantity = new JsonRpcQuantity(0n); + public stateRoot: Buffer = KECCAK256_RLP; + public codeHash: Buffer = KECCAK256_NULL; constructor(address: Address) constructor(buffer: Buffer) @@ -13,4 +17,7 @@ export default class Account { this.address = arg; } } + public serialize() { + return rlp.encode(Buffer.from([this.nonce, this.balance, this.stateRoot, this.codeHash])); + } } diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index a9018edfe9..009d59aaeb 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -1,14 +1,16 @@ -export type IndexableJsonRpcType = string & { +export type IndexableJsonRpcType = string & { new(value: T): IndexableJsonRpcType, toString(): string } export const strCache = new WeakMap(); +export const bufCache = new WeakMap(); export const toStrings = new WeakMap(); +export const toBuffers = new WeakMap(); const inspect = Symbol.for('nodejs.util.inspect.custom'); -export class BaseJsonRpcType { +export class BaseJsonRpcType { protected value: T; // used to make console.log debugging a little easier private [inspect](depth: number, options: any):T { @@ -16,35 +18,58 @@ export class BaseJsonRpcType string; if (Buffer.isBuffer(value)) { - toString = value.toString.bind(value, "hex"); + toStrings.set(this, () => value.toString("hex")); + bufCache.set(this, value); self[Symbol.toStringTag] = "Buffer"; } else { const type = typeof value; switch (type) { + case "number": + toStrings.set(this, () => (value as number).toString(16)); + toBuffers.set(this, () => { + const arr = new ArrayBuffer(4); + const view = new DataView(arr); + view.setInt32(0, value as number); + return Buffer.from(arr); + }); + break; case "bigint": - toString = value.toString.bind(value, 16); + toStrings.set(this, () => (value as bigint).toString(16)); + toBuffers.set(this, () => { + const arr = new ArrayBuffer(8); + const view = new DataView(arr); + view.setBigUint64(0, value as bigint); + return Buffer.from(arr); + }); break; case "string": { - toString = () => { - if ((value as string).indexOf("0x") === 0) { - return (value as string).slice(2); - } else { - const buf = Buffer.from(value as string); + // handle hex-encoded string + if ((value as string).indexOf("0x") === 0) { + strCache.set(this, value); + toBuffers.set(this, () => Buffer.from((value as string).slice(2), "hex")); + } else { + // handle a string + toStrings.set(this, () => { + const buf = this.toBuffer(); return buf.toString("hex"); - } + }); + toBuffers.set(this, () => Buffer.from(value as string)); } break; } + case "undefined": { + strCache.set(this, value); + bufCache.set(this, Buffer.from([])); + break; + } default: - throw new Error(`Cannot create a ${typeof value} as a HexData`); + throw new Error(`Cannot wrap a "${type}" as a json-rpc type`); } self[Symbol.toStringTag] = type; } this.value = value; - toStrings.set(this, toString); } toString(): string { @@ -56,7 +81,12 @@ export class BaseJsonRpcType = BaseJsonRpcType & IndexableJsonRpcType; +export type JsonRpcType = BaseJsonRpcType & IndexableJsonRpcType; diff --git a/src/types/json-rpc/json-rpc-data.ts b/src/types/json-rpc/json-rpc-data.ts index 34c8b6a0cd..bcb794d1da 100644 --- a/src/types/json-rpc/json-rpc-data.ts +++ b/src/types/json-rpc/json-rpc-data.ts @@ -13,7 +13,7 @@ export class JsonRpcData extends BaseJsonRpcType { throw new Error(`Cannot create a ${typeof value} as a JsonRpcData`); } super(value); - if(byteLength !== undefined){ + if (byteLength !== undefined) { validateByteLength(byteLength); byteLengths.set(this, byteLength | 0); } @@ -56,14 +56,16 @@ export class JsonRpcData extends BaseJsonRpcType { type $ = { new(value: T, byteLength?: number): _JsonRpcData & JsonRpcType, from(value: T, byteLength?: number): _JsonRpcData & JsonRpcType, - toString(byteLength?: number): string + toString(byteLength?: number): string, + toBuffer(): Buffer } const _JsonRpcData = JsonRpcData as $; interface _JsonRpcData { constructor(value: T, byteLength?: number): _JsonRpcData from(value: T, byteLength?: number): _JsonRpcData, - toString(byteLength?: number): string + toString(byteLength?: number): string, + toBuffer(): Buffer } export type IndexableJsonRpcData = _JsonRpcData & IndexableJsonRpcType; diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index f36ba6865b..0ba18eddaa 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -1,24 +1,26 @@ import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; class JsonRpcQuantity extends BaseJsonRpcType { - public static from(value: bigint | string | Buffer) { + public static from(value: number | bigint | string | Buffer) { return new _JsonRpcQuantity(value); } public toBigInt(): bigint { return BigInt(this.value); } } -type $ = { +type $ = { new(value: T): _JsonRpcQuantity & JsonRpcType, from(value: T): _JsonRpcQuantity & JsonRpcType, - toBigInt(): bigint + toBigInt(): bigint, + toBuffer(): Buffer } const _JsonRpcQuantity = JsonRpcQuantity as $; -interface _JsonRpcQuantity { +interface _JsonRpcQuantity { constructor(value: T): _JsonRpcQuantity from(): _JsonRpcQuantity, - toBigInt(): bigint + toBigInt(): bigint, + toBuffer(): Buffer } export type IndexableJsonRpcQuantity = _JsonRpcQuantity & IndexableJsonRpcType; diff --git a/src/types/transaction.ts b/src/types/transaction.ts index ad7ddfa812..e9c9501fc3 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -1,85 +1,456 @@ -import { JsonRpcData, JsonRpcQuantity } from "./json-rpc"; -import Address from "./address"; - -type TransactionDataObject = { - blockHash: string, - blockNumber: string, - from: string, - gas: string, - gasPrice: string, - hash: string, - input: string, - nonce: string, - to: string, - transactionIndex: string, - value: string, - v: string, - r: string, - s: string +import { JsonRpcData } from "./json-rpc/json-rpc-data"; +import { JsonRpcQuantity } from "./json-rpc"; + +// import { JsonRpcData, JsonRpcQuantity } from "./json-rpc"; +// import Address from "./address"; + +// type TransactionDataObject = { +// blockHash: string, +// blockNumber: string, +// from: string, +// gas: string, +// gasPrice: string, +// hash: string, +// input: string, +// nonce: string, +// to: string, +// transactionIndex: string, +// value: string, +// v: string, +// r: string, +// s: string +// } + +// type TransactionData = { +// blockHash: JsonRpcData, +// blockNumber: JsonRpcData, +// from: Address, +// gas: JsonRpcQuantity, +// gasPrice: JsonRpcQuantity, +// hash: JsonRpcData, +// input: JsonRpcData, +// nonce: JsonRpcQuantity, +// to: Address, +// transactionIndex: JsonRpcQuantity, +// value: JsonRpcQuantity, +// v: JsonRpcQuantity, +// r: JsonRpcData, +// s: JsonRpcData +// } + +// export default class Transaction implements TransactionData { +// blockHash: JsonRpcData; +// blockNumber: JsonRpcData; +// from: JsonRpcData; +// gas: JsonRpcQuantity; +// gasPrice: JsonRpcQuantity; +// get hash(): JsonRpcData { +// return new JsonRpcData("0x123"); +// }; +// input: JsonRpcData; +// nonce: JsonRpcQuantity; +// to: JsonRpcData; +// transactionIndex: JsonRpcQuantity; +// value: JsonRpcQuantity; +// v: JsonRpcQuantity; +// r: JsonRpcData; +// s: JsonRpcData; +// constructor(transaction: TransactionData) { +// const obj = { +// blockHash: JsonRpcData.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. +// blockNumber: JsonRpcQuantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. +// from: JsonRpcData.from("0x123456", 32), // 20 Bytes - address of the sender. +// gas: JsonRpcQuantity.from(123n),// QUANTITY - gas provided by the sender. +// gasPrice: JsonRpcQuantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. +// hash: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. +// input: JsonRpcData.from("0x123"),// DATA - the data send along with the transaction. +// nonce: JsonRpcQuantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. +// to: JsonRpcData.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. +// transactionIndex: JsonRpcQuantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. +// value: JsonRpcQuantity.from(123n),// QUANTITY - value transferred in Wei. +// v: JsonRpcQuantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id +// r: JsonRpcData.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r +// s: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s +// } as any; +// Object.keys(obj).forEach((key) => { +// (this as any)[key] = obj[key] as any; +// }); +// } +// // https://github.com/fastify/fast-json-stringify +// // https://github.com/YousefED/typescript-json-schema +// toObject(): TransactionDataObject { +// const a = JSON.stringify({ +// gasPrice: this.gasPrice +// }); +// console.log(a); +// return { +// gasPrice: this.gasPrice.toString() +// } as TransactionDataObject; +// } +// /** +// * +// * @param tx Cost returns gasPrice * gas + value. +// */ +// cost(): bigint { +// return this.gasPrice.toBigInt() * this.gas.toBigInt() + this.value.toBigInt(); +// } +// } + + + + +const EthereumJsTransaction = require("ethereumjs-tx"); +const EthereumJsFakeTransaction = require("ethereumjs-tx/fake"); +const ethUtil = require("ethereumjs-util"); +const assert = require("assert"); +const rlp = require("rlp"); + +const sign = EthereumJsTransaction.prototype.sign; +const fakeHash = function() { + // this isn't memoization of the hash. previous versions of ganache-core + // created hashes in a different/incorrect way and are recorded this way + // in snapshot dbs. We are preserving the chain's immutability by using the + // stored hash instead of calculating it. + if (this._hash != null) { + return this._hash; + } + return EthereumJsFakeTransaction.prototype.hash.apply(this, arguments); +}; +const BUFFER_ZERO = Buffer.from([0]); + +function configZeroableField(tx: any, fieldName: string, fieldLength = 32) { + const index = tx._fields.indexOf(fieldName); + const descriptor = Object.getOwnPropertyDescriptor(tx, fieldName); + // eslint-disable-next-line accessor-pairs + Object.defineProperty(tx, fieldName, { + set: (v) => { + descriptor.set.call(tx, v); + v = ethUtil.toBuffer(v); + assert(fieldLength >= v.length, `The field ${fieldName} must not have more ${fieldLength} bytes`); + tx._originals[index] = v; + }, + get: () => { + return tx._originals[index]; + } + }); } -type TransactionData = { - blockHash: JsonRpcData, - blockNumber: JsonRpcData, - from: Address, - gas: JsonRpcQuantity, - gasPrice: JsonRpcQuantity, - hash: JsonRpcData, - input: JsonRpcData, - nonce: JsonRpcQuantity, - to: Address, - transactionIndex: JsonRpcQuantity, - value: JsonRpcQuantity, - v: JsonRpcQuantity, - r: JsonRpcData, - s: JsonRpcData +/** + * etheruemjs-tx's Transactions don't behave quite like we need them to, so + * we're monkey-patching them to do what we want here. + * @param {Transaction} tx The Transaction to fix + * @param {Object} [data] The data object + */ +function fixProps(tx: any, data: any) { + // ethereumjs-tx doesn't allow for a `0` value in fields, but we want it to + // in order to differentiate between a value that isn't set and a value + // that is set to 0 in a fake transaction. + // Once https://github.com/ethereumjs/ethereumjs-tx/issues/112 is figured + // out we can probably remove this fix/hack. + // We keep track of the original value and return that value when + // referenced by its property name. This lets us properly encode a `0` as + // an empty buffer while still being able to differentiate between a `0` + // and `null`/`undefined`. + tx._originals = []; + const fieldNames = ["nonce", "gasPrice", "gasLimit", "value"]; + fieldNames.forEach((fieldName) => configZeroableField(tx, fieldName, 32)); + + // Ethereumjs-tx doesn't set the _chainId value whenever the v value is set, + // which causes transaction signing to fail on transactions that include a + // chain id in the v value (like ethers.js does). + // Whenever the v value changes we need to make sure the chainId is also set. + const vDescriptors = Object.getOwnPropertyDescriptor(tx, "v"); + // eslint-disable-next-line accessor-pairs + Object.defineProperty(tx, "v", { + set: (v) => { + vDescriptors.set.call(tx, v); + // calculate chainId from signature + const sigV = ethUtil.bufferToInt(tx.v); + let chainId = Math.floor((sigV - 35) / 2); + if (chainId < 0) { + chainId = 0; + } + tx._chainId = chainId || 0; + } + }); + + if (tx.isFake()) { + /** + * @prop {Buffer} from (read/write) Set from address to bypass transaction + * signing on fake transactions. + */ + Object.defineProperty(tx, "from", { + enumerable: true, + configurable: true, + get: tx.getSenderAddress.bind(tx), + set: (val) => { + if (val) { + tx._from = ethUtil.toBuffer(val); + } else { + tx._from = null; + } + } + }); + + if (data && data.from) { + tx.from = data.from; + } + + tx.hash = fakeHash; + } } -export default class Transaction implements TransactionData{ - blockHash: JsonRpcData; - blockNumber: JsonRpcData; - from: JsonRpcData; - gas: JsonRpcQuantity; - gasPrice: JsonRpcQuantity; - hash: JsonRpcData; - input: JsonRpcData; - nonce: JsonRpcQuantity; - to: JsonRpcData; - transactionIndex: JsonRpcQuantity; - value: JsonRpcQuantity; - v: JsonRpcQuantity; - r: JsonRpcData; - s: JsonRpcData; - constructor() { - const obj = { - blockHash: JsonRpcData.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. - blockNumber: JsonRpcQuantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. - from: JsonRpcData.from("0x123456", 32), // 20 Bytes - address of the sender. - gas: JsonRpcQuantity.from(123n),// QUANTITY - gas provided by the sender. - gasPrice: JsonRpcQuantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. - hash: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. - input: JsonRpcData.from("0x123"),// DATA - the data send along with the transaction. - nonce: JsonRpcQuantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. - to: JsonRpcData.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. - transactionIndex: JsonRpcQuantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. - value: JsonRpcQuantity.from(123n),// QUANTITY - value transferred in Wei. - v: JsonRpcQuantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id - r: JsonRpcData.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r - s: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s - } as any; - Object.keys(obj).forEach((key) => { - (this as any)[key] = obj[key] as any; - }); +/** + * Parses the given data object and adds its properties to the given tx. + * @param {Transaction} tx + * @param {Object} [data] + */ +function initData(tx: any, data: any) { + if (data) { + if (typeof data === "string") { + data = JsonRpcData.from(data).toBuffer(); + data = rlp.decode(data); + } else if (Buffer.isBuffer(data)) { + data = rlp.decode(data); } - // https://github.com/fastify/fast-json-stringify - // https://github.com/YousefED/typescript-json-schema - toObject(): TransactionDataObject { - const a = JSON.stringify({ - gasPrice: this.gasPrice - }); - console.log(a); - return { - gasPrice: this.gasPrice.toString() - } as TransactionDataObject; + const self = tx; + if (Array.isArray(data)) { + if (data.length > tx._fields.length) { + throw new Error("wrong number of fields in data"); + } + + // make sure all the items are buffers + data.forEach((d, i) => { + self[self._fields[i]] = ethUtil.toBuffer(d); + }); + } else if ((typeof data === "undefined" ? "undefined" : typeof data) === "object") { + const keys = Object.keys(data); + tx._fields.forEach((field: any) => { + if (keys.indexOf(field) !== -1) { + self[field] = data[field]; + } + if (field === "gasLimit") { + if (keys.indexOf("gas") !== -1) { + self["gas"] = data["gas"]; + } + } else if (field === "data") { + if (keys.indexOf("input") !== -1) { + self["input"] = data["input"]; + } + } + }); + + // Set chainId value from the data, if it's there and the data didn't + // contain a `v` value with chainId in it already. If we do have a + // data.chainId value let's set the interval v value to it. + if (!tx._chainId && data && data.chainId != null) { + tx.raw[self._fields.indexOf("v")] = tx._chainId = data.chainId || 0; + } + } else { + throw new Error("invalid data"); } -} \ No newline at end of file + } +} + +export default class Transaction extends EthereumJsTransaction { + /** + * @param {Object} [data] The data for this Transaction. + * @param {Number} type The `Transaction.types` bit flag for this transaction + * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. + */ + constructor(data: any, type = Transaction.types.none) { + super(); + + this.type = type; + + fixProps(this, data); + initData(this, data); + } + + static get types() { + // values must be powers of 2 + return { + none: 0, + signed: 1, + fake: 2 + }; + } + + /** + * Prepares arbitrary JSON data for use in a Transaction. + * @param {Object} json JSON object representing the Transaction + * @param {Number} type The `Transaction.types` bit flag for this transaction + * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. + */ + static fromJSON(json: any, type: any) { + let toAccount; + if (json.to) { + // Remove all padding and make it easily comparible. + const buf = JsonRpcData.from(json.to).toBuffer(); + + if (buf.equals(BUFFER_ZERO)) { + // if the address is 0x0 make it 0x0{20} + toAccount = ethUtil.setLengthLeft(buf, 20); + } else { + toAccount = buf; + } + } + const data = json.data || json.input; + const options = { + nonce: JsonRpcData.from(json.nonce).toBuffer(), + from: JsonRpcData.from(json.from).toBuffer(), + value: JsonRpcQuantity.from(json.value).toBuffer(), + gasLimit: JsonRpcQuantity.from(json.gas || json.gasLimit).toBuffer(), + gasPrice: JsonRpcQuantity.from(json.gasPrice).toBuffer(), + data: data ? JsonRpcData.from(data).toBuffer() : null, + to: toAccount, + v: JsonRpcData.from(json.v).toBuffer(), + r: JsonRpcData.from(json.r).toBuffer(), + s: JsonRpcData.from(json.s).toBuffer() + }; + + const tx = new Transaction(options, type); + tx._hash = json.hash ? JsonRpcData.from(json.hash).toBuffer() : null; + return tx; + } + + /** + * Encodes the Transaction in order to be used in a database. Can be decoded + * into an identical Transaction via `Transaction.decode(encodedTx)`. + */ + encode() { + const resultJSON = { + hash: JsonRpcData.from(this.hash()).toString(), + nonce: JsonRpcQuantity.from(this.nonce).toString() || "0x", + from: JsonRpcData.from(this.from).toString(), + to: JsonRpcData.from(this.to).toString(), + value: JsonRpcQuantity.from(this.value).toString(), + gas: JsonRpcQuantity.from(this.gasLimit).toString(), + gasPrice: JsonRpcQuantity.from(this.gasPrice).toString(), + data: this.data ? this.data.toString("hex") : null, + v: JsonRpcData.from(this.v).toString(), + r: JsonRpcData.from(this.r).toString(), + s: JsonRpcData.from(this.s).toString(), + _type: this.type + }; + return resultJSON; + } + + isFake() { + return (this.type & Transaction.types.fake) === Transaction.types.fake; + } + + isSigned() { + return (this.type & Transaction.types.signed) === Transaction.types.signed; + } + + /** + * Compares the transaction's nonce value to the given expectedNonce taking in + * to account the type of transaction and comparison rules for each type. + * + * In a signed transaction a nonce of Buffer([]) is the same as Buffer([0]), + * but in a fake transaction Buffer([]) is null and Buffer([0]) is 0. + * + * @param {Buffer} expectedNonce The value of the from account's next nonce. + */ + validateNonce(expectedNonce: any) { + let nonce; + if (this.isSigned() && this.nonce.length === 0) { + nonce = BUFFER_ZERO; + } else { + nonce = this.nonce; + } + return nonce.equals(expectedNonce); + } + + /** + * Signs the transaction and sets the `type` bit for `signed` to 1, + * i.e., `isSigned() === true` + */ + sign() { + sign.apply(this, arguments); + this.type |= Transaction.types.signed; + } + + /** + * Returns a JSON-RPC spec compliant representation of this Transaction. + * + * @param {Object} block The block this Transaction appears in. + */ + toJsonRpc(block: any) { + const hash = this.hash(); + + let transactionIndex = null; + for (let i = 0, txns = block.transactions, l = txns.length; i < l; i++) { + if (txns[i].hash().equals(hash)) { + transactionIndex = i; + break; + } + } + + const resultJSON = { + hash: JsonRpcData.from(hash).toString(), + nonce: JsonRpcQuantity.from(this.nonce).toString(), + blockHash: JsonRpcData.from(block.hash()).toString(), + blockNumber: JsonRpcData.from(block.header.number).toString(), + transactionIndex: JsonRpcQuantity.from(BigInt(transactionIndex)).toString(), + from: JsonRpcData.from(this.from).toString(), + to: JsonRpcData.from(this.to).toString(), + value: JsonRpcQuantity.from(this.value).toString(), + gas: JsonRpcQuantity.from(this.gasLimit).toString(), + gasPrice: JsonRpcQuantity.from(this.gasPrice).toString(), + input: JsonRpcData.from(this.data).toString(), // TODO: this output format probably needs the 0x stripped. + v: JsonRpcData.from(this.v).toString(), + r: JsonRpcData.from(this.r).toString(), + s: JsonRpcData.from(this.s).toString() + }; + + return resultJSON; + } + + /** + * Computes a sha3-256 hash of the serialized tx + * + * This method is nearly identical to ethereumjs-tx hash with the exception of + * the v,r,s value setting when _chainId > 0. Because the `_chainId` in our + * implementation is calculated whenever the v is updated we have to make sure + * we don't recalc the chainId when we set the v to soemthing else. + * + * Note: If the transaction is a fake transaction this hash method gets + * overridden in the constructor. + * + * @param {Boolean} [includeSignature=true] whether or not to inculde the signature + * @return {Buffer} + */ + hash(includeSignature = true) { + // EIP155 spec: + // when computing the hash of a transaction for purposes of signing or recovering, + // instead of hashing only the first six elements (ie. nonce, gasprice, startgas, to, value, data), + // hash nine elements, with v replaced by CHAIN_ID, r = 0 and s = 0 + + let items; + if (includeSignature) { + items = this.raw; + } else { + // cache the chainId here + const chainId = this._chainId; + if (chainId > 0) { + const cacheRaw = this.raw.slice(); + // Setting `this.v` changes the value of `this._chainId` + this.v = chainId; + this.r = 0; + this.s = 0; + + items = this.raw; + this.raw = cacheRaw; + // set the chainId back to its original value here. + this._chainId = chainId; + } else { + items = this.raw.slice(0, 6); + } + } + + // create hash + return ethUtil.rlphash(items); + } +}; diff --git a/src/utils/heap.ts b/src/utils/heap.ts new file mode 100644 index 0000000000..ca8e607422 --- /dev/null +++ b/src/utils/heap.ts @@ -0,0 +1,187 @@ +import { updateArrayBindingPattern } from "typescript"; + +type Comparator = (values: T[], a: number, b: number) => boolean; +class Heap { + public best: number = 0; + public length: number; + public array: T[]; + protected readonly less: Comparator; + + /** + * @param size the size of the heap + * @param less the comparator function + */ + constructor(less: Comparator) { + this.less = less; + } + + public init(values: T[]) { + this.array = values; + const l = this.length = values.length; + for (let i = ((l / 2) | 0) - 1; i >= 0;) { + this.down(i--, l); + } + } + + /** + * + * @param value + */ + public insert(value: T) { + const i = this.length++; + this.array[i] = value; + this.up(i, this.best); + } + + public size() { + return this.length - this.best; + } + + /** + * Return the current best element. Do not remove it + */ + public peek(): T { + return this.array[this.best]; + } + + /** + * Remove the current best element + * @param map + */ + public shift() { + // TODO: fix the tree as the best is not neccessarily at best++ + this.best++; + } + + /** + * Removes the last element + */ + public pop() { + this.length--; + } + + public replaceBest(newValue: T) { + const i = this.best; + this.array[i] = newValue; + this.fix(i); + } + + public fix(i: number) { + if (!this.down(i, this.length)) { + this.up(i, this.best); + } + } + + private up(j: number, best: number) { + const values = this.array; + const less = this.less.bind(null, values); + for (let i: number; ((i = (j - 1) / 2 | 0 + best), i !== j && less(j, i)); j = i) { + this.swap(i, j); + } + } + private down(i0: number, l: number): boolean { + const values = this.array; + let i = i0; + for (let j1: number; (j1 = 2 * i + 1) < l;) { + let j = j1; // left child + let j2 = j1 + 1; + if (j2 < l && this.less(values, j2, j1)) { + j = j2; // = 2 * i + 2 // right child + } + if (!this.less(values, j, i)) { + break; + } + this.swap(i, j); + i = j; + } + return i > i0; + } + + private swap(i: number, j: number) { + const values = this.array; + [values[j], values[i]] = [values[i], values[j]]; + } +} + +// type HeapHeapMap> = {heap: U, value: T}; + +// export class HeapHeap = Heap, V extends HeapHeapMap = HeapHeapMap> extends Heap { +// // public insert(value: V) +// // public insert(value: U) +// // public insert(value: U | V) { +// // super.insert({ +// // value: (value as U).peek(), +// // heap: this +// // } as any); +// // } +// public peek(): V +// public peek(): T +// public peek(): T | V { +// const best = super.peek(); +// return best.value as T; +// } +// public shift() { +// const heap = super.peek().heap; +// if (heap.size() > 0) { +// // replace the old with the new: +// this.array[this.best] = heap.peek() as any as V; +// // TODO: fix the ordering + +// } else { +// // we're done with this account, shorten our heap +// this.best++; +// } +// } +// } + +// export default Heap; + +// type Account = {nonce: number, gasPrice: number}; +// const byNonce = (a:any, b:any): boolean => a.nonce < b.nonce; +// const account1 = new Heap(2, byNonce); +// account1.insert({nonce: 2, gasPrice: 3}); +// account1.insert({nonce: 1, gasPrice: 2}); + +// const account2 = new Heap(3, byNonce); +// account2.insert({nonce: 2, gasPrice: 3}); +// account2.insert({nonce: 3, gasPrice: 4}); +// account2.insert({nonce: 5, gasPrice: 9}); + +// const accounts = [account1, account2]; +// const byPrice = (a:any, b:any): boolean => a.gasPrice > b.gasPrice; + +// const all = new HeapHeap(accounts.length, byPrice); +// for (var i = 0; i < accounts.length; i++) { +// var account = accounts[i]; +// all.insert(account); +// } + +// const a = all.peek(); + + +// type account = {gasPrice: number}; +// const a = new Heap((values: account[], a: number, b: number) => { +// return values[a].gasPrice < values[b].gasPrice; +// }); + +// var values = [{gasPrice: 9}, {gasPrice: 7}, {gasPrice: 9}, {gasPrice: 4}, {gasPrice: 6}]; + +// a.init(values); +// var best = a.peek(values); +// console.log(best.gasPrice == 4); +// a.replace(values, 0, {gasPrice: 11}); +// var best = a.peek(values); +// console.log(best.gasPrice == 6); +// a.shift(); +// var best = a.peek(values); +// console.log(best.gasPrice == 7); + +// a.replaceBest(values, {gasPrice: 99}); +// var best = a.peek(values); +// console.log(best.gasPrice == 9); + +// a.replaceBest(values, {gasPrice: 1}); +// var best = a.peek(values); +// console.log(best.gasPrice == 1); + +export default Heap; \ No newline at end of file diff --git a/src/utils/request-processor.ts b/src/utils/request-processor.ts index e851c12154..93d34f18d8 100644 --- a/src/utils/request-processor.ts +++ b/src/utils/request-processor.ts @@ -1,15 +1,29 @@ export default class RequestProcessor { - public limit: number = 0 - public pending: any[] = []; + /** + * The number of concurrent requests. Set to null for no limit. + */ + public limit: number = null; + + /** + * The pending requests. You can't do anything with this array. + */ + public readonly pending: any[] = []; + /** + * The number of tasks currently being processed. + */ public runningTasks: number = 0; - private _processing: boolean; private _paused: boolean = true; public get paused(): boolean { return this._paused; } - constructor(limit?: number) { - if(limit !== undefined) { + /** + * Promise-based FIFO queue. + * @param limit The number of requests that can be processed at a time. + * Default value is is no limit (via `null`). + */ + constructor(limit: number = null) { + if (limit !== null) { if (!Number.isInteger(limit) || limit < 0 || limit > Number.MAX_SAFE_INTEGER) { throw new RangeError("`limit` must be an integer and between 0 - Number.MAX_SAFE_INTEGER, inclusive.") } @@ -19,31 +33,37 @@ export default class RequestProcessor { this.process(); } + /** + * Pause processing. This will *not* cancel or promises that are currently + * running. + */ public pause() { this._paused = true; } + /** + * Resume processing. + */ public resume() { this._paused = false; this.process(); } private process() { - if (this._processing) return; - this._processing = true; - // if we aren't paused and the number of things we're processing is under // our limit and we have things to process: do it! - while(!this.paused && this.pending.length > 0 && (!this.limit || this.runningTasks < this.limit)) { - let current = this.pending.shift(); + while (!this.paused && this.pending.length > 0 && (!this.limit || this.runningTasks < this.limit)) { + const current = this.pending.shift(); this.runningTasks++; - current().then(() => { + current().finally(() => { this.runningTasks--; }); } - this._processing = false; } + /** + * Insert a new function into the queue. + */ public queue = function(fn: (...args: any[]) => Promise<{}>, ...args: any[]): Promise<{}> { const promise = new Promise((resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { const executor = () => { From 0511ad42f5cae0b0efe3f76b3b64880106f80711 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 17:41:52 -0400 Subject: [PATCH 031/691] Whitespace fix and todos --- src/provider.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/provider.ts b/src/provider.ts index 082f0d468a..e5c3e60bf4 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -37,7 +37,7 @@ export default class Provider extends Emittery { // set up our request processor to either use FIFO or or async request processing const _requestProcessor = this[requestProcessor] = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 1 : 0); - if(!_providerOptions.mnemonic){ + if (!_providerOptions.mnemonic) { // TODO: this is a default and should be configured that way _providerOptions.mnemonic = generateMnemonic(); } @@ -58,6 +58,8 @@ export default class Provider extends Emittery { this[engine] = new Engine(ledger); } + // TODO: this doesn't seem like a provider-level function. Maybe we should + // move this into the Ledger or it's Blockchain? private initializeAccounts(): Account[]{ const _providerOptions = this[options]; let accounts: Account[]; @@ -85,6 +87,7 @@ export default class Provider extends Emittery { return accounts; } + // TODO: this should probable be moved as well (see `initializeAccounts` above) private createAccount(balance: JsonRpcQuantity, privateKey: JsonRpcData, address?: Address) { address = address || Address.from(privateToAddress(Buffer.from(privateKey.toString(), "hex"))); From 88d54f24df3352383fec73aa3c615266e6a3cf13 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 17:42:07 -0400 Subject: [PATCH 032/691] Whitespace --- src/server.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server.ts b/src/server.ts index cd9d6d6948..882112aee6 100644 --- a/src/server.ts +++ b/src/server.ts @@ -58,6 +58,7 @@ export default class Server { throw err; } } + close() { const _listenSocket = this[listenSocket]; if (_listenSocket) { From fe05e401e61d7b196b7680311ed3122f25819823 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 17:42:17 -0400 Subject: [PATCH 033/691] Start eth_sendTransaction --- src/ledgers/ethereum/ledger.ts | 73 +++++++++++++++++++++++++--------- test/provider.ts | 15 +++++-- 2 files changed, 67 insertions(+), 21 deletions(-) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 60a69839c7..1fe8d89a06 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -7,6 +7,7 @@ import { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; +const BUFFER_ZERO = Buffer.from([0]); const createKeccakHash = require("keccak"); const hash = createKeccakHash("keccak256"); @@ -143,7 +144,7 @@ export default class Ethereum implements ILedger { * @returns Array of 20 Bytes - addresses owned by the client. */ async eth_accounts(): Promise{ - return this[_options].accounts; + return this[_options].accounts.map(account => account.address); } /** @@ -197,26 +198,62 @@ export default class Ethereum implements ILedger { return transaction; } - @sync - async eth_sendTransaction(transaction: any): Promise { - // todo: transaction stuff - return ""; - } + async eth_sendTransaction(transaction: any): Promise { + // TODO: rewrite this stuff - @sync - async eth_sendRawTransaction(transaction: any): Promise { - // todo: transaction stuff - return ""; - } - readonly [index: string]: (...args: any) => Promise<{}>; -} -// make sync wrap the method in a FIFO queue -function sync(target: any, name: any, descriptor: any) { - const method = descriptor.value; - descriptor.value = function(...args: any[]) { - return method.apply(args); + const from = transaction.from ? JsonRpcData.from(transaction.from) : null; + + if (from == null) { + throw new Error("from not found; is required"); + } + + // Error checks. It's possible to JSON.stringify a Buffer to JSON. + // we actually now handle this "properly" (not sure about spec), but for + // legacy reasons we don't allow it. + if (transaction.to && typeof transaction.to !== "string") { + throw new Error("Invalid to address"); + } + + // TODO: accounts was an object in the previous ganache, now it is an array. + // fix it! + const isKnownAccount = this[_options].accounts.hasOwnProperty(from.toString().toLowerCase()); + + // todo: set up account locking unlocking and things... + // if (method === "eth_sendTransaction" && !this.unlocked_accounts.hasOwnProperty(from)) { + // const msg = isKnownAccount ? "signer account is locked" : "sender account not recognized"; + // return callback(new Error(msg)); + // } + + let type = Transaction.types.none; + if (!isKnownAccount) { + type |= Transaction.types.fake; + } + + const tx = Transaction.fromJSON(transaction, type); + if (tx.gasLimit.length === 0) { + tx.gasLimit = Buffer.from("15f90", "hex"); + } + + if (tx.gasPrice.length === 0) { + tx.gasPrice = JsonRpcQuantity.from(this[_options].gasPrice).toBuffer(); + } + + if (tx.value.length === 0) { + tx.value = Buffer.from([0]); + } + + if (tx.to.length === 0 || tx.to.equals(BUFFER_ZERO)) { + tx.to = Buffer.allocUnsafe(0); + } + + return await this[_blockchain].queueTransaction(tx); + } + + async eth_sendRawTransaction(transaction: any): Promise { + await this[_blockchain].queueTransaction(transaction); + return transaction.hash; } readonly [index: string]: (...args: any) => Promise<{}>; diff --git a/test/provider.ts b/test/provider.ts index 2d4b78487f..47a57293ef 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -10,6 +10,15 @@ describe("provider", () => { network_id: networkId }); }) + it.only("sends a transaction", async () => { + const accounts = await p.send("eth_accounts"); + const result = await p.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 123 + }]); + console.log(result); + }); it.skip("returns a transaction", async () => { var result = await p.send("eth_getTransactionByHash", ["0x123"]); const v = result.blockNumber; @@ -33,10 +42,10 @@ describe("provider", () => { it("returns rejects invalid rpc methods", async () => { await assert.rejects(p.send("toString"), { - message: "Invalid method: toString" + message: "Invalid or unsupported method: toString" }); await assert.rejects(p.send("yo_mamma!"), { - message: "Invalid method: yo_mamma!" + message: "Invalid or unsupported method: yo_mamma!" }); const str = Buffer.from([1]) as any as string; await assert.rejects(new Promise((resolve, reject) => { @@ -52,7 +61,7 @@ describe("provider", () => { } }) }), { - message: "Invalid method: \u0001" + message: "Invalid or unsupported method: \u0001" }); }); }); From 111f1a6cd04f73c45c65f9e8c56a7eb5fc32c4bf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 17:43:09 -0400 Subject: [PATCH 034/691] Enable all tests --- test/provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/provider.ts b/test/provider.ts index 47a57293ef..26a5a7d3d9 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -10,7 +10,7 @@ describe("provider", () => { network_id: networkId }); }) - it.only("sends a transaction", async () => { + it("sends a transaction", async () => { const accounts = await p.send("eth_accounts"); const result = await p.send("eth_sendTransaction", [{ from: accounts[0], From 6770cc3fa7b28b43f49b5b7bfc6e803a6344be5f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Apr 2019 21:39:54 -0400 Subject: [PATCH 035/691] eth_getBalance --- src/ledgers/ethereum/blockchain.ts | 10 +- src/ledgers/ethereum/database.ts | 2 +- src/ledgers/ethereum/ledger.ts | 487 ++++++++++-------- src/ledgers/ethereum/options.ts | 4 +- .../ethereum/things/account-manager.ts | 17 +- src/ledgers/ethereum/things/block-manager.ts | 5 + src/options/options.ts | 10 +- src/provider.ts | 4 +- src/types/account.ts | 6 + src/types/json-rpc/json-rpc-quantity.ts | 10 +- src/utils/jsbi-helpers.ts | 2 +- test/provider.ts | 5 + 12 files changed, 320 insertions(+), 242 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 8fc89f8b87..6b7718ae18 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -8,14 +8,16 @@ import Account from "../../types/account"; import { promisify } from "util"; import { JsonRpcQuantity, JsonRpcData } from "../../types/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; +import AccountManager from "./things/account-manager"; const VM = require("ethereumjs-vm"); export default class Blockchain extends Emittery { public blocks: BlockManager; public transactions: TransactionManager; + public accounts: AccountManager; private vm: any; - private trie: Trie; + public trie: Trie; private readonly database: Database /** @@ -45,6 +47,7 @@ export default class Blockchain extends Emittery { this.trie = new Trie(database.trie, root); this.blocks = this.database.blocks; this.transactions = this.database.transactions; + this.accounts = this.database.accounts; this._initializeVM(hardfork, allowUnlimitedContractSize); @@ -87,7 +90,7 @@ export default class Blockchain extends Emittery { address: account.address } }) - .map(account => putAccount(account.address.toString(), account.account)); + .map(account => putAccount(account.address.toBuffer(), account.account)); await Promise.all(pendingAccounts); return commit(); } @@ -98,7 +101,8 @@ export default class Blockchain extends Emittery { // If we were given a timestamp, use it instead of the `currentTime` timestamp: ((timestamp as any) / 1000 | 0) || this.currentTime(), gasLimit: blockGasLimit.toBuffer(), - stateRoot: this.trie.root + stateRoot: this.trie.root, + number: "0x0" }); // store the genesis block in the database diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index c7eb58e013..fe5c78994e 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -12,7 +12,7 @@ const encode = require("encoding-down"); type DatabaseOptions = {db: string | object, dbPath: string} export default class Database extends Emittery{ - private readonly blockchain: Blockchain; + public readonly blockchain: Blockchain; private readonly options: DatabaseOptions; public directory: string = null; public db: levelup.LevelUp = null; diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 1fe8d89a06..e855593fb0 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,9 +1,9 @@ import ILedger from "../../interfaces/ledger"; -import EthereumOptions, {getDefaultOptions as getDefaultEthereumOptions} from "./options"; -import {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcData} from "../../types/json-rpc"; +import EthereumOptions, { getDefaultOptions as getDefaultEthereumOptions } from "./options"; +import { JsonRpcData, JsonRpcQuantity, IndexableJsonRpcData } from "../../types/json-rpc"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; -import { IndexableAddress } from "../../types/address"; +import Address, { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; @@ -16,245 +16,288 @@ const _options = Symbol("options"); const _coinbase = Symbol("coinbase"); const _isMining = Symbol("isMining"); const _blockchain = Symbol("blockchain"); -const _accounts = Symbol("accounts"); +const _knownAccounts = Symbol("knownAccounts"); +const _unlockedAccounts = Symbol("unlockedAccounts"); export default class Ethereum implements ILedger { - private readonly [_options]: EthereumOptions; - private readonly [_coinbase]: Account; - private readonly [_blockchain]: Blockchain; - private [_isMining]: boolean = false; - /** - * This is the Ethereum ledger that the provider interacts with. - * The only methods permitted on the prototype are the supported json-rpc - * methods. - * @param options - * @param ready Callback for when the ledger is fully initialized - */ - constructor(options: EthereumOptions, ready: () => {}) { - const tmpOptions = this[_options] = Object.assign(getDefaultEthereumOptions(), options); - this[_coinbase] = tmpOptions.accounts[0]; - const chain = this[_blockchain] = new Blockchain( - tmpOptions.db, - tmpOptions.dbPath, - tmpOptions.accounts, - tmpOptions.hardfork, - tmpOptions.allowUnlimitedContractSize, - tmpOptions.gasLimit, - tmpOptions.timestamp - ); - chain.on("ready", ready); + private readonly [_knownAccounts] = new Set(); + private readonly [_unlockedAccounts] = new Set(); + private readonly [_options]: EthereumOptions; + private readonly [_coinbase]: Account; + private readonly [_blockchain]: Blockchain; + private [_isMining] = false; + + /** + * This is the Ethereum ledger that the provider interacts with. + * The only methods permitted on the prototype are the supported json-rpc + * methods. + * @param options + * @param ready Callback for when the ledger is fully initialized + */ + constructor(options: EthereumOptions, ready: () => {}) { + const opts = this[_options] + = Object.assign(getDefaultEthereumOptions(), options); + this[_coinbase] = opts.accounts[0]; + opts.accounts.forEach((account) => { + const address = account.address.toString().toLowerCase(); + this[_knownAccounts].add(address); + + // if the `secure` option has been set do NOT add these accounts to the + // _unlockedAccounts + if (opts.secure) return; + + this[_unlockedAccounts].add(address); + }); + opts.unlockedAccounts.forEach((addressOrIndex: string | number) => { + let address; + switch (typeof addressOrIndex) { + case "string": + if (addressOrIndex.indexOf("0x") === 0) { + address = addressOrIndex; + break; + } else { + addressOrIndex = parseInt(addressOrIndex as string, 10); + // not `break`ing here because I want this to fall + // through to the `number` case. + // Refactor it if you want. + // break; // no break, please + } + case "number": + const account = opts.accounts[addressOrIndex]; + if (!account) { + throw new Error( + `Account at index ${addressOrIndex} not found. Max + index available is + ${opts.accounts.length - 1}.` + ); + } + address = account.address.toString(); + break; + default: + throw new Error( + `Invalid value specified in unlocked_accounts` + ); + } + this[_knownAccounts].add(address.toLowerCase()); + }); + + const chain = this[_blockchain] = new Blockchain( + opts.db, + opts.dbPath, + opts.accounts, + opts.hardfork, + opts.allowUnlimitedContractSize, + opts.gasLimit, + opts.timestamp + ); + chain.on("ready", ready); + } + + /** + * Returns the current client version. + * @returns The current client version. + */ + async web3_clientVersion(): Promise { + return "EthereumJS canache-core/v" + 0 + "/ethereum-js"; + }; + + /** + * Returns Keccak-256 (not the standardized SHA3-256) of the given data. + * @param {string} the data to convert into a SHA3 hash. + * @returns The SHA3 result of the given string. + */ + async web3_sha3(string: string): Promise { + return hash(string).digest(); + }; + + /** + * Returns number of peers currently connected to the client. + * @returns {QUANTITY} integer of the number of connected peers. + */ + async net_peerCount(): Promise { + return 0n; + } + + /** + * Returns the current network id. + * @returns The current network id. + */ + async net_version(): Promise { + return this[_options].net_version; + } + + /** + * Returns true if client is actively listening for network connections. + * @returns true when listening, otherwise false. + */ + async net_listening(): Promise { + return true; + } + + /** + * Returns the current ethereum protocol version. + * @returns The current ethereum protocol version. + */ + async eth_protocolVersion(): Promise { + return "63"; + } + + + /** + * Returns an object with data about the sync status or false. + * @returns An object with sync status data or false, when not syncing: + * startingBlock: {bigint} - The block at which the import started (will only be reset, after the sync reached his head) + * currentBlock: {bigint} - The current block, same as eth_blockNumber + * highestBlock: {bigint} - The estimated highest block + */ + async eth_syncing(): Promise { + return false; + } + + /** + * Returns the client coinbase address. + * @returns 20 bytes - the current coinbase address. + */ + async eth_coinbase(): Promise { + return this[_coinbase] ? this[_coinbase].address : null; + } + + /** + * Returns true if client is actively mining new blocks. + * @returns returns true of the client is mining, otherwise false. + */ + async eth_mining(): Promise { + return this[_isMining]; + } + + /** + * Returns the number of hashes per second that the node is mining with. + * @returns number of hashes per second. + */ + async eth_hashrate(): Promise { + return 0n; + } + + /** + * Returns the current price per gas in wei. + * @returns integer of the current gas price in wei. + */ + async eth_gasPrice(): Promise { + return this[_options].gasPrice; + } + + /** + * Returns a list of addresses owned by client. + * @returns Array of 20 Bytes - addresses owned by the client. + */ + async eth_accounts(): Promise { + return this[_options].accounts.map(account => account.address); + } + + /** + * Returns the number of most recent block. + * @returns integer of the current block number the client is on. + */ + async eth_blockNumber(): Promise { + const latest = this[_blockchain].blocks.get(Tag.LATEST); + return latest.then((block: any) => BigInt(block.value.header.number)); + } + + /** + * Returns the balance of the account of given address. + * @param address 20 Bytes - address to check for balance. + * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter + */ + async eth_getBalance(address: IndexableAddress, blockNumber: bigint | Tag = Tag.LATEST): Promise { + const chain = this[_blockchain]; + const str = blockNumber.toString(); + const block = await chain.blocks.get(Buffer.from([0])); + //const block = await chain.blocks.get(str); + const account = await chain.accounts.get(Address.from(address)); + //const account = await block.accounts.get(address); + //return account.balance; + return account.balance; + } + + /** + * Returns the information about a transaction requested by transaction hash. + * + * @param transasctionHash 32 Bytes - hash of a transaction + */ + async eth_getTransactionByHash(transasctionHash: IndexableJsonRpcData): Promise { + transasctionHash = JsonRpcData.from(transasctionHash); + + const chain = this[_blockchain]; + // const block = await chain.blocks.get(Tag.LATEST); + + // // TODO: just POC stuff I was working on... + // if (!block) { + // const b = new Block(null as any); + // b.header.number = Buffer.from("1234", "hex"); + // const c = b.serialize(true); + // const d = new Block(c); + // // await chain.blocks.set(Tag.LATEST, c); + // } + // const block2 = await chain.blocks.get(Tag.LATEST); + // // END + + + const transaction = await chain.transactions.get(transasctionHash); + return transaction; + } + + async eth_sendTransaction(transaction: any): Promise { + const from = transaction.from ? JsonRpcData.from(transaction.from).toString().toLowerCase() : null; + + if (from == null) { + throw new Error("from not found; is required"); } - /** - * Returns the current client version. - * @returns The current client version. - */ - async web3_clientVersion(): Promise { - return "EthereumJS canache-core/v" + 0 + "/ethereum-js"; - }; - - /** - * Returns Keccak-256 (not the standardized SHA3-256) of the given data. - * @param {string} the data to convert into a SHA3 hash. - * @returns The SHA3 result of the given string. - */ - async web3_sha3(string: string): Promise { - return hash(string).digest(); - }; - - /** - * Returns number of peers currently connected to the client. - * @returns {QUANTITY} integer of the number of connected peers. - */ - async net_peerCount(): Promise{ - return 0n; + // Error checks. It's possible to JSON.stringify a Buffer to JSON. + // we actually now handle this "properly" (not sure about spec), but for + // legacy reasons we don't allow it. + if (transaction.to && typeof transaction.to !== "string") { + throw new Error("Invalid to address"); } - /** - * Returns the current network id. - * @returns The current network id. - */ - async net_version(): Promise { - return this[_options].net_version; - } - - /** - * Returns true if client is actively listening for network connections. - * @returns true when listening, otherwise false. - */ - async net_listening(): Promise { - return true; - } - - /** - * Returns the current ethereum protocol version. - * @returns The current ethereum protocol version. - */ - async eth_protocolVersion(): Promise { - return "63"; - } - - - /** - * Returns an object with data about the sync status or false. - * @returns An object with sync status data or false, when not syncing: - * startingBlock: {bigint} - The block at which the import started (will only be reset, after the sync reached his head) - * currentBlock: {bigint} - The current block, same as eth_blockNumber - * highestBlock: {bigint} - The estimated highest block - */ - async eth_syncing(): Promise { - return false; - } - - /** - * Returns the client coinbase address. - * @returns 20 bytes - the current coinbase address. - */ - async eth_coinbase(): Promise { - return this[_coinbase] ? this[_coinbase].address : null; - } + const isKnownAccount = this[_knownAccounts].has(from); + const isUnlockedAccount = this[_knownAccounts].has(from); - /** - * Returns true if client is actively mining new blocks. - * @returns returns true of the client is mining, otherwise false. - */ - async eth_mining(): Promise{ - return this[_isMining]; + if (!isUnlockedAccount) { + const msg = isKnownAccount ? "signer account is locked" : "sender account not recognized"; + throw new Error(msg); } - /** - * Returns the number of hashes per second that the node is mining with. - * @returns number of hashes per second. - */ - async eth_hashrate(): Promise { - return 0n; + let type = Transaction.types.none; + if (!isKnownAccount) { + type |= Transaction.types.fake; } - /** - * Returns the current price per gas in wei. - * @returns integer of the current gas price in wei. - */ - async eth_gasPrice(): Promise{ - return this[_options].gasPrice; + const tx = Transaction.fromJSON(transaction, type); + if (tx.gasLimit.length === 0) { + tx.gasLimit = Buffer.from("15f90", "hex"); } - /** - * Returns a list of addresses owned by client. - * @returns Array of 20 Bytes - addresses owned by the client. - */ - async eth_accounts(): Promise{ - return this[_options].accounts.map(account => account.address); + if (tx.gasPrice.length === 0) { + tx.gasPrice = JsonRpcQuantity.from(this[_options].gasPrice).toBuffer(); } - /** - * Returns the number of most recent block. - * @returns integer of the current block number the client is on. - */ - async eth_blockNumber(): Promise { - const latest = this[_blockchain].blocks.get(Tag.LATEST); - return latest.then((block: any) => BigInt(block.value.header.number)); + if (tx.value.length === 0) { + tx.value = Buffer.from([0]); } - /** - * Returns the balance of the account of given address. - * @param address 20 Bytes - address to check for balance. - * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter - */ - async eth_getBalance(address: IndexableAddress, blockNumber: bigint|Tag = Tag.LATEST): Promise { - const chain = this[_blockchain]; - const str = blockNumber.toString(); - var t = chain.blocks.get("str"); - const block = await chain.blocks.get(str); - //const account = await block.accounts.get(address); - //return account.balance; - return JsonRpcQuantity.from(BigInt(0)); + if (tx.to.length === 0 || tx.to.equals(BUFFER_ZERO)) { + tx.to = Buffer.allocUnsafe(0); } - /** - * Returns the information about a transaction requested by transaction hash. - * - * @param transasctionHash 32 Bytes - hash of a transaction - */ - async eth_getTransactionByHash(transasctionHash: IndexableJsonRpcData): Promise { - transasctionHash = JsonRpcData.from(transasctionHash); - - const chain = this[_blockchain]; - // const block = await chain.blocks.get(Tag.LATEST); - - // // TODO: just POC stuff I was working on... - // if (!block) { - // const b = new Block(null as any); - // b.header.number = Buffer.from("1234", "hex"); - // const c = b.serialize(true); - // const d = new Block(c); - // // await chain.blocks.set(Tag.LATEST, c); - // } - // const block2 = await chain.blocks.get(Tag.LATEST); - // // END - - - const transaction = await chain.transactions.get(transasctionHash); - return transaction; - } + return this[_blockchain].queueTransaction(tx); + } - async eth_sendTransaction(transaction: any): Promise { - // TODO: rewrite this stuff - - - - const from = transaction.from ? JsonRpcData.from(transaction.from) : null; - - if (from == null) { - throw new Error("from not found; is required"); - } - - // Error checks. It's possible to JSON.stringify a Buffer to JSON. - // we actually now handle this "properly" (not sure about spec), but for - // legacy reasons we don't allow it. - if (transaction.to && typeof transaction.to !== "string") { - throw new Error("Invalid to address"); - } - - // TODO: accounts was an object in the previous ganache, now it is an array. - // fix it! - const isKnownAccount = this[_options].accounts.hasOwnProperty(from.toString().toLowerCase()); - - // todo: set up account locking unlocking and things... - // if (method === "eth_sendTransaction" && !this.unlocked_accounts.hasOwnProperty(from)) { - // const msg = isKnownAccount ? "signer account is locked" : "sender account not recognized"; - // return callback(new Error(msg)); - // } - - let type = Transaction.types.none; - if (!isKnownAccount) { - type |= Transaction.types.fake; - } - - const tx = Transaction.fromJSON(transaction, type); - if (tx.gasLimit.length === 0) { - tx.gasLimit = Buffer.from("15f90", "hex"); - } - - if (tx.gasPrice.length === 0) { - tx.gasPrice = JsonRpcQuantity.from(this[_options].gasPrice).toBuffer(); - } - - if (tx.value.length === 0) { - tx.value = Buffer.from([0]); - } - - if (tx.to.length === 0 || tx.to.equals(BUFFER_ZERO)) { - tx.to = Buffer.allocUnsafe(0); - } - - return await this[_blockchain].queueTransaction(tx); - } - - async eth_sendRawTransaction(transaction: any): Promise { - await this[_blockchain].queueTransaction(transaction); - return transaction.hash; - } + async eth_sendRawTransaction(transaction: any): Promise { + await this[_blockchain].queueTransaction(transaction); + return transaction.hash; + } - readonly [index: string]: (...args: any) => Promise<{}>; + readonly [index: string]: (...args: any) => Promise<{}>; } diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 17fc770026..668584f657 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -6,12 +6,14 @@ type EthereumOptions = ILedgerOptions & { net_version: string, gasPrice?: bigint, accounts: Account[], + unlockedAccounts: string[] | number[], allowUnlimitedContractSize: boolean, hardfork: string, gasLimit: JsonRpcQuantity, timestamp?: Date, db?: object, - dbPath?: string + dbPath?: string, + secure: boolean } export default EthereumOptions; diff --git a/src/ledgers/ethereum/things/account-manager.ts b/src/ledgers/ethereum/things/account-manager.ts index 39139d4d22..697569f8a5 100644 --- a/src/ledgers/ethereum/things/account-manager.ts +++ b/src/ledgers/ethereum/things/account-manager.ts @@ -1,6 +1,8 @@ import Database from "../database"; import Account from "../../../types/account"; import Address from "../../../types/address"; +import Trie from "merkle-patricia-tree/baseTrie"; +import { promisify } from "util"; export default class AccountManager { @@ -10,15 +12,10 @@ export default class AccountManager { } public async get(address: Address, blockTag: string = "latest"): Promise { - const block = await this.db.blocks.get(blockTag); - // this.db.trie. - - // trie.get(utils.toBuffer(address), function(err, data) { - // // Finally, put the stateRoot back for good - // trie.root = currentStateRoot; - - // var account = new Account(data); - - return new Account(address); + const block = await this.db.blocks.get(Buffer.from([0])); + const trieCopy = new Trie(this.db.trie, block.value.header.stateRoot); + const get = promisify(trieCopy.get.bind(trieCopy, address.toBuffer())); + const data = await get(); + return new Account(data); } } diff --git a/src/ledgers/ethereum/things/block-manager.ts b/src/ledgers/ethereum/things/block-manager.ts index d5d859fc13..a500af6956 100644 --- a/src/ledgers/ethereum/things/block-manager.ts +++ b/src/ledgers/ethereum/things/block-manager.ts @@ -65,6 +65,11 @@ export default class BlockManager extends Manager { } else if (value instanceof Block) { value = value.value.serialize(true); } + + // ethereumjs-block treats [0] as [] :-() + if (Buffer.isBuffer(key) && key.equals(Buffer.from([]))){ + key = Buffer.from([0]); + } return super.set(key, value); } } diff --git a/src/options/options.ts b/src/options/options.ts index b1b9817fbd..275148a87e 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -81,7 +81,7 @@ export default interface Options { /** * Array of addresses or address indexes specifying which accounts should be unlocked. */ - unlocked_accounts?: JsonRpcData[]|bigint[], + unlocked_accounts?: string[] | number[], /** * Specify a path to a directory to save the chain database. If a database @@ -90,6 +90,11 @@ export default interface Options { */ db_path?: string, + /** + * Lock available accounts by default (good for third party transaction signing. Defaults to `false`. + */ + secure?: boolean, + /** * Specify an alternative database instance, for instance MemDOWN. */ @@ -153,6 +158,7 @@ export const getDefault: (options: Options)=> Options = (options) => { gasLimit: new JsonRpcQuantity("0x6691b7"), verbose: false, asyncRequestProcessing: false, - hardfork: "petersburg" + hardfork: "petersburg", + secure: false }, options); } diff --git a/src/provider.ts b/src/provider.ts index e5c3e60bf4..2f475e2973 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -53,7 +53,9 @@ export default class Provider extends Emittery { allowUnlimitedContractSize: _providerOptions.allowUnlimitedContractSize, hardfork: _providerOptions.hardfork, gasLimit: _providerOptions.gasLimit, - timestamp: _providerOptions.time + timestamp: _providerOptions.time, + unlockedAccounts: _providerOptions.unlocked_accounts || [], + secure: _providerOptions.secure }, _requestProcessor.resume.bind(_requestProcessor)); this[engine] = new Engine(ledger); } diff --git a/src/types/account.ts b/src/types/account.ts index a344fcfe9c..f1586c5da1 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -15,6 +15,12 @@ export default class Account { constructor(arg: Address | Buffer) { if (arg instanceof Address){ this.address = arg; + } else if (Buffer.isBuffer(arg)){ + const arr = rlp.decode(arg) as any as Buffer[]; + this.nonce = JsonRpcQuantity.from(arr[0]); + this.balance = JsonRpcQuantity.from(arr[1]); + this.stateRoot = arr[2]; + this.codeHash = arr[3]; } } public serialize() { diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index 0ba18eddaa..b8b2b3d7e5 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -1,11 +1,19 @@ import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; +import { bufferToHex } from "ethereumjs-util"; +import { isBigIntLiteral } from "typescript"; class JsonRpcQuantity extends BaseJsonRpcType { public static from(value: number | bigint | string | Buffer) { return new _JsonRpcQuantity(value); } public toBigInt(): bigint { - return BigInt(this.value); + const value = this.value; + if (Buffer.isBuffer(value)) { + const view = new DataView(value.buffer); + return view.getBigUint64(value.byteOffset as any) as bigint; + } else { + return BigInt(this.value); + } } } type $ = { diff --git a/src/utils/jsbi-helpers.ts b/src/utils/jsbi-helpers.ts index b2c3f2ed74..95279c8732 100644 --- a/src/utils/jsbi-helpers.ts +++ b/src/utils/jsbi-helpers.ts @@ -3,7 +3,7 @@ import JSBI from "jsbi"; declare global { interface DataView { setBigUint64(byteOffset: number, value: bigint | JSBI, littleEndian?: boolean): void; - getBigUint64(byteOffset: number, littleEndian?: boolean): void; + getBigUint64(byteOffset: number, littleEndian?: boolean): bigint | JSBI; } } diff --git a/test/provider.ts b/test/provider.ts index 26a5a7d3d9..f38211f8fc 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -10,6 +10,11 @@ describe("provider", () => { network_id: networkId }); }) + it("gets balance", async() => { + const accounts = await p.send("eth_accounts"); + const balance = await p.send("eth_getBalance", [accounts[0]]); + assert.strictEqual(balance, 100, "Heyo!"); + }) it("sends a transaction", async () => { const accounts = await p.send("eth_accounts"); const result = await p.send("eth_sendTransaction", [{ From 1fac34a6e87372bfe7db9314ac6113c608675cca Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 24 Apr 2019 21:50:02 -0400 Subject: [PATCH 036/691] Just making things work --- src/ledgers/ethereum/blockchain.ts | 46 ++-- src/ledgers/ethereum/database.ts | 12 +- src/ledgers/ethereum/ledger.ts | 230 ++++++++++-------- src/ledgers/ethereum/options.ts | 18 +- .../ethereum/things/account-manager.ts | 21 +- src/ledgers/ethereum/things/block-manager.ts | 78 +++--- src/ledgers/ethereum/things/manager.ts | 16 +- .../ethereum/things/transaction-manager.ts | 27 +- .../ethereum/things/transaction-pool.ts | 62 +++-- src/options/options.ts | 25 +- src/options/provider-options.ts | 4 +- src/provider.ts | 64 ++--- src/types/json-rpc/json-rpc-base-types.ts | 25 +- src/types/json-rpc/json-rpc-quantity.ts | 35 ++- src/types/tags.ts | 12 +- src/types/transaction.ts | 8 +- src/utils/heap.ts | 2 - 17 files changed, 391 insertions(+), 294 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 6b7718ae18..36c8e9cdfc 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -12,6 +12,16 @@ import AccountManager from "./things/account-manager"; const VM = require("ethereumjs-vm"); +type BlockchainOptions = { + db?: string | object, + db_path?: string, + accounts?: Account[], + hardfork?: string, + allowUnlimitedContractSize?: boolean, + gasLimit?: JsonRpcQuantity, + timestamp?: Date +}; + export default class Blockchain extends Emittery { public blocks: BlockManager; public transactions: TransactionManager; @@ -34,10 +44,10 @@ export default class Blockchain extends Emittery { * @param blockGasLimit * @param timestamp */ - constructor(db: string | object, dbPath: string, accounts: Account[], hardfork: string, allowUnlimitedContractSize: boolean, blockGasLimit: JsonRpcQuantity, timestamp: Date) { + constructor(options: BlockchainOptions) { super(); - const database = this.database = new Database({db, dbPath}, this); + const database = this.database = new Database(options, this); database.on("ready", async () => { // TODO: get the latest block from the database @@ -45,14 +55,14 @@ export default class Blockchain extends Emittery { // and we will skip creating the genesis block alltogether const root:any = null; this.trie = new Trie(database.trie, root); - this.blocks = this.database.blocks; - this.transactions = this.database.transactions; - this.accounts = this.database.accounts; + this.blocks = new BlockManager(this, database.blocks); + this.transactions = new TransactionManager(this, database.transactions, options); + this.accounts = new AccountManager(this); - this._initializeVM(hardfork, allowUnlimitedContractSize); + this._initializeVM(options.hardfork, options.allowUnlimitedContractSize); - await this._initializeAccounts(accounts); - await this._initializeGenesisBlock(timestamp, blockGasLimit); + await this._initializeAccounts(options.accounts); + await this._initializeGenesisBlock(options.timestamp, options.gasLimit); this.emit("ready"); }); @@ -80,17 +90,15 @@ export default class Blockchain extends Emittery { const checkpoint = promisify(stateManager.checkpoint.bind(stateManager)) const commit = promisify(stateManager.commit.bind(stateManager)) await checkpoint(); - const pendingAccounts = accounts - .map(account => { - const ethereumJsAccount = new EthereumJsAccount(); - ethereumJsAccount.nonce = account.nonce.toBuffer(), - ethereumJsAccount.balance = account.balance.toBuffer() - return { - account: ethereumJsAccount, - address: account.address - } - }) - .map(account => putAccount(account.address.toBuffer(), account.account)); + const l = accounts.length; + const pendingAccounts = Array(l); + for (let i = 0; i < l; i++) { + const account = accounts[i]; + const ethereumJsAccount = new EthereumJsAccount(); + ethereumJsAccount.nonce = account.nonce.toBuffer(), + ethereumJsAccount.balance = account.balance.toBuffer() + pendingAccounts[i] = putAccount(account.address.toBuffer(), ethereumJsAccount); + } await Promise.all(pendingAccounts); return commit(); } diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index fe5c78994e..a277749246 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -9,18 +9,17 @@ const leveldown = require("leveldown"); const sub = require( "subleveldown"); const encode = require("encoding-down"); -type DatabaseOptions = {db: string | object, dbPath: string} +type DatabaseOptions = {db?: string | object, dbPath?: string}; export default class Database extends Emittery{ public readonly blockchain: Blockchain; private readonly options: DatabaseOptions; public directory: string = null; public db: levelup.LevelUp = null; - public blocks: BlockManager; - public accounts: AccountManager; + public blocks: levelup.LevelUp; public blockLogs: levelup.LevelUp; public blockHashes: levelup.LevelUp; - public transactions: TransactionManager; + public transactions: levelup.LevelUp; public transactionReceipts: levelup.LevelUp; public trie: levelup.LevelUp; public readonly initialized: boolean; @@ -61,9 +60,8 @@ export default class Database extends Emittery{ this.db = db; await open; - this.blocks = new BlockManager(this); - this.transactions = new TransactionManager(this); - this.accounts = new AccountManager(this); + this.blocks = sub(db, "blocks", levelupOptions); + this.transactions = sub(db, "transactions", levelupOptions); return this.emit("ready"); } /** diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index e855593fb0..553cf8bcfc 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,17 +1,28 @@ +//#region Imports import ILedger from "../../interfaces/ledger"; -import EthereumOptions, { getDefaultOptions as getDefaultEthereumOptions } from "./options"; +import EthereumOptions, { getDefaultOptions } from "./options"; import { JsonRpcData, JsonRpcQuantity, IndexableJsonRpcData } from "../../types/json-rpc"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; import Address, { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; +import JsonRpc from "../../servers/utils/jsonrpc"; +const createKeccakHash = require("keccak"); +// Read in the current ganache version from the package.json +const {name, version} = require("../../../package.json"); +//#endregion +//#region Constants +const CLIENT_VERSION = `EthereumJS ${name}/v${version}/ethereum-js` +const PROTOCOL_VERSION = JsonRpcData.from("0x3f"); const BUFFER_ZERO = Buffer.from([0]); -const createKeccakHash = require("keccak"); +const RPCQUANTITY_ZERO = JsonRpcQuantity.from("0x0"); +//#endregion const hash = createKeccakHash("keccak256"); +const _accounts = Symbol("accounts"); const _options = Symbol("options"); const _coinbase = Symbol("coinbase"); const _isMining = Symbol("isMining"); @@ -19,9 +30,9 @@ const _blockchain = Symbol("blockchain"); const _knownAccounts = Symbol("knownAccounts"); const _unlockedAccounts = Symbol("unlockedAccounts"); - export default class Ethereum implements ILedger { - private readonly [_knownAccounts] = new Set(); + private readonly [_accounts]: Address[]; + private readonly [_knownAccounts] = new Map(); private readonly [_unlockedAccounts] = new Set(); private readonly [_options]: EthereumOptions; private readonly [_coinbase]: Account; @@ -36,61 +47,82 @@ export default class Ethereum implements ILedger { * @param ready Callback for when the ledger is fully initialized */ constructor(options: EthereumOptions, ready: () => {}) { - const opts = this[_options] - = Object.assign(getDefaultEthereumOptions(), options); - this[_coinbase] = opts.accounts[0]; - opts.accounts.forEach((account) => { - const address = account.address.toString().toLowerCase(); - this[_knownAccounts].add(address); + const opts = this[_options] = Object.assign(getDefaultOptions(), options); + const accounts = opts.accounts; + const knownAccounts = this[_knownAccounts]; + const unlockedAccounts = this[_unlockedAccounts]; + + //#region Configure Known and Unlocked Accounts + this[_coinbase] = accounts[0]; + const l = accounts.length; + const accountsCache = this[_accounts] = Array(l); + for (let i = 0; i < l; i++) { + const account = accounts[i]; + const address = account.address; + const strAddress = address.toString().toLowerCase(); + accountsCache[i] = address; + knownAccounts.set(strAddress, account.privateKey); // if the `secure` option has been set do NOT add these accounts to the // _unlockedAccounts - if (opts.secure) return; - - this[_unlockedAccounts].add(address); - }); - opts.unlockedAccounts.forEach((addressOrIndex: string | number) => { - let address; - switch (typeof addressOrIndex) { - case "string": - if (addressOrIndex.indexOf("0x") === 0) { - address = addressOrIndex; + if (opts.secure) continue; + + unlockedAccounts.add(strAddress); + } + //#endregion + + //#region Unlocked Accounts + const givenUnlockedUaccounts = opts.unlocked_accounts; + if (givenUnlockedUaccounts) { + const ul = givenUnlockedUaccounts.length; + for (let i = 0; i < ul; i++) { + let arg = givenUnlockedUaccounts[i]; + let address; + switch (typeof arg) { + case "string": + // `toLowerCase` so we handle uppercase `0X` formats + const addressOrIndex = arg.toLowerCase(); + if (addressOrIndex.indexOf("0x") === 0) { + address = addressOrIndex; + break; + } else { + // try to convert the arg string to a number. + // don't use parseInt because strings like `"123abc"` parse + // to `123`, and there is probably an error on the user's side we'd + // want to uncover. + const index = (arg as any) / 1; + // if we don't have a valid number, or the number isn't an valid JS + // integer (no bigints or decimals, please), throw an error. + if (!Number.isSafeInteger(index)) { + throw new Error(`Invalid value in unlocked_accounts: ${arg}`); + } + arg = index; + // not `break`ing here because I want this to fall through to the + // `"number"` case below. + // Refactor it if you want. + // break; // no break, please. + } + case "number": + const account = accounts[arg]; + if (account == null) { + throw new Error( + `Account at index ${addressOrIndex} not found. Max index available + is ${l - 1}.` + ); + } + address = account.address.toString().toLowerCase(); break; - } else { - addressOrIndex = parseInt(addressOrIndex as string, 10); - // not `break`ing here because I want this to fall - // through to the `number` case. - // Refactor it if you want. - // break; // no break, please - } - case "number": - const account = opts.accounts[addressOrIndex]; - if (!account) { + default: throw new Error( - `Account at index ${addressOrIndex} not found. Max - index available is - ${opts.accounts.length - 1}.` + `Invalid value specified in unlocked_accounts` ); - } - address = account.address.toString(); - break; - default: - throw new Error( - `Invalid value specified in unlocked_accounts` - ); + } + unlockedAccounts.add(address); } - this[_knownAccounts].add(address.toLowerCase()); - }); - - const chain = this[_blockchain] = new Blockchain( - opts.db, - opts.dbPath, - opts.accounts, - opts.hardfork, - opts.allowUnlimitedContractSize, - opts.gasLimit, - opts.timestamp - ); + } + //#endregion + + const chain = this[_blockchain] = new Blockchain(options); chain.on("ready", ready); } @@ -99,7 +131,7 @@ export default class Ethereum implements ILedger { * @returns The current client version. */ async web3_clientVersion(): Promise { - return "EthereumJS canache-core/v" + 0 + "/ethereum-js"; + return CLIENT_VERSION; }; /** @@ -107,24 +139,17 @@ export default class Ethereum implements ILedger { * @param {string} the data to convert into a SHA3 hash. * @returns The SHA3 result of the given string. */ - async web3_sha3(string: string): Promise { - return hash(string).digest(); + async web3_sha3(string: string): Promise { + return JsonRpcData.from(hash(string).digest()); }; - /** - * Returns number of peers currently connected to the client. - * @returns {QUANTITY} integer of the number of connected peers. - */ - async net_peerCount(): Promise { - return 0n; - } - /** * Returns the current network id. - * @returns The current network id. + * @returns {string} The current network id. This value should NOT be JSON-RPC + * Quantity/Data encoded. */ async net_version(): Promise { - return this[_options].net_version; + return this[_options].net_version.toString(); } /** @@ -135,19 +160,28 @@ export default class Ethereum implements ILedger { return true; } + /** + * Returns number of peers currently connected to the client. + * @returns {QUANTITY} integer of the number of connected peers. + */ + async net_peerCount(): Promise { + return RPCQUANTITY_ZERO; + } + /** * Returns the current ethereum protocol version. * @returns The current ethereum protocol version. */ - async eth_protocolVersion(): Promise { - return "63"; + async eth_protocolVersion(): Promise { + return PROTOCOL_VERSION; } /** * Returns an object with data about the sync status or false. * @returns An object with sync status data or false, when not syncing: - * startingBlock: {bigint} - The block at which the import started (will only be reset, after the sync reached his head) + * startingBlock: {bigint} - The block at which the import started (will + * only be reset, after the sync reached his head) * currentBlock: {bigint} - The current block, same as eth_blockNumber * highestBlock: {bigint} - The estimated highest block */ @@ -159,7 +193,7 @@ export default class Ethereum implements ILedger { * Returns the client coinbase address. * @returns 20 bytes - the current coinbase address. */ - async eth_coinbase(): Promise { + async eth_coinbase(): Promise
{ return this[_coinbase] ? this[_coinbase].address : null; } @@ -175,15 +209,15 @@ export default class Ethereum implements ILedger { * Returns the number of hashes per second that the node is mining with. * @returns number of hashes per second. */ - async eth_hashrate(): Promise { - return 0n; + async eth_hashrate(): Promise { + return RPCQUANTITY_ZERO; } /** * Returns the current price per gas in wei. * @returns integer of the current gas price in wei. */ - async eth_gasPrice(): Promise { + async eth_gasPrice(): Promise { return this[_options].gasPrice; } @@ -191,8 +225,8 @@ export default class Ethereum implements ILedger { * Returns a list of addresses owned by client. * @returns Array of 20 Bytes - addresses owned by the client. */ - async eth_accounts(): Promise { - return this[_options].accounts.map(account => account.address); + async eth_accounts(): Promise { + return this[_accounts]; } /** @@ -207,9 +241,13 @@ export default class Ethereum implements ILedger { /** * Returns the balance of the account of given address. * @param address 20 Bytes - address to check for balance. - * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter + * @param blockNumber integer block number, or the string "latest", "earliest" + * or "pending", see the default block parameter */ - async eth_getBalance(address: IndexableAddress, blockNumber: bigint | Tag = Tag.LATEST): Promise { + async eth_getBalance( + address: IndexableAddress, + blockNumber: bigint | Tag = Tag.LATEST + ): Promise { const chain = this[_blockchain]; const str = blockNumber.toString(); const block = await chain.blocks.get(Buffer.from([0])); @@ -229,28 +267,19 @@ export default class Ethereum implements ILedger { transasctionHash = JsonRpcData.from(transasctionHash); const chain = this[_blockchain]; - // const block = await chain.blocks.get(Tag.LATEST); - - // // TODO: just POC stuff I was working on... - // if (!block) { - // const b = new Block(null as any); - // b.header.number = Buffer.from("1234", "hex"); - // const c = b.serialize(true); - // const d = new Block(c); - // // await chain.blocks.set(Tag.LATEST, c); - // } - // const block2 = await chain.blocks.get(Tag.LATEST); - // // END - - const transaction = await chain.transactions.get(transasctionHash); return transaction; } async eth_sendTransaction(transaction: any): Promise { - const from = transaction.from ? JsonRpcData.from(transaction.from).toString().toLowerCase() : null; + let fromString = transaction.from; + let from; + if (fromString) { + from = Address.from(transaction.from); + fromString = from.toString().toLowerCase(); + } - if (from == null) { + if (fromString == null) { throw new Error("from not found; is required"); } @@ -261,8 +290,8 @@ export default class Ethereum implements ILedger { throw new Error("Invalid to address"); } - const isKnownAccount = this[_knownAccounts].has(from); - const isUnlockedAccount = this[_knownAccounts].has(from); + const isKnownAccount = this[_knownAccounts].has(fromString); + const isUnlockedAccount = this[_unlockedAccounts].has(fromString); if (!isUnlockedAccount) { const msg = isKnownAccount ? "signer account is locked" : "sender account not recognized"; @@ -276,11 +305,11 @@ export default class Ethereum implements ILedger { const tx = Transaction.fromJSON(transaction, type); if (tx.gasLimit.length === 0) { - tx.gasLimit = Buffer.from("15f90", "hex"); + tx.gasLimit = Buffer.from("015f90", "hex"); } if (tx.gasPrice.length === 0) { - tx.gasPrice = JsonRpcQuantity.from(this[_options].gasPrice).toBuffer(); + tx.gasPrice = this[_options].gasPrice.toBuffer(); } if (tx.value.length === 0) { @@ -291,6 +320,15 @@ export default class Ethereum implements ILedger { tx.to = Buffer.allocUnsafe(0); } + if (isKnownAccount) { + if (tx.nonce.length === 0) { + const account = await this[_blockchain].accounts.get(from); + tx.nonce = JsonRpcQuantity.from(1n + account.nonce.toBigInt()).toBuffer(); + } + const secretKey = this[_knownAccounts].get(fromString); + tx.sign(secretKey.toBuffer()); + } + return this[_blockchain].queueTransaction(tx); } diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 668584f657..e594a53e11 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -3,17 +3,17 @@ import Account from "../../types/account"; import { JsonRpcQuantity } from "../../types/json-rpc"; type EthereumOptions = ILedgerOptions & { - net_version: string, - gasPrice?: bigint, - accounts: Account[], - unlockedAccounts: string[] | number[], - allowUnlimitedContractSize: boolean, - hardfork: string, - gasLimit: JsonRpcQuantity, + net_version?: string | number, + gasPrice?: JsonRpcQuantity, + accounts?: Account[], + unlocked_accounts?: string[] | number[], + allowUnlimitedContractSize?: boolean, + hardfork?: string, + gasLimit?: JsonRpcQuantity, timestamp?: Date, db?: object, - dbPath?: string, - secure: boolean + db_path?: string, + secure?: boolean } export default EthereumOptions; diff --git a/src/ledgers/ethereum/things/account-manager.ts b/src/ledgers/ethereum/things/account-manager.ts index 697569f8a5..364adc3c89 100644 --- a/src/ledgers/ethereum/things/account-manager.ts +++ b/src/ledgers/ethereum/things/account-manager.ts @@ -3,19 +3,24 @@ import Account from "../../../types/account"; import Address from "../../../types/address"; import Trie from "merkle-patricia-tree/baseTrie"; import { promisify } from "util"; +import Blockchain from "../blockchain"; export default class AccountManager { - private db: Database; - constructor(db: Database) { - this.db = db; + private blockchain: Blockchain; + constructor(blockchain: Blockchain) { + this.blockchain = blockchain; } public async get(address: Address, blockTag: string = "latest"): Promise { - const block = await this.db.blocks.get(Buffer.from([0])); - const trieCopy = new Trie(this.db.trie, block.value.header.stateRoot); - const get = promisify(trieCopy.get.bind(trieCopy, address.toBuffer())); - const data = await get(); - return new Account(data); + const blockchain = this.blockchain; + const block = await blockchain.blocks.get(Buffer.from([0])); + const trieCopy = new Trie((blockchain as any).database.trie, block.value.header.stateRoot); + return new Promise((resolve, reject) => { + trieCopy.get(address.toBuffer(), (err, data)=>{ + if(err) return reject(err); + resolve(new Account(data)); + }); + }); } } diff --git a/src/ledgers/ethereum/things/block-manager.ts b/src/ledgers/ethereum/things/block-manager.ts index a500af6956..75df211796 100644 --- a/src/ledgers/ethereum/things/block-manager.ts +++ b/src/ledgers/ethereum/things/block-manager.ts @@ -1,10 +1,10 @@ import EthereumJsBlock from "ethereumjs-block"; -import Database from "../database"; import Manager from "./manager"; -const Heap: any = require("heap") +import Tag from "../../../types/tags"; +import levelup = require("levelup"); +import Blockchain from "../blockchain"; export default class BlockManager extends Manager { - /** * The earliest block */ @@ -20,10 +20,10 @@ export default class BlockManager extends Manager { */ public pending: Block; - constructor(db: Database) { - super(db, Block, "block"); + constructor(blockchain: Blockchain, base: levelup.LevelUp) { + super(blockchain, base, Block); - db.once("open").then(() => { + blockchain.on("open", () => { // TODO: get the last key, set as "earliest" // TODO: get the first last key, set as "latest" }); @@ -45,12 +45,36 @@ export default class BlockManager extends Manager { * @param header */ createBlock(header: {}): Block { - const block = new Block(null); + const block = new Block(null, this); // TODO: make better Object.assign(block.value.header, header); return block; } + async get(keyOrBlock: string | Buffer | Tag): Promise { + if (typeof keyOrBlock === "string") { + const tag = Tag.normalize(keyOrBlock as Tag); + switch (tag) { + case Tag.LATEST: + return this.latest; + case undefined: + case null: + // the key is probably a hex string, let nature takes it's course. + break; + case Tag.PENDING: + return this.pending; + case Tag.EARLIEST: + return this.earliest; + default: + // this probably can't happen. but if someone passed something like + // `toString` in as a block tag and it got this far... maybe we'd + // get here... + throw new Error(`Invalid block Tag: ${keyOrBlock}`); + } + } + return super.get(keyOrBlock); + } + /** * Writes the block object to the underlying database. * @param block @@ -77,47 +101,9 @@ export default class BlockManager extends Manager { export class Block { public readonly manager: BlockManager; public readonly value: EthereumJsBlock; - constructor(raw: Buffer, manager?: BlockManager) + constructor(raw: Buffer, manager: BlockManager) { this.value = new EthereumJsBlock(raw); this.manager = manager; - // const byAddresses:any = {}; - // this._transactions.byPriceAndNonce = new Heap((a:any, b:any) => { - // let aAccountOrder = byAddresses[a.address]; - // let first = aAccountOrder.peek(); - // if (first === a) { - // // sort by gasPrice - // return a.gasPrice - b.gasPrice; - // } - // if (a.address === b.address) { - // return b.nonce - a.nonce; - // } else { - // // otherwise sort by gasPrice - // return a.gasPrice - b.gasPrice; - // } - // }); - // this.transactions = { - // push: (transaction: any) => { - // // get the first tx by account (via nonce) - // // then sort by price - // let addressHeap = byAddresses[transaction.address]; - // if (!addressHeap) { // to check for equality and then compare by gasPrice. - // addressHeap = new Heap((a:any, b:any) => { - // return b.nonce - a.nonce; - // }); - // byAddresses[transaction.address] = addressHeap; - // } - // addressHeap.push(transaction); - - // this.transactions.byPriceAndNonce.push(transaction); - - // } - // }; } - // _transactions: { - // byAddresses: any, - // byPriceAndNonce: any, - // } - // // TODO: https://ethereum.stackexchange.com/a/2809/44640 - // transactions: any } diff --git a/src/ledgers/ethereum/things/manager.ts b/src/ledgers/ethereum/things/manager.ts index 278e53c4c9..d2e7616321 100644 --- a/src/ledgers/ethereum/things/manager.ts +++ b/src/ledgers/ethereum/things/manager.ts @@ -1,20 +1,22 @@ -const sub = require("subleveldown"); import levelup from "levelup"; -import Database from "../database"; -const levelupOptions: any = { valueEncoding: "binary" }; +import { JsonRpcData } from "../../../types/json-rpc"; +import Blockchain from "../blockchain"; export type Instantiable = {new(...args: any[]): T}; export default class Manager { + protected blockchain: Blockchain; private Type: Instantiable; - public db: Database; protected base: levelup.LevelUp; - constructor(db: Database, type: Instantiable, name: string){ + constructor(blockchain: Blockchain, base: levelup.LevelUp, type: Instantiable){ this.Type = type; - this.db = db; - this.base = sub(db.db, name, levelupOptions); + this.blockchain = blockchain; + this.base = base; } get(key: string | Buffer): Promise { + if (typeof key === "string") { + key = JsonRpcData.from(key).toBuffer(); + } return this.base.get(key).then((raw) => new this.Type(raw)); } set(key: string | Buffer, value: Buffer): Promise { diff --git a/src/ledgers/ethereum/things/transaction-manager.ts b/src/ledgers/ethereum/things/transaction-manager.ts index 881694a646..0319e2ad98 100644 --- a/src/ledgers/ethereum/things/transaction-manager.ts +++ b/src/ledgers/ethereum/things/transaction-manager.ts @@ -1,31 +1,24 @@ import Transaction from "../../../types/transaction"; -import Database from "../database"; import Manager from "./manager"; -import TransactionPool from "./transaction-pool"; +import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; +import levelup = require("levelup"); +import Blockchain from "../blockchain"; + +export type TransactionManagerOptions = TransactionPoolOptions; export default class TransactionManager extends Manager { public transactionPool: TransactionPool; - constructor(db: Database) { - super(db, Transaction, "transactions"); + constructor(blockchain: Blockchain, base: levelup.LevelUp, options: TransactionManagerOptions) { + super(blockchain, base, Transaction); - this.transactionPool = new TransactionPool(db); + this.transactionPool = new TransactionPool(blockchain, options); this.transactionPool.on("drain", (transactions: any[]) => { - transactions - }) + // TODO: create pending block? + }); } public push(transaction: Transaction): Promise { return this.transactionPool.insert(transaction); } } - -// export class Transaction { -// private readonly manager: TransactionManager; -// public readonly value: _Transaction; -// constructor(raw: Buffer, manager?: TransactionManager) { -// // todo: make _Transaction take the raw Buffer -// this.value = new _Transaction(/*raw*/); -// this.manager = manager; -// } -// } diff --git a/src/ledgers/ethereum/things/transaction-pool.ts b/src/ledgers/ethereum/things/transaction-pool.ts index 95b869371b..944d1babac 100644 --- a/src/ledgers/ethereum/things/transaction-pool.ts +++ b/src/ledgers/ethereum/things/transaction-pool.ts @@ -1,8 +1,9 @@ import Emittery from "emittery"; -import Database from "../database"; +import Blockchain from "../blockchain"; import Errors from "./errors"; import Heap from "../../../utils/heap"; import Transaction from "../../../types/transaction"; +import { JsonRpcData, JsonRpcQuantity } from "../../../types/json-rpc"; // OLD insertion sort: // function siftUp(comparator: (a:T, b:T) => boolean, array: T[], value: T, startingIndex = 0, endingIndex = array.length) { @@ -14,6 +15,11 @@ import Transaction from "../../../types/transaction"; // return i; // } +export type TransactionPoolOptions = { + gasPrice?: JsonRpcQuantity, + gasLimit?: JsonRpcQuantity +}; + function byNonce(values: Transaction[], a: number, b: number) { return values[b].nonce.toBigInt() < values[a].nonce.toBigInt(); } @@ -69,6 +75,8 @@ function calculateIntrinsicGas(data: Buffer): bigint { } export default class TransactionPool extends Emittery { + private options: TransactionPoolOptions; + /** * Minimum gas price to enforce for acceptance into the pool */ @@ -104,10 +112,11 @@ export default class TransactionPool extends Emittery { */ public lifetime: number = 3 * 24 * 60 * 60 * 1000 - private db: Database; - constructor(db: Database) { + private blockchain: Blockchain; + constructor(blockchain: Blockchain, options: TransactionPoolOptions) { super(); - this.db = db; + this.blockchain = blockchain; + this.options = options; } public length: number; private hashes = new Set(); @@ -167,39 +176,38 @@ export default class TransactionPool extends Emittery { } public async validateTransaction(transaction: Transaction): Promise { - // // TODO: Check the transaction doesn't exceed the current block limit gas. - // if (this.blockchain.gasLimit < transaction.gasLimit) { - // return new Error("Transaction gasLimit is too low"); - // } + // Check the transaction doesn't exceed the current block limit gas. + if (this.options.gasLimit < JsonRpcQuantity.from(transaction.gasLimit)) { + return new Error("Transaction gasLimit is too low"); + } // Transactions can't be negative. This may never happen using RLP // decoded transactions but may occur if you create a transaction using // the RPC for example. - // if (transaction.value.toBigInt() < 0) { - // return new Error("Transaction value cannot be negative"); - // } + if (transaction.value < 0) { + return new Error("Transaction value cannot be negative"); + } // Should supply enough intrinsic gas - // const gas = calculateIntrinsicGas(transaction.input.toBuffer()); - // if (transaction.gasPrice.toBigInt() < gas) { - // return new Error("intrisic gas too low"); - // } + const gas = calculateIntrinsicGas(transaction.input); + if (transaction.gasPrice < gas) { + return new Error("intrisic gas too low"); + } - const from = transaction.from; - // todo: get the origin account - // const originAccount = await this.db.accounts.get(from); + const from = JsonRpcData.from(transaction.from); + const transactor = await this.blockchain.accounts.get(from); - // TODO: Transactor should have enough funds to cover the costs + // Transactor should have enough funds to cover the costs // cost == V + GP * GL - // if (originAccount.balance.toBigInt() < transaction.cost()) { - // return new Error("Account does not have enough funds to complete transaction"); - // } + console.log(transactor.balance.toBigInt()); + if (transactor.balance.toBigInt() < transaction.cost()) { + return new Error("Account does not have enough funds to complete transaction"); + } - // TODO: check that the nonce isn't too low - - // if ( currentaccount.nonce.toBigInt() > transaction.nonce.toBigInt()) { - // return new Error("Transaction nonce is too low"); - // } + // check that the nonce isn't too low + if (transactor.nonce > transaction.nonce) { + return new Error("Transaction nonce is too low"); + } return null; } } \ No newline at end of file diff --git a/src/options/options.ts b/src/options/options.ts index 275148a87e..fd9570df57 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -2,11 +2,20 @@ import Account from "../types/account"; import {JsonRpcData, JsonRpcQuantity} from "../types/json-rpc"; import ILedger from "../interfaces/ledger"; import Ethereum from "../ledgers/ethereum/ledger"; +import { TupleType } from "typescript"; interface Logger { log(message?: any, ...optionalParams: any[]): void; } +// Okay, so a "bug" in TS treats types with the same shape as having the same +// name, so Intellisense would say that AccountType requires `[Address, Address]` +// instead of `[Address, PrivateKey]`, flip flopping like this "fixes" it. +type Address = {} & string; +type PrivateKey = string & {}; +type AccountTuple = [Address, PrivateKey]; + + export default interface Options { ledger?: ILedger, /** @@ -16,7 +25,7 @@ export default interface Options { * the given balance. If specified, the key is used to determine the account's * address. */ - accounts?: Account[], + accounts?: Array, /** * Output VM opcodes for debugging. Defaults to `false` @@ -46,7 +55,7 @@ export default interface Options { /** * Number of accounts to generate at startup. Default to `10`. */ - total_accounts?: bigint, + total_accounts?: number, /** * When a string, same as --fork option above. Can also be a Web3 Provider @@ -63,7 +72,12 @@ export default interface Options { fork_block_number?: string | bigint, /** - * Same as --networkId option above. + * Same as --networkId option above. Alias of network_id. + */ + net_version?: string | number, + + /** + * Same as --networkId option above. Alias of net_version. */ network_id?: string | number, @@ -79,7 +93,7 @@ export default interface Options { locked?: boolean, /** - * Array of addresses or address indexes specifying which accounts should be unlocked. + * Array of addresses or address indexes specifying which accounts should be unlocked. Alias of unlockedAccounts */ unlocked_accounts?: string[] | number[], @@ -143,13 +157,14 @@ export default interface Options { }; export const getDefault: (options: Options)=> Options = (options) => { - const network_id = (options && options.network_id || Date.now()).toString(); + const network_id = (options && options.net_version || options.network_id || Date.now()).toString(); return Object.assign({ debug: false, logger: {log: () => {}}, default_balance_ether: 100n, total_accounts: 10n, network_id, + net_version: network_id, locked: false, vmErrorsOnRPCResponse: true, hdPath: "m/44'/60'/0'/0/", diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 4ebc50837a..32f28ecbb5 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -5,10 +5,10 @@ const seedrandom = require("seedrandom"); function randomBytes(length: any, rng: any): any { - var buf = []; + var buf = Array(length); for (var i = 0; i < length; i++) { - buf.push(rng() * 255); + buf[i] = rng() * 255; } return Buffer.from(buf); diff --git a/src/provider.ts b/src/provider.ts index 2f475e2973..060aa8a117 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -9,11 +9,14 @@ import { generateMnemonic, mnemonicToSeedSync } from "bip39"; import { JsonRpcQuantity, JsonRpcData } from "./types/json-rpc"; import Address from "./types/address"; import JsonRpc from "./servers/utils/jsonrpc"; +import EthereumOptions from "./ledgers/ethereum/options"; const hdkey = require("ethereumjs-wallet/hdkey"); export type ProviderOptions = ProviderOptions; +const WEI = 1000000000000000000n; + const options = Symbol("options"); const engine = Symbol("engine"); const requestProcessor = Symbol("requestProcessor"); @@ -44,19 +47,11 @@ export default class Provider extends Emittery { this.wallet = hdkey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); const accounts = this.initializeAccounts(); - const net_version = _providerOptions.network_id.toString(); - const ledger = _providerOptions.ledger || new Ethereum({ - db: _providerOptions.db, - dbPath: _providerOptions.db_path, - net_version, - accounts, - allowUnlimitedContractSize: _providerOptions.allowUnlimitedContractSize, - hardfork: _providerOptions.hardfork, - gasLimit: _providerOptions.gasLimit, - timestamp: _providerOptions.time, - unlockedAccounts: _providerOptions.unlocked_accounts || [], - secure: _providerOptions.secure - }, _requestProcessor.resume.bind(_requestProcessor)); + // ethereum options' `accounts` are different than the provider options' + // `accounts`, fix that up here: + const ethereumOptions = _providerOptions as any as EthereumOptions; + ethereumOptions.accounts = accounts; + const ledger = _providerOptions.ledger || new Ethereum(ethereumOptions, _requestProcessor.resume.bind(_requestProcessor)); this[engine] = new Engine(ledger); } @@ -64,34 +59,41 @@ export default class Provider extends Emittery { // move this into the Ledger or it's Blockchain? private initializeAccounts(): Account[]{ const _providerOptions = this[options]; + const etherInWei = JsonRpcQuantity.from(JsonRpcQuantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); let accounts: Account[]; - if (_providerOptions.accounts) { - accounts = _providerOptions.accounts.map((account) => { - return this.createAccount(account.balance, account.privateKey, account.address); - }); - } else if(_providerOptions.total_accounts) { - accounts = []; - const hdPath = this[options].hdPath; - const wallet = this.wallet; - - const ether = JsonRpcQuantity.from(_providerOptions.default_balance_ether); - for (let index = 0; index < _providerOptions.total_accounts; index++) { - const acct = wallet.derivePath(hdPath + index); - const accountWallet = acct.getWallet(); - const address = Address.from(accountWallet.getAddress()); - const privateKey = JsonRpcData.from(accountWallet.getPrivateKey()); - accounts.push(this.createAccount(ether, privateKey, address)); + let givenAccounts = _providerOptions.accounts + if (givenAccounts) { + const l = givenAccounts.length; + accounts = Array(l); + for (let i = 0; i < l; i++) { + const account = givenAccounts[i]; + accounts[i] = this.createAccount(etherInWei, JsonRpcData.from(account[1]), JsonRpcData.from(account[0])); } } else { - throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); + const l =_providerOptions.total_accounts; + if (l) { + accounts = Array(l); + const hdPath = this[options].hdPath; + const wallet = this.wallet; + + for (let index = 0; index < l; index++) { + const acct = wallet.derivePath(hdPath + index); + const accountWallet = acct.getWallet(); + const address = Address.from(accountWallet.getAddress()); + const privateKey = JsonRpcData.from(accountWallet.getPrivateKey()); + accounts[index] = this.createAccount(etherInWei, privateKey, address); + } + } else { + throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); + } } return accounts; } // TODO: this should probable be moved as well (see `initializeAccounts` above) private createAccount(balance: JsonRpcQuantity, privateKey: JsonRpcData, address?: Address) { - address = address || Address.from(privateToAddress(Buffer.from(privateKey.toString(), "hex"))); + address = address || Address.from(privateToAddress(privateKey.toBuffer())); const account = new Account(address); account.privateKey = privateKey; diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index 009d59aaeb..dce5e669ef 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -3,6 +3,8 @@ export type IndexableJsonRpcType Buffer.from((value as string).slice(2), "hex")); + toBuffers.set(this, () => { + let fixedValue = (value as string).slice(2); + if (fixedValue.length % 2 === 1) { + fixedValue = "0" + fixedValue; + } + return Buffer.from(fixedValue, "hex"); + }); } else { // handle a string toStrings.set(this, () => { const buf = this.toBuffer(); return buf.toString("hex"); }); + // treat string without `0x` as just plain text. This is probably + // wrong. TODO: look into this. toBuffers.set(this, () => Buffer.from(value as string)); } break; } - case "undefined": { - strCache.set(this, value); - bufCache.set(this, Buffer.from([])); - break; - } default: + // handle undefined/null + if (value == null) { + // This is a weird thing that returns undefined/null for a call + // to toString(). + this.toString = () => value as string; + bufCache.set(this, EMPTY_BUFFER); + break; + } throw new Error(`Cannot wrap a "${type}" as a json-rpc type`); } self[Symbol.toStringTag] = type; diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index b8b2b3d7e5..bf123ad350 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -8,13 +8,44 @@ class JsonRpcQuantity extends BaseJsonRpcType { } public toBigInt(): bigint { const value = this.value; + + // TODO: memoize this stuff if (Buffer.isBuffer(value)) { - const view = new DataView(value.buffer); - return view.getBigUint64(value.byteOffset as any) as bigint; + // Parsed as BE. + + // This doesn't handle negative values. We may need to add logic to handle + // it because it is possible values returned from the VM could be negative + // and stored in a buffer. + + + const length = value.byteLength; + // Buffers that are 6 bytes or less can be converted with built-in methods + if (length <= 6) { + return BigInt(value.readUIntBE(0, length)); + } + + let view: DataView; + // Buffers that are 7 bytes need to be padded to 8 bytes + if (length === 7) { + const padded = new Uint8Array(8); + // set byte 0 to 0, and bytes 1-8 to the value's 7 bytes: + padded.set(value, 1); + view = new DataView(padded.buffer); + } else if (length === 8) { + view = new DataView(value.buffer, value.byteOffset, length); + } else { + // TODO: handle bigint's stored as Buffers that are this big? + // It's not too hard. + throw new Error(`Cannot convert Buffer of length ${length} to bigint!`); + } + return view.getBigUint64(0) as bigint; } else { return BigInt(this.value); } } + valueOf(): bigint { + return this.toBigInt(); + } } type $ = { new(value: T): _JsonRpcQuantity & JsonRpcType, diff --git a/src/types/tags.ts b/src/types/tags.ts index a03e58ec2f..9fe32e1eba 100644 --- a/src/types/tags.ts +++ b/src/types/tags.ts @@ -12,22 +12,18 @@ enum _Tag { namespace Tag { export function normalize(tag: keyof typeof _Tag|Tag): Tag { let t: Tag; - if(typeof tag === "string"){ + if (typeof tag === "string") { t = (Tag)[tag.toUpperCase()]; } else { switch (tag) { - case Tag.EARLIEST: + case _Tag.earliest: return Tag.EARLIEST; - case Tag.LATEST: + case _Tag.latest: return Tag.LATEST; - case Tag.PENDING: + case _Tag.pending: return Tag.PENDING; } } - - if (!t) { - throw new Error("Invalid tag: " + tag); - } return t; } } diff --git a/src/types/transaction.ts b/src/types/transaction.ts index e9c9501fc3..c4f0d67959 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -276,6 +276,10 @@ export default class Transaction extends EthereumJsTransaction { }; } + cost(): bigint { + return JsonRpcQuantity.from(this.gasPrice).toBigInt() * JsonRpcQuantity.from(this.gas).toBigInt() + JsonRpcQuantity.from(this.value).toBigInt(); + } + /** * Prepares arbitrary JSON data for use in a Transaction. * @param {Object} json JSON object representing the Transaction @@ -367,9 +371,9 @@ export default class Transaction extends EthereumJsTransaction { * Signs the transaction and sets the `type` bit for `signed` to 1, * i.e., `isSigned() === true` */ - sign() { - sign.apply(this, arguments); + sign(secretKey: Buffer) { this.type |= Transaction.types.signed; + return sign.call(this, secretKey); } /** diff --git a/src/utils/heap.ts b/src/utils/heap.ts index ca8e607422..e561d66f75 100644 --- a/src/utils/heap.ts +++ b/src/utils/heap.ts @@ -1,5 +1,3 @@ -import { updateArrayBindingPattern } from "typescript"; - type Comparator = (values: T[], a: number, b: number) => boolean; class Heap { public best: number = 0; From 3dc52ad9fe9331b472e31bdaf9d3e1162fb35375 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 24 Apr 2019 21:50:10 -0400 Subject: [PATCH 037/691] Uno mas --- src/server.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/server.ts b/src/server.ts index 882112aee6..f9f04cb095 100644 --- a/src/server.ts +++ b/src/server.ts @@ -10,28 +10,27 @@ import HttpServer from "./servers/http-server"; const options = Symbol("options"); const listenSocket = Symbol("listenSocket"); const app = Symbol("app"); -const provider = Symbol("provider"); const websocketServer = Symbol("websocketServer"); const httpServer = Symbol("httpServer"); export default class Server { private [app]: TemplatedApp; - private [provider]: Provider; + private provider: Provider; private [options]: ServerOptions; private [httpServer]: HttpServer; private [listenSocket]: us_listen_socket; private [websocketServer]: WebsocketServer; constructor(serverOptions?: ServerOptions) { - this[options] = getDefaultServerOptions(serverOptions); - this[provider] = new Provider(this[options]); + const opts = this[options] = getDefaultServerOptions(serverOptions); + const prov = this.provider = new Provider(opts); const _app = this[app] = uWS.App(null); if (this[options].ws) { - this[websocketServer] = new WebsocketServer(_app, this[provider]); + this[websocketServer] = new WebsocketServer(_app, prov); } - this[httpServer] = new HttpServer(_app, this[provider]); + this[httpServer] = new HttpServer(_app, prov); } async listen(port: number, callback?: (err: Error) => void): Promise { From 81970ab819ed4bc47ee8d33cc853e043e1cd2f9d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 24 Apr 2019 21:55:43 -0400 Subject: [PATCH 038/691] clean up --- src/ledgers/ethereum/database.ts | 3 -- src/ledgers/ethereum/ledger.ts | 1 - .../ethereum/things/account-manager.ts | 2 -- .../ethereum/things/transaction-pool.ts | 2 -- src/options/options.ts | 5 +-- src/types/json-rpc/json-rpc-quantity.ts | 2 -- src/types/transaction.ts | 36 ++++++++++--------- 7 files changed, 20 insertions(+), 31 deletions(-) diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index a277749246..695f41e090 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -1,9 +1,6 @@ import Emittery from "emittery"; import { dir } from "tmp-promise"; import levelup from "levelup"; -import AccountManager from "./things/account-manager"; -import BlockManager from "./things/block-manager"; -import TransactionManager from "./things/transaction-manager"; import Blockchain from "./blockchain"; const leveldown = require("leveldown"); const sub = require( "subleveldown"); diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 553cf8bcfc..0b0ca474de 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -7,7 +7,6 @@ import Tag from "../../types/tags"; import Address, { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; -import JsonRpc from "../../servers/utils/jsonrpc"; const createKeccakHash = require("keccak"); // Read in the current ganache version from the package.json const {name, version} = require("../../../package.json"); diff --git a/src/ledgers/ethereum/things/account-manager.ts b/src/ledgers/ethereum/things/account-manager.ts index 364adc3c89..4e399cef69 100644 --- a/src/ledgers/ethereum/things/account-manager.ts +++ b/src/ledgers/ethereum/things/account-manager.ts @@ -1,8 +1,6 @@ -import Database from "../database"; import Account from "../../../types/account"; import Address from "../../../types/address"; import Trie from "merkle-patricia-tree/baseTrie"; -import { promisify } from "util"; import Blockchain from "../blockchain"; export default class AccountManager { diff --git a/src/ledgers/ethereum/things/transaction-pool.ts b/src/ledgers/ethereum/things/transaction-pool.ts index 944d1babac..ae99cbd3a5 100644 --- a/src/ledgers/ethereum/things/transaction-pool.ts +++ b/src/ledgers/ethereum/things/transaction-pool.ts @@ -198,8 +198,6 @@ export default class TransactionPool extends Emittery { const transactor = await this.blockchain.accounts.get(from); // Transactor should have enough funds to cover the costs - // cost == V + GP * GL - console.log(transactor.balance.toBigInt()); if (transactor.balance.toBigInt() < transaction.cost()) { return new Error("Account does not have enough funds to complete transaction"); } diff --git a/src/options/options.ts b/src/options/options.ts index fd9570df57..b563454072 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -1,8 +1,6 @@ import Account from "../types/account"; -import {JsonRpcData, JsonRpcQuantity} from "../types/json-rpc"; +import {JsonRpcQuantity} from "../types/json-rpc"; import ILedger from "../interfaces/ledger"; -import Ethereum from "../ledgers/ethereum/ledger"; -import { TupleType } from "typescript"; interface Logger { log(message?: any, ...optionalParams: any[]): void; @@ -15,7 +13,6 @@ type Address = {} & string; type PrivateKey = string & {}; type AccountTuple = [Address, PrivateKey]; - export default interface Options { ledger?: ILedger, /** diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index bf123ad350..73d12b2468 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -1,6 +1,4 @@ import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; -import { bufferToHex } from "ethereumjs-util"; -import { isBigIntLiteral } from "typescript"; class JsonRpcQuantity extends BaseJsonRpcType { public static from(value: number | bigint | string | Buffer) { diff --git a/src/types/transaction.ts b/src/types/transaction.ts index c4f0d67959..19dd68a1a9 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -56,22 +56,22 @@ import { JsonRpcQuantity } from "./json-rpc"; // r: JsonRpcData; // s: JsonRpcData; // constructor(transaction: TransactionData) { -// const obj = { -// blockHash: JsonRpcData.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. -// blockNumber: JsonRpcQuantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. -// from: JsonRpcData.from("0x123456", 32), // 20 Bytes - address of the sender. -// gas: JsonRpcQuantity.from(123n),// QUANTITY - gas provided by the sender. -// gasPrice: JsonRpcQuantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. -// hash: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. -// input: JsonRpcData.from("0x123"),// DATA - the data send along with the transaction. -// nonce: JsonRpcQuantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. -// to: JsonRpcData.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. -// transactionIndex: JsonRpcQuantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. -// value: JsonRpcQuantity.from(123n),// QUANTITY - value transferred in Wei. -// v: JsonRpcQuantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id -// r: JsonRpcData.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r -// s: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s -// } as any; +// const obj = { +// blockHash: JsonRpcData.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. +// blockNumber: JsonRpcQuantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. +// from: JsonRpcData.from("0x123456", 32), // 20 Bytes - address of the sender. +// gas: JsonRpcQuantity.from(123n),// QUANTITY - gas provided by the sender. +// gasPrice: JsonRpcQuantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. +// hash: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. +// input: JsonRpcData.from("0x123"),// DATA - the data send along with the transaction. +// nonce: JsonRpcQuantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. +// to: JsonRpcData.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. +// transactionIndex: JsonRpcQuantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. +// value: JsonRpcQuantity.from(123n),// QUANTITY - value transferred in Wei. +// v: JsonRpcQuantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id +// r: JsonRpcData.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r +// s: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s +// } as any; // Object.keys(obj).forEach((key) => { // (this as any)[key] = obj[key] as any; // }); @@ -277,7 +277,9 @@ export default class Transaction extends EthereumJsTransaction { } cost(): bigint { - return JsonRpcQuantity.from(this.gasPrice).toBigInt() * JsonRpcQuantity.from(this.gas).toBigInt() + JsonRpcQuantity.from(this.value).toBigInt(); + return JsonRpcQuantity.from(this.gasPrice).toBigInt() + * JsonRpcQuantity.from(this.gas).toBigInt() + + JsonRpcQuantity.from(this.value).toBigInt(); } /** From 176de98b0320fe00e462c2e86a4016a158ce01e4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 25 Apr 2019 19:07:07 -0400 Subject: [PATCH 039/691] commit to spite nick --- src/ledgers/ethereum/blockchain.ts | 6 ++--- .../{things => components}/account-manager.ts | 0 .../{things => components}/block-manager.ts | 6 ++--- .../ethereum/{things => components}/errors.ts | 0 .../{things => components}/manager.ts | 2 +- .../transaction-manager.ts | 0 .../transaction-pool.ts | 4 +-- src/ledgers/ethereum/ledger.ts | 8 ++++++ src/ledgers/ethereum/options.ts | 2 +- src/options/options.ts | 7 +++-- src/provider.ts | 2 +- src/types/account.ts | 6 +++-- src/types/json-rpc/index.ts | 2 +- src/types/json-rpc/json-rpc-base-types.ts | 27 ++++++++++++++++--- test/provider.ts | 4 ++- 15 files changed, 53 insertions(+), 23 deletions(-) rename src/ledgers/ethereum/{things => components}/account-manager.ts (100%) rename src/ledgers/ethereum/{things => components}/block-manager.ts (94%) rename src/ledgers/ethereum/{things => components}/errors.ts (100%) rename src/ledgers/ethereum/{things => components}/manager.ts (93%) rename src/ledgers/ethereum/{things => components}/transaction-manager.ts (100%) rename src/ledgers/ethereum/{things => components}/transaction-pool.ts (99%) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 36c8e9cdfc..deb2d1c915 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,14 +1,14 @@ import Database from "./database"; import Emittery from "emittery"; -import BlockManager, { Block } from "./things/block-manager"; -import TransactionManager from "./things/transaction-manager"; +import BlockManager, { Block } from "./components/block-manager"; +import TransactionManager from "./components/transaction-manager"; import Trie from "merkle-patricia-tree"; import { BN } from "ethereumjs-util"; import Account from "../../types/account"; import { promisify } from "util"; import { JsonRpcQuantity, JsonRpcData } from "../../types/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; -import AccountManager from "./things/account-manager"; +import AccountManager from "./components/account-manager"; const VM = require("ethereumjs-vm"); diff --git a/src/ledgers/ethereum/things/account-manager.ts b/src/ledgers/ethereum/components/account-manager.ts similarity index 100% rename from src/ledgers/ethereum/things/account-manager.ts rename to src/ledgers/ethereum/components/account-manager.ts diff --git a/src/ledgers/ethereum/things/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts similarity index 94% rename from src/ledgers/ethereum/things/block-manager.ts rename to src/ledgers/ethereum/components/block-manager.ts index 75df211796..006523ec1f 100644 --- a/src/ledgers/ethereum/things/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -80,9 +80,9 @@ export default class BlockManager extends Manager { * @param block */ set(block: Block): Promise - set(key: string | Buffer, value: Buffer): Promise - set(keyOrBlock: string | Buffer | Block, value?: Buffer | Block): Promise { - let key: string | Buffer; + set(key: Buffer, value: Buffer): Promise + set(keyOrBlock: Buffer | Block, value?: Buffer | Block): Promise { + let key: Buffer; if (keyOrBlock instanceof Block){ key = keyOrBlock.value.header.number; value = keyOrBlock.value.serialize(true); diff --git a/src/ledgers/ethereum/things/errors.ts b/src/ledgers/ethereum/components/errors.ts similarity index 100% rename from src/ledgers/ethereum/things/errors.ts rename to src/ledgers/ethereum/components/errors.ts diff --git a/src/ledgers/ethereum/things/manager.ts b/src/ledgers/ethereum/components/manager.ts similarity index 93% rename from src/ledgers/ethereum/things/manager.ts rename to src/ledgers/ethereum/components/manager.ts index d2e7616321..ad6c018d48 100644 --- a/src/ledgers/ethereum/things/manager.ts +++ b/src/ledgers/ethereum/components/manager.ts @@ -19,7 +19,7 @@ export default class Manager { } return this.base.get(key).then((raw) => new this.Type(raw)); } - set(key: string | Buffer, value: Buffer): Promise { + set(key: Buffer, value: Buffer): Promise { return this.base.put(key, value).then((raw) => new this.Type(raw)); } } \ No newline at end of file diff --git a/src/ledgers/ethereum/things/transaction-manager.ts b/src/ledgers/ethereum/components/transaction-manager.ts similarity index 100% rename from src/ledgers/ethereum/things/transaction-manager.ts rename to src/ledgers/ethereum/components/transaction-manager.ts diff --git a/src/ledgers/ethereum/things/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts similarity index 99% rename from src/ledgers/ethereum/things/transaction-pool.ts rename to src/ledgers/ethereum/components/transaction-pool.ts index ae99cbd3a5..a147428c74 100644 --- a/src/ledgers/ethereum/things/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -4,6 +4,7 @@ import Errors from "./errors"; import Heap from "../../../utils/heap"; import Transaction from "../../../types/transaction"; import { JsonRpcData, JsonRpcQuantity } from "../../../types/json-rpc"; +import Account from "ethereumjs-account"; // OLD insertion sort: // function siftUp(comparator: (a:T, b:T) => boolean, array: T[], value: T, startingIndex = 0, endingIndex = array.length) { @@ -59,7 +60,7 @@ function calculateIntrinsicGas(data: Buffer): bigint { nonZeroBytes++ } } - // Make sure we don't exceed uint64 for all data combinations. This + // Make sure we don't exceed uint64 for all data combinations. if ((MAX_UINT64 - gas) / params.TRANSACTION_DATA_NON_ZERO_GAS < nonZeroBytes) { throw new Error(Errors.INTRINSIC_GAS_TOO_LOW); } @@ -160,7 +161,6 @@ export default class TransactionPool extends Emittery { // return; // } - // TODO: if we got here we have a transaction that *isn't* executable // insert the transaction in its origin's (i.e., the `from` address's) // Heap, which sorts by nonce diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 0b0ca474de..26bbdfb91f 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -270,6 +270,10 @@ export default class Ethereum implements ILedger { return transaction; } + /** + * + * @param transaction + */ async eth_sendTransaction(transaction: any): Promise { let fromString = transaction.from; let from; @@ -331,6 +335,10 @@ export default class Ethereum implements ILedger { return this[_blockchain].queueTransaction(tx); } + /** + * + * @param transaction + */ async eth_sendRawTransaction(transaction: any): Promise { await this[_blockchain].queueTransaction(transaction); return transaction.hash; diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index e594a53e11..c28a26843a 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -19,4 +19,4 @@ type EthereumOptions = ILedgerOptions & { export default EthereumOptions; export const getDefaultOptions : () => EthereumOptions = () => { return {} as EthereumOptions; -} \ No newline at end of file +} diff --git a/src/options/options.ts b/src/options/options.ts index b563454072..f92160dc72 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -1,4 +1,3 @@ -import Account from "../types/account"; import {JsonRpcQuantity} from "../types/json-rpc"; import ILedger from "../interfaces/ledger"; @@ -9,8 +8,8 @@ interface Logger { // Okay, so a "bug" in TS treats types with the same shape as having the same // name, so Intellisense would say that AccountType requires `[Address, Address]` // instead of `[Address, PrivateKey]`, flip flopping like this "fixes" it. -type Address = {} & string; -type PrivateKey = string & {}; +type Address = string & {}; +type PrivateKey = {} & string; type AccountTuple = [Address, PrivateKey]; export default interface Options { @@ -22,7 +21,7 @@ export default interface Options { * the given balance. If specified, the key is used to determine the account's * address. */ - accounts?: Array, + accounts?: AccountTuple[], /** * Output VM opcodes for debugging. Defaults to `false` diff --git a/src/provider.ts b/src/provider.ts index 060aa8a117..62ff29e343 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,3 +1,4 @@ +import { JsonRpcQuantity, JsonRpcData } from "./types/json-rpc"; import Engine from "./engine"; import RequestProcessor from "./utils/request-processor"; import ProviderOptions, { getDefault as getDefaultProviderOptions } from "./options/provider-options"; @@ -6,7 +7,6 @@ import Ethereum from "./ledgers/ethereum/ledger" import { privateToAddress } from "ethereumjs-util"; import Account from "./types/account"; import { generateMnemonic, mnemonicToSeedSync } from "bip39"; -import { JsonRpcQuantity, JsonRpcData } from "./types/json-rpc"; import Address from "./types/address"; import JsonRpc from "./servers/utils/jsonrpc"; import EthereumOptions from "./ledgers/ethereum/options"; diff --git a/src/types/account.ts b/src/types/account.ts index f1586c5da1..607b3b489e 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -4,9 +4,9 @@ import { rlp, KECCAK256_RLP, KECCAK256_NULL } from "ethereumjs-util"; export default class Account { public address: Address; - public balance: JsonRpcQuantity = new JsonRpcQuantity(0n); + public balance: JsonRpcQuantity; public privateKey: JsonRpcData; - public nonce: JsonRpcQuantity = new JsonRpcQuantity(0n); + public nonce: JsonRpcQuantity; public stateRoot: Buffer = KECCAK256_RLP; public codeHash: Buffer = KECCAK256_NULL; @@ -15,6 +15,8 @@ export default class Account { constructor(arg: Address | Buffer) { if (arg instanceof Address){ this.address = arg; + this.balance = new JsonRpcQuantity(0n); + this.nonce = new JsonRpcQuantity(0n); } else if (Buffer.isBuffer(arg)){ const arr = rlp.decode(arg) as any as Buffer[]; this.nonce = JsonRpcQuantity.from(arr[0]); diff --git a/src/types/json-rpc/index.ts b/src/types/json-rpc/index.ts index 60139bb251..a0ff451baa 100644 --- a/src/types/json-rpc/index.ts +++ b/src/types/json-rpc/index.ts @@ -1,4 +1,4 @@ import {IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType} from "./json-rpc-base-types"; import JsonRpcQuantity, {IndexableJsonRpcQuantity} from "./json-rpc-quantity"; import JsonRpcData, {IndexableJsonRpcData} from "./json-rpc-data"; -export {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType, IndexableJsonRpcQuantity, IndexableJsonRpcData}; \ No newline at end of file +export {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType, IndexableJsonRpcQuantity, IndexableJsonRpcData}; diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index dce5e669ef..09a85f4884 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -1,3 +1,6 @@ +import JSBI from "jsbi"; +import { JsonRpcQuantity } from "."; + export type IndexableJsonRpcType = string & { new(value: T): IndexableJsonRpcType, toString(): string @@ -39,10 +42,26 @@ export class BaseJsonRpcType (value as bigint).toString(16)); toBuffers.set(this, () => { - const arr = new ArrayBuffer(8); - const view = new DataView(arr); - view.setBigUint64(0, value as bigint); - return Buffer.from(arr); + //onst value = (2n**64n); + var max = (2n**64n)-1n; + + var val = value as bigint; + var size = 4; + var buff = new ArrayBuffer(size * 8); + var view = new DataView(buff); + if(val > max) { + var long = val; + var index = size - 1; + while (long > 0) { + var byte = long & max; + view.setBigUint64(index * 8, byte); + long = (long - byte) / max; + index--; + } + } else { + view.setBigUint64(0, val); + } + return Buffer.from(buff.slice((index+1) * 8)); }); break; case "string": { diff --git a/test/provider.ts b/test/provider.ts index f38211f8fc..4fc60d1886 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -1,16 +1,18 @@ import Ganache from "../index" import * as assert from "assert"; import Provider from "../src/provider"; +import { JsonRpcQuantity } from "../src/types/json-rpc"; describe("provider", () => { const networkId = "1234"; let p: Provider; + beforeEach("set up", () =>{ p = Ganache.provider({ network_id: networkId }); }) - it("gets balance", async() => { + it.only("gets balance", async() => { const accounts = await p.send("eth_accounts"); const balance = await p.send("eth_getBalance", [accounts[0]]); assert.strictEqual(balance, 100, "Heyo!"); From 0625b193b6aa4878dad6a200faf9b896a22d074d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Apr 2019 13:32:10 -0400 Subject: [PATCH 040/691] Fix the heap --- src/utils/heap.ts | 262 +++++++++++++++++++++++++++++++--------------- 1 file changed, 180 insertions(+), 82 deletions(-) diff --git a/src/utils/heap.ts b/src/utils/heap.ts index e561d66f75..f157e09d1e 100644 --- a/src/utils/heap.ts +++ b/src/utils/heap.ts @@ -1,105 +1,203 @@ type Comparator = (values: T[], a: number, b: number) => boolean; + class Heap { - public best: number = 0; - public length: number; - public array: T[]; - protected readonly less: Comparator; - - /** - * @param size the size of the heap - * @param less the comparator function - */ - constructor(less: Comparator) { - this.less = less; - } + public length: number; + public array: T[]; + protected readonly less: Comparator; - public init(values: T[]) { - this.array = values; - const l = this.length = values.length; - for (let i = ((l / 2) | 0) - 1; i >= 0;) { - this.down(i--, l); - } - } + /** + * Creates a priority-queue heap where the highest priority element, + * as determined by the `less` function, is at the tip/root of the heap. + * To read the highest priority element without removing it call peek(). To + * read and remove the element call `shift()` + * @param size the size of the heap + * @param less the comparator function + */ + constructor(less: Comparator) { + this.less = less; + } - /** - * - * @param value - */ - public insert(value: T) { - const i = this.length++; - this.array[i] = value; - this.up(i, this.best); + public init(array: T[]) { + this.array = array; + const length = this.length = array.length; + for (let i = ((length / 2) | 0) - 1; i >= 0;) { + this.down(i--, length); } + } - public size() { - return this.length - this.best; - } + /** + * Pushes a new element onto the heap + * @param value + */ + public push(value: T) { + const i = this.length++; + this.array[i] = value; + this.up(i); + } - /** - * Return the current best element. Do not remove it - */ - public peek(): T { - return this.array[this.best]; - } + public size() { + return this.length; + } - /** - * Remove the current best element - * @param map - */ - public shift() { - // TODO: fix the tree as the best is not neccessarily at best++ - this.best++; - } + /** + * Return the current best element. Do not remove it + */ + public peek(): T { + return this.array[0]; + } + + /** + * Removes and returns the element with the highest priority from the heap. + * The complexity is O(log n) where n = this.size(). + * @returns the element with the highest priority + */ + public shift(): T { + const array = this.array; + const length = this.length; - /** - * Removes the last element - */ - public pop() { - this.length--; + // if we are empty or about to be empty... + if (length <= 1) { + if (length === 0) return; + const element = array[0]; + // finaly clear the array + this.length = array.length = 0; + return element; } + // otherwise... + + // remember the best element + const best = array[0]; + const newLength = this.length = length - 1; + // put our last element at the start of the heap + array[0] = array[newLength]; + // then sort from the new first element to the second to last element + this.down(0, newLength); + return best; + } - public replaceBest(newValue: T) { - const i = this.best; - this.array[i] = newValue; - this.fix(i); + /** + * Removes the highest priority element from the queue, replacing it with + * the new element. This is equivalent to, but faster than, calling + * `replace(0, newValue);`. + * If you call this on an empty heap (`this.size() === 0`) you may find + * unexpected behavior. + * @param newValue + */ + public replaceBest(newValue: T) { + this.array[0] = newValue; + this.down(0, this.length); + } + + /** + * Replaces the element at position `i` with the `newValue`. If the element at + * position `i` doesn't exist, or if `i < 0` or `i > this.size()` you may + * find unexpected behavior. + * @param i + * @param newValue + */ + public replace(i: number, newValue: T) { + this.array[i] = newValue; + this.fix(i); + } + + /** + * Removes the element at position `i`. + * The complexity is O(log n) where n = this.size(). + * @param i the element to remove + */ + public remove(i: number) { + const newLength = --this.length; + if (newLength !== i) { + this.swap(i, newLength); + if (!this.down(i, newLength)) { + this.up(i); + } } + } - public fix(i: number) { - if (!this.down(i, this.length)) { - this.up(i, this.best); - } + /** + * Removes the element with the highest priority from the heap + * The complexity is O(log n) where n = this.size(). + */ + public removeBest() { + const array = this.array; + const length = this.length; + if (length === 1) { + // finally, clear the array + this.length = array.length = 0 + return; } - private up(j: number, best: number) { - const values = this.array; - const less = this.less.bind(null, values); - for (let i: number; ((i = (j - 1) / 2 | 0 + best), i !== j && less(j, i)); j = i) { - this.swap(i, j); - } + const newLength = --this.length; + // put our last element at the start of the heap + array[0] = array[newLength]; + // then sort from the new first element to the second to last element + this.down(0, newLength); + } + + /** + * Re-establishes the heap ordering after the element at index `i` changes + * its value. Changing the value of the element at index `i` and then + * calling fix is equivalent to, but faster than, calling + * `remove(i); push(newValue);`. + * The complexity is O(log n) where n = this.size(). + * @param i + */ + public fix(i: number) { + if (!this.down(i, this.length)) { + this.up(i); } - private down(i0: number, l: number): boolean { - const values = this.array; - let i = i0; - for (let j1: number; (j1 = 2 * i + 1) < l;) { - let j = j1; // left child - let j2 = j1 + 1; - if (j2 < l && this.less(values, j2, j1)) { - j = j2; // = 2 * i + 2 // right child - } - if (!this.less(values, j, i)) { - break; - } - this.swap(i, j); - i = j; - } - return i > i0; + } + + private up(j: number,) { + const less = this.less.bind(null, this.array); + for (let i: number; ((i = (j - 1) / 2 | 0), i !== j && less(j, i)); j = i) { + this.swap(i, j); } + } - private swap(i: number, j: number) { - const values = this.array; - [values[j], values[i]] = [values[i], values[j]]; + private down(i0: number, l: number): boolean { + const less = this.less.bind(null, this.array); + let i = i0; + for (let j1: number; (j1 = 2 * i + 1) < l;) { + let j = j1; // left child + let j2 = j1 + 1; + if (j2 < l && less(j2, j1)) { + j = j2; // = 2 * i + 2 // right child + } + if (!less(j, i)) { + break; + } + this.swap(i, j); + i = j; } + return i > i0; + } + + /** + * Swaps the elements in the heap + * @param i The first element + * @param j The second element + */ + private swap(i: number, j: number) { + const array = this.array; + const first = array[i]; + array[i] = array[j]; + array[j] = first; + } +} + +var d = new Heap((values, a, b) => values[a] < values[b]); +d.init([5,6,7,8,1,2,7,9,4,654,46,7,1,3,74,1,4,89,3621,74]); +console.log(d.array.length) +let c = 0; +let i: number; +while(i = d.shift()){ + console.log(i); + c++; } +console.log(c); +console.log(d.array); // type HeapHeapMap> = {heap: U, value: T}; From 3139faa1f5e823668a2d9caf500a53a0c8010d47 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Apr 2019 13:32:47 -0400 Subject: [PATCH 041/691] update tsc --- typings/superagent.d.ts | 2 ++ typings/tmp.d.ts | 8 ++++++++ typings/uWebsockets.js.ts | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 typings/tmp.d.ts diff --git a/typings/superagent.d.ts b/typings/superagent.d.ts index 196a8dc358..a9e792bd34 100644 --- a/typings/superagent.d.ts +++ b/typings/superagent.d.ts @@ -1,3 +1,5 @@ +// superagent TS def has issues with these browser APIs not being available in +// node. // error TS2304: Cannot find name 'XMLHttpRequest' declare interface XMLHttpRequest {} // error TS2304: Cannot find name 'Blob' diff --git a/typings/tmp.d.ts b/typings/tmp.d.ts new file mode 100644 index 0000000000..b4832a9858 --- /dev/null +++ b/typings/tmp.d.ts @@ -0,0 +1,8 @@ +declare module "tmp" { + export class Options {} + export class SimpleOptions {} + export const fileSync: any; + export const dirSync: any; + export const tmpNameSync: any; + export const setGracefulCleanup: any; +} diff --git a/typings/uWebsockets.js.ts b/typings/uWebsockets.js.ts index 78655cf6cb..9952e2a07e 100644 --- a/typings/uWebsockets.js.ts +++ b/typings/uWebsockets.js.ts @@ -1,5 +1,7 @@ import "uWebSockets.js" +// uWebSockets.js doesn't haveinclude these in it's TS def file. + declare module "uWebSockets.js" { export const DISABLED:number; export const SHARED_COMPRESSOR:number; From 033f8eb3321ccc849424aafa2118cce81e80dca9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Apr 2019 13:33:11 -0400 Subject: [PATCH 042/691] update tobuffer on json-rpc-base-types --- npm-shrinkwrap.json | 9 ++++++++ package.json | 5 +++-- src/types/json-rpc/json-rpc-base-types.ts | 26 +++++++++++++++++------ 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 976d50674e..a75e0ee9ed 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -193,6 +193,15 @@ "safe-buffer": "^5.0.1" } }, + "bigint-buffer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.2.tgz", + "integrity": "sha512-gof9NgbodUgCXD2aUHfUKk5KUDk6/zPlwE+YYpRM2t7zS0K/6WipJFWfziIY+EavxFDuGUnuuQQzzvNcckPKNA==", + "optional": true, + "requires": { + "bindings": "^1.3.0" + } + }, "bindings": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", diff --git a/package.json b/package.json index a36720eb3f..6dc86dc056 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "emittery": "0.4.1", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.0", - "ethereumjs-blockchain": "^3.4.0", "ethereumjs-tx": "1.3.7", "ethereumjs-util": "6.1.0", "ethereumjs-vm": "3.0.0", @@ -56,7 +55,9 @@ "utf-8-validate": "5.0.2", "ws": "6.2.1" }, - "optionalDependencies": {}, + "optionalDependencies": { + "bigint-buffer": "1.1.2" + }, "repository": { "type": "git", "url": "https://github.com/trufflesuite/ganache-core" diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index 09a85f4884..e796f5d189 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -1,5 +1,17 @@ -import JSBI from "jsbi"; -import { JsonRpcQuantity } from "."; +let intToBuffer: (val: bigint | number) => Buffer; +try { + const toBufferBE = require('bigint-buffer').toBufferBE; + intToBuffer = (val: bigint | number) => { + const buffer = toBufferBE(val, 128); + for (let i = 0; i < buffer.length - 1; i++) if (buffer[i]) return buffer.slice(i) + return buffer.slice(buffer.length - 1) + } +} catch(e) { + intToBuffer = (val: bigint | number): Buffer => { + const hex = val.toString(16); + return Buffer.from(hex.length % 2 ? hex : `0${hex}`); + } +} export type IndexableJsonRpcType = string & { new(value: T): IndexableJsonRpcType, @@ -33,15 +45,17 @@ export class BaseJsonRpcType (value as number).toString(16)); toBuffers.set(this, () => { - const arr = new ArrayBuffer(4); - const view = new DataView(arr); - view.setInt32(0, value as number); - return Buffer.from(arr); + // const arr = new ArrayBuffer(4); + // const view = new DataView(arr); + // view.setInt32(0, value as number); + // return Buffer.from(arr); + return intToBuffer(value as number); }); break; case "bigint": toStrings.set(this, () => (value as bigint).toString(16)); toBuffers.set(this, () => { + return intToBuffer(value as number); //onst value = (2n**64n); var max = (2n**64n)-1n; From 73f78f050a9a362c297370020b9a0210f7f39310 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Apr 2019 13:33:20 -0400 Subject: [PATCH 043/691] add pending queue logic to tx pool --- .../ethereum/components/transaction-pool.ts | 88 ++++++++++++------- 1 file changed, 58 insertions(+), 30 deletions(-) diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index a147428c74..f104480ce6 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -4,17 +4,6 @@ import Errors from "./errors"; import Heap from "../../../utils/heap"; import Transaction from "../../../types/transaction"; import { JsonRpcData, JsonRpcQuantity } from "../../../types/json-rpc"; -import Account from "ethereumjs-account"; - -// OLD insertion sort: -// function siftUp(comparator: (a:T, b:T) => boolean, array: T[], value: T, startingIndex = 0, endingIndex = array.length) { -// let i = startingIndex; -// for (; i < endingIndex; i++) { -// if (!comparator(value, array[i])) break; -// } -// array.splice(i, 0, value); -// return i; -// } export type TransactionPoolOptions = { gasPrice?: JsonRpcQuantity, @@ -132,14 +121,17 @@ export default class TransactionPool extends Emittery { throw new Error(`known transaction: ${hash}`); } - const err = await this.validateTransaction(transaction); + let err: Error; + err = this.validateTransaction(transaction); if (err != null) { throw err; } - const origin = transaction.from.toString(); + const from = JsonRpcData.from(transaction.from); + + const origin = from.toString(); const orgins = this.origins; - let pendingOriginTransactions = orgins.get(origin); + let queuedOriginTransactions = orgins.get(origin); // TODO: If the transaction pool is full, discard underpriced transactions if (this.length >= this.globalSlots + this.globalQueue) { @@ -153,29 +145,64 @@ export default class TransactionPool extends Emittery { // nonce matches the pending nonce // AND the new tx's gasPrice is `this.priceBump` greater than the // pending tx's. - // Also, if a transaction is at the correct `nonce` it is executable. - // we need to pull out the origin's transactions that are now executable - // from the `pendingOriginTransactions`, if it is available - // if (stuff) { - // this.pending ... - // return; - // } + + + + const transactor = await this.blockchain.accounts.get(from); + err = await this.validateTransactor(transaction, transactor); + if (err != null) { + throw err; + } + + // If a transaction is at the correct `nonce` it is executable. + const transactionNonce = transaction.nonce.toBigInt(); + if (transactor.nonce.toBigInt() + 1n === transactionNonce) { + // we need to pull out the origin's transactions that are now executable + // from the `pendingOriginTransactions`, if it is available + const pending = this.pending; + let pendingOriginTransactions = pending.get(origin); + if (!pendingOriginTransactions) { + pendingOriginTransactions = new Heap(byNonce); + pendingOriginTransactions.array = [transaction]; + pendingOriginTransactions.length = 1; + pending.set(origin, pendingOriginTransactions); + } else { + pendingOriginTransactions.push(transaction); + } + if (queuedOriginTransactions) { + let nextTransaction: any; + let nextNonce: bigint = transactionNonce; + while (nextTransaction = queuedOriginTransactions.peek()) { + nextNonce += 1n; + if (nextTransaction.nonce.toBigInt() !== nextNonce) { + break; + } else { + pendingOriginTransactions.push(nextTransaction); + // remove this transaction from the queue + queuedOriginTransactions.shift(); + } + } + } + // notify miner that we have pending transactions ready for it + this.emit("drain", pending); + return; + } // TODO: if we got here we have a transaction that *isn't* executable // insert the transaction in its origin's (i.e., the `from` address's) // Heap, which sorts by nonce - if (!pendingOriginTransactions) { - pendingOriginTransactions = new Heap(byNonce); - pendingOriginTransactions.array = [transaction]; - pendingOriginTransactions.length = 1; - orgins.set(origin, pendingOriginTransactions); + if (!queuedOriginTransactions) { + queuedOriginTransactions = new Heap(byNonce); + queuedOriginTransactions.array = [transaction]; + queuedOriginTransactions.length = 1; + orgins.set(origin, queuedOriginTransactions); } else { - pendingOriginTransactions.insert(transaction); + queuedOriginTransactions.push(transaction); } } - public async validateTransaction(transaction: Transaction): Promise { + public validateTransaction(transaction: Transaction): Error { // Check the transaction doesn't exceed the current block limit gas. if (this.options.gasLimit < JsonRpcQuantity.from(transaction.gasLimit)) { return new Error("Transaction gasLimit is too low"); @@ -194,9 +221,10 @@ export default class TransactionPool extends Emittery { return new Error("intrisic gas too low"); } - const from = JsonRpcData.from(transaction.from); - const transactor = await this.blockchain.accounts.get(from); + return null; + } + public async validateTransactor(transaction: Transaction, transactor: any): Promise { // Transactor should have enough funds to cover the costs if (transactor.balance.toBigInt() < transaction.cost()) { return new Error("Account does not have enough funds to complete transaction"); From 6a7747f371f27afff6bebe56e7902e0cac1b5023 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Apr 2019 19:03:45 -0400 Subject: [PATCH 044/691] Make mining a tx almost work --- src/ledgers/ethereum/blockchain.ts | 31 +++- .../ethereum/components/transaction-pool.ts | 77 ++------ src/ledgers/ethereum/ledger.ts | 4 +- src/ledgers/ethereum/miner.ts | 164 ++++++++++++++++++ .../ethereum/components => types}/errors.ts | 0 src/types/json-rpc/json-rpc-base-types.ts | 17 +- src/types/json-rpc/json-rpc-quantity.ts | 7 +- src/types/params.ts | 15 ++ src/types/transaction.ts | 44 ++++- src/utils/heap.ts | 107 +----------- test/provider.ts | 45 ++++- 11 files changed, 323 insertions(+), 188 deletions(-) create mode 100644 src/ledgers/ethereum/miner.ts rename src/{ledgers/ethereum/components => types}/errors.ts (100%) create mode 100644 src/types/params.ts diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index deb2d1c915..50fee93c4c 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,14 +1,17 @@ +import Miner from "./miner"; import Database from "./database"; import Emittery from "emittery"; import BlockManager, { Block } from "./components/block-manager"; import TransactionManager from "./components/transaction-manager"; import Trie from "merkle-patricia-tree"; -import { BN } from "ethereumjs-util"; +import { BN, MAX_INTEGER } from "ethereumjs-util"; import Account from "../../types/account"; import { promisify } from "util"; import { JsonRpcQuantity, JsonRpcData } from "../../types/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; +import Heap from "../../utils/heap"; +import Transaction from "../../types/transaction"; const VM = require("ethereumjs-vm"); @@ -26,7 +29,7 @@ export default class Blockchain extends Emittery { public blocks: BlockManager; public transactions: TransactionManager; public accounts: AccountManager; - private vm: any; + public vm: any; public trie: Trie; private readonly database: Database @@ -36,13 +39,7 @@ export default class Blockchain extends Emittery { * * Emits a `ready` event once the database and * all dependencies are fully initialized. - * @param db - * @param dbPath - * @param accounts - * @param hardfork - * @param allowUnlimitedContractSize - * @param blockGasLimit - * @param timestamp + * @param options */ constructor(options: BlockchainOptions) { super(); @@ -61,6 +58,22 @@ export default class Blockchain extends Emittery { this._initializeVM(options.hardfork, options.allowUnlimitedContractSize); + const miner = new Miner(this.vm, options); + + const instamining = true; + if(instamining){ + this.transactions.transactionPool.on("drain", async (pending: Map>) => { + await miner.mine(pending); + }); + } else { + const minerInterval = 3 * 1000; + const mine = async (pending: Map>) => { + await miner.mine(pending); + setTimeout(mine, minerInterval, pending); + }; + setTimeout(mine, minerInterval, this.transactions.transactionPool.pending); + } + await this._initializeAccounts(options.accounts); await this._initializeGenesisBlock(options.timestamp, options.gasLimit); diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index f104480ce6..253d35470b 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -1,9 +1,9 @@ import Emittery from "emittery"; import Blockchain from "../blockchain"; -import Errors from "./errors"; import Heap from "../../../utils/heap"; import Transaction from "../../../types/transaction"; import { JsonRpcData, JsonRpcQuantity } from "../../../types/json-rpc"; +import { SSL_OP_SSLEAY_080_CLIENT_DH_BUG } from "constants"; export type TransactionPoolOptions = { gasPrice?: JsonRpcQuantity, @@ -11,57 +11,7 @@ export type TransactionPoolOptions = { }; function byNonce(values: Transaction[], a: number, b: number) { - return values[b].nonce.toBigInt() < values[a].nonce.toBigInt(); -} - -const params = { - /** - * Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. - */ - TRANSACTION_GAS: 21000n, - - /** - * Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. - */ - TRANSACTION_DATA_NON_ZERO_GAS: 68n, - /** - * Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. - */ - TRANSACTION_DATA_ZERO_GAS: 4n -} - -const MAX_UINT64 = (1n<<64n) - 1n; -/** - * Compute the 'intrinsic gas' for a message with the given data. - * @param data The transaction's data - */ -function calculateIntrinsicGas(data: Buffer): bigint { - // Set the starting gas for the raw transaction - let gas = params.TRANSACTION_GAS; - - // Bump the required gas by the amount of transactional data - const dataLength = data.byteLength; - if (dataLength > 0) { - // Zero and non-zero bytes are priced differently - let nonZeroBytes: bigint = 0n; - for (const b of data) { - if (b !== 0) { - nonZeroBytes++ - } - } - // Make sure we don't exceed uint64 for all data combinations. - if ((MAX_UINT64 - gas) / params.TRANSACTION_DATA_NON_ZERO_GAS < nonZeroBytes) { - throw new Error(Errors.INTRINSIC_GAS_TOO_LOW); - } - gas += nonZeroBytes * params.TRANSACTION_DATA_NON_ZERO_GAS; - - let z = BigInt(dataLength) - nonZeroBytes; - if ( (MAX_UINT64 - gas) / params.TRANSACTION_DATA_ZERO_GAS < z) { - throw new Error(Errors.INTRINSIC_GAS_TOO_LOW); - } - gas += z * params.TRANSACTION_DATA_ZERO_GAS; - } - return gas; + return (JsonRpcQuantity.from(values[b].nonce).toBigInt() || 0n) > (JsonRpcQuantity.from(values[a].nonce).toBigInt() || 0n); } export default class TransactionPool extends Emittery { @@ -110,7 +60,7 @@ export default class TransactionPool extends Emittery { } public length: number; private hashes = new Set(); - private pending: Map> = new Map(); + public pending: Map> = new Map(); private origins: Map> = new Map(); public async insert(transaction: Transaction) { @@ -155,8 +105,12 @@ export default class TransactionPool extends Emittery { } // If a transaction is at the correct `nonce` it is executable. - const transactionNonce = transaction.nonce.toBigInt(); - if (transactor.nonce.toBigInt() + 1n === transactionNonce) { + const transactionNonce = JsonRpcQuantity.from(transaction.nonce).toBigInt() || 0n; + let transactorNonce = transactor.nonce.toBigInt(); + if (transactorNonce == null) { + transactorNonce = -1n; + } + if (transactorNonce + 1n === transactionNonce) { // we need to pull out the origin's transactions that are now executable // from the `pendingOriginTransactions`, if it is available const pending = this.pending; @@ -174,12 +128,13 @@ export default class TransactionPool extends Emittery { let nextNonce: bigint = transactionNonce; while (nextTransaction = queuedOriginTransactions.peek()) { nextNonce += 1n; - if (nextTransaction.nonce.toBigInt() !== nextNonce) { + const nextTxNonce = JsonRpcQuantity.from(nextTransaction.nonce).toBigInt() || 0n; + if (nextTxNonce !== nextNonce) { break; } else { pendingOriginTransactions.push(nextTransaction); // remove this transaction from the queue - queuedOriginTransactions.shift(); + queuedOriginTransactions.removeBest(); } } } @@ -216,7 +171,7 @@ export default class TransactionPool extends Emittery { } // Should supply enough intrinsic gas - const gas = calculateIntrinsicGas(transaction.input); + const gas = transaction.calculateIntrinsicGas(); if (transaction.gasPrice < gas) { return new Error("intrisic gas too low"); } @@ -231,7 +186,11 @@ export default class TransactionPool extends Emittery { } // check that the nonce isn't too low - if (transactor.nonce > transaction.nonce) { + let transactorNonce = transactor.nonce.toBigInt(); + if (transactorNonce == null) { + transactorNonce = -1n; + } + if (transactorNonce >= (JsonRpcQuantity.from(transaction.nonce).toBigInt() || 0n)) { return new Error("Transaction nonce is too low"); } return null; diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 26bbdfb91f..1415104375 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -7,6 +7,7 @@ import Tag from "../../types/tags"; import Address, { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; + const createKeccakHash = require("keccak"); // Read in the current ganache version from the package.json const {name, version} = require("../../../package.json"); @@ -326,7 +327,8 @@ export default class Ethereum implements ILedger { if (isKnownAccount) { if (tx.nonce.length === 0) { const account = await this[_blockchain].accounts.get(from); - tx.nonce = JsonRpcQuantity.from(1n + account.nonce.toBigInt()).toBuffer(); + const accountNonce = (account.nonce.toBigInt()) || 0n; + tx.nonce = JsonRpcQuantity.from(1n + accountNonce).toBuffer(); } const secretKey = this[_knownAccounts].get(fromString); tx.sign(secretKey.toBuffer()); diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts new file mode 100644 index 0000000000..d540a8b548 --- /dev/null +++ b/src/ledgers/ethereum/miner.ts @@ -0,0 +1,164 @@ +import { Block } from "../../ledgers/ethereum/components/block-manager" +import params from "../../types/params"; +import Heap from "../../utils/heap"; +import Transaction from "../../types/transaction"; +import { JsonRpcQuantity, JsonRpcData } from "../../types/json-rpc"; +import { promisify } from "util"; +import Trie from "merkle-patricia-tree"; +import { rlp } from "ethereumjs-util"; + +const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); + +function replaceFromHeap(priced: Heap, source: Heap, pending: Map>, key: string) { + // get the next best for this account: + const next = source.peek(); + if (next) { + // remove the current best priced transaction from this + // account and replace it with the account's next lowest + // nonce transaction: + priced.replaceBest(next); + } else { + // since we don't have a next, just remove this item from + // priced and delete the Heap from `pending` as it is now + // empty. + pending.delete(key) + priced.removeBest(); + } +} + +type MinerOptions = { + gasLimit?: JsonRpcQuantity +} + +function byPrice(values: Transaction[], a: number, b: number) { + return JsonRpcQuantity.from(values[a].gasPrice) > JsonRpcQuantity.from(values[b].gasPrice); +} + +export default class Miner { + private readonly options: MinerOptions; + private readonly vm: any + private readonly _runTx: ({tx:{}}) => Promise; + private readonly _checkpoint: () => Promise; + private readonly _commit: () => Promise; + private readonly _revert: () => Promise; + + // initialize a Heap that sorts by gasPrice + private readonly priced = new Heap(byPrice);; + constructor(vm: any, options: MinerOptions) { + this.vm = vm; + this.options = options; + this._runTx = promisify(vm.runTx.bind(vm)); + const stateManager = vm.stateManager; + this._checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); + this._commit = promisify(stateManager.commit.bind(stateManager)); + this._revert = promisify(stateManager.revert.bind(stateManager)); + + // init the heap with an empty array + this.priced.init([]); + } + /** + * + * @param pending A live Map of pending transactions from the transaction + * pool. The miner will update this Map by removing the best transactions + * and putting them in a block. + * It is possible the miner will not empty the Map if it can't fit all + * transactions within a single block. The remaining items will be left in + * the pending pool to be eligible for mining in the future. + */ + public async mine(pending: Map>) { + const priced = this.priced; + const blockTransactions: any[] = []; + for(let mapping of pending) { + const next = mapping[1].peek(); + if (next) { + priced.push(next); + } + } + + let blockGasLeft = this.options.gasLimit.toBigInt(); + let best: Transaction; + let counter = 0; + const transactionTrie = new Trie(null, null); + const receiptTrie = new Trie(null, null); + const promises: Promise[] = []; + // Run until we run out of items, or until the inner loop stops us + while (best = priced.peek()) { + // if the current best transaction can't possibly fit in this block + // go ahead and run the next best transaction, ignoring all other + // pending transactions from this account. + if (best.calculateIntrinsicGas() > blockGasLeft) { + priced.removeBest(); + continue; + } + const origin = JsonRpcData.from(best.from).toString(); + const pendingFromOrigin = pending.get(origin); + + const runArgs = { + tx: best + }; + await this._checkpoint(); + const result = await this._runTx(runArgs).catch((err: Error) => ({ err })); + if (result.err) { + await this._revert(); + const errorMessage = result.err.message; + if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { + // update `priced` with the next best for this account: + replaceFromHeap(priced, pendingFromOrigin, pending, origin); + } + } else { + await this._commit(); + const gasUsed = JsonRpcQuantity.from(result.gasUsed.toBuffer()).toBigInt(); + if (blockGasLeft >= gasUsed) { + blockGasLeft -= gasUsed; + + const resultVm = result.vm; + const txLogs = resultVm.logs || []; + // result.vm.exception is flipped so 1=0 and 0=1. :facepalm: + const status = resultVm.exception ? 1 : 0; + const bitVector = result.bloom.bitvector; + const rawReceipt = [ + status, + result.gasUsed.toBuffer(), + bitVector, + txLogs + ]; + const rcptBuffer = rlp.encode(rawReceipt); + const key = rlp.encode(counter); + promises.push(putInTrie(transactionTrie, key, best.serialize())); + promises.push(putInTrie(receiptTrie, key, rcptBuffer)); + + // remove the current (`best`) item from the pending queue as we + // now know it will fit in the block. + pendingFromOrigin.removeBest(); + + // We've found ourselves a block. Yeehaw! + blockTransactions.push(best); + + await promises; + + // if we don't have enough gas for even the smallest of + // transactions we're done, clear `priced` & break the loop + if (blockGasLeft <= params.TRANSACTION_GAS) { + // we ran out of space, so let's clear + priced.clear(); + break; + } + + // update `priced` with the next best for this account: + replaceFromHeap(priced, pendingFromOrigin, pending, origin); + } else { + // didn't fit. remove it from the priced transactions + // without replacing it with another from the account. + priced.removeBest(); + } + } + } + + this.finalizeBlock(blockTransactions, transactionTrie, receiptTrie); + } + + private async finalizeBlock(blockTransactions: Transaction[], transactionTrie: Trie, receiptTrie: Trie): Promise { + // TODO: create the block and save it to the database + return new Block(Buffer.from([0]), null); + } +} \ No newline at end of file diff --git a/src/ledgers/ethereum/components/errors.ts b/src/types/errors.ts similarity index 100% rename from src/ledgers/ethereum/components/errors.ts rename to src/types/errors.ts diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index e796f5d189..3b1469e452 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -1,13 +1,13 @@ -let intToBuffer: (val: bigint | number) => Buffer; +let intToBuffer: (val: bigint) => Buffer; try { const toBufferBE = require('bigint-buffer').toBufferBE; - intToBuffer = (val: bigint | number) => { + intToBuffer = (val: bigint) => { const buffer = toBufferBE(val, 128); for (let i = 0; i < buffer.length - 1; i++) if (buffer[i]) return buffer.slice(i) return buffer.slice(buffer.length - 1) } } catch(e) { - intToBuffer = (val: bigint | number): Buffer => { + intToBuffer = (val: bigint): Buffer => { const hex = val.toString(16); return Buffer.from(hex.length % 2 ? hex : `0${hex}`); } @@ -45,17 +45,16 @@ export class BaseJsonRpcType (value as number).toString(16)); toBuffers.set(this, () => { - // const arr = new ArrayBuffer(4); - // const view = new DataView(arr); - // view.setInt32(0, value as number); - // return Buffer.from(arr); - return intToBuffer(value as number); + const arr = new ArrayBuffer(4); + const view = new DataView(arr); + view.setInt32(0, value as number); + return Buffer.from(arr); }); break; case "bigint": toStrings.set(this, () => (value as bigint).toString(16)); toBuffers.set(this, () => { - return intToBuffer(value as number); + return intToBuffer(value as bigint); //onst value = (2n**64n); var max = (2n**64n)-1n; diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index 73d12b2468..f597bbc345 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -1,4 +1,5 @@ import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; +const toBigIntBE = require('bigint-buffer').toBigIntBE; class JsonRpcQuantity extends BaseJsonRpcType { public static from(value: number | bigint | string | Buffer) { @@ -17,6 +18,9 @@ class JsonRpcQuantity extends BaseJsonRpcType { const length = value.byteLength; + if (length === 0) { + return null; + } // Buffers that are 6 bytes or less can be converted with built-in methods if (length <= 6) { return BigInt(value.readUIntBE(0, length)); @@ -32,9 +36,10 @@ class JsonRpcQuantity extends BaseJsonRpcType { } else if (length === 8) { view = new DataView(value.buffer, value.byteOffset, length); } else { + return toBigIntBE(value); // TODO: handle bigint's stored as Buffers that are this big? // It's not too hard. - throw new Error(`Cannot convert Buffer of length ${length} to bigint!`); + // throw new Error(`Cannot convert Buffer of length ${length} to bigint!`); } return view.getBigUint64(0) as bigint; } else { diff --git a/src/types/params.ts b/src/types/params.ts new file mode 100644 index 0000000000..8e495e23c8 --- /dev/null +++ b/src/types/params.ts @@ -0,0 +1,15 @@ +export default { + /** + * Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. + */ + TRANSACTION_GAS: 21000n, + + /** + * Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. + */ + TRANSACTION_DATA_NON_ZERO_GAS: 68n, + /** + * Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. + */ + TRANSACTION_DATA_ZERO_GAS: 4n + }; \ No newline at end of file diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 19dd68a1a9..1e94c1a64a 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -1,5 +1,10 @@ +import Errors from "./errors" import { JsonRpcData } from "./json-rpc/json-rpc-data"; import { JsonRpcQuantity } from "./json-rpc"; +import params from "./params"; + +const MAX_UINT64 = (1n << 64n) - 1n; + // import { JsonRpcData, JsonRpcQuantity } from "./json-rpc"; // import Address from "./address"; @@ -106,7 +111,7 @@ const assert = require("assert"); const rlp = require("rlp"); const sign = EthereumJsTransaction.prototype.sign; -const fakeHash = function() { +const fakeHash = function () { // this isn't memoization of the hash. previous versions of ganache-core // created hashes in a different/incorrect way and are recorded this way // in snapshot dbs. We are preserving the chain's immutability by using the @@ -282,6 +287,41 @@ export default class Transaction extends EthereumJsTransaction { + JsonRpcQuantity.from(this.value).toBigInt(); } + /** + * Compute the 'intrinsic gas' for a message with the given data. + * @param data The transaction's data + */ + public calculateIntrinsicGas(): bigint { + const data = this.input; + + // Set the starting gas for the raw transaction + let gas = params.TRANSACTION_GAS; + + // Bump the required gas by the amount of transactional data + const dataLength = data.byteLength; + if (dataLength > 0) { + // Zero and non-zero bytes are priced differently + let nonZeroBytes: bigint = 0n; + for (const b of data) { + if (b !== 0) { + nonZeroBytes++; + } + } + // Make sure we don't exceed uint64 for all data combinations. + if ((MAX_UINT64 - gas) / params.TRANSACTION_DATA_NON_ZERO_GAS < nonZeroBytes) { + throw new Error(Errors.INTRINSIC_GAS_TOO_LOW); + } + gas += nonZeroBytes * params.TRANSACTION_DATA_NON_ZERO_GAS; + + let z = BigInt(dataLength) - nonZeroBytes; + if ((MAX_UINT64 - gas) / params.TRANSACTION_DATA_ZERO_GAS < z) { + throw new Error(Errors.INTRINSIC_GAS_TOO_LOW); + } + gas += z * params.TRANSACTION_DATA_ZERO_GAS; + } + return gas; + } + /** * Prepares arbitrary JSON data for use in a Transaction. * @param {Object} json JSON object representing the Transaction @@ -293,7 +333,7 @@ export default class Transaction extends EthereumJsTransaction { if (json.to) { // Remove all padding and make it easily comparible. const buf = JsonRpcData.from(json.to).toBuffer(); - + if (buf.equals(BUFFER_ZERO)) { // if the address is 0x0 make it 0x0{20} toAccount = ethUtil.setLengthLeft(buf, 20); diff --git a/src/utils/heap.ts b/src/utils/heap.ts index f157e09d1e..6e37011c9d 100644 --- a/src/utils/heap.ts +++ b/src/utils/heap.ts @@ -46,26 +46,30 @@ class Heap { return this.array[0]; } + public clear() { + this.length = this.array.length = 0; + } + /** * Removes and returns the element with the highest priority from the heap. * The complexity is O(log n) where n = this.size(). * @returns the element with the highest priority */ public shift(): T { - const array = this.array; const length = this.length; // if we are empty or about to be empty... if (length <= 1) { if (length === 0) return; - const element = array[0]; - // finaly clear the array - this.length = array.length = 0; + const element = this.array[0]; + // finally, clear the array + this.clear(); return element; } // otherwise... // remember the best element + const array = this.array; const best = array[0]; const newLength = this.length = length - 1; // put our last element at the start of the heap @@ -187,97 +191,4 @@ class Heap { } } -var d = new Heap((values, a, b) => values[a] < values[b]); -d.init([5,6,7,8,1,2,7,9,4,654,46,7,1,3,74,1,4,89,3621,74]); -console.log(d.array.length) -let c = 0; -let i: number; -while(i = d.shift()){ - console.log(i); - c++; -} -console.log(c); -console.log(d.array); - -// type HeapHeapMap> = {heap: U, value: T}; - -// export class HeapHeap = Heap, V extends HeapHeapMap = HeapHeapMap> extends Heap { -// // public insert(value: V) -// // public insert(value: U) -// // public insert(value: U | V) { -// // super.insert({ -// // value: (value as U).peek(), -// // heap: this -// // } as any); -// // } -// public peek(): V -// public peek(): T -// public peek(): T | V { -// const best = super.peek(); -// return best.value as T; -// } -// public shift() { -// const heap = super.peek().heap; -// if (heap.size() > 0) { -// // replace the old with the new: -// this.array[this.best] = heap.peek() as any as V; -// // TODO: fix the ordering - -// } else { -// // we're done with this account, shorten our heap -// this.best++; -// } -// } -// } - -// export default Heap; - -// type Account = {nonce: number, gasPrice: number}; -// const byNonce = (a:any, b:any): boolean => a.nonce < b.nonce; -// const account1 = new Heap(2, byNonce); -// account1.insert({nonce: 2, gasPrice: 3}); -// account1.insert({nonce: 1, gasPrice: 2}); - -// const account2 = new Heap(3, byNonce); -// account2.insert({nonce: 2, gasPrice: 3}); -// account2.insert({nonce: 3, gasPrice: 4}); -// account2.insert({nonce: 5, gasPrice: 9}); - -// const accounts = [account1, account2]; -// const byPrice = (a:any, b:any): boolean => a.gasPrice > b.gasPrice; - -// const all = new HeapHeap(accounts.length, byPrice); -// for (var i = 0; i < accounts.length; i++) { -// var account = accounts[i]; -// all.insert(account); -// } - -// const a = all.peek(); - - -// type account = {gasPrice: number}; -// const a = new Heap((values: account[], a: number, b: number) => { -// return values[a].gasPrice < values[b].gasPrice; -// }); - -// var values = [{gasPrice: 9}, {gasPrice: 7}, {gasPrice: 9}, {gasPrice: 4}, {gasPrice: 6}]; - -// a.init(values); -// var best = a.peek(values); -// console.log(best.gasPrice == 4); -// a.replace(values, 0, {gasPrice: 11}); -// var best = a.peek(values); -// console.log(best.gasPrice == 6); -// a.shift(); -// var best = a.peek(values); -// console.log(best.gasPrice == 7); - -// a.replaceBest(values, {gasPrice: 99}); -// var best = a.peek(values); -// console.log(best.gasPrice == 9); - -// a.replaceBest(values, {gasPrice: 1}); -// var best = a.peek(values); -// console.log(best.gasPrice == 1); - -export default Heap; \ No newline at end of file +export default Heap; diff --git a/test/provider.ts b/test/provider.ts index 4fc60d1886..9a4ba842f9 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -1,7 +1,6 @@ import Ganache from "../index" -import * as assert from "assert"; +import assert from "assert"; import Provider from "../src/provider"; -import { JsonRpcQuantity } from "../src/types/json-rpc"; describe("provider", () => { const networkId = "1234"; @@ -12,19 +11,47 @@ describe("provider", () => { network_id: networkId }); }) - it.only("gets balance", async() => { + it("gets balance", async() => { const accounts = await p.send("eth_accounts"); const balance = await p.send("eth_getBalance", [accounts[0]]); - assert.strictEqual(balance, 100, "Heyo!"); + // TODO: this value is actually wrong! + assert.strictEqual(balance, "0x056bc75e2d63100000", "Heyo!"); }) - it("sends a transaction", async () => { + it.only("sends a transaction", async () => { + const seedrandom = require("seedrandom"); + const rand = seedrandom("sup"); const accounts = await p.send("eth_accounts"); - const result = await p.send("eth_sendTransaction", [{ + + + + + const nonces = [5, 3, 2, 1, 0]; + const to = accounts[accounts.length - 1]; + + + const id = setImmediate(()=>{console.log(1)}); + p.send("eth_sendTransaction", [{ from: accounts[0], - to: accounts[1], - value: 123 + to: to, + value: 10_000, + nonce: nonces[2], + gasPrice: (rand() * 100) | 0 }]); - console.log(result); + clearImmediate(id); + + // for every account (except the last one) + for (let j = 0; j < accounts.length - 6; j++) { + for (let i = 0; i < nonces.length; i++) { + // send transactions with our random nonces + await p.send("eth_sendTransaction", [{ + from: accounts[j], + to: to, + value: 10_000, + nonce: nonces[i], + gasPrice: (rand() * 100) | 0 + }]); + } + } }); it.skip("returns a transaction", async () => { var result = await p.send("eth_getTransactionByHash", ["0x123"]); From 51be80d88f347753c6ac8025bf985a8a12316c85 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Apr 2019 19:05:08 -0400 Subject: [PATCH 045/691] format document --- src/ledgers/ethereum/miner.ts | 273 +++++++++++++++++----------------- 1 file changed, 137 insertions(+), 136 deletions(-) diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index d540a8b548..55f149f471 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -10,155 +10,156 @@ import { rlp } from "ethereumjs-util"; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); function replaceFromHeap(priced: Heap, source: Heap, pending: Map>, key: string) { - // get the next best for this account: - const next = source.peek(); - if (next) { - // remove the current best priced transaction from this - // account and replace it with the account's next lowest - // nonce transaction: - priced.replaceBest(next); - } else { - // since we don't have a next, just remove this item from - // priced and delete the Heap from `pending` as it is now - // empty. - pending.delete(key) - priced.removeBest(); - } + // get the next best for this account: + const next = source.peek(); + if (next) { + // remove the current best priced transaction from this + // account and replace it with the account's next lowest + // nonce transaction: + priced.replaceBest(next); + } else { + // since we don't have a next, just remove this item from + // priced and delete the Heap from `pending` as it is now + // empty. + pending.delete(key) + priced.removeBest(); + } } type MinerOptions = { - gasLimit?: JsonRpcQuantity + gasLimit?: JsonRpcQuantity } function byPrice(values: Transaction[], a: number, b: number) { - return JsonRpcQuantity.from(values[a].gasPrice) > JsonRpcQuantity.from(values[b].gasPrice); + return JsonRpcQuantity.from(values[a].gasPrice) > JsonRpcQuantity.from(values[b].gasPrice); } export default class Miner { - private readonly options: MinerOptions; - private readonly vm: any - private readonly _runTx: ({tx:{}}) => Promise; - private readonly _checkpoint: () => Promise; - private readonly _commit: () => Promise; - private readonly _revert: () => Promise; - - // initialize a Heap that sorts by gasPrice - private readonly priced = new Heap(byPrice);; - constructor(vm: any, options: MinerOptions) { - this.vm = vm; - this.options = options; - this._runTx = promisify(vm.runTx.bind(vm)); - const stateManager = vm.stateManager; - this._checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); - this._commit = promisify(stateManager.commit.bind(stateManager)); - this._revert = promisify(stateManager.revert.bind(stateManager)); - - // init the heap with an empty array - this.priced.init([]); + private readonly options: MinerOptions; + private readonly vm: any + private readonly _runTx: ({ tx: { } }) => Promise; + private readonly _checkpoint: () => Promise; + private readonly _commit: () => Promise; + private readonly _revert: () => Promise; + + // initialize a Heap that sorts by gasPrice + private readonly priced = new Heap(byPrice);; + constructor(vm: any, options: MinerOptions) { + this.vm = vm; + this.options = options; + this._runTx = promisify(vm.runTx.bind(vm)); + const stateManager = vm.stateManager; + this._checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); + this._commit = promisify(stateManager.commit.bind(stateManager)); + this._revert = promisify(stateManager.revert.bind(stateManager)); + + // init the heap with an empty array + this.priced.init([]); + } + /** + * + * @param pending A live Map of pending transactions from the transaction + * pool. The miner will update this Map by removing the best transactions + * and putting them in a block. + * It is possible the miner will not empty the Map if it can't fit all + * transactions within a single block. The remaining items will be left in + * the pending pool to be eligible for mining in the future. + */ + public async mine(pending: Map>) { + const priced = this.priced; + const blockTransactions: any[] = []; + for (let mapping of pending) { + const next = mapping[1].peek(); + if (next) { + priced.push(next); + } } - /** - * - * @param pending A live Map of pending transactions from the transaction - * pool. The miner will update this Map by removing the best transactions - * and putting them in a block. - * It is possible the miner will not empty the Map if it can't fit all - * transactions within a single block. The remaining items will be left in - * the pending pool to be eligible for mining in the future. - */ - public async mine(pending: Map>) { - const priced = this.priced; - const blockTransactions: any[] = []; - for(let mapping of pending) { - const next = mapping[1].peek(); - if (next) { - priced.push(next); - } - } - let blockGasLeft = this.options.gasLimit.toBigInt(); - let best: Transaction; - let counter = 0; - const transactionTrie = new Trie(null, null); - const receiptTrie = new Trie(null, null); - const promises: Promise[] = []; - // Run until we run out of items, or until the inner loop stops us - while (best = priced.peek()) { - // if the current best transaction can't possibly fit in this block - // go ahead and run the next best transaction, ignoring all other - // pending transactions from this account. - if (best.calculateIntrinsicGas() > blockGasLeft) { - priced.removeBest(); - continue; - } - const origin = JsonRpcData.from(best.from).toString(); - const pendingFromOrigin = pending.get(origin); - - const runArgs = { - tx: best - }; - await this._checkpoint(); - const result = await this._runTx(runArgs).catch((err: Error) => ({ err })); - if (result.err) { - await this._revert(); - const errorMessage = result.err.message; - if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { - // update `priced` with the next best for this account: - replaceFromHeap(priced, pendingFromOrigin, pending, origin); - } - } else { - await this._commit(); - const gasUsed = JsonRpcQuantity.from(result.gasUsed.toBuffer()).toBigInt(); - if (blockGasLeft >= gasUsed) { - blockGasLeft -= gasUsed; - - const resultVm = result.vm; - const txLogs = resultVm.logs || []; - // result.vm.exception is flipped so 1=0 and 0=1. :facepalm: - const status = resultVm.exception ? 1 : 0; - const bitVector = result.bloom.bitvector; - const rawReceipt = [ - status, - result.gasUsed.toBuffer(), - bitVector, - txLogs - ]; - const rcptBuffer = rlp.encode(rawReceipt); - const key = rlp.encode(counter); - promises.push(putInTrie(transactionTrie, key, best.serialize())); - promises.push(putInTrie(receiptTrie, key, rcptBuffer)); - - // remove the current (`best`) item from the pending queue as we - // now know it will fit in the block. - pendingFromOrigin.removeBest(); - - // We've found ourselves a block. Yeehaw! - blockTransactions.push(best); - - await promises; - - // if we don't have enough gas for even the smallest of - // transactions we're done, clear `priced` & break the loop - if (blockGasLeft <= params.TRANSACTION_GAS) { - // we ran out of space, so let's clear - priced.clear(); - break; - } - - // update `priced` with the next best for this account: - replaceFromHeap(priced, pendingFromOrigin, pending, origin); - } else { - // didn't fit. remove it from the priced transactions - // without replacing it with another from the account. - priced.removeBest(); - } - } + let blockGasLeft = this.options.gasLimit.toBigInt(); + let best: Transaction; + let counter = 0; + const transactionTrie = new Trie(null, null); + const receiptTrie = new Trie(null, null); + const promises: Promise[] = []; + // Run until we run out of items, or until the inner loop stops us + while (best = priced.peek()) { + // if the current best transaction can't possibly fit in this block + // go ahead and run the next best transaction, ignoring all other + // pending transactions from this account. + if (best.calculateIntrinsicGas() > blockGasLeft) { + priced.removeBest(); + continue; + } + const origin = JsonRpcData.from(best.from).toString(); + const pendingFromOrigin = pending.get(origin); + + const runArgs = { + tx: best + }; + await this._checkpoint(); + const result = await this._runTx(runArgs).catch((err: Error) => ({ err })); + if (result.err) { + await this._revert(); + const errorMessage = result.err.message; + if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { + // update `priced` with the next best for this account: + replaceFromHeap(priced, pendingFromOrigin, pending, origin); + } + continue; + } + + await this._commit(); + const gasUsed = JsonRpcQuantity.from(result.gasUsed.toBuffer()).toBigInt(); + if (blockGasLeft >= gasUsed) { + blockGasLeft -= gasUsed; + + const resultVm = result.vm; + const txLogs = resultVm.logs || []; + // result.vm.exception is flipped so 1=0 and 0=1. :facepalm: + const status = resultVm.exception ? 1 : 0; + const bitVector = result.bloom.bitvector; + const rawReceipt = [ + status, + result.gasUsed.toBuffer(), + bitVector, + txLogs + ]; + const rcptBuffer = rlp.encode(rawReceipt); + const key = rlp.encode(counter); + promises.push(putInTrie(transactionTrie, key, best.serialize())); + promises.push(putInTrie(receiptTrie, key, rcptBuffer)); + + // remove the current (`best`) item from the pending queue as we + // now know it will fit in the block. + pendingFromOrigin.removeBest(); + + // We've found ourselves a block. Yeehaw! + blockTransactions.push(best); + + await promises; + + // if we don't have enough gas for even the smallest of + // transactions we're done, clear `priced` & break the loop + if (blockGasLeft <= params.TRANSACTION_GAS) { + // we ran out of space, so let's clear + priced.clear(); + break; } - this.finalizeBlock(blockTransactions, transactionTrie, receiptTrie); + // update `priced` with the next best for this account: + replaceFromHeap(priced, pendingFromOrigin, pending, origin); + } else { + // didn't fit. remove it from the priced transactions + // without replacing it with another from the account. + priced.removeBest(); + } } - private async finalizeBlock(blockTransactions: Transaction[], transactionTrie: Trie, receiptTrie: Trie): Promise { - // TODO: create the block and save it to the database - return new Block(Buffer.from([0]), null); - } + this.finalizeBlock(blockTransactions, transactionTrie, receiptTrie); + } + + private async finalizeBlock(blockTransactions: Transaction[], transactionTrie: Trie, receiptTrie: Trie): Promise { + // TODO: create the block and save it to the database + return new Block(Buffer.from([0]), null); + } } \ No newline at end of file From f36064774b2a0fd58297937030de4fa5eddf03dd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 May 2019 19:32:16 -0400 Subject: [PATCH 046/691] Fix the transaction pool and miner to better handle out of order transactions. --- src/ledgers/ethereum/blockchain.ts | 35 +- src/ledgers/ethereum/components/manager.ts | 6 +- .../ethereum/components/transaction-pool.ts | 328 +++++++++--------- src/ledgers/ethereum/ledger.ts | 32 +- src/ledgers/ethereum/miner.ts | 194 ++++++++--- src/ledgers/ethereum/options.ts | 6 +- src/options/options.ts | 10 +- src/provider.ts | 10 +- src/types/account.ts | 16 +- src/types/address.ts | 6 +- src/types/json-rpc/index.ts | 6 +- src/types/json-rpc/json-rpc-data.ts | 22 +- src/types/json-rpc/json-rpc-quantity.ts | 20 +- src/types/transaction.ts | 166 ++++----- src/utils/heap.ts | 20 +- test/provider.ts | 27 ++ 16 files changed, 531 insertions(+), 373 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 50fee93c4c..7fd7614a25 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -4,10 +4,10 @@ import Emittery from "emittery"; import BlockManager, { Block } from "./components/block-manager"; import TransactionManager from "./components/transaction-manager"; import Trie from "merkle-patricia-tree"; -import { BN, MAX_INTEGER } from "ethereumjs-util"; +import { BN } from "ethereumjs-util"; import Account from "../../types/account"; import { promisify } from "util"; -import { JsonRpcQuantity, JsonRpcData } from "../../types/json-rpc"; +import { Quantity, Data } from "../../types/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; import Heap from "../../utils/heap"; @@ -21,7 +21,7 @@ type BlockchainOptions = { accounts?: Account[], hardfork?: string, allowUnlimitedContractSize?: boolean, - gasLimit?: JsonRpcQuantity, + gasLimit?: Quantity, timestamp?: Date }; @@ -61,7 +61,7 @@ export default class Blockchain extends Emittery { const miner = new Miner(this.vm, options); const instamining = true; - if(instamining){ + if (instamining) { this.transactions.transactionPool.on("drain", async (pending: Map>) => { await miner.mine(pending); }); @@ -71,11 +71,28 @@ export default class Blockchain extends Emittery { await miner.mine(pending); setTimeout(mine, minerInterval, pending); }; - setTimeout(mine, minerInterval, this.transactions.transactionPool.pending); + setTimeout(mine, minerInterval, this.transactions.transactionPool.executables); } await this._initializeAccounts(options.accounts); - await this._initializeGenesisBlock(options.timestamp, options.gasLimit); + let lastBlock = this._initializeGenesisBlock(options.timestamp, options.gasLimit); + await lastBlock; + miner.on("block", async (blockData: any) => { + const previousBlock = await lastBlock; + const previousHeader = previousBlock.value.header; + const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; + const block = this.blocks.createBlock({ + number: Quantity.from(previousNumber + 1n).toBuffer(), + gasLimit: options.gasLimit.toBuffer(), + timestamp: this.currentTime(), + parentHash: previousHeader.hash(), + transactionsTrie: blockData.transactionsTrie.root, + receiptTrie: blockData.receiptTrie.root + }); + console.log( Quantity.from(block.value.header.number).toBigInt() ); + + lastBlock = this.blocks.set(block); + }); this.emit("ready"); }); @@ -116,7 +133,7 @@ export default class Blockchain extends Emittery { return commit(); } - async _initializeGenesisBlock(timestamp: Date, blockGasLimit: JsonRpcQuantity): Promise { + async _initializeGenesisBlock(timestamp: Date, blockGasLimit: Quantity): Promise { // create the genesis block const genesis = this.blocks.next({ // If we were given a timestamp, use it instead of the `currentTime` @@ -143,8 +160,8 @@ export default class Blockchain extends Emittery { return number.toString() as any; } - async queueTransaction(transaction: any): Promise { + async queueTransaction(transaction: any): Promise { await this.transactions.push(transaction); - return JsonRpcData.from(transaction.hash()); + return Data.from(transaction.hash()); } } diff --git a/src/ledgers/ethereum/components/manager.ts b/src/ledgers/ethereum/components/manager.ts index ad6c018d48..db46e09318 100644 --- a/src/ledgers/ethereum/components/manager.ts +++ b/src/ledgers/ethereum/components/manager.ts @@ -1,5 +1,5 @@ import levelup from "levelup"; -import { JsonRpcData } from "../../../types/json-rpc"; +import { Data } from "../../../types/json-rpc"; import Blockchain from "../blockchain"; export type Instantiable = {new(...args: any[]): T}; @@ -15,11 +15,11 @@ export default class Manager { } get(key: string | Buffer): Promise { if (typeof key === "string") { - key = JsonRpcData.from(key).toBuffer(); + key = Data.from(key).toBuffer(); } return this.base.get(key).then((raw) => new this.Type(raw)); } set(key: Buffer, value: Buffer): Promise { - return this.base.put(key, value).then((raw) => new this.Type(raw)); + return this.base.put(key, value).then((raw) => new this.Type(value)); } } \ No newline at end of file diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index 253d35470b..c8da914233 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -2,197 +2,193 @@ import Emittery from "emittery"; import Blockchain from "../blockchain"; import Heap from "../../../utils/heap"; import Transaction from "../../../types/transaction"; -import { JsonRpcData, JsonRpcQuantity } from "../../../types/json-rpc"; -import { SSL_OP_SSLEAY_080_CLIENT_DH_BUG } from "constants"; +import { Data, Quantity } from "../../../types/json-rpc"; export type TransactionPoolOptions = { - gasPrice?: JsonRpcQuantity, - gasLimit?: JsonRpcQuantity + gasPrice?: Quantity, + gasLimit?: Quantity }; function byNonce(values: Transaction[], a: number, b: number) { - return (JsonRpcQuantity.from(values[b].nonce).toBigInt() || 0n) > (JsonRpcQuantity.from(values[a].nonce).toBigInt() || 0n); + return (Quantity.from(values[b].nonce).toBigInt() || 0n) > (Quantity.from(values[a].nonce).toBigInt() || 0n); } export default class TransactionPool extends Emittery { - private options: TransactionPoolOptions; - - /** - * Minimum gas price to enforce for acceptance into the pool - */ - public priceLimit: number = 1 - - /** - * Minimum price bump percentage to replace an already existing transaction (nonce) - */ - public priceBump: number = 10 - - /** - * Number of executable transaction slots guaranteed per account - */ - public accountSlots: number = 16 - - /** - * Maximum number of executable transaction slots for all accounts - */ - public globalSlots: number = 4096 - - /** - * Maximum number of non-executable transaction slots permitted per account - */ - public accountQueue: number = 64 - - /** - * Maximum number of non-executable transaction slots for all accounts - */ - public globalQueue: number = 1024 - - /** - * Maximum amount of time non-executable transaction are queued, in milliseconds - */ - public lifetime: number = 3 * 24 * 60 * 60 * 1000 - - private blockchain: Blockchain; - constructor(blockchain: Blockchain, options: TransactionPoolOptions) { - super(); - this.blockchain = blockchain; - this.options = options; + private options: TransactionPoolOptions; + + /** + * Minimum gas price to enforce for acceptance into the pool + */ + public priceLimit: number = 0 + + /** + * Minimum price bump percentage to replace an already existing transaction (nonce) + */ + public priceBump: bigint = 10n + + private blockchain: Blockchain; + constructor(blockchain: Blockchain, options: TransactionPoolOptions) { + super(); + this.blockchain = blockchain; + this.options = options; + } + public executables: Map> = new Map(); + private origins: Map> = new Map(); + + public async insert(transaction: Transaction) { + let err: Error; + + err = this.validateTransaction(transaction); + if (err != null) { + throw err; } - public length: number; - private hashes = new Set(); - public pending: Map> = new Map(); - private origins: Map> = new Map(); - - public async insert(transaction: Transaction) { - const hash = transaction.hash().toString(); - - // if this transaction is a duplicate, discard it - if (this.hashes.has(hash)) { - throw new Error(`known transaction: ${hash}`); - } - let err: Error; - err = this.validateTransaction(transaction); - if (err != null) { - throw err; + const from = Data.from(transaction.from); + const transactionNonce = Quantity.from(transaction.nonce).toBigInt() || 0n; + + const origin = from.toString(); + const origins = this.origins; + let queuedOriginTransactions = origins.get(origin); + + let isExecutableTransaction = false; + const executables = this.executables; + let executableOriginTransactions = executables.get(origin); + + if (executableOriginTransactions) { + // check if a transaction with the same nonce is in the origin's + // executables queue already. Replace the matching transaction or throw this + // new transaction away as neccessary. + const pendingArray = executableOriginTransactions.array; + const priceBump = this.priceBump; + const newGasPrice = Quantity.from(transaction.gasPrice).toBigInt() + // Notice: we're iterating over the raw heap array, which isn't + // neccessarily sorted + for (let i = 0, l = executableOriginTransactions.length; i < l; i++) { + const currentPendingTx = pendingArray[i]; + const thisNonce = Quantity.from(currentPendingTx.nonce).toBigInt(); + if (thisNonce === transactionNonce) { + const gasPrice = Quantity.from(currentPendingTx.gasPrice).toBigInt(); + const thisPricePremium = gasPrice + ((gasPrice * priceBump) / 100n); + + // TODO: how do we surface these transaction failures to the caller?! + + // if our new price is `thisPrice * priceBumpPercent` better than our + // oldPrice, throw out the old now. + if (newGasPrice > thisPricePremium) { + isExecutableTransaction = true; + // do an in-place replace without triggering a resort because we + // already known where this tranassction should go in this byNonce + // heap. + executableOriginTransactions.array[i] = transaction; + throw new Error("That old transaction sucked, yo!"); + } else { + throw new Error("That new transaction sucked, yo!"); + } + break; } + } + } - const from = JsonRpcData.from(transaction.from); - - const origin = from.toString(); - const orgins = this.origins; - let queuedOriginTransactions = orgins.get(origin); + const transactor = await this.blockchain.accounts.get(from); + err = await this.validateTransactor(transaction, transactor); + if (err != null) { + throw err; + } - // TODO: If the transaction pool is full, discard underpriced transactions - if (this.length >= this.globalSlots + this.globalQueue) { - // TODO: If the new transaction is underpriced, don't accept it - // TODO: if the new transaction is better than our worse one, make - // room for it by discarding a cheaper transaction - } - // TODO: if the transaction is replacing an already pending transaction, - // do it now... - // a transaction can replace a *pending* transaction if the new tx's - // nonce matches the pending nonce - // AND the new tx's gasPrice is `this.priceBump` greater than the - // pending tx's. - - - - const transactor = await this.blockchain.accounts.get(from); - err = await this.validateTransactor(transaction, transactor); - if (err != null) { - throw err; - } + if (!isExecutableTransaction) { + // If the transaction wasn't foudn in our origin's executables queue, + // check if it is at the correct `nonce` by looking up the origin's + // current nonce + const transactorNextNonce = (transactor.nonce.toBigInt() || 0n) + 1n; + isExecutableTransaction = transactorNextNonce === transactionNonce; + } - // If a transaction is at the correct `nonce` it is executable. - const transactionNonce = JsonRpcQuantity.from(transaction.nonce).toBigInt() || 0n; - let transactorNonce = transactor.nonce.toBigInt(); - if (transactorNonce == null) { - transactorNonce = -1n; - } - if (transactorNonce + 1n === transactionNonce) { - // we need to pull out the origin's transactions that are now executable - // from the `pendingOriginTransactions`, if it is available - const pending = this.pending; - let pendingOriginTransactions = pending.get(origin); - if (!pendingOriginTransactions) { - pendingOriginTransactions = new Heap(byNonce); - pendingOriginTransactions.array = [transaction]; - pendingOriginTransactions.length = 1; - pending.set(origin, pendingOriginTransactions); + // if it is executable add it to the executables queue + if (isExecutableTransaction) { + if (executableOriginTransactions) { + executableOriginTransactions.push(transaction); + } else { + // if we don't yet have a executables queue for this origin make one now + executableOriginTransactions = Heap.from(transaction, byNonce); + executables.set(origin, executableOriginTransactions); + } + + // Now we need to drain any queued transacions that were previously + // not executable due to nonce gaps into the origin's queue... + if (queuedOriginTransactions) { + let nextExpectedNonce: bigint = transactionNonce + 1n; + while (true) { + const nextTx = queuedOriginTransactions.peek(); + const nextTxNonce = Quantity.from(nextTx.nonce).toBigInt() || 0n; + if (nextTxNonce !== nextExpectedNonce) { + break; + } else { + // we've got a an executable nonce! Put it in the executables queue. + executableOriginTransactions.push(nextTx); + // And then remove this transaction from its origin's queue + if (queuedOriginTransactions.removeBest()) { + nextExpectedNonce += 1n; } else { - pendingOriginTransactions.push(transaction); - } - if (queuedOriginTransactions) { - let nextTransaction: any; - let nextNonce: bigint = transactionNonce; - while (nextTransaction = queuedOriginTransactions.peek()) { - nextNonce += 1n; - const nextTxNonce = JsonRpcQuantity.from(nextTransaction.nonce).toBigInt() || 0n; - if (nextTxNonce !== nextNonce) { - break; - } else { - pendingOriginTransactions.push(nextTransaction); - // remove this transaction from the queue - queuedOriginTransactions.removeBest(); - } - } + // removeBest() returns `false` when there are no more items after + // the remove item. Let's do some cleanup when that happens + origins.delete(origin); + break; } - // notify miner that we have pending transactions ready for it - this.emit("drain", pending); - return; + } } + } - // TODO: if we got here we have a transaction that *isn't* executable - // insert the transaction in its origin's (i.e., the `from` address's) - // Heap, which sorts by nonce - - if (!queuedOriginTransactions) { - queuedOriginTransactions = new Heap(byNonce); - queuedOriginTransactions.array = [transaction]; - queuedOriginTransactions.length = 1; - orgins.set(origin, queuedOriginTransactions); - } else { - queuedOriginTransactions.push(transaction); - } + // notify listeners (the miner, probably) that we have executables + // transactions ready for it + this.emit("drain", executables); + return; } - public validateTransaction(transaction: Transaction): Error { - // Check the transaction doesn't exceed the current block limit gas. - if (this.options.gasLimit < JsonRpcQuantity.from(transaction.gasLimit)) { - return new Error("Transaction gasLimit is too low"); - } + if (queuedOriginTransactions) { + queuedOriginTransactions.push(transaction); + } else { + queuedOriginTransactions = Heap.from(transaction, byNonce); + origins.set(origin, queuedOriginTransactions); + } + } - // Transactions can't be negative. This may never happen using RLP - // decoded transactions but may occur if you create a transaction using - // the RPC for example. - if (transaction.value < 0) { - return new Error("Transaction value cannot be negative"); - } + private validateTransaction(transaction: Transaction): Error { + // Check the transaction doesn't exceed the current block limit gas. + if (this.options.gasLimit < Quantity.from(transaction.gasLimit)) { + return new Error("Transaction gasLimit is too low"); + } - // Should supply enough intrinsic gas - const gas = transaction.calculateIntrinsicGas(); - if (transaction.gasPrice < gas) { - return new Error("intrisic gas too low"); - } + // Transactions can't be negative. This may never happen using RLP + // decoded transactions but may occur if you create a transaction using + // the RPC for example. + if (transaction.value < 0) { + return new Error("Transaction value cannot be negative"); + } - return null; + // Should supply enough intrinsic gas + const gas = transaction.calculateIntrinsicGas(); + if (transaction.gasPrice < gas) { + return new Error("intrisic gas too low"); } - public async validateTransactor(transaction: Transaction, transactor: any): Promise { - // Transactor should have enough funds to cover the costs - if (transactor.balance.toBigInt() < transaction.cost()) { - return new Error("Account does not have enough funds to complete transaction"); - } + return null; + } - // check that the nonce isn't too low - let transactorNonce = transactor.nonce.toBigInt(); - if (transactorNonce == null) { - transactorNonce = -1n; - } - if (transactorNonce >= (JsonRpcQuantity.from(transaction.nonce).toBigInt() || 0n)) { - return new Error("Transaction nonce is too low"); - } - return null; + private async validateTransactor(transaction: Transaction, transactor: any): Promise { + // Transactor should have enough funds to cover the costs + if (transactor.balance.toBigInt() < transaction.cost()) { + return new Error("Account does not have enough funds to complete transaction"); + } + + // check that the nonce isn't too low + let transactorNonce = transactor.nonce.toBigInt(); + if (transactorNonce == null) { + transactorNonce = -1n; + } + const transactionNonce = (Quantity.from(transaction.nonce).toBigInt() || 0n); + if (transactorNonce >= transactionNonce) { + return new Error("Transaction nonce is too low"); } + return null; + } } \ No newline at end of file diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 1415104375..a7126df30d 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,7 +1,7 @@ //#region Imports import ILedger from "../../interfaces/ledger"; import EthereumOptions, { getDefaultOptions } from "./options"; -import { JsonRpcData, JsonRpcQuantity, IndexableJsonRpcData } from "../../types/json-rpc"; +import { Data, Quantity, IndexableData } from "../../types/json-rpc"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; import Address, { IndexableAddress } from "../../types/address"; @@ -15,9 +15,9 @@ const {name, version} = require("../../../package.json"); //#region Constants const CLIENT_VERSION = `EthereumJS ${name}/v${version}/ethereum-js` -const PROTOCOL_VERSION = JsonRpcData.from("0x3f"); +const PROTOCOL_VERSION = Data.from("0x3f"); const BUFFER_ZERO = Buffer.from([0]); -const RPCQUANTITY_ZERO = JsonRpcQuantity.from("0x0"); +const RPCQUANTITY_ZERO = Quantity.from("0x0"); //#endregion const hash = createKeccakHash("keccak256"); @@ -32,7 +32,7 @@ const _unlockedAccounts = Symbol("unlockedAccounts"); export default class Ethereum implements ILedger { private readonly [_accounts]: Address[]; - private readonly [_knownAccounts] = new Map(); + private readonly [_knownAccounts] = new Map(); private readonly [_unlockedAccounts] = new Set(); private readonly [_options]: EthereumOptions; private readonly [_coinbase]: Account; @@ -139,8 +139,8 @@ export default class Ethereum implements ILedger { * @param {string} the data to convert into a SHA3 hash. * @returns The SHA3 result of the given string. */ - async web3_sha3(string: string): Promise { - return JsonRpcData.from(hash(string).digest()); + async web3_sha3(string: string): Promise { + return Data.from(hash(string).digest()); }; /** @@ -164,7 +164,7 @@ export default class Ethereum implements ILedger { * Returns number of peers currently connected to the client. * @returns {QUANTITY} integer of the number of connected peers. */ - async net_peerCount(): Promise { + async net_peerCount(): Promise { return RPCQUANTITY_ZERO; } @@ -172,7 +172,7 @@ export default class Ethereum implements ILedger { * Returns the current ethereum protocol version. * @returns The current ethereum protocol version. */ - async eth_protocolVersion(): Promise { + async eth_protocolVersion(): Promise { return PROTOCOL_VERSION; } @@ -209,7 +209,7 @@ export default class Ethereum implements ILedger { * Returns the number of hashes per second that the node is mining with. * @returns number of hashes per second. */ - async eth_hashrate(): Promise { + async eth_hashrate(): Promise { return RPCQUANTITY_ZERO; } @@ -217,7 +217,7 @@ export default class Ethereum implements ILedger { * Returns the current price per gas in wei. * @returns integer of the current gas price in wei. */ - async eth_gasPrice(): Promise { + async eth_gasPrice(): Promise { return this[_options].gasPrice; } @@ -247,7 +247,7 @@ export default class Ethereum implements ILedger { async eth_getBalance( address: IndexableAddress, blockNumber: bigint | Tag = Tag.LATEST - ): Promise { + ): Promise { const chain = this[_blockchain]; const str = blockNumber.toString(); const block = await chain.blocks.get(Buffer.from([0])); @@ -263,8 +263,8 @@ export default class Ethereum implements ILedger { * * @param transasctionHash 32 Bytes - hash of a transaction */ - async eth_getTransactionByHash(transasctionHash: IndexableJsonRpcData): Promise { - transasctionHash = JsonRpcData.from(transasctionHash); + async eth_getTransactionByHash(transasctionHash: IndexableData): Promise { + transasctionHash = Data.from(transasctionHash); const chain = this[_blockchain]; const transaction = await chain.transactions.get(transasctionHash); @@ -275,7 +275,7 @@ export default class Ethereum implements ILedger { * * @param transaction */ - async eth_sendTransaction(transaction: any): Promise { + async eth_sendTransaction(transaction: any): Promise { let fromString = transaction.from; let from; if (fromString) { @@ -328,7 +328,7 @@ export default class Ethereum implements ILedger { if (tx.nonce.length === 0) { const account = await this[_blockchain].accounts.get(from); const accountNonce = (account.nonce.toBigInt()) || 0n; - tx.nonce = JsonRpcQuantity.from(1n + accountNonce).toBuffer(); + tx.nonce = Quantity.from(1n + accountNonce).toBuffer(); } const secretKey = this[_knownAccounts].get(fromString); tx.sign(secretKey.toBuffer()); @@ -341,7 +341,7 @@ export default class Ethereum implements ILedger { * * @param transaction */ - async eth_sendRawTransaction(transaction: any): Promise { + async eth_sendRawTransaction(transaction: any): Promise { await this[_blockchain].queueTransaction(transaction); return transaction.hash; } diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index 55f149f471..c2d1de8cae 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -2,39 +2,42 @@ import { Block } from "../../ledgers/ethereum/components/block-manager" import params from "../../types/params"; import Heap from "../../utils/heap"; import Transaction from "../../types/transaction"; -import { JsonRpcQuantity, JsonRpcData } from "../../types/json-rpc"; +import { Quantity, Data } from "../../types/json-rpc"; import { promisify } from "util"; import Trie from "merkle-patricia-tree"; import { rlp } from "ethereumjs-util"; +import Emittery = require("emittery"); const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); function replaceFromHeap(priced: Heap, source: Heap, pending: Map>, key: string) { - // get the next best for this account: - const next = source.peek(); + // get the next best for this account, removing from the source Heap: + const next = source.shift(); if (next) { - // remove the current best priced transaction from this + // remove the current best priced transaction from this // account and replace it with the account's next lowest // nonce transaction: priced.replaceBest(next); } else { // since we don't have a next, just remove this item from - // priced and delete the Heap from `pending` as it is now - // empty. - pending.delete(key) + // priced priced.removeBest(); } } type MinerOptions = { - gasLimit?: JsonRpcQuantity + gasLimit?: Quantity } function byPrice(values: Transaction[], a: number, b: number) { - return JsonRpcQuantity.from(values[a].gasPrice) > JsonRpcQuantity.from(values[b].gasPrice); + return Quantity.from(values[a].gasPrice) > Quantity.from(values[b].gasPrice); } -export default class Miner { +export default class Miner extends Emittery { + private currentlyExecutingPrice = 0n; + private origins = new Set(); + private pending: Map>; + private _isMining: boolean = false; private readonly options: MinerOptions; private readonly vm: any private readonly _runTx: ({ tx: { } }) => Promise; @@ -43,8 +46,9 @@ export default class Miner { private readonly _revert: () => Promise; // initialize a Heap that sorts by gasPrice - private readonly priced = new Heap(byPrice);; + private readonly priced = new Heap(byPrice); constructor(vm: any, options: MinerOptions) { + super(); this.vm = vm; this.options = options; this._runTx = promisify(vm.runTx.bind(vm)); @@ -56,6 +60,7 @@ export default class Miner { // init the heap with an empty array this.priced.init([]); } + /** * * @param pending A live Map of pending transactions from the transaction @@ -66,50 +71,80 @@ export default class Miner { * the pending pool to be eligible for mining in the future. */ public async mine(pending: Map>) { - const priced = this.priced; - const blockTransactions: any[] = []; - for (let mapping of pending) { - const next = mapping[1].peek(); - if (next) { - priced.push(next); - } + // only allow mining a single block at a time (per miner) + if (this._isMining) { + // if we are currently mining a block, set the `pending` property + // so the miner knows it should immediately mine another block once it is + // done with its current work. + this.pending = pending; + this.updatePricedHeap(pending); + return; + } else { + this.setPricedHeap(pending); } + this._isMining = true; + + const blockTransactions: Transaction[] = []; let blockGasLeft = this.options.gasLimit.toBigInt(); - let best: Transaction; + let counter = 0; - const transactionTrie = new Trie(null, null); + const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); const promises: Promise[] = []; - // Run until we run out of items, or until the inner loop stops us + + await this._checkpoint(); + + const priced = this.priced; + const rejectedTransactions: Transaction[] = []; + let best: Transaction; + // Run until we run out of items, or until the inner loop stops us. + // we don't call `shift()` here because we will will probably need to + // `replace`this top transaction with the next top transaction from the same + // origin. while (best = priced.peek()) { // if the current best transaction can't possibly fit in this block // go ahead and run the next best transaction, ignoring all other - // pending transactions from this account. + // pending transactions from this account for this block. if (best.calculateIntrinsicGas() > blockGasLeft) { priced.removeBest(); + rejectedTransactions.push(best); continue; } - const origin = JsonRpcData.from(best.from).toString(); + + const origin = Data.from(best.from).toString(); const pendingFromOrigin = pending.get(origin); const runArgs = { tx: best }; + this.currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); await this._checkpoint(); const result = await this._runTx(runArgs).catch((err: Error) => ({ err })); + // await new Promise((resolve)=>setTimeout(resolve, 2000)); if (result.err) { await this._revert(); const errorMessage = result.err.message; if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { - // update `priced` with the next best for this account: + // a race condition between the pool and the miner could potentially + // cause this issue. + // We do NOT want to re-run this transaction. + // Update the `priced` heap with the next best transaction from this + // account replaceFromHeap(priced, pendingFromOrigin, pending, origin); + + // TODO: how do we surface this error to the caller? + throw result.err; + } else { + // TODO: handle all other errors! + // TODO: how do we surface this error to the caller? + throw result.err; } continue; } - await this._commit(); - const gasUsed = JsonRpcQuantity.from(result.gasUsed.toBuffer()).toBigInt(); + + const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); if (blockGasLeft >= gasUsed) { blockGasLeft -= gasUsed; @@ -125,41 +160,112 @@ export default class Miner { txLogs ]; const rcptBuffer = rlp.encode(rawReceipt); - const key = rlp.encode(counter); - promises.push(putInTrie(transactionTrie, key, best.serialize())); + const key = rlp.encode(counter++); + promises.push(putInTrie(transactionsTrie, key, best.serialize())); promises.push(putInTrie(receiptTrie, key, rcptBuffer)); - // remove the current (`best`) item from the pending queue as we + // remove the current (`best`) item from the live pending queue as we // now know it will fit in the block. - pendingFromOrigin.removeBest(); - - // We've found ourselves a block. Yeehaw! blockTransactions.push(best); - await promises; - - // if we don't have enough gas for even the smallest of - // transactions we're done, clear `priced` & break the loop + // if we don't have enough gas left for even the smallest of + // transactions we're done if (blockGasLeft <= params.TRANSACTION_GAS) { - // we ran out of space, so let's clear - priced.clear(); break; } // update `priced` with the next best for this account: replaceFromHeap(priced, pendingFromOrigin, pending, origin); } else { - // didn't fit. remove it from the priced transactions - // without replacing it with another from the account. + // didn't fit. remove it from the priced transactions without replacing + // it with another from the account. This transaction will have to be + // run again in the next block. priced.removeBest(); + rejectedTransactions.push(best); } } + await Promise.all([promises, this._commit()]); + + // put the rejected transactions back in their original origin heaps + rejectedTransactions.forEach(transaction => { + // TODO: this transaction should probably be validated again...? + console.log(transaction); + }); + + this.emit("block", { + blockTransactions, + transactionsTrie, + receiptTrie + }); + + // reset the miner + this.reset(); + + if (this.pending) { + this.mine(this.pending); + this.pending = null; + } + } + + private reset(){ + this.origins.clear(); + this.priced.clear(); + this._isMining = false; + this.currentlyExecutingPrice = 0n; + } - this.finalizeBlock(blockTransactions, transactionTrie, receiptTrie); + private setPricedHeap(pending: Map>) { + const origins = this.origins; + const priced = this.priced; + + for (let mapping of pending) { + const heap = mapping[1]; + const next = heap.shift(); + if (next) { + const origin = Data.from(next.from).toString(); + origins.add(origin); + priced.push(next); + } + } } - private async finalizeBlock(blockTransactions: Transaction[], transactionTrie: Trie, receiptTrie: Trie): Promise { - // TODO: create the block and save it to the database - return new Block(Buffer.from([0]), null); + private updatePricedHeap(pending: Map>) { + const origins = this.origins; + const priced = this.priced; + // Note: the `pending` Map passed here is "live", meaning it is constantly + // being updated by the `transactionPool`. This allows us to begin + // processing a block with the _current_ pending transactions, and while + // that is processing, to receive new transactions + // updated out `priced` heap with new pending transactions + for (let mapping of pending) { + const heap = mapping[1]; + const next = heap.peek(); + if (next) { + const price = Quantity.from(next.gasPrice).toBigInt(); + if (this.currentlyExecutingPrice < price) { + // don't insert a tranaction into the miner's `priced` heap + // if it will be better than it's last + continue; + } + const origin = Data.from(next.from).toString(); + if (origins.has(origin)) { + // don't insert a transaction into the miner's `priced` heap if it + // has already queued up transactions for that origin + continue; + } + origins.add(origin); + priced.push(next); + heap.removeBest(); + } + } } + // private async finalizeBlock(blockTransactions: Transaction[], transactionTrie: Trie, receiptTrie: Trie) { + // this.emit("block", { + // blockTransactions, + // transactionTrie, + // receiptTrie + // }) + // // TODO: create the block and save it to the database + // //return new Block(Buffer.from([0]), null); + // } } \ No newline at end of file diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index c28a26843a..1a20547744 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,15 +1,15 @@ import ILedgerOptions from "../../interfaces/ledger-options" import Account from "../../types/account"; -import { JsonRpcQuantity } from "../../types/json-rpc"; +import { Quantity } from "../../types/json-rpc"; type EthereumOptions = ILedgerOptions & { net_version?: string | number, - gasPrice?: JsonRpcQuantity, + gasPrice?: Quantity, accounts?: Account[], unlocked_accounts?: string[] | number[], allowUnlimitedContractSize?: boolean, hardfork?: string, - gasLimit?: JsonRpcQuantity, + gasLimit?: Quantity, timestamp?: Date, db?: object, db_path?: string, diff --git a/src/options/options.ts b/src/options/options.ts index f92160dc72..a28769bd5c 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -1,4 +1,4 @@ -import {JsonRpcQuantity} from "../types/json-rpc"; +import {Quantity} from "../types/json-rpc"; import ILedger from "../interfaces/ledger"; interface Logger { @@ -131,13 +131,13 @@ export default interface Options { * Sets the default gas price for transactions if not otherwise specified. * Must be specified as a hex string in wei. Defaults to "0x77359400", or 2 gwei. */ - gasPrice?: JsonRpcQuantity, + gasPrice?: Quantity, /** * Sets the block gas limit. Must be specified as a hex string. Defaults to * "0x6691b7". */ - gasLimit?: JsonRpcQuantity, + gasLimit?: Quantity, /** * @@ -165,8 +165,8 @@ export const getDefault: (options: Options)=> Options = (options) => { vmErrorsOnRPCResponse: true, hdPath: "m/44'/60'/0'/0/", allowUnlimitedContractSize: false, - gasPrice: new JsonRpcQuantity("0x77359400"), - gasLimit: new JsonRpcQuantity("0x6691b7"), + gasPrice: new Quantity("0x77359400"), + gasLimit: new Quantity("0x6691b7"), verbose: false, asyncRequestProcessing: false, hardfork: "petersburg", diff --git a/src/provider.ts b/src/provider.ts index 62ff29e343..5179dd5395 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,4 +1,4 @@ -import { JsonRpcQuantity, JsonRpcData } from "./types/json-rpc"; +import { Quantity, Data } from "./types/json-rpc"; import Engine from "./engine"; import RequestProcessor from "./utils/request-processor"; import ProviderOptions, { getDefault as getDefaultProviderOptions } from "./options/provider-options"; @@ -59,7 +59,7 @@ export default class Provider extends Emittery { // move this into the Ledger or it's Blockchain? private initializeAccounts(): Account[]{ const _providerOptions = this[options]; - const etherInWei = JsonRpcQuantity.from(JsonRpcQuantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); + const etherInWei = Quantity.from(Quantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); let accounts: Account[]; let givenAccounts = _providerOptions.accounts @@ -68,7 +68,7 @@ export default class Provider extends Emittery { accounts = Array(l); for (let i = 0; i < l; i++) { const account = givenAccounts[i]; - accounts[i] = this.createAccount(etherInWei, JsonRpcData.from(account[1]), JsonRpcData.from(account[0])); + accounts[i] = this.createAccount(etherInWei, Data.from(account[1]), Data.from(account[0])); } } else { const l =_providerOptions.total_accounts; @@ -81,7 +81,7 @@ export default class Provider extends Emittery { const acct = wallet.derivePath(hdPath + index); const accountWallet = acct.getWallet(); const address = Address.from(accountWallet.getAddress()); - const privateKey = JsonRpcData.from(accountWallet.getPrivateKey()); + const privateKey = Data.from(accountWallet.getPrivateKey()); accounts[index] = this.createAccount(etherInWei, privateKey, address); } } else { @@ -92,7 +92,7 @@ export default class Provider extends Emittery { } // TODO: this should probable be moved as well (see `initializeAccounts` above) - private createAccount(balance: JsonRpcQuantity, privateKey: JsonRpcData, address?: Address) { + private createAccount(balance: Quantity, privateKey: Data, address?: Address) { address = address || Address.from(privateToAddress(privateKey.toBuffer())); const account = new Account(address); diff --git a/src/types/account.ts b/src/types/account.ts index 607b3b489e..e28fda8ecf 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -1,12 +1,12 @@ -import { JsonRpcData, JsonRpcQuantity } from "./json-rpc"; +import { Data, Quantity } from "./json-rpc"; import Address from "./address"; import { rlp, KECCAK256_RLP, KECCAK256_NULL } from "ethereumjs-util"; export default class Account { public address: Address; - public balance: JsonRpcQuantity; - public privateKey: JsonRpcData; - public nonce: JsonRpcQuantity; + public balance: Quantity; + public privateKey: Data; + public nonce: Quantity; public stateRoot: Buffer = KECCAK256_RLP; public codeHash: Buffer = KECCAK256_NULL; @@ -15,12 +15,12 @@ export default class Account { constructor(arg: Address | Buffer) { if (arg instanceof Address){ this.address = arg; - this.balance = new JsonRpcQuantity(0n); - this.nonce = new JsonRpcQuantity(0n); + this.balance = new Quantity(0n); + this.nonce = new Quantity(0n); } else if (Buffer.isBuffer(arg)){ const arr = rlp.decode(arg) as any as Buffer[]; - this.nonce = JsonRpcQuantity.from(arr[0]); - this.balance = JsonRpcQuantity.from(arr[1]); + this.nonce = Quantity.from(arr[0]); + this.balance = Quantity.from(arr[1]); this.stateRoot = arr[2]; this.codeHash = arr[3]; } diff --git a/src/types/address.ts b/src/types/address.ts index 6ca6f35a5e..bcc040eaef 100644 --- a/src/types/address.ts +++ b/src/types/address.ts @@ -1,7 +1,7 @@ -import {IndexableJsonRpcType, JsonRpcData} from "./json-rpc"; +import {IndexableJsonRpcType, Data} from "./json-rpc"; -const Address = JsonRpcData; +const Address = Data; -interface Address extends JsonRpcData {} +interface Address extends Data {} export type IndexableAddress = Address & IndexableJsonRpcType; export default Address; \ No newline at end of file diff --git a/src/types/json-rpc/index.ts b/src/types/json-rpc/index.ts index a0ff451baa..c5c5208837 100644 --- a/src/types/json-rpc/index.ts +++ b/src/types/json-rpc/index.ts @@ -1,4 +1,4 @@ import {IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType} from "./json-rpc-base-types"; -import JsonRpcQuantity, {IndexableJsonRpcQuantity} from "./json-rpc-quantity"; -import JsonRpcData, {IndexableJsonRpcData} from "./json-rpc-data"; -export {JsonRpcData, JsonRpcQuantity, IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType, IndexableJsonRpcQuantity, IndexableJsonRpcData}; +import Quantity, {IndexableQuantity} from "./json-rpc-quantity"; +import Data, {IndexableData} from "./json-rpc-data"; +export {Data, Quantity, IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType, IndexableQuantity, IndexableData}; diff --git a/src/types/json-rpc/json-rpc-data.ts b/src/types/json-rpc/json-rpc-data.ts index bcb794d1da..14d3cf9361 100644 --- a/src/types/json-rpc/json-rpc-data.ts +++ b/src/types/json-rpc/json-rpc-data.ts @@ -7,10 +7,10 @@ function validateByteLength(byteLength?: number){ } } const byteLengths = new WeakMap(); -export class JsonRpcData extends BaseJsonRpcType { +export class Data extends BaseJsonRpcType { constructor(value: string | Buffer, byteLength?: number) { if (typeof value === "bigint"){ - throw new Error(`Cannot create a ${typeof value} as a JsonRpcData`); + throw new Error(`Cannot create a ${typeof value} as a Data`); } super(value); if (byteLength !== undefined) { @@ -50,23 +50,23 @@ export class JsonRpcData extends BaseJsonRpcType { } } public static from(value: T, byteLength?: number) { - return new _JsonRpcData(value, byteLength); + return new _Data(value, byteLength); } } type $ = { - new(value: T, byteLength?: number): _JsonRpcData & JsonRpcType, - from(value: T, byteLength?: number): _JsonRpcData & JsonRpcType, + new(value: T, byteLength?: number): _Data & JsonRpcType, + from(value: T, byteLength?: number): _Data & JsonRpcType, toString(byteLength?: number): string, toBuffer(): Buffer } -const _JsonRpcData = JsonRpcData as $; +const _Data = Data as $; -interface _JsonRpcData { - constructor(value: T, byteLength?: number): _JsonRpcData - from(value: T, byteLength?: number): _JsonRpcData, +interface _Data { + constructor(value: T, byteLength?: number): _Data + from(value: T, byteLength?: number): _Data, toString(byteLength?: number): string, toBuffer(): Buffer } -export type IndexableJsonRpcData = _JsonRpcData & IndexableJsonRpcType; -export default _JsonRpcData; +export type IndexableData = _Data & IndexableJsonRpcType; +export default _Data; diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index f597bbc345..2bb652507f 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -1,9 +1,9 @@ import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; const toBigIntBE = require('bigint-buffer').toBigIntBE; -class JsonRpcQuantity extends BaseJsonRpcType { +class Quantity extends BaseJsonRpcType { public static from(value: number | bigint | string | Buffer) { - return new _JsonRpcQuantity(value); + return new _Quantity(value); } public toBigInt(): bigint { const value = this.value; @@ -51,19 +51,19 @@ class JsonRpcQuantity extends BaseJsonRpcType { } } type $ = { - new(value: T): _JsonRpcQuantity & JsonRpcType, - from(value: T): _JsonRpcQuantity & JsonRpcType, + new(value: T): _Quantity & JsonRpcType, + from(value: T): _Quantity & JsonRpcType, toBigInt(): bigint, toBuffer(): Buffer } -const _JsonRpcQuantity = JsonRpcQuantity as $; +const _Quantity = Quantity as $; -interface _JsonRpcQuantity { - constructor(value: T): _JsonRpcQuantity - from(): _JsonRpcQuantity, +interface _Quantity { + constructor(value: T): _Quantity + from(): _Quantity, toBigInt(): bigint, toBuffer(): Buffer } -export type IndexableJsonRpcQuantity = _JsonRpcQuantity & IndexableJsonRpcType; -export default _JsonRpcQuantity; +export type IndexableQuantity = _Quantity & IndexableJsonRpcType; +export default _Quantity; diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 1e94c1a64a..d9538a9ade 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -1,12 +1,12 @@ import Errors from "./errors" -import { JsonRpcData } from "./json-rpc/json-rpc-data"; -import { JsonRpcQuantity } from "./json-rpc"; +import { Data } from "./json-rpc/json-rpc-data"; +import { Quantity } from "./json-rpc"; import params from "./params"; const MAX_UINT64 = (1n << 64n) - 1n; -// import { JsonRpcData, JsonRpcQuantity } from "./json-rpc"; +// import { Data, Quantity } from "./json-rpc"; // import Address from "./address"; // type TransactionDataObject = { @@ -27,55 +27,55 @@ const MAX_UINT64 = (1n << 64n) - 1n; // } // type TransactionData = { -// blockHash: JsonRpcData, -// blockNumber: JsonRpcData, +// blockHash: Data, +// blockNumber: Data, // from: Address, -// gas: JsonRpcQuantity, -// gasPrice: JsonRpcQuantity, -// hash: JsonRpcData, -// input: JsonRpcData, -// nonce: JsonRpcQuantity, +// gas: Quantity, +// gasPrice: Quantity, +// hash: Data, +// input: Data, +// nonce: Quantity, // to: Address, -// transactionIndex: JsonRpcQuantity, -// value: JsonRpcQuantity, -// v: JsonRpcQuantity, -// r: JsonRpcData, -// s: JsonRpcData +// transactionIndex: Quantity, +// value: Quantity, +// v: Quantity, +// r: Data, +// s: Data // } // export default class Transaction implements TransactionData { -// blockHash: JsonRpcData; -// blockNumber: JsonRpcData; -// from: JsonRpcData; -// gas: JsonRpcQuantity; -// gasPrice: JsonRpcQuantity; -// get hash(): JsonRpcData { -// return new JsonRpcData("0x123"); +// blockHash: Data; +// blockNumber: Data; +// from: Data; +// gas: Quantity; +// gasPrice: Quantity; +// get hash(): Data { +// return new Data("0x123"); // }; -// input: JsonRpcData; -// nonce: JsonRpcQuantity; -// to: JsonRpcData; -// transactionIndex: JsonRpcQuantity; -// value: JsonRpcQuantity; -// v: JsonRpcQuantity; -// r: JsonRpcData; -// s: JsonRpcData; +// input: Data; +// nonce: Quantity; +// to: Data; +// transactionIndex: Quantity; +// value: Quantity; +// v: Quantity; +// r: Data; +// s: Data; // constructor(transaction: TransactionData) { // const obj = { -// blockHash: JsonRpcData.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. -// blockNumber: JsonRpcQuantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. -// from: JsonRpcData.from("0x123456", 32), // 20 Bytes - address of the sender. -// gas: JsonRpcQuantity.from(123n),// QUANTITY - gas provided by the sender. -// gasPrice: JsonRpcQuantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. -// hash: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. -// input: JsonRpcData.from("0x123"),// DATA - the data send along with the transaction. -// nonce: JsonRpcQuantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. -// to: JsonRpcData.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. -// transactionIndex: JsonRpcQuantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. -// value: JsonRpcQuantity.from(123n),// QUANTITY - value transferred in Wei. -// v: JsonRpcQuantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id -// r: JsonRpcData.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r -// s: JsonRpcData.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s +// blockHash: Data.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. +// blockNumber: Quantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. +// from: Data.from("0x123456", 32), // 20 Bytes - address of the sender. +// gas: Quantity.from(123n),// QUANTITY - gas provided by the sender. +// gasPrice: Quantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. +// hash: Data.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. +// input: Data.from("0x123"),// DATA - the data send along with the transaction. +// nonce: Quantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. +// to: Data.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. +// transactionIndex: Quantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. +// value: Quantity.from(123n),// QUANTITY - value transferred in Wei. +// v: Quantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id +// r: Data.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r +// s: Data.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s // } as any; // Object.keys(obj).forEach((key) => { // (this as any)[key] = obj[key] as any; @@ -213,7 +213,7 @@ function fixProps(tx: any, data: any) { function initData(tx: any, data: any) { if (data) { if (typeof data === "string") { - data = JsonRpcData.from(data).toBuffer(); + data = Data.from(data).toBuffer(); data = rlp.decode(data); } else if (Buffer.isBuffer(data)) { data = rlp.decode(data); @@ -282,9 +282,9 @@ export default class Transaction extends EthereumJsTransaction { } cost(): bigint { - return JsonRpcQuantity.from(this.gasPrice).toBigInt() - * JsonRpcQuantity.from(this.gas).toBigInt() - + JsonRpcQuantity.from(this.value).toBigInt(); + return Quantity.from(this.gasPrice).toBigInt() + * Quantity.from(this.gas).toBigInt() + + Quantity.from(this.value).toBigInt(); } /** @@ -332,7 +332,7 @@ export default class Transaction extends EthereumJsTransaction { let toAccount; if (json.to) { // Remove all padding and make it easily comparible. - const buf = JsonRpcData.from(json.to).toBuffer(); + const buf = Data.from(json.to).toBuffer(); if (buf.equals(BUFFER_ZERO)) { // if the address is 0x0 make it 0x0{20} @@ -343,20 +343,20 @@ export default class Transaction extends EthereumJsTransaction { } const data = json.data || json.input; const options = { - nonce: JsonRpcData.from(json.nonce).toBuffer(), - from: JsonRpcData.from(json.from).toBuffer(), - value: JsonRpcQuantity.from(json.value).toBuffer(), - gasLimit: JsonRpcQuantity.from(json.gas || json.gasLimit).toBuffer(), - gasPrice: JsonRpcQuantity.from(json.gasPrice).toBuffer(), - data: data ? JsonRpcData.from(data).toBuffer() : null, + nonce: Data.from(json.nonce).toBuffer(), + from: Data.from(json.from).toBuffer(), + value: Quantity.from(json.value).toBuffer(), + gasLimit: Quantity.from(json.gas || json.gasLimit).toBuffer(), + gasPrice: Quantity.from(json.gasPrice).toBuffer(), + data: data ? Data.from(data).toBuffer() : null, to: toAccount, - v: JsonRpcData.from(json.v).toBuffer(), - r: JsonRpcData.from(json.r).toBuffer(), - s: JsonRpcData.from(json.s).toBuffer() + v: Data.from(json.v).toBuffer(), + r: Data.from(json.r).toBuffer(), + s: Data.from(json.s).toBuffer() }; const tx = new Transaction(options, type); - tx._hash = json.hash ? JsonRpcData.from(json.hash).toBuffer() : null; + tx._hash = json.hash ? Data.from(json.hash).toBuffer() : null; return tx; } @@ -366,17 +366,17 @@ export default class Transaction extends EthereumJsTransaction { */ encode() { const resultJSON = { - hash: JsonRpcData.from(this.hash()).toString(), - nonce: JsonRpcQuantity.from(this.nonce).toString() || "0x", - from: JsonRpcData.from(this.from).toString(), - to: JsonRpcData.from(this.to).toString(), - value: JsonRpcQuantity.from(this.value).toString(), - gas: JsonRpcQuantity.from(this.gasLimit).toString(), - gasPrice: JsonRpcQuantity.from(this.gasPrice).toString(), + hash: Data.from(this.hash()).toString(), + nonce: Quantity.from(this.nonce).toString() || "0x", + from: Data.from(this.from).toString(), + to: Data.from(this.to).toString(), + value: Quantity.from(this.value).toString(), + gas: Quantity.from(this.gasLimit).toString(), + gasPrice: Quantity.from(this.gasPrice).toString(), data: this.data ? this.data.toString("hex") : null, - v: JsonRpcData.from(this.v).toString(), - r: JsonRpcData.from(this.r).toString(), - s: JsonRpcData.from(this.s).toString(), + v: Data.from(this.v).toString(), + r: Data.from(this.r).toString(), + s: Data.from(this.s).toString(), _type: this.type }; return resultJSON; @@ -435,20 +435,20 @@ export default class Transaction extends EthereumJsTransaction { } const resultJSON = { - hash: JsonRpcData.from(hash).toString(), - nonce: JsonRpcQuantity.from(this.nonce).toString(), - blockHash: JsonRpcData.from(block.hash()).toString(), - blockNumber: JsonRpcData.from(block.header.number).toString(), - transactionIndex: JsonRpcQuantity.from(BigInt(transactionIndex)).toString(), - from: JsonRpcData.from(this.from).toString(), - to: JsonRpcData.from(this.to).toString(), - value: JsonRpcQuantity.from(this.value).toString(), - gas: JsonRpcQuantity.from(this.gasLimit).toString(), - gasPrice: JsonRpcQuantity.from(this.gasPrice).toString(), - input: JsonRpcData.from(this.data).toString(), // TODO: this output format probably needs the 0x stripped. - v: JsonRpcData.from(this.v).toString(), - r: JsonRpcData.from(this.r).toString(), - s: JsonRpcData.from(this.s).toString() + hash: Data.from(hash).toString(), + nonce: Quantity.from(this.nonce).toString(), + blockHash: Data.from(block.hash()).toString(), + blockNumber: Data.from(block.header.number).toString(), + transactionIndex: Quantity.from(BigInt(transactionIndex)).toString(), + from: Data.from(this.from).toString(), + to: Data.from(this.to).toString(), + value: Quantity.from(this.value).toString(), + gas: Quantity.from(this.gasLimit).toString(), + gasPrice: Quantity.from(this.gasPrice).toString(), + input: Data.from(this.data).toString(), // TODO: this output format probably needs the 0x stripped. + v: Data.from(this.v).toString(), + r: Data.from(this.r).toString(), + s: Data.from(this.s).toString() }; return resultJSON; diff --git a/src/utils/heap.ts b/src/utils/heap.ts index 6e37011c9d..270ddacb51 100644 --- a/src/utils/heap.ts +++ b/src/utils/heap.ts @@ -53,7 +53,8 @@ class Heap { /** * Removes and returns the element with the highest priority from the heap. * The complexity is O(log n) where n = this.size(). - * @returns the element with the highest priority + * @returns the element with the highest priority. returns `undefined` if + * there are no more elements in the heap. */ public shift(): T { const length = this.length; @@ -122,14 +123,17 @@ class Heap { /** * Removes the element with the highest priority from the heap * The complexity is O(log n) where n = this.size(). + * @returns `true` when there are more elements in the queue, `false` when the + * last element was just removed. Calling `removeBest` when there are no more + * elements in the queue will return `true`. So don't do that. */ public removeBest() { const array = this.array; const length = this.length; if (length === 1) { - // finally, clear the array - this.length = array.length = 0 - return; + // finally, clear the array + this.length = array.length = 0; + return false; } const newLength = --this.length; @@ -137,6 +141,7 @@ class Heap { array[0] = array[newLength]; // then sort from the new first element to the second to last element this.down(0, newLength); + return true; } /** @@ -189,6 +194,13 @@ class Heap { array[i] = array[j]; array[j] = first; } + + public static from(item: T, less: Comparator){ + const heap = new Heap(less); + heap.array = [item]; + heap.length = 1; + return heap; + } } export default Heap; diff --git a/test/provider.ts b/test/provider.ts index 9a4ba842f9..97a2444c49 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -18,6 +18,33 @@ describe("provider", () => { assert.strictEqual(balance, "0x056bc75e2d63100000", "Heyo!"); }) it.only("sends a transaction", async () => { + const accounts = await p.send("eth_accounts"); + const to = accounts[accounts.length - 1]; + + await p.send("eth_sendTransaction", [{ + from: accounts[0], + to: to, + value: 10_000, + nonce: 0, + gasPrice: 100 + }]); + await p.send("eth_sendTransaction", [{ + from: accounts[0], + to: to, + value: 20_000, + nonce: 0, + gasPrice: 200 + }]); + await p.send("eth_sendTransaction", [{ + from: accounts[2], + to: to, + value: 30_000, + nonce: 0, + gasPrice: 300 + }]); + + }); + it("sends a transaction", async () => { const seedrandom = require("seedrandom"); const rand = seedrandom("sup"); const accounts = await p.send("eth_accounts"); From 0ee53022341f12089f1331d34b03e097f68644de Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 May 2019 21:19:15 -0400 Subject: [PATCH 047/691] make sure we can append a next nonce transaction to the `executables` heap. --- .../ethereum/components/transaction-pool.ts | 101 +++++++++++------- src/utils/heap.ts | 8 +- 2 files changed, 68 insertions(+), 41 deletions(-) diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index c8da914233..886deb1ab9 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -5,7 +5,14 @@ import Transaction from "../../../types/transaction"; import { Data, Quantity } from "../../../types/json-rpc"; export type TransactionPoolOptions = { + /** + * TODO: use this value. + */ gasPrice?: Quantity, + + /** + * Minimum gas price to enforce for acceptance into the pool + */ gasLimit?: Quantity }; @@ -16,11 +23,6 @@ function byNonce(values: Transaction[], a: number, b: number) { export default class TransactionPool extends Emittery { private options: TransactionPoolOptions; - /** - * Minimum gas price to enforce for acceptance into the pool - */ - public priceLimit: number = 0 - /** * Minimum price bump percentage to replace an already existing transaction (nonce) */ @@ -40,6 +42,7 @@ export default class TransactionPool extends Emittery { err = this.validateTransaction(transaction); if (err != null) { + // TODO: how do we surface these transaction failures to the caller?! throw err; } @@ -60,10 +63,12 @@ export default class TransactionPool extends Emittery { // new transaction away as neccessary. const pendingArray = executableOriginTransactions.array; const priceBump = this.priceBump; - const newGasPrice = Quantity.from(transaction.gasPrice).toBigInt() + const newGasPrice = Quantity.from(transaction.gasPrice).toBigInt(); // Notice: we're iterating over the raw heap array, which isn't // neccessarily sorted - for (let i = 0, l = executableOriginTransactions.length; i < l; i++) { + let highestNonce = 0n; + const length = executableOriginTransactions.length; + for (let i = 0; i < length; i++) { const currentPendingTx = pendingArray[i]; const thisNonce = Quantity.from(currentPendingTx.nonce).toBigInt(); if (thisNonce === transactionNonce) { @@ -85,18 +90,29 @@ export default class TransactionPool extends Emittery { throw new Error("That new transaction sucked, yo!"); } break; + } else if (thisNonce > highestNonce) { + highestNonce = thisNonce; } } + // if our transaction's nonce is 1 higher than the last transaction in the + // origin's heap we are executable. + if (transactionNonce === highestNonce + 1n) { + isExecutableTransaction = true; + } } + // TODO: since this is the only async code in this `insert` fn, maybe we can + // put this into the miner? The VM itself does check for everything this + // validation function checks for. const transactor = await this.blockchain.accounts.get(from); err = await this.validateTransactor(transaction, transactor); if (err != null) { + // TODO: how do we surface these transaction failures to the caller?! throw err; } if (!isExecutableTransaction) { - // If the transaction wasn't foudn in our origin's executables queue, + // If the transaction wasn't found in our origin's executables queue, // check if it is at the correct `nonce` by looking up the origin's // current nonce const transactorNextNonce = (transactor.nonce.toBigInt() || 0n) + 1n; @@ -113,38 +129,8 @@ export default class TransactionPool extends Emittery { executables.set(origin, executableOriginTransactions); } - // Now we need to drain any queued transacions that were previously - // not executable due to nonce gaps into the origin's queue... - if (queuedOriginTransactions) { - let nextExpectedNonce: bigint = transactionNonce + 1n; - while (true) { - const nextTx = queuedOriginTransactions.peek(); - const nextTxNonce = Quantity.from(nextTx.nonce).toBigInt() || 0n; - if (nextTxNonce !== nextExpectedNonce) { - break; - } else { - // we've got a an executable nonce! Put it in the executables queue. - executableOriginTransactions.push(nextTx); - // And then remove this transaction from its origin's queue - if (queuedOriginTransactions.removeBest()) { - nextExpectedNonce += 1n; - } else { - // removeBest() returns `false` when there are no more items after - // the remove item. Let's do some cleanup when that happens - origins.delete(origin); - break; - } - } - } - } - - // notify listeners (the miner, probably) that we have executables - // transactions ready for it - this.emit("drain", executables); - return; - } - - if (queuedOriginTransactions) { + this.drainQueued(origin, queuedOriginTransactions, executableOriginTransactions, transactionNonce); + } else if (queuedOriginTransactions) { queuedOriginTransactions.push(transaction); } else { queuedOriginTransactions = Heap.from(transaction, byNonce); @@ -152,6 +138,41 @@ export default class TransactionPool extends Emittery { } } + private drainQueued(origin: string, queuedOriginTransactions: Heap, executableOriginTransactions: Heap, transactionNonce: bigint) { + // Now we need to drain any queued transacions that were previously + // not executable due to nonce gaps into the origin's queue... + if (queuedOriginTransactions) { + const origins = this.origins; + + let nextExpectedNonce: bigint = transactionNonce + 1n; + while (true) { + const nextTx = queuedOriginTransactions.peek(); + const nextTxNonce = Quantity.from(nextTx.nonce).toBigInt() || 0n; + if (nextTxNonce !== nextExpectedNonce) { + break; + } + + // we've got a an executable nonce! Put it in the executables queue. + executableOriginTransactions.push(nextTx); + + // And then remove this transaction from its origin's queue + if (!queuedOriginTransactions.removeBest()) { + // removeBest() returns `false` when there are no more items after + // the remove item. Let's do some cleanup when that happens + origins.delete(origin); + break; + } + + nextExpectedNonce += 1n; + } + } + + + // notify listeners (the miner, probably) that we have executables + // transactions ready for it + this.emit("drain", this.executables); + } + private validateTransaction(transaction: Transaction): Error { // Check the transaction doesn't exceed the current block limit gas. if (this.options.gasLimit < Quantity.from(transaction.gasLimit)) { diff --git a/src/utils/heap.ts b/src/utils/heap.ts index 270ddacb51..f4b9f79bb8 100644 --- a/src/utils/heap.ts +++ b/src/utils/heap.ts @@ -158,7 +158,7 @@ class Heap { } } - private up(j: number,) { + private up(j: number) { const less = this.less.bind(null, this.array); for (let i: number; ((i = (j - 1) / 2 | 0), i !== j && less(j, i)); j = i) { this.swap(i, j); @@ -195,6 +195,12 @@ class Heap { array[j] = first; } + /** + * Heap initialization helper for when you only know of a single item for the + * heap. + * @param item + * @param less + */ public static from(item: T, less: Comparator){ const heap = new Heap(less); heap.array = [item]; From 1a31956ac7bbe0e3d0cea1b5f7a00902eb19e1ae Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 May 2019 21:59:02 -0400 Subject: [PATCH 048/691] add some tests and code coverage --- npm-shrinkwrap.json | 890 +++++++++++++++++- package.json | 15 +- src/engine.ts | 12 +- .../ethereum/components/transaction-pool.ts | 2 +- src/ledgers/ethereum/ledger.ts | 9 +- src/options/options.ts | 10 +- src/provider.ts | 51 +- src/server.ts | 25 +- src/servers/http-server.ts | 34 +- src/servers/ws-server.ts | 3 +- src/utils/request-processor.ts | 1 + test/provider.ts | 172 +++- test/server.ts | 129 ++- test/temp-tests.ts | 47 + 14 files changed, 1261 insertions(+), 139 deletions(-) create mode 100644 test/temp-tests.ts diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a75e0ee9ed..d78c90af60 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4,6 +4,152 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/generator": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", + "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4", + "jsesc": "^2.5.1", + "lodash": "^4.17.11", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + } + } + }, + "@babel/parser": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz", + "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==", + "dev": true + }, + "@babel/template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4" + } + }, + "@babel/traverse": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz", + "integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.4.4", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.11" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "@babel/types": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", + "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.11", + "to-fast-properties": "^2.0.0" + } + }, "@types/abstract-leveldown": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-5.0.1.tgz", @@ -116,6 +262,21 @@ "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", "integrity": "sha1-ZBqlXft9am8KgUHEucCqULbCTdU=" }, + "append-transform": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", + "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "dev": true, + "requires": { + "default-require-extensions": "^2.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, "arg": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", @@ -361,6 +522,18 @@ } } }, + "caching-transform": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", + "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==", + "dev": true, + "requires": { + "hasha": "^3.0.0", + "make-dir": "^2.0.0", + "package-hash": "^3.0.0", + "write-file-atomic": "^2.4.2" + } + }, "camelcase": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", @@ -499,6 +672,12 @@ "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, "complain": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/complain/-/complain-1.3.0.tgz", @@ -518,6 +697,15 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, "cookiejar": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", @@ -529,6 +717,19 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cp-file": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz", + "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "make-dir": "^2.0.0", + "nested-error-stacks": "^2.0.0", + "pify": "^4.0.1", + "safe-buffer": "^5.0.1" + } + }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -612,6 +813,15 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, + "default-require-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", + "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "dev": true, + "requires": { + "strip-bom": "^3.0.0" + } + }, "deferred-leveldown": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.0.1.tgz", @@ -756,6 +966,15 @@ "prr": "~1.0.1" } }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, "error-stack-parser": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.0.2.tgz", @@ -789,6 +1008,12 @@ "is-symbol": "^1.0.2" } }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1479,6 +1704,17 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -1502,6 +1738,44 @@ "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" }, + "foreground-child": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "dev": true, + "requires": { + "cross-spawn": "^4", + "signal-exit": "^3.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + } + } + }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", @@ -1565,12 +1839,44 @@ "path-is-absolute": "^1.0.0" } }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, + "handlebars": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "dev": true, + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1619,6 +1925,15 @@ "minimalistic-assert": "^1.0.1" } }, + "hasha": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", + "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", + "dev": true, + "requires": { + "is-stream": "^1.0.1" + } + }, "hdkey": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.1.tgz", @@ -1644,6 +1959,12 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, "htmljs-parser": { "version": "2.6.6", "resolved": "https://registry.npmjs.org/htmljs-parser/-/htmljs-parser-2.6.6.tgz", @@ -1658,6 +1979,12 @@ "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1679,6 +2006,12 @@ "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, "is-buffer": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", @@ -1749,6 +2082,105 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", + "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", + "dev": true, + "requires": { + "append-transform": "^1.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "dev": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.4.tgz", + "integrity": "sha512-QCHGyZEK0bfi9GR215QSm+NJwFKEShbtc7tfbUdLAEzn3kKhLDDZqvljn8rPZM9v8CEOhzL1nlYoO4r1ryl67w==", + "dev": true, + "requires": { + "handlebars": "^4.1.2" + } + }, "js-sha3": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", @@ -1776,6 +2208,18 @@ "integrity": "sha512-TzO/62Hxeb26QMb4IGlI/5X+QLr9Uqp1FPkwp2+KOICW+Q+vSuFj61c8pkT6wAns4WcK56X7CmSHhJeDGWOqxQ==", "dev": true }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "keccak": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.0.0.tgz", @@ -2030,6 +2474,26 @@ "resolved": "https://registry.npmjs.org/listener-tracker/-/listener-tracker-2.0.0.tgz", "integrity": "sha1-OWCLQ1wJAfpVECF8FFJyjWvBm18=" }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -2045,6 +2509,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -2089,6 +2559,16 @@ "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, "make-error": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", @@ -2187,6 +2667,23 @@ } } }, + "merge-source-map": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "merkle-patricia-tree": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", @@ -2314,9 +2811,9 @@ } }, "mocha": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.3.tgz", - "integrity": "sha512-QdE/w//EPHrqgT5PNRUjRVHy6IJAzAf1R8n2O8W8K2RZ+NbPfOD5cBDp+PGa2Gptep37C/TdBiaNwakppEzEbg==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", + "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -2328,7 +2825,7 @@ "glob": "7.1.3", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.0", + "js-yaml": "3.13.1", "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", @@ -2358,16 +2855,6 @@ "path-is-absolute": "^1.0.0" } }, - "js-yaml": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz", - "integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "supports-color": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", @@ -2395,6 +2882,18 @@ "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-1.8.2.tgz", "integrity": "sha512-Tr0DNY4RzTaBG2W2m3l7ZtFuJChTH6VZhXVhkGGjF/4cZTt+i8GcM9ozD+30Lmr4mDoZ5Xx34t2o4GJqYWDGcg==" }, + "neo-async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", + "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "dev": true + }, + "nested-error-stacks": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", + "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -2425,6 +2924,29 @@ "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", "dev": true }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "resolve": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", + "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -2440,6 +2962,61 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, + "nyc": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.0.tgz", + "integrity": "sha512-iy9fEV8Emevz3z/AanIZsoGa8F4U2p0JKevZ/F0sk+/B2r9E6Qn+EPs0bpxEhnAt6UPlTL8mQZIaSJy8sK0ZFw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "caching-transform": "^3.0.2", + "convert-source-map": "^1.6.0", + "cp-file": "^6.2.0", + "find-cache-dir": "^2.1.0", + "find-up": "^3.0.0", + "foreground-child": "^1.5.6", + "glob": "^7.1.3", + "istanbul-lib-coverage": "^2.0.5", + "istanbul-lib-hook": "^2.0.7", + "istanbul-lib-instrument": "^3.3.0", + "istanbul-lib-report": "^2.0.8", + "istanbul-lib-source-maps": "^3.0.6", + "istanbul-reports": "^2.2.4", + "js-yaml": "^3.13.1", + "make-dir": "^2.1.0", + "merge-source-map": "^1.1.0", + "resolve-from": "^4.0.0", + "rimraf": "^2.6.3", + "signal-exit": "^3.0.2", + "spawn-wrap": "^1.4.2", + "test-exclude": "^5.2.3", + "uuid": "^3.3.2", + "yargs": "^13.2.2", + "yargs-parser": "^13.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "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" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -2482,6 +3059,24 @@ "wrappy": "1" } }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, "optionator": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", @@ -2495,6 +3090,12 @@ "wordwrap": "~1.0.0" } }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, "os-locale": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", @@ -2553,6 +3154,28 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "package-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", + "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^3.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -2577,6 +3200,23 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, "pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -2589,6 +3229,21 @@ "sha.js": "^2.4.8" } }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -2689,6 +3344,27 @@ "resolved": "https://registry.npmjs.org/raptor-util/-/raptor-util-3.2.0.tgz", "integrity": "sha1-I7DIA8jxrIocrmfZpjiLSRYcl1g=" }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", @@ -2710,6 +3386,15 @@ } } }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -2736,6 +3421,31 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "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" + } + } + } + }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -2895,10 +3605,16 @@ "rusha": "^0.8.1" } }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, "source-map-support": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz", - "integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -2913,6 +3629,52 @@ } } }, + "spawn-wrap": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", + "integrity": "sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg==", + "dev": true, + "requires": { + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" + } + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "dev": true + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -2968,6 +3730,12 @@ "ansi-regex": "^2.0.0" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", @@ -3097,6 +3865,34 @@ "has-flag": "^3.0.0" } }, + "test-exclude": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "dev": true, + "requires": { + "glob": "^7.1.3", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^2.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "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" + } + } + } + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -3114,6 +3910,18 @@ "tmp": "0.0.33" } }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, "try-require": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/try-require/-/try-require-1.2.1.tgz", @@ -3213,6 +4021,33 @@ "version": "github:uNetworking/uWebSockets.js#32749187bfefb94de69f1aa5a8275647c7ccf3aa", "from": "github:uNetworking/uWebSockets.js#v15.9.0" }, + "uglify-js": { + "version": "3.5.11", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.11.tgz", + "integrity": "sha512-izPJg8RsSyqxbdnqX36ExpbH3K7tDBsAU/VfNv89VkMFy3z39zFjunQGsSHOlGlyIfGLGprGeosgQno3bo2/Kg==", + "dev": true, + "optional": true, + "requires": { + "commander": "~2.20.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true, + "optional": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, "utf-8-validate": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", @@ -3237,6 +4072,16 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "warp10": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/warp10/-/warp10-2.0.1.tgz", @@ -3309,6 +4154,17 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write-file-atomic": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.2.tgz", + "integrity": "sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, "ws": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", diff --git a/package.json b/package.json index 6dc86dc056..adf09d2561 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,16 @@ }, "scripts": { "build": "tsc", - "test": "cross-env TS_NODE_FILES=true mocha --timeout 999999 --colors --require ts-node/register --watch-extensions ts --recursive --check-leaks 'test/**.ts'" + "test": "nyc npm run mocha", + "mocha": "cross-env TS_NODE_FILES=true mocha --colors --require ts-node/register --require source-map-support/register --watch-extensions ts --recursive --check-leaks 'test/**.ts'" + }, + "nyc": { + "extension": [ + ".ts" + ], + "exclude": [ + "**/*.d.ts" + ] }, "dependencies": { "@types/abstract-leveldown": "^5.0.1", @@ -47,7 +56,9 @@ "bufferutil": "4.0.1", "cross-env": "5.2.0", "jsbi": "^2.0.5", - "mocha": "^6.1.3", + "mocha": "^6.1.4", + "nyc": "^14.1.0", + "source-map-support": "^0.5.12", "superagent": "4.1.0", "ts-node": "^8.0.3", "tslint": "5.14.0", diff --git a/src/engine.ts b/src/engine.ts index 996744dfee..f0cbdd59e0 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -1,10 +1,9 @@ import ILedger from "./interfaces/ledger"; import Emittery from "emittery"; -const _ledger = Symbol("ledger"); export default class Engine extends Emittery { - private readonly [_ledger]: ILedger; + private readonly _ledger: ILedger; /** * The Engine handles execution of methods on the given Ledger * @param ledger @@ -12,10 +11,7 @@ export default class Engine extends Emittery { constructor(ledger: ILedger) { super(); - if (!ledger) { - throw new Error("You must provide a ledger"); - } - this[_ledger] = ledger; + this._ledger = ledger; } /** @@ -27,9 +23,9 @@ export default class Engine extends Emittery { // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { - const ledger = this[_ledger]; + const ledger = this._ledger; // Only allow executing our *own* methods: - if (ledger.__proto__.hasOwnProperty(methodName)) { + if (methodName !== "constructor" && ledger.__proto__.hasOwnProperty(methodName)) { const fn = ledger[methodName]; // just double check, in case a Ledger breaks the rules and adds non-fns // to their Ledger interface. diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index 886deb1ab9..c3558f7cb2 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -67,7 +67,7 @@ export default class TransactionPool extends Emittery { // Notice: we're iterating over the raw heap array, which isn't // neccessarily sorted let highestNonce = 0n; - const length = executableOriginTransactions.length; + const length = executableOriginTransactions.length; for (let i = 0; i < length; i++) { const currentPendingTx = pendingArray[i]; const thisNonce = Quantity.from(currentPendingTx.nonce).toBigInt(); diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index a7126df30d..642f32981d 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -7,6 +7,7 @@ import Tag from "../../types/tags"; import Address, { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; +const { toChecksumAddress } = require("ethereumjs-util"); const createKeccakHash = require("keccak"); // Read in the current ganache version from the package.json @@ -20,8 +21,6 @@ const BUFFER_ZERO = Buffer.from([0]); const RPCQUANTITY_ZERO = Quantity.from("0x0"); //#endregion -const hash = createKeccakHash("keccak256"); - const _accounts = Symbol("accounts"); const _options = Symbol("options"); const _coinbase = Symbol("coinbase"); @@ -59,8 +58,8 @@ export default class Ethereum implements ILedger { for (let i = 0; i < l; i++) { const account = accounts[i]; const address = account.address; - const strAddress = address.toString().toLowerCase(); - accountsCache[i] = address; + const strAddress = address.toString(); + accountsCache[i] = toChecksumAddress(strAddress); knownAccounts.set(strAddress, account.privateKey); // if the `secure` option has been set do NOT add these accounts to the @@ -140,7 +139,7 @@ export default class Ethereum implements ILedger { * @returns The SHA3 result of the given string. */ async web3_sha3(string: string): Promise { - return Data.from(hash(string).digest()); + return Data.from(createKeccakHash("keccak256").update(string).digest()); }; /** diff --git a/src/options/options.ts b/src/options/options.ts index a28769bd5c..129ed3e4a3 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -8,9 +8,7 @@ interface Logger { // Okay, so a "bug" in TS treats types with the same shape as having the same // name, so Intellisense would say that AccountType requires `[Address, Address]` // instead of `[Address, PrivateKey]`, flip flopping like this "fixes" it. -type Address = string & {}; -type PrivateKey = {} & string; -type AccountTuple = [Address, PrivateKey]; +type Account = {balance: string, secretKey?: string}; export default interface Options { ledger?: ILedger, @@ -21,7 +19,7 @@ export default interface Options { * the given balance. If specified, the key is used to determine the account's * address. */ - accounts?: AccountTuple[], + accounts?: Account[], /** * Output VM opcodes for debugging. Defaults to `false` @@ -153,7 +151,7 @@ export default interface Options { }; export const getDefault: (options: Options)=> Options = (options) => { - const network_id = (options && options.net_version || options.network_id || Date.now()).toString(); + const network_id = (options ? options.network_id || options.net_version || Date.now() : Date.now()).toString(); return Object.assign({ debug: false, logger: {log: () => {}}, @@ -168,7 +166,7 @@ export const getDefault: (options: Options)=> Options = (options) => { gasPrice: new Quantity("0x77359400"), gasLimit: new Quantity("0x6691b7"), verbose: false, - asyncRequestProcessing: false, + asyncRequestProcessing: true, hardfork: "petersburg", secure: false }, options); diff --git a/src/provider.ts b/src/provider.ts index 5179dd5395..f62ca79dd0 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -18,7 +18,6 @@ export type ProviderOptions = ProviderOptions; const WEI = 1000000000000000000n; const options = Symbol("options"); -const engine = Symbol("engine"); const requestProcessor = Symbol("requestProcessor"); interface Callback { @@ -28,22 +27,17 @@ interface Callback { export default class Provider extends Emittery { private [options]: ProviderOptions; - private [engine]: Engine; + private _engine: Engine; private [requestProcessor]: RequestProcessor; private wallet:any; - private hdPath:string; constructor(providerOptions?: ProviderOptions) { super(); const _providerOptions = this[options] = getDefaultProviderOptions(providerOptions); // set up our request processor to either use FIFO or or async request processing - const _requestProcessor = this[requestProcessor] = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 1 : 0); + const _requestProcessor = this[requestProcessor] = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 0 : 1); - if (!_providerOptions.mnemonic) { - // TODO: this is a default and should be configured that way - _providerOptions.mnemonic = generateMnemonic(); - } this.wallet = hdkey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); const accounts = this.initializeAccounts(); @@ -52,7 +46,7 @@ export default class Provider extends Emittery { const ethereumOptions = _providerOptions as any as EthereumOptions; ethereumOptions.accounts = accounts; const ledger = _providerOptions.ledger || new Ethereum(ethereumOptions, _requestProcessor.resume.bind(_requestProcessor)); - this[engine] = new Engine(ledger); + this._engine = new Engine(ledger); } // TODO: this doesn't seem like a provider-level function. Maybe we should @@ -62,22 +56,35 @@ export default class Provider extends Emittery { const etherInWei = Quantity.from(Quantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); let accounts: Account[]; - let givenAccounts = _providerOptions.accounts - if (givenAccounts) { - const l = givenAccounts.length; - accounts = Array(l); - for (let i = 0; i < l; i++) { + let givenAccounts = _providerOptions.accounts; + let accountsLength; + if (givenAccounts && (accountsLength = givenAccounts.length) !== 0) { + const wallet = this.wallet; + const hdPath = this[options].hdPath; + accounts = Array(accountsLength); + for (let i = 0; i < accountsLength; i++) { const account = givenAccounts[i]; - accounts[i] = this.createAccount(etherInWei, Data.from(account[1]), Data.from(account[0])); + const secretKey = account.secretKey; + let secretKeyData; + let address: Address; + if (!secretKey) { + const acct = wallet.derivePath(hdPath + i); + const accountWallet = acct.getWallet(); + address = Address.from(accountWallet.getAddress()); + secretKeyData = Data.from(accountWallet.getPrivateKey()); + } else { + secretKeyData = Data.from(secretKey); + } + accounts[i] = this.createAccount(Quantity.from(account.balance), secretKeyData, address); } } else { - const l =_providerOptions.total_accounts; - if (l) { - accounts = Array(l); + const numerOfAccounts =_providerOptions.total_accounts; + if (numerOfAccounts) { + accounts = Array(numerOfAccounts); const hdPath = this[options].hdPath; const wallet = this.wallet; - for (let index = 0; index < l; index++) { + for (let index = 0; index < numerOfAccounts; index++) { const acct = wallet.derivePath(hdPath + index); const accountWallet = acct.getWallet(); const address = Address.from(accountWallet.getAddress()); @@ -108,8 +115,8 @@ export default class Provider extends Emittery { let method: string; let params: any[]; let response: Promise<{}>; - const _engine = this[engine]; - const execute = _engine.execute.bind(_engine); + const engine = this._engine; + const execute = engine.execute.bind(engine); if (typeof arg1 === "string") { method = arg1; params = arg2 as any[]; @@ -140,7 +147,7 @@ export default class Provider extends Emittery { const _options = this[options]; if (_options.verbose) { - _options.logger.log(` > ${method}: ${JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); + _options.logger.log(` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); } return response; diff --git a/src/server.ts b/src/server.ts index f9f04cb095..7e898399f3 100644 --- a/src/server.ts +++ b/src/server.ts @@ -13,13 +13,22 @@ const app = Symbol("app"); const websocketServer = Symbol("websocketServer"); const httpServer = Symbol("httpServer"); +export enum ConnectionStatus { + // Flags + open = 1, + opening = 3, + closed = 4, + closing = 12 +} + export default class Server { private [app]: TemplatedApp; - private provider: Provider; + public provider: Provider; private [options]: ServerOptions; private [httpServer]: HttpServer; private [listenSocket]: us_listen_socket; private [websocketServer]: WebsocketServer; + public status = ConnectionStatus.closed; constructor(serverOptions?: ServerOptions) { const opts = this[options] = getDefaultServerOptions(serverOptions); @@ -35,17 +44,20 @@ export default class Server { async listen(port: number, callback?: (err: Error) => void): Promise { let err; - if (this[listenSocket]) { - err = new Error("Server is already listening."); + if (this.status & ConnectionStatus.open) { + err = new Error(`Server is already listening on port: ${port}`); } else { + this.status = ConnectionStatus.opening; const _listenSocket = await new Promise((resolve) => { this[app].listen(port, resolve); }); if (_listenSocket) { + this.status = ConnectionStatus.open; this[listenSocket] = _listenSocket; err = null; } else { + this.status = ConnectionStatus.closed; err = new Error("Failed to listen on port: " + port); } } @@ -61,14 +73,19 @@ export default class Server { close() { const _listenSocket = this[listenSocket]; if (_listenSocket) { + this.status = ConnectionStatus.closing; this[listenSocket] = undefined; // close the socket to prevent any more connections uWS.us_listen_socket_close(_listenSocket); // close all the currently connection websockets: - this[websocketServer].close() + const ws = this[websocketServer] + if (ws) { + ws.close(); + } // and do all http cleanup, if any this[httpServer].close(); + this.status = ConnectionStatus.closed; } } } diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index d0ace968d8..54341f4b16 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -100,30 +100,16 @@ export default class HttpServer { // fallback routes... app - .any("/", async (response) => { - response.onAborted(() => {}); - - // TODO: send back the Ganache-UI - // any other request to "/" is not allowed, so respond with `405 Method Not Allowed`... - - const accounts = await provider.send("eth_accounts"); - - // res.setHeader("content-type", "text/html"); - // render the output to the `res` output stream - response.writeHeader("Content-Type", "text/html"); - template.render({ - accounts: accounts, - blocks: [], - transactions: [], - events: [], - logs: [] - }, response); - - // sendResponse(response, HttpResponseCodes.METHOD_NOT_ALLOWED, ContentTypes.PLAIN, "405 Method Not Allowed"); - }) - .any("/*", (response) => { - // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... - sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); + .any("/*", (response ,request) => { + const connectionHeader = request.getHeader("connection"); + if (connectionHeader && connectionHeader.toLowerCase() === "upgrade") { + // if we got here it means the websocket server wasn't enabled but + // a client tried to connect via websocket. This is a Bad Request. + sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request"); + } else { + // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... + sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); + } }); } diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index db25f0f692..f27f9a9689 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -26,7 +26,6 @@ export default class WebsocketServer { return; } const method = payload.method; - const result = await provider.send(method, payload.params); // The socket may have closed while we were waiting for the response // Don't bother trying to send to it now. @@ -39,7 +38,9 @@ export default class WebsocketServer { ws.send(JSON.stringify(json), isBinary, true); } }, + /* istanbul ignore next */ drain: (ws: WebSocket) => { + /* istanbul ignore next */ console.log("WebSocket backpressure: " + ws.getBufferedAmount()); }, close: (ws: WebSocket) => { diff --git a/src/utils/request-processor.ts b/src/utils/request-processor.ts index 93d34f18d8..3eb096d64b 100644 --- a/src/utils/request-processor.ts +++ b/src/utils/request-processor.ts @@ -57,6 +57,7 @@ export default class RequestProcessor { this.runningTasks++; current().finally(() => { this.runningTasks--; + this.process(); }); } } diff --git a/test/provider.ts b/test/provider.ts index 97a2444c49..cf8abc2663 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -10,14 +10,73 @@ describe("provider", () => { p = Ganache.provider({ network_id: networkId }); - }) + }); + + it("works without passing options", async() => { + assert.doesNotThrow(() => Ganache.provider()); + }); + + it("it logs when `options.verbose` is `true`", async() => { + const logger = { + log: (msg: string) => { + assert.strictEqual(msg, " > net_version: undefined"); + } + }; + const p = Ganache.provider({logger, verbose: true}); + + logger.log = (msg) => { + assert.strictEqual(msg, " > net_version: undefined", "doesn't work when no params"); + }; + await p.send("net_version"); + + return new Promise(async (resolve) => { + logger.log = (msg) => { + const expected = " > web3_sha3: [\n" + + " > \"Tim is a swell guy.\"\n" + + " > ]"; + assert.strictEqual(msg, expected, "doesn't work with params"); + resolve(); + }; + await p.send("web3_sha3", ["Tim is a swell guy."]); + }); + }).timeout(500); + + it("it logs with options.verbose", async() => { + assert.doesNotThrow(() => Ganache.provider()); + }); + + it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async() => { + const p = Ganache.provider(); + const accounts = await p.send("eth_accounts"); + // eth_accounts should always be faster than eth_getBalance; it should + // return before eth_getBalance because of the `asyncRequestProcessing` flag + const calA = p.send("eth_getBalance", [accounts[0]]); + const callB = p.send("eth_accounts"); + const result = await Promise.race([calA, callB]); + assert(Array.isArray(result)); + assert.strictEqual(result.length, 10); + }); + + it("it processes requests in order when `asyncRequestProcessing` is false", async() => { + const p = Ganache.provider({asyncRequestProcessing: false}); + const accounts = await p.send("eth_accounts"); + // eth_accounts should always be faster than eth_getBalance, but shouldn't + // return before eth_getBalance because of the `asyncRequestProcessing` flag + const callA = p.send("eth_getBalance", [accounts[0]]); + const callB = p.send("eth_accounts"); + const result = await Promise.race([callA, callB]); + assert.strictEqual(typeof result, "string"); + // TODO: this value is wrong: + assert.strictEqual(result, "0x056bc75e2d63100000"); + }); + it("gets balance", async() => { const accounts = await p.send("eth_accounts"); const balance = await p.send("eth_getBalance", [accounts[0]]); // TODO: this value is actually wrong! assert.strictEqual(balance, "0x056bc75e2d63100000", "Heyo!"); }) - it.only("sends a transaction", async () => { + it.skip("sends a transaction", async () => { const accounts = await p.send("eth_accounts"); const to = accounts[accounts.length - 1]; @@ -44,14 +103,11 @@ describe("provider", () => { }]); }); - it("sends a transaction", async () => { + it.skip("sends a transaction", async () => { const seedrandom = require("seedrandom"); const rand = seedrandom("sup"); const accounts = await p.send("eth_accounts"); - - - const nonces = [5, 3, 2, 1, 0]; const to = accounts[accounts.length - 1]; @@ -89,40 +145,84 @@ describe("provider", () => { const version = await p.send("net_version"); assert.strictEqual(version, networkId); }); - it("returns things via legacy", (done) => { - const ret = p.send({ - id: "1", - jsonrpc: "2.0", - method: "net_version" - } as any, (_err: Error, result: any): void => { - assert.strictEqual(result.result, networkId); - done(); + it("returns things via legacy", async() => { + await new Promise((resolve) => { + const ret = p.send({ + id: "1", + jsonrpc: "2.0", + method: "net_version" + } as any, (_err: Error, result: any): void => { + assert.strictEqual(result.result, networkId); + resolve(); + }); + assert.strictEqual(ret, undefined); + }); + return new Promise((resolve) => { + const ret = p.sendAsync({ + id: "1", + jsonrpc: "2.0", + method: "net_version" + } as any, (_err: Error, result: any): void => { + assert.strictEqual(result.result, networkId); + resolve(); + }); + assert.strictEqual(ret, undefined); }); - assert.strictEqual(ret, undefined); }); - it("returns rejects invalid rpc methods", async () => { - await assert.rejects(p.send("toString"), { - message: "Invalid or unsupported method: toString" - }); - await assert.rejects(p.send("yo_mamma!"), { - message: "Invalid or unsupported method: yo_mamma!" + it("rejects invalid rpc methods", async () => { + const illegalMethodNames = [ + "toString", "toValue", "__proto__", "prototype", "notAFunction", "", " ", + "constructor", + ]; + await Promise.all(illegalMethodNames.map((name) => { + return assert.rejects(p.send(name), { + message: `Invalid or unsupported method: ${name}` + }); + })); + + // duck punch a property that shouldn't appear on the ledger. we test this + // to make sure that 3rd party ledger imlementations can't shoot themselves + // in the foot on accident + (p as any)._engine._ledger.__proto__.illegalProperty = true; + await assert.rejects(p.send("illegalProperty"), { + message: "Invalid or unsupported method: illegalProperty" }); - const str = Buffer.from([1]) as any as string; - await assert.rejects(new Promise((resolve, reject) => { - p.send({ - id: "1", - jsonrpc: "2.0", - method: str as any - } as any, (err: Error, result: any): void => { - if(err) { - reject(err); - } else { - resolve(result); - } - }) - }), { - message: "Invalid or unsupported method: \u0001" + + // make sure we reject non-strings over the classical send interface + const circular = {} as any; + circular.circular = circular; + const illegalMethodTypes = [ + 123, Buffer.from([1]) as any as string, null, undefined, {}, [], + {foo: "bar"}, [1,2], new Date(), Infinity, NaN, circular + ]; + await Promise.all(illegalMethodTypes.map((methodType) => { + return assert.rejects( + new Promise((resolve, reject) => { + p.send({ + id: "1", + jsonrpc: "2.0", + method: methodType as any + } as any, (err: Error, result: any): void => { + if(err) { + reject(err); + } else { + resolve(result); + } + }) + }), + { + message: `Invalid or unsupported method: ${methodType}` + }); + })); + + // make sure we reject non-strings over the EIP-1193 send interface + illegalMethodTypes.map((methodType) => { + assert.throws(() => p.send(methodType as string), { + message: "No callback provided to provider's send function. As of " + + "web3 1.0, provider.send is no longer synchronous and must be " + + "passed a callback as its final argument." + }); }); }); }); diff --git a/test/server.ts b/test/server.ts index 654ee41d6b..02ad11094a 100644 --- a/test/server.ts +++ b/test/server.ts @@ -4,10 +4,11 @@ import request from "superagent"; import WebSocket from "ws"; import Server from "../src/server"; import { ServerOptions } from "../src/server"; +import http from "http"; describe("server", () => { - const port = 8547; + const port = 5234; const netVersion = "1234"; const jsonRpcJson: any = { jsonrpc: "2.0", @@ -16,23 +17,108 @@ describe("server", () => { params: [] }; let s: Server; - beforeEach("setup", async ()=>{ + async function setup() { s = Ganache.server({ network_id: netVersion } as ServerOptions); - await s.listen(port); - }) + return s.listen(port); + }; + async function teardown(){ + s && s.close(); + s = undefined; + } describe("http", () => { it("returns the net_version", async () => { - const response = await request - .post('http://localhost:' + port) - .send(jsonRpcJson); - const json = JSON.parse(response.text) - assert.strictEqual(json.result, netVersion); + await setup(); + try { + const response = await request + .post('http://localhost:' + port) + .send(jsonRpcJson); + const json = JSON.parse(response.text); + assert.strictEqual(json.result, netVersion); + } finally { + teardown(); + } + }); + + it("returns the net_version over a legacy connection", (done) => { + const s = Ganache.server({ + network_id: netVersion + } as ServerOptions); + s.listen(port, async () => { + try { + const response = await request + .post('http://localhost:' + port) + .send(jsonRpcJson); + const json = JSON.parse(response.text); + assert.strictEqual(json.result, netVersion); + } finally { + s.close(); + } + done(); + }); + }); + + it("fails to `.listen()` twice", async () => { + await setup(); + try { + await assert.rejects(s.listen(port), { + message: `Server is already listening on port: ${port}` + }); + } finally { + teardown(); + } + }); + + it("fails to listen if the socket is already in use by 3rd party", async () => { + const server = http.createServer(); + server.listen(port); + + try { + await assert.rejects(setup, { + message: `Failed to listen on port: ${port}` + }); + } finally { + teardown(); + server.close(); + } + }); + + // TODO: active this test once uWebsockets is updated to include seese's fix + it.skip("fails to listen if the socket is already in use by Ganache", async () => { + const s2 = Ganache.server({ + network_id: netVersion + } as ServerOptions); + + await assert.rejects(s2.listen(port), { + message: `Failed to listen on port: ${port}` + }); + }); + + it("does not start a websocket server when `ws` is false", async () => { + s = Ganache.server({ + network_id: netVersion, + ws: false + } as ServerOptions); + await s.listen(port); + try { + const ws = new WebSocket('ws://localhost:' + port); + + await assert.rejects(new Promise((_, reject) => { + ws.on("error", reject); + }), { + message: "Unexpected server response: 400" + }); + } finally { + teardown(); + } }); }); describe("websocket", () => { + beforeEach("setup", setup); + afterEach("teardown", teardown); + it("returns the net_version over a websocket", async () => { const ws = new WebSocket('ws://localhost:' + port); @@ -85,10 +171,27 @@ describe("server", () => { }); assert.strictEqual(result, 1002, "Did not receive expected close code 1002"); }); - }); - afterEach("teardown", ()=>{ - s && s.close(); - s = undefined; + it("doesn't crash when the connection is closed while a request is in flight", async () => { + const ws = new WebSocket('ws://localhost:' + port); + await new Promise((resolve) => { + ws.on("open", () => { + ws.send(JSON.stringify(jsonRpcJson)); + ws.on("message", () => { + assert.fail("Got a message when we should have!"); + }); + ws.on("close", resolve); + }); + + s.provider.send = async function() { + // close our websocket when after intercepting the request + s.close(); + return new Promise(resolve => { + // then resolve on the next-ish event loop + setImmediate(resolve); + }); + }; + }); + }); }); }); diff --git a/test/temp-tests.ts b/test/temp-tests.ts new file mode 100644 index 0000000000..20ff0433ac --- /dev/null +++ b/test/temp-tests.ts @@ -0,0 +1,47 @@ +import Ganache from "../index" +import assert from "assert"; + +/** + * test in here are playground tests or just tests that are in the original + * ganache-core but have yet been properly ported over yet. + */ + +describe("Accounts", () => { + const expectedAddress = "0x604a95C9165Bc95aE016a5299dd7d400dDDBEa9A"; + const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; + + it("should respect the BIP99 mnemonic", async() => { + const options = { mnemonic }; + const p = Ganache.provider(options); + const accounts = await p.send("eth_accounts"); + + assert.strictEqual(accounts[0], expectedAddress); + }); + + it("should create it's own mnemonic", async() => { + const p = Ganache.provider(); + const options = (p as any)[Object.getOwnPropertySymbols(p)[0] as any]; + assert.deepStrictEqual(typeof options.mnemonic, "string"); + }); + + it("shouldn't allow initialization without accounts", async() => { + const options = {total_accounts: 0} as any; + assert.throws(()=>{ Ganache.provider(options); }, { + message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" + }); + + options.accounts = [] as any; + assert.throws(()=>{ Ganache.provider(options); }, { + message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" + }); + }); + + it("sets up accounts", async () => { + const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); + const p = Ganache.provider({ + accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] + }); + const accounts = await p.send("eth_accounts"); + assert.strictEqual(accounts.length, 2); + }); +}); \ No newline at end of file From f4872f657e6f6b519b330faacb1cc8e2e8f07f0f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 May 2019 21:59:08 -0400 Subject: [PATCH 049/691] remove --- src/servers/ws-server.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index f27f9a9689..36cc60046d 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -38,7 +38,6 @@ export default class WebsocketServer { ws.send(JSON.stringify(json), isBinary, true); } }, - /* istanbul ignore next */ drain: (ws: WebSocket) => { /* istanbul ignore next */ console.log("WebSocket backpressure: " + ws.getBufferedAmount()); From 33b284e6a245cbca2b82fa8b593935974349a1cf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 13 May 2019 20:50:38 -0400 Subject: [PATCH 050/691] test chunked data --- npm-shrinkwrap.json | 20 +++++ package.json | 3 +- src/server.ts | 2 +- src/servers/http-server.ts | 79 +++++++++-------- src/servers/ws-server.ts | 5 +- test/server.ts | 169 ++++++++++++++++++++++++++++--------- 6 files changed, 191 insertions(+), 87 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d78c90af60..e60c7fd86d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1793,6 +1793,16 @@ "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", "dev": true }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2000,6 +2010,16 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "into-stream": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.0.tgz", + "integrity": "sha512-cbDhb8qlxKMxPBk/QxTtYg1DQ4CwXmadu7quG3B7nrJsgSncEreF2kwWKZFdnjc/lSNNIkFPsjI7SM0Cx/QXPw==", + "dev": true, + "requires": { + "from2": "^2.3.0", + "p-is-promise": "^2.0.0" + } + }, "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", diff --git a/package.json b/package.json index adf09d2561..f2485aaba4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "scripts": { "build": "tsc", - "test": "nyc npm run mocha", + "test": "nyc npm run mocha -- --throw-deprecation", "mocha": "cross-env TS_NODE_FILES=true mocha --colors --require ts-node/register --require source-map-support/register --watch-extensions ts --recursive --check-leaks 'test/**.ts'" }, "nyc": { @@ -55,6 +55,7 @@ "@types/ws": "6.0.1", "bufferutil": "4.0.1", "cross-env": "5.2.0", + "into-stream": "^5.1.0", "jsbi": "^2.0.5", "mocha": "^6.1.4", "nyc": "^14.1.0", diff --git a/src/server.ts b/src/server.ts index 7e898399f3..1900858514 100644 --- a/src/server.ts +++ b/src/server.ts @@ -37,7 +37,7 @@ export default class Server { const _app = this[app] = uWS.App(null); if (this[options].ws) { - this[websocketServer] = new WebsocketServer(_app, prov); + this[websocketServer] = new WebsocketServer(_app, prov, opts); } this[httpServer] = new HttpServer(_app, prov); } diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 54341f4b16..3f5c253fd3 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -5,7 +5,6 @@ import JsonRpc from "./utils/jsonrpc" import HttpResponseCodes from "./utils/http-response-codes"; const _handlePost = Symbol("handlePost"); -const _handleData = Symbol("handleData"); const _handleOptions = Symbol("handleOptions"); const _provider = Symbol("provider"); const noop = () => { }; @@ -82,7 +81,6 @@ function sendResponse(response: HttpResponse, statusCode: number, contentType?: response.end(data) } -const template = require("./views/index"); export default class HttpServer { private [_provider]: Provider; constructor(app: TemplatedApp, provider: Provider) { @@ -117,51 +115,50 @@ export default class HttpServer { // handle JSONRPC post requests... const writeHeaders = prepareCORSResponseHeaders("POST", request); + // TODO: pre-allocate the buffer when we know the Content-Length let buffer: Buffer; - response.onData(this[_handleData].bind(this, buffer, response, writeHeaders)); response.onAborted(() => { response.aborted = true; }); - } - - private [_handleData](buffer: Buffer, response: HttpResponse, writeHeaders: (response: HttpResponse) => void, message: ArrayBuffer, isLast: boolean) { - const chunk = Buffer.from(message); - if (isLast) { - let payload: JsonRpc.Request; - try { - const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; - payload = JsonRpc.Request(JSON.parse(message)); - } catch (e) { - sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); - return; - } - - const id = payload.id; - const method = payload.method; - switch (method) { - // http connections do not support subscriptions - case "eth_subscribe": - case "eth_unsubscribe": - const error = JsonRpc.Error(id, "-32000", "notifications not supported") - sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.JSON, JSON.stringify(error), writeHeaders); - break; - default: - // `await`ing the `provider.send` instead of using `then` causes uWS - // to delay cleaning up the `request` object, which we don't neccessarily want to delay. - this[_provider].send(method, payload.params).then((result) => { - if (response.aborted) return; - const json = JsonRpc.Response(id, result); - sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, JSON.stringify(json), writeHeaders); - }); - break; - } - } else { - if (buffer) { - buffer = Buffer.concat([buffer, chunk]); + response.onData((message: ArrayBuffer, isLast: boolean) => { + const chunk = Buffer.from(message); + if (isLast) { + let payload: JsonRpc.Request; + try { + const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; + payload = JsonRpc.Request(JSON.parse(message)); + } catch (e) { + sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); + return; + } + + const id = payload.id; + const method = payload.method; + switch (method) { + // http connections do not support subscriptions + case "eth_subscribe": + case "eth_unsubscribe": + const error = JsonRpc.Error(id, "-32000", "notifications not supported") + sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.JSON, JSON.stringify(error), writeHeaders); + break; + default: + // `await`ing the `provider.send` instead of using `then` causes uWS + // to delay cleaning up the `request` object, which we don't neccessarily want to delay. + this[_provider].send(method, payload.params).then((result) => { + if (response.aborted) return; + const json = JsonRpc.Response(id, result); + sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, JSON.stringify(json), writeHeaders); + }); + break; + } } else { - buffer = Buffer.concat([chunk]); + if (buffer) { + buffer = Buffer.concat([buffer, chunk]); + } else { + buffer = Buffer.concat([chunk]); + } } - } + }); } private [_handleOptions](response: HttpResponse, request: HttpRequest) { diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index 36cc60046d..cca83ded97 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -6,7 +6,7 @@ const _connections = Symbol("connections"); export default class WebsocketServer { private [_connections] = new Set(); - constructor(app: TemplatedApp, provider: Provider) { + constructor(app: TemplatedApp, provider: Provider, options: any) { app.ws("/", { /* WS Options */ compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression @@ -39,8 +39,7 @@ export default class WebsocketServer { } }, drain: (ws: WebSocket) => { - /* istanbul ignore next */ - console.log("WebSocket backpressure: " + ws.getBufferedAmount()); + options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); }, close: (ws: WebSocket) => { this[_connections].delete(ws); diff --git a/test/server.ts b/test/server.ts index 02ad11094a..e0860efa23 100644 --- a/test/server.ts +++ b/test/server.ts @@ -5,22 +5,26 @@ import WebSocket from "ws"; import Server from "../src/server"; import { ServerOptions } from "../src/server"; import http from "http"; - +import intoStream from "into-stream"; describe("server", () => { const port = 5234; - const netVersion = "1234"; + const network_id = "1234"; const jsonRpcJson: any = { jsonrpc: "2.0", id: "1", method: "net_version", params: [] }; + const logger = { + log: (_message: string) => {} + } let s: Server; - async function setup() { - s = Ganache.server({ - network_id: netVersion - } as ServerOptions); + async function setup(options: ServerOptions = { + network_id, + logger + } as ServerOptions) { + s = Ganache.server(options); return s.listen(port); }; async function teardown(){ @@ -35,15 +39,15 @@ describe("server", () => { .post('http://localhost:' + port) .send(jsonRpcJson); const json = JSON.parse(response.text); - assert.strictEqual(json.result, netVersion); + assert.strictEqual(json.result, network_id); } finally { teardown(); } }); - it("returns the net_version over a legacy connection", (done) => { - const s = Ganache.server({ - network_id: netVersion + it("returns the net_version over a legacy-style connection listener", (done) => { + s = Ganache.server({ + network_id } as ServerOptions); s.listen(port, async () => { try { @@ -51,9 +55,9 @@ describe("server", () => { .post('http://localhost:' + port) .send(jsonRpcJson); const json = JSON.parse(response.text); - assert.strictEqual(json.result, netVersion); + assert.strictEqual(json.result, network_id); } finally { - s.close(); + teardown(); } done(); }); @@ -62,6 +66,8 @@ describe("server", () => { it("fails to `.listen()` twice", async () => { await setup(); try { + // the call to `setup()` above calls `listen()` already. if we call it + // again it should fail. await assert.rejects(s.listen(port), { message: `Server is already listening on port: ${port}` }); @@ -84,35 +90,68 @@ describe("server", () => { } }); - // TODO: active this test once uWebsockets is updated to include seese's fix + // TODO: un-skip this test once uWebsockets is updated to include seese's fix it.skip("fails to listen if the socket is already in use by Ganache", async () => { - const s2 = Ganache.server({ - network_id: netVersion - } as ServerOptions); + await setup(); + const s2 = Ganache.server(); - await assert.rejects(s2.listen(port), { - message: `Failed to listen on port: ${port}` - }); + try { + await assert.rejects(s2.listen(port), { + message: `Failed to listen on port: ${port}` + }); + } finally { + teardown(); + } }); it("does not start a websocket server when `ws` is false", async () => { - s = Ganache.server({ - network_id: netVersion, + await setup({ ws: false } as ServerOptions); - await s.listen(port); try { const ws = new WebSocket('ws://localhost:' + port); - await assert.rejects(new Promise((_, reject) => { - ws.on("error", reject); - }), { + await assert.rejects(new Promise((_, reject) => ws.on("error", reject)), { message: "Unexpected server response: 400" }); } finally { teardown(); } }); + + it("handles chunked requests (note: doesn't test `transfer-encoding: chunked`)", async () => { + await setup(); + try { + const req = request.post('http://localhost:' + port); + const json =JSON.stringify(jsonRpcJson); + + // we have to set the content-length because we can't use + // `Transfer-Encoding: chunked` with uWebSockets.js as of v15.9.0 + req.set('Content-Length', json.length.toString()); + + await new Promise((resolve, reject) => { + req.on("response", response => { + const json = JSON.parse(response.text); + assert.strictEqual(json.result, network_id); + resolve(); + }); + req.on("error", function(){ + console.log(...arguments); + reject(); + }); + req.on("progress", function(){ + console.log(...arguments); + }); + + const readableStream = intoStream(json); + // make sure the data is sent as tiny pieces. + (readableStream as any)._readableState.highWaterMark = 8; + readableStream.pipe(req as any); + }); + } finally { + teardown(); + } + }); }); describe("websocket", () => { @@ -129,7 +168,7 @@ describe("server", () => { ws.on('message', resolve); }); const json = JSON.parse(response); - assert.strictEqual(json.result, netVersion); + assert.strictEqual(json.result, network_id); }); it("returns the net_version over a websocket as binary", async () => { @@ -143,7 +182,7 @@ describe("server", () => { }); assert.strictEqual(response.constructor, Buffer, "response doesn't seem to be a Buffer as expect"); const json = JSON.parse(response); - assert.strictEqual(json.result, netVersion, "Binary data result is not as expected"); + assert.strictEqual(json.result, network_id, "Binary data result is not as expected"); }); it("doesn't crash when sending bad data over http", async () => { @@ -158,7 +197,7 @@ describe("server", () => { .post('http://localhost:' + port) .send(jsonRpcJson); const json = JSON.parse(response.text) - assert.strictEqual(json.result, netVersion); + assert.strictEqual(json.result, network_id); }); it("doesn't crash when sending bad data over websocket", async () => { @@ -173,25 +212,73 @@ describe("server", () => { }); it("doesn't crash when the connection is closed while a request is in flight", async () => { + s.provider.send = async function() { + // close our websocket after intercepting the request + s.close(); + }; + const ws = new WebSocket('ws://localhost:' + port); - await new Promise((resolve) => { + return new Promise((resolve, reject) => { ws.on("open", () => { + // If we get a message that means things didn't get closed as they + // should have OR they are closing too late for some reason and + // this test isn't testing anything. + ws.on("message", () => reject("Got a message when we should have!")); + + // make sure we leave enough time for things to crash if it does end + // up crashing. + ws.on("close", () => setImmediate(resolve)); + + // The RPC request method doesn't matter since we're duck punching our + // provider.send method anyway. ws.send(JSON.stringify(jsonRpcJson)); - ws.on("message", () => { - assert.fail("Got a message when we should have!"); - }); - ws.on("close", resolve); }); + }); + }); + + it("can handle backpressure", async () => { + { // create tons of data to force websocket backpressure + const huge = {} as any; + for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; + s.provider.send = async () => huge; + } + + const ws = new WebSocket('ws://localhost:' + port); + const oldLog = logger.log; + try { + let gotBackpressure = false; + // duck punch `logger.log` so we can intercept logs + logger.log = (message: string) => { + if (message.indexOf("WebSocket backpressure: ") === 0) { + gotBackpressure = true; + } + } + return await new Promise((resolve, reject) => { + ws.on("open", () => { + ws.on("message", (_message) => { + if (gotBackpressure) { + resolve(); + } else { + reject( + new Error( + "Possible false positive: Didn't detect backpressure " + + " before receiving a message. Ensure `s.provider.send` is" + + " sending enough data." + ) + ); + } + }); - s.provider.send = async function() { - // close our websocket when after intercepting the request - s.close(); - return new Promise(resolve => { - // then resolve on the next-ish event loop - setImmediate(resolve); + // The RPC request method doesn't matter since we're duck punching + // our provider.send method anyway. + ws.send(JSON.stringify(jsonRpcJson)); }); - }; - }); + }); + } finally { + // put the original logger back so other tests that might rely on it + // don't break. + logger.log = oldLog; + } }); }); }); From 8357e042ed080de9a8c3e044109a7190619a63ef Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 20:47:20 -0400 Subject: [PATCH 051/691] test provider `seed` --- test/provider.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/provider.ts b/test/provider.ts index cf8abc2663..6dc33e3938 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -70,6 +70,12 @@ describe("provider", () => { assert.strictEqual(result, "0x056bc75e2d63100000"); }); + it("generates predictable accounts when given a seed", async() => { + const p = Ganache.provider({seed: "temet nosce"}); + const accounts = await p.send("eth_accounts"); + assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); + }); + it("gets balance", async() => { const accounts = await p.send("eth_accounts"); const balance = await p.send("eth_getBalance", [accounts[0]]); @@ -112,7 +118,6 @@ describe("provider", () => { const to = accounts[accounts.length - 1]; - const id = setImmediate(()=>{console.log(1)}); p.send("eth_sendTransaction", [{ from: accounts[0], to: to, @@ -120,7 +125,6 @@ describe("provider", () => { nonce: nonces[2], gasPrice: (rand() * 100) | 0 }]); - clearImmediate(id); // for every account (except the last one) for (let j = 0; j < accounts.length - 6; j++) { From 244ff30de47151a11db9050f1e6ce31b25bf1ef1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 20:48:02 -0400 Subject: [PATCH 052/691] fix some server responses --- src/servers/http-server.ts | 42 +++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 3f5c253fd3..7a6a78959e 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -9,10 +9,6 @@ const _handleOptions = Symbol("handleOptions"); const _provider = Symbol("provider"); const noop = () => { }; -if (!process.env.NODE_ENV) { - require("marko/node-require"); -} - /** * uWS doesn't let us use the request after the request method has completed. * But we can't set headers until after the statusCode is set. But we don't @@ -27,7 +23,7 @@ function prepareCORSResponseHeaders(method: string, request: HttpRequest) { const origin = request.getHeader("origin"); const acrh = request.getHeader("access-control-request-headers"); return (response: HttpResponse) => { - const isCORSRequest = true || origin !== ""; + const isCORSRequest = origin !== ""; if (isCORSRequest) { // OPTIONS preflight requests need a little extra treatment if (method === "OPTIONS") { @@ -37,9 +33,6 @@ function prepareCORSResponseHeaders(method: string, request: HttpRequest) { if (acrh !== "") { response.writeHeader("Access-Control-Allow-Headers", acrh); } - // Safari needs Content-Length = 0 for a 204 response otherwise it hangs forever - // https://github.com/expressjs/cors/pull/121#issue-130260174 - response.writeHeader("Content-Length", "0"); // Make browsers and compliant clients cache the OPTIONS preflight response for 10 // minutes (this is the maximum time Chromium allows) @@ -97,18 +90,17 @@ export default class HttpServer { }); // fallback routes... - app - .any("/*", (response ,request) => { - const connectionHeader = request.getHeader("connection"); - if (connectionHeader && connectionHeader.toLowerCase() === "upgrade") { - // if we got here it means the websocket server wasn't enabled but - // a client tried to connect via websocket. This is a Bad Request. - sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request"); - } else { - // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... - sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); - } - }); + app.any("/*", (response ,request) => { + const connectionHeader = request.getHeader("connection"); + if (connectionHeader && connectionHeader.toLowerCase() === "upgrade") { + // if we got here it means the websocket server wasn't enabled but + // a client tried to connect via websocket. This is a Bad Request. + sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request"); + } else { + // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... + sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); + } + }); } private [_handlePost](response: HttpResponse, request: HttpRequest) { @@ -138,14 +130,18 @@ export default class HttpServer { // http connections do not support subscriptions case "eth_subscribe": case "eth_unsubscribe": - const error = JsonRpc.Error(id, "-32000", "notifications not supported") + const error = JsonRpc.Error(id, "-32000", "notifications not supported"); sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.JSON, JSON.stringify(error), writeHeaders); break; default: // `await`ing the `provider.send` instead of using `then` causes uWS // to delay cleaning up the `request` object, which we don't neccessarily want to delay. this[_provider].send(method, payload.params).then((result) => { - if (response.aborted) return; + if (response.aborted) { + // if the request has been aborted don't try sending (it'll + // cause an `Unhandled promise rejection` if we try) + return; + } const json = JsonRpc.Response(id, result); sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, JSON.stringify(json), writeHeaders); }); @@ -165,7 +161,7 @@ export default class HttpServer { // handle CORS preflight requests... const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); // OPTIONS responses don't have a body, so respond with `204 No Content`... - sendResponse(response, HttpResponseCodes.NO_CONTENT, null, null, writeHeaders); + sendResponse(response, HttpResponseCodes.NO_CONTENT, null, "", writeHeaders); } public close() { // currently a no op. From 13c6287855bdda7f5a8b0bbd22582a446f2b2111 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:02:13 -0400 Subject: [PATCH 053/691] convert to strict TS and optimize soem default options --- src/options/provider-options.ts | 56 ++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 32f28ecbb5..dbcf42355b 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -1,30 +1,28 @@ import Options, {getDefault as getDefaultOptions} from "./options"; const bip39 = require("bip39"); -const seedrandom = require("seedrandom"); +import seedrandom, { seedrandom_prng } from "seedrandom"; - -function randomBytes(length: any, rng: any): any { - var buf = Array(length); - - for (var i = 0; i < length; i++) { - buf[i] = rng() * 255; +function randomBytes(length: number, rng: () => number) { + const buf = Buffer.allocUnsafe(length); + for (let i = 0; i < length; i++) { + buf[i] = rng() * 255 | 0; } - - return Buffer.from(buf); + return buf; } -function randomAlphaNumericString (length:any, rng:any) { +const randomAlphaNumericString = (() => { const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + const alphabetLength = alphabet.length; + return (length: number, rng: () => number) => { + let text = ""; + for (let i = 0; i < length; i++) { + text += alphabet[rng() * alphabetLength | 0]; + } - let text = ""; - - for (var i = 0; i < length; i++) { - text += alphabet.charAt(Math.floor((rng || Math.random)() * alphabet.length)); - } - - return text; -} + return text; + }; +})(); export default interface ProviderOptions extends Options { /** @@ -41,16 +39,22 @@ export const getDefault : (options: ProviderOptions) => ProviderOptions = (optio getDefaultOptions(options) ); + if (!_options.mnemonic) { + let rng: seedrandom_prng; + let seed = _options.seed; + if (!seed) { // do this so that we can use the same seed on our next run and get the same - // results without explicitly setting a seed up front - if (!_options.seed) { - _options.seed = randomAlphaNumericString(10, seedrandom()); + // results without explicitly setting a seed up front. + // Use the alea PRNG for it's extra speed. + rng = seedrandom.alea as seedrandom_prng; + seed = _options.seed = randomAlphaNumericString(10, rng()); + } else { + // Use the default seedrandom PRNG for ganache-core <= 2 back-compatibility + rng = seedrandom; } - // generate a randomized default mnemonic - if (!_options.mnemonic) { - let _randomBytes = randomBytes(16, seedrandom(_options.seed)); - _options.mnemonic = bip39.entropyToMnemonic(_randomBytes.toString("hex")); - } + const _randomBytes = randomBytes(16, rng(seed)); + _options.mnemonic = bip39.entropyToMnemonic(_randomBytes); + } return _options; } From e457301ce30807c4a7abbdb1215ed1f99271e154 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:03:28 -0400 Subject: [PATCH 054/691] implement better server close logic --- src/server.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/server.ts b/src/server.ts index 1900858514..06c41df853 100644 --- a/src/server.ts +++ b/src/server.ts @@ -72,20 +72,20 @@ export default class Server { close() { const _listenSocket = this[listenSocket]; + this.status = ConnectionStatus.closing; if (_listenSocket) { - this.status = ConnectionStatus.closing; this[listenSocket] = undefined; // close the socket to prevent any more connections uWS.us_listen_socket_close(_listenSocket); - - // close all the currently connection websockets: - const ws = this[websocketServer] - if (ws) { - ws.close(); - } - // and do all http cleanup, if any - this[httpServer].close(); - this.status = ConnectionStatus.closed; } + // close all the currently connection websockets: + const ws = this[websocketServer] + if (ws) { + ws.close(); + } + // and do all http cleanup, if any + this[httpServer].close(); + this.status = ConnectionStatus.closed; } } + From 64ab9eaa5a71d2179e6d733d47673945ba4d30d7 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:05:01 -0400 Subject: [PATCH 055/691] add better datbase close logic --- src/ledgers/ethereum/database.ts | 146 +++++++++++++++++++------------ 1 file changed, 89 insertions(+), 57 deletions(-) diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index 695f41e090..a6b4343b4a 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -8,68 +8,100 @@ const encode = require("encoding-down"); type DatabaseOptions = {db?: string | object, dbPath?: string}; + +const tmpOptions = {prefix: "ganache-core_", unsafeCleanup: true}; +const noop = (): void => {}; + export default class Database extends Emittery{ - public readonly blockchain: Blockchain; - private readonly options: DatabaseOptions; - public directory: string = null; - public db: levelup.LevelUp = null; - public blocks: levelup.LevelUp; - public blockLogs: levelup.LevelUp; - public blockHashes: levelup.LevelUp; - public transactions: levelup.LevelUp; - public transactionReceipts: levelup.LevelUp; - public trie: levelup.LevelUp; - public readonly initialized: boolean; - /** - * The Database handles the creation of the database, and all access to it. - * Once the database has been fully initialized it will emit a `ready` - * event. - * Emit's a `close` event once complete. - * @param options Supports one of two options: `db` (a leveldown compliant - * store instance) or `dbPath` (the path to store/read the db instance) - * @param blockchain - */ - constructor(options: DatabaseOptions, blockchain: Blockchain) { - super(); + public readonly blockchain: Blockchain; + private readonly options: DatabaseOptions; + private _cleanup = noop; + private closed = false; + public directory: string = null; + public db: levelup.LevelUp = null; + public blocks: levelup.LevelUp; + public blockLogs: levelup.LevelUp; + public blockHashes: levelup.LevelUp; + public transactions: levelup.LevelUp; + public transactionReceipts: levelup.LevelUp; + public trie: levelup.LevelUp; + public readonly initialized: boolean; + /** + * The Database handles the creation of the database, and all access to it. + * Once the database has been fully initialized it will emit a `ready` + * event. + * Emit's a `close` event once complete. + * @param options Supports one of two options: `db` (a leveldown compliant + * store instance) or `dbPath` (the path to store/read the db instance) + * @param blockchain + */ + constructor(options: DatabaseOptions, blockchain: Blockchain) { + super(); - this.options = options; - this.blockchain = blockchain; - this._initialize(); + this.options = options; + this.blockchain = blockchain; + this._initialize(); + } + private async _initialize() { + const levelupOptions: any = { valueEncoding: "binary" }; + const store = this.options.db; + let db; + if (store) { + db = await levelup(store as any, levelupOptions); + } else { + let directory = this.options.dbPath; + if (!directory) { + const dirInfo = await dir(tmpOptions); + directory = dirInfo.path; + this._cleanup = dirInfo.cleanup; + + // don't continue if we closed while we were waiting for the dir + if (this.closed) return this.cleanup(); + } + this.directory = directory; + const store = encode(leveldown(directory), levelupOptions); + db = await levelup(store, {}); } - private async _initialize(){ - const levelupOptions: any = { valueEncoding: "binary" }; - const store = this.options.db; - let db; - if (store) { - db = await levelup(store as any, levelupOptions); - } else { - let directory = this.options.dbPath; - if (!directory) { - directory = (await dir()).path; - } - this.directory = directory; - const store = encode(leveldown(directory), levelupOptions); - db = await levelup(store, {}); - } - const open = db.open(); - this.trie = sub(db, "trie", levelupOptions); + // don't continue if we closed while we were waiting for the db + if (this.closed) return this.cleanup(); + + const open = db.open(); + this.trie = sub(db, "trie", levelupOptions); + + this.db = db; + await open; + + // don't continue if we closed while we were waiting for it to open + if (this.closed) return this.cleanup(); + + this.blocks = sub(db, "blocks", levelupOptions); + this.transactions = sub(db, "transactions", levelupOptions); + + this.emit("ready"); + return; + } + /** + * Gracefully close the database and wait for it to fully shut down. + * Emit's a `close` event once complete. + */ + public async close() { + const wasClosed = this.closed; + this.closed = true; + await this.cleanup(); - this.db = db; - await open; - this.blocks = sub(db, "blocks", levelupOptions); - this.transactions = sub(db, "transactions", levelupOptions); - return this.emit("ready"); + // only emit `close` once + if (!wasClosed) { + this.emit("close"); + return; } - /** - * Gracefully close the database and wait for it to fully shut down. - * Emit's a `close` event once complete. - */ - public async close() { - const db = this.db; - if (db && db.isOpen()) { - await db.close(); - } - return this.emit("close"); + } + private async cleanup(){ + const db = this.db; + if (db && db.isOpen()) { + // await new Promise(resolve => setTimeout(resolve, 1000)); + // await db.close(); } + this._cleanup(); + } } From 8283d50eb76337f5b2642bd8db8625d9b9dc5a94 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:05:18 -0400 Subject: [PATCH 056/691] add shutdown method to blockchain --- src/ledgers/ethereum/blockchain.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 7fd7614a25..3ed55cc0da 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -164,4 +164,8 @@ export default class Blockchain extends Emittery { await this.transactions.push(transaction); return Data.from(transaction.hash()); } + + public async shutdown() { + return this.database.close(); + } } From 14e387dd4383a7f032e12edc23b7944f3a389561 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:05:33 -0400 Subject: [PATCH 057/691] remove unsed arg in manager --- src/ledgers/ethereum/components/manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ledgers/ethereum/components/manager.ts b/src/ledgers/ethereum/components/manager.ts index db46e09318..104c4a7978 100644 --- a/src/ledgers/ethereum/components/manager.ts +++ b/src/ledgers/ethereum/components/manager.ts @@ -20,6 +20,6 @@ export default class Manager { return this.base.get(key).then((raw) => new this.Type(raw)); } set(key: Buffer, value: Buffer): Promise { - return this.base.put(key, value).then((raw) => new this.Type(value)); + return this.base.put(key, value).then(() => new this.Type(value)); } } \ No newline at end of file From 5ca735573d7ca991b5f857249ca9a0925672d6b2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:05:58 -0400 Subject: [PATCH 058/691] pass an event emitter to the ledger instead of a callback --- src/ledgers/ethereum/ledger.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 642f32981d..71014eb755 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,5 +1,5 @@ //#region Imports -import ILedger from "../../interfaces/ledger"; +import ILedger, {Emitter} from "../../interfaces/ledger"; import EthereumOptions, { getDefaultOptions } from "./options"; import { Data, Quantity, IndexableData } from "../../types/json-rpc"; import Blockchain from "./blockchain"; @@ -45,7 +45,7 @@ export default class Ethereum implements ILedger { * @param options * @param ready Callback for when the ledger is fully initialized */ - constructor(options: EthereumOptions, ready: () => {}) { + constructor(options: EthereumOptions, emitter: Emitter) { const opts = this[_options] = Object.assign(getDefaultOptions(), options); const accounts = opts.accounts; const knownAccounts = this[_knownAccounts]; @@ -122,7 +122,8 @@ export default class Ethereum implements ILedger { //#endregion const chain = this[_blockchain] = new Blockchain(options); - chain.on("ready", ready); + chain.on("ready", () => emitter.emit("ready")); + emitter.on("close", async () => chain.shutdown()); } /** From 4cd93baddd7ffedc910d89e1072c135d2ce0a808 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:06:35 -0400 Subject: [PATCH 059/691] minimum emitter interface --- src/interfaces/ledger.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/interfaces/ledger.ts b/src/interfaces/ledger.ts index 8157f888a6..3e61ee87c4 100644 --- a/src/interfaces/ledger.ts +++ b/src/interfaces/ledger.ts @@ -1,3 +1,8 @@ +export type Emitter = { + on(eventName: string, listener: (eventData?: any) => any): any + off(eventName: string, listener: (eventData?: any) => any): any + emit(eventName: string, eventData?: any): any +}; /** * Defines the interface for a Ledger. From d165be23608188a97f933ce81f73196ddbdb5abe Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:07:06 -0400 Subject: [PATCH 060/691] implement the new emitter --- src/provider.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/provider.ts b/src/provider.ts index f62ca79dd0..d67c5fbf6e 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -6,7 +6,7 @@ import Emittery from "emittery"; import Ethereum from "./ledgers/ethereum/ledger" import { privateToAddress } from "ethereumjs-util"; import Account from "./types/account"; -import { generateMnemonic, mnemonicToSeedSync } from "bip39"; +import { mnemonicToSeedSync } from "bip39"; import Address from "./types/address"; import JsonRpc from "./servers/utils/jsonrpc"; import EthereumOptions from "./ledgers/ethereum/options"; @@ -45,7 +45,9 @@ export default class Provider extends Emittery { // `accounts`, fix that up here: const ethereumOptions = _providerOptions as any as EthereumOptions; ethereumOptions.accounts = accounts; - const ledger = _providerOptions.ledger || new Ethereum(ethereumOptions, _requestProcessor.resume.bind(_requestProcessor)); + const emitter = this as any; + const ledger = _providerOptions.ledger || new Ethereum(ethereumOptions, emitter); + emitter.on("ready", _requestProcessor.resume.bind(_requestProcessor)); this._engine = new Engine(ledger); } @@ -161,4 +163,8 @@ export default class Provider extends Emittery { public sendAsync(payload: JsonRpc.Request, callback?: Callback): void { return this.send(payload, callback); } + + public async close() { + return this.emit("close"); + } } From 23effc204d73b13d9975a6707cbd6275289f18a5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:07:26 -0400 Subject: [PATCH 061/691] add tests and await the server close event --- test/server.ts | 250 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 229 insertions(+), 21 deletions(-) diff --git a/test/server.ts b/test/server.ts index e0860efa23..5c1dbdedb0 100644 --- a/test/server.ts +++ b/test/server.ts @@ -28,18 +28,25 @@ describe("server", () => { return s.listen(port); }; async function teardown(){ - s && s.close(); + s && await s.close(); s = undefined; } describe("http", () => { + async function simpleTest(){ + const response = await request + .post('http://localhost:' + port) + .send(jsonRpcJson); + assert.strictEqual(response.status, 200); + + const json = JSON.parse(response.text); + assert.strictEqual(json.result, network_id); + return response; + } + it("returns the net_version", async () => { await setup(); try { - const response = await request - .post('http://localhost:' + port) - .send(jsonRpcJson); - const json = JSON.parse(response.text); - assert.strictEqual(json.result, network_id); + await simpleTest(); } finally { teardown(); } @@ -51,11 +58,7 @@ describe("server", () => { } as ServerOptions); s.listen(port, async () => { try { - const response = await request - .post('http://localhost:' + port) - .send(jsonRpcJson); - const json = JSON.parse(response.text); - assert.strictEqual(json.result, network_id); + await simpleTest(); } finally { teardown(); } @@ -86,7 +89,7 @@ describe("server", () => { }); } finally { teardown(); - server.close(); + await server.close(); } }); @@ -135,13 +138,9 @@ describe("server", () => { assert.strictEqual(json.result, network_id); resolve(); }); - req.on("error", function(){ - console.log(...arguments); + req.on("error", () => { reject(); }); - req.on("progress", function(){ - console.log(...arguments); - }); const readableStream = intoStream(json); // make sure the data is sent as tiny pieces. @@ -152,6 +151,205 @@ describe("server", () => { teardown(); } }); + + it("fails to subscribe and unsubscribe over HTTP", async () =>{ + await setup(); + const jsonRpcJson: any = { + jsonrpc: "2.0", + id: "1", + method: "eth_subscribe", + params: [] + }; + try { + // TODO: should we expect a 200 OK response with an `error` property + // in a json rpc body? Probably, because we _do_ already send one. :-/ + await assert.rejects(request + .post('http://localhost:' + port) + .send(jsonRpcJson) + , { + status: 400, + message: "Bad Request" + }); + jsonRpcJson.method = "eth_unsubscribe"; + await assert.rejects(request + .post('http://localhost:' + port) + .send(jsonRpcJson) + , { + message: "Bad Request" + }); + } finally { + teardown(); + } + }); + + it("returns a teapot", async () => { + await setup(); + try { + const result = await request.get('http://localhost:' + port + "/418").catch(e => e); + assert.strictEqual(result.status, 418); + assert.strictEqual(result.message, "I'm a Teapot"); + } finally { + teardown(); + } + }); + + it("returns 404 for bad routes", async () => { + await setup(); + const methods = ["get", "post", "head", "options", "put", "delete", "patch", "trace"]; + try { + const requests = methods.map(async (method) => { + const result = await (request as any)[method]('http://localhost:' + port + "/there-is-no-spoon").catch((e: any) => e); + assert.strictEqual(result.status, 404); + assert.strictEqual(result.message, "Not Found"); + }); + await Promise.all(requests); + } finally { + teardown(); + } + }); + + it("doesn't crash when the request is aborted while waiting for repsonse", async () => { + await setup(); + + try { + const oldSend = s.provider.send; + const req = request.post('http://localhost:' + port); + const abortPromise = new Promise(resolve => { + s.provider.send = () => { + // abort the request object after intercepting the request + req.abort(); + return new Promise(innerResolve => { + // It takes 2 passes of the event loop to register the `abort` + // server-side: + setImmediate(setImmediate, () => { + // resolve the `provider.send` to make sure the server can + // handle _not_ responding to a request that has been aborted: + innerResolve(); + // and finally, resolve the `abort` promise: + resolve(); + }); + }); + }; + }); + const result = await req.send(jsonRpcJson).catch(e => e); + assert.strictEqual(result.code, "ABORTED", "Response was not aborted"); + + // wait for the server to react to the requesrt's `abort` + await abortPromise; + + s.provider.send = oldSend; + + // now make sure we are still up and running: + await simpleTest(); + + } finally { + teardown(); + } + }); + + it("server closes when told to", async () => { + await setup(); + + try { + await s.close(); + const req = request.post('http://localhost:' + port); + await assert.rejects(req.send(jsonRpcJson), { + code: "ECONNREFUSED" + }); + } finally { + teardown(); + } + }); + + describe("CORS", () => { + const optionsHeaders = [ + "Access-Control-Allow-Methods", + "Access-Control-Allow-Headers", + "Access-Control-Max-Age" + ]; + const baseHeaders = [ + "Access-Control-Allow-Credentials", + "Access-Control-Allow-Origin" + ]; + const allCorsHeaders = optionsHeaders.concat(baseHeaders);; + + it("does not return CORS headers for non-CORS requests", async() => { + await setup(); + try { + const resp = await simpleTest(); + allCorsHeaders.forEach((header) => { + assert.strictEqual( + resp.header[header.toLowerCase()], + undefined , + `Non-CORS response should not contain header ${header}` + ); + }); + } finally { + teardown(); + } + }); + + it("returns only base CORS headers for post request with origin header", async() => { + await setup(); + const origin = "origin"; + try { + const resp = await request + .post('http://localhost:' + port) + .set("origin", origin) + .send(jsonRpcJson); + assert.strictEqual(resp.status, 200); + assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); + assert.strictEqual(resp.header["access-control-allow-origin"], origin); + optionsHeaders.forEach((header) => { + assert.strictEqual( + resp.header[header.toLowerCase()], + undefined , + `Non-CORS response should not contain header ${header}` + ); + }); + } finally { + teardown(); + } + }); + + it("returns all CORS headers for request options request with origin header", async() => { + await setup(); + const origin = "origin"; + try { + const resp = await request + .options('http://localhost:' + port) + .set("origin", origin) + .send(jsonRpcJson); + assert.strictEqual(resp.status, 204); + assert.strictEqual(resp.header["access-control-allow-methods"], "POST"); + assert.strictEqual(resp.header["access-control-allow-origin"], origin); + assert.strictEqual(resp.header["access-control-max-age"], "600"); + assert.strictEqual(resp.header["content-length"], "0"); + assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); + assert.strictEqual(resp.header["access-control-allow-origin"], origin); + } finally { + teardown(); + } + }); + + it("echos Access-Control-Request-Headers for options request", async() => { + await setup(); + const origin = "origin"; + const acrh = "origin, content-length, x-random"; + try { + const resp = await request + .options('http://localhost:' + port) + .set("origin", origin) + .set("Access-Control-Request-Headers", acrh) + .send(jsonRpcJson); + + assert.strictEqual(resp.status, 204); + assert.strictEqual(resp.header["access-control-allow-headers"], acrh); + } finally { + teardown(); + } + }); + }); }); describe("websocket", () => { @@ -212,9 +410,9 @@ describe("server", () => { }); it("doesn't crash when the connection is closed while a request is in flight", async () => { - s.provider.send = async function() { + s.provider.send = async () => { // close our websocket after intercepting the request - s.close(); + await s.close(); }; const ws = new WebSocket('ws://localhost:' + port); @@ -236,12 +434,22 @@ describe("server", () => { }); }); - it("can handle backpressure", async () => { + it.skip("can handle backpressure", async () => { { // create tons of data to force websocket backpressure const huge = {} as any; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; s.provider.send = async () => huge; } + // { + // return await new Promise((resolve) => { + // const ws = new WebSocket('ws://localhost:8545'); + // ws.on("open", () => { + // ws.send(JSON.stringify(jsonRpcJson)); + // ws.close(); + // resolve(); + // }); + // }); + // } const ws = new WebSocket('ws://localhost:' + port); const oldLog = logger.log; @@ -279,6 +487,6 @@ describe("server", () => { // don't break. logger.log = oldLog; } - }); + }).timeout(10000); }); }); From a15012c93317cae7a3687f6953b65fb4aa35a0cb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:07:41 -0400 Subject: [PATCH 062/691] update packages --- npm-shrinkwrap.json | 1612 +++++++++++++------------------------------ package.json | 43 +- 2 files changed, 513 insertions(+), 1142 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e60c7fd86d..7d75dec804 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -64,34 +64,6 @@ "chalk": "^2.0.0", "esutils": "^2.0.2", "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - } } }, "@babel/parser": { @@ -150,15 +122,11 @@ "to-fast-properties": "^2.0.0" } }, - "@types/abstract-leveldown": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-5.0.1.tgz", - "integrity": "sha512-wYxU3kp5zItbxKmeRYCEplS2MW7DzyBnxPGj+GJVHZEUZiK/nn5Ei1sUFgURDh+X051+zsGe28iud3oHjrYWQQ==" - }, "@types/bn.js": { - "version": "4.11.4", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.4.tgz", - "integrity": "sha512-AO8WW+aRcKWKQAYTfKLzwnpL6U+TfPqS+haRrhCy5ff04Da8WZud3ZgVjspQXaEXJDcTlsjUEVvL39wegDek5w==", + "version": "4.11.5", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", + "integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==", + "dev": true, "requires": { "@types/node": "*" } @@ -173,6 +141,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/ethereumjs-tx/-/ethereumjs-tx-1.0.1.tgz", "integrity": "sha512-UtucmY/WoMCDhNebyFJQ+AevyFGeTgh8UYZE1aWqIRkk90E+eKWgGV2lAVjkg/gXqxLkJYZ0RcV1J09K9xlSvw==", + "dev": true, "requires": { "@types/bn.js": "*", "@types/node": "*" @@ -185,15 +154,22 @@ "dev": true }, "@types/mocha": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", - "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.6.tgz", + "integrity": "sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw==", "dev": true }, "@types/node": { "version": "10.12.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.0.tgz", - "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==" + "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==", + "dev": true + }, + "@types/seedrandom": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz", + "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", + "dev": true }, "@types/superagent": { "version": "4.1.1", @@ -226,11 +202,10 @@ } }, "abstract-leveldown": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.1.tgz", - "integrity": "sha512-8ccQIKHwmh7rIRWvKGgSTM2LByLWpLZgAYRjDNOh1ZTXvlR0gtm2Ir7aD8rEUre8DMllchJJTAZhhN5aUBN7XA==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", "requires": { - "level-concat-iterator": "~2.0.0", "xtend": "~4.0.0" } }, @@ -246,21 +221,19 @@ "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "app-module-path": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/app-module-path/-/app-module-path-2.2.0.tgz", - "integrity": "sha1-ZBqlXft9am8KgUHEucCqULbCTdU=" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } }, "append-transform": { "version": "1.0.0", @@ -283,11 +256,6 @@ "integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==", "dev": true }, - "argly": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/argly/-/argly-1.2.0.tgz", - "integrity": "sha1-KydORVGin/XnGZ0u2XiOtm7TbmA=" - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -297,11 +265,6 @@ "sprintf-js": "~1.0.2" } }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" - }, "async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", @@ -330,17 +293,6 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -364,14 +316,17 @@ } }, "bindings": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", - "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } }, "bip39": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.0.tgz", - "integrity": "sha512-p1gHoZCAMfHRQLr57d/3AfillgPwV2nsBAnHpHUmr3BCRmThN9k18r5mUK/9R/zdFhZAlltYDzYe2GjnzXvMQA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", + "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", "requires": { "@types/node": "11.11.6", "create-hash": "^1.1.0", @@ -394,11 +349,6 @@ "safe-buffer": "^5.0.1" } }, - "bluebird": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz", - "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==" - }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", @@ -418,11 +368,6 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, - "browser-refresh-client": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/browser-refresh-client/-/browser-refresh-client-1.1.4.tgz", - "integrity": "sha1-jl/4R1/h1UHSroH3oa6gWuIaYhc=" - }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -487,6 +432,14 @@ "dev": true, "requires": { "node-gyp-build": "~3.7.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", + "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "dev": true + } } }, "builtin-modules": { @@ -502,24 +455,6 @@ "requires": { "abstract-leveldown": "^2.4.1", "lru-cache": "^3.2.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "requires": { - "xtend": "~4.0.0" - } - }, - "lru-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", - "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", - "requires": { - "pseudomap": "^1.0.1" - } - } } }, "caching-transform": { @@ -535,46 +470,33 @@ } }, "camelcase": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", - "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==" - }, - "chai": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", - "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", - "requires": { - "assertion-error": "^1.0.1", - "deep-eql": "^0.1.3", - "type-detect": "^1.0.0" - } + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true }, "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "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" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "dependencies": { "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, - "char-props": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/char-props/-/char-props-0.1.5.tgz", - "integrity": "sha1-W5UvniDqIc0Iyn/hNaEPb+kcEJ4=" - }, "checkpoint-store": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", @@ -601,23 +523,6 @@ "string-width": "^2.1.1", "strip-ansi": "^4.0.0", "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } } }, "code-point-at": { @@ -658,18 +563,18 @@ "dev": true }, "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "~1.0.0" } }, "commander": { - "version": "2.15.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true }, "commondir": { @@ -678,18 +583,10 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "complain": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/complain/-/complain-1.3.0.tgz", - "integrity": "sha512-PA9uGpaS4BXKrhFx3rl2nZMWySnGoW1pWf+dpBqNdDx3uR6PA0EPxjD17H9OxvW5w/bODBSziQ516Guf59rW+w==", - "requires": { - "error-stack-parser": "^2.0.1" - } - }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "concat-map": { @@ -776,6 +673,14 @@ "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "debug": { @@ -793,26 +698,6 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, - "deep-eql": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", - "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", - "requires": { - "type-detect": "0.1.1" - }, - "dependencies": { - "type-detect": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", - "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=" - } - } - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" - }, "default-require-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", @@ -823,12 +708,21 @@ } }, "deferred-leveldown": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.0.1.tgz", - "integrity": "sha512-BXohsvTedWOLkj2n/TY+yqVlrCWa2Zs8LSxh3uCAgFOru7/pjxKyZAexGa1j83BaKloER4PqUyQ9rGPJLt9bqA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", "requires": { - "abstract-leveldown": "~6.0.0", - "inherits": "^2.0.3" + "abstract-leveldown": "~2.6.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "~4.0.0" + } + } } }, "define-properties": { @@ -838,6 +732,14 @@ "dev": true, "requires": { "object-keys": "^1.0.12" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } } }, "defined": { @@ -851,23 +753,6 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, - "deresolve": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/deresolve/-/deresolve-1.1.2.tgz", - "integrity": "sha1-nPI3nI0tYx3EuZVylLkOSnLLbOA=", - "requires": { - "lasso-package-root": "^1.0.0", - "raptor-polyfill": "^1.0.2", - "resolve-from": "^1.0.1" - }, - "dependencies": { - "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=" - } - } - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -930,22 +815,17 @@ } }, "level-codec": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.0.tgz", - "integrity": "sha512-OIpVvjCcZNP5SdhcNupnsI1zo5Y9Vpm+k/F1gfG5kXrtctlrwanisakweJtE0uA0OpLukRfOQae+Fg0M5Debhg==" + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", + "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" }, "level-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.0.tgz", - "integrity": "sha512-AmY4HCp9h3OiU19uG+3YWkdELgy05OTP/r23aNHaQKWv8DO787yZgsEuGVkoph40uwN+YdUKnANlrxSsoOaaxg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", "requires": { "errno": "~0.1.1" } - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" } } }, @@ -975,14 +855,6 @@ "is-arrayish": "^0.2.1" } }, - "error-stack-parser": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.0.2.tgz", - "integrity": "sha512-E1fPutRDdIj/hohG0UpT5mayXNCxXP9d+snxFsPU9X0XgccOumKraa3juDMwTUyi7+Bu5+mCGagjg4IYeNbOdw==", - "requires": { - "stackframe": "^1.0.4" - } - }, "es-abstract": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", @@ -995,6 +867,14 @@ "is-callable": "^1.1.4", "is-regex": "^1.0.4", "object-keys": "^1.0.12" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } } }, "es-to-primitive": { @@ -1020,45 +900,17 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "escodegen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", - "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true - } - } - }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true }, "ethashjs": { "version": "0.0.7", @@ -1117,29 +969,6 @@ "merkle-patricia-tree": "^2.1.2" }, "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", - "requires": { - "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", - "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, "ethereumjs-util": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", @@ -1165,65 +994,6 @@ "safe-buffer": "^5.1.0" } }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } - } - }, - "level-ws": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", - "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, "levelup": { "version": "1.3.9", "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", @@ -1236,13 +1006,6 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } } }, "merkle-patricia-tree": { @@ -1266,29 +1029,6 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" } } - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - }, - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } } } }, @@ -1333,6 +1073,14 @@ "nan": "^2.2.1", "safe-buffer": "^5.1.0" } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } } } }, @@ -1423,29 +1171,6 @@ "safe-buffer": "^5.1.1" }, "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", - "requires": { - "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", - "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, "ethereumjs-account": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", @@ -1483,65 +1208,6 @@ "safe-buffer": "^5.1.0" } }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } - } - }, - "level-ws": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", - "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, "levelup": { "version": "1.3.9", "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", @@ -1554,13 +1220,6 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } } }, "merkle-patricia-tree": { @@ -1598,29 +1257,6 @@ } } } - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - }, - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } } } }, @@ -1649,19 +1285,6 @@ "strip-hex-prefix": "1.0.0" } }, - "events": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", - "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" - }, - "events-light": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/events-light/-/events-light-1.0.5.tgz", - "integrity": "sha1-lk5jRQugr0prAiqpVbF//vZXte4=", - "requires": { - "chai": "^3.5.0" - } - }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -1699,10 +1322,10 @@ "resolved": "https://registry.npmjs.org/fast-future/-/fast-future-1.0.2.tgz", "integrity": "sha1-hDWpqqAteSSNF9cE52JZMB2ZKAo=" }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "find-cache-dir": { "version": "2.1.0", @@ -1806,8 +1429,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "function-bind": { "version": "1.1.1", @@ -1836,10 +1458,9 @@ } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1896,15 +1517,6 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1957,7 +1569,8 @@ "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true }, "hmac-drbg": { "version": "1.0.1", @@ -1975,15 +1588,6 @@ "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, - "htmljs-parser": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/htmljs-parser/-/htmljs-parser-2.6.6.tgz", - "integrity": "sha512-cwIV9dkA5WgDuhZigrL6Aw1+sGdhlVi5b4csijnGVHe0GATGY0ibHt68q2O7nULTtg5HTMtR8tdvd2yVfPIZxg==", - "requires": { - "char-props": "^0.1.5", - "complain": "^1.0.0" - } - }, "immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", @@ -1999,7 +1603,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -2207,9 +1810,9 @@ "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { @@ -2260,31 +1863,6 @@ "sha3": "^1.2.2" } }, - "lasso-caching-fs": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/lasso-caching-fs/-/lasso-caching-fs-1.0.2.tgz", - "integrity": "sha1-m+TrHwaqwSYDRMrq70LC8AhusQ0=", - "requires": { - "raptor-async": "^1.1.2" - } - }, - "lasso-modules-client": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/lasso-modules-client/-/lasso-modules-client-2.0.5.tgz", - "integrity": "sha1-2aBnJKkAl3Y2lxZn7pwXDS/E3Sg=", - "requires": { - "lasso-package-root": "^1.0.0", - "raptor-polyfill": "^1.0.2" - } - }, - "lasso-package-root": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lasso-package-root/-/lasso-package-root-1.0.1.tgz", - "integrity": "sha1-mX0OcfQdA8Xw+gmlvCmNeW+LLCM=", - "requires": { - "lasso-caching-fs": "^1.0.0" - } - }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", @@ -2300,36 +1878,38 @@ "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" }, "level-concat-iterator": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.0.tgz", - "integrity": "sha512-gMs7JtWp479SOBjJQteQ+WMctfiQXG1SX5EuIGWTTUP37mKqs6BcYcjfZVVzAdTq0lAcSYpL2xGwmCG/hbjOcg==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" }, "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", "requires": { "errno": "~0.1.1" } }, "level-iterator-stream": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.1.tgz", - "integrity": "sha512-pSZWqXK6/yHQkZKCHrR59nKpU5iqorKM22C/BOHTb/cwNQ2EOZG+bovmFFGcOgaBoF3KxqJEI27YwewhJQTzsw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", "requires": { "inherits": "^2.0.1", - "readable-stream": "^3.0.2", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", "xtend": "^4.0.0" }, "dependencies": { "readable-stream": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", - "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" } } } @@ -2363,11 +1943,6 @@ "ltgt": "~2.2.0", "safe-buffer": "~5.1.1" } - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" } } }, @@ -2406,9 +1981,9 @@ } }, "level-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.0.tgz", - "integrity": "sha512-AmY4HCp9h3OiU19uG+3YWkdELgy05OTP/r23aNHaQKWv8DO787yZgsEuGVkoph40uwN+YdUKnANlrxSsoOaaxg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", "requires": { "errno": "~0.1.1" } @@ -2433,67 +2008,128 @@ "level-iterator-stream": "~3.0.0", "xtend": "~4.0.0" } - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" } } }, "level-ws": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", - "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.2.8", - "xtend": "^4.0.1" + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } + } } }, "leveldown": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.0.1.tgz", - "integrity": "sha512-G4iodNkOhJmZ3uHInsvr1OZrvxxn24+BmfgQCLXdYCFr6diGdshFGCVZfmA4vgcxqvuzPF2P+KnwXdbyeabWqA==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.0.3.tgz", + "integrity": "sha512-isfWtOQIXbGbQRI8nmU9FqCZM0klmqTAOFi0vF6G/D0O1ZgxLrSh6Xd4Zj9iVQfGt6+8jpYwkRbN07VLrxRM8w==", "requires": { - "abstract-leveldown": "~6.0.0", + "abstract-leveldown": "~6.0.3", "fast-future": "~1.0.2", "napi-macros": "~1.8.1", "node-gyp-build": "~3.8.0" }, "dependencies": { - "node-gyp-build": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.8.0.tgz", - "integrity": "sha512-bYbpIHyRqZ7sVWXxGpz8QIRug5JZc/hzZH4GbdT9HTZi6WmKCZ8GLvP8OZ9TTiIBvwPFKgtGrlWQSXDAvYdsPw==" + "abstract-leveldown": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", + "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", + "requires": { + "level-concat-iterator": "~2.0.0", + "xtend": "~4.0.0" + } } } }, "levelup": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.0.0.tgz", - "integrity": "sha512-RcWkjtMj1DGs8ftNs4U7MEZeHFnC9QcHn/fmBlOypHXCx02zwukZROzyUwRiu9dgw9y1tCDLFMmXQHEhCChi4w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.0.1.tgz", + "integrity": "sha512-l7KXOkINXHgNqmz0v9bxvRnMCUG4gmShFrzFSZXXhcqFnfvKAW8NerVsTICpZtVhGOMAmhY6JsVoVh/tUPBmdg==", "requires": { "deferred-leveldown": "~5.0.0", "level-errors": "~2.0.0", "level-iterator-stream": "~4.0.0", "xtend": "~4.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", + "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", + "requires": { + "level-concat-iterator": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.0.1.tgz", + "integrity": "sha512-BXohsvTedWOLkj2n/TY+yqVlrCWa2Zs8LSxh3uCAgFOru7/pjxKyZAexGa1j83BaKloER4PqUyQ9rGPJLt9bqA==", + "requires": { + "abstract-leveldown": "~6.0.0", + "inherits": "^2.0.3" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.1.tgz", + "integrity": "sha512-pSZWqXK6/yHQkZKCHrR59nKpU5iqorKM22C/BOHTb/cwNQ2EOZG+bovmFFGcOgaBoF3KxqJEI27YwewhJQTzsw==", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^3.0.2", + "xtend": "^4.0.0" + } + }, + "readable-stream": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "listener-tracker": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/listener-tracker/-/listener-tracker-2.0.0.tgz", - "integrity": "sha1-OWCLQ1wJAfpVECF8FFJyjWvBm18=" - }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -2542,36 +2178,14 @@ "dev": true, "requires": { "chalk": "^2.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - } } }, "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", + "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", "requires": { - "yallist": "^3.0.2" + "pseudomap": "^1.0.1" } }, "ltgt": { @@ -2587,6 +2201,14 @@ "requires": { "pify": "^4.0.1", "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "make-error": { @@ -2604,45 +2226,6 @@ "p-defer": "^1.0.0" } }, - "marko": { - "version": "4.16.6", - "resolved": "https://registry.npmjs.org/marko/-/marko-4.16.6.tgz", - "integrity": "sha512-N3mjv37dZ1nne/TYovCGmQ4dW0AiKH/C4uusbLVZ46KVYbJabjer6B3wadPhJKmJYvmI+YEAVkHzmxcy1t+qOA==", - "requires": { - "app-module-path": "^2.2.0", - "argly": "^1.0.0", - "browser-refresh-client": "^1.0.0", - "camelcase": "^5.0.0", - "char-props": "~0.1.5", - "complain": "^1.3.0", - "deresolve": "^1.1.2", - "escodegen": "^1.8.1", - "esprima": "^4.0.0", - "estraverse": "^4.2.0", - "events": "^1.0.2", - "events-light": "^1.0.0", - "he": "^1.1.0", - "htmljs-parser": "^2.6.5", - "lasso-caching-fs": "^1.0.1", - "lasso-modules-client": "^2.0.4", - "lasso-package-root": "^1.0.1", - "listener-tracker": "^2.0.0", - "minimatch": "^3.0.2", - "object-assign": "^4.1.0", - "property-handlers": "^1.0.0", - "raptor-json": "^1.0.1", - "raptor-polyfill": "^1.0.0", - "raptor-promises": "^1.0.1", - "raptor-regexp": "^1.0.0", - "raptor-util": "^3.2.0", - "resolve-from": "^2.0.0", - "shorthash": "0.0.2", - "simple-sha1": "^2.1.0", - "strip-json-comments": "^2.0.1", - "try-require": "^1.2.1", - "warp10": "^2.0.1" - } - }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -2673,18 +2256,8 @@ "functional-red-black-tree": "^1.0.1", "immediate": "^3.2.3", "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "requires": { - "xtend": "~4.0.0" - } - } + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" } }, "merge-source-map": { @@ -2732,6 +2305,11 @@ "secp256k1": "^3.0.1" } }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, "keccak": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", @@ -2743,15 +2321,49 @@ "safe-buffer": "^5.1.0" } }, + "level-ws": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", + "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.2.8", + "xtend": "^4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } + } + }, "readable-stream": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", - "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } } } }, @@ -2771,24 +2383,24 @@ } }, "mime": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", - "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.2.tgz", + "integrity": "sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg==", "dev": true }, "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", "dev": true }, "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, "requires": { - "mime-db": "~1.38.0" + "mime-db": "1.40.0" } }, "mimic-fn": { @@ -2874,15 +2486,6 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" } - }, - "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, @@ -2893,9 +2496,9 @@ "dev": true }, "nan": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" }, "napi-macros": { "version": "1.8.2", @@ -2903,9 +2506,9 @@ "integrity": "sha512-Tr0DNY4RzTaBG2W2m3l7ZtFuJChTH6VZhXVhkGGjF/4cZTt+i8GcM9ozD+30Lmr4mDoZ5Xx34t2o4GJqYWDGcg==" }, "neo-async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", - "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, "nested-error-stacks": { @@ -2939,10 +2542,9 @@ } }, "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", - "dev": true + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.8.0.tgz", + "integrity": "sha512-bYbpIHyRqZ7sVWXxGpz8QIRug5JZc/hzZH4GbdT9HTZi6WmKCZ8GLvP8OZ9TTiIBvwPFKgtGrlWQSXDAvYdsPw==" }, "normalize-package-data": { "version": "2.5.0", @@ -2954,17 +2556,6 @@ "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "resolve": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", - "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - } } }, "npm-run-path": { @@ -2983,9 +2574,9 @@ "dev": true }, "nyc": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.0.tgz", - "integrity": "sha512-iy9fEV8Emevz3z/AanIZsoGa8F4U2p0JKevZ/F0sk+/B2r9E6Qn+EPs0bpxEhnAt6UPlTL8mQZIaSJy8sK0ZFw==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", + "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", "dev": true, "requires": { "archy": "^1.0.0", @@ -3013,40 +2604,12 @@ "uuid": "^3.3.2", "yargs": "^13.2.2", "yargs-parser": "^13.0.0" - }, - "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "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" - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - } } }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" }, "object.assign": { "version": "4.1.0", @@ -3058,6 +2621,14 @@ "function-bind": "^1.1.1", "has-symbols": "^1.0.0", "object-keys": "^1.0.11" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } } }, "object.getownpropertydescriptors": { @@ -3074,7 +2645,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -3087,27 +2657,6 @@ "requires": { "minimist": "~0.0.1", "wordwrap": "~0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "requires": { - "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" } }, "os-homedir": { @@ -3127,11 +2676,6 @@ "mem": "^4.0.0" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -3205,8 +2749,7 @@ "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=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "2.0.1", @@ -3264,21 +2807,11 @@ "find-up": "^3.0.0" } }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" - }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, - "property-handlers": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/property-handlers/-/property-handlers-1.1.1.tgz", - "integrity": "sha1-yyDTIqq32U//rCj0bJGGvVlHtLQ=" - }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -3299,10 +2832,11 @@ "once": "^1.3.1" } }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true }, "randombytes": { "version": "2.1.0", @@ -3312,58 +2846,6 @@ "safe-buffer": "^5.1.0" } }, - "raptor-async": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/raptor-async/-/raptor-async-1.1.3.tgz", - "integrity": "sha1-uDw8m2A9yYXCw6n3jStAc+b2Akw=" - }, - "raptor-json": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/raptor-json/-/raptor-json-1.1.0.tgz", - "integrity": "sha1-cL0JsU5k99MuxQzOg3fWApwPCHY=", - "requires": { - "raptor-strings": "^1.0.0" - } - }, - "raptor-polyfill": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/raptor-polyfill/-/raptor-polyfill-1.1.0.tgz", - "integrity": "sha512-VhFc5e6EuNGdax7FQ2QWlCdXFi5OBBsclDh0kzZtgBI7lauc8aFs7+htdi5Q3qCRoYXfsucSBsRKf7a3s+YGmA==" - }, - "raptor-promises": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/raptor-promises/-/raptor-promises-1.0.3.tgz", - "integrity": "sha1-1XaxEOBCNlT3/fFyHijULk3DwOs=", - "requires": { - "q": "^1.0.1", - "raptor-util": "^1.0.0" - }, - "dependencies": { - "raptor-util": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/raptor-util/-/raptor-util-1.1.2.tgz", - "integrity": "sha1-8u6AdqmuPq4uZWcuRqIgB0+i3/M=" - } - } - }, - "raptor-regexp": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/raptor-regexp/-/raptor-regexp-1.0.1.tgz", - "integrity": "sha1-7PD2bGZxwM2fXkjDcFAmxVCZlcA=" - }, - "raptor-strings": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/raptor-strings/-/raptor-strings-1.0.2.tgz", - "integrity": "sha1-ks4ssBU6/pBHDYA5oCVbTPM6tfw=", - "requires": { - "raptor-polyfill": "^1.0.1" - } - }, - "raptor-util": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/raptor-util/-/raptor-util-3.2.0.tgz", - "integrity": "sha1-I7DIA8jxrIocrmfZpjiLSRYcl1g=" - }, "read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -3403,6 +2885,14 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } } } }, @@ -3428,42 +2918,26 @@ "dev": true }, "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", + "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", "dev": true, "requires": { - "path-parse": "^1.0.5" + "path-parse": "^1.0.6" } }, "resolve-from": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, "requires": { "glob": "^7.1.3" - }, - "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "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" - } - } } }, "ripemd160": { @@ -3484,11 +2958,6 @@ "safe-buffer": "^5.1.1" } }, - "rusha": { - "version": "0.8.13", - "resolved": "https://registry.npmjs.org/rusha/-/rusha-0.8.13.tgz", - "integrity": "sha1-mghOe4YLF7/zAVuSxnpqM2GRUTo=" - }, "rustbn.js": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", @@ -3526,25 +2995,20 @@ } }, "secp256k1": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.6.2.tgz", - "integrity": "sha512-90nYt7yb0LmI4A2jJs1grglkTAXrBwxYAjP9bpeKjvJKOjG2fOeH/YI/lchDMIvjrOasd5QXwvV2jwN168xNng==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.0.tgz", + "integrity": "sha512-YlUIghD6ilkMkzmFJpIdVjiamv2S8lNZ9YMwm1XII9JC0NcR5qQiv2DOp/G37sExBtaMStzba4VDJtvBXEbmMQ==", "requires": { - "bindings": "^1.2.1", - "bip66": "^1.1.3", - "bn.js": "^4.11.3", - "create-hash": "^1.1.2", + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", "drbg.js": "^1.0.1", - "elliptic": "^6.2.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" + "elliptic": "^6.4.1", + "nan": "^2.13.2", + "safe-buffer": "^5.1.2" } }, - "seed-random": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", - "integrity": "sha1-KpsZ4lCoFwmSMaW5mk2vgLf77VQ=" - }, "seedrandom": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.1.tgz", @@ -3556,10 +3020,9 @@ "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, "set-blocking": { "version": "2.0.0", @@ -3577,18 +3040,11 @@ } }, "sha3": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.2.tgz", - "integrity": "sha1-pmxQmN5MJbyIM27ItIF9AFvKe6k=", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.3.tgz", + "integrity": "sha512-sOWDZi8cDBRkLfWOw18wvJyNblXDHzwMGnRWut8zNNeIeLnmMRO17bjpLc7OzMuj1ASUgx2IyohzUCAl+Kx5vA==", "requires": { - "nan": "2.10.0" - }, - "dependencies": { - "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" - } + "nan": "2.13.2" } }, "shebang-command": { @@ -3606,25 +3062,12 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, - "shorthash": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/shorthash/-/shorthash-0.0.2.tgz", - "integrity": "sha1-WbJo7sveWQOLMNogK8+93rLEpOs=" - }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "simple-sha1": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/simple-sha1/-/simple-sha1-2.1.2.tgz", - "integrity": "sha512-TQl9rm4rdKAVmhO++sXAb8TNN0D6JAD5iyI1mqEPNpxUzTRrtm4aOG1pDf/5W/qCFihiaoK6uuL9rvQz1x1VKw==", - "requires": { - "rusha": "^0.8.1" - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -3701,11 +3144,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "stackframe": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.0.4.tgz", - "integrity": "sha512-to7oADIniaYwS3MhtCa/sQhrxidCCQiF/qp4/m5iN3ipf0Y7Xlri0f6eG29r08aL7JYl8n32AF3Q5GYBZ7K8vw==" - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -3714,40 +3152,20 @@ "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } } }, "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^3.0.0" } }, "strip-bom": { @@ -3773,7 +3191,8 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true }, "subleveldown": { "version": "4.0.0", @@ -3788,9 +3207,9 @@ }, "dependencies": { "abstract-leveldown": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.2.tgz", - "integrity": "sha512-AaEmQKBazexOeFp2tu+TnGWFhTudFMFK7yOdzJ5VlQyvZDmP6ff8R75JDDVtLCCi+hK5L8DVWaDe51w3uONqCA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", + "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", "requires": { "level-concat-iterator": "~2.0.0", "xtend": "~4.0.0" @@ -3812,34 +3231,32 @@ "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" }, - "levelup": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.0.1.tgz", - "integrity": "sha512-l7KXOkINXHgNqmz0v9bxvRnMCUG4gmShFrzFSZXXhcqFnfvKAW8NerVsTICpZtVhGOMAmhY6JsVoVh/tUPBmdg==", + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", "requires": { - "deferred-leveldown": "~5.0.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "xtend": "~4.0.0" + "errno": "~0.1.1" } } } }, "superagent": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-4.1.0.tgz", - "integrity": "sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.0.5.tgz", + "integrity": "sha512-5fnihpNqJfDJHxeIkqlXKFDOW5t4WUFV8Ba1erxdWT0RySqjgAW6Hska0xNYEpAfaoMzubn77GROm/XlkssOoQ==", "dev": true, "requires": { - "component-emitter": "^1.2.0", + "component-emitter": "^1.3.0", "cookiejar": "^2.1.2", - "debug": "^4.1.0", + "debug": "^4.1.1", "form-data": "^2.3.3", - "formidable": "^1.2.0", - "methods": "^1.1.1", - "mime": "^2.4.0", - "qs": "^6.6.0", - "readable-stream": "^3.0.6" + "formidable": "^1.2.1", + "methods": "^1.1.2", + "mime": "^2.4.2", + "qs": "^6.7.0", + "readable-stream": "^3.3.0", + "semver": "^6.0.0" }, "dependencies": { "debug": { @@ -3851,35 +3268,38 @@ "ms": "^2.1.1" } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", - "dev": true - }, "readable-stream": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.2.0.tgz", - "integrity": "sha512-RV20kLjdmpZuTF1INEb9IA3L68Nmi+Ri7ppZqo78wj//Pn62fCoJyV9zalccNzDD/OuJpMG4f+pfMl8+L6QdGw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } + }, + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==", + "dev": true + }, + "string_decoder": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", + "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } } } }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -3895,39 +3315,22 @@ "minimatch": "^3.0.4", "read-pkg-up": "^4.0.0", "require-main-filename": "^2.0.0" - }, - "dependencies": { - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dev": true, - "requires": { - "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" - } - } } }, "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", + "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", "requires": { - "os-tmpdir": "~1.0.2" + "rimraf": "^2.6.3" } }, "tmp-promise": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-1.0.5.tgz", - "integrity": "sha512-hOabTz9Tp49wCozFwuJe5ISrOqkECm6kzw66XTP23DuzNU7QS/KiZq5LC9Y7QSy8f1rPSLy4bKaViP0OwGI1cA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-2.0.0.tgz", + "integrity": "sha512-kChVEhT3MTvFKrFEiKZEgDpIzUDj/EAsivMW/x0dFYPtymbLU0IkJeEJLHQ5UZfxacV3fi85NBqDDI4vT0QsYA==", "requires": { - "bluebird": "^3.5.0", - "tmp": "0.0.33" + "tmp": "0.1.0" } }, "to-fast-properties": { @@ -3942,15 +3345,10 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, - "try-require": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/try-require/-/try-require-1.2.1.tgz", - "integrity": "sha1-NEiaLKwMCcHMEO2RugEVlNQzO+I=" - }, "ts-node": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.0.3.tgz", - "integrity": "sha512-2qayBA4vdtVRuDo11DEFSsD/SFsBXQBRZZhbRGSIkmYmVkWjULn/GGMdG10KVqkaGndljfaTD8dKjWgcejO8YA==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.1.0.tgz", + "integrity": "sha512-34jpuOrxDuf+O6iW1JpgTRDFynUZ1iEqtYruBqh35gICNjN8x+LpVcPAcwzLPi9VU6mdA3ym+x233nZmZp445A==", "dev": true, "requires": { "arg": "^4.1.0", @@ -3967,46 +3365,24 @@ "dev": true }, "tslint": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", - "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz", + "integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==", "dev": true, "requires": { - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", "diff": "^3.2.0", "glob": "^7.1.1", - "js-yaml": "^3.7.0", + "js-yaml": "^3.13.0", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", "tslib": "^1.8.0", "tsutils": "^2.29.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - } } }, "tsutils": { @@ -4018,23 +3394,10 @@ "tslib": "^1.8.1" } }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "type-detect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", - "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=" - }, "typescript": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.1.tgz", - "integrity": "sha512-3NSMb2VzDQm8oBTLH6Nj55VVtUEpe/rgkIzMir0qVoLyjDZlnMBva0U6vDiV3IH+sl/Yu6oP5QwsAQtHPmDd2Q==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz", + "integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==", "dev": true }, "uWebSockets.js": { @@ -4042,9 +3405,9 @@ "from": "github:uNetworking/uWebSockets.js#v15.9.0" }, "uglify-js": { - "version": "3.5.11", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.11.tgz", - "integrity": "sha512-izPJg8RsSyqxbdnqX36ExpbH3K7tDBsAU/VfNv89VkMFy3z39zFjunQGsSHOlGlyIfGLGprGeosgQno3bo2/Kg==", + "version": "3.5.12", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.12.tgz", + "integrity": "sha512-KeQesOpPiZNgVwJj8Ge3P4JYbQHUdZzpx6Fahy6eKAYRSV4zhVmLXoC+JtOeYxcHCHTve8RG1ZGdTvpeOUM26Q==", "dev": true, "optional": true, "requires": { @@ -4052,13 +3415,6 @@ "source-map": "~0.6.1" }, "dependencies": { - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true, - "optional": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -4075,6 +3431,14 @@ "dev": true, "requires": { "node-gyp-build": "~3.7.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", + "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "dev": true + } } }, "utf8": { @@ -4102,11 +3466,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "warp10": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/warp10/-/warp10-2.0.1.tgz", - "integrity": "sha512-nS1KG2RCVTWepfSitZKzL+HYiqqMJag06KtOJF/LwklrJWeJYRWHjMYpd6GXMt09ot+HIEj+Y4dmQNnNNE0Bjg==" - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -4132,9 +3491,10 @@ } }, "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true }, "wrap-ansi": { "version": "2.1.0", @@ -4146,6 +3506,12 @@ "strip-ansi": "^3.0.1" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", @@ -4165,14 +3531,22 @@ "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } } } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "2.4.2", @@ -4186,12 +3560,12 @@ } }, "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.0.0.tgz", + "integrity": "sha512-cknCal4k0EAOrh1SHHPPWWh4qm93g1IuGGGwBjWkXmCG7LsDtL8w9w+YVfaF+KSVwiHQKDIMsSLBVftKf9d1pg==", "dev": true, "requires": { - "async-limiter": "~1.0.0" + "async-limiter": "^1.0.0" } }, "xtend": { @@ -4323,9 +3697,9 @@ } }, "yn": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.0.0.tgz", - "integrity": "sha512-+Wo/p5VRfxUgBUGy2j/6KX2mj9AYJWOHuhMjMcbBFc3y54o9/4buK1ksBvuiK01C3kby8DH9lSmJdSxw+4G/2Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz", + "integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==", "dev": true } } diff --git a/package.json b/package.json index f2485aaba4..76a6a22b12 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "scripts": { "build": "tsc", - "test": "nyc npm run mocha -- --throw-deprecation", + "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --colors --require ts-node/register --require source-map-support/register --watch-extensions ts --recursive --check-leaks 'test/**.ts'" }, "nyc": { @@ -23,10 +23,7 @@ ] }, "dependencies": { - "@types/abstract-leveldown": "^5.0.1", - "@types/ethereumjs-tx": "^1.0.1", - "abstract-leveldown": "^6.0.1", - "bip39": "^3.0.0", + "bip39": "3.0.2", "bn.js": "4.11.8", "cachedown": "1.0.0", "emittery": "0.4.1", @@ -37,35 +34,35 @@ "ethereumjs-vm": "3.0.0", "ethereumjs-wallet": "0.6.3", "keccak": "2.0.0", - "leveldown": "5.0.1", - "levelup": "4.0.0", - "marko": "4.16.6", + "leveldown": "5.0.3", + "levelup": "4.0.1", "merkle-patricia-tree": "3.0.0", - "seed-random": "2.2.0", "seedrandom": "3.0.1", "subleveldown": "4.0.0", - "tmp-promise": "1.0.5", + "tmp-promise": "2.0.0", "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.9.0" }, "devDependencies": { - "@types/mocha": "5.2.5", - "@types/node": "10.12.0", - "@types/superagent": "4.1.1", - "@types/uws": "0.13.2", - "@types/ws": "6.0.1", + "@types/ethereumjs-tx": "^1.0.1", + "@types/mocha": "^5.2.6", + "@types/node": "^10.12.0", + "@types/seedrandom": "^2.4.28", + "@types/superagent": "^4.1.1", + "@types/uws": "^0.13.2", + "@types/ws": "^6.0.1", "bufferutil": "4.0.1", - "cross-env": "5.2.0", + "cross-env": "^5.2.0", "into-stream": "^5.1.0", "jsbi": "^2.0.5", "mocha": "^6.1.4", - "nyc": "^14.1.0", + "nyc": "^14.1.1", "source-map-support": "^0.5.12", - "superagent": "4.1.0", - "ts-node": "^8.0.3", - "tslint": "5.14.0", - "typescript": "3.4.1", - "utf-8-validate": "5.0.2", - "ws": "6.2.1" + "superagent": "5.0.5", + "ts-node": "^8.1.0", + "tslint": "^5.16.0", + "typescript": "^3.4.5", + "utf-8-validate": "^5.0.2", + "ws": "^7.0.0" }, "optionalDependencies": { "bigint-buffer": "1.1.2" From 8b3476bdbe4a69c98e6a023fb3e2c2d7bc8bb5ea Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:08:51 -0400 Subject: [PATCH 063/691] reenable the backpressure test --- test/server.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/test/server.ts b/test/server.ts index 5c1dbdedb0..324933ce66 100644 --- a/test/server.ts +++ b/test/server.ts @@ -434,22 +434,12 @@ describe("server", () => { }); }); - it.skip("can handle backpressure", async () => { + it("can handle backpressure", async () => { { // create tons of data to force websocket backpressure const huge = {} as any; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; s.provider.send = async () => huge; } - // { - // return await new Promise((resolve) => { - // const ws = new WebSocket('ws://localhost:8545'); - // ws.on("open", () => { - // ws.send(JSON.stringify(jsonRpcJson)); - // ws.close(); - // resolve(); - // }); - // }); - // } const ws = new WebSocket('ws://localhost:' + port); const oldLog = logger.log; From e29a45c492057152763b329ee10af24211c0f7b2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 14 May 2019 21:17:17 -0400 Subject: [PATCH 064/691] clean up some close logic --- npm-shrinkwrap.json | 12 +++++++++--- package.json | 2 +- src/ledgers/ethereum/database.ts | 11 +++++------ src/server.ts | 3 ++- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7d75dec804..b189dbb6e4 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -349,6 +349,11 @@ "safe-buffer": "^5.0.1" } }, + "bluebird": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz", + "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==" + }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", @@ -3326,10 +3331,11 @@ } }, "tmp-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-2.0.0.tgz", - "integrity": "sha512-kChVEhT3MTvFKrFEiKZEgDpIzUDj/EAsivMW/x0dFYPtymbLU0IkJeEJLHQ5UZfxacV3fi85NBqDDI4vT0QsYA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-1.1.0.tgz", + "integrity": "sha512-8+Ah9aB1IRXCnIOxXZ0uFozV1nMU5xiu7hhFVUSxZ3bYu+psD4TzagCzVbexUCgNNGJnsmNDQlS4nG3mTyoNkw==", "requires": { + "bluebird": "^3.5.0", "tmp": "0.1.0" } }, diff --git a/package.json b/package.json index 76a6a22b12..9796d3a700 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "merkle-patricia-tree": "3.0.0", "seedrandom": "3.0.1", "subleveldown": "4.0.0", - "tmp-promise": "2.0.0", + "tmp-promise": "1.1.0", "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.9.0" }, "devDependencies": { diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index a6b4343b4a..6074ace3e4 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -97,11 +97,10 @@ export default class Database extends Emittery{ } } private async cleanup(){ - const db = this.db; - if (db && db.isOpen()) { - // await new Promise(resolve => setTimeout(resolve, 1000)); - // await db.close(); - } - this._cleanup(); + // const db = this.db; + // if (db && db.isOpen()) { + // await db.close(); + // } + // this._cleanup(); } } diff --git a/src/server.ts b/src/server.ts index 06c41df853..3300973639 100644 --- a/src/server.ts +++ b/src/server.ts @@ -70,7 +70,7 @@ export default class Server { } } - close() { + async close() { const _listenSocket = this[listenSocket]; this.status = ConnectionStatus.closing; if (_listenSocket) { @@ -86,6 +86,7 @@ export default class Server { // and do all http cleanup, if any this[httpServer].close(); this.status = ConnectionStatus.closed; + await this.provider.close(); } } From 0b6d85762a31bf582ec23b31217301366acfc738 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:41:22 -0400 Subject: [PATCH 065/691] exlude tests from nyc --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9796d3a700..1937c33db8 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ ".ts" ], "exclude": [ - "**/*.d.ts" + "**/*.d.ts", + "test/**" ] }, "dependencies": { From 6a8e0695485a3fa60a5fd1fde9b7a250077e99bd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:41:37 -0400 Subject: [PATCH 066/691] stop accepting new requests while the provider is closing --- src/provider.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/provider.ts b/src/provider.ts index d67c5fbf6e..bbbacf8099 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -165,6 +165,13 @@ export default class Provider extends Emittery { } public async close() { - return this.emit("close"); + // wait for anything that subscribed to this close event (like the ledger) + // to finish before returning + + // stop accepting new requests + this[requestProcessor].pause(); + + await this.emit("close"); + return; } } From a4a6e43db7df1dc651d37622da1c4658a88ce2d7 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:42:01 -0400 Subject: [PATCH 067/691] rename `ConnectionStatus` to just `Status` --- src/server.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/server.ts b/src/server.ts index 3300973639..23841603d4 100644 --- a/src/server.ts +++ b/src/server.ts @@ -13,7 +13,7 @@ const app = Symbol("app"); const websocketServer = Symbol("websocketServer"); const httpServer = Symbol("httpServer"); -export enum ConnectionStatus { +export enum Status { // Flags open = 1, opening = 3, @@ -28,7 +28,7 @@ export default class Server { private [httpServer]: HttpServer; private [listenSocket]: us_listen_socket; private [websocketServer]: WebsocketServer; - public status = ConnectionStatus.closed; + public status = Status.closed; constructor(serverOptions?: ServerOptions) { const opts = this[options] = getDefaultServerOptions(serverOptions); @@ -44,20 +44,21 @@ export default class Server { async listen(port: number, callback?: (err: Error) => void): Promise { let err; - if (this.status & ConnectionStatus.open) { + // if open or opening + if (this.status & Status.open) { err = new Error(`Server is already listening on port: ${port}`); } else { - this.status = ConnectionStatus.opening; + this.status = Status.opening; const _listenSocket = await new Promise((resolve) => { this[app].listen(port, resolve); }); if (_listenSocket) { - this.status = ConnectionStatus.open; + this.status = Status.open; this[listenSocket] = _listenSocket; err = null; } else { - this.status = ConnectionStatus.closed; + this.status = Status.closed; err = new Error("Failed to listen on port: " + port); } } @@ -70,9 +71,9 @@ export default class Server { } } - async close() { + public async close() { const _listenSocket = this[listenSocket]; - this.status = ConnectionStatus.closing; + this.status = Status.closing; if (_listenSocket) { this[listenSocket] = undefined; // close the socket to prevent any more connections @@ -85,7 +86,7 @@ export default class Server { } // and do all http cleanup, if any this[httpServer].close(); - this.status = ConnectionStatus.closed; + this.status = Status.closed; await this.provider.close(); } } From aaff6dbb73a2243ee3bacc86ef01056b3795220d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:42:45 -0400 Subject: [PATCH 068/691] make sure we wait for the server teardown before starting the next test --- test/server.ts | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/test/server.ts b/test/server.ts index 324933ce66..2ba9b3c00d 100644 --- a/test/server.ts +++ b/test/server.ts @@ -48,7 +48,7 @@ describe("server", () => { try { await simpleTest(); } finally { - teardown(); + await teardown(); } }); @@ -60,7 +60,7 @@ describe("server", () => { try { await simpleTest(); } finally { - teardown(); + await teardown(); } done(); }); @@ -75,7 +75,7 @@ describe("server", () => { message: `Server is already listening on port: ${port}` }); } finally { - teardown(); + await teardown(); } }); @@ -88,7 +88,7 @@ describe("server", () => { message: `Failed to listen on port: ${port}` }); } finally { - teardown(); + await teardown(); await server.close(); } }); @@ -103,7 +103,7 @@ describe("server", () => { message: `Failed to listen on port: ${port}` }); } finally { - teardown(); + await teardown(); } }); @@ -118,7 +118,7 @@ describe("server", () => { message: "Unexpected server response: 400" }); } finally { - teardown(); + await teardown(); } }); @@ -148,7 +148,7 @@ describe("server", () => { readableStream.pipe(req as any); }); } finally { - teardown(); + await teardown(); } }); @@ -178,7 +178,7 @@ describe("server", () => { message: "Bad Request" }); } finally { - teardown(); + await teardown(); } }); @@ -189,7 +189,7 @@ describe("server", () => { assert.strictEqual(result.status, 418); assert.strictEqual(result.message, "I'm a Teapot"); } finally { - teardown(); + await teardown(); } }); @@ -204,7 +204,7 @@ describe("server", () => { }); await Promise.all(requests); } finally { - teardown(); + await teardown(); } }); @@ -243,7 +243,7 @@ describe("server", () => { await simpleTest(); } finally { - teardown(); + await teardown(); } }); @@ -257,7 +257,7 @@ describe("server", () => { code: "ECONNREFUSED" }); } finally { - teardown(); + await teardown(); } }); @@ -285,7 +285,7 @@ describe("server", () => { ); }); } finally { - teardown(); + await teardown(); } }); @@ -308,7 +308,7 @@ describe("server", () => { ); }); } finally { - teardown(); + await teardown(); } }); @@ -328,7 +328,7 @@ describe("server", () => { assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); assert.strictEqual(resp.header["access-control-allow-origin"], origin); } finally { - teardown(); + await teardown(); } }); @@ -346,7 +346,7 @@ describe("server", () => { assert.strictEqual(resp.status, 204); assert.strictEqual(resp.header["access-control-allow-headers"], acrh); } finally { - teardown(); + await teardown(); } }); }); @@ -421,7 +421,7 @@ describe("server", () => { // If we get a message that means things didn't get closed as they // should have OR they are closing too late for some reason and // this test isn't testing anything. - ws.on("message", () => reject("Got a message when we should have!")); + ws.on("message", () => reject("Got a message when we shouldn't have!")); // make sure we leave enough time for things to crash if it does end // up crashing. @@ -438,7 +438,9 @@ describe("server", () => { { // create tons of data to force websocket backpressure const huge = {} as any; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; - s.provider.send = async () => huge; + s.provider.send = async () => { + return huge + }; } const ws = new WebSocket('ws://localhost:' + port); From 461ac8e4c9a303bf78832a4027e03259257e0511 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:43:02 -0400 Subject: [PATCH 069/691] Formatting --- test/provider.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/provider.ts b/test/provider.ts index 6dc33e3938..d769a8f147 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -81,7 +81,8 @@ describe("provider", () => { const balance = await p.send("eth_getBalance", [accounts[0]]); // TODO: this value is actually wrong! assert.strictEqual(balance, "0x056bc75e2d63100000", "Heyo!"); - }) + }); + it.skip("sends a transaction", async () => { const accounts = await p.send("eth_accounts"); const to = accounts[accounts.length - 1]; @@ -107,8 +108,8 @@ describe("provider", () => { nonce: 0, gasPrice: 300 }]); - }); + it.skip("sends a transaction", async () => { const seedrandom = require("seedrandom"); const rand = seedrandom("sup"); @@ -140,15 +141,18 @@ describe("provider", () => { } } }); + it.skip("returns a transaction", async () => { var result = await p.send("eth_getTransactionByHash", ["0x123"]); const v = result.blockNumber; // todo: figure things out - }) + }); + it("returns things via EIP-1193", async () => { const version = await p.send("net_version"); assert.strictEqual(version, networkId); }); + it("returns things via legacy", async() => { await new Promise((resolve) => { const ret = p.send({ From eae3c152f6b16dd3d12791318c77e5f929b773d5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:43:34 -0400 Subject: [PATCH 070/691] Because we only allow `1` or `0` in our request processor let's just get rid of the strictness check --- src/utils/request-processor.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/utils/request-processor.ts b/src/utils/request-processor.ts index 3eb096d64b..44eb643146 100644 --- a/src/utils/request-processor.ts +++ b/src/utils/request-processor.ts @@ -20,21 +20,15 @@ export default class RequestProcessor { /** * Promise-based FIFO queue. * @param limit The number of requests that can be processed at a time. - * Default value is is no limit (via `null`). + * Default value is is no limit (`0`). */ - constructor(limit: number = null) { - if (limit !== null) { - if (!Number.isInteger(limit) || limit < 0 || limit > Number.MAX_SAFE_INTEGER) { - throw new RangeError("`limit` must be an integer and between 0 - Number.MAX_SAFE_INTEGER, inclusive.") - } - this.limit = limit; - } - + constructor(limit: number) { + this.limit = limit; this.process(); } /** - * Pause processing. This will *not* cancel or promises that are currently + * Pause processing. This will *not* cancel any promises that are currently * running. */ public pause() { From 756b4a9a9d8f7a0a14b531835463d5ee4ad978a6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:43:52 -0400 Subject: [PATCH 071/691] Whitespace fix --- src/types/tags.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/types/tags.ts b/src/types/tags.ts index 9fe32e1eba..dad438d946 100644 --- a/src/types/tags.ts +++ b/src/types/tags.ts @@ -6,7 +6,7 @@ enum Tag { enum _Tag { earliest, latest, - pending + pending } namespace Tag { @@ -15,11 +15,11 @@ namespace Tag { if (typeof tag === "string") { t = (Tag)[tag.toUpperCase()]; } else { - switch (tag) { + switch (tag) { case _Tag.earliest: return Tag.EARLIEST; case _Tag.latest: - return Tag.LATEST; + return Tag.LATEST; case _Tag.pending: return Tag.PENDING; } From a564676b425015c56b2749b8e12f3ae8d3b21cc2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:44:23 -0400 Subject: [PATCH 072/691] Fix database write/close race condition that could cause a segfault --- src/ledgers/ethereum/blockchain.ts | 312 ++++++++++++++++------------- src/ledgers/ethereum/database.ts | 47 +++-- src/ledgers/ethereum/ledger.ts | 6 +- 3 files changed, 201 insertions(+), 164 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 3ed55cc0da..99743b0001 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -15,157 +15,183 @@ import Transaction from "../../types/transaction"; const VM = require("ethereumjs-vm"); +export enum Status { + // Flags + started = 1, + starting = 3, + stopped = 4, + stopping = 12 +} + type BlockchainOptions = { - db?: string | object, - db_path?: string, - accounts?: Account[], - hardfork?: string, - allowUnlimitedContractSize?: boolean, - gasLimit?: Quantity, - timestamp?: Date + db?: string | object, + db_path?: string, + accounts?: Account[], + hardfork?: string, + allowUnlimitedContractSize?: boolean, + gasLimit?: Quantity, + timestamp?: Date }; export default class Blockchain extends Emittery { - public blocks: BlockManager; - public transactions: TransactionManager; - public accounts: AccountManager; - public vm: any; - public trie: Trie; - private readonly database: Database - - /** - * Initializes the underlying Database and handles synchronization between - * the ledger and the database. - * - * Emits a `ready` event once the database and - * all dependencies are fully initialized. - * @param options - */ - constructor(options: BlockchainOptions) { - super(); - - const database = this.database = new Database(options, this); - - database.on("ready", async () => { - // TODO: get the latest block from the database - // if we have a latest block, `root` will be that block's header.stateRoot - // and we will skip creating the genesis block alltogether - const root:any = null; - this.trie = new Trie(database.trie, root); - this.blocks = new BlockManager(this, database.blocks); - this.transactions = new TransactionManager(this, database.transactions, options); - this.accounts = new AccountManager(this); - - this._initializeVM(options.hardfork, options.allowUnlimitedContractSize); - - const miner = new Miner(this.vm, options); - - const instamining = true; - if (instamining) { - this.transactions.transactionPool.on("drain", async (pending: Map>) => { - await miner.mine(pending); - }); - } else { - const minerInterval = 3 * 1000; - const mine = async (pending: Map>) => { - await miner.mine(pending); - setTimeout(mine, minerInterval, pending); - }; - setTimeout(mine, minerInterval, this.transactions.transactionPool.executables); - } - - await this._initializeAccounts(options.accounts); - let lastBlock = this._initializeGenesisBlock(options.timestamp, options.gasLimit); - await lastBlock; - miner.on("block", async (blockData: any) => { - const previousBlock = await lastBlock; - const previousHeader = previousBlock.value.header; - const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; - const block = this.blocks.createBlock({ - number: Quantity.from(previousNumber + 1n).toBuffer(), - gasLimit: options.gasLimit.toBuffer(), - timestamp: this.currentTime(), - parentHash: previousHeader.hash(), - transactionsTrie: blockData.transactionsTrie.root, - receiptTrie: blockData.receiptTrie.root - }); - console.log( Quantity.from(block.value.header.number).toBigInt() ); - - lastBlock = this.blocks.set(block); - }); - - this.emit("ready"); + private state: Status = Status.starting; + public blocks: BlockManager; + public transactions: TransactionManager; + public accounts: AccountManager; + public vm: any; + public trie: Trie; + private readonly database: Database + + /** + * Initializes the underlying Database and handles synchronization between + * the ledger and the database. + * + * Emits a `ready` event once the database and + * all dependencies are fully initialized. + * @param options + */ + constructor(options: BlockchainOptions) { + super(); + + const database = this.database = new Database(options, this); + + database.on("ready", async () => { + // TODO: get the latest block from the database + // if we have a latest block, `root` will be that block's header.stateRoot + // and we will skip creating the genesis block alltogether + const root: Buffer = null; + this.trie = new Trie(database.trie, root); + this.blocks = new BlockManager(this, database.blocks); + this._initializeVM(options.hardfork, options.allowUnlimitedContractSize); + + const miner = new Miner(this.vm, options); + this.transactions = new TransactionManager(this, database.transactions, options); + this.accounts = new AccountManager(this); + + const instamining = true; + if (instamining) { + this.transactions.transactionPool.on("drain", async (pending: Map>) => { + await miner.mine(pending); }); - } - - _initializeVM(hardfork: string, allowUnlimitedContractSize: boolean) { - this.vm = new VM({ - state: this.trie, - activatePrecompiles: true, - hardfork, - allowUnlimitedContractSize, - blockchain: { - getBlock: async (number: BN, done: any) => { - const hash = await this.blockNumberToHash(number); - done(this.blocks.get(hash)); - } - } + } else { + const minerInterval = 3 * 1000; + const mine = async (pending: Map>) => { + await miner.mine(pending); + setTimeout(mine, minerInterval, pending); + }; + setTimeout(mine, minerInterval, this.transactions.transactionPool.executables); + } + + await this._initializeAccounts(options.accounts); + let lastBlock = this._initializeGenesisBlock(options.timestamp, options.gasLimit); + miner.on("block", async (blockData: any) => { + const previousBlock = await lastBlock; + const previousHeader = previousBlock.value.header; + const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; + const block = this.blocks.createBlock({ + number: Quantity.from(previousNumber + 1n).toBuffer(), + gasLimit: options.gasLimit.toBuffer(), + timestamp: this._currentTime(), + parentHash: previousHeader.hash(), + transactionsTrie: blockData.transactionsTrie.root, + receiptTrie: blockData.receiptTrie.root }); - this.vm.on("step", this.emit.bind(this, "step")); - } - - async _initializeAccounts(accounts: Account[]) : Promise{ - const stateManager = this.vm.stateManager; - const putAccount = promisify(stateManager.putAccount.bind(stateManager)); - const checkpoint = promisify(stateManager.checkpoint.bind(stateManager)) - const commit = promisify(stateManager.commit.bind(stateManager)) - await checkpoint(); - const l = accounts.length; - const pendingAccounts = Array(l); - for (let i = 0; i < l; i++) { - const account = accounts[i]; - const ethereumJsAccount = new EthereumJsAccount(); - ethereumJsAccount.nonce = account.nonce.toBuffer(), - ethereumJsAccount.balance = account.balance.toBuffer() - pendingAccounts[i] = putAccount(account.address.toBuffer(), ethereumJsAccount); + console.log(Quantity.from(block.value.header.number).toBigInt()); + + lastBlock = this.blocks.set(block); + }); + + await lastBlock; + this.state = Status.started; + this.emit("start"); + }); + } + + private _initializeVM(hardfork: string, allowUnlimitedContractSize: boolean) { + this.vm = new VM({ + state: this.trie, + activatePrecompiles: true, + hardfork, + allowUnlimitedContractSize, + blockchain: { + getBlock: async (number: BN, done: any) => { + const hash = await this._blockNumberToHash(number); + done(this.blocks.get(hash)); } - await Promise.all(pendingAccounts); - return commit(); - } - - async _initializeGenesisBlock(timestamp: Date, blockGasLimit: Quantity): Promise { - // create the genesis block - const genesis = this.blocks.next({ - // If we were given a timestamp, use it instead of the `currentTime` - timestamp: ((timestamp as any) / 1000 | 0) || this.currentTime(), - gasLimit: blockGasLimit.toBuffer(), - stateRoot: this.trie.root, - number: "0x0" - }); - - // store the genesis block in the database - return this.blocks.set(genesis); - } - - currentTime() { - // Take the floor of the current time - return (Date.now() / 1000) | 0; + } + }); + this.vm.on("step", this.emit.bind(this, "step")); + } + + private async _initializeAccounts(accounts: Account[]): Promise { + const stateManager = this.vm.stateManager; + const putAccount = promisify(stateManager.putAccount.bind(stateManager)); + const checkpoint = promisify(stateManager.checkpoint.bind(stateManager)) + const commit = promisify(stateManager.commit.bind(stateManager)) + await checkpoint(); + const l = accounts.length; + const pendingAccounts = Array(l); + for (let i = 0; i < l; i++) { + const account = accounts[i]; + const ethereumJsAccount = new EthereumJsAccount(); + ethereumJsAccount.nonce = account.nonce.toBuffer(), + ethereumJsAccount.balance = account.balance.toBuffer() + pendingAccounts[i] = putAccount(account.address.toBuffer(), ethereumJsAccount); } - - /** - * Given a block number, find it's hash in the database - * @param number - */ - blockNumberToHash(number: BN): Promise { - return number.toString() as any; - } - - async queueTransaction(transaction: any): Promise { - await this.transactions.push(transaction); - return Data.from(transaction.hash()); + await Promise.all(pendingAccounts); + return commit(); + } + + private async _initializeGenesisBlock(timestamp: Date, blockGasLimit: Quantity): Promise { + // create the genesis block + const genesis = this.blocks.next({ + // If we were given a timestamp, use it instead of the `_currentTime` + timestamp: ((timestamp as any) / 1000 | 0) || this._currentTime(), + gasLimit: blockGasLimit.toBuffer(), + stateRoot: this.trie.root, + number: "0x0" + }); + + // store the genesis block in the database + return this.blocks.set(genesis); + } + + private _currentTime() { + // Take the floor of the current time + return (Date.now() / 1000) | 0; + } + + /** + * Given a block number, find it's hash in the database + * @param number + */ + private _blockNumberToHash(number: BN): Promise { + return number.toString() as any; + } + + public async queueTransaction(transaction: any): Promise { + await this.transactions.push(transaction); + return Data.from(transaction.hash()); + } + + /** + * Gracefully shuts down the blockchain service and all of it's dependencies. + */ + public async stop() { + // If the blockchain is still initalizing we don't want to shut down + // yet because tehre may still be database calls in flight. Leveldb may + // cause a segfault due to a race condition between a db write and the close + // call. + if (this.state === Status.starting) { + await new Promise((resolve) => { + this.on("start", resolve); + }); } - - public async shutdown() { - return this.database.close(); + if (this.state === Status.started) { + this.state = Status.stopping; + await this.database.close(); + this.state = Status.stopped; } + this.emit("stop"); + } } diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index 6074ace3e4..ed300fd5f7 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -10,12 +10,12 @@ type DatabaseOptions = {db?: string | object, dbPath?: string}; const tmpOptions = {prefix: "ganache-core_", unsafeCleanup: true}; -const noop = (): void => {}; +const noop = (callback: () => void): void => callback(); -export default class Database extends Emittery{ +export default class Database extends Emittery { public readonly blockchain: Blockchain; private readonly options: DatabaseOptions; - private _cleanup = noop; + private _cleanupDirectory = noop; private closed = false; public directory: string = null; public db: levelup.LevelUp = null; @@ -30,7 +30,6 @@ export default class Database extends Emittery{ * The Database handles the creation of the database, and all access to it. * Once the database has been fully initialized it will emit a `ready` * event. - * Emit's a `close` event once complete. * @param options Supports one of two options: `db` (a leveldown compliant * store instance) or `dbPath` (the path to store/read the db instance) * @param blockchain @@ -53,10 +52,10 @@ export default class Database extends Emittery{ if (!directory) { const dirInfo = await dir(tmpOptions); directory = dirInfo.path; - this._cleanup = dirInfo.cleanup; + this._cleanupDirectory = dirInfo.cleanup; // don't continue if we closed while we were waiting for the dir - if (this.closed) return this.cleanup(); + if (this.closed) return this._cleanup(); } this.directory = directory; const store = encode(leveldown(directory), levelupOptions); @@ -64,7 +63,7 @@ export default class Database extends Emittery{ } // don't continue if we closed while we were waiting for the db - if (this.closed) return this.cleanup(); + if (this.closed) return this._cleanup(); const open = db.open(); this.trie = sub(db, "trie", levelupOptions); @@ -73,22 +72,23 @@ export default class Database extends Emittery{ await open; // don't continue if we closed while we were waiting for it to open - if (this.closed) return this.cleanup(); + if (this.closed) return this._cleanup(); this.blocks = sub(db, "blocks", levelupOptions); this.transactions = sub(db, "transactions", levelupOptions); - this.emit("ready"); + await this.emit("ready"); return; } /** - * Gracefully close the database and wait for it to fully shut down. - * Emit's a `close` event once complete. + * Gracefully closes the database and cleans up the file system and waits for + * it to fully shut down. Emit's a `close` event once complete. + * Note: only emits `close` once. */ public async close() { const wasClosed = this.closed; this.closed = true; - await this.cleanup(); + await this._cleanup(); // only emit `close` once if (!wasClosed) { @@ -96,11 +96,22 @@ export default class Database extends Emittery{ return; } } - private async cleanup(){ - // const db = this.db; - // if (db && db.isOpen()) { - // await db.close(); - // } - // this._cleanup(); + + /** + * Cleans up the database connections and our tmp directory. + */ + private async _cleanup(){ + const db = this.db; + if (db) { + await db.close(); + await Promise.all( + [ + this.blocks.close(), + this.transactions.close(), + this.trie.close() + ] + ); + } + return new Promise(resolve => this._cleanupDirectory(resolve)); } } diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 71014eb755..eaac868d61 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -121,9 +121,9 @@ export default class Ethereum implements ILedger { } //#endregion - const chain = this[_blockchain] = new Blockchain(options); - chain.on("ready", () => emitter.emit("ready")); - emitter.on("close", async () => chain.shutdown()); + const blockchain = this[_blockchain] = new Blockchain(options); + blockchain.on("start", () => emitter.emit("ready")); + emitter.on("close", async () => await blockchain.stop()); } /** From 66e8556ca2135fd05c1b29ad7d4281cc55913509 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:47:59 -0400 Subject: [PATCH 073/691] Only run CI tests on node 10 for now --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 32eba855c1..8333bc44da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: node_js node_js: - - "node" - - "lts/carbon" + - "lts/dubnium" addons: apt: From b5a59b464e657d0a0deea651fa325341cd1c95ab Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 15 May 2019 12:55:04 -0400 Subject: [PATCH 074/691] Remove some skipped tests that'd only prove RPC behavior --- test/provider.ts | 65 ------------------------------------------------ 1 file changed, 65 deletions(-) diff --git a/test/provider.ts b/test/provider.ts index d769a8f147..f1f0a058cf 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -83,71 +83,6 @@ describe("provider", () => { assert.strictEqual(balance, "0x056bc75e2d63100000", "Heyo!"); }); - it.skip("sends a transaction", async () => { - const accounts = await p.send("eth_accounts"); - const to = accounts[accounts.length - 1]; - - await p.send("eth_sendTransaction", [{ - from: accounts[0], - to: to, - value: 10_000, - nonce: 0, - gasPrice: 100 - }]); - await p.send("eth_sendTransaction", [{ - from: accounts[0], - to: to, - value: 20_000, - nonce: 0, - gasPrice: 200 - }]); - await p.send("eth_sendTransaction", [{ - from: accounts[2], - to: to, - value: 30_000, - nonce: 0, - gasPrice: 300 - }]); - }); - - it.skip("sends a transaction", async () => { - const seedrandom = require("seedrandom"); - const rand = seedrandom("sup"); - const accounts = await p.send("eth_accounts"); - - const nonces = [5, 3, 2, 1, 0]; - const to = accounts[accounts.length - 1]; - - - p.send("eth_sendTransaction", [{ - from: accounts[0], - to: to, - value: 10_000, - nonce: nonces[2], - gasPrice: (rand() * 100) | 0 - }]); - - // for every account (except the last one) - for (let j = 0; j < accounts.length - 6; j++) { - for (let i = 0; i < nonces.length; i++) { - // send transactions with our random nonces - await p.send("eth_sendTransaction", [{ - from: accounts[j], - to: to, - value: 10_000, - nonce: nonces[i], - gasPrice: (rand() * 100) | 0 - }]); - } - } - }); - - it.skip("returns a transaction", async () => { - var result = await p.send("eth_getTransactionByHash", ["0x123"]); - const v = result.blockNumber; - // todo: figure things out - }); - it("returns things via EIP-1193", async () => { const version = await p.send("net_version"); assert.strictEqual(version, networkId); From f0fe35a8203adfdf6bbe38c93c7ba557908aa53d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Jun 2019 10:29:22 -0400 Subject: [PATCH 075/691] remove random whitespace --- src/engine.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/engine.ts b/src/engine.ts index f0cbdd59e0..5abb69a56a 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -10,7 +10,6 @@ export default class Engine extends Emittery { */ constructor(ledger: ILedger) { super(); - this._ledger = ledger; } From c2670be5e6c2951af269bba36b37535f3813407c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 19 Jul 2019 18:37:27 -0400 Subject: [PATCH 076/691] Maintenance: Just keeping things updated --- npm-shrinkwrap.json | 10 ++--- package.json | 2 +- src/ledgers/ethereum/blockchain.ts | 33 +++++++++----- .../ethereum/components/account-manager.ts | 6 +-- .../ethereum/components/block-manager.ts | 2 +- src/ledgers/ethereum/database.ts | 5 ++- src/ledgers/ethereum/ledger.ts | 44 ++++++++++++++----- src/ledgers/ethereum/miner.ts | 18 ++++---- src/options/provider-options.ts | 2 +- src/provider.ts | 2 +- src/server.ts | 5 ++- src/servers/http-server.ts | 14 +++--- test/server.ts | 4 +- test/temp-tests.ts | 11 ++++- typings/uWebsockets.js.ts | 11 ++++- 15 files changed, 115 insertions(+), 54 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b189dbb6e4..14f79cfddf 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2166,9 +2166,9 @@ } }, "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==" }, "lodash.flattendeep": { "version": "4.4.0", @@ -3407,8 +3407,8 @@ "dev": true }, "uWebSockets.js": { - "version": "github:uNetworking/uWebSockets.js#32749187bfefb94de69f1aa5a8275647c7ccf3aa", - "from": "github:uNetworking/uWebSockets.js#v15.9.0" + "version": "github:uNetworking/uWebSockets.js#e7552889a50a7ffa654c41c99a9bad46dd0024c5", + "from": "github:uNetworking/uWebSockets.js#v15.11.0" }, "uglify-js": { "version": "3.5.12", diff --git a/package.json b/package.json index 1937c33db8..3b22bdbe2c 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "seedrandom": "3.0.1", "subleveldown": "4.0.0", "tmp-promise": "1.1.0", - "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.9.0" + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.11.0" }, "devDependencies": { "@types/ethereumjs-tx": "^1.0.1", diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 99743b0001..d0ca504143 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -62,7 +62,7 @@ export default class Blockchain extends Emittery { const root: Buffer = null; this.trie = new Trie(database.trie, root); this.blocks = new BlockManager(this, database.blocks); - this._initializeVM(options.hardfork, options.allowUnlimitedContractSize); + this.vm = this.createVmFromStateTrie(this.trie, options.hardfork, options.allowUnlimitedContractSize); const miner = new Miner(this.vm, options); this.transactions = new TransactionManager(this, database.transactions, options); @@ -83,7 +83,7 @@ export default class Blockchain extends Emittery { } await this._initializeAccounts(options.accounts); - let lastBlock = this._initializeGenesisBlock(options.timestamp, options.gasLimit); + let lastBlock = this._initializeGenesisBlock(options.timestamp, options.gasLimit);; miner.on("block", async (blockData: any) => { const previousBlock = await lastBlock; const previousHeader = previousBlock.value.header; @@ -98,18 +98,19 @@ export default class Blockchain extends Emittery { }); console.log(Quantity.from(block.value.header.number).toBigInt()); + this.blocks.latest = block; lastBlock = this.blocks.set(block); }); - await lastBlock; + this.blocks.earliest = this.blocks.latest = await lastBlock; this.state = Status.started; this.emit("start"); }); } - private _initializeVM(hardfork: string, allowUnlimitedContractSize: boolean) { - this.vm = new VM({ - state: this.trie, + private createVmFromStateTrie(stateTrie: Trie, hardfork: string, allowUnlimitedContractSize: boolean): any { + const vm = new VM({ + state: stateTrie, activatePrecompiles: true, hardfork, allowUnlimitedContractSize, @@ -120,7 +121,8 @@ export default class Blockchain extends Emittery { } } }); - this.vm.on("step", this.emit.bind(this, "step")); + vm.on("step", this.emit.bind(this, "step")); + return vm; } private async _initializeAccounts(accounts: Account[]): Promise { @@ -162,7 +164,7 @@ export default class Blockchain extends Emittery { } /** - * Given a block number, find it's hash in the database + * Given a block number, find its hash in the database * @param number */ private _blockNumberToHash(number: BN): Promise { @@ -174,12 +176,23 @@ export default class Blockchain extends Emittery { return Data.from(transaction.hash()); } + public async simulateTransaction(transaction: any, parentBlock: Block, block: Block): Promise { + // TODO: this is basically pseudo code: + const vm = this.vm.copy(); + const stateManager = vm.stateManager; + await promisify(stateManager.setStateRoot.bind(stateManager))(parentBlock.value.header.stateRoot); + transaction.block = block; + transaction.caller = transaction.from; + const result = await promisify(vm.runCall.bind(vm))(transaction); + return result.vm.returnValue || "0x"; + } + /** - * Gracefully shuts down the blockchain service and all of it's dependencies. + * Gracefully shuts down the blockchain service and all of its dependencies. */ public async stop() { // If the blockchain is still initalizing we don't want to shut down - // yet because tehre may still be database calls in flight. Leveldb may + // yet because there may still be database calls in flight. Leveldb may // cause a segfault due to a race condition between a db write and the close // call. if (this.state === Status.starting) { diff --git a/src/ledgers/ethereum/components/account-manager.ts b/src/ledgers/ethereum/components/account-manager.ts index 4e399cef69..827dcb666a 100644 --- a/src/ledgers/ethereum/components/account-manager.ts +++ b/src/ledgers/ethereum/components/account-manager.ts @@ -2,17 +2,17 @@ import Account from "../../../types/account"; import Address from "../../../types/address"; import Trie from "merkle-patricia-tree/baseTrie"; import Blockchain from "../blockchain"; +import Tag from "../../../types/tags"; export default class AccountManager { - private blockchain: Blockchain; constructor(blockchain: Blockchain) { this.blockchain = blockchain; } - public async get(address: Address, blockTag: string = "latest"): Promise { + public async get(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { const blockchain = this.blockchain; - const block = await blockchain.blocks.get(Buffer.from([0])); + const block = await blockchain.blocks.get(blockNumber); const trieCopy = new Trie((blockchain as any).database.trie, block.value.header.stateRoot); return new Promise((resolve, reject) => { trieCopy.get(address.toBuffer(), (err, data)=>{ diff --git a/src/ledgers/ethereum/components/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts index 006523ec1f..dcbccd90bb 100644 --- a/src/ledgers/ethereum/components/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -59,7 +59,7 @@ export default class BlockManager extends Manager { return this.latest; case undefined: case null: - // the key is probably a hex string, let nature takes it's course. + // the key is probably a hex string, let nature takes its course. break; case Tag.PENDING: return this.pending; diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index ed300fd5f7..e17d745e84 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -26,6 +26,7 @@ export default class Database extends Emittery { public transactionReceipts: levelup.LevelUp; public trie: levelup.LevelUp; public readonly initialized: boolean; + /** * The Database handles the creation of the database, and all access to it. * Once the database has been fully initialized it will emit a `ready` @@ -41,6 +42,7 @@ export default class Database extends Emittery { this.blockchain = blockchain; this._initialize(); } + private async _initialize() { const levelupOptions: any = { valueEncoding: "binary" }; const store = this.options.db; @@ -80,9 +82,10 @@ export default class Database extends Emittery { await this.emit("ready"); return; } + /** * Gracefully closes the database and cleans up the file system and waits for - * it to fully shut down. Emit's a `close` event once complete. + * it to fully shut down. Emits a `close` event once complete. * Note: only emits `close` once. */ public async close() { diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index eaac868d61..817b1e5daf 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -7,6 +7,7 @@ import Tag from "../../types/tags"; import Address, { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import Account from "../../types/account"; +import { Block } from "./components/block-manager"; const { toChecksumAddress } = require("ethereumjs-util"); const createKeccakHash = require("keccak"); @@ -238,6 +239,15 @@ export default class Ethereum implements ILedger { return latest.then((block: any) => BigInt(block.value.header.number)); } + /** + * Returns the currently configured chain id, a value used in + * replay-protected transaction signing as introduced by EIP-155. + * @returns big integer of the current chain id. Defaults are mainnet=61, morden=62, custom=1337. + */ + async eth_chainId(): Promise { + return 1337n; + } + /** * Returns the balance of the account of given address. * @param address 20 Bytes - address to check for balance. @@ -246,15 +256,10 @@ export default class Ethereum implements ILedger { */ async eth_getBalance( address: IndexableAddress, - blockNumber: bigint | Tag = Tag.LATEST + blockNumber: Buffer | Tag = Tag.LATEST ): Promise { const chain = this[_blockchain]; - const str = blockNumber.toString(); - const block = await chain.blocks.get(Buffer.from([0])); - //const block = await chain.blocks.get(str); - const account = await chain.accounts.get(Address.from(address)); - //const account = await block.accounts.get(address); - //return account.balance; + const account = await chain.accounts.get(Address.from(address), blockNumber); return account.balance; } @@ -272,8 +277,9 @@ export default class Ethereum implements ILedger { } /** - * + * Creates new message call transaction or a contract creation, if the data field contains code. * @param transaction + * @returns The transaction hash */ async eth_sendTransaction(transaction: any): Promise { let fromString = transaction.from; @@ -338,13 +344,29 @@ export default class Ethereum implements ILedger { } /** - * + * Creates new message call transaction or a contract creation for signed transactions. * @param transaction + * @returns The transaction hash */ async eth_sendRawTransaction(transaction: any): Promise { - await this[_blockchain].queueTransaction(transaction); - return transaction.hash; + return await this[_blockchain].queueTransaction(transaction); } + async eth_call(transaction: any, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + const blocks = this[_blockchain].blocks; + const block = await blocks.get(blockNumber); + const blockCopy = blocks.createBlock(block.value.header); + const currentNumber = Quantity.from(blockCopy.value.header.number).toBigInt() || 0n; + let parentBlock: Block; + if (currentNumber > 0n) { + const previousBlockNumber = Quantity.from(currentNumber - 1n); + parentBlock = await blocks.get(previousBlockNumber.toBuffer()); + } else { + parentBlock = blockCopy; + } + return this[_blockchain].simulateTransaction(transaction, parentBlock, blockCopy); + } + + readonly [index: string]: (...args: any) => Promise<{}>; } diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index c2d1de8cae..f400f8579b 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -1,4 +1,3 @@ -import { Block } from "../../ledgers/ethereum/components/block-manager" import params from "../../types/params"; import Heap from "../../utils/heap"; import Transaction from "../../types/transaction"; @@ -39,7 +38,7 @@ export default class Miner extends Emittery { private pending: Map>; private _isMining: boolean = false; private readonly options: MinerOptions; - private readonly vm: any + private readonly vm: any; private readonly _runTx: ({ tx: { } }) => Promise; private readonly _checkpoint: () => Promise; private readonly _commit: () => Promise; @@ -115,6 +114,8 @@ export default class Miner extends Emittery { const origin = Data.from(best.from).toString(); const pendingFromOrigin = pending.get(origin); + // TODO: construct a Block (outside this while loop) + // and use it in these runArgs: const runArgs = { tx: best }; @@ -150,7 +151,6 @@ export default class Miner extends Emittery { const resultVm = result.vm; const txLogs = resultVm.logs || []; - // result.vm.exception is flipped so 1=0 and 0=1. :facepalm: const status = resultVm.exception ? 1 : 0; const bitVector = result.bloom.bitvector; const rawReceipt = [ @@ -186,7 +186,7 @@ export default class Miner extends Emittery { } await Promise.all([promises, this._commit()]); - // put the rejected transactions back in their original origin heaps + // TODO: put the rejected transactions back in their original origin heaps rejectedTransactions.forEach(transaction => { // TODO: this transaction should probably be validated again...? console.log(transaction); @@ -198,7 +198,7 @@ export default class Miner extends Emittery { receiptTrie }); - // reset the miner + // reset the miner (tis sets _isMining back to false) this.reset(); if (this.pending) { @@ -235,16 +235,16 @@ export default class Miner extends Emittery { // Note: the `pending` Map passed here is "live", meaning it is constantly // being updated by the `transactionPool`. This allows us to begin // processing a block with the _current_ pending transactions, and while - // that is processing, to receive new transactions - // updated out `priced` heap with new pending transactions + // that is processing, to receive new transactions, updating our `priced` + // heap with these new pending transactions. for (let mapping of pending) { const heap = mapping[1]; const next = heap.peek(); if (next) { const price = Quantity.from(next.gasPrice).toBigInt(); if (this.currentlyExecutingPrice < price) { - // don't insert a tranaction into the miner's `priced` heap - // if it will be better than it's last + // don't insert a transaction into the miner's `priced` heap + // if it will be better than its last continue; } const origin = Data.from(next.from).toString(); diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index dbcf42355b..0e63751309 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -45,7 +45,7 @@ export const getDefault : (options: ProviderOptions) => ProviderOptions = (optio if (!seed) { // do this so that we can use the same seed on our next run and get the same // results without explicitly setting a seed up front. - // Use the alea PRNG for it's extra speed. + // Use the alea PRNG for its extra speed. rng = seedrandom.alea as seedrandom_prng; seed = _options.seed = randomAlphaNumericString(10, rng()); } else { diff --git a/src/provider.ts b/src/provider.ts index bbbacf8099..be6be30917 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -52,7 +52,7 @@ export default class Provider extends Emittery { } // TODO: this doesn't seem like a provider-level function. Maybe we should - // move this into the Ledger or it's Blockchain? + // move this into the Ledger or its Blockchain? private initializeAccounts(): Account[]{ const _providerOptions = this[options]; const etherInWei = Quantity.from(Quantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); diff --git a/src/server.ts b/src/server.ts index 23841603d4..f60921e326 100644 --- a/src/server.ts +++ b/src/server.ts @@ -50,7 +50,10 @@ export default class Server { } else { this.status = Status.opening; const _listenSocket = await new Promise((resolve) => { - this[app].listen(port, resolve); + // Make sure we have *exclusive* use of this port. + // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 + const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; + this[app].listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); }); if (_listenSocket) { diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 7a6a78959e..8a44e52429 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -66,12 +66,14 @@ function prepareCORSResponseHeaders(method: string, request: HttpRequest) { function sendResponse(response: HttpResponse, statusCode: number, contentType?: RecognizedString, data?: RecognizedString, writeHeaders: (response: HttpResponse) => void = noop): void { - response.writeStatus(statusCode.toString()); - writeHeaders(response); - if (contentType) { - response.writeHeader("Content-Type", contentType); - } - response.end(data) + response.experimental_cork(()=>{ + response.writeStatus(statusCode.toString()); + writeHeaders(response); + if (contentType) { + response.writeHeader("Content-Type", contentType); + } + response.end(data); + }); } export default class HttpServer { diff --git a/test/server.ts b/test/server.ts index 2ba9b3c00d..24cf7668d2 100644 --- a/test/server.ts +++ b/test/server.ts @@ -94,7 +94,7 @@ describe("server", () => { }); // TODO: un-skip this test once uWebsockets is updated to include seese's fix - it.skip("fails to listen if the socket is already in use by Ganache", async () => { + it("fails to listen if the socket is already in use by Ganache", async () => { await setup(); const s2 = Ganache.server(); @@ -102,6 +102,8 @@ describe("server", () => { await assert.rejects(s2.listen(port), { message: `Failed to listen on port: ${port}` }); + } catch(e) { + console.log(e); } finally { await teardown(); } diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 20ff0433ac..d700b665d4 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -18,7 +18,7 @@ describe("Accounts", () => { assert.strictEqual(accounts[0], expectedAddress); }); - it("should create it's own mnemonic", async() => { + it("should create its own mnemonic", async() => { const p = Ganache.provider(); const options = (p as any)[Object.getOwnPropertySymbols(p)[0] as any]; assert.deepStrictEqual(typeof options.mnemonic, "string"); @@ -44,4 +44,13 @@ describe("Accounts", () => { const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts.length, 2); }); + + it("runs eth_call", async () => { + const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); + const p = Ganache.provider({ + accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] + }); + const accounts = await p.send("eth_accounts"); + const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); + }); }); \ No newline at end of file diff --git a/typings/uWebsockets.js.ts b/typings/uWebsockets.js.ts index 9952e2a07e..457bf0bdb7 100644 --- a/typings/uWebsockets.js.ts +++ b/typings/uWebsockets.js.ts @@ -1,9 +1,16 @@ import "uWebSockets.js" -// uWebSockets.js doesn't haveinclude these in it's TS def file. - +enum ListenOptions { + LIBUS_LISTEN_DEFAULT = 0, + LIBUS_LISTEN_EXCLUSIVE_PORT = 1 +} +// uWebSockets.js doesn't include these in its TS def file. declare module "uWebSockets.js" { export const DISABLED:number; export const SHARED_COMPRESSOR:number; export const DEDICATED_COMPRESSOR:number; + + export interface TemplatedApp { + listen(port: number, options: ListenOptions, cb: (listenSocket: any) => void): TemplatedApp; + } } From 53f0af0068a4f813fac5c37aaf01c367589e2f51 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 19 Jul 2019 18:45:16 -0400 Subject: [PATCH 077/691] update comment --- src/ledgers/ethereum/blockchain.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index d0ca504143..7e4509742e 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -177,7 +177,7 @@ export default class Blockchain extends Emittery { } public async simulateTransaction(transaction: any, parentBlock: Block, block: Block): Promise { - // TODO: this is basically pseudo code: + // TODO: this is just a prototype implementation const vm = this.vm.copy(); const stateManager = vm.stateManager; await promisify(stateManager.setStateRoot.bind(stateManager))(parentBlock.value.header.stateRoot); From 6e11e18d3a1be0fb8ddcf076d466a6a6ca2f3345 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 19 Jul 2019 18:45:26 -0400 Subject: [PATCH 078/691] Line length fix --- src/ledgers/ethereum/miner.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index f400f8579b..e61334f424 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -13,13 +13,11 @@ function replaceFromHeap(priced: Heap, source: Heap, p // get the next best for this account, removing from the source Heap: const next = source.shift(); if (next) { - // remove the current best priced transaction from this - // account and replace it with the account's next lowest - // nonce transaction: + // remove the current best priced transaction from this account and replace + // replace it with the account's next lowest nonce transaction: priced.replaceBest(next); } else { - // since we don't have a next, just remove this item from - // priced + // since we don't have a next, just remove this item from priced priced.removeBest(); } } From 980e996fbc7779dd09970871b3eeb3ca6920aae6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Jul 2019 19:09:12 -0400 Subject: [PATCH 079/691] Account nonces start at 0. --- src/ledgers/ethereum/ledger.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 817b1e5daf..d20135b177 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -332,9 +332,9 @@ export default class Ethereum implements ILedger { if (isKnownAccount) { if (tx.nonce.length === 0) { + // TODO: check pending transactions and get the nonce from there const account = await this[_blockchain].accounts.get(from); - const accountNonce = (account.nonce.toBigInt()) || 0n; - tx.nonce = Quantity.from(1n + accountNonce).toBuffer(); + tx.nonce = account.nonce.toBuffer(); } const secretKey = this[_knownAccounts].get(fromString); tx.sign(secretKey.toBuffer()); From 419016636c5654caa387c4770010f6ff6ac11509 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Jul 2019 19:09:52 -0400 Subject: [PATCH 080/691] Update to `Quantity` for v, r, s --- src/types/transaction.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/types/transaction.ts b/src/types/transaction.ts index d9538a9ade..2695bbae83 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -258,6 +258,12 @@ function initData(tx: any, data: any) { } export default class Transaction extends EthereumJsTransaction { + type: number; + v: number; + r: number; + s: number; + raw: any; + _chainId: any; /** * @param {Object} [data] The data for this Transaction. * @param {Number} type The `Transaction.types` bit flag for this transaction @@ -374,9 +380,9 @@ export default class Transaction extends EthereumJsTransaction { gas: Quantity.from(this.gasLimit).toString(), gasPrice: Quantity.from(this.gasPrice).toString(), data: this.data ? this.data.toString("hex") : null, - v: Data.from(this.v).toString(), - r: Data.from(this.r).toString(), - s: Data.from(this.s).toString(), + v: Quantity.from(this.v).toString(), + r: Quantity.from(this.r).toString(), + s: Quantity.from(this.s).toString(), _type: this.type }; return resultJSON; @@ -446,9 +452,9 @@ export default class Transaction extends EthereumJsTransaction { gas: Quantity.from(this.gasLimit).toString(), gasPrice: Quantity.from(this.gasPrice).toString(), input: Data.from(this.data).toString(), // TODO: this output format probably needs the 0x stripped. - v: Data.from(this.v).toString(), - r: Data.from(this.r).toString(), - s: Data.from(this.s).toString() + v: Quantity.from(this.v).toString(), + r: Quantity.from(this.r).toString(), + s: Quantity.from(this.s).toString() }; return resultJSON; From b896e263474b908841ebc01e625a357b27672621 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Jul 2019 19:10:28 -0400 Subject: [PATCH 081/691] Again, nonces start at 0 --- src/ledgers/ethereum/components/transaction-pool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index c3558f7cb2..7151615ef5 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -115,7 +115,7 @@ export default class TransactionPool extends Emittery { // If the transaction wasn't found in our origin's executables queue, // check if it is at the correct `nonce` by looking up the origin's // current nonce - const transactorNextNonce = (transactor.nonce.toBigInt() || 0n) + 1n; + const transactorNextNonce = transactor.nonce.toBigInt() || 0n; isExecutableTransaction = transactorNextNonce === transactionNonce; } From 2b0c6c07bb6a666e643259e37194407e746b57e6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Jul 2019 19:11:05 -0400 Subject: [PATCH 082/691] More transaction work --- src/ledgers/ethereum/blockchain.ts | 33 +++++++++-- src/ledgers/ethereum/miner.ts | 93 +++++++++++++++++++----------- src/types/transaction.ts | 35 +++++++++++ 3 files changed, 121 insertions(+), 40 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 7e4509742e..80316d7452 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -68,34 +68,55 @@ export default class Blockchain extends Emittery { this.transactions = new TransactionManager(this, database.transactions, options); this.accounts = new AccountManager(this); + await this._initializeAccounts(options.accounts); + let lastBlock = this._initializeGenesisBlock(options.timestamp, options.gasLimit); + + const readyNextBlock = async () => { + const previousBlock = await lastBlock; + const previousHeader = previousBlock.value.header; + const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; + return this.blocks.createBlock({ + number: Quantity.from(previousNumber + 1n).toBuffer(), + gasLimit: options.gasLimit.toBuffer(), + timestamp: this._currentTime(), + parentHash: previousHeader.hash(), + }); + } const instamining = true; if (instamining) { this.transactions.transactionPool.on("drain", async (pending: Map>) => { - await miner.mine(pending); + const block = await readyNextBlock(); + await miner.mine(pending, block.value); }); } else { + // TODO: the interval needs to be from the `options` const minerInterval = 3 * 1000; const mine = async (pending: Map>) => { - await miner.mine(pending); + const block = await readyNextBlock(); + await miner.mine(pending, block.value); setTimeout(mine, minerInterval, pending); }; setTimeout(mine, minerInterval, this.transactions.transactionPool.executables); } - await this._initializeAccounts(options.accounts); - let lastBlock = this._initializeGenesisBlock(options.timestamp, options.gasLimit);; + miner.on("block", async (blockData: any) => { const previousBlock = await lastBlock; const previousHeader = previousBlock.value.header; const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; const block = this.blocks.createBlock({ + parentHash: previousHeader.hash(), number: Quantity.from(previousNumber + 1n).toBuffer(), - gasLimit: options.gasLimit.toBuffer(), + // coinbase: timestamp: this._currentTime(), - parentHash: previousHeader.hash(), + // difficulty: + gasLimit: options.gasLimit.toBuffer(), transactionsTrie: blockData.transactionsTrie.root, receiptTrie: blockData.receiptTrie.root }); + // TODO: save the transactions, et al, too + // blockData.blockTransactions + console.log(Quantity.from(block.value.header.number).toBigInt()); this.blocks.latest = block; diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index e61334f424..143bbcd547 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -6,6 +6,7 @@ import { promisify } from "util"; import Trie from "merkle-patricia-tree"; import { rlp } from "ethereumjs-util"; import Emittery = require("emittery"); +import Block from "ethereumjs-block"; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); @@ -67,7 +68,7 @@ export default class Miner extends Emittery { * transactions within a single block. The remaining items will be left in * the pending pool to be eligible for mining in the future. */ - public async mine(pending: Map>) { + public async mine(pending: Map>, block: Block) { // only allow mining a single block at a time (per miner) if (this._isMining) { // if we are currently mining a block, set the `pending` property @@ -89,16 +90,25 @@ export default class Miner extends Emittery { const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); const promises: Promise[] = []; + const receipts: any[] = []; await this._checkpoint(); const priced = this.priced; const rejectedTransactions: Transaction[] = []; - let best: Transaction; + const blockData = { + blockTransactions, + transactionsTrie, + receiptTrie, + gasUsed: 0n, + receipts + }; + // Run until we run out of items, or until the inner loop stops us. // we don't call `shift()` here because we will will probably need to - // `replace`this top transaction with the next top transaction from the same + // `replace` this top transaction with the next top transaction from the same // origin. + let best: Transaction; while (best = priced.peek()) { // if the current best transaction can't possibly fit in this block // go ahead and run the next best transaction, ignoring all other @@ -109,18 +119,21 @@ export default class Miner extends Emittery { continue; } + // TODO: get a real block + const blockHeader = block.header; + const blockBloom = blockHeader.bloom; + const origin = Data.from(best.from).toString(); const pendingFromOrigin = pending.get(origin); - // TODO: construct a Block (outside this while loop) - // and use it in these runArgs: + this.currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); + const runArgs = { - tx: best + tx: best, + block }; - this.currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); await this._checkpoint(); const result = await this._runTx(runArgs).catch((err: Error) => ({ err })); - // await new Promise((resolve)=>setTimeout(resolve, 2000)); if (result.err) { await this._revert(); const errorMessage = result.err.message; @@ -141,30 +154,29 @@ export default class Miner extends Emittery { } continue; } - await this._commit(); const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); if (blockGasLeft >= gasUsed) { + await this._commit(); + blockGasLeft -= gasUsed; + blockData.gasUsed += gasUsed; - const resultVm = result.vm; - const txLogs = resultVm.logs || []; - const status = resultVm.exception ? 1 : 0; - const bitVector = result.bloom.bitvector; - const rawReceipt = [ - status, - result.gasUsed.toBuffer(), - bitVector, - txLogs - ]; - const rcptBuffer = rlp.encode(rawReceipt); - const key = rlp.encode(counter++); - promises.push(putInTrie(transactionsTrie, key, best.serialize())); - promises.push(putInTrie(receiptTrie, key, rcptBuffer)); + // calculate receipts and tries + const receipt = best.generateReceipt(result, block, counter); + const txKey = rlp.encode(counter); + promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); + promises.push(putInTrie(receiptTrie, txKey, receipt.raw)); + receipts.push(receipt); - // remove the current (`best`) item from the live pending queue as we - // now know it will fit in the block. - blockTransactions.push(best); + // update the block's bloom + const bloom = receipt.logsBloom; + for (let i = 0; i < 256; i++) { + blockBloom[i] |= bloom[i]; + } + + block.transactions[counter] = best as any; + counter++ // if we don't have enough gas left for even the smallest of // transactions we're done @@ -172,9 +184,13 @@ export default class Miner extends Emittery { break; } + // remove the current (`best`) item from the live pending queue as we + // now know it will fit in the block. // update `priced` with the next best for this account: replaceFromHeap(priced, pendingFromOrigin, pending, origin); } else { + await this._revert(); + // didn't fit. remove it from the priced transactions without replacing // it with another from the account. This transaction will have to be // run again in the next block. @@ -189,18 +205,27 @@ export default class Miner extends Emittery { // TODO: this transaction should probably be validated again...? console.log(transaction); }); + + this.emit("block", blockData); - this.emit("block", { - blockTransactions, - transactionsTrie, - receiptTrie - }); - - // reset the miner (tis sets _isMining back to false) + // reset the miner (this sets _isMining back to false) this.reset(); if (this.pending) { - this.mine(this.pending); + // TODO: hm... tricky... we know we need to mine a new block + // but at what timestamp. We need to get the timestamp from `blockchain`, but so far, + // we don't require the miner to know about the blockchain. + // also, what if the previous block was mined with a timestamp, do we need to mine two blocks with that + // same timestamp? uh, I think not. + const nextBlock = new Block({ + parentHash: block.header.hash, + number: Quantity.from(Quantity.from(block.header.number).toBigInt() + 1n).toBuffer(), + coinbase: block.header.coinbase, + timestamp: block.header.timestamp, + difficulty: block.header.difficulty, + gasLimit: block.header.gasLimit, + } as any); + this.mine(this.pending, nextBlock); this.pending = null; } } diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 2695bbae83..d3f36e1772 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -505,4 +505,39 @@ export default class Transaction extends EthereumJsTransaction { // create hash return ethUtil.rlphash(items); } + + generateReceipt = (result: any, block: any, transactionIndex: number) => { + const status = result.vm.exception; + const bitvector = result.bloom.bitvector; + const gasUsed = result.gasUsed; + const logs = result.vm.logs; + const rawReceipt = rlp.encode([ + status, + gasUsed, + bitvector, + logs + ]); + return { + transactionHash: this.hash(), + transactionIndex: transactionIndex, + blockHash: null as Buffer, + blockNumber: block.header.number, + from: this.from, + to: this.to, + gasUsed: gasUsed, + cumulativeGasUsed: block.gasUsed, + contractAddress: result.createdAddress, + logs: result.vm.logs, + status: result.vm.exception, + logsBloom: bitvector, + v: this.v, + r: this.r, + s: this.s, + toJSON: (blockHash: Buffer) => { + // TODO: make this return this things + return {}; + }, + raw: rawReceipt + } + } }; From 2bab9e7d092638227231c14e26d67d6a65cc8e35 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Jul 2019 19:11:30 -0400 Subject: [PATCH 083/691] Add some basic temp tests --- npm-shrinkwrap.json | 285 ++++++++++++++++++++++++++++++++++ package.json | 1 + test/contracts/helloWorld.sol | 16 ++ test/temp-tests.ts | 59 +++++++ 4 files changed, 361 insertions(+) create mode 100644 test/contracts/helloWorld.sol diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 14f79cfddf..d7d0371a70 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -576,6 +576,12 @@ "delayed-stream": "~1.0.0" } }, + "command-exists": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz", + "integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==", + "dev": true + }, "commander": { "version": "2.20.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", @@ -1431,6 +1437,19 @@ "readable-stream": "^2.0.0" } }, + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1848,6 +1867,15 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, "keccak": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.0.0.tgz", @@ -1868,6 +1896,15 @@ "sha3": "^1.2.2" } }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", @@ -2265,6 +2302,12 @@ "safe-buffer": "~5.1.1" } }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, "merge-source-map": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", @@ -2681,6 +2724,12 @@ "mem": "^4.0.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -2916,6 +2965,12 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -3073,6 +3128,236 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "solc": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.5.10.tgz", + "integrity": "sha512-Stdrh/MDkopsXYPRzPehTNYuV80Grr2CnQMuFvWj+EeRVbe3piGHxW47KebWn1sGdmK8FLaMfUehccqJP0KovQ==", + "dev": true, + "requires": { + "command-exists": "^1.2.8", + "fs-extra": "^0.30.0", + "keccak": "^1.0.2", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33", + "yargs": "^11.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "dev": true, + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", diff --git a/package.json b/package.json index 3b22bdbe2c..f8ca405df2 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "jsbi": "^2.0.5", "mocha": "^6.1.4", "nyc": "^14.1.1", + "solc": "0.5.10", "source-map-support": "^0.5.12", "superagent": "5.0.5", "ts-node": "^8.1.0", diff --git a/test/contracts/helloWorld.sol b/test/contracts/helloWorld.sol new file mode 100644 index 0000000000..beaf3e649e --- /dev/null +++ b/test/contracts/helloWorld.sol @@ -0,0 +1,16 @@ +pragma solidity ^0.5.0; + +contract Example { + uint public value; + + event ValueSet(uint); + + constructor() public payable { + value = 5; + } + + function setValue(uint val) public { + value = val; + emit ValueSet(val); + } +} diff --git a/test/temp-tests.ts b/test/temp-tests.ts index d700b665d4..9cb8c78016 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -1,5 +1,32 @@ import Ganache from "../index" import assert from "assert"; +const solc = require("solc"); + +function compileSolidity(source: string) { + let result = JSON.parse( + solc.compile( + JSON.stringify({ + language: "Solidity", + sources: { + "Contract.sol": { + content: source + } + }, + settings: { + outputSelection: { + "*": { + "*": ["*"] + } + } + } + }) + ) + ); + + return Promise.resolve({ + code: "0x" + result.contracts["Contract.sol"].Example.evm.bytecode.object + }); +} /** * test in here are playground tests or just tests that are in the original @@ -18,6 +45,23 @@ describe("Accounts", () => { assert.strictEqual(accounts[0], expectedAddress); }); + + it("eth_sendTransaction", async() => { + const options = { mnemonic }; + const p = Ganache.provider(options); + const accounts = await p.send("eth_accounts"); + const result = await p.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + await new Promise((resolve) => setTimeout(resolve, 1000)); + + const balance1 = await p.send("eth_getBalance", [accounts[0]]); + const balance2 = await p.send("eth_getBalance", [accounts[1]]); + console.log(result, balance1, balance2); + }); + it("should create its own mnemonic", async() => { const p = Ganache.provider(); const options = (p as any)[Object.getOwnPropertySymbols(p)[0] as any]; @@ -45,6 +89,21 @@ describe("Accounts", () => { assert.strictEqual(accounts.length, 2); }); + it.only("deploys contracts", async () => { + const contract = await compileSolidity("pragma solidity ^0.5.0; contract Example { event Event(); constructor() public { emit Event(); } }"); + const p = Ganache.provider(); + const accounts = await p.send("eth_accounts"); + const transactionHash = await p.send("eth_sendTransaction", [ + { + from: accounts[0], + data: contract.code + } + ]); + console.log(transactionHash); + await new Promise((resolve) => setTimeout(resolve, 1000000)); + const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); + }); + it("runs eth_call", async () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ From 49d70a7b0c3a95025e8b19148e652bf79a738bd5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 23 Jul 2019 19:12:14 -0400 Subject: [PATCH 084/691] ; --- index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/index.ts b/index.ts index 156c362b3a..af6a0faf2f 100644 --- a/index.ts +++ b/index.ts @@ -12,4 +12,3 @@ export default { Server, Provider }; -; \ No newline at end of file From 84fffff902ea1a9f08ddc4725ecbd7204a1761d9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 25 Jul 2019 09:21:31 -0400 Subject: [PATCH 085/691] A little refactor --- src/types/transaction.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/types/transaction.ts b/src/types/transaction.ts index d3f36e1772..8ed24cbd7e 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -507,10 +507,11 @@ export default class Transaction extends EthereumJsTransaction { } generateReceipt = (result: any, block: any, transactionIndex: number) => { - const status = result.vm.exception; + const vmResult = result.vm; + const status = vmResult.exception; const bitvector = result.bloom.bitvector; const gasUsed = result.gasUsed; - const logs = result.vm.logs; + const logs = vmResult.logs; const rawReceipt = rlp.encode([ status, gasUsed, @@ -527,14 +528,14 @@ export default class Transaction extends EthereumJsTransaction { gasUsed: gasUsed, cumulativeGasUsed: block.gasUsed, contractAddress: result.createdAddress, - logs: result.vm.logs, - status: result.vm.exception, + logs: logs, + status: status, logsBloom: bitvector, v: this.v, r: this.r, s: this.s, toJSON: (blockHash: Buffer) => { - // TODO: make this return this things + // TODO: make this return the things return {}; }, raw: rawReceipt From a4e8989efc301b28d094082297dfbb1c4b25a744 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Aug 2019 11:40:21 -0400 Subject: [PATCH 086/691] Makes sure tmp attempts to clean up temp directories even after a crash --- src/ledgers/ethereum/database.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index e17d745e84..444a5e5b48 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -1,5 +1,5 @@ import Emittery from "emittery"; -import { dir } from "tmp-promise"; +import { dir, setGracefulCleanup } from "tmp-promise"; import levelup from "levelup"; import Blockchain from "./blockchain"; const leveldown = require("leveldown"); @@ -8,7 +8,7 @@ const encode = require("encoding-down"); type DatabaseOptions = {db?: string | object, dbPath?: string}; - +setGracefulCleanup(); const tmpOptions = {prefix: "ganache-core_", unsafeCleanup: true}; const noop = (callback: () => void): void => callback(); From cc697572d313e86c6febd702fe2755bba30c3911 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 6 Jan 2020 17:54:59 -0500 Subject: [PATCH 087/691] Don't typecheck libs we depend on --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 5a7bf4f262..e9ff5097c4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "skipLibCheck": true, "experimentalDecorators": true, "module": "commonjs", "esModuleInterop": true, From 7b563630edef4bf01cb9f7ea19ba6306d88b7d15 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 6 Jan 2020 17:56:04 -0500 Subject: [PATCH 088/691] Reorg of ethereum ledger architecture --- src/engine.ts | 2 +- src/interfaces/base-ledger.ts | 19 ++++++ src/interfaces/ledger.ts | 13 ---- src/ledgers/ethereum/ledger.ts | 112 ++++++--------------------------- src/ledgers/ethereum/wallet.ts | 89 ++++++++++++++++++++++++++ src/options/options.ts | 2 +- 6 files changed, 128 insertions(+), 109 deletions(-) create mode 100644 src/interfaces/base-ledger.ts delete mode 100644 src/interfaces/ledger.ts create mode 100644 src/ledgers/ethereum/wallet.ts diff --git a/src/engine.ts b/src/engine.ts index 5abb69a56a..be402bf1c4 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -1,4 +1,4 @@ -import ILedger from "./interfaces/ledger"; +import {ILedger} from "./interfaces/base-ledger"; import Emittery from "emittery"; diff --git a/src/interfaces/base-ledger.ts b/src/interfaces/base-ledger.ts new file mode 100644 index 0000000000..511c6cb0fe --- /dev/null +++ b/src/interfaces/base-ledger.ts @@ -0,0 +1,19 @@ +export type Emitter = { + on(eventName: string, listener: (eventData?: any) => any): any + off(eventName: string, listener: (eventData?: any) => any): any + emit(eventName: string, eventData?: any): any +}; + +/** + * Base implementation for a Ledger. + * All properties must be `async` callable or return a `Promise` + */ +export default class BaseLedger { + readonly [index: string]: (...args: any) => Promise; +} + +/** + * Defines the interface for a Ledger. + * All properties must be `async` callable or return a `Promise` + */ +export interface ILedger extends BaseLedger { } diff --git a/src/interfaces/ledger.ts b/src/interfaces/ledger.ts deleted file mode 100644 index 3e61ee87c4..0000000000 --- a/src/interfaces/ledger.ts +++ /dev/null @@ -1,13 +0,0 @@ -export type Emitter = { - on(eventName: string, listener: (eventData?: any) => any): any - off(eventName: string, listener: (eventData?: any) => any): any - emit(eventName: string, eventData?: any): any -}; - -/** - * Defines the interface for a Ledger. - * all properties must be `async` callable or return a `Promise` - */ -export default interface ILedger { - readonly [key: string]: (params?: any[]) => Promise; -} diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index d20135b177..defcd8c6ed 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,14 +1,13 @@ //#region Imports -import ILedger, {Emitter} from "../../interfaces/ledger"; +import BaseLedger, {Emitter} from "../../interfaces/base-ledger"; import EthereumOptions, { getDefaultOptions } from "./options"; import { Data, Quantity, IndexableData } from "../../types/json-rpc"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; import Address, { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; -import Account from "../../types/account"; import { Block } from "./components/block-manager"; -const { toChecksumAddress } = require("ethereumjs-util"); +import Wallet from "./wallet"; const createKeccakHash = require("keccak"); // Read in the current ganache version from the package.json @@ -22,20 +21,14 @@ const BUFFER_ZERO = Buffer.from([0]); const RPCQUANTITY_ZERO = Quantity.from("0x0"); //#endregion -const _accounts = Symbol("accounts"); const _options = Symbol("options"); -const _coinbase = Symbol("coinbase"); +const _wallet = Symbol("wallet"); const _isMining = Symbol("isMining"); const _blockchain = Symbol("blockchain"); -const _knownAccounts = Symbol("knownAccounts"); -const _unlockedAccounts = Symbol("unlockedAccounts"); -export default class Ethereum implements ILedger { - private readonly [_accounts]: Address[]; - private readonly [_knownAccounts] = new Map(); - private readonly [_unlockedAccounts] = new Set(); +export default class Ethereum extends BaseLedger { + private readonly [_wallet]: Wallet; private readonly [_options]: EthereumOptions; - private readonly [_coinbase]: Account; private readonly [_blockchain]: Blockchain; private [_isMining] = false; @@ -47,86 +40,18 @@ export default class Ethereum implements ILedger { * @param ready Callback for when the ledger is fully initialized */ constructor(options: EthereumOptions, emitter: Emitter) { + super(); + const opts = this[_options] = Object.assign(getDefaultOptions(), options); - const accounts = opts.accounts; - const knownAccounts = this[_knownAccounts]; - const unlockedAccounts = this[_unlockedAccounts]; - - //#region Configure Known and Unlocked Accounts - this[_coinbase] = accounts[0]; - const l = accounts.length; - const accountsCache = this[_accounts] = Array(l); - for (let i = 0; i < l; i++) { - const account = accounts[i]; - const address = account.address; - const strAddress = address.toString(); - accountsCache[i] = toChecksumAddress(strAddress); - knownAccounts.set(strAddress, account.privateKey); - - // if the `secure` option has been set do NOT add these accounts to the - // _unlockedAccounts - if (opts.secure) continue; - - unlockedAccounts.add(strAddress); - } - //#endregion - - //#region Unlocked Accounts - const givenUnlockedUaccounts = opts.unlocked_accounts; - if (givenUnlockedUaccounts) { - const ul = givenUnlockedUaccounts.length; - for (let i = 0; i < ul; i++) { - let arg = givenUnlockedUaccounts[i]; - let address; - switch (typeof arg) { - case "string": - // `toLowerCase` so we handle uppercase `0X` formats - const addressOrIndex = arg.toLowerCase(); - if (addressOrIndex.indexOf("0x") === 0) { - address = addressOrIndex; - break; - } else { - // try to convert the arg string to a number. - // don't use parseInt because strings like `"123abc"` parse - // to `123`, and there is probably an error on the user's side we'd - // want to uncover. - const index = (arg as any) / 1; - // if we don't have a valid number, or the number isn't an valid JS - // integer (no bigints or decimals, please), throw an error. - if (!Number.isSafeInteger(index)) { - throw new Error(`Invalid value in unlocked_accounts: ${arg}`); - } - arg = index; - // not `break`ing here because I want this to fall through to the - // `"number"` case below. - // Refactor it if you want. - // break; // no break, please. - } - case "number": - const account = accounts[arg]; - if (account == null) { - throw new Error( - `Account at index ${addressOrIndex} not found. Max index available - is ${l - 1}.` - ); - } - address = account.address.toString().toLowerCase(); - break; - default: - throw new Error( - `Invalid value specified in unlocked_accounts` - ); - } - unlockedAccounts.add(address); - } - } - //#endregion + + this[_wallet] = new Wallet(opts); const blockchain = this[_blockchain] = new Blockchain(options); blockchain.on("start", () => emitter.emit("ready")); emitter.on("close", async () => await blockchain.stop()); } + //#region web3 /** * Returns the current client version. * @returns The current client version. @@ -143,7 +68,9 @@ export default class Ethereum implements ILedger { async web3_sha3(string: string): Promise { return Data.from(createKeccakHash("keccak256").update(string).digest()); }; + //#endregion + //#region net /** * Returns the current network id. * @returns {string} The current network id. This value should NOT be JSON-RPC @@ -168,6 +95,7 @@ export default class Ethereum implements ILedger { async net_peerCount(): Promise { return RPCQUANTITY_ZERO; } + //#endregion /** * Returns the current ethereum protocol version. @@ -177,7 +105,6 @@ export default class Ethereum implements ILedger { return PROTOCOL_VERSION; } - /** * Returns an object with data about the sync status or false. * @returns An object with sync status data or false, when not syncing: @@ -195,7 +122,7 @@ export default class Ethereum implements ILedger { * @returns 20 bytes - the current coinbase address. */ async eth_coinbase(): Promise
{ - return this[_coinbase] ? this[_coinbase].address : null; + return this[_wallet].coinbase ? this[_wallet].coinbase.address : null; } /** @@ -227,7 +154,7 @@ export default class Ethereum implements ILedger { * @returns Array of 20 Bytes - addresses owned by the client. */ async eth_accounts(): Promise { - return this[_accounts]; + return this[_wallet].accounts; } /** @@ -300,8 +227,8 @@ export default class Ethereum implements ILedger { throw new Error("Invalid to address"); } - const isKnownAccount = this[_knownAccounts].has(fromString); - const isUnlockedAccount = this[_unlockedAccounts].has(fromString); + const isKnownAccount = this[_wallet].knownAccounts.has(fromString); + const isUnlockedAccount = this[_wallet].unlockedAccounts.has(fromString); if (!isUnlockedAccount) { const msg = isKnownAccount ? "signer account is locked" : "sender account not recognized"; @@ -336,7 +263,7 @@ export default class Ethereum implements ILedger { const account = await this[_blockchain].accounts.get(from); tx.nonce = account.nonce.toBuffer(); } - const secretKey = this[_knownAccounts].get(fromString); + const secretKey = this[_wallet].knownAccounts.get(fromString); tx.sign(secretKey.toBuffer()); } @@ -366,7 +293,4 @@ export default class Ethereum implements ILedger { } return this[_blockchain].simulateTransaction(transaction, parentBlock, blockCopy); } - - - readonly [index: string]: (...args: any) => Promise<{}>; } diff --git a/src/ledgers/ethereum/wallet.ts b/src/ledgers/ethereum/wallet.ts new file mode 100644 index 0000000000..b8abb792b2 --- /dev/null +++ b/src/ledgers/ethereum/wallet.ts @@ -0,0 +1,89 @@ +import { Data } from "../../types/json-rpc"; +import Address from "../../types/address"; +import EthereumOptions from "./options"; +import Account from "../../types/account"; +const { toChecksumAddress } = require("ethereumjs-util"); + +export default class Wallet { + readonly accounts: Address[]; + readonly knownAccounts = new Map(); + readonly unlockedAccounts = new Set(); + readonly coinbase: Account; + + constructor(opts: EthereumOptions) { + const accounts = opts.accounts; + const knownAccounts = this.knownAccounts; + const unlockedAccounts = this.unlockedAccounts; + + //#region Configure Known and Unlocked Accounts + this.coinbase = accounts[0]; + const l = accounts.length; + const accountsCache = this.accounts = Array(l); + for (let i = 0; i < l; i++) { + const account = accounts[i]; + const address = account.address; + const strAddress = address.toString(); + accountsCache[i] = toChecksumAddress(strAddress); + knownAccounts.set(strAddress, account.privateKey); + + // if the `secure` option has been set do NOT add these accounts to the + // _unlockedAccounts + if (opts.secure) continue; + + unlockedAccounts.add(strAddress); + } + //#endregion + + //#region Unlocked Accounts + const givenUnlockedUaccounts = opts.unlocked_accounts; + if (givenUnlockedUaccounts) { + const ul = givenUnlockedUaccounts.length; + for (let i = 0; i < ul; i++) { + let arg = givenUnlockedUaccounts[i]; + let address; + switch (typeof arg) { + case "string": + // `toLowerCase` so we handle uppercase `0X` formats + const addressOrIndex = arg.toLowerCase(); + if (addressOrIndex.indexOf("0x") === 0) { + address = addressOrIndex; + break; + } else { + // try to convert the arg string to a number. + // don't use parseInt because strings like `"123abc"` parse + // to `123`, and there is probably an error on the user's side we'd + // want to uncover. + const index = (arg as any) / 1; + // if we don't have a valid number, or the number isn't an valid JS + // integer (no bigints or decimals, please), throw an error. + if (!Number.isSafeInteger(index)) { + throw new Error(`Invalid value in unlocked_accounts: ${arg}`); + } + arg = index; + // not `break`ing here because I want this to fall through to the + // `"number"` case below. + // Refactor it if you want. + // break; // no break, please. + } + case "number": + const account = accounts[arg]; + if (account == null) { + throw new Error( + `Account at index ${addressOrIndex} not found. Max index available + is ${l - 1}.` + ); + } + address = account.address.toString().toLowerCase(); + break; + default: + throw new Error( + `Invalid value specified in unlocked_accounts` + ); + } + unlockedAccounts.add(address); + } + } + //#endregion + + } +} \ No newline at end of file diff --git a/src/options/options.ts b/src/options/options.ts index 129ed3e4a3..3126b0da35 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -1,5 +1,5 @@ import {Quantity} from "../types/json-rpc"; -import ILedger from "../interfaces/ledger"; +import {ILedger} from "../interfaces/base-ledger"; interface Logger { log(message?: any, ...optionalParams: any[]): void; From 3959f442ab96f035299d6de6ffd00375a6fc1fae Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 6 Jan 2020 18:49:54 -0500 Subject: [PATCH 089/691] Fix dbPath typo --- src/ledgers/ethereum/database.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index 444a5e5b48..41a9d88c43 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -3,10 +3,10 @@ import { dir, setGracefulCleanup } from "tmp-promise"; import levelup from "levelup"; import Blockchain from "./blockchain"; const leveldown = require("leveldown"); -const sub = require( "subleveldown"); +const sub = require("subleveldown"); const encode = require("encoding-down"); -type DatabaseOptions = {db?: string | object, dbPath?: string}; +type DatabaseOptions = {db?: string | object, db_path?: string}; setGracefulCleanup(); const tmpOptions = {prefix: "ganache-core_", unsafeCleanup: true}; @@ -32,7 +32,7 @@ export default class Database extends Emittery { * Once the database has been fully initialized it will emit a `ready` * event. * @param options Supports one of two options: `db` (a leveldown compliant - * store instance) or `dbPath` (the path to store/read the db instance) + * store instance) or `db_path` (the path to store/read the db instance) * @param blockchain */ constructor(options: DatabaseOptions, blockchain: Blockchain) { @@ -50,7 +50,7 @@ export default class Database extends Emittery { if (store) { db = await levelup(store as any, levelupOptions); } else { - let directory = this.options.dbPath; + let directory = this.options.db_path; if (!directory) { const dirInfo = await dir(tmpOptions); directory = dirInfo.path; From 3eb5b37944cdb28e2e4b0ddcadd9b49fb1dd164c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 6 Jan 2020 18:50:05 -0500 Subject: [PATCH 090/691] Whitespace fix --- src/ledgers/ethereum/blockchain.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 80316d7452..7c739a3591 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -158,7 +158,7 @@ export default class Blockchain extends Emittery { const account = accounts[i]; const ethereumJsAccount = new EthereumJsAccount(); ethereumJsAccount.nonce = account.nonce.toBuffer(), - ethereumJsAccount.balance = account.balance.toBuffer() + ethereumJsAccount.balance = account.balance.toBuffer() pendingAccounts[i] = putAccount(account.address.toBuffer(), ethereumJsAccount); } await Promise.all(pendingAccounts); From 6f5464bf682f0b09f20f226dd0cb6e505896ca2c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 6 Jan 2020 18:50:34 -0500 Subject: [PATCH 091/691] Improvie typing in EthereumOptions --- src/ledgers/ethereum/options.ts | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 1a20547744..2729d057de 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,22 +1,12 @@ -import ILedgerOptions from "../../interfaces/ledger-options" +import Options from "../../options/provider-options"; import Account from "../../types/account"; -import { Quantity } from "../../types/json-rpc"; -type EthereumOptions = ILedgerOptions & { - net_version?: string | number, - gasPrice?: Quantity, - accounts?: Account[], - unlocked_accounts?: string[] | number[], - allowUnlimitedContractSize?: boolean, - hardfork?: string, - gasLimit?: Quantity, - timestamp?: Date, - db?: object, - db_path?: string, - secure?: boolean -} +type EthereumOptions = Pick & { + timestamp: Date, + accounts: Account[] +}; export default EthereumOptions; -export const getDefaultOptions : () => EthereumOptions = () => { - return {} as EthereumOptions; +export const getDefaultOptions: () => EthereumOptions = () => { + return {} as EthereumOptions; } From 49a9d974ac185863a7e895abbe2d7a17f157a6bb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 6 Jan 2020 18:55:06 -0500 Subject: [PATCH 092/691] Fix tsc complaining about ProviderOptions export --- src/provider.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/provider.ts b/src/provider.ts index be6be30917..8b056b14d5 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -13,8 +13,6 @@ import EthereumOptions from "./ledgers/ethereum/options"; const hdkey = require("ethereumjs-wallet/hdkey"); -export type ProviderOptions = ProviderOptions; - const WEI = 1000000000000000000n; const options = Symbol("options"); From 08e6480160775cbb3196eddecf7e9411d3548c1e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 6 Jan 2020 18:56:03 -0500 Subject: [PATCH 093/691] Don't `only` things. :-D --- test/temp-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 9cb8c78016..483c36f724 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -89,7 +89,7 @@ describe("Accounts", () => { assert.strictEqual(accounts.length, 2); }); - it.only("deploys contracts", async () => { + it("deploys contracts", async () => { const contract = await compileSolidity("pragma solidity ^0.5.0; contract Example { event Event(); constructor() public { emit Event(); } }"); const p = Ganache.provider(); const accounts = await p.send("eth_accounts"); From 3ad84cea0665fbf38c1bd832e76e490bdf99819a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 11:53:31 -0500 Subject: [PATCH 094/691] General fixes --- src/ledgers/ethereum/wallet.ts | 2 +- src/options/options.ts | 2 +- test/temp-tests.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ledgers/ethereum/wallet.ts b/src/ledgers/ethereum/wallet.ts index b8abb792b2..7fb91d66e7 100644 --- a/src/ledgers/ethereum/wallet.ts +++ b/src/ledgers/ethereum/wallet.ts @@ -53,7 +53,7 @@ export default class Wallet { // don't use parseInt because strings like `"123abc"` parse // to `123`, and there is probably an error on the user's side we'd // want to uncover. - const index = (arg as any) / 1; + const index = (arg as any) - 0; // if we don't have a valid number, or the number isn't an valid JS // integer (no bigints or decimals, please), throw an error. if (!Number.isSafeInteger(index)) { diff --git a/src/options/options.ts b/src/options/options.ts index 3126b0da35..2b0188b5e1 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -89,7 +89,7 @@ export default interface Options { /** * Array of addresses or address indexes specifying which accounts should be unlocked. Alias of unlockedAccounts */ - unlocked_accounts?: string[] | number[], + unlocked_accounts?: Array, /** * Specify a path to a directory to save the chain database. If a database diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 483c36f724..685d5241d6 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -89,7 +89,7 @@ describe("Accounts", () => { assert.strictEqual(accounts.length, 2); }); - it("deploys contracts", async () => { + it.skip("deploys contracts", async () => { const contract = await compileSolidity("pragma solidity ^0.5.0; contract Example { event Event(); constructor() public { emit Event(); } }"); const p = Ganache.provider(); const accounts = await p.send("eth_accounts"); From 73b86fcd104bdf3ed587e2ffbb1ff7eb2d3aea9a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 16:23:57 -0500 Subject: [PATCH 095/691] Make sure we save the state root to the block database --- src/ledgers/ethereum/blockchain.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 7c739a3591..b97476eff6 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -112,7 +112,8 @@ export default class Blockchain extends Emittery { // difficulty: gasLimit: options.gasLimit.toBuffer(), transactionsTrie: blockData.transactionsTrie.root, - receiptTrie: blockData.receiptTrie.root + receiptTrie: blockData.receiptTrie.root, + stateRoot: this.trie.root }); // TODO: save the transactions, et al, too // blockData.blockTransactions From e3c20a8e3556cb06096c03f8f38f4c3340c0ef6c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 16:25:24 -0500 Subject: [PATCH 096/691] Remove old console.log --- src/ledgers/ethereum/blockchain.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index b97476eff6..483c951c59 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -118,8 +118,6 @@ export default class Blockchain extends Emittery { // TODO: save the transactions, et al, too // blockData.blockTransactions - console.log(Quantity.from(block.value.header.number).toBigInt()); - this.blocks.latest = block; lastBlock = this.blocks.set(block); }); From ca70de3dc38c1b5a2c368822b3337ea1659db7a1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 16:26:34 -0500 Subject: [PATCH 097/691] Don't use noop getDefaultOptions for EthereumOptions --- src/ledgers/ethereum/ledger.ts | 4 ++-- src/ledgers/ethereum/options.ts | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index defcd8c6ed..b43c61c515 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,6 +1,6 @@ //#region Imports import BaseLedger, {Emitter} from "../../interfaces/base-ledger"; -import EthereumOptions, { getDefaultOptions } from "./options"; +import EthereumOptions from "./options"; import { Data, Quantity, IndexableData } from "../../types/json-rpc"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; @@ -42,7 +42,7 @@ export default class Ethereum extends BaseLedger { constructor(options: EthereumOptions, emitter: Emitter) { super(); - const opts = this[_options] = Object.assign(getDefaultOptions(), options); + const opts = this[_options] = options; this[_wallet] = new Wallet(opts); diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 2729d057de..8661bf8285 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -7,6 +7,3 @@ type EthereumOptions = Pick EthereumOptions = () => { - return {} as EthereumOptions; -} From e1257461fb2d7155dcf71361be1794d4eac96832 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 16:26:57 -0500 Subject: [PATCH 098/691] Use strings for HTTP status codes because that's what they should be anyway --- src/servers/http-server.ts | 4 ++-- src/servers/utils/http-response-codes.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 8a44e52429..78a1c8e9cf 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -65,9 +65,9 @@ function prepareCORSResponseHeaders(method: string, request: HttpRequest) { } -function sendResponse(response: HttpResponse, statusCode: number, contentType?: RecognizedString, data?: RecognizedString, writeHeaders: (response: HttpResponse) => void = noop): void { +function sendResponse(response: HttpResponse, statusCode: HttpResponseCodes, contentType?: RecognizedString, data?: RecognizedString, writeHeaders: (response: HttpResponse) => void = noop): void { response.experimental_cork(()=>{ - response.writeStatus(statusCode.toString()); + response.writeStatus(statusCode); writeHeaders(response); if (contentType) { response.writeHeader("Content-Type", contentType); diff --git a/src/servers/utils/http-response-codes.ts b/src/servers/utils/http-response-codes.ts index 3b35193f57..d05d06ad6d 100644 --- a/src/servers/utils/http-response-codes.ts +++ b/src/servers/utils/http-response-codes.ts @@ -1,9 +1,9 @@ enum HttpResponseCodes{ - OK = 200, - NO_CONTENT = 204, - BAD_REQUEST = 400, - NOT_FOUND = 404, - METHOD_NOT_ALLOWED = 405, - IM_A_TEAPOT = 418 + OK = "200", + NO_CONTENT = "204", + BAD_REQUEST = "400", + NOT_FOUND = "404", + METHOD_NOT_ALLOWED = "405", + IM_A_TEAPOT = "418" } export default HttpResponseCodes; \ No newline at end of file From 78ded4b95c43b52753fc1160559e3e7d6363d964 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 16:27:52 -0500 Subject: [PATCH 099/691] Ensure we are waiting for all trie updates before continuing --- src/ledgers/ethereum/miner.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index 143bbcd547..8689dc8364 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -198,7 +198,8 @@ export default class Miner extends Emittery { rejectedTransactions.push(best); } } - await Promise.all([promises, this._commit()]); + promises.push(this._commit()); + await Promise.all(promises); // TODO: put the rejected transactions back in their original origin heaps rejectedTransactions.forEach(transaction => { From f4d79493f5168cbb1a15ce3c3bbb7ba9d58fffb5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 16:29:21 -0500 Subject: [PATCH 100/691] Update options to more consistent style --- src/ledgers/ethereum/ledger.ts | 11 +++---- src/ledgers/ethereum/options.ts | 2 +- src/options/options.ts | 51 ++++++++++++++++++++++----------- 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index b43c61c515..b243bcce90 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -8,6 +8,7 @@ import Address, { IndexableAddress } from "../../types/address"; import Transaction from "../../types/transaction"; import { Block } from "./components/block-manager"; import Wallet from "./wallet"; +import Account from "ethereumjs-account"; const createKeccakHash = require("keccak"); // Read in the current ganache version from the package.json @@ -77,7 +78,7 @@ export default class Ethereum extends BaseLedger { * Quantity/Data encoded. */ async net_version(): Promise { - return this[_options].net_version.toString(); + return this[_options].networkId.toString(); } /** @@ -122,7 +123,7 @@ export default class Ethereum extends BaseLedger { * @returns 20 bytes - the current coinbase address. */ async eth_coinbase(): Promise
{ - return this[_wallet].coinbase ? this[_wallet].coinbase.address : null; + return this[_wallet].coinbase.address; } /** @@ -169,10 +170,10 @@ export default class Ethereum extends BaseLedger { /** * Returns the currently configured chain id, a value used in * replay-protected transaction signing as introduced by EIP-155. - * @returns big integer of the current chain id. Defaults are mainnet=61, morden=62, custom=1337. + * @returns The chain id as a string. */ - async eth_chainId(): Promise { - return 1337n; + async eth_chainId(): Promise { + return this[_options].chainId.toString(); } /** diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 8661bf8285..b263ab6b99 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,7 +1,7 @@ import Options from "../../options/provider-options"; import Account from "../../types/account"; -type EthereumOptions = Pick & { +type EthereumOptions = Pick & { timestamp: Date, accounts: Account[] }; diff --git a/src/options/options.ts b/src/options/options.ts index 2b0188b5e1..122e91904b 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -66,26 +66,48 @@ export default interface Options { fork_block_number?: string | bigint, /** - * Same as --networkId option above. Alias of network_id. + * The currently configured chain id, a value used in replay-protected + * transaction signing as introduced by EIP-155. Default's to `1337` + */ + chainId?: string | number, + + /** + * Alias of `networkId`. + */ + netVersion?: string | number, + + /** + * Alias of `networkId`. */ net_version?: string | number, /** - * Same as --networkId option above. Alias of net_version. + * The id of the network returned by the RPC method `net_version`. + * Defaults to the current timestamp (`Date.now()`). + */ + networkId?: string | number, + + /** + * Alias of `networkId`. */ network_id?: string | number, /** * Date that the first block should start. Use this feature, along with the - * evm_increaseTime method to test time-dependent code. + * `evm_increaseTime` RPC, to test time-dependent code. */ time?: Date, /** - * Whether or not accounts are locked by default. Defaults to `false` + * Alias of `secure` */ locked?: boolean, + /** + * Lock available accounts by default (good for third party transaction signing). Defaults to `false`. + */ + secure?: boolean, + /** * Array of addresses or address indexes specifying which accounts should be unlocked. Alias of unlockedAccounts */ @@ -98,11 +120,6 @@ export default interface Options { */ db_path?: string, - /** - * Lock available accounts by default (good for third party transaction signing. Defaults to `false`. - */ - secure?: boolean, - /** * Specify an alternative database instance, for instance MemDOWN. */ @@ -151,23 +168,25 @@ export default interface Options { }; export const getDefault: (options: Options)=> Options = (options) => { - const network_id = (options ? options.network_id || options.net_version || Date.now() : Date.now()).toString(); + // TODO: convert to null propagation operator after updating TS to a version that supports it + const networkId = (options ? options.networkId || options.netVersion || options.network_id || options.net_version || Date.now() : Date.now()).toString(); + const chainId = options ? (options.chainId) || 1337 : 1337; + const secure = options ? options.secure || options.locked || false : false; return Object.assign({ + chainId, debug: false, logger: {log: () => {}}, default_balance_ether: 100n, total_accounts: 10n, - network_id, - net_version: network_id, - locked: false, + networkId, vmErrorsOnRPCResponse: true, hdPath: "m/44'/60'/0'/0/", allowUnlimitedContractSize: false, - gasPrice: new Quantity("0x77359400"), - gasLimit: new Quantity("0x6691b7"), + gasPrice: new Quantity(2000000000), + gasLimit: new Quantity(6721975), verbose: false, asyncRequestProcessing: true, hardfork: "petersburg", - secure: false + secure }, options); } From ace0d45aeaffffa33427b133ea2f50c7345d9530 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 16:29:50 -0500 Subject: [PATCH 101/691] Test basic eth_sendTransaction functionality --- test/temp-tests.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 685d5241d6..20ec1b576b 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -50,16 +50,17 @@ describe("Accounts", () => { const options = { mnemonic }; const p = Ganache.provider(options); const accounts = await p.send("eth_accounts"); - const result = await p.send("eth_sendTransaction", [{ + const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); + await p.send("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 }]); - await new Promise((resolve) => setTimeout(resolve, 1000)); + // TODO: remove and replace with something that detects with the block is "mined" + await new Promise((resolve) => setTimeout(resolve, 3000)); - const balance1 = await p.send("eth_getBalance", [accounts[0]]); - const balance2 = await p.send("eth_getBalance", [accounts[1]]); - console.log(result, balance1, balance2); + const balance1_2 = await p.send("eth_getBalance", [accounts[1]]); + assert.strictEqual(parseInt(balance1_1) + 1, parseInt(balance1_2)); }); it("should create its own mnemonic", async() => { From 9ca9f759e95facf956d5f330b4180be6653ac07f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 16:30:40 -0500 Subject: [PATCH 102/691] Test `unlocked_accounts`'s error paths --- test/temp-tests.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 20ec1b576b..89cf974082 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -90,6 +90,24 @@ describe("Accounts", () => { assert.strictEqual(accounts.length, 2); }); + it("sets errors when unlocked_accounts index is too high", async () => { + const ganacheInitFn = Ganache.provider.bind(Ganache, { + unlocked_accounts: [99] + }); + assert.throws(ganacheInitFn, { + message: "addressOrIndex is not defined" + }); + }); + + it("sets errors when unlocked_accounts index is a (big) bigint", async () => { + const bigNumber = BigInt(Number.MAX_SAFE_INTEGER) + 1n; + const ganacheInitFn = Ganache.provider.bind(Ganache, { + unlocked_accounts: [bigNumber.toString()] + }); + assert.throws(ganacheInitFn, { + message: `Invalid value in unlocked_accounts: ${bigNumber}` + }); + }); it.skip("deploys contracts", async () => { const contract = await compileSolidity("pragma solidity ^0.5.0; contract Example { event Event(); constructor() public { emit Event(); } }"); const p = Ganache.provider(); From 0d7a7ea7c45ef32f990a1a6a0df5da1cf231e048 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 7 Jan 2020 16:37:51 -0500 Subject: [PATCH 103/691] Testing unlocking specific accounts works --- test/temp-tests.ts | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 89cf974082..d525688422 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -108,6 +108,49 @@ describe("Accounts", () => { message: `Invalid value in unlocked_accounts: ${bigNumber}` }); }); + + it("unlocks accounts via unlock_accounts (both string and numbered numbers)", async () => { + const p = Ganache.provider({ + locked: true, + unlocked_accounts: ["0", 1] + }); + + const accounts = await p.send("eth_accounts"); + const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); + const badSend = () => { + return p.send("eth_sendTransaction", [{ + from: accounts[2], + to: accounts[1], + value: 123 + }]); + }; + await assert.rejects(badSend, "Error: signer account is locked"); + + await p.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 123 + }]); + + await new Promise((resolve) => setTimeout(resolve, 5000)); + + const balance1_2 = await p.send("eth_getBalance", [accounts[1]]); + assert.strictEqual(BigInt(balance1_1) + 123n, BigInt(balance1_2)); + + const balance0_1 = await p.send("eth_getBalance", [accounts[0]]); + + await p.send("eth_sendTransaction", [{ + from: accounts[1], + to: accounts[0], + value: 123 + }]); + + await new Promise((resolve) => setTimeout(resolve, 5000)); + + const balance0_2 = await p.send("eth_getBalance", [accounts[0]]); + assert.strictEqual(BigInt(balance0_1) + 123n, BigInt(balance0_2)); + }); + it.skip("deploys contracts", async () => { const contract = await compileSolidity("pragma solidity ^0.5.0; contract Example { event Event(); constructor() public { emit Event(); } }"); const p = Ganache.provider(); From bd5dc15f399a7cd661a14e08425d36c3da3a17b0 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Wed, 8 Jan 2020 13:09:35 -0500 Subject: [PATCH 104/691] Update all dependencies to latest --- index.ts | 3 +- npm-shrinkwrap.json | 2707 +++++++++++++++------------- package.json | 56 +- src/ledgers/ethereum/blockchain.ts | 2 +- src/ledgers/ethereum/wallet.ts | 3 +- src/server.ts | 2 - src/types/account.ts | 2 +- test/server.ts | 2 +- test/temp-tests.ts | 7 +- typings/uWebsockets.js.ts | 3 - 10 files changed, 1482 insertions(+), 1305 deletions(-) diff --git a/index.ts b/index.ts index af6a0faf2f..8e37c3ad52 100644 --- a/index.ts +++ b/index.ts @@ -3,7 +3,8 @@ jsbiHelpers.install(); import Provider from "./src/provider"; import ProviderOptions from "./src/options/provider-options"; -import Server, {ServerOptions} from "./src/server"; +import ServerOptions from "./src/options/server-options"; +import Server from "./src/server"; // `server` and `provider` are here for backwards compatability export default { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d7d0371a70..c62ea406d3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -13,46 +13,98 @@ "@babel/highlight": "^7.0.0" } }, + "@babel/core": { + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.7.tgz", + "integrity": "sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.7", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.7", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "json5": "^2.1.0", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, "@babel/generator": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", - "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", + "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", "dev": true, "requires": { - "@babel/types": "^7.4.4", + "@babel/types": "^7.7.4", "jsesc": "^2.5.1", - "lodash": "^4.17.11", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" + "lodash": "^4.17.13", + "source-map": "^0.5.0" } }, "@babel/helper-function-name": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", - "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/helper-get-function-arity": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", - "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.7.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", - "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helpers": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", + "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", "dev": true, "requires": { - "@babel/types": "^7.4.4" + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/highlight": { @@ -67,39 +119,48 @@ } }, "@babel/parser": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz", - "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==", + "version": "7.7.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", + "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", "dev": true }, "@babel/template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", - "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4" + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" } }, "@babel/traverse": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz", - "integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.4.4", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4", + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.11" + "lodash": "^4.17.13" }, "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -112,25 +173,84 @@ } }, "@babel/types": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", - "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.11", + "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } }, + "@istanbuljs/load-nyc-config": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", + "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, "@types/bn.js": { "version": "4.11.5", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", "integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==", - "dev": true, "requires": { "@types/node": "*" } }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, "@types/cookiejar": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz", @@ -154,16 +274,15 @@ "dev": true }, "@types/mocha": { - "version": "5.2.6", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.6.tgz", - "integrity": "sha512-1axi39YdtBI7z957vdqXI4Ac25e7YihYQtJa+Clnxg1zTJEaIRbndt71O3sP4GAMgiAm0pY26/b9BrY4MR/PMw==", + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", "dev": true }, "@types/node": { - "version": "10.12.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.0.tgz", - "integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==", - "dev": true + "version": "13.1.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.4.tgz", + "integrity": "sha512-Lue/mlp2egZJoHXZr4LndxDAd7i/7SQYhV0EjWfb/a4/OZ6tuVwMCVPiwkU5nsEipxEf7hmkSU7Em5VQ8P5NGA==" }, "@types/seedrandom": { "version": "2.4.28", @@ -172,9 +291,9 @@ "dev": true }, "@types/superagent": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.1.tgz", - "integrity": "sha512-NetXrraTWPcdGG6IwYJhJ5esUGx8AYNiozbc1ENWEsF6BsD4JmNODJczI6Rm1xFPVp6HZESds9YCfqz4zIsM6A==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.4.tgz", + "integrity": "sha512-SRH2q6/5/nhOkAuLXm3azRGjBYpoKCZWh138Rt1AxSIyE6/1b9uClIH2V+JfyDtjIvgr5yQqYgNUmdpbneJoZQ==", "dev": true, "requires": { "@types/cookiejar": "*", @@ -192,12 +311,11 @@ } }, "@types/ws": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.1.tgz", - "integrity": "sha512-EzH8k1gyZ4xih/MaZTXwT2xOkPiIMSrhQ9b8wrlX88L0T02eYsddatQlwVFlEPyEqV0ChpdpNnE51QPH6NVT4Q==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.4.tgz", + "integrity": "sha512-PpPrX7SZW9re6+Ha8ojZG4Se8AZXgf0GK6zmfqEuCsY49LFDNXO3SByp44X3dFEqtB73lkCDAdUazhAjVPiNwg==", "dev": true, "requires": { - "@types/events": "*", "@types/node": "*" } }, @@ -214,6 +332,16 @@ "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -235,13 +363,23 @@ "color-convert": "^1.9.0" } }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "append-transform": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", - "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, "requires": { - "default-require-extensions": "^2.0.0" + "default-require-extensions": "^3.0.0" } }, "archy": { @@ -251,9 +389,9 @@ "dev": true }, "arg": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", - "integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz", + "integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==", "dev": true }, "argparse": { @@ -281,12 +419,6 @@ "async": "^2.4.0" } }, - "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", - "dev": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -315,6 +447,12 @@ "bindings": "^1.3.0" } }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, "bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", @@ -349,15 +487,10 @@ "safe-buffer": "^5.0.1" } }, - "bluebird": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.4.tgz", - "integrity": "sha512-FG+nFEZChJrbQ9tIccIfZJBz3J7mLrAhxakAbnrJWn8d7aKOC+LWifa0G+p4ZqKp4y13T7juYvdhq9NzKdsrjw==" - }, "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.1.tgz", + "integrity": "sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA==" }, "brace-expansion": { "version": "1.1.11", @@ -368,6 +501,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -463,15 +605,15 @@ } }, "caching-transform": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", - "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "requires": { - "hasha": "^3.0.0", - "make-dir": "^2.0.0", - "package-hash": "^3.0.0", - "write-file-atomic": "^2.4.2" + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" } }, "camelcase": { @@ -510,6 +652,22 @@ "functional-red-black-tree": "^1.0.1" } }, + "chokidar": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", + "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" + } + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -519,23 +677,51 @@ "safe-buffer": "^5.0.1" } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, "coinstring": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/coinstring/-/coinstring-2.3.0.tgz", @@ -606,9 +792,9 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", "dev": true, "requires": { "safe-buffer": "~5.1.1" @@ -620,24 +806,16 @@ "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", "dev": true }, + "core-js-pure": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.2.tgz", + "integrity": "sha512-PRasaCPjjCB65au2dMBPtxuIR6LM8MVNdbIbN57KxcDV1FAYQWlF0pqje/HC2sM6nm/s9KqSTkMTU75pozaghA==" + }, "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=" }, - "cp-file": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz", - "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "make-dir": "^2.0.0", - "nested-error-stacks": "^2.0.0", - "pify": "^4.0.1", - "safe-buffer": "^5.0.1" - } - }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -664,34 +842,23 @@ } }, "cross-env": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz", - "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-6.0.3.tgz", + "integrity": "sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag==", "dev": true, "requires": { - "cross-spawn": "^6.0.5", - "is-windows": "^1.0.0" + "cross-spawn": "^7.0.0" } }, "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", + "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - } + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, "debug": { @@ -710,12 +877,12 @@ "dev": true }, "default-require-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", - "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", "dev": true, "requires": { - "strip-bom": "^3.0.0" + "strip-bom": "^4.0.0" } }, "deferred-leveldown": { @@ -740,7 +907,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, "requires": { "object-keys": "^1.0.12" }, @@ -748,8 +914,7 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" } } }, @@ -792,12 +957,19 @@ "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } } }, "emittery": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.4.1.tgz", - "integrity": "sha512-r4eRSeStEGf6M5SKdrQhhLK5bOwOBxQhIE3YSTnZE3GpKiLfnnhE+tPtrJE79+eDJgm39BM6LSoI8SCx4HbwlQ==" + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.5.1.tgz", + "integrity": "sha512-sYZXNHH9PhTfs98ROEFVC3bLiR8KSqXQsEHIwZ9J6H0RaQObC3JYq4G8IvDd0b45/LxfGKYBpmaUN4LiKytaNw==" }, "emoji-regex": { "version": "7.0.3", @@ -840,15 +1012,6 @@ } } }, - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, "errno": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", @@ -857,42 +1020,35 @@ "prr": "~1.0.1" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", - "dev": true, + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0.tgz", + "integrity": "sha512-yYkE07YF+6SIBmg1MsJ9dlub5L48Ek7X0qz+c/CPCHS9EBXfESorzng4cJQjJW5/pB6vDF41u7F8vUhLVDqIug==", "requires": { - "es-to-primitive": "^1.2.0", + "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" }, "dependencies": { "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" } } }, "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "dev": true, + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -939,6 +1095,11 @@ "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, "ethereumjs-util": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", @@ -969,17 +1130,47 @@ } }, "ethereumjs-block": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.0.tgz", - "integrity": "sha512-Ye+uG/L2wrp364Zihdlr/GfC3ft+zG8PdHcRtsBFNNH1CkOhxOwdB8friBU85n89uRZ9eIMAywCq0F4CwT1wAw==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", "requires": { "async": "^2.0.1", - "ethereumjs-common": "^1.1.0", - "ethereumjs-tx": "^1.2.2", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", "ethereumjs-util": "^5.0.0", "merkle-patricia-tree": "^2.1.2" }, "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^2.0.0", + "rlp": "^2.2.3", + "secp256k1": "^3.0.1" + } + } + } + }, "ethereumjs-util": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", @@ -992,17 +1183,35 @@ "rlp": "^2.0.0", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" + }, + "dependencies": { + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + } } }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", + "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" + "bindings": "^1.5.0", + "inherits": "^2.0.4", + "nan": "^2.14.0", + "safe-buffer": "^5.2.0" } }, "levelup": { @@ -1040,34 +1249,49 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" } } + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" } } }, "ethereumjs-blockchain": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-3.4.0.tgz", - "integrity": "sha512-wxPSmt6EQjhbywkFbftKcb0qRFIZWocHMuDa8/AB4eWL/UPYalNcDyLaxYbrDytmhHid3Uu8G/tA3C/TxZBuOQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.3.tgz", + "integrity": "sha512-0nJWbyA+Gu0ZKZr/cywMtB/77aS/4lOVsIKbgUN2sFQYscXO5rPbUfrEe7G2Zhjp86/a0VqLllemDSTHvx3vZA==", "requires": { "async": "^2.6.1", "ethashjs": "~0.0.7", - "ethereumjs-block": "~2.2.0", - "ethereumjs-common": "^1.1.0", - "ethereumjs-util": "~6.0.0", + "ethereumjs-block": "~2.2.2", + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "~6.1.0", "flow-stoplight": "^1.0.0", "level-mem": "^3.0.1", "lru-cache": "^5.1.1", - "safe-buffer": "^5.1.2", + "rlp": "^2.2.2", "semaphore": "^1.1.0" }, "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, "ethereumjs-util": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.0.0.tgz", - "integrity": "sha512-E3yKUyl0Fs95nvTFQZe/ZSNcofhDzUsDlA5y2uoRmf1+Ec7gpGhNCsgKkZBRh7Br5op8mJcYF/jFbmjj909+nQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", "requires": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", - "ethjs-util": "^0.1.6", + "ethjs-util": "0.1.6", "keccak": "^1.0.2", "rlp": "^2.0.0", "safe-buffer": "^5.1.1", @@ -1096,9 +1320,9 @@ } }, "ethereumjs-common": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.1.0.tgz", - "integrity": "sha512-LUmYkKV/HcZbWRyu3OU9YOevsH3VJDXtI6kEd8VZweQec+JjDGKCmAVKUyzhYUHqxRJu7JNALZ3A/b3NXOP6tA==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz", + "integrity": "sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ==" }, "ethereumjs-tx": { "version": "1.3.7", @@ -1121,6 +1345,13 @@ "rlp": "^2.0.0", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } } }, "keccak": { @@ -1137,75 +1368,86 @@ } }, "ethereumjs-util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", - "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", "requires": { + "@types/bn.js": "^4.11.3", "bn.js": "^4.11.0", "create-hash": "^1.1.2", "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", + "keccak": "^2.0.0", + "rlp": "^2.2.3", "secp256k1": "^3.0.1" }, "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", + "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" + "bindings": "^1.5.0", + "inherits": "^2.0.4", + "nan": "^2.14.0", + "safe-buffer": "^5.2.0" } + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" } } }, "ethereumjs-vm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-3.0.0.tgz", - "integrity": "sha512-lNu+G/RWPRCrQM5s24MqgU75PEGiAhL4Ombw0ew6m08d+amsxf/vGAb98yDNdQqqHKV6JbwO/tCGfdqXGI6Cug==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.1.2.tgz", + "integrity": "sha512-Zxz/i0u6+74kZ/0UEAbCd2WCSTuS0jPM9LnM9TUGXDbffrkULb1tIBcgHWqYsARGCQJGMDZj5FKDtUJ04Heowg==", "requires": { "async": "^2.1.2", "async-eventemitter": "^0.2.2", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~2.2.0", - "ethereumjs-blockchain": "^3.4.0", - "ethereumjs-common": "^1.1.0", - "ethereumjs-util": "^6.0.0", + "core-js-pure": "^3.0.1", + "ethereumjs-account": "^3.0.0", + "ethereumjs-block": "^2.2.2", + "ethereumjs-blockchain": "^4.0.3", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^6.2.0", "fake-merkle-patricia-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1", "merkle-patricia-tree": "^2.3.2", "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1" + "safe-buffer": "^5.1.1", + "util.promisify": "^1.0.0" }, "dependencies": { - "ethereumjs-account": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz", - "integrity": "sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA==", + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", "requires": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - } + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" } }, "keccak": { @@ -1305,21 +1547,6 @@ "safe-buffer": "^5.1.1" } }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, "fake-merkle-patricia-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", @@ -1328,25 +1555,35 @@ "checkpoint-store": "^1.1.0" } }, - "fast-future": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/fast-future/-/fast-future-1.0.2.tgz", - "integrity": "sha1-hDWpqqAteSSNF9cE52JZMB2ZKAo=" + "fast-safe-stringify": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", + "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", + "dev": true }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", + "integrity": "sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + "make-dir": "^3.0.0", + "pkg-dir": "^4.1.0" } }, "find-up": { @@ -1373,51 +1610,23 @@ "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" }, "foreground-child": { - "version": "1.5.6", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, "requires": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" - } - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - } + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" } }, "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, @@ -1437,6 +1646,12 @@ "readable-stream": "^2.0.0" } }, + "fromentries": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", + "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", + "dev": true + }, "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", @@ -1455,11 +1670,17 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fsevents": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", + "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "dev": true, + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", @@ -1472,15 +1693,6 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, "glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", @@ -1494,6 +1706,15 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -1501,9 +1722,9 @@ "dev": true }, "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", "dev": true }, "growl": { @@ -1512,31 +1733,10 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", - "dev": true, - "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -1548,10 +1748,9 @@ "dev": true }, "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" }, "hash-base": { "version": "3.0.4", @@ -1572,12 +1771,13 @@ } }, "hasha": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", - "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.1.0.tgz", + "integrity": "sha512-OFPDWmzPN1l7atOV1TgBVmNtBxaIysToK6Ve9DK+vT6pYuklw/nPNT+HJbZi0KDcI6vWB+9tgvZ5YD7fA3CXcA==", "dev": true, "requires": { - "is-stream": "^1.0.1" + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" } }, "hdkey": { @@ -1606,10 +1806,10 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "html-escaper": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.0.tgz", + "integrity": "sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig==", "dev": true }, "immediate": { @@ -1623,6 +1823,12 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1638,43 +1844,52 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "into-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.0.tgz", - "integrity": "sha512-cbDhb8qlxKMxPBk/QxTtYg1DQ4CwXmadu7quG3B7nrJsgSncEreF2kwWKZFdnjc/lSNNIkFPsjI7SM0Cx/QXPw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.1.tgz", + "integrity": "sha512-krrAJ7McQxGGmvaYbB7Q1mcA+cRwg9Ij2RfWIeVesNBgVDZmzY/Fa4IpZUT3bmdRzMzdf/mzltCG2Dq99IZGBA==", "dev": true, "requires": { "from2": "^2.3.0", - "p-is-promise": "^2.0.0" + "p-is-promise": "^3.0.0" + }, + "dependencies": { + "p-is-promise": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", + "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", + "dev": true + } } }, - "invert-kv": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } }, "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", "dev": true }, "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-fullwidth-code-point": { @@ -1683,35 +1898,54 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "is-hex-prefixed": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "requires": { - "has": "^1.0.1" + "has": "^1.0.3" } }, "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "dev": true, + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "requires": { - "has-symbols": "^1.0.0" + "has-symbols": "^1.0.1" } }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -1730,75 +1964,111 @@ "dev": true }, "istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", "dev": true }, "istanbul-lib-hook": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", - "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, "requires": { - "append-transform": "^1.0.0" + "append-transform": "^2.0.0" } }, "istanbul-lib-instrument": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.0.tgz", + "integrity": "sha512-Nm4wVHdo7ZXSG30KjZ2Wl5SU/Bw7bDx1PdaiIFzEStdjs0H12mOTncn1GVYuqQSaZxpg87VGBRsVRPGD2cD1AQ==", "dev": true, "requires": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" + "@babel/core": "^7.7.5", + "@babel/parser": "^7.7.5", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" }, "dependencies": { "semver": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", - "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + }, + "dependencies": { + "rimraf": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", + "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", "dev": true } } }, "istanbul-lib-report": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", - "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, "requires": { - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "supports-color": "^6.1.0" + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" }, "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } }, "istanbul-lib-source-maps": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", - "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", "dev": true, "requires": { "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "rimraf": "^2.6.3", + "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" }, "dependencies": { @@ -1820,12 +2090,13 @@ } }, "istanbul-reports": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.4.tgz", - "integrity": "sha512-QCHGyZEK0bfi9GR215QSm+NJwFKEShbtc7tfbUdLAEzn3kKhLDDZqvljn8rPZM9v8CEOhzL1nlYoO4r1ryl67w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-2osTcC8zcOSUkImzN2EWQta3Vdi4WjjKw99P2yWx5mLnigAM0Rd5uYFn1cf2i/Ois45GkNjaoTqc5CxgMSX80A==", "dev": true, "requires": { - "handlebars": "^4.1.2" + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" } }, "js-sha3": { @@ -1850,9 +2121,9 @@ } }, "jsbi": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-2.0.5.tgz", - "integrity": "sha512-TzO/62Hxeb26QMb4IGlI/5X+QLr9Uqp1FPkwp2+KOICW+Q+vSuFj61c8pkT6wAns4WcK56X7CmSHhJeDGWOqxQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-3.1.1.tgz", + "integrity": "sha512-+HQESPaV0mRiH614z4JPVPAftcRC2p53x92lySPzUzFwJbJTMpzHz8OYUkcXPN3fOcHUe0NdVcHnCtX/1+eCrA==", "dev": true }, "jsesc": { @@ -1861,11 +2132,22 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true + "json5": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", + "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } }, "jsonfile": { "version": "2.4.0", @@ -1877,14 +2159,12 @@ } }, "keccak": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.0.0.tgz", - "integrity": "sha512-rKe/lRr0KGhjoz97cwg+oeT1Rj/Y4cjae6glArioUC8JBF9ROGZctwIaaruM7d7naovME4Q8WcQSO908A8qcyQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", + "integrity": "sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==", "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" } }, "keccakjs": { @@ -1905,15 +2185,6 @@ "graceful-fs": "^4.1.9" } }, - "lcid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, - "requires": { - "invert-kv": "^2.0.0" - } - }, "level-codec": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", @@ -2053,6 +2324,21 @@ } } }, + "level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "requires": { + "xtend": "^4.0.2" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, "level-ws": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", @@ -2084,53 +2370,60 @@ } }, "leveldown": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.0.3.tgz", - "integrity": "sha512-isfWtOQIXbGbQRI8nmU9FqCZM0klmqTAOFi0vF6G/D0O1ZgxLrSh6Xd4Zj9iVQfGt6+8jpYwkRbN07VLrxRM8w==", - "requires": { - "abstract-leveldown": "~6.0.3", - "fast-future": "~1.0.2", - "napi-macros": "~1.8.1", - "node-gyp-build": "~3.8.0" + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.4.1.tgz", + "integrity": "sha512-3lMPc7eU3yj5g+qF1qlALInzIYnkySIosR1AsUKFjL9D8fYbTLuENBAeDRZXIG4qeWOAyqRItOoLu2v2avWiMA==", + "requires": { + "abstract-leveldown": "~6.2.1", + "napi-macros": "~2.0.0", + "node-gyp-build": "~4.1.0" }, "dependencies": { "abstract-leveldown": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", - "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.2.tgz", + "integrity": "sha512-/a+Iwj0rn//CX0EJOasNyZJd2o8xur8Ce9C57Sznti/Ilt/cb6Qd8/k98A4ZOklXgTG+iAYYUs1OTG0s1eH+zQ==", "requires": { "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", "xtend": "~4.0.0" } + }, + "node-gyp-build": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", + "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" } } }, "levelup": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.0.1.tgz", - "integrity": "sha512-l7KXOkINXHgNqmz0v9bxvRnMCUG4gmShFrzFSZXXhcqFnfvKAW8NerVsTICpZtVhGOMAmhY6JsVoVh/tUPBmdg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.3.2.tgz", + "integrity": "sha512-cRTjU4ktWo59wf13PHEiOayHC3n0dOh4i5+FHr4tv4MX9+l7mqETicNq3Aj07HKlLdk0z5muVoDL2RD+ovgiyA==", "requires": { - "deferred-leveldown": "~5.0.0", + "deferred-leveldown": "~5.3.0", "level-errors": "~2.0.0", "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", "xtend": "~4.0.0" }, "dependencies": { "abstract-leveldown": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", - "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.2.tgz", + "integrity": "sha512-/a+Iwj0rn//CX0EJOasNyZJd2o8xur8Ce9C57Sznti/Ilt/cb6Qd8/k98A4ZOklXgTG+iAYYUs1OTG0s1eH+zQ==", "requires": { "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", "xtend": "~4.0.0" } }, "deferred-leveldown": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.0.1.tgz", - "integrity": "sha512-BXohsvTedWOLkj2n/TY+yqVlrCWa2Zs8LSxh3uCAgFOru7/pjxKyZAexGa1j83BaKloER4PqUyQ9rGPJLt9bqA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", "requires": { - "abstract-leveldown": "~6.0.0", + "abstract-leveldown": "~6.2.1", "inherits": "^2.0.3" } }, @@ -2143,55 +2436,52 @@ } }, "level-iterator-stream": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.1.tgz", - "integrity": "sha512-pSZWqXK6/yHQkZKCHrR59nKpU5iqorKM22C/BOHTb/cwNQ2EOZG+bovmFFGcOgaBoF3KxqJEI27YwewhJQTzsw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", "requires": { - "inherits": "^2.0.1", - "readable-stream": "^3.0.2", - "xtend": "^4.0.0" + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } } }, "readable-stream": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", - "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, "string_decoder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", - "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } } } }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -2236,19 +2526,18 @@ "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" }, "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", "dev": true, "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" + "semver": "^6.0.0" }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -2259,15 +2548,6 @@ "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", "dev": true }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -2278,17 +2558,6 @@ "safe-buffer": "^5.1.2" } }, - "mem": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - } - }, "memdown": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", @@ -2308,23 +2577,6 @@ "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", "dev": true }, - "merge-source-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", - "dev": true, - "requires": { - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "merkle-patricia-tree": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", @@ -2351,6 +2603,13 @@ "rlp": "^2.0.0", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } } }, "isarray": { @@ -2428,35 +2687,36 @@ "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } } }, "mime": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.2.tgz", - "integrity": "sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", "dev": true }, "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", "dev": true }, "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", "dev": true, "requires": { - "mime-db": "1.40.0" + "mime-db": "1.43.0" } }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -2491,13 +2751,14 @@ } }, "mocha": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", - "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.0.0.tgz", + "integrity": "sha512-CirsOPbO3jU86YKjjMzFLcXIb5YiGLUrjrXFHoJ3e2z9vWiaZVCZQ2+gtRGMPWF+nFhN6AWwLM/juzAQ6KRkbA==", "dev": true, "requires": { "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", + "chokidar": "3.3.0", "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", @@ -2510,15 +2771,15 @@ "minimatch": "3.0.4", "mkdirp": "0.5.1", "ms": "2.1.1", - "node-environment-flags": "1.0.5", + "node-environment-flags": "1.0.6", "object.assign": "4.1.0", "strip-json-comments": "2.0.1", "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "13.2.2", - "yargs-parser": "13.0.0", - "yargs-unparser": "1.5.0" + "yargs": "13.3.0", + "yargs-parser": "13.1.1", + "yargs-unparser": "1.6.0" }, "dependencies": { "glob": { @@ -2534,6 +2795,15 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } } } }, @@ -2549,32 +2819,19 @@ "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" }, "napi-macros": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-1.8.2.tgz", - "integrity": "sha512-Tr0DNY4RzTaBG2W2m3l7ZtFuJChTH6VZhXVhkGGjF/4cZTt+i8GcM9ozD+30Lmr4mDoZ5Xx34t2o4GJqYWDGcg==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", + "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" }, - "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", - "dev": true - }, - "nested-error-stacks": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", - "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "node-addon-api": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.0.tgz", + "integrity": "sha512-ASCL5U13as7HhOExbT6OlWJJUV/lLzL2voOSP1UVehpRD8FbSrSDjfScK/KwAvVTI5AS6r4VwbOMlIqtvRidnA==" }, "node-environment-flags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", - "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", + "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", "dev": true, "requires": { "object.getownpropertydescriptors": "^2.0.3", @@ -2582,78 +2839,253 @@ }, "dependencies": { "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true } } }, "node-gyp-build": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.8.0.tgz", - "integrity": "sha512-bYbpIHyRqZ7sVWXxGpz8QIRug5JZc/hzZH4GbdT9HTZi6WmKCZ8GLvP8OZ9TTiIBvwPFKgtGrlWQSXDAvYdsPw==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.0.tgz", + "integrity": "sha512-4oiumOLhCDU9Rronz8PZ5S4IvT39H5+JEv/hps9V8s7RSLhsac0TCP78ulnHXOo8X1wdpPiTayGlM1jr4IbnaQ==" }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, "requires": { - "path-key": "^2.0.0" + "process-on-spawn": "^1.0.0" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, "nyc": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", - "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.0.tgz", + "integrity": "sha512-qcLBlNCKMDVuKb7d1fpxjPR8sHeMVX0CHarXAVzrVWoFrigCkYR8xcrjfXSPi5HXM7EU78L6ywO7w1c5rZNCNg==", "dev": true, "requires": { - "archy": "^1.0.0", - "caching-transform": "^3.0.2", - "convert-source-map": "^1.6.0", - "cp-file": "^6.2.0", - "find-cache-dir": "^2.1.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.5", - "istanbul-lib-hook": "^2.0.7", - "istanbul-lib-instrument": "^3.3.0", - "istanbul-lib-report": "^2.0.8", - "istanbul-lib-source-maps": "^3.0.6", - "istanbul-reports": "^2.2.4", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.0", "js-yaml": "^3.13.1", - "make-dir": "^2.1.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.3", + "make-dir": "^3.0.0", + "node-preload": "^0.2.0", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.2.3", - "uuid": "^3.3.2", - "yargs": "^13.2.2", - "yargs-parser": "^13.0.0" + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "uuid": "^3.3.3", + "yargs": "^15.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "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" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "rimraf": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", + "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.1.0.tgz", + "integrity": "sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^16.1.0" + } + }, + "yargs-parser": { + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz", + "integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } } }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" + }, "object-keys": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", @@ -2663,7 +3095,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, "requires": { "define-properties": "^1.1.2", "function-bind": "^1.1.1", @@ -2674,19 +3105,17 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" } } }, "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "dev": true, + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "once": { @@ -2697,61 +3126,16 @@ "wrappy": "1" } }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-locale": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "dev": true, - "requires": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", - "dev": true - }, "p-limit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -2766,6 +3150,15 @@ "p-limit": "^2.0.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -2773,27 +3166,17 @@ "dev": true }, "package-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", - "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, "requires": { "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", + "hasha": "^5.0.0", "lodash.flattendeep": "^4.4.0", "release-zalgo": "^1.0.0" } }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -2806,9 +3189,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-parse": { @@ -2817,23 +3200,6 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, "pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -2846,19 +3212,55 @@ "sha.js": "^2.4.8" } }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "picomatch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", + "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", "dev": true }, "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "find-up": "^3.0.0" + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } } }, "process-nextick-args": { @@ -2866,6 +3268,15 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -2876,20 +3287,10 @@ "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.1.tgz", + "integrity": "sha512-Cxm7/SS/y/Z3MHWSxXb8lIFqgqBowP5JMlTUFyJN88y0SGQhVmZnqFK/PeuMX9LzUyWsqqhNxIyg0jlzq946yA==", "dev": true }, "randombytes": { @@ -2900,26 +3301,10 @@ "safe-buffer": "^5.1.0" } }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "read-pkg-up": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", - "dev": true, - "requires": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" - } + "reachdown": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.0.0.tgz", + "integrity": "sha512-Ty7X/t52GwgRam3SMpZC2grmutuUarkiD4sVhjM8g8/5NlX8PAEsYO/pyx6nTTqS9udee1j1BxaAS/f6Rm8SMw==" }, "readable-stream": { "version": "2.3.6", @@ -2950,6 +3335,15 @@ } } }, + "readdirp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -2987,15 +3381,15 @@ } }, "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "requires": { "glob": "^7.1.3" } @@ -3016,6 +3410,13 @@ "requires": { "bn.js": "^4.11.1", "safe-buffer": "^5.1.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } } }, "rustbn.js": { @@ -3067,12 +3468,19 @@ "elliptic": "^6.4.1", "nan": "^2.13.2", "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } } }, "seedrandom": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.1.tgz", - "integrity": "sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg==" + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" }, "semaphore": { "version": "1.1.0", @@ -3100,26 +3508,26 @@ } }, "sha3": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.3.tgz", - "integrity": "sha512-sOWDZi8cDBRkLfWOw18wvJyNblXDHzwMGnRWut8zNNeIeLnmMRO17bjpLc7OzMuj1ASUgx2IyohzUCAl+Kx5vA==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.6.tgz", + "integrity": "sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ==", "requires": { "nan": "2.13.2" } }, "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "shebang-regex": "^3.0.0" } }, "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "signal-exit": { @@ -3129,181 +3537,37 @@ "dev": true }, "solc": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.5.10.tgz", - "integrity": "sha512-Stdrh/MDkopsXYPRzPehTNYuV80Grr2CnQMuFvWj+EeRVbe3piGHxW47KebWn1sGdmK8FLaMfUehccqJP0KovQ==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.1.tgz", + "integrity": "sha512-iKqNYps2p++x8L9sBg7JeAJb7EmW8VJ/2asAzwlLYcUhj86AzuWLe94UTSQHv1SSCCj/x6lya8twvXkZtlTbIQ==", "dev": true, "requires": { "command-exists": "^1.2.8", + "commander": "3.0.2", "fs-extra": "^0.30.0", - "keccak": "^1.0.2", + "js-sha3": "0.8.0", "memorystream": "^0.3.1", "require-from-string": "^2.0.0", "semver": "^5.5.0", - "tmp": "0.0.33", - "yargs": "^11.0.0" + "tmp": "0.0.33" }, "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", "dev": true }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "dev": true, - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", "dev": true }, "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "tmp": { @@ -3314,47 +3578,6 @@ "requires": { "os-tmpdir": "~1.0.2" } - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "yargs": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", - "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - } - }, - "yargs-parser": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } } } }, @@ -3365,9 +3588,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", + "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -3383,51 +3606,30 @@ } }, "spawn-wrap": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", - "integrity": "sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, "requires": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", "signal-exit": "^3.0.2", - "which": "^1.3.0" - } - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "which": "^2.0.1" + }, + "dependencies": { + "rimraf": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", + "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, - "spdx-license-ids": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", - "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", - "dev": true - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -3444,6 +3646,24 @@ "strip-ansi": "^4.0.0" } }, + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, "string_decoder": { "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", @@ -3459,15 +3679,9 @@ } }, "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, "strip-hex-prefix": { @@ -3485,32 +3699,34 @@ "dev": true }, "subleveldown": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-4.0.0.tgz", - "integrity": "sha512-Cvra766rz7lB+F4Lw5ofA1TTeiHNCUTdClH2mSWDtrpszNt2GHPRe7WTEQhti0WO+VngIi36NeNQOx1JA6IV1A==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-4.1.4.tgz", + "integrity": "sha512-njpSBP/Bxh7EahraG6IhR6goOH2ffMTMVt7Ud+k/OhNFHrrmuvK+XYfauI8KnjCm0w381cUF43pejlWeJMZChA==", "requires": { - "abstract-leveldown": "^6.0.2", - "encoding-down": "^6.0.1", + "abstract-leveldown": "^6.1.1", + "encoding-down": "^6.2.0", "inherits": "^2.0.3", "level-option-wrap": "^1.1.0", - "levelup": "^4.0.1" + "levelup": "^4.3.1", + "reachdown": "^1.0.0" }, "dependencies": { "abstract-leveldown": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.0.3.tgz", - "integrity": "sha512-jzewKKpZbaYUa6HTThnrl+GrJhzjEAeuc7hTVpZdzg7kupXZFoqQDFwyOwLNbmJKJlmzw8yiipMPkDiuKkT06Q==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.2.tgz", + "integrity": "sha512-/a+Iwj0rn//CX0EJOasNyZJd2o8xur8Ce9C57Sznti/Ilt/cb6Qd8/k98A4ZOklXgTG+iAYYUs1OTG0s1eH+zQ==", "requires": { "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", "xtend": "~4.0.0" } }, "encoding-down": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.0.2.tgz", - "integrity": "sha512-oAEANslmNb64AF4kvHXjTxB7KecwD7X0qf8MffMfhpjP6gjGcnCTOkRgps/1yUNeR4Bhe6ckN6aAzZz+RIYgTw==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", + "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", "requires": { - "abstract-leveldown": "^6.0.0", + "abstract-leveldown": "^6.2.1", "inherits": "^2.0.3", "level-codec": "^9.0.0", "level-errors": "^2.0.0" @@ -3532,21 +3748,22 @@ } }, "superagent": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.0.5.tgz", - "integrity": "sha512-5fnihpNqJfDJHxeIkqlXKFDOW5t4WUFV8Ba1erxdWT0RySqjgAW6Hska0xNYEpAfaoMzubn77GROm/XlkssOoQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.2.1.tgz", + "integrity": "sha512-46b4Lkwnlz7Ebdv2FBbfuqb3kVkG1jV/SK3EW6NnwL9a3T4h5hHtegNEQfbXvTFbDoUZXId4W3dMgap2f6ic1g==", "dev": true, "requires": { "component-emitter": "^1.3.0", "cookiejar": "^2.1.2", "debug": "^4.1.1", - "form-data": "^2.3.3", + "fast-safe-stringify": "^2.0.7", + "form-data": "^3.0.0", "formidable": "^1.2.1", "methods": "^1.1.2", - "mime": "^2.4.2", - "qs": "^6.7.0", - "readable-stream": "^3.3.0", - "semver": "^6.0.0" + "mime": "^2.4.4", + "qs": "^6.9.1", + "readable-stream": "^3.4.0", + "semver": "^6.3.0" }, "dependencies": { "debug": { @@ -3559,9 +3776,9 @@ } }, "readable-stream": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", - "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -3569,19 +3786,25 @@ "util-deprecate": "^1.0.1" } }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "dev": true + }, "semver": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", - "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, "string_decoder": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", - "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } } } @@ -3596,15 +3819,14 @@ } }, "test-exclude": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", - "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "requires": { - "glob": "^7.1.3", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^2.0.0" + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" } }, "tmp": { @@ -3616,11 +3838,10 @@ } }, "tmp-promise": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-1.1.0.tgz", - "integrity": "sha512-8+Ah9aB1IRXCnIOxXZ0uFozV1nMU5xiu7hhFVUSxZ3bYu+psD4TzagCzVbexUCgNNGJnsmNDQlS4nG3mTyoNkw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-2.0.2.tgz", + "integrity": "sha512-zl71nFWjPKW2KXs+73gEk8RmqvtAeXPxhWDkTUoa3MSMkjq3I+9OeknjF178MQoMYsdqL730hfzvNfEkePxq9Q==", "requires": { - "bluebird": "^3.5.0", "tmp": "0.1.0" } }, @@ -3630,50 +3851,69 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } }, "ts-node": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.1.0.tgz", - "integrity": "sha512-34jpuOrxDuf+O6iW1JpgTRDFynUZ1iEqtYruBqh35gICNjN8x+LpVcPAcwzLPi9VU6mdA3ym+x233nZmZp445A==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.4.tgz", + "integrity": "sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw==", "dev": true, "requires": { "arg": "^4.1.0", - "diff": "^3.1.0", + "diff": "^4.0.1", "make-error": "^1.1.1", "source-map-support": "^0.5.6", "yn": "^3.0.0" + }, + "dependencies": { + "diff": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", + "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "dev": true + } } }, "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, "tslint": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz", - "integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==", + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", + "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", - "diff": "^3.2.0", + "diff": "^4.0.1", "glob": "^7.1.1", - "js-yaml": "^3.13.0", + "js-yaml": "^3.13.1", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", "tslib": "^1.8.0", "tsutils": "^2.29.0" + }, + "dependencies": { + "diff": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", + "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "dev": true + } } }, "tsutils": { @@ -3685,36 +3925,31 @@ "tslib": "^1.8.1" } }, - "typescript": { - "version": "3.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz", - "integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==", + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, - "uWebSockets.js": { - "version": "github:uNetworking/uWebSockets.js#e7552889a50a7ffa654c41c99a9bad46dd0024c5", - "from": "github:uNetworking/uWebSockets.js#v15.11.0" - }, - "uglify-js": { - "version": "3.5.12", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.12.tgz", - "integrity": "sha512-KeQesOpPiZNgVwJj8Ge3P4JYbQHUdZzpx6Fahy6eKAYRSV4zhVmLXoC+JtOeYxcHCHTve8RG1ZGdTvpeOUM26Q==", + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, - "optional": true, "requires": { - "commander": "~2.20.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } + "is-typedarray": "^1.0.0" } }, + "typescript": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", + "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", + "dev": true + }, + "uWebSockets.js": { + "version": "github:uNetworking/uWebSockets.js#da161f254495c7dd2925f778b36310b6f49bcb01", + "from": "github:uNetworking/uWebSockets.js#v16.4.0" + }, "utf-8-validate": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", @@ -3742,25 +3977,24 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -3781,55 +4015,41 @@ "string-width": "^1.0.2 || 2" } }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" }, "dependencies": { "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^4.1.0" } } } @@ -3840,24 +4060,22 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.2.tgz", - "integrity": "sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.1.tgz", + "integrity": "sha512-JPStrIyyVJ6oCSz/691fAjFtefZ6q+fP6tm+OS4Qw6o+TGQxNp1ziY2PgS+X/m0V8OWhZiO/m4xSj+Pr4RrZvw==", "dev": true, "requires": { - "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" } }, "ws": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.0.0.tgz", - "integrity": "sha512-cknCal4k0EAOrh1SHHPPWWh4qm93g1IuGGGwBjWkXmCG7LsDtL8w9w+YVfaF+KSVwiHQKDIMsSLBVftKf9d1pg==", - "dev": true, - "requires": { - "async-limiter": "^1.0.0" - } + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz", + "integrity": "sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A==", + "dev": true }, "xtend": { "version": "4.0.1", @@ -3871,27 +4089,26 @@ "dev": true }, "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "yargs": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", - "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", "dev": true, "requires": { - "cliui": "^4.0.0", + "cliui": "^5.0.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", - "os-locale": "^3.1.0", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.0.0" + "yargs-parser": "^13.1.1" }, "dependencies": { "ansi-regex": { @@ -3923,9 +4140,9 @@ } }, "yargs-parser": { - "version": "13.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", - "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -3933,64 +4150,28 @@ } }, "yargs-unparser": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", - "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", "dev": true, "requires": { "flat": "^4.1.0", - "lodash": "^4.17.11", - "yargs": "^12.0.5" + "lodash": "^4.17.15", + "yargs": "^13.3.0" }, "dependencies": { - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "yargs": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1 || ^4.0.0", - "yargs-parser": "^11.1.1" - } - }, - "yargs-parser": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } }, "yn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz", - "integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true } } diff --git a/package.json b/package.json index f8ca405df2..22ca2ecfe7 100644 --- a/package.json +++ b/package.json @@ -25,46 +25,46 @@ }, "dependencies": { "bip39": "3.0.2", - "bn.js": "4.11.8", + "bn.js": "5.1.1", "cachedown": "1.0.0", - "emittery": "0.4.1", + "emittery": "0.5.1", "ethereumjs-account": "3.0.0", - "ethereumjs-block": "2.2.0", + "ethereumjs-block": "2.2.2", "ethereumjs-tx": "1.3.7", - "ethereumjs-util": "6.1.0", - "ethereumjs-vm": "3.0.0", + "ethereumjs-util": "6.2.0", + "ethereumjs-vm": "4.1.2", "ethereumjs-wallet": "0.6.3", - "keccak": "2.0.0", - "leveldown": "5.0.3", - "levelup": "4.0.1", + "keccak": "3.0.0", + "leveldown": "5.4.1", + "levelup": "4.3.2", "merkle-patricia-tree": "3.0.0", - "seedrandom": "3.0.1", - "subleveldown": "4.0.0", - "tmp-promise": "1.1.0", - "uWebSockets.js": "github:uNetworking/uWebSockets.js#v15.11.0" + "seedrandom": "3.0.5", + "subleveldown": "4.1.4", + "tmp-promise": "2.0.2", + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v16.4.0" }, "devDependencies": { "@types/ethereumjs-tx": "^1.0.1", - "@types/mocha": "^5.2.6", - "@types/node": "^10.12.0", + "@types/mocha": "^5.2.7", + "@types/node": "^13.1.4", "@types/seedrandom": "^2.4.28", - "@types/superagent": "^4.1.1", + "@types/superagent": "^4.1.4", "@types/uws": "^0.13.2", - "@types/ws": "^6.0.1", + "@types/ws": "^6.0.4", "bufferutil": "4.0.1", - "cross-env": "^5.2.0", - "into-stream": "^5.1.0", - "jsbi": "^2.0.5", - "mocha": "^6.1.4", - "nyc": "^14.1.1", - "solc": "0.5.10", - "source-map-support": "^0.5.12", - "superagent": "5.0.5", - "ts-node": "^8.1.0", - "tslint": "^5.16.0", - "typescript": "^3.4.5", + "cross-env": "^6.0.3", + "into-stream": "^5.1.1", + "jsbi": "^3.1.1", + "mocha": "^7.0.0", + "nyc": "^15.0.0", + "solc": "0.6.1", + "source-map-support": "^0.5.16", + "superagent": "5.2.1", + "ts-node": "^8.5.4", + "tslint": "^5.20.1", + "typescript": "^3.7.4", "utf-8-validate": "^5.0.2", - "ws": "^7.0.0" + "ws": "^7.2.1" }, "optionalDependencies": { "bigint-buffer": "1.1.2" diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 483c951c59..ee80a91cdd 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -13,7 +13,7 @@ import AccountManager from "./components/account-manager"; import Heap from "../../utils/heap"; import Transaction from "../../types/transaction"; -const VM = require("ethereumjs-vm"); +const VM = require("ethereumjs-vm").default; export enum Status { // Flags diff --git a/src/ledgers/ethereum/wallet.ts b/src/ledgers/ethereum/wallet.ts index 7fb91d66e7..a33ba7b437 100644 --- a/src/ledgers/ethereum/wallet.ts +++ b/src/ledgers/ethereum/wallet.ts @@ -69,8 +69,7 @@ export default class Wallet { const account = accounts[arg]; if (account == null) { throw new Error( - `Account at index ${addressOrIndex} not found. Max index available - is ${l - 1}.` + `Account at index ${arg} not found. Max index available is ${l - 1}.` ); } address = account.address.toString().toLowerCase(); diff --git a/src/server.ts b/src/server.ts index f60921e326..663ac2d3ea 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,7 +1,5 @@ import ServerOptions, {getDefault as getDefaultServerOptions} from "./options/server-options"; -export type ServerOptions = ServerOptions; - import uWS, { TemplatedApp, us_listen_socket } from "uWebSockets.js"; import Provider from "./provider"; import WebsocketServer from "./servers/ws-server"; diff --git a/src/types/account.ts b/src/types/account.ts index e28fda8ecf..caf220dcb3 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -26,6 +26,6 @@ export default class Account { } } public serialize() { - return rlp.encode(Buffer.from([this.nonce, this.balance, this.stateRoot, this.codeHash])); + return rlp.encode(Buffer.concat([this.nonce.toBuffer(), this.balance.toBuffer(), this.stateRoot, this.codeHash])); } } diff --git a/test/server.ts b/test/server.ts index 24cf7668d2..2e89f93e6d 100644 --- a/test/server.ts +++ b/test/server.ts @@ -3,7 +3,7 @@ import * as assert from "assert"; import request from "superagent"; import WebSocket from "ws"; import Server from "../src/server"; -import { ServerOptions } from "../src/server"; +import ServerOptions from "../src/options/server-options"; import http from "http"; import intoStream from "into-stream"; diff --git a/test/temp-tests.ts b/test/temp-tests.ts index d525688422..2209ff9160 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -95,7 +95,7 @@ describe("Accounts", () => { unlocked_accounts: [99] }); assert.throws(ganacheInitFn, { - message: "addressOrIndex is not defined" + message: "Account at index 99 not found. Max index available is 9." }); }); @@ -109,7 +109,7 @@ describe("Accounts", () => { }); }); - it("unlocks accounts via unlock_accounts (both string and numbered numbers)", async () => { + xit("unlocks accounts via unlock_accounts (both string and numbered numbers)", async () => { const p = Ganache.provider({ locked: true, unlocked_accounts: ["0", 1] @@ -166,12 +166,13 @@ describe("Accounts", () => { const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); }); - it("runs eth_call", async () => { + xit("runs eth_call", async () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] }); const accounts = await p.send("eth_accounts"); const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); + assert(true); }); }); \ No newline at end of file diff --git a/typings/uWebsockets.js.ts b/typings/uWebsockets.js.ts index 457bf0bdb7..edc9b7c569 100644 --- a/typings/uWebsockets.js.ts +++ b/typings/uWebsockets.js.ts @@ -6,9 +6,6 @@ enum ListenOptions { } // uWebSockets.js doesn't include these in its TS def file. declare module "uWebSockets.js" { - export const DISABLED:number; - export const SHARED_COMPRESSOR:number; - export const DEDICATED_COMPRESSOR:number; export interface TemplatedApp { listen(port: number, options: ListenOptions, cb: (listenSocket: any) => void): TemplatedApp; From e6f2113950973bb839014ca6dd31d97623c48239 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 8 Jan 2020 13:22:09 -0500 Subject: [PATCH 105/691] Add transaction receipts database --- src/ledgers/ethereum/database.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index 41a9d88c43..387ae7412d 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -48,7 +48,7 @@ export default class Database extends Emittery { const store = this.options.db; let db; if (store) { - db = await levelup(store as any, levelupOptions); + db = levelup(store as any, levelupOptions); } else { let directory = this.options.db_path; if (!directory) { @@ -61,14 +61,14 @@ export default class Database extends Emittery { } this.directory = directory; const store = encode(leveldown(directory), levelupOptions); - db = await levelup(store, {}); + db = levelup(store, {}); } // don't continue if we closed while we were waiting for the db if (this.closed) return this._cleanup(); const open = db.open(); - this.trie = sub(db, "trie", levelupOptions); + this.trie = sub(db, "T", levelupOptions); this.db = db; await open; @@ -76,11 +76,11 @@ export default class Database extends Emittery { // don't continue if we closed while we were waiting for it to open if (this.closed) return this._cleanup(); - this.blocks = sub(db, "blocks", levelupOptions); - this.transactions = sub(db, "transactions", levelupOptions); + this.blocks = sub(db, "b", levelupOptions); + this.transactions = sub(db, "t", levelupOptions); + this.transactionReceipts = sub(db, "r", levelupOptions); - await this.emit("ready"); - return; + return this.emit("ready"); } /** From c86991f129dd8cbc903c19108ff661cb2588870c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 8 Jan 2020 13:22:35 -0500 Subject: [PATCH 106/691] Persist transactions to the db --- src/ledgers/ethereum/blockchain.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 483c951c59..0451de621c 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -99,7 +99,6 @@ export default class Blockchain extends Emittery { setTimeout(mine, minerInterval, this.transactions.transactionPool.executables); } - miner.on("block", async (blockData: any) => { const previousBlock = await lastBlock; const previousHeader = previousBlock.value.header; @@ -115,11 +114,18 @@ export default class Blockchain extends Emittery { receiptTrie: blockData.receiptTrie.root, stateRoot: this.trie.root }); - // TODO: save the transactions, et al, too - // blockData.blockTransactions this.blocks.latest = block; - lastBlock = this.blocks.set(block); + let promises: Promise[] = []; + blockData.blockTransactions.forEach((tx: Transaction) => { + const hash = tx.hash(); + const s = tx.serialize(); + promises.push(this.transactions.set(hash, s)); + // TODO: figure out transaction receipts! + // promises.push(this.transactionReceipts.set(hash, s)); + }); + const pendingLastBlock = this.blocks.set(block); + lastBlock = Promise.all(promises).then(() => pendingLastBlock); }); this.blocks.earliest = this.blocks.latest = await lastBlock; From 2dd32d25f98cf849e48c230f893d384b00b31510 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 8 Jan 2020 13:22:51 -0500 Subject: [PATCH 107/691] Make sure we add transactions to the blockData --- src/ledgers/ethereum/miner.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index 8689dc8364..9925049749 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -176,6 +176,7 @@ export default class Miner extends Emittery { } block.transactions[counter] = best as any; + blockData.blockTransactions[counter] = best; counter++ // if we don't have enough gas left for even the smallest of From 4c8348db08182606474efc278841dd3efb82cae0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 8 Jan 2020 13:23:11 -0500 Subject: [PATCH 108/691] Add proper types to the TransactionManager --- src/ledgers/ethereum/components/transaction-manager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ledgers/ethereum/components/transaction-manager.ts b/src/ledgers/ethereum/components/transaction-manager.ts index 0319e2ad98..6ee0ee7cdd 100644 --- a/src/ledgers/ethereum/components/transaction-manager.ts +++ b/src/ledgers/ethereum/components/transaction-manager.ts @@ -6,14 +6,14 @@ import Blockchain from "../blockchain"; export type TransactionManagerOptions = TransactionPoolOptions; -export default class TransactionManager extends Manager { +export default class TransactionManager extends Manager { public transactionPool: TransactionPool; constructor(blockchain: Blockchain, base: levelup.LevelUp, options: TransactionManagerOptions) { super(blockchain, base, Transaction); this.transactionPool = new TransactionPool(blockchain, options); - this.transactionPool.on("drain", (transactions: any[]) => { + this.transactionPool.on("drain", (transactions: Transaction[]) => { // TODO: create pending block? }); } From 2d57d20fb7f66c6172feb91bc3e0f20ca258d1c4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 8 Jan 2020 14:23:07 -0500 Subject: [PATCH 109/691] FIx this weird levelup import syntax --- src/ledgers/ethereum/components/block-manager.ts | 2 +- src/ledgers/ethereum/components/transaction-manager.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ledgers/ethereum/components/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts index dcbccd90bb..09766e728f 100644 --- a/src/ledgers/ethereum/components/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -1,7 +1,7 @@ import EthereumJsBlock from "ethereumjs-block"; import Manager from "./manager"; import Tag from "../../../types/tags"; -import levelup = require("levelup"); +import levelup from "levelup"; import Blockchain from "../blockchain"; export default class BlockManager extends Manager { diff --git a/src/ledgers/ethereum/components/transaction-manager.ts b/src/ledgers/ethereum/components/transaction-manager.ts index 6ee0ee7cdd..f399744ba7 100644 --- a/src/ledgers/ethereum/components/transaction-manager.ts +++ b/src/ledgers/ethereum/components/transaction-manager.ts @@ -1,7 +1,7 @@ import Transaction from "../../../types/transaction"; import Manager from "./manager"; import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; -import levelup = require("levelup"); +import levelup from "levelup"; import Blockchain from "../blockchain"; export type TransactionManagerOptions = TransactionPoolOptions; From 73e14f0736be43c73073bed5976ef58dcfacd50c Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Wed, 8 Jan 2020 14:42:35 -0500 Subject: [PATCH 110/691] Upgrade ethereumjs-tx to ts native version --- npm-shrinkwrap.json | 59 ++------------- package.json | 3 +- .../ethereum/components/transaction-pool.ts | 4 +- src/types/transaction.ts | 73 ++++--------------- 4 files changed, 22 insertions(+), 117 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c62ea406d3..52d710627e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -257,16 +257,6 @@ "integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==", "dev": true }, - "@types/ethereumjs-tx": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/ethereumjs-tx/-/ethereumjs-tx-1.0.1.tgz", - "integrity": "sha512-UtucmY/WoMCDhNebyFJQ+AevyFGeTgh8UYZE1aWqIRkk90E+eKWgGV2lAVjkg/gXqxLkJYZ0RcV1J09K9xlSvw==", - "dev": true, - "requires": { - "@types/bn.js": "*", - "@types/node": "*" - } - }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -1114,11 +1104,6 @@ } } }, - "ethereum-common": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/ethereum-common/-/ethereum-common-0.0.18.tgz", - "integrity": "sha1-L9w1dvIykDNYl26znaeDIT/5Uj8=" - }, "ethereumjs-account": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", @@ -1325,46 +1310,12 @@ "integrity": "sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ==" }, "ethereumjs-tx": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz", - "integrity": "sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", "requires": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } - } - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - } + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" } }, "ethereumjs-util": { diff --git a/package.json b/package.json index 22ca2ecfe7..d7ab75aa27 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "emittery": "0.5.1", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.2", - "ethereumjs-tx": "1.3.7", + "ethereumjs-tx": "^2.1.2", "ethereumjs-util": "6.2.0", "ethereumjs-vm": "4.1.2", "ethereumjs-wallet": "0.6.3", @@ -44,7 +44,6 @@ "uWebSockets.js": "github:uNetworking/uWebSockets.js#v16.4.0" }, "devDependencies": { - "@types/ethereumjs-tx": "^1.0.1", "@types/mocha": "^5.2.7", "@types/node": "^13.1.4", "@types/seedrandom": "^2.4.28", diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index 7151615ef5..9efe7889a8 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -182,13 +182,13 @@ export default class TransactionPool extends Emittery { // Transactions can't be negative. This may never happen using RLP // decoded transactions but may occur if you create a transaction using // the RPC for example. - if (transaction.value < 0) { + if (Quantity.from(transaction.value).toBigInt() < 0) { return new Error("Transaction value cannot be negative"); } // Should supply enough intrinsic gas const gas = transaction.calculateIntrinsicGas(); - if (transaction.gasPrice < gas) { + if (Quantity.from(transaction.gasPrice).toBigInt() < gas) { return new Error("intrisic gas too low"); } diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 8ed24cbd7e..5602825bef 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -101,14 +101,13 @@ const MAX_UINT64 = (1n << 64n) - 1n; // } // } - - - -const EthereumJsTransaction = require("ethereumjs-tx"); -const EthereumJsFakeTransaction = require("ethereumjs-tx/fake"); -const ethUtil = require("ethereumjs-util"); -const assert = require("assert"); -const rlp = require("rlp"); +// const EthereumJsTransaction = require('ethereumjs-tx').Transaction +// const EthereumJsFakeTransaction = require('ethereumjs-tx').FakeTransaction +import { Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction } from "ethereumjs-tx"; +// import EthereumJsFakeTransaction from "ethereumjs-tx/dist/fake"; +import * as ethUtil from "ethereumjs-util"; +import assert from "assert"; +import rlp from "rlp"; const sign = EthereumJsTransaction.prototype.sign; const fakeHash = function () { @@ -259,11 +258,13 @@ function initData(tx: any, data: any) { export default class Transaction extends EthereumJsTransaction { type: number; - v: number; - r: number; - s: number; + v: Buffer; + r: Buffer; + s: Buffer; raw: any; _chainId: any; + _hash: Buffer; + readonly from: Buffer; /** * @param {Object} [data] The data for this Transaction. * @param {Number} type The `Transaction.types` bit flag for this transaction @@ -289,7 +290,7 @@ export default class Transaction extends EthereumJsTransaction { cost(): bigint { return Quantity.from(this.gasPrice).toBigInt() - * Quantity.from(this.gas).toBigInt() + * Quantity.from(this.gasLimit).toBigInt() + Quantity.from(this.value).toBigInt(); } @@ -298,7 +299,7 @@ export default class Transaction extends EthereumJsTransaction { * @param data The transaction's data */ public calculateIntrinsicGas(): bigint { - const data = this.input; + const data = this.data; // Set the starting gas for the raw transaction let gas = params.TRANSACTION_GAS; @@ -460,52 +461,6 @@ export default class Transaction extends EthereumJsTransaction { return resultJSON; } - /** - * Computes a sha3-256 hash of the serialized tx - * - * This method is nearly identical to ethereumjs-tx hash with the exception of - * the v,r,s value setting when _chainId > 0. Because the `_chainId` in our - * implementation is calculated whenever the v is updated we have to make sure - * we don't recalc the chainId when we set the v to soemthing else. - * - * Note: If the transaction is a fake transaction this hash method gets - * overridden in the constructor. - * - * @param {Boolean} [includeSignature=true] whether or not to inculde the signature - * @return {Buffer} - */ - hash(includeSignature = true) { - // EIP155 spec: - // when computing the hash of a transaction for purposes of signing or recovering, - // instead of hashing only the first six elements (ie. nonce, gasprice, startgas, to, value, data), - // hash nine elements, with v replaced by CHAIN_ID, r = 0 and s = 0 - - let items; - if (includeSignature) { - items = this.raw; - } else { - // cache the chainId here - const chainId = this._chainId; - if (chainId > 0) { - const cacheRaw = this.raw.slice(); - // Setting `this.v` changes the value of `this._chainId` - this.v = chainId; - this.r = 0; - this.s = 0; - - items = this.raw; - this.raw = cacheRaw; - // set the chainId back to its original value here. - this._chainId = chainId; - } else { - items = this.raw.slice(0, 6); - } - } - - // create hash - return ethUtil.rlphash(items); - } - generateReceipt = (result: any, block: any, transactionIndex: number) => { const vmResult = result.vm; const status = vmResult.exception; From 74d3438afa12c4ff1a7fd9f5507d014d2238fb2d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 8 Jan 2020 15:55:30 -0500 Subject: [PATCH 111/691] Update transaction running to new vm --- src/ledgers/ethereum/blockchain.ts | 4 ++-- src/ledgers/ethereum/miner.ts | 4 +--- src/types/transaction.ts | 30 +++++++++++++++--------------- test/temp-tests.ts | 3 +-- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 64166ea263..944d43351c 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -209,8 +209,8 @@ export default class Blockchain extends Emittery { await promisify(stateManager.setStateRoot.bind(stateManager))(parentBlock.value.header.stateRoot); transaction.block = block; transaction.caller = transaction.from; - const result = await promisify(vm.runCall.bind(vm))(transaction); - return result.vm.returnValue || "0x"; + const result = await vm.runCall(transaction); + return result.execResult.returnValue || "0x"; } /** diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index 9925049749..5121e5c218 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -38,7 +38,6 @@ export default class Miner extends Emittery { private _isMining: boolean = false; private readonly options: MinerOptions; private readonly vm: any; - private readonly _runTx: ({ tx: { } }) => Promise; private readonly _checkpoint: () => Promise; private readonly _commit: () => Promise; private readonly _revert: () => Promise; @@ -49,7 +48,6 @@ export default class Miner extends Emittery { super(); this.vm = vm; this.options = options; - this._runTx = promisify(vm.runTx.bind(vm)); const stateManager = vm.stateManager; this._checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); this._commit = promisify(stateManager.commit.bind(stateManager)); @@ -133,7 +131,7 @@ export default class Miner extends Emittery { block }; await this._checkpoint(); - const result = await this._runTx(runArgs).catch((err: Error) => ({ err })); + const result = await this.vm.runTx(runArgs).catch((err: Error) => ({ err })); if (result.err) { await this._revert(); const errorMessage = result.err.message; diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 5602825bef..f00f516f4e 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -107,7 +107,7 @@ import { Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFake // import EthereumJsFakeTransaction from "ethereumjs-tx/dist/fake"; import * as ethUtil from "ethereumjs-util"; import assert from "assert"; -import rlp from "rlp"; +import {decode as rlpDecode, encode as rlpEncode} from "rlp"; const sign = EthereumJsTransaction.prototype.sign; const fakeHash = function () { @@ -213,9 +213,9 @@ function initData(tx: any, data: any) { if (data) { if (typeof data === "string") { data = Data.from(data).toBuffer(); - data = rlp.decode(data); + data = rlpDecode(data); } else if (Buffer.isBuffer(data)) { - data = rlp.decode(data); + data = rlpDecode(data); } const self = tx; if (Array.isArray(data)) { @@ -462,30 +462,30 @@ export default class Transaction extends EthereumJsTransaction { } generateReceipt = (result: any, block: any, transactionIndex: number) => { - const vmResult = result.vm; - const status = vmResult.exception; - const bitvector = result.bloom.bitvector; + const vmResult = result.execResult; + const status = vmResult.exceptionError ? 0 : 1; const gasUsed = result.gasUsed; - const logs = vmResult.logs; - const rawReceipt = rlp.encode([ + const logsBloom = result.bloom.bitvector; + const logs = vmResult.logs || Buffer.alloc(0); + const raw = rlpEncode([ status, gasUsed, - bitvector, + logsBloom, logs ]); return { transactionHash: this.hash(), - transactionIndex: transactionIndex, + transactionIndex, blockHash: null as Buffer, blockNumber: block.header.number, from: this.from, to: this.to, - gasUsed: gasUsed, + gasUsed, cumulativeGasUsed: block.gasUsed, contractAddress: result.createdAddress, - logs: logs, - status: status, - logsBloom: bitvector, + logs, + status, + logsBloom, v: this.v, r: this.r, s: this.s, @@ -493,7 +493,7 @@ export default class Transaction extends EthereumJsTransaction { // TODO: make this return the things return {}; }, - raw: rawReceipt + raw } } }; diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 2209ff9160..db78c56f0c 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -45,7 +45,6 @@ describe("Accounts", () => { assert.strictEqual(accounts[0], expectedAddress); }); - it("eth_sendTransaction", async() => { const options = { mnemonic }; const p = Ganache.provider(options); @@ -166,7 +165,7 @@ describe("Accounts", () => { const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); }); - xit("runs eth_call", async () => { + it("runs eth_call", async () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] From 9155d15c2de156736fa1be1015b0a85268a4f109 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 8 Jan 2020 18:25:56 -0500 Subject: [PATCH 112/691] Add block number <> hash db indexing --- src/ledgers/ethereum/blockchain.ts | 4 +-- .../ethereum/components/block-manager.ts | 29 +++++++++---------- test/temp-tests.ts | 25 ++++++++++++---- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 944d43351c..75e7c9478b 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -124,7 +124,7 @@ export default class Blockchain extends Emittery { // TODO: figure out transaction receipts! // promises.push(this.transactionReceipts.set(hash, s)); }); - const pendingLastBlock = this.blocks.set(block); + const pendingLastBlock = this.blocks.putBlock(block); lastBlock = Promise.all(promises).then(() => pendingLastBlock); }); @@ -181,7 +181,7 @@ export default class Blockchain extends Emittery { }); // store the genesis block in the database - return this.blocks.set(genesis); + return this.blocks.putBlock(genesis); } private _currentTime() { diff --git a/src/ledgers/ethereum/components/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts index 09766e728f..b12f9aa296 100644 --- a/src/ledgers/ethereum/components/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -79,22 +79,19 @@ export default class BlockManager extends Manager { * Writes the block object to the underlying database. * @param block */ - set(block: Block): Promise - set(key: Buffer, value: Buffer): Promise - set(keyOrBlock: Buffer | Block, value?: Buffer | Block): Promise { - let key: Buffer; - if (keyOrBlock instanceof Block){ - key = keyOrBlock.value.header.number; - value = keyOrBlock.value.serialize(true); - } else if (value instanceof Block) { - value = value.value.serialize(true); - } - - // ethereumjs-block treats [0] as [] :-() - if (Buffer.isBuffer(key) && key.equals(Buffer.from([]))){ - key = Buffer.from([0]); - } - return super.set(key, value); + async putBlock(block: Block) { + let key = block.value.header.number; + if (Buffer.isBuffer(key) && key.equals(Buffer.from([]))){ + key = Buffer.from([0]); + } + const secondaryKey = block.value.header.hash(); + const value = block.value.serialize(true); + + const results = await Promise.all([ + super.set(secondaryKey, key), + super.set(key, value) + ]); + return results[1]; } } diff --git a/test/temp-tests.ts b/test/temp-tests.ts index db78c56f0c..6480554416 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -108,7 +108,7 @@ describe("Accounts", () => { }); }); - xit("unlocks accounts via unlock_accounts (both string and numbered numbers)", async () => { + it("unlocks accounts via unlock_accounts (both string and numbered numbers)", async () => { const p = Ganache.provider({ locked: true, unlocked_accounts: ["0", 1] @@ -159,10 +159,10 @@ describe("Accounts", () => { from: accounts[0], data: contract.code } - ]); - console.log(transactionHash); - await new Promise((resolve) => setTimeout(resolve, 1000000)); - const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); + ]); + await new Promise((resolve) => setTimeout(resolve, 3000)); + const result = await p.send("eth_getTransactionByHash", [transactionHash]); + console.log(result); }); it("runs eth_call", async () => { @@ -174,4 +174,19 @@ describe("Accounts", () => { const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); assert(true); }); + + it.skip("eth_getStorageAt", async () => { + const p = Ganache.provider(); + const accounts = await p.send("eth_accounts"); + await p.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await new Promise((resolve) => setTimeout(resolve, 3000)); + + const storage = await p.send("eth_getStorageAt", [accounts[0], 0]); + console.log(storage) + }) }); \ No newline at end of file From 5173b8c9f44ab387c5b50bf7b4977b232591f223 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 9 Jan 2020 13:01:39 -0500 Subject: [PATCH 113/691] rename transaction's toJsonRpc to toJSON --- src/types/transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/transaction.ts b/src/types/transaction.ts index f00f516f4e..63f3a9b95c 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -430,7 +430,7 @@ export default class Transaction extends EthereumJsTransaction { * * @param {Object} block The block this Transaction appears in. */ - toJsonRpc(block: any) { + toJSON(block: any) { const hash = this.hash(); let transactionIndex = null; From 826aef81ae1280d19911ad8f427f9309251650ab Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 9 Jan 2020 13:26:49 -0500 Subject: [PATCH 114/691] If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck. --- src/types/transaction.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 63f3a9b95c..59c367ba43 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -256,7 +256,8 @@ function initData(tx: any, data: any) { } } -export default class Transaction extends EthereumJsTransaction { +interface Transaction extends Omit {} +class Transaction extends (EthereumJsTransaction as any) { type: number; v: Buffer; r: Buffer; @@ -430,11 +431,16 @@ export default class Transaction extends EthereumJsTransaction { * * @param {Object} block The block this Transaction appears in. */ - toJSON(block: any) { + toJSON(block: Block) + { + if (typeof block === "boolean") { + throw new Error("block must be a Block type, boolean isn't allowed. Sorry about TypeScript"); + } + const blockValue = block.value; const hash = this.hash(); let transactionIndex = null; - for (let i = 0, txns = block.transactions, l = txns.length; i < l; i++) { + for (let i = 0, txns = blockValue.transactions, l = txns.length; i < l; i++) { if (txns[i].hash().equals(hash)) { transactionIndex = i; break; @@ -444,8 +450,8 @@ export default class Transaction extends EthereumJsTransaction { const resultJSON = { hash: Data.from(hash).toString(), nonce: Quantity.from(this.nonce).toString(), - blockHash: Data.from(block.hash()).toString(), - blockNumber: Data.from(block.header.number).toString(), + blockHash: Data.from(blockValue.hash()).toString(), + blockNumber: Data.from(blockValue.header.number).toString(), transactionIndex: Quantity.from(BigInt(transactionIndex)).toString(), from: Data.from(this.from).toString(), to: Data.from(this.to).toString(), From c8a63927194eaf6dcba48481b18cb8f3042329cd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 9 Jan 2020 13:45:29 -0500 Subject: [PATCH 115/691] So that last thing didn't work right --- src/ledgers/ethereum/miner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index 5121e5c218..8b56d862c4 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -127,7 +127,7 @@ export default class Miner extends Emittery { this.currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); const runArgs = { - tx: best, + tx: best as any as EthereumJsTransaction, block }; await this._checkpoint(); From 613bcaa456781c11993a925c621ccf041896f02d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 9 Jan 2020 13:47:36 -0500 Subject: [PATCH 116/691] add more type stuff --- src/types/transaction.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 59c367ba43..ace5b38086 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -108,6 +108,7 @@ import { Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFake import * as ethUtil from "ethereumjs-util"; import assert from "assert"; import {decode as rlpDecode, encode as rlpEncode} from "rlp"; +import { Block } from "../ledgers/ethereum/components/block-manager"; const sign = EthereumJsTransaction.prototype.sign; const fakeHash = function () { @@ -431,8 +432,7 @@ class Transaction extends (EthereumJsTransaction as any) { * * @param {Object} block The block this Transaction appears in. */ - toJSON(block: Block) - { + toJSON(block: Block) { if (typeof block === "boolean") { throw new Error("block must be a Block type, boolean isn't allowed. Sorry about TypeScript"); } From 2b0cf7870120d9b07a336604e0412cf9b56b63aa Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 9 Jan 2020 13:48:39 -0500 Subject: [PATCH 117/691] export Transaction --- src/types/transaction.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/types/transaction.ts b/src/types/transaction.ts index ace5b38086..17bf53006a 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -503,3 +503,5 @@ class Transaction extends (EthereumJsTransaction as any) { } } }; + +export default Transaction; From 34e910d8143982cee1192f9c3e49f0e0f17f4941 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 9 Jan 2020 14:33:09 -0500 Subject: [PATCH 118/691] Well --- src/types/transaction.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 17bf53006a..51526c61a5 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -272,8 +272,8 @@ class Transaction extends (EthereumJsTransaction as any) { * @param {Number} type The `Transaction.types` bit flag for this transaction * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ - constructor(data: any, type = Transaction.types.none) { - super(); + constructor(data: any, type = Transaction.types.none, options: any) { + super(undefined, options); this.type = type; From 2d6bf4aad25c85d0023b8e1c7f281be21cbdab83 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Thu, 9 Jan 2020 14:52:56 -0500 Subject: [PATCH 119/691] Add getBlocksBy* , add ethereumjs-common --- package.json | 1 + src/ledgers/ethereum/blockchain.ts | 1 + .../ethereum/components/block-manager.ts | 62 +++++++++++++++++-- src/ledgers/ethereum/components/manager.ts | 2 +- src/ledgers/ethereum/ledger.ts | 22 +++++++ src/ledgers/ethereum/miner.ts | 3 +- src/provider.ts | 6 +- src/types/transaction.ts | 30 ++++----- test/helpers/getProvider.ts | 13 ++++ test/ledger.ts | 28 +++++++++ test/temp-tests.ts | 2 +- typings/ethereumjs-block/header.d.ts | 37 ++++++----- typings/ethereumjs-block/index.d.ts | 5 +- typings/ethereumjs-blockchain/index.d.ts | 31 ---------- 14 files changed, 167 insertions(+), 76 deletions(-) create mode 100644 test/helpers/getProvider.ts create mode 100644 test/ledger.ts delete mode 100644 typings/ethereumjs-blockchain/index.d.ts diff --git a/package.json b/package.json index d7ab75aa27..ecb790052f 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "emittery": "0.5.1", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.2", + "ethereumjs-common": "^1.5.0", "ethereumjs-tx": "^2.1.2", "ethereumjs-util": "6.2.0", "ethereumjs-vm": "4.1.2", diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 75e7c9478b..0d04da7afc 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -124,6 +124,7 @@ export default class Blockchain extends Emittery { // TODO: figure out transaction receipts! // promises.push(this.transactionReceipts.set(hash, s)); }); + block.value.transactions = blockData.blockTransactions; const pendingLastBlock = this.blocks.putBlock(block); lastBlock = Promise.all(promises).then(() => pendingLastBlock); }); diff --git a/src/ledgers/ethereum/components/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts index b12f9aa296..cbeb974316 100644 --- a/src/ledgers/ethereum/components/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -3,6 +3,10 @@ import Manager from "./manager"; import Tag from "../../../types/tags"; import levelup from "levelup"; import Blockchain from "../blockchain"; +import { Quantity, Data } from "../../../types/json-rpc"; +import Transaction from "../../../types/transaction"; +import { rlp } from "ethereumjs-util"; +import Common from "ethereumjs-common"; export default class BlockManager extends Manager { /** @@ -86,12 +90,11 @@ export default class BlockManager extends Manager { } const secondaryKey = block.value.header.hash(); const value = block.value.serialize(true); - - const results = await Promise.all([ + await Promise.all([ super.set(secondaryKey, key), super.set(key, value) ]); - return results[1]; + return block; } } @@ -100,7 +103,56 @@ export class Block { public readonly value: EthereumJsBlock; constructor(raw: Buffer, manager: BlockManager) { - this.value = new EthereumJsBlock(raw); - this.manager = manager; + const common = {common: new Common("mainnet", "istanbul")}; + if(raw) { + const data = rlp.decode(raw) as any as [Buffer[], Buffer[], Buffer[]]; + this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, common); + const rawTransactions = data[1]; + + // parse transactions so we can use our own transaction class + for (let i = 0; i < rawTransactions.length; i++) { + // TODO: Pass the common object instead of the options. It can't be implemented right now + // because the hardfork may be `null`. Read the above TODO for more info. + const tx = new Transaction(rawTransactions[i]); + this.value.transactions.push(tx) + } + } else { + this.value = new EthereumJsBlock(null, common); + } + + this.manager = manager; } + + private getTxFn(include = false): (tx: Transaction) => {[key: string] : string} | Data { + if (include) { + return (tx: Transaction) => tx.toJSON(this) + } else { + return (tx: Transaction) => Data.from(tx.hash()); + } + } + + toJsonRpc(includeFullTransactions = false) { + return { + number: Quantity.from(this.value.header.number), + hash: Data.from(this.value.hash()), + parentHash: Data.from(this.value.header.parentHash), // common.hash + mixHash: Data.from(this.value.header.mixHash), + nonce: Data.from(this.value.header.nonce, 16), + sha3Uncles: Data.from(this.value.header.uncleHash), + logsBloom: Data.from(this.value.header.bloom), + transactionsRoot: Data.from(this.value.header.transactionsTrie), + stateRoot: Data.from(this.value.header.stateRoot), + receiptsRoot: Data.from(this.value.header.receiptTrie), + miner: Data.from(this.value.header.coinbase), + difficulty: Quantity.from(this.value.header.difficulty), + totalDifficulty: Quantity.from(this.value.header.difficulty), // TODO: Figure out what to do here. + extraData: Data.from(this.value.header.extraData), + size: Quantity.from(1000), // TODO: Do something better here + gasLimit: Quantity.from(this.value.header.gasLimit), + gasUsed: Quantity.from(this.value.header.gasUsed), + timestamp: Quantity.from(this.value.header.timestamp), + transactions: this.value.transactions.map(this.getTxFn(includeFullTransactions)), + uncles: [] as string[] // this.value.uncleHeaders.map(function(uncleHash) {return to.hex(uncleHash)}) + }; + } } diff --git a/src/ledgers/ethereum/components/manager.ts b/src/ledgers/ethereum/components/manager.ts index 104c4a7978..9d9f905826 100644 --- a/src/ledgers/ethereum/components/manager.ts +++ b/src/ledgers/ethereum/components/manager.ts @@ -20,6 +20,6 @@ export default class Manager { return this.base.get(key).then((raw) => new this.Type(raw)); } set(key: Buffer, value: Buffer): Promise { - return this.base.put(key, value).then(() => new this.Type(value)); + return this.base.put(key, value); } } \ No newline at end of file diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index b243bcce90..1768a8f550 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -126,6 +126,28 @@ export default class Ethereum extends BaseLedger { return this[_wallet].coinbase.address; } + /** + * + * @param id string | Buffer identifier for a block + * @returns Block + */ + async eth_getBlockByNumber(id : string | Buffer, transactions = false) { + const block = await this[_blockchain].blocks.get(id); + return block.toJsonRpc(transactions); + } + + // async eth_getBlockByHash(id : string | Buffer) { + // return this[_blockchain].blocks.get(id); + // } + + // async eth_getBlockTransactionCountByNumber(id : string | Buffer) { + // return this[_blockchain].blocks.get(id); + // } + + // async eth_getBlockTransactionCountByHash(id : string | Buffer) { + // return this[_blockchain].blocks.get(id); + // } + /** * Returns true if client is actively mining new blocks. * @returns returns true of the client is mining, otherwise false. diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index 8b56d862c4..b4859521f4 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -127,7 +127,7 @@ export default class Miner extends Emittery { this.currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); const runArgs = { - tx: best as any as EthereumJsTransaction, + tx: best as any, block }; await this._checkpoint(); @@ -150,7 +150,6 @@ export default class Miner extends Emittery { // TODO: how do we surface this error to the caller? throw result.err; } - continue; } const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); diff --git a/src/provider.ts b/src/provider.ts index 8b056b14d5..3a577f79b2 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -75,7 +75,7 @@ export default class Provider extends Emittery { } else { secretKeyData = Data.from(secretKey); } - accounts[i] = this.createAccount(Quantity.from(account.balance), secretKeyData, address); + accounts[i] = Provider.createAccount(Quantity.from(account.balance), secretKeyData, address); } } else { const numerOfAccounts =_providerOptions.total_accounts; @@ -89,7 +89,7 @@ export default class Provider extends Emittery { const accountWallet = acct.getWallet(); const address = Address.from(accountWallet.getAddress()); const privateKey = Data.from(accountWallet.getPrivateKey()); - accounts[index] = this.createAccount(etherInWei, privateKey, address); + accounts[index] = Provider.createAccount(etherInWei, privateKey, address); } } else { throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); @@ -99,7 +99,7 @@ export default class Provider extends Emittery { } // TODO: this should probable be moved as well (see `initializeAccounts` above) - private createAccount(balance: Quantity, privateKey: Data, address?: Address) { + private static createAccount(balance: Quantity, privateKey: Data, address?: Address) { address = address || Address.from(privateToAddress(privateKey.toBuffer())); const account = new Account(address); diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 51526c61a5..02c25e53ff 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -272,7 +272,7 @@ class Transaction extends (EthereumJsTransaction as any) { * @param {Number} type The `Transaction.types` bit flag for this transaction * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ - constructor(data: any, type = Transaction.types.none, options: any) { + constructor(data: any, type = Transaction.types.none, options?: any) { super(undefined, options); this.type = type; @@ -448,20 +448,20 @@ class Transaction extends (EthereumJsTransaction as any) { } const resultJSON = { - hash: Data.from(hash).toString(), - nonce: Quantity.from(this.nonce).toString(), - blockHash: Data.from(blockValue.hash()).toString(), - blockNumber: Data.from(blockValue.header.number).toString(), - transactionIndex: Quantity.from(BigInt(transactionIndex)).toString(), - from: Data.from(this.from).toString(), - to: Data.from(this.to).toString(), - value: Quantity.from(this.value).toString(), - gas: Quantity.from(this.gasLimit).toString(), - gasPrice: Quantity.from(this.gasPrice).toString(), - input: Data.from(this.data).toString(), // TODO: this output format probably needs the 0x stripped. - v: Quantity.from(this.v).toString(), - r: Quantity.from(this.r).toString(), - s: Quantity.from(this.s).toString() + hash: Data.from(hash), + nonce: Quantity.from(this.nonce), + blockHash: Data.from(block.value.hash()), + blockNumber: Data.from(block.value.header.number), + transactionIndex: Quantity.from(BigInt(transactionIndex)), + from: Data.from(this.from), + to: Data.from(this.to), + value: Quantity.from(this.value), + gas: Quantity.from(this.gasLimit), + gasPrice: Quantity.from(this.gasPrice), + input: Data.from(this.data), // TODO: this output format probably needs the 0x stripped. + v: Quantity.from(this.v), + r: Quantity.from(this.r), + s: Quantity.from(this.s) }; return resultJSON; diff --git a/test/helpers/getProvider.ts b/test/helpers/getProvider.ts new file mode 100644 index 0000000000..00573a7d1d --- /dev/null +++ b/test/helpers/getProvider.ts @@ -0,0 +1,13 @@ +import Ganache from "../../index"; +import Provider from "../../src/provider"; +import ProviderOptions from "../../src/options/provider-options"; + +const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; +const GetProvider = (options: ProviderOptions = {mnemonic}) => { + return Ganache.provider(options) +} + +export default GetProvider; +export { + Provider +} diff --git a/test/ledger.ts b/test/ledger.ts new file mode 100644 index 0000000000..71a03db99d --- /dev/null +++ b/test/ledger.ts @@ -0,0 +1,28 @@ +import assert from "assert"; +import GetProvider, { Provider } from "./helpers/getProvider"; + + +describe("requests", () => { + // const expectedAddress = "0x604a95C9165Bc95aE016a5299dd7d400dDDBEa9A"; + let provider: Provider; + + beforeEach(() => { + provider = GetProvider(); + }) + + it("eth_getBlockByNumber", async() => { + // @TODO: Fix this horrible test + const accounts = await provider.send("eth_accounts"); + await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await new Promise((resolve) => setTimeout(resolve, 100)); + const blocks = [provider.send("eth_getBlockByNumber", ["0x1", true]), provider.send("eth_getBlockByNumber", ["0x1"])]; + console.log(JSON.stringify(await Promise.all(blocks))); + + assert(true); + }); +}) diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 6480554416..07de4561f9 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -189,4 +189,4 @@ describe("Accounts", () => { const storage = await p.send("eth_getStorageAt", [accounts[0], 0]); console.log(storage) }) -}); \ No newline at end of file +}); diff --git a/typings/ethereumjs-block/header.d.ts b/typings/ethereumjs-block/header.d.ts index 970d20f4e4..a971de9b62 100644 --- a/typings/ethereumjs-block/header.d.ts +++ b/typings/ethereumjs-block/header.d.ts @@ -1,5 +1,3 @@ - - declare module 'ethereumjs-block/header' { import BN from 'bn.js' import { Block } from 'ethereumjs-block' @@ -25,22 +23,27 @@ declare module 'ethereumjs-block/header' { } export class BlockHeader { - parentHash: Buffer - uncleHash: Buffer - coinbase: Buffer - stateRoot: Buffer - transactionTrie: Buffer - receiptTrie: Buffer - bloom: Buffer - difficulty: Buffer - number: Buffer - gasLimit: Buffer - gasUsed: Buffer - timestamp: Buffer - extraData: Buffer - raw: Buffer[] + public raw!: Buffer[] + public parentHash!: Buffer + public uncleHash!: Buffer + public coinbase!: Buffer + public stateRoot!: Buffer + public transactionsTrie!: Buffer + public receiptTrie!: Buffer + public bloom!: Buffer + public difficulty!: Buffer + public number!: Buffer + public gasLimit!: Buffer + public gasUsed!: Buffer + public timestamp!: Buffer + public extraData!: Buffer + public mixHash!: Buffer + public nonce!: Buffer - constructor(data: LargeNumber | IBlockHeader) + constructor( + data: Buffer | PrefixedHexString | BufferLike[] | BlockHeaderData = {}, + opts: ChainOptions = {} + ) serialize(): Buffer canonicalDifficulty(block: Block): BN validateDifficulty(block: Block): boolean diff --git a/typings/ethereumjs-block/index.d.ts b/typings/ethereumjs-block/index.d.ts index f00979b534..b73a65aa3f 100644 --- a/typings/ethereumjs-block/index.d.ts +++ b/typings/ethereumjs-block/index.d.ts @@ -22,7 +22,10 @@ declare module 'ethereumjs-block' { header: BlockHeader raw: Buffer[] - constructor(data: string | Buffer | number[] | IBlock) + constructor( + data: Buffer | [Buffer[], Buffer[], Buffer[]] | BlockData = {}, + opts: ChainOptions = {}, + ) hash(): Buffer isGenesis(): boolean setGenesisParams(): void diff --git a/typings/ethereumjs-blockchain/index.d.ts b/typings/ethereumjs-blockchain/index.d.ts deleted file mode 100644 index 76ae42e306..0000000000 --- a/typings/ethereumjs-blockchain/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -declare module 'ethereumjs-blockchain' { - import BN from 'bn.js' - import { LevelUp } from 'levelup' - import { Block } from 'ethereumjs-block' - - type BlockTag = Buffer | BN | number - type Callback = (err: Error | null, result: T) => void - type OnBlock = (block: Block, reorg: boolean, cb: Callback) => void - - export interface BlockchainOptions { - db: LevelUp - cb: Callback - } - - export class Blockchain { - constructor(opts: BlockchainOptions) - putGenesis(genesis: Block, cb: Callback): void - getHead(name: string, cb: Callback): void - getLatestHeader(cb: Callback): void - getLatestBlock(cb: Callback): void - putBlocks(blocks: Block[], cb: Callback): void - putBlock(block: Block, cb: Callback): void - getBlock(blockTag: BlockTag, cb: Callback): void - getBlocks(blockId: BlockTag, maxBlocks: number, skip: number, reverse: boolean, cb: Callback): void - selectNeededHashes(hashes: Buffer, cb: Callback): void - delBlock(blockHash: Buffer, cb: Callback): void - iterator(name: string, onBlock: OnBlock, cb: Callback): void - } - - export default Blockchain - } \ No newline at end of file From 1cbc8b98967cfd614d9adac61e3a29fa8d98dbe9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 9 Jan 2020 17:25:26 -0500 Subject: [PATCH 120/691] Add eth_getBlockTransactionCount* and stuff --- .../ethereum/components/block-manager.ts | 61 ++++++---- src/ledgers/ethereum/components/manager.ts | 7 +- src/ledgers/ethereum/ledger.ts | 31 +++-- src/types/transaction.ts | 6 +- test/ledger.ts | 30 ++++- typings/ethereumjs-block/header.d.ts | 114 +++++++++--------- 6 files changed, 144 insertions(+), 105 deletions(-) diff --git a/src/ledgers/ethereum/components/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts index cbeb974316..e0c9bf2016 100644 --- a/src/ledgers/ethereum/components/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -5,7 +5,7 @@ import levelup from "levelup"; import Blockchain from "../blockchain"; import { Quantity, Data } from "../../../types/json-rpc"; import Transaction from "../../../types/transaction"; -import { rlp } from "ethereumjs-util"; +import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; export default class BlockManager extends Manager { @@ -55,9 +55,18 @@ export default class BlockManager extends Manager { return block; } - async get(keyOrBlock: string | Buffer | Tag): Promise { - if (typeof keyOrBlock === "string") { - const tag = Tag.normalize(keyOrBlock as Tag); + async getNumberFromHash(hash: string | Buffer | Tag): Promise { + return this.base.get(Data.from(hash).toBuffer()); + } + + async getByHash(hash: string | Buffer | Tag): Promise { + const number = await this.getNumberFromHash(hash); + return super.get(number); + } + + async get(tagOrBlockNumber: string | Buffer | Tag): Promise { + if (typeof tagOrBlockNumber === "string") { + const tag = Tag.normalize(tagOrBlockNumber as Tag); switch (tag) { case Tag.LATEST: return this.latest; @@ -73,10 +82,11 @@ export default class BlockManager extends Manager { // this probably can't happen. but if someone passed something like // `toString` in as a block tag and it got this far... maybe we'd // get here... - throw new Error(`Invalid block Tag: ${keyOrBlock}`); + throw new Error(`Invalid block Tag: ${tagOrBlockNumber}`); } } - return super.get(keyOrBlock); + + return super.get(tagOrBlockNumber); } /** @@ -104,8 +114,8 @@ export class Block { constructor(raw: Buffer, manager: BlockManager) { const common = {common: new Common("mainnet", "istanbul")}; - if(raw) { - const data = rlp.decode(raw) as any as [Buffer[], Buffer[], Buffer[]]; + if (raw) { + const data = rlpDecode(raw) as any as [Buffer[], Buffer[], Buffer[]]; this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, common); const rawTransactions = data[1]; @@ -131,26 +141,27 @@ export class Block { } } - toJsonRpc(includeFullTransactions = false) { + toJSON(includeFullTransactions = false) { + const header = this.value.header; return { - number: Quantity.from(this.value.header.number), + number: Quantity.from(header.number), hash: Data.from(this.value.hash()), - parentHash: Data.from(this.value.header.parentHash), // common.hash - mixHash: Data.from(this.value.header.mixHash), - nonce: Data.from(this.value.header.nonce, 16), - sha3Uncles: Data.from(this.value.header.uncleHash), - logsBloom: Data.from(this.value.header.bloom), - transactionsRoot: Data.from(this.value.header.transactionsTrie), - stateRoot: Data.from(this.value.header.stateRoot), - receiptsRoot: Data.from(this.value.header.receiptTrie), - miner: Data.from(this.value.header.coinbase), - difficulty: Quantity.from(this.value.header.difficulty), - totalDifficulty: Quantity.from(this.value.header.difficulty), // TODO: Figure out what to do here. - extraData: Data.from(this.value.header.extraData), + parentHash: Data.from(header.parentHash), + mixHash: Data.from(header.mixHash), + nonce: Data.from(header.nonce, 16), + sha3Uncles: Data.from(header.uncleHash), + logsBloom: Data.from(header.bloom), + transactionsRoot: Data.from(header.transactionsTrie), + stateRoot: Data.from(header.stateRoot), + receiptsRoot: Data.from(header.receiptTrie), + miner: Data.from(header.coinbase), + difficulty: Quantity.from(header.difficulty), + totalDifficulty: Quantity.from(header.difficulty), // TODO: Figure out what to do here. + extraData: Data.from(header.extraData), size: Quantity.from(1000), // TODO: Do something better here - gasLimit: Quantity.from(this.value.header.gasLimit), - gasUsed: Quantity.from(this.value.header.gasUsed), - timestamp: Quantity.from(this.value.header.timestamp), + gasLimit: Quantity.from(header.gasLimit), + gasUsed: Quantity.from(header.gasUsed), + timestamp: Quantity.from(header.timestamp), transactions: this.value.transactions.map(this.getTxFn(includeFullTransactions)), uncles: [] as string[] // this.value.uncleHeaders.map(function(uncleHash) {return to.hex(uncleHash)}) }; diff --git a/src/ledgers/ethereum/components/manager.ts b/src/ledgers/ethereum/components/manager.ts index 9d9f905826..f185f3e64b 100644 --- a/src/ledgers/ethereum/components/manager.ts +++ b/src/ledgers/ethereum/components/manager.ts @@ -13,11 +13,14 @@ export default class Manager { this.blockchain = blockchain; this.base = base; } - get(key: string | Buffer): Promise { + getRaw(key: string | Buffer): Promise { if (typeof key === "string") { key = Data.from(key).toBuffer(); } - return this.base.get(key).then((raw) => new this.Type(raw)); + return this.base.get(key); + } + get(key: string | Buffer) { + return this.getRaw(key).then((raw) => new this.Type(raw)); } set(key: Buffer, value: Buffer): Promise { return this.base.put(key, value); diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 1768a8f550..5a6d67e316 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -9,6 +9,7 @@ import Transaction from "../../types/transaction"; import { Block } from "./components/block-manager"; import Wallet from "./wallet"; import Account from "ethereumjs-account"; +import {decode as rlpDecode} from "rlp"; const createKeccakHash = require("keccak"); // Read in the current ganache version from the package.json @@ -128,25 +129,29 @@ export default class Ethereum extends BaseLedger { /** * - * @param id string | Buffer identifier for a block + * @param number string | Buffer identifier for a block * @returns Block */ - async eth_getBlockByNumber(id : string | Buffer, transactions = false) { - const block = await this[_blockchain].blocks.get(id); - return block.toJsonRpc(transactions); + async eth_getBlockByNumber(number: string | Buffer, transactions = false) { + const block = await this[_blockchain].blocks.get(number); + return block.toJSON(transactions); } - // async eth_getBlockByHash(id : string | Buffer) { - // return this[_blockchain].blocks.get(id); - // } + async eth_getBlockByHash(hash: string | Buffer, transactions = false) { + const block = await this[_blockchain].blocks.getByHash(hash); + return block.toJSON(transactions); + } - // async eth_getBlockTransactionCountByNumber(id : string | Buffer) { - // return this[_blockchain].blocks.get(id); - // } + async eth_getBlockTransactionCountByNumber(number: string | Buffer) { + const rawBlock = await this[_blockchain].blocks.getRaw(number); + const data = rlpDecode(rawBlock); + return (data[1] as any).length; + } - // async eth_getBlockTransactionCountByHash(id : string | Buffer) { - // return this[_blockchain].blocks.get(id); - // } + async eth_getBlockTransactionCountByHash(hash: string | Buffer) { + const number = await this[_blockchain].blocks.getNumberFromHash(hash); + return this.eth_getBlockTransactionCountByNumber(number); + } /** * Returns true if client is actively mining new blocks. diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 02c25e53ff..6b14a707e4 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -275,6 +275,9 @@ class Transaction extends (EthereumJsTransaction as any) { constructor(data: any, type = Transaction.types.none, options?: any) { super(undefined, options); + // EthereumJS-TX Transaction overwrites our `toJSON`, so we overwrite it back here: + this.toJSON = Transaction.prototype.toJSON.bind(this); + this.type = type; fixProps(this, data); @@ -433,9 +436,6 @@ class Transaction extends (EthereumJsTransaction as any) { * @param {Object} block The block this Transaction appears in. */ toJSON(block: Block) { - if (typeof block === "boolean") { - throw new Error("block must be a Block type, boolean isn't allowed. Sorry about TypeScript"); - } const blockValue = block.value; const hash = this.hash(); diff --git a/test/ledger.ts b/test/ledger.ts index 71a03db99d..ce66022f1e 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -1,14 +1,32 @@ import assert from "assert"; import GetProvider, { Provider } from "./helpers/getProvider"; - -describe("requests", () => { +describe("ledger", () => { // const expectedAddress = "0x604a95C9165Bc95aE016a5299dd7d400dDDBEa9A"; let provider: Provider; beforeEach(() => { provider = GetProvider(); - }) + }); + + it("eth_getBlockByNumber", async() => { + // @TODO: Fix this horrible test + const accounts = await provider.send("eth_accounts"); + await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await new Promise((resolve) => setTimeout(resolve, 100)); + const blocks = await Promise.all([provider.send("eth_getBlockByNumber", ["0x1", true]), provider.send("eth_getBlockByNumber", ["0x1"])]); + console.log(JSON.stringify(blocks)); + + const counts = await Promise.all([provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]), provider.send("eth_getBlockTransactionCountByHash", [blocks[0].hash])]); + console.log(counts); + + assert(true); + }); it("eth_getBlockByNumber", async() => { // @TODO: Fix this horrible test @@ -20,8 +38,10 @@ describe("requests", () => { }]); // TODO: remove and replace with something that detects with the block is "mined" await new Promise((resolve) => setTimeout(resolve, 100)); - const blocks = [provider.send("eth_getBlockByNumber", ["0x1", true]), provider.send("eth_getBlockByNumber", ["0x1"])]; - console.log(JSON.stringify(await Promise.all(blocks))); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); + + const blocks2 = await Promise.all([provider.send("eth_getBlockByHash", [block.hash, true]), provider.send("eth_getBlockByHash", [block.hash])]); + console.log(JSON.stringify(blocks2)); assert(true); }); diff --git a/typings/ethereumjs-block/header.d.ts b/typings/ethereumjs-block/header.d.ts index a971de9b62..c8a9380004 100644 --- a/typings/ethereumjs-block/header.d.ts +++ b/typings/ethereumjs-block/header.d.ts @@ -1,58 +1,58 @@ declare module 'ethereumjs-block/header' { - import BN from 'bn.js' - import { Block } from 'ethereumjs-block' - import { Blockchain } from 'ethereumjs-blockchain' - - type LargeNumber = string | Buffer | BN - type Callback = (err: Error | null, result: T) => void - - export interface IBlockHeader { - parentHash: Buffer - uncleHash: Buffer - coinbase: Buffer - stateRoot: Buffer - transactionTrie: Buffer - receiptTrie: Buffer - bloom: Buffer - difficulty: Buffer - number: Buffer - gasLimit: Buffer - gasUsed: Buffer - timestamp: Buffer - extraData: Buffer - } - - export class BlockHeader { - public raw!: Buffer[] - public parentHash!: Buffer - public uncleHash!: Buffer - public coinbase!: Buffer - public stateRoot!: Buffer - public transactionsTrie!: Buffer - public receiptTrie!: Buffer - public bloom!: Buffer - public difficulty!: Buffer - public number!: Buffer - public gasLimit!: Buffer - public gasUsed!: Buffer - public timestamp!: Buffer - public extraData!: Buffer - public mixHash!: Buffer - public nonce!: Buffer - - constructor( - data: Buffer | PrefixedHexString | BufferLike[] | BlockHeaderData = {}, - opts: ChainOptions = {} - ) - serialize(): Buffer - canonicalDifficulty(block: Block): BN - validateDifficulty(block: Block): boolean - validateGasLimit(block: Block): boolean - validate(blockChain: Blockchain, height: BN | Callback, cb?: Callback): void - hash(): Buffer - isGenesis(): boolean - toJSON(labeled: boolean): object - } - - export default BlockHeader - } \ No newline at end of file + import BN from 'bn.js' + import { Block } from 'ethereumjs-block' + import { Blockchain } from 'ethereumjs-blockchain' + + type LargeNumber = string | Buffer | BN + type Callback = (err: Error | null, result: T) => void + + export interface IBlockHeader { + parentHash: Buffer + uncleHash: Buffer + coinbase: Buffer + stateRoot: Buffer + transactionTrie: Buffer + receiptTrie: Buffer + bloom: Buffer + difficulty: Buffer + number: Buffer + gasLimit: Buffer + gasUsed: Buffer + timestamp: Buffer + extraData: Buffer + } + + export class BlockHeader { + public raw!: Buffer[] + public parentHash!: Buffer + public uncleHash!: Buffer + public coinbase!: Buffer + public stateRoot!: Buffer + public transactionsTrie!: Buffer + public receiptTrie!: Buffer + public bloom!: Buffer + public difficulty!: Buffer + public number!: Buffer + public gasLimit!: Buffer + public gasUsed!: Buffer + public timestamp!: Buffer + public extraData!: Buffer + public mixHash!: Buffer + public nonce!: Buffer + + constructor( + data: Buffer | PrefixedHexString | BufferLike[] | BlockHeaderData = {}, + opts: ChainOptions = {} + ) + serialize(): Buffer + canonicalDifficulty(block: Block): BN + validateDifficulty(block: Block): boolean + validateGasLimit(block: Block): boolean + validate(blockChain: Blockchain, height: BN | Callback, cb?: Callback): void + hash(): Buffer + isGenesis(): boolean + toJSON(labeled: boolean): object + } + + export default BlockHeader +} \ No newline at end of file From 68f6c7f8e5f035c4c11730acd66cc82c372f7ace Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Thu, 9 Jan 2020 18:40:27 -0500 Subject: [PATCH 121/691] add docs for eth_get* --- .../ethereum/components/block-manager.ts | 2 -- src/ledgers/ethereum/ledger.ts | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/ledgers/ethereum/components/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts index e0c9bf2016..e9bffa0796 100644 --- a/src/ledgers/ethereum/components/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -121,8 +121,6 @@ export class Block { // parse transactions so we can use our own transaction class for (let i = 0; i < rawTransactions.length; i++) { - // TODO: Pass the common object instead of the options. It can't be implemented right now - // because the hardfork may be `null`. Read the above TODO for more info. const tx = new Transaction(rawTransactions[i]); this.value.transactions.push(tx) } diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 5a6d67e316..e074318158 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -128,26 +128,41 @@ export default class Ethereum extends BaseLedger { } /** - * - * @param number string | Buffer identifier for a block + * Returns information about a block by block number. + * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in th e default block parameter. + * @param transactions Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions. * @returns Block */ async eth_getBlockByNumber(number: string | Buffer, transactions = false) { const block = await this[_blockchain].blocks.get(number); return block.toJSON(transactions); } - + + /** + * Returns information about a block by block hash. + * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in th e default block parameter. + * @param transactions Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions. + * @returns Block + */ async eth_getBlockByHash(hash: string | Buffer, transactions = false) { const block = await this[_blockchain].blocks.getByHash(hash); return block.toJSON(transactions); } + /** + * Returns the number of transactions in a block from a block matching the given block number. + * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. + */ async eth_getBlockTransactionCountByNumber(number: string | Buffer) { const rawBlock = await this[_blockchain].blocks.getRaw(number); const data = rlpDecode(rawBlock); return (data[1] as any).length; } - + + /** + * Returns the number of transactions in a block from a block matching the given block hash. + * @param hash DATA, 32 Bytes - hash of a block. + */ async eth_getBlockTransactionCountByHash(hash: string | Buffer) { const number = await this[_blockchain].blocks.getNumberFromHash(hash); return this.eth_getBlockTransactionCountByNumber(number); From ab49b2de8b78c7d0307e807fe628509c402fad98 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Thu, 9 Jan 2020 18:41:40 -0500 Subject: [PATCH 122/691] Add sleep test helper --- test/helpers/sleep.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test/helpers/sleep.ts diff --git a/test/helpers/sleep.ts b/test/helpers/sleep.ts new file mode 100644 index 0000000000..eb7471261c --- /dev/null +++ b/test/helpers/sleep.ts @@ -0,0 +1,3 @@ +const sleep = (time: number = 100) => new Promise((resolve) => setTimeout(resolve, time)); + +export default sleep; From d590bcee7a7934d6defd549fbd45fe0c384c2fcd Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Thu, 9 Jan 2020 18:43:43 -0500 Subject: [PATCH 123/691] Add tests for eth_get* --- test/ledger.ts | 56 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/test/ledger.ts b/test/ledger.ts index ce66022f1e..203ea33fe7 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -1,48 +1,66 @@ import assert from "assert"; import GetProvider, { Provider } from "./helpers/getProvider"; +import sleep from "./helpers/sleep"; -describe("ledger", () => { - // const expectedAddress = "0x604a95C9165Bc95aE016a5299dd7d400dDDBEa9A"; +describe.only("ledger", () => { let provider: Provider; + let accounts: string[]; - beforeEach(() => { + beforeEach(async () => { provider = GetProvider(); + accounts = await provider.send("eth_accounts"); }); it("eth_getBlockByNumber", async() => { - // @TODO: Fix this horrible test - const accounts = await provider.send("eth_accounts"); await provider.send("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 }]); // TODO: remove and replace with something that detects with the block is "mined" - await new Promise((resolve) => setTimeout(resolve, 100)); + await sleep(); const blocks = await Promise.all([provider.send("eth_getBlockByNumber", ["0x1", true]), provider.send("eth_getBlockByNumber", ["0x1"])]); - console.log(JSON.stringify(blocks)); + assert(blocks[0].hash, blocks[1].hash); + }); + + it("eth_getBlockByHash", async() => { + await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await sleep(); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - const counts = await Promise.all([provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]), provider.send("eth_getBlockTransactionCountByHash", [blocks[0].hash])]); - console.log(counts); - - assert(true); + const blocks = await Promise.all([provider.send("eth_getBlockByHash", [block.hash, true]), provider.send("eth_getBlockByHash", [block.hash])]); + assert(blocks[0].hash, blocks[1].hash); }); - it("eth_getBlockByNumber", async() => { - // @TODO: Fix this horrible test - const accounts = await provider.send("eth_accounts"); + it("eth_getBlockTransactionCountByHash", async() => { await provider.send("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 }]); // TODO: remove and replace with something that detects with the block is "mined" - await new Promise((resolve) => setTimeout(resolve, 100)); + await sleep(); const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - const blocks2 = await Promise.all([provider.send("eth_getBlockByHash", [block.hash, true]), provider.send("eth_getBlockByHash", [block.hash])]); - console.log(JSON.stringify(blocks2)); - - assert(true); + const count = await provider.send("eth_getBlockTransactionCountByHash", [block.hash]); + assert(count, "1"); + }); + + it("eth_getBlockTransactionCountByNumber", async() => { + await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await sleep(); + + const count = await provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]); + assert(count, "1"); }); }) From 17fef39299775debc39b59fa6c2d45ae86f32476 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Thu, 9 Jan 2020 18:44:57 -0500 Subject: [PATCH 124/691] Remove only from test --- test/ledger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ledger.ts b/test/ledger.ts index 203ea33fe7..dc60914ba2 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -2,7 +2,7 @@ import assert from "assert"; import GetProvider, { Provider } from "./helpers/getProvider"; import sleep from "./helpers/sleep"; -describe.only("ledger", () => { +describe("ledger", () => { let provider: Provider; let accounts: string[]; From 2f32c993ccf781266dcb5667508f1c9735b4ae02 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Thu, 9 Jan 2020 19:02:30 -0500 Subject: [PATCH 125/691] Add eth_getUncleCount* && tests --- src/ledgers/ethereum/ledger.ts | 19 +++++++++++++++++++ test/ledger.ts | 27 +++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index e074318158..41b215eb74 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -168,6 +168,25 @@ export default class Ethereum extends BaseLedger { return this.eth_getBlockTransactionCountByNumber(number); } + + /** + * Returns the number of uncles in a block from a block matching the given block hash. + * @param hash DATA, 32 Bytes - hash of a block. + */ + async eth_getUncleCountByBlockHash(hash: string | Buffer) { + const block = await this.eth_getBlockByHash(hash); + return block.uncles.length.toString(); + } + + /** + * Returns the number of uncles in a block from a block matching the given block hash. + * @param hash DATA, 32 Bytes - hash of a block. + */ + async eth_getUncleCountByBlockNumber(number: string | Buffer) { + const block = await this.eth_getBlockByNumber(number); + return block.uncles.length.toString(); + } + /** * Returns true if client is actively mining new blocks. * @returns returns true of the client is mining, otherwise false. diff --git a/test/ledger.ts b/test/ledger.ts index dc60914ba2..731bad6324 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -63,4 +63,31 @@ describe("ledger", () => { const count = await provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]); assert(count, "1"); }); + + it("eth_getUncleCountByBlockHash", async() => { + await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await sleep(); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); + + const count = await provider.send("eth_getUncleCountByBlockHash", [block.hash]); + assert(count, "0"); + }); + + it("eth_getUncleCountByBlockNumber", async() => { + await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await sleep(); + + const count = await provider.send("eth_getUncleCountByBlockNumber", ["0x1"]); + assert(count, "0"); + }); }) From d0c791b3311f141ae043e9bc9134aac45fb0436e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jan 2020 17:16:56 -0500 Subject: [PATCH 126/691] Add nullable to Quantity type and properly encode rpc strings --- src/types/json-rpc/json-rpc-quantity.ts | 32 ++++++++++++++++++++----- test/provider.ts | 4 ++-- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index 2bb652507f..c782485783 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -2,8 +2,27 @@ import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; const toBigIntBE = require('bigint-buffer').toBigIntBE; class Quantity extends BaseJsonRpcType { - public static from(value: number | bigint | string | Buffer) { - return new _Quantity(value); + _nullable: boolean; + public static from(value: number | bigint | string | Buffer, nullable = false) { + const q = new _Quantity(value, nullable); + q._nullable = nullable; + return q; + } + public toString(): string { + if (Buffer.isBuffer(this.value)) { + let val = this.value.toString("hex").replace(/^(?:0+(.+?))?$/, "$1");; + + if (val === "") { + if (this._nullable) { + return null; + } + // RPC Quantities must represent `0` as `0x0` + val = "0"; + } + return "0x" + val; + } else { + return super.toString(); + } } public toBigInt(): bigint { const value = this.value; @@ -51,19 +70,20 @@ class Quantity extends BaseJsonRpcType { } } type $ = { - new(value: T): _Quantity & JsonRpcType, - from(value: T): _Quantity & JsonRpcType, + _nullable: boolean + new(value: T, nullable?: boolean): _Quantity & JsonRpcType, + from(value: T, nullable?: boolean): _Quantity & JsonRpcType, toBigInt(): bigint, toBuffer(): Buffer } const _Quantity = Quantity as $; interface _Quantity { - constructor(value: T): _Quantity + _nullable: boolean + constructor(value: T, nullable?: boolean): _Quantity from(): _Quantity, toBigInt(): bigint, toBuffer(): Buffer } -export type IndexableQuantity = _Quantity & IndexableJsonRpcType; export default _Quantity; diff --git a/test/provider.ts b/test/provider.ts index f1f0a058cf..46f563666d 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -67,7 +67,7 @@ describe("provider", () => { const result = await Promise.race([callA, callB]); assert.strictEqual(typeof result, "string"); // TODO: this value is wrong: - assert.strictEqual(result, "0x056bc75e2d63100000"); + assert.strictEqual(result, "0x56bc75e2d63100000"); }); it("generates predictable accounts when given a seed", async() => { @@ -80,7 +80,7 @@ describe("provider", () => { const accounts = await p.send("eth_accounts"); const balance = await p.send("eth_getBalance", [accounts[0]]); // TODO: this value is actually wrong! - assert.strictEqual(balance, "0x056bc75e2d63100000", "Heyo!"); + assert.strictEqual(balance, "0x56bc75e2d63100000", "Heyo!"); }); it("returns things via EIP-1193", async () => { From 2f305eb7fdcc2e2cb4e9b5bb957a473bc1cbf0f6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jan 2020 17:17:06 -0500 Subject: [PATCH 127/691] Remove loggins --- test/ledger.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/ledger.ts b/test/ledger.ts index 731bad6324..8ed4b35756 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -35,6 +35,9 @@ describe("ledger", () => { const blocks = await Promise.all([provider.send("eth_getBlockByHash", [block.hash, true]), provider.send("eth_getBlockByHash", [block.hash])]); assert(blocks[0].hash, blocks[1].hash); + const counts = await Promise.all([provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]), provider.send("eth_getBlockTransactionCountByHash", [blocks[0].hash])]); + + assert(true); }); it("eth_getBlockTransactionCountByHash", async() => { From e363b7eaed97b5eb25025f821574af1ada51a9d9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jan 2020 17:17:24 -0500 Subject: [PATCH 128/691] Remove bad exports --- src/types/json-rpc/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/json-rpc/index.ts b/src/types/json-rpc/index.ts index c5c5208837..cf961f88a7 100644 --- a/src/types/json-rpc/index.ts +++ b/src/types/json-rpc/index.ts @@ -1,4 +1,4 @@ import {IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType} from "./json-rpc-base-types"; -import Quantity, {IndexableQuantity} from "./json-rpc-quantity"; +import Quantity from "./json-rpc-quantity"; import Data, {IndexableData} from "./json-rpc-data"; -export {Data, Quantity, IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType, IndexableQuantity, IndexableData}; +export {Data, Quantity, IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType, IndexableData}; From 205a92409e23c674887c898103e89bd233f94012 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jan 2020 17:21:24 -0500 Subject: [PATCH 129/691] Add transaction receipts and db batching --- src/ledgers/ethereum/blockchain.ts | 31 ++++-- src/ledgers/ethereum/database.ts | 38 +++++++ src/ledgers/ethereum/miner.ts | 50 ++++----- src/types/receipt.ts | 45 ++++++++ src/types/transaction.ts | 168 ++++++----------------------- 5 files changed, 159 insertions(+), 173 deletions(-) create mode 100644 src/types/receipt.ts diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 0d04da7afc..f913ae365e 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -12,6 +12,9 @@ import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; import Heap from "../../utils/heap"; import Transaction from "../../types/transaction"; +import Manager from "./components/manager"; +import Receipt from "../../types/receipt"; +import {encode as rlpEncode} from "rlp"; const VM = require("ethereumjs-vm").default; @@ -37,6 +40,7 @@ export default class Blockchain extends Emittery { private state: Status = Status.starting; public blocks: BlockManager; public transactions: TransactionManager; + public transactionReceipts: Manager; public accounts: AccountManager; public vm: any; public trie: Trie; @@ -66,6 +70,7 @@ export default class Blockchain extends Emittery { const miner = new Miner(this.vm, options); this.transactions = new TransactionManager(this, database.transactions, options); + this.transactionReceipts = new Manager(this, database.transactionReceipts, Receipt); this.accounts = new AccountManager(this); await this._initializeAccounts(options.accounts); @@ -112,21 +117,25 @@ export default class Blockchain extends Emittery { gasLimit: options.gasLimit.toBuffer(), transactionsTrie: blockData.transactionsTrie.root, receiptTrie: blockData.receiptTrie.root, - stateRoot: this.trie.root + stateRoot: this.trie.root, + gasUsed: Quantity.from(blockData.gasUsed).toBuffer() }); this.blocks.latest = block; - let promises: Promise[] = []; - blockData.blockTransactions.forEach((tx: Transaction) => { - const hash = tx.hash(); - const s = tx.serialize(); - promises.push(this.transactions.set(hash, s)); - // TODO: figure out transaction receipts! - // promises.push(this.transactionReceipts.set(hash, s)); + lastBlock = this.database.batch(() => { + blockData.blockTransactions.forEach((tx: Transaction, i: number) => { + const hash = tx.hash(); + const encoded = rlpEncode([...tx.raw, Quantity.from(i).toBuffer()]); + this.transactions.set(hash, encoded); + + const receipt = tx.getReceipt(); + const r = receipt.serialize(block, tx); + this.transactionReceipts.set(hash, r); + }); + block.value.transactions = blockData.blockTransactions; + this.blocks.putBlock(block); + return block; }); - block.value.transactions = blockData.blockTransactions; - const pendingLastBlock = this.blocks.putBlock(block); - lastBlock = Promise.all(promises).then(() => pendingLastBlock); }); this.blocks.earliest = this.blocks.latest = await lastBlock; diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index 387ae7412d..d8b04ed813 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -1,3 +1,4 @@ +import { AbstractLevelDOWN } from 'abstract-leveldown'; import Emittery from "emittery"; import { dir, setGracefulCleanup } from "tmp-promise"; import levelup from "levelup"; @@ -26,6 +27,7 @@ export default class Database extends Emittery { public transactionReceipts: levelup.LevelUp; public trie: levelup.LevelUp; public readonly initialized: boolean; + private _rootStore: AbstractLevelDOWN; /** * The Database handles the creation of the database, and all access to it. @@ -48,6 +50,7 @@ export default class Database extends Emittery { const store = this.options.db; let db; if (store) { + this._rootStore = store as any; db = levelup(store as any, levelupOptions); } else { let directory = this.options.db_path; @@ -61,6 +64,7 @@ export default class Database extends Emittery { } this.directory = directory; const store = encode(leveldown(directory), levelupOptions); + this._rootStore = store; db = levelup(store, {}); } @@ -68,6 +72,7 @@ export default class Database extends Emittery { if (this.closed) return this._cleanup(); const open = db.open(); + (db as any).___aaaa____ = true; this.trie = sub(db, "T", levelupOptions); this.db = db; @@ -83,6 +88,39 @@ export default class Database extends Emittery { return this.emit("ready"); } + /** + * Call `batch` to batch `put` and `del` operations within the same + * event loop tick of the provided function. All db operations within the + * batch _must_ be executed synchronously. + * @param fn {Function} Within this function's event loop tick, all `put` and + * `del` database operations are applied in a single atomic operation. This + * provides a single write call and if any individual put/del's fail the + * entire operation fails and no modifications are made. + * @returns {Promise} returns a Promise that resolves to the return value + * of the provided function. + */ + batch(fn: () => T): Promise { + const rootDb = this._rootStore.db; + const batch = this.db.batch(); + + const originalPut = rootDb.put; + const originalDel = rootDb.del; + + rootDb.put = batch.put.bind(batch); + rootDb.del = batch.del.bind(batch); + let prom; + try { + const ret = fn(); + // PSA: don't let vscode (or yourself) rewrite this to `await` the `batch.write` call. + // The `finally` block needs to run _ebfore_ the write promise has resolved. + prom = batch.write().then(() => ret); + } finally { + rootDb.put = originalPut; + rootDb.del = originalDel; + } + return prom; + } + /** * Gracefully closes the database and cleans up the file system and waits for * it to fully shut down. Emits a `close` event once complete. diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index b4859521f4..9af9e3bd71 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -4,9 +4,11 @@ import Transaction from "../../types/transaction"; import { Quantity, Data } from "../../types/json-rpc"; import { promisify } from "util"; import Trie from "merkle-patricia-tree"; -import { rlp } from "ethereumjs-util"; -import Emittery = require("emittery"); +import Emittery from "emittery"; import Block from "ethereumjs-block"; +import VM from "ethereumjs-vm"; +import { RunTxResult } from "ethereumjs-vm/dist/runTx"; +import {encode as rlpEncode} from "rlp"; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); @@ -37,14 +39,14 @@ export default class Miner extends Emittery { private pending: Map>; private _isMining: boolean = false; private readonly options: MinerOptions; - private readonly vm: any; + private readonly vm: VM; private readonly _checkpoint: () => Promise; private readonly _commit: () => Promise; private readonly _revert: () => Promise; // initialize a Heap that sorts by gasPrice private readonly priced = new Heap(byPrice); - constructor(vm: any, options: MinerOptions) { + constructor(vm: VM, options: MinerOptions) { super(); this.vm = vm; this.options = options; @@ -88,7 +90,6 @@ export default class Miner extends Emittery { const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); const promises: Promise[] = []; - const receipts: any[] = []; await this._checkpoint(); @@ -98,8 +99,7 @@ export default class Miner extends Emittery { blockTransactions, transactionsTrie, receiptTrie, - gasUsed: 0n, - receipts + gasUsed: 0n }; // Run until we run out of items, or until the inner loop stops us. @@ -131,10 +131,12 @@ export default class Miner extends Emittery { block }; await this._checkpoint(); - const result = await this.vm.runTx(runArgs).catch((err: Error) => ({ err })); - if (result.err) { + let result: RunTxResult; + try { + result = await this.vm.runTx(runArgs); + } catch(err) { await this._revert(); - const errorMessage = result.err.message; + const errorMessage = err.message; if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { // a race condition between the pool and the miner could potentially // cause this issue. @@ -144,11 +146,11 @@ export default class Miner extends Emittery { replaceFromHeap(priced, pendingFromOrigin, pending, origin); // TODO: how do we surface this error to the caller? - throw result.err; + throw err; } else { // TODO: handle all other errors! // TODO: how do we surface this error to the caller? - throw result.err; + throw err; } } @@ -160,20 +162,19 @@ export default class Miner extends Emittery { blockData.gasUsed += gasUsed; // calculate receipts and tries - const receipt = best.generateReceipt(result, block, counter); - const txKey = rlp.encode(counter); + const rawReceipt = best.initializeReceipt(result); + const txKey = rlpEncode(counter); promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); - promises.push(putInTrie(receiptTrie, txKey, receipt.raw)); - receipts.push(receipt); + promises.push(putInTrie(receiptTrie, txKey, rawReceipt)); // update the block's bloom - const bloom = receipt.logsBloom; + const bloom = result.bloom.bitvector; for (let i = 0; i < 256; i++) { blockBloom[i] |= bloom[i]; } - block.transactions[counter] = best as any; - blockData.blockTransactions[counter] = best; + blockTransactions[counter] = best; + counter++ // if we don't have enough gas left for even the smallest of @@ -196,8 +197,8 @@ export default class Miner extends Emittery { rejectedTransactions.push(best); } } - promises.push(this._commit()); await Promise.all(promises); + await this._commit(); // TODO: put the rejected transactions back in their original origin heaps rejectedTransactions.forEach(transaction => { @@ -281,13 +282,4 @@ export default class Miner extends Emittery { } } } - // private async finalizeBlock(blockTransactions: Transaction[], transactionTrie: Trie, receiptTrie: Trie) { - // this.emit("block", { - // blockTransactions, - // transactionTrie, - // receiptTrie - // }) - // // TODO: create the block and save it to the database - // //return new Block(Buffer.from([0]), null); - // } } \ No newline at end of file diff --git a/src/types/receipt.ts b/src/types/receipt.ts new file mode 100644 index 0000000000..11ea61a2c9 --- /dev/null +++ b/src/types/receipt.ts @@ -0,0 +1,45 @@ +import Transaction from "./transaction"; +import { Block } from "../ledgers/ethereum/components/block-manager"; +import {encode as rlpEncode, decode as rlpDecode} from "rlp"; +import { Data, Quantity } from "./json-rpc"; + +export default class Receipt { + private contractAddress: Buffer; + private raw: any[]; + private rlp: Buffer; + + constructor(data?: Buffer) { + if (data) { + const decoded = rlpDecode(data) as any as [Buffer, Buffer, Buffer, Buffer[], Buffer]; + this.init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4]); + } + } + private init(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer = null){ + this.raw = [status, gasUsed, logsBloom, logs]; + this.contractAddress = contractAddress; + this.rlp = rlpEncode(this.raw); + } + static fromValues(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer){ + const receipt = new Receipt(); + receipt.init(status, gasUsed, logsBloom, logs, contractAddress); + return receipt; + } + serialize(all: boolean) { + return all ? this.rlp : Buffer.concat([this.rlp, rlpEncode(this.contractAddress)]); + } + toJSON(block: Block, transaction: Transaction) { + const raw = this.raw; + return { + transactionHash: Data.from(transaction.hash()), + transactionIndex: Quantity.from((transaction as any)._index), + blockNumber: Quantity.from(block.value.header.number), + blockHash: Data.from(block.value.hash()), + cumulativeGasUsed: Quantity.from(block.value.header.gasUsed), + gasUsed: Quantity.from(raw[1]), + contractAddress: Data.from(this.contractAddress), + logs: raw[3], // TODO: figure this out + logsBloom: Data.from(raw[2], 256), + status: Quantity.from(raw[0]) + }; + } +} diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 6b14a707e4..a6c8637be9 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -2,114 +2,19 @@ import Errors from "./errors" import { Data } from "./json-rpc/json-rpc-data"; import { Quantity } from "./json-rpc"; import params from "./params"; - -const MAX_UINT64 = (1n << 64n) - 1n; - - -// import { Data, Quantity } from "./json-rpc"; -// import Address from "./address"; - -// type TransactionDataObject = { -// blockHash: string, -// blockNumber: string, -// from: string, -// gas: string, -// gasPrice: string, -// hash: string, -// input: string, -// nonce: string, -// to: string, -// transactionIndex: string, -// value: string, -// v: string, -// r: string, -// s: string -// } - -// type TransactionData = { -// blockHash: Data, -// blockNumber: Data, -// from: Address, -// gas: Quantity, -// gasPrice: Quantity, -// hash: Data, -// input: Data, -// nonce: Quantity, -// to: Address, -// transactionIndex: Quantity, -// value: Quantity, -// v: Quantity, -// r: Data, -// s: Data -// } - -// export default class Transaction implements TransactionData { -// blockHash: Data; -// blockNumber: Data; -// from: Data; -// gas: Quantity; -// gasPrice: Quantity; -// get hash(): Data { -// return new Data("0x123"); -// }; -// input: Data; -// nonce: Quantity; -// to: Data; -// transactionIndex: Quantity; -// value: Quantity; -// v: Quantity; -// r: Data; -// s: Data; -// constructor(transaction: TransactionData) { -// const obj = { -// blockHash: Data.from("0x123456", 32), // 32 Bytes - hash of the block where this transaction was in. null when its pending. -// blockNumber: Quantity.from(123n),// QUANTITY - block number where this transaction was in. null when its pending. -// from: Data.from("0x123456", 32), // 20 Bytes - address of the sender. -// gas: Quantity.from(123n),// QUANTITY - gas provided by the sender. -// gasPrice: Quantity.from(123n),// QUANTITY - gas price provided by the sender in Wei. -// hash: Data.from("0x123456", 32),// DATA, 32 Bytes - hash of the transaction. -// input: Data.from("0x123"),// DATA - the data send along with the transaction. -// nonce: Quantity.from(123456n),// QUANTITY - the number of transactions made by the sender prior to this one. -// to: Data.from("0x123456", 20),// DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. -// transactionIndex: Quantity.from(99n),// QUANTITY - integer of the transaction's index position in the block. null when its pending. -// value: Quantity.from(123n),// QUANTITY - value transferred in Wei. -// v: Quantity.from(Buffer.from([27])), // QUANTITY - ECDSA recovery id -// r: Data.from(Buffer.from([12,34,46]), 32),// DATA, 32 Bytes - ECDSA signature r -// s: Data.from("0x123456", 32),// DATA, 32 Bytes - ECDSA signature s -// } as any; -// Object.keys(obj).forEach((key) => { -// (this as any)[key] = obj[key] as any; -// }); -// } -// // https://github.com/fastify/fast-json-stringify -// // https://github.com/YousefED/typescript-json-schema -// toObject(): TransactionDataObject { -// const a = JSON.stringify({ -// gasPrice: this.gasPrice -// }); -// console.log(a); -// return { -// gasPrice: this.gasPrice.toString() -// } as TransactionDataObject; -// } -// /** -// * -// * @param tx Cost returns gasPrice * gas + value. -// */ -// cost(): bigint { -// return this.gasPrice.toBigInt() * this.gas.toBigInt() + this.value.toBigInt(); -// } -// } - -// const EthereumJsTransaction = require('ethereumjs-tx').Transaction -// const EthereumJsFakeTransaction = require('ethereumjs-tx').FakeTransaction import { Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction } from "ethereumjs-tx"; -// import EthereumJsFakeTransaction from "ethereumjs-tx/dist/fake"; import * as ethUtil from "ethereumjs-util"; import assert from "assert"; -import {decode as rlpDecode, encode as rlpEncode} from "rlp"; +import {decode as rlpDecode} from "rlp"; +import { RunTxResult } from "ethereumjs-vm/dist/runTx"; import { Block } from "../ledgers/ethereum/components/block-manager"; +import Receipt from "./receipt"; +const MAX_UINT64 = (1n << 64n) - 1n; +const ZERO_BUFFER = Buffer.from([0]); +const ONE_BUFFER = Buffer.from([0]); + +//#region helpers const sign = EthereumJsTransaction.prototype.sign; const fakeHash = function () { // this isn't memoization of the hash. previous versions of ganache-core @@ -220,6 +125,12 @@ function initData(tx: any, data: any) { } const self = tx; if (Array.isArray(data)) { + // add in our hacked-in `_index` property + // which is the index in the block the transaciton + // was mined in + if (data.length > tx._fields.length){ + tx._index = data.pop(); + } if (data.length > tx._fields.length) { throw new Error("wrong number of fields in data"); } @@ -257,6 +168,8 @@ function initData(tx: any, data: any) { } } +//#endregion + interface Transaction extends Omit {} class Transaction extends (EthereumJsTransaction as any) { type: number; @@ -267,12 +180,13 @@ class Transaction extends (EthereumJsTransaction as any) { _chainId: any; _hash: Buffer; readonly from: Buffer; + private _receipt: any; /** * @param {Object} [data] The data for this Transaction. * @param {Number} type The `Transaction.types` bit flag for this transaction * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ - constructor(data: any, type = Transaction.types.none, options?: any) { + constructor(data: any, type: number = Transaction.types.none, options?: any) { super(undefined, options); // EthereumJS-TX Transaction overwrites our `toJSON`, so we overwrite it back here: @@ -348,7 +262,7 @@ class Transaction extends (EthereumJsTransaction as any) { if (buf.equals(BUFFER_ZERO)) { // if the address is 0x0 make it 0x0{20} - toAccount = ethUtil.setLengthLeft(buf, 20); + toAccount = Buffer.alloc(20, 0); } else { toAccount = buf; } @@ -467,40 +381,28 @@ class Transaction extends (EthereumJsTransaction as any) { return resultJSON; } - generateReceipt = (result: any, block: any, transactionIndex: number) => { + initializeReceipt = (result: RunTxResult) => { const vmResult = result.execResult; - const status = vmResult.exceptionError ? 0 : 1; - const gasUsed = result.gasUsed; + const status = vmResult.exceptionError ? ZERO_BUFFER : ONE_BUFFER; + const gasUsed = result.gasUsed.toBuffer(); const logsBloom = result.bloom.bitvector; - const logs = vmResult.logs || Buffer.alloc(0); - const raw = rlpEncode([ + const logs = vmResult.logs || []; + + this._receipt = Receipt.fromValues( status, gasUsed, logsBloom, - logs - ]); - return { - transactionHash: this.hash(), - transactionIndex, - blockHash: null as Buffer, - blockNumber: block.header.number, - from: this.from, - to: this.to, - gasUsed, - cumulativeGasUsed: block.gasUsed, - contractAddress: result.createdAddress, logs, - status, - logsBloom, - v: this.v, - r: this.r, - s: this.s, - toJSON: (blockHash: Buffer) => { - // TODO: make this return the things - return {}; - }, - raw - } + result.createdAddress + ); + + // returns RLP encoded data for use in a transaction trie + return this._receipt.serialize(false); + } + + + getReceipt = () => { + return this._receipt; } }; From ed3d1727e17fa7a9620c54f429c75ceba65782db Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jan 2020 17:21:39 -0500 Subject: [PATCH 130/691] Whitespace fix --- .../components/transaction-manager.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ledgers/ethereum/components/transaction-manager.ts b/src/ledgers/ethereum/components/transaction-manager.ts index f399744ba7..65e82c3335 100644 --- a/src/ledgers/ethereum/components/transaction-manager.ts +++ b/src/ledgers/ethereum/components/transaction-manager.ts @@ -7,18 +7,18 @@ import Blockchain from "../blockchain"; export type TransactionManagerOptions = TransactionPoolOptions; export default class TransactionManager extends Manager { - public transactionPool: TransactionPool; + public transactionPool: TransactionPool; - constructor(blockchain: Blockchain, base: levelup.LevelUp, options: TransactionManagerOptions) { - super(blockchain, base, Transaction); + constructor(blockchain: Blockchain, base: levelup.LevelUp, options: TransactionManagerOptions) { + super(blockchain, base, Transaction); - this.transactionPool = new TransactionPool(blockchain, options); - this.transactionPool.on("drain", (transactions: Transaction[]) => { - // TODO: create pending block? - }); - } + this.transactionPool = new TransactionPool(blockchain, options); + this.transactionPool.on("drain", (transactions: Transaction[]) => { + // TODO: create pending block? + }); + } - public push(transaction: Transaction): Promise { - return this.transactionPool.insert(transaction); - } + public push(transaction: Transaction): Promise { + return this.transactionPool.insert(transaction); + } } From 2993ba3312af4a163cbd9a44eb9f9c4acf83e1dc Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Fri, 10 Jan 2020 17:59:00 -0500 Subject: [PATCH 131/691] Add eth_getTransactionByBlock* & test cases --- src/ledgers/ethereum/ledger.ts | 19 +++++++++++++++++++ test/ledger.ts | 27 +++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 41b215eb74..1cf18ca582 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -168,6 +168,25 @@ export default class Ethereum extends BaseLedger { return this.eth_getBlockTransactionCountByNumber(number); } + /** + * Returns information about a transaction by block hash and transaction index position. + * @param hash DATA, 32 Bytes - hash of a block. + * @param index QUANTITY - integer of the transaction index position. + */ + async eth_getTransactionByBlockHashAndIndex(hash: string | Buffer, index: string) { + const block = await this.eth_getBlockByHash(hash, true); + return block.transactions[parseInt(index, 10)]; + } + + /** + * Returns information about a transaction by block number and transaction index position. + * @param number QUANTITY|TAG - a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. + * @param index QUANTITY - integer of the transaction index position. + */ + async eth_getTransactionByBlockNumberAndIndex(number: string | Buffer, index: string) { + const block = await this.eth_getBlockByNumber(number, true); + return block.transactions[parseInt(index, 10)]; + } /** * Returns the number of uncles in a block from a block matching the given block hash. diff --git a/test/ledger.ts b/test/ledger.ts index 8ed4b35756..76c3761bd7 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -67,6 +67,33 @@ describe("ledger", () => { assert(count, "1"); }); + it("eth_getTransactionByBlockNumberAndIndex", async() => { + await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await sleep(); + + const tx = await provider.send("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); + assert.equal(tx.hash, "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", "Unexpected transaction hash."); + }); + + it("eth_getTransactionByBlockHashAndIndex", async() => { + await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await sleep(); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); + + const tx = await provider.send("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); + assert.equal(tx.hash, "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", "Unexpected transaction hash."); + }); + it("eth_getUncleCountByBlockHash", async() => { await provider.send("eth_sendTransaction", [{ from: accounts[0], From 96e8b83beec1c17248398501cf32b3ef5cf8a3ab Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Fri, 10 Jan 2020 18:25:29 -0500 Subject: [PATCH 132/691] Fix eth_blockNumber and Add test --- src/ledgers/ethereum/ledger.ts | 6 +++--- test/ledger.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 1cf18ca582..2abbc6976c 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -242,9 +242,9 @@ export default class Ethereum extends BaseLedger { * Returns the number of most recent block. * @returns integer of the current block number the client is on. */ - async eth_blockNumber(): Promise { - const latest = this[_blockchain].blocks.get(Tag.LATEST); - return latest.then((block: any) => BigInt(block.value.header.number)); + async eth_blockNumber() { + const latest = await this[_blockchain].blocks.get(Tag.LATEST); + return Quantity.from(latest.value.header.number); } /** diff --git a/test/ledger.ts b/test/ledger.ts index 76c3761bd7..e31e09a7ea 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -11,6 +11,19 @@ describe("ledger", () => { accounts = await provider.send("eth_accounts"); }); + it("eth_blockNumber", async () => { + const blockNumber = parseInt(await provider.send("eth_blockNumber"), 10); + await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await sleep(); + const nextBlockNumber = await provider.send("eth_blockNumber"); + assert.equal(blockNumber, nextBlockNumber - 1); + }); + it("eth_getBlockByNumber", async() => { await provider.send("eth_sendTransaction", [{ from: accounts[0], From 59fec4d9044d7b7ea33c0c72115d1afb8fe74c0d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 11 Jan 2020 20:57:28 -0500 Subject: [PATCH 133/691] Add `eth_getStorageAt` --- src/ledgers/ethereum/ledger.ts | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 2abbc6976c..c2e9cf4ffc 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -271,6 +271,59 @@ export default class Ethereum extends BaseLedger { return account.balance; } + /** + * Returns the value from a storage position at a given address. + * @param data 20 Bytes - address of the storage. + * @param quantity integer of the position in the storage. + * @param blockNumber integer block number, or the string "latest", "earliest" + * or "pending", see the default block parameter + */ + async eth_getStorageAt( + address: IndexableAddress, + position: bigint, + blockNumber: Buffer | Tag = Tag.LATEST + ): Promise { + const blockProm = this[_blockchain].blocks.getRaw(blockNumber); + + const trie = this[_blockchain].trie.copy(); + const getFromTrie = (address: Buffer): Promise => new Promise((resolve, reject) => { + trie.get(address, (err, data) => { + if(err) return reject(err); + resolve(data); + }); + }); + const block = await blockProm; + if (!block) return Data.from("0x"); + + const blockData = rlpDecode(block) as any as [[Buffer, Buffer, Buffer, Buffer /* stateRoot */] /* header */, Buffer[], Buffer[]]; + const headerData = blockData[0]; + const blockStateRoot = headerData[3]; + trie.root = blockStateRoot; + + const addressDataPromise = getFromTrie(Address.from(address).toBuffer()); + + const posBuff = Quantity.from(position).toBuffer(); + // if the provided `position` is > 32 bytes it's invalid. + // TODO: should we ignore or just return an RPC exception of some sort? + const length = posBuff.length; + if (length > 32) return Data.from("0x"); + let paddedPosBuff: Buffer; + if (length !== 32) { + // storage locations are 32 byte wide Buffers, so we need to + // expand any value given to at least 32 bytes + paddedPosBuff = Buffer.alloc(32); + posBuff.copy(paddedPosBuff, 32 - length); + } else { + paddedPosBuff = posBuff; + } + + const addressData = await addressDataPromise; + // An address's stateRoot is stored in the 3rd rlp entry + trie.root = (rlpDecode(addressData) as any as [Buffer /*nonce*/, Buffer /*amount*/, Buffer /*stateRoot*/, Buffer /*codeHash*/])[2]; + const value = await getFromTrie(paddedPosBuff); + return Data.from(value); + } + /** * Returns the information about a transaction requested by transaction hash. * From bfed61d56e3a6d3fc80f87a2ed268e505cb9d94b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 11 Jan 2020 21:01:35 -0500 Subject: [PATCH 134/691] Tweaks for transaction receipts --- npm-shrinkwrap.json | 36 +++++++++++---- src/ledgers/ethereum/blockchain.ts | 42 ++++++++++++----- src/ledgers/ethereum/components/manager.ts | 47 +++++++++++-------- src/ledgers/ethereum/ledger.ts | 53 ++++++++++++++-------- src/ledgers/ethereum/options.ts | 2 +- src/options/options.ts | 3 ++ src/types/receipt.ts | 45 ------------------ src/types/transaction-receipt.ts | 43 ++++++++++++++++++ src/types/transaction.ts | 36 +++++---------- 9 files changed, 180 insertions(+), 127 deletions(-) delete mode 100644 src/types/receipt.ts create mode 100644 src/types/transaction-receipt.ts diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 52d710627e..04a49e37b8 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1211,6 +1211,16 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" + }, + "dependencies": { + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + } } }, "merkle-patricia-tree": { @@ -1424,6 +1434,16 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" + }, + "dependencies": { + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + } } }, "merkle-patricia-tree": { @@ -2146,14 +2166,6 @@ "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - }, "level-iterator-stream": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", @@ -2165,6 +2177,14 @@ "xtend": "^4.0.0" }, "dependencies": { + "level-errors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.1.2.tgz", + "integrity": "sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w==", + "requires": { + "errno": "~0.1.1" + } + }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index f913ae365e..36d7188e45 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -13,8 +13,9 @@ import AccountManager from "./components/account-manager"; import Heap from "../../utils/heap"; import Transaction from "../../types/transaction"; import Manager from "./components/manager"; -import Receipt from "../../types/receipt"; +import TransactionReceipt from "../../types/transaction-receipt"; import {encode as rlpEncode} from "rlp"; +import Common from "ethereumjs-common"; const VM = require("ethereumjs-vm").default; @@ -40,7 +41,7 @@ export default class Blockchain extends Emittery { private state: Status = Status.starting; public blocks: BlockManager; public transactions: TransactionManager; - public transactionReceipts: Manager; + public transactionReceipts: Manager; public accounts: AccountManager; public vm: any; public trie: Trie; @@ -70,7 +71,7 @@ export default class Blockchain extends Emittery { const miner = new Miner(this.vm, options); this.transactions = new TransactionManager(this, database.transactions, options); - this.transactionReceipts = new Manager(this, database.transactionReceipts, Receipt); + this.transactionReceipts = new Manager(this, database.transactionReceipts, TransactionReceipt); this.accounts = new AccountManager(this); await this._initializeAccounts(options.accounts); @@ -125,12 +126,19 @@ export default class Blockchain extends Emittery { lastBlock = this.database.batch(() => { blockData.blockTransactions.forEach((tx: Transaction, i: number) => { const hash = tx.hash(); - const encoded = rlpEncode([...tx.raw, Quantity.from(i).toBuffer()]); - this.transactions.set(hash, encoded); + // todo: clean up transction extra data stuffs because this is gross: + const extraData = [ + ...tx.raw, + block.value.hash(), + block.value.header.number, + Quantity.from(i).toBuffer() + ]; + const encodedTx = rlpEncode(extraData); + this.transactions.set(hash, encodedTx); const receipt = tx.getReceipt(); - const r = receipt.serialize(block, tx); - this.transactionReceipts.set(hash, r); + const encodedReceipt = receipt.serialize(true); + this.transactionReceipts.set(hash, encodedReceipt); }); block.value.transactions = blockData.blockTransactions; this.blocks.putBlock(block); @@ -145,10 +153,21 @@ export default class Blockchain extends Emittery { } private createVmFromStateTrie(stateTrie: Trie, hardfork: string, allowUnlimitedContractSize: boolean): any { + const common = Common.forCustomChain( + "mainnet", // TODO needs to match chain id + { + name: "ganache", + networkId: 1, + chainId: 1, + comment: "Local test network", + bootstrapNodes: [] + }, + hardfork + ); const vm = new VM({ state: stateTrie, activatePrecompiles: true, - hardfork, + common, allowUnlimitedContractSize, blockchain: { getBlock: async (number: BN, done: any) => { @@ -216,11 +235,12 @@ export default class Blockchain extends Emittery { // TODO: this is just a prototype implementation const vm = this.vm.copy(); const stateManager = vm.stateManager; - await promisify(stateManager.setStateRoot.bind(stateManager))(parentBlock.value.header.stateRoot); - transaction.block = block; + const settingStateRootProm = promisify(stateManager.setStateRoot.bind(stateManager))(parentBlock.value.header.stateRoot); + transaction.block = block.value; transaction.caller = transaction.from; + await settingStateRootProm; const result = await vm.runCall(transaction); - return result.execResult.returnValue || "0x"; + return Data.from(result.execResult.returnValue || "0x"); } /** diff --git a/src/ledgers/ethereum/components/manager.ts b/src/ledgers/ethereum/components/manager.ts index f185f3e64b..a261fd8947 100644 --- a/src/ledgers/ethereum/components/manager.ts +++ b/src/ledgers/ethereum/components/manager.ts @@ -1,28 +1,35 @@ import levelup from "levelup"; import { Data } from "../../../types/json-rpc"; import Blockchain from "../blockchain"; +const NOTFOUND = 404; -export type Instantiable = {new(...args: any[]): T}; +export type Instantiable = { new(...args: any[]): T }; export default class Manager { - protected blockchain: Blockchain; - private Type: Instantiable; - protected base: levelup.LevelUp; - constructor(blockchain: Blockchain, base: levelup.LevelUp, type: Instantiable){ - this.Type = type; - this.blockchain = blockchain; - this.base = base; - } - getRaw(key: string | Buffer): Promise { - if (typeof key === "string") { - key = Data.from(key).toBuffer(); - } - return this.base.get(key); - } - get(key: string | Buffer) { - return this.getRaw(key).then((raw) => new this.Type(raw)); - } - set(key: Buffer, value: Buffer): Promise { - return this.base.put(key, value); + protected blockchain: Blockchain; + private Type: Instantiable; + protected base: levelup.LevelUp; + constructor(blockchain: Blockchain, base: levelup.LevelUp, type: Instantiable) { + this.Type = type; + this.blockchain = blockchain; + this.base = base; + } + getRaw(key: string | Buffer): Promise { + if (typeof key === "string") { + key = Data.from(key).toBuffer(); } + + return this.base.get(key).catch(e =>{ + if (e.status === NOTFOUND) return null; + throw e; + }); + } + async get(key: string | Buffer) { + const raw = await this.getRaw(key); + if (!raw) return null; + return new this.Type(raw); + } + set(key: Buffer, value: Buffer): Promise { + return this.base.put(key, value); + } } \ No newline at end of file diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index c2e9cf4ffc..78a2a730e8 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -19,6 +19,7 @@ const {name, version} = require("../../../package.json"); //#region Constants const CLIENT_VERSION = `EthereumJS ${name}/v${version}/ethereum-js` const PROTOCOL_VERSION = Data.from("0x3f"); +const BUFFER_EMPTY = Buffer.allocUnsafe(0); const BUFFER_ZERO = Buffer.from([0]); const RPCQUANTITY_ZERO = Quantity.from("0x0"); //#endregion @@ -327,16 +328,35 @@ export default class Ethereum extends BaseLedger { /** * Returns the information about a transaction requested by transaction hash. * - * @param transasctionHash 32 Bytes - hash of a transaction + * @param transactionHash 32 Bytes - hash of a transaction */ - async eth_getTransactionByHash(transasctionHash: IndexableData): Promise { - transasctionHash = Data.from(transasctionHash); - + async eth_getTransactionByHash(transactionHash: string): Promise { const chain = this[_blockchain]; - const transaction = await chain.transactions.get(transasctionHash); + const transaction = await chain.transactions.get(Data.from(transactionHash).toBuffer()); return transaction; } + /** + * Returns the receipt of a transaction by transaction hash. + * + * Note That the receipt is not available for pending transactions. + * + * @param transactionHash 32 Bytes - hash of a transaction + * @returns Returns the receipt of a transaction by transaction hash. + */ + async eth_getTransactionReceipt(transactionHash: string): Promise<{}> { + const blockchain = this[_blockchain]; + const transactionPromise = blockchain.transactions.get(transactionHash); + const receiptPromise = blockchain.transactionReceipts.get(transactionHash); + const blockPromise = transactionPromise.then(t => t ? blockchain.blocks.get(t._blockNum) : null); + const [transaction, receipt, block] = await Promise.all([transactionPromise, receiptPromise, blockPromise]); + if (receipt && block && transaction) { + return receipt.toJSON(block, transaction); + } else { + return null; + } + } + /** * Creates new message call transaction or a contract creation, if the data field contains code. * @param transaction @@ -376,7 +396,7 @@ export default class Ethereum extends BaseLedger { const tx = Transaction.fromJSON(transaction, type); if (tx.gasLimit.length === 0) { - tx.gasLimit = Buffer.from("015f90", "hex"); + tx.gasLimit = this[_options].defaultTransactionGasLimit.toBuffer(); } if (tx.gasPrice.length === 0) { @@ -388,7 +408,7 @@ export default class Ethereum extends BaseLedger { } if (tx.to.length === 0 || tx.to.equals(BUFFER_ZERO)) { - tx.to = Buffer.allocUnsafe(0); + tx.to = BUFFER_EMPTY; } if (isKnownAccount) { @@ -415,16 +435,13 @@ export default class Ethereum extends BaseLedger { async eth_call(transaction: any, blockNumber: Buffer | Tag = Tag.LATEST): Promise { const blocks = this[_blockchain].blocks; - const block = await blocks.get(blockNumber); - const blockCopy = blocks.createBlock(block.value.header); - const currentNumber = Quantity.from(blockCopy.value.header.number).toBigInt() || 0n; - let parentBlock: Block; - if (currentNumber > 0n) { - const previousBlockNumber = Quantity.from(currentNumber - 1n); - parentBlock = await blocks.get(previousBlockNumber.toBuffer()); - } else { - parentBlock = blockCopy; - } - return this[_blockchain].simulateTransaction(transaction, parentBlock, blockCopy); + const parentBlock = await blocks.get(blockNumber); + const parentHeader = parentBlock.value.header; + const newBlock = blocks.createBlock({ + number: parentHeader.number, + timestamp: parentHeader.timestamp, + parentHash: parentHeader.parentHash + }); + return this[_blockchain].simulateTransaction(transaction, parentBlock, newBlock); } } diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index b263ab6b99..f9c748a9cc 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,7 +1,7 @@ import Options from "../../options/provider-options"; import Account from "../../types/account"; -type EthereumOptions = Pick & { +type EthereumOptions = Pick & { timestamp: Date, accounts: Account[] }; diff --git a/src/options/options.ts b/src/options/options.ts index 122e91904b..646c0944e5 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -154,6 +154,8 @@ export default interface Options { */ gasLimit?: Quantity, + defaultTransactionGasLimit?: Quantity, + /** * */ @@ -184,6 +186,7 @@ export const getDefault: (options: Options)=> Options = (options) => { allowUnlimitedContractSize: false, gasPrice: new Quantity(2000000000), gasLimit: new Quantity(6721975), + defaultTransactionGasLimit: new Quantity(90000), verbose: false, asyncRequestProcessing: true, hardfork: "petersburg", diff --git a/src/types/receipt.ts b/src/types/receipt.ts deleted file mode 100644 index 11ea61a2c9..0000000000 --- a/src/types/receipt.ts +++ /dev/null @@ -1,45 +0,0 @@ -import Transaction from "./transaction"; -import { Block } from "../ledgers/ethereum/components/block-manager"; -import {encode as rlpEncode, decode as rlpDecode} from "rlp"; -import { Data, Quantity } from "./json-rpc"; - -export default class Receipt { - private contractAddress: Buffer; - private raw: any[]; - private rlp: Buffer; - - constructor(data?: Buffer) { - if (data) { - const decoded = rlpDecode(data) as any as [Buffer, Buffer, Buffer, Buffer[], Buffer]; - this.init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4]); - } - } - private init(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer = null){ - this.raw = [status, gasUsed, logsBloom, logs]; - this.contractAddress = contractAddress; - this.rlp = rlpEncode(this.raw); - } - static fromValues(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer){ - const receipt = new Receipt(); - receipt.init(status, gasUsed, logsBloom, logs, contractAddress); - return receipt; - } - serialize(all: boolean) { - return all ? this.rlp : Buffer.concat([this.rlp, rlpEncode(this.contractAddress)]); - } - toJSON(block: Block, transaction: Transaction) { - const raw = this.raw; - return { - transactionHash: Data.from(transaction.hash()), - transactionIndex: Quantity.from((transaction as any)._index), - blockNumber: Quantity.from(block.value.header.number), - blockHash: Data.from(block.value.hash()), - cumulativeGasUsed: Quantity.from(block.value.header.gasUsed), - gasUsed: Quantity.from(raw[1]), - contractAddress: Data.from(this.contractAddress), - logs: raw[3], // TODO: figure this out - logsBloom: Data.from(raw[2], 256), - status: Quantity.from(raw[0]) - }; - } -} diff --git a/src/types/transaction-receipt.ts b/src/types/transaction-receipt.ts new file mode 100644 index 0000000000..34c7ef8682 --- /dev/null +++ b/src/types/transaction-receipt.ts @@ -0,0 +1,43 @@ +import Transaction from "./transaction"; +import { Block } from "../ledgers/ethereum/components/block-manager"; +import { encode as rlpEncode, decode as rlpDecode } from "rlp"; +import { Data, Quantity } from "./json-rpc"; + +export default class TransactionReceipt { + private contractAddress: Buffer; + private raw: [Buffer, Buffer, Buffer, Buffer[]]; + + constructor(data?: Buffer) { + if (data) { + const decoded = rlpDecode(data) as any as [Buffer, Buffer, Buffer, Buffer[], Buffer]; + this.init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4]); + } + } + private init(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer = null) { + this.raw = [status, gasUsed, logsBloom, logs]; + this.contractAddress = contractAddress; + } + static fromValues(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer) { + const receipt = new TransactionReceipt(); + receipt.init(status, gasUsed, logsBloom, logs, contractAddress); + return receipt; + } + serialize(all: boolean) { + return all ? rlpEncode([...this.raw, this.contractAddress]) : rlpEncode(this.raw); + } + toJSON(block: Block, transaction: Transaction) { + const raw = this.raw; + return { + transactionHash: Data.from(transaction.hash()), + transactionIndex: Quantity.from((transaction as any)._index), + blockNumber: Quantity.from(block.value.header.number), + blockHash: Data.from(block.value.hash()), + cumulativeGasUsed: Quantity.from(block.value.header.gasUsed), + gasUsed: Quantity.from(raw[1]), + contractAddress: Data.from(this.contractAddress), + logs: raw[3], // TODO: figure this out + logsBloom: Data.from(raw[2], 256), + status: Quantity.from(raw[0]) + }; + } +} diff --git a/src/types/transaction.ts b/src/types/transaction.ts index a6c8637be9..3d89ad3705 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -8,7 +8,7 @@ import assert from "assert"; import {decode as rlpDecode} from "rlp"; import { RunTxResult } from "ethereumjs-vm/dist/runTx"; import { Block } from "../ledgers/ethereum/components/block-manager"; -import Receipt from "./receipt"; +import TransactionReceipt from "./transaction-receipt"; const MAX_UINT64 = (1n << 64n) - 1n; const ZERO_BUFFER = Buffer.from([0]); @@ -125,11 +125,13 @@ function initData(tx: any, data: any) { } const self = tx; if (Array.isArray(data)) { - // add in our hacked-in `_index` property + // add in our hacked-in properties // which is the index in the block the transaciton // was mined in - if (data.length > tx._fields.length){ + if (data.length === tx._fields.length + 3){ tx._index = data.pop(); + tx._blockNum = data.pop(); + tx._blockHash = data.pop(); } if (data.length > tx._fields.length) { throw new Error("wrong number of fields in data"); @@ -349,24 +351,13 @@ class Transaction extends (EthereumJsTransaction as any) { * * @param {Object} block The block this Transaction appears in. */ - toJSON(block: Block) { - const blockValue = block.value; - const hash = this.hash(); - - let transactionIndex = null; - for (let i = 0, txns = blockValue.transactions, l = txns.length; i < l; i++) { - if (txns[i].hash().equals(hash)) { - transactionIndex = i; - break; - } - } - - const resultJSON = { - hash: Data.from(hash), + toJSON(block?: Block) { + return { + hash: Data.from(this.hash()), nonce: Quantity.from(this.nonce), - blockHash: Data.from(block.value.hash()), - blockNumber: Data.from(block.value.header.number), - transactionIndex: Quantity.from(BigInt(transactionIndex)), + blockHash: Data.from(block ? block.value.hash() : this._blockHash), + blockNumber: Data.from(block ? block.value.header.number : this._blockNum), + transactionIndex: Quantity.from(this._index), from: Data.from(this.from), to: Data.from(this.to), value: Quantity.from(this.value), @@ -377,8 +368,6 @@ class Transaction extends (EthereumJsTransaction as any) { r: Quantity.from(this.r), s: Quantity.from(this.s) }; - - return resultJSON; } initializeReceipt = (result: RunTxResult) => { @@ -388,7 +377,7 @@ class Transaction extends (EthereumJsTransaction as any) { const logsBloom = result.bloom.bitvector; const logs = vmResult.logs || []; - this._receipt = Receipt.fromValues( + this._receipt = TransactionReceipt.fromValues( status, gasUsed, logsBloom, @@ -400,7 +389,6 @@ class Transaction extends (EthereumJsTransaction as any) { return this._receipt.serialize(false); } - getReceipt = () => { return this._receipt; } From 2ecafaa1597f67f661cdee67fbd6ba5504681581 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 11 Jan 2020 21:02:12 -0500 Subject: [PATCH 135/691] Add/update tests --- test/ledger.ts | 26 +++++++++++++++++++++++ test/temp-tests.ts | 52 +++++++++++++++++++++++++++------------------- 2 files changed, 57 insertions(+), 21 deletions(-) diff --git a/test/ledger.ts b/test/ledger.ts index e31e09a7ea..180d732a16 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -133,4 +133,30 @@ describe("ledger", () => { const count = await provider.send("eth_getUncleCountByBlockNumber", ["0x1"]); assert(count, "0"); }); + + it("eth_getTransactionReceipt", async() => { + const hash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await sleep(); + + const receipt = await provider.send("eth_getTransactionReceipt", [hash]); + assert(receipt.transactionIndex, "0x0"); + }); + + it("eth_getTransactionByHash", async() => { + const hash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: accounts[1], + value: 1 + }]); + // TODO: remove and replace with something that detects with the block is "mined" + await sleep(); + + const tx = await provider.send("eth_getTransactionByHash", [hash]); + assert(tx.transactionIndex, "0x0"); + }); }) diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 07de4561f9..4d81c0ceab 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -1,5 +1,6 @@ import Ganache from "../index" import assert from "assert"; +import { Quantity } from "../src/types/json-rpc"; const solc = require("solc"); function compileSolidity(source: string) { @@ -150,9 +151,11 @@ describe("Accounts", () => { assert.strictEqual(BigInt(balance0_1) + 123n, BigInt(balance0_2)); }); - it.skip("deploys contracts", async () => { - const contract = await compileSolidity("pragma solidity ^0.5.0; contract Example { event Event(); constructor() public { emit Event(); } }"); - const p = Ganache.provider(); + it("deploys contracts", async () => { + const contract = await compileSolidity("pragma solidity ^0.6.1; contract Example { uint public value; event Event(); constructor() public { value = 5; emit Event(); } function getVal() public pure returns (uint8) { return 123; } }"); + const p = Ganache.provider({ + defaultTransactionGasLimit: Quantity.from(6721975) + }); const accounts = await p.send("eth_accounts"); const transactionHash = await p.send("eth_sendTransaction", [ { @@ -160,9 +163,31 @@ describe("Accounts", () => { data: contract.code } ]); - await new Promise((resolve) => setTimeout(resolve, 3000)); - const result = await p.send("eth_getTransactionByHash", [transactionHash]); - console.log(result); + + // TODO: we need events so badly! + let result = null; + while (!result) { + result = await p.send("eth_getTransactionReceipt", [transactionHash]); + } + + assert.strictEqual(result.blockNumber, "0x1"); + + const hash = await p.send("eth_sendTransaction", [{ + from: accounts[1], + to: accounts[2], + value: 1 + }]); + let result2 = null; + while (!result2) { + result2 = await p.send("eth_getTransactionReceipt", [hash]); + } + + const ret = await p.send("eth_call", [{from: accounts[3], to: result.contractAddress, gasLimit: 6721975, data: "0xe1cb0e52"}]); + + assert.strictEqual(ret, "0x000000000000000000000000000000000000000000000000000000000000007b"); + + const storage = await p.send("eth_getStorageAt", [result.contractAddress, 0, "0x2"]); + assert.strictEqual(storage, "0x05"); }); it("runs eth_call", async () => { @@ -174,19 +199,4 @@ describe("Accounts", () => { const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); assert(true); }); - - it.skip("eth_getStorageAt", async () => { - const p = Ganache.provider(); - const accounts = await p.send("eth_accounts"); - await p.send("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); - // TODO: remove and replace with something that detects with the block is "mined" - await new Promise((resolve) => setTimeout(resolve, 3000)); - - const storage = await p.send("eth_getStorageAt", [accounts[0], 0]); - console.log(storage) - }) }); From e048b07ced6463817dc99b78522286693f9012e2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 13 Jan 2020 10:35:57 -0500 Subject: [PATCH 136/691] Set longer timeout on tests so they actually pass --- test/temp-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 4d81c0ceab..da7f9538e4 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -61,7 +61,7 @@ describe("Accounts", () => { const balance1_2 = await p.send("eth_getBalance", [accounts[1]]); assert.strictEqual(parseInt(balance1_1) + 1, parseInt(balance1_2)); - }); + }).timeout(5000); it("should create its own mnemonic", async() => { const p = Ganache.provider(); @@ -149,7 +149,7 @@ describe("Accounts", () => { const balance0_2 = await p.send("eth_getBalance", [accounts[0]]); assert.strictEqual(BigInt(balance0_1) + 123n, BigInt(balance0_2)); - }); + }).timeout(12000); it("deploys contracts", async () => { const contract = await compileSolidity("pragma solidity ^0.6.1; contract Example { uint public value; event Event(); constructor() public { value = 5; emit Event(); } function getVal() public pure returns (uint8) { return 123; } }"); From 69f6d0ba56ad41191bd12be54f770f5a6844ab0a Mon Sep 17 00:00:00 2001 From: "Nicholas J. Paterno" Date: Sun, 19 Jan 2020 14:03:59 -0500 Subject: [PATCH 137/691] Update dependencies --- npm-shrinkwrap.json | 108 +++++++++++++++++++++++++------------------- package.json | 10 ++-- 2 files changed, 67 insertions(+), 51 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 04a49e37b8..4e6009f1eb 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -270,9 +270,9 @@ "dev": true }, "@types/node": { - "version": "13.1.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.4.tgz", - "integrity": "sha512-Lue/mlp2egZJoHXZr4LndxDAd7i/7SQYhV0EjWfb/a4/OZ6tuVwMCVPiwkU5nsEipxEf7hmkSU7Em5VQ8P5NGA==" + "version": "13.1.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.8.tgz", + "integrity": "sha512-6XzyyNM9EKQW4HKuzbo/CkOIjn/evtCmsU+MUM1xDfJ+3/rNjBttM1NgN7AOQvN6tP1Sl1D1PIKMreTArnxM9A==" }, "@types/seedrandom": { "version": "2.4.28", @@ -301,9 +301,9 @@ } }, "@types/ws": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.4.tgz", - "integrity": "sha512-PpPrX7SZW9re6+Ha8ojZG4Se8AZXgf0GK6zmfqEuCsY49LFDNXO3SByp44X3dFEqtB73lkCDAdUazhAjVPiNwg==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.0.tgz", + "integrity": "sha512-HnqczxiZ828df9FUh9OyY7vSOelpQNaj+SLEnDvU74rYijp61ggV7dhmDlMky0oYXKLdVuIG4KvExk8DEqzJgQ==", "dev": true, "requires": { "@types/node": "*" @@ -797,9 +797,9 @@ "dev": true }, "core-js-pure": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.2.tgz", - "integrity": "sha512-PRasaCPjjCB65au2dMBPtxuIR6LM8MVNdbIbN57KxcDV1FAYQWlF0pqje/HC2sM6nm/s9KqSTkMTU75pozaghA==" + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.4.tgz", + "integrity": "sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw==" }, "core-util-is": { "version": "1.0.2", @@ -1376,9 +1376,9 @@ } }, "ethereumjs-vm": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.1.2.tgz", - "integrity": "sha512-Zxz/i0u6+74kZ/0UEAbCd2WCSTuS0jPM9LnM9TUGXDbffrkULb1tIBcgHWqYsARGCQJGMDZj5FKDtUJ04Heowg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.1.3.tgz", + "integrity": "sha512-RTrD0y7My4O6Qr1P2ZIsMfD6RzL6kU/RhBZ0a5XrPzAeR61crBS7or66ohDrvxDI/rDBxMi+6SnsELih6fzalw==", "requires": { "async": "^2.1.2", "async-eventemitter": "^0.2.2", @@ -1402,15 +1402,6 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, - "ethereumjs-tx": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", - "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, "keccak": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", @@ -1434,16 +1425,6 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" - }, - "dependencies": { - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - } } }, "merkle-patricia-tree": { @@ -2166,6 +2147,14 @@ "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, "level-iterator-stream": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", @@ -3832,22 +3821,22 @@ } }, "ts-node": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.5.4.tgz", - "integrity": "sha512-izbVCRV68EasEPQ8MSIGBNK9dc/4sYJJKYA+IarMQct1RtEot6Xp0bXuClsbUSnKpg50ho+aOAx8en5c+y4OFw==", + "version": "8.6.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz", + "integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==", "dev": true, "requires": { "arg": "^4.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "source-map-support": "^0.5.6", - "yn": "^3.0.0" + "yn": "3.1.1" }, "dependencies": { "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true } } @@ -3912,9 +3901,9 @@ } }, "typescript": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz", - "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==", + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz", + "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==", "dev": true }, "uWebSockets.js": { @@ -3949,12 +3938,39 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "util.promisify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", "requires": { - "define-properties": "^1.1.2", - "object.getownpropertydescriptors": "^2.0.3" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.2.tgz", + "integrity": "sha512-YoKuru3Lyoy7yVTBSH2j7UxTqe/je3dWAruC0sHvZX1GNd5zX8SSLvQqEgO9b3Ex8IW+goFI9arEEsFIbulhOw==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } } }, "uuid": { diff --git a/package.json b/package.json index ecb790052f..d43ae20e15 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "ethereumjs-common": "^1.5.0", "ethereumjs-tx": "^2.1.2", "ethereumjs-util": "6.2.0", - "ethereumjs-vm": "4.1.2", + "ethereumjs-vm": "^4.1.3", "ethereumjs-wallet": "0.6.3", "keccak": "3.0.0", "leveldown": "5.4.1", @@ -46,11 +46,11 @@ }, "devDependencies": { "@types/mocha": "^5.2.7", - "@types/node": "^13.1.4", + "@types/node": "^13.1.8", "@types/seedrandom": "^2.4.28", "@types/superagent": "^4.1.4", "@types/uws": "^0.13.2", - "@types/ws": "^6.0.4", + "@types/ws": "^7.2.0", "bufferutil": "4.0.1", "cross-env": "^6.0.3", "into-stream": "^5.1.1", @@ -60,9 +60,9 @@ "solc": "0.6.1", "source-map-support": "^0.5.16", "superagent": "5.2.1", - "ts-node": "^8.5.4", + "ts-node": "^8.6.2", "tslint": "^5.20.1", - "typescript": "^3.7.4", + "typescript": "^3.7.5", "utf-8-validate": "^5.0.2", "ws": "^7.2.1" }, From 02c05f7aa1539d7e5fb6bcab9f8e405df3469d6f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 23 Apr 2020 21:02:53 -0400 Subject: [PATCH 138/691] Update dependencies --- npm-shrinkwrap.json | 1121 +++++++++++++++++------------------- package.json | 60 +- src/server.ts | 2 +- src/servers/http-server.ts | 2 +- 4 files changed, 561 insertions(+), 624 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4e6009f1eb..dff3817e6d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -5,45 +5,38 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.8.3" } }, "@babel/core": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.7.tgz", - "integrity": "sha512-jlSjuj/7z138NLZALxVgrx13AOtqip42ATZP7+kYl53GvDV6+4dCek1mVUo8z8c8Xnw/mx2q3d9HWh3griuesQ==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", + "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", "dev": true, "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.7", - "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.7", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.0", + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helpers": "^7.9.0", + "@babel/parser": "^7.9.0", + "@babel/template": "^7.8.6", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", - "json5": "^2.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", "lodash": "^4.17.13", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -56,111 +49,172 @@ } }, "@babel/generator": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.7.tgz", - "integrity": "sha512-/AOIBpHh/JU1l0ZFS4kiRCBnLi6OTHzh0RPk3h9isBxkkqELtQNFi1Vr/tiG9p1yfoUdKVwISuXWQR+hwwM4VQ==", + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", + "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", "dev": true, "requires": { - "@babel/types": "^7.7.4", + "@babel/types": "^7.9.5", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, "@babel/helper-function-name": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", - "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", + "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/types": "^7.9.5" } }, "@babel/helper-get-function-arity": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", - "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", + "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", + "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", + "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-replace-supers": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", + "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "requires": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" } }, "@babel/helper-split-export-declaration": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", - "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", "dev": true, "requires": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.3" } }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, "@babel/helpers": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.4.tgz", - "integrity": "sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg==", + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", + "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", "dev": true, "requires": { - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0" } }, "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.7.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.7.tgz", - "integrity": "sha512-WtTZMZAZLbeymhkd/sEaPD8IQyGAhmuTuvTzLiCFM7iXiVdY0gc0IaI+cW0fh1BnSMbJSzXX6/fHllgHKwHhXw==", + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", "dev": true }, "@babel/template": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", - "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" } }, "@babel/traverse": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", - "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", + "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.5", + "@babel/helper-function-name": "^7.9.5", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/parser": "^7.9.0", + "@babel/types": "^7.9.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" }, "dependencies": { - "@babel/code-frame": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", - "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -173,12 +227,12 @@ } }, "@babel/types": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", - "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", "dev": true, "requires": { - "esutils": "^2.0.2", + "@babel/helper-validator-identifier": "^7.9.5", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -238,9 +292,9 @@ "dev": true }, "@types/bn.js": { - "version": "4.11.5", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz", - "integrity": "sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng==", + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", "requires": { "@types/node": "*" } @@ -264,15 +318,15 @@ "dev": true }, "@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", + "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", "dev": true }, "@types/node": { - "version": "13.1.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.8.tgz", - "integrity": "sha512-6XzyyNM9EKQW4HKuzbo/CkOIjn/evtCmsU+MUM1xDfJ+3/rNjBttM1NgN7AOQvN6tP1Sl1D1PIKMreTArnxM9A==" + "version": "13.13.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", + "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==" }, "@types/seedrandom": { "version": "2.4.28", @@ -281,9 +335,9 @@ "dev": true }, "@types/superagent": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.4.tgz", - "integrity": "sha512-SRH2q6/5/nhOkAuLXm3azRGjBYpoKCZWh138Rt1AxSIyE6/1b9uClIH2V+JfyDtjIvgr5yQqYgNUmdpbneJoZQ==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.7.tgz", + "integrity": "sha512-JSwNPgRYjIC4pIeOqLwWwfGj6iP1n5NE6kNBEbGx2V8H78xCPwx7QpNp9plaI30+W3cFEzJO7BIIsXE+dbtaGg==", "dev": true, "requires": { "@types/cookiejar": "*", @@ -301,9 +355,9 @@ } }, "@types/ws": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.0.tgz", - "integrity": "sha512-HnqczxiZ828df9FUh9OyY7vSOelpQNaj+SLEnDvU74rYijp61ggV7dhmDlMky0oYXKLdVuIG4KvExk8DEqzJgQ==", + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.4.tgz", + "integrity": "sha512-9S6Ask71vujkVyeEXKxjBSUV8ZUB0mjL5la4IncBoheu04bDaYyUKErh1BQcY9+WzOUOiKqz/OnpJHYckbMfNg==", "dev": true, "requires": { "@types/node": "*" @@ -379,9 +433,9 @@ "dev": true }, "arg": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.2.tgz", - "integrity": "sha512-+ytCkGcBtHZ3V2r2Z06AncYO8jz46UEamcspGoU8lHcEbpn6J77QK0vdWvChsclg/tM5XIJC5tnjmPp7Eq6Obg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "argparse": { @@ -394,11 +448,11 @@ } }, "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", "requires": { - "lodash": "^4.17.11" + "lodash": "^4.17.14" } }, "async-eventemitter": { @@ -421,17 +475,22 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base-x": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.5.tgz", - "integrity": "sha512-C3picSgzPSLE+jW3tcBzJoGwitOtazb5B+5YmAxZm2ybmTi9LNgAtDO/jjVEBZwHoXmDBZ9m/IELj3elJVRBcA==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", "requires": { "safe-buffer": "^5.0.1" } }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" + }, "bigint-buffer": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.2.tgz", - "integrity": "sha512-gof9NgbodUgCXD2aUHfUKk5KUDk6/zPlwE+YYpRM2t7zS0K/6WipJFWfziIY+EavxFDuGUnuuQQzzvNcckPKNA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", "optional": true, "requires": { "bindings": "^1.3.0" @@ -551,6 +610,15 @@ "safe-buffer": "^5.1.2" } }, + "buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -712,22 +780,6 @@ } } }, - "coinstring": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/coinstring/-/coinstring-2.3.0.tgz", - "integrity": "sha1-zbYzY6lhUCQEolr7gsLibV/2J6Q=", - "requires": { - "bs58": "^2.0.1", - "create-hash": "^1.1.1" - }, - "dependencies": { - "bs58": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-2.0.1.tgz", - "integrity": "sha1-VZCNWPGYKrogCPob7Y+RmYopv40=" - } - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -753,15 +805,15 @@ } }, "command-exists": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz", - "integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", "dev": true }, "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", "dev": true }, "commondir": { @@ -788,6 +840,14 @@ "dev": true, "requires": { "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "cookiejar": { @@ -797,9 +857,9 @@ "dev": true }, "core-js-pure": { - "version": "3.6.4", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.4.tgz", - "integrity": "sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw==" + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" }, "core-util-is": { "version": "1.0.2", @@ -832,18 +892,18 @@ } }, "cross-env": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-6.0.3.tgz", - "integrity": "sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz", + "integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==", "dev": true, "requires": { - "cross-spawn": "^7.0.0" + "cross-spawn": "^7.0.1" } }, "cross-spawn": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", - "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -936,9 +996,9 @@ } }, "elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -957,9 +1017,9 @@ } }, "emittery": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.5.1.tgz", - "integrity": "sha512-sYZXNHH9PhTfs98ROEFVC3bLiR8KSqXQsEHIwZ9J6H0RaQObC3JYq4G8IvDd0b45/LxfGKYBpmaUN4LiKytaNw==" + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.6.0.tgz", + "integrity": "sha512-6EMRGr9KzYWp8DzHFZsKVZBsMO6QhAeHMeHND8rhyBNCHKMLpgW9tZv40bwN3rAIKRS5CxcK8oLRKUJSB9h7yQ==" }, "emoji-regex": { "version": "7.0.3", @@ -1011,9 +1071,9 @@ } }, "es-abstract": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0.tgz", - "integrity": "sha512-yYkE07YF+6SIBmg1MsJ9dlub5L48Ek7X0qz+c/CPCHS9EBXfESorzng4cJQjJW5/pB6vDF41u7F8vUhLVDqIug==", + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", @@ -1063,12 +1123,6 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, "ethashjs": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.7.tgz", @@ -1131,31 +1185,6 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, - "ethereumjs-tx": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", - "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", - "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^2.0.0", - "rlp": "^2.2.3", - "secp256k1": "^3.0.1" - } - } - } - }, "ethereumjs-util": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", @@ -1168,35 +1197,17 @@ "rlp": "^2.0.0", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" - }, - "dependencies": { - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - } } }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, "keccak": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", - "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "requires": { - "bindings": "^1.5.0", - "inherits": "^2.0.4", - "nan": "^2.14.0", - "safe-buffer": "^5.2.0" + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" } }, "levelup": { @@ -1211,16 +1222,6 @@ "prr": "~1.0.1", "semver": "~5.4.1", "xtend": "~4.0.0" - }, - "dependencies": { - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - } } }, "merkle-patricia-tree": { @@ -1244,16 +1245,6 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" } } - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" - }, - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" } } }, @@ -1347,11 +1338,6 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, "keccak": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", @@ -1362,16 +1348,6 @@ "nan": "^2.14.0", "safe-buffer": "^5.2.0" } - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" - }, - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" } } }, @@ -1528,13 +1504,13 @@ } }, "find-cache-dir": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.2.0.tgz", - "integrity": "sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^3.0.0", + "make-dir": "^3.0.2", "pkg-dir": "^4.1.0" } }, @@ -1583,9 +1559,9 @@ } }, "formidable": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", - "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", + "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", "dev": true }, "from2": { @@ -1623,9 +1599,9 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", "dev": true, "optional": true }, @@ -1639,6 +1615,12 @@ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -1646,9 +1628,9 @@ "dev": true }, "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1659,9 +1641,9 @@ } }, "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -1723,9 +1705,9 @@ } }, "hasha": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.1.0.tgz", - "integrity": "sha512-OFPDWmzPN1l7atOV1TgBVmNtBxaIysToK6Ve9DK+vT6pYuklw/nPNT+HJbZi0KDcI6vWB+9tgvZ5YD7fA3CXcA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", "dev": true, "requires": { "is-stream": "^2.0.0", @@ -1733,11 +1715,11 @@ } }, "hdkey": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.1.tgz", - "integrity": "sha512-DvHZ5OuavsfWs5yfVJZestsnc3wzPvLWNk6c2nRUfo6X+OtxypGt20vDDf7Ba+MJzjL3KS1og2nw2eBbLCOUTA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.2.tgz", + "integrity": "sha512-PTQ4VKu0oRnCrYfLp04iQZ7T2Cxz0UsEXYauk2j8eh6PJXCpbXuCFhOmtIFtbET0i3PMWmHN9J11gU8LEgUljQ==", "requires": { - "coinstring": "^2.0.0", + "bs58check": "^2.1.2", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } @@ -1759,11 +1741,16 @@ } }, "html-escaper": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.0.tgz", - "integrity": "sha512-a4u9BeERWGu/S8JiWEAQcdrg9v4QArtP9keViQjGMdff20fBdd8waotXaNmODqBe6uZ3Nafi7K/ho4gCQHV3Ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + }, "immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", @@ -1791,9 +1778,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "into-stream": { "version": "5.1.1", @@ -1803,14 +1790,6 @@ "requires": { "from2": "^2.3.0", "p-is-promise": "^3.0.0" - }, - "dependencies": { - "p-is-promise": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", - "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", - "dev": true - } } }, "is-binary-path": { @@ -1931,9 +1910,9 @@ } }, "istanbul-lib-instrument": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.0.tgz", - "integrity": "sha512-Nm4wVHdo7ZXSG30KjZ2Wl5SU/Bw7bDx1PdaiIFzEStdjs0H12mOTncn1GVYuqQSaZxpg87VGBRsVRPGD2cD1AQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz", + "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==", "dev": true, "requires": { "@babel/core": "^7.7.5", @@ -1969,19 +1948,13 @@ }, "dependencies": { "rimraf": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", - "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" } - }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", - "dev": true } } }, @@ -2042,9 +2015,9 @@ } }, "istanbul-reports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.0.tgz", - "integrity": "sha512-2osTcC8zcOSUkImzN2EWQta3Vdi4WjjKw99P2yWx5mLnigAM0Rd5uYFn1cf2i/Ois45GkNjaoTqc5CxgMSX80A==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -2073,9 +2046,9 @@ } }, "jsbi": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-3.1.1.tgz", - "integrity": "sha512-+HQESPaV0mRiH614z4JPVPAftcRC2p53x92lySPzUzFwJbJTMpzHz8OYUkcXPN3fOcHUe0NdVcHnCtX/1+eCrA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-3.1.2.tgz", + "integrity": "sha512-5nDXo1X9QVaXK/Cpb5VECV9ss1QPbjUuk1qSruHB1PK/g39Sd414K4nci99ElFDZv0vzxDEnKn3o49/Tn9Yagw==", "dev": true }, "jsesc": { @@ -2085,20 +2058,12 @@ "dev": true }, "json5": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", - "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "dev": true, "requires": { - "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } + "minimist": "^1.2.5" } }, "jsonfile": { @@ -2166,14 +2131,6 @@ "xtend": "^4.0.0" }, "dependencies": { - "level-errors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.1.2.tgz", - "integrity": "sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w==", - "requires": { - "errno": "~0.1.1" - } - }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", @@ -2216,6 +2173,11 @@ "ltgt": "~2.2.0", "safe-buffer": "~5.1.1" } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" } } }, @@ -2290,13 +2252,6 @@ "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", "requires": { "xtend": "^4.0.2" - }, - "dependencies": { - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } } }, "level-ws": { @@ -2330,9 +2285,9 @@ } }, "leveldown": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.4.1.tgz", - "integrity": "sha512-3lMPc7eU3yj5g+qF1qlALInzIYnkySIosR1AsUKFjL9D8fYbTLuENBAeDRZXIG4qeWOAyqRItOoLu2v2avWiMA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", + "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", "requires": { "abstract-leveldown": "~6.2.1", "napi-macros": "~2.0.0", @@ -2340,10 +2295,12 @@ }, "dependencies": { "abstract-leveldown": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.2.tgz", - "integrity": "sha512-/a+Iwj0rn//CX0EJOasNyZJd2o8xur8Ce9C57Sznti/Ilt/cb6Qd8/k98A4ZOklXgTG+iAYYUs1OTG0s1eH+zQ==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", "level-concat-iterator": "~2.0.0", "level-supports": "~1.0.0", "xtend": "~4.0.0" @@ -2357,9 +2314,9 @@ } }, "levelup": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.3.2.tgz", - "integrity": "sha512-cRTjU4ktWo59wf13PHEiOayHC3n0dOh4i5+FHr4tv4MX9+l7mqETicNq3Aj07HKlLdk0z5muVoDL2RD+ovgiyA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", "requires": { "deferred-leveldown": "~5.3.0", "level-errors": "~2.0.0", @@ -2369,10 +2326,12 @@ }, "dependencies": { "abstract-leveldown": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.2.tgz", - "integrity": "sha512-/a+Iwj0rn//CX0EJOasNyZJd2o8xur8Ce9C57Sznti/Ilt/cb6Qd8/k98A4ZOklXgTG+iAYYUs1OTG0s1eH+zQ==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", "level-concat-iterator": "~2.0.0", "level-supports": "~1.0.0", "xtend": "~4.0.0" @@ -2403,35 +2362,18 @@ "inherits": "^2.0.4", "readable-stream": "^3.4.0", "xtend": "^4.0.2" - }, - "dependencies": { - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } } }, "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" - }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -2453,9 +2395,9 @@ } }, "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==" + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, "lodash.flattendeep": { "version": "4.4.0", @@ -2464,12 +2406,12 @@ "dev": true }, "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", "dev": true, "requires": { - "chalk": "^2.0.1" + "chalk": "^2.4.2" } }, "lru-cache": { @@ -2486,9 +2428,9 @@ "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" }, "make-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", - "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -2503,9 +2445,9 @@ } }, "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "md5.js": { @@ -2529,6 +2471,13 @@ "inherits": "~2.0.1", "ltgt": "~2.2.0", "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } }, "memorystream": { @@ -2551,6 +2500,11 @@ "semaphore": ">=1.0.1" }, "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, "ethereumjs-util": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", @@ -2563,13 +2517,6 @@ "rlp": "^2.0.0", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } } }, "isarray": { @@ -2599,9 +2546,9 @@ }, "dependencies": { "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -2611,13 +2558,18 @@ "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" } } }, "readable-stream": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", - "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -2630,6 +2582,13 @@ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } } } } @@ -2696,24 +2655,24 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", "dev": true, "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, "mocha": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.0.0.tgz", - "integrity": "sha512-CirsOPbO3jU86YKjjMzFLcXIb5YiGLUrjrXFHoJ3e2z9vWiaZVCZQ2+gtRGMPWF+nFhN6AWwLM/juzAQ6KRkbA==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.1.tgz", + "integrity": "sha512-3qQsu3ijNS3GkWcccT5Zw0hf/rWvu1fTN9sPvEd81hlwsr30GX2GcDSSoBxo24IR8FelmrAydGC6/1J5QQP4WA==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -2727,9 +2686,9 @@ "growl": "1.10.5", "he": "1.2.0", "js-yaml": "3.13.1", - "log-symbols": "2.2.0", + "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", + "mkdirp": "0.5.3", "ms": "2.1.1", "node-environment-flags": "1.0.6", "object.assign": "4.1.0", @@ -2737,8 +2696,8 @@ "supports-color": "6.0.0", "which": "1.3.1", "wide-align": "1.1.3", - "yargs": "13.3.0", - "yargs-parser": "13.1.1", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", "yargs-unparser": "1.6.0" }, "dependencies": { @@ -2774,9 +2733,9 @@ "dev": true }, "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" }, "napi-macros": { "version": "2.0.0", @@ -2807,9 +2766,9 @@ } }, "node-gyp-build": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.0.tgz", - "integrity": "sha512-4oiumOLhCDU9Rronz8PZ5S4IvT39H5+JEv/hps9V8s7RSLhsac0TCP78ulnHXOo8X1wdpPiTayGlM1jr4IbnaQ==" + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.1.tgz", + "integrity": "sha512-XyCKXsqZfLqHep1hhsMncoXuUNt/cXCjg1+8CLbu69V1TKuPiOeSGbL9n+k/ByKH8UT0p4rdIX8XkTRZV0i7Sw==" }, "node-preload": { "version": "0.2.1", @@ -2827,9 +2786,9 @@ "dev": true }, "nyc": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.0.tgz", - "integrity": "sha512-qcLBlNCKMDVuKb7d1fpxjPR8sHeMVX0CHarXAVzrVWoFrigCkYR8xcrjfXSPi5HXM7EU78L6ywO7w1c5rZNCNg==", + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.1.tgz", + "integrity": "sha512-n0MBXYBYRqa67IVt62qW1r/d9UH/Qtr7SF1w/nQLJ9KxvWF6b2xCHImRAixHN9tnMMYHC2P14uo6KddNGwMgGg==", "dev": true, "requires": { "@istanbuljs/load-nyc-config": "^1.0.0", @@ -2847,10 +2806,9 @@ "istanbul-lib-processinfo": "^2.0.2", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.0", - "js-yaml": "^3.13.1", + "istanbul-reports": "^3.0.2", "make-dir": "^3.0.0", - "node-preload": "^0.2.0", + "node-preload": "^0.2.1", "p-map": "^3.0.0", "process-on-spawn": "^1.0.0", "resolve-from": "^5.0.0", @@ -2858,7 +2816,6 @@ "signal-exit": "^3.0.2", "spawn-wrap": "^2.0.0", "test-exclude": "^6.0.0", - "uuid": "^3.3.3", "yargs": "^15.0.2" }, "dependencies": { @@ -2920,20 +2877,6 @@ "path-exists": "^4.0.0" } }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "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" - } - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2965,9 +2908,9 @@ "dev": true }, "rimraf": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", - "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -2993,12 +2936,6 @@ "ansi-regex": "^5.0.0" } }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", - "dev": true - }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -3011,9 +2948,9 @@ } }, "yargs": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.1.0.tgz", - "integrity": "sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==", + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", "dev": true, "requires": { "cliui": "^6.0.0", @@ -3026,13 +2963,13 @@ "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^16.1.0" + "yargs-parser": "^18.1.1" } }, "yargs-parser": { - "version": "16.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-16.1.0.tgz", - "integrity": "sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -3092,10 +3029,16 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "p-is-promise": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", + "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", + "dev": true + }, "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -3173,9 +3116,9 @@ } }, "picomatch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", - "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, "pkg-dir": { @@ -3224,9 +3167,9 @@ } }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "process-on-spawn": { "version": "1.0.0", @@ -3248,9 +3191,9 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, "qs": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.1.tgz", - "integrity": "sha512-Cxm7/SS/y/Z3MHWSxXb8lIFqgqBowP5JMlTUFyJN88y0SGQhVmZnqFK/PeuMX9LzUyWsqqhNxIyg0jlzq946yA==", + "version": "6.9.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", + "integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", "dev": true }, "randombytes": { @@ -3262,14 +3205,14 @@ } }, "reachdown": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.0.0.tgz", - "integrity": "sha512-Ty7X/t52GwgRam3SMpZC2grmutuUarkiD4sVhjM8g8/5NlX8PAEsYO/pyx6nTTqS9udee1j1BxaAS/f6Rm8SMw==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz", + "integrity": "sha512-6LsdRe4cZyOjw4NnvbhUd/rGG7WQ9HMopPr+kyL018Uci4kijtxcGR5kVb5Ln13k4PEE+fEFQbjfOvNw7cnXmA==" }, "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -3285,6 +3228,11 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -3332,9 +3280,9 @@ "dev": true }, "resolve": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", - "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -3364,12 +3312,11 @@ } }, "rlp": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", - "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.4.tgz", + "integrity": "sha512-fdq2yYCWpAQBhwkZv+Z8o/Z4sPmYm1CUq6P7n6lVTOdb949CnqA0sndXal5C1NleSVSZm6q5F3iEbauyVln/iw==", "requires": { - "bn.js": "^4.11.1", - "safe-buffer": "^5.1.1" + "bn.js": "^4.11.1" }, "dependencies": { "bn.js": { @@ -3385,9 +3332,9 @@ "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" }, "scrypt": { "version": "6.0.3", @@ -3416,17 +3363,17 @@ } }, "secp256k1": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.0.tgz", - "integrity": "sha512-YlUIghD6ilkMkzmFJpIdVjiamv2S8lNZ9YMwm1XII9JC0NcR5qQiv2DOp/G37sExBtaMStzba4VDJtvBXEbmMQ==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", "requires": { "bindings": "^1.5.0", "bip66": "^1.1.5", "bn.js": "^4.11.8", "create-hash": "^1.2.0", "drbg.js": "^1.0.1", - "elliptic": "^6.4.1", - "nan": "^2.13.2", + "elliptic": "^6.5.2", + "nan": "^2.14.0", "safe-buffer": "^5.1.2" }, "dependencies": { @@ -3473,6 +3420,13 @@ "integrity": "sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ==", "requires": { "nan": "2.13.2" + }, + "dependencies": { + "nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" + } } }, "shebang-command": { @@ -3491,15 +3445,15 @@ "dev": true }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "solc": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.1.tgz", - "integrity": "sha512-iKqNYps2p++x8L9sBg7JeAJb7EmW8VJ/2asAzwlLYcUhj86AzuWLe94UTSQHv1SSCCj/x6lya8twvXkZtlTbIQ==", + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.6.tgz", + "integrity": "sha512-p0IO/1fRaHWKN+qR+mUivpwnBpFYD8EoFAzT8VL4lmllNwsyEO7TJJAc2QK0XUeWOYOT92NWKhDNNNLTVbHShA==", "dev": true, "requires": { "command-exists": "^1.2.8", @@ -3512,12 +3466,6 @@ "tmp": "0.0.33" }, "dependencies": { - "commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "dev": true - }, "js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", @@ -3548,9 +3496,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "version": "0.5.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.18.tgz", + "integrity": "sha512-9luZr/BZ2QeU6tO2uG8N2aZpVSli4TSAOAqFOyTO51AJcD9P99c0K1h6dD6r6qo5dyT44BR5exweOaLLeldTkQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -3580,9 +3528,9 @@ }, "dependencies": { "rimraf": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz", - "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -3606,22 +3554,42 @@ "strip-ansi": "^4.0.0" } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string.prototype.trimleft": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", - "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" } }, "string.prototype.trimright": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", - "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" } }, "string_decoder": { @@ -3659,23 +3627,25 @@ "dev": true }, "subleveldown": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-4.1.4.tgz", - "integrity": "sha512-njpSBP/Bxh7EahraG6IhR6goOH2ffMTMVt7Ud+k/OhNFHrrmuvK+XYfauI8KnjCm0w381cUF43pejlWeJMZChA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.0.tgz", + "integrity": "sha512-DotbiAIyOWSsidM06/m+EsBHXRyP7EgPlDDD5GVn6JcoDFcVZbp+VN9bOdErNtDWwgR+lJDuKwcJ8nKqSq9Ixg==", "requires": { - "abstract-leveldown": "^6.1.1", + "abstract-leveldown": "^6.2.3", "encoding-down": "^6.2.0", "inherits": "^2.0.3", "level-option-wrap": "^1.1.0", "levelup": "^4.3.1", - "reachdown": "^1.0.0" + "reachdown": "^1.1.0" }, "dependencies": { "abstract-leveldown": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.2.tgz", - "integrity": "sha512-/a+Iwj0rn//CX0EJOasNyZJd2o8xur8Ce9C57Sznti/Ilt/cb6Qd8/k98A4ZOklXgTG+iAYYUs1OTG0s1eH+zQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", + "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", "level-concat-iterator": "~2.0.0", "level-supports": "~1.0.0", "xtend": "~4.0.0" @@ -3708,9 +3678,9 @@ } }, "superagent": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.2.1.tgz", - "integrity": "sha512-46b4Lkwnlz7Ebdv2FBbfuqb3kVkG1jV/SK3EW6NnwL9a3T4h5hHtegNEQfbXvTFbDoUZXId4W3dMgap2f6ic1g==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.2.2.tgz", + "integrity": "sha512-pMWBUnIllK4ZTw7p/UaobiQPwAO5w/1NRRTDpV0FTVNmECztsxKspj3ZWEordVEaqpZtmOQJJna4yTLyC/q7PQ==", "dev": true, "requires": { "component-emitter": "^1.3.0", @@ -3736,9 +3706,9 @@ } }, "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -3746,12 +3716,6 @@ "util-deprecate": "^1.0.1" } }, - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", - "dev": true - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -3821,15 +3785,15 @@ } }, "ts-node": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.6.2.tgz", - "integrity": "sha512-4mZEbofxGqLL2RImpe3zMJukvEvcO1XP8bj8ozBPySdCUXEcU5cIRwR0aM3R+VoZq7iXc8N86NC0FspGRqP4gg==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.9.0.tgz", + "integrity": "sha512-rwkXfOs9zmoHrV8xE++dmNd6ZIS+nmHHCxcV53ekGJrxFLMbp+pizpPS07ARvhwneCIECPppOwbZHvw9sQtU4w==", "dev": true, "requires": { "arg": "^4.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.6", + "source-map-support": "^0.5.17", "yn": "3.1.1" }, "dependencies": { @@ -3842,15 +3806,15 @@ } }, "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", "dev": true }, "tslint": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", - "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.1.tgz", + "integrity": "sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -3861,17 +3825,23 @@ "glob": "^7.1.1", "js-yaml": "^3.13.1", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", + "mkdirp": "^0.5.3", "resolve": "^1.3.2", "semver": "^5.3.0", - "tslib": "^1.8.0", + "tslib": "^1.10.0", "tsutils": "^2.29.0" }, "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true } } @@ -3901,14 +3871,14 @@ } }, "typescript": { - "version": "3.7.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz", - "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", "dev": true }, "uWebSockets.js": { - "version": "github:uNetworking/uWebSockets.js#da161f254495c7dd2925f778b36310b6f49bcb01", - "from": "github:uNetworking/uWebSockets.js#v16.4.0" + "version": "github:uNetworking/uWebSockets.js#116a85f9668dcb03e7799db06dc8275bc43c0963", + "from": "github:uNetworking/uWebSockets.js#v17.4.0" }, "utf-8-validate": { "version": "5.0.2", @@ -3946,37 +3916,12 @@ "es-abstract": "^1.17.2", "has-symbols": "^1.0.1", "object.getownpropertydescriptors": "^2.1.0" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.2.tgz", - "integrity": "sha512-YoKuru3Lyoy7yVTBSH2j7UxTqe/je3dWAruC0sHvZX1GNd5zX8SSLvQqEgO9b3Ex8IW+goFI9arEEsFIbulhOw==", - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } } }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, "which": { "version": "2.0.2", @@ -4047,9 +3992,9 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.1.tgz", - "integrity": "sha512-JPStrIyyVJ6oCSz/691fAjFtefZ6q+fP6tm+OS4Qw6o+TGQxNp1ziY2PgS+X/m0V8OWhZiO/m4xSj+Pr4RrZvw==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, "requires": { "imurmurhash": "^0.1.4", @@ -4059,15 +4004,15 @@ } }, "ws": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz", - "integrity": "sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", + "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==", "dev": true }, "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, "y18n": { "version": "4.0.0", @@ -4081,9 +4026,9 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, "requires": { "cliui": "^5.0.0", @@ -4095,7 +4040,7 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" + "yargs-parser": "^13.1.2" }, "dependencies": { "ansi-regex": { @@ -4127,9 +4072,9 @@ } }, "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -4145,14 +4090,6 @@ "flat": "^4.1.0", "lodash": "^4.17.15", "yargs": "^13.3.0" - }, - "dependencies": { - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - } } }, "yn": { diff --git a/package.json b/package.json index d43ae20e15..0ddc3d4a73 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "2.2.1", "main": "./index.js", "engines": { - "node": ">=8.9.0", - "npm": ">=6.4.1" + "node": ">=10.7.0 <=14.0.0", + "npm": ">=6.1.0" }, "directories": { "lib": "./lib" @@ -27,47 +27,47 @@ "bip39": "3.0.2", "bn.js": "5.1.1", "cachedown": "1.0.0", - "emittery": "0.5.1", + "emittery": "0.6.0", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.2", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.2", + "ethereumjs-common": "1.5.0", + "ethereumjs-tx": "2.1.2", "ethereumjs-util": "6.2.0", - "ethereumjs-vm": "^4.1.3", + "ethereumjs-vm": "4.1.3", "ethereumjs-wallet": "0.6.3", "keccak": "3.0.0", - "leveldown": "5.4.1", - "levelup": "4.3.2", + "leveldown": "5.6.0", + "levelup": "4.4.0", "merkle-patricia-tree": "3.0.0", "seedrandom": "3.0.5", - "subleveldown": "4.1.4", + "subleveldown": "5.0.0", "tmp-promise": "2.0.2", - "uWebSockets.js": "github:uNetworking/uWebSockets.js#v16.4.0" + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v17.4.0" }, "devDependencies": { - "@types/mocha": "^5.2.7", - "@types/node": "^13.1.8", - "@types/seedrandom": "^2.4.28", - "@types/superagent": "^4.1.4", - "@types/uws": "^0.13.2", - "@types/ws": "^7.2.0", + "@types/mocha": "7.0.2", + "@types/node": "13.13.2", + "@types/seedrandom": "2.4.28", + "@types/superagent": "4.1.7", + "@types/uws": "0.13.2", + "@types/ws": "7.2.4", "bufferutil": "4.0.1", - "cross-env": "^6.0.3", - "into-stream": "^5.1.1", - "jsbi": "^3.1.1", - "mocha": "^7.0.0", - "nyc": "^15.0.0", - "solc": "0.6.1", - "source-map-support": "^0.5.16", - "superagent": "5.2.1", - "ts-node": "^8.6.2", - "tslint": "^5.20.1", - "typescript": "^3.7.5", - "utf-8-validate": "^5.0.2", - "ws": "^7.2.1" + "cross-env": "7.0.2", + "into-stream": "5.1.1", + "jsbi": "3.1.2", + "mocha": "7.1.1", + "nyc": "15.0.1", + "solc": "0.6.6", + "source-map-support": "0.5.18", + "superagent": "5.2.2", + "ts-node": "8.9.0", + "tslint": "6.1.1", + "typescript": "3.8.3", + "utf-8-validate": "5.0.2", + "ws": "7.2.3" }, "optionalDependencies": { - "bigint-buffer": "1.1.2" + "bigint-buffer": "1.1.5" }, "repository": { "type": "git", diff --git a/src/server.ts b/src/server.ts index 663ac2d3ea..a699e456b8 100644 --- a/src/server.ts +++ b/src/server.ts @@ -32,7 +32,7 @@ export default class Server { const opts = this[options] = getDefaultServerOptions(serverOptions); const prov = this.provider = new Provider(opts); - const _app = this[app] = uWS.App(null); + const _app = this[app] = uWS.App(); if (this[options].ws) { this[websocketServer] = new WebsocketServer(_app, prov, opts); diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 78a1c8e9cf..d76f86851a 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -66,7 +66,7 @@ function prepareCORSResponseHeaders(method: string, request: HttpRequest) { function sendResponse(response: HttpResponse, statusCode: HttpResponseCodes, contentType?: RecognizedString, data?: RecognizedString, writeHeaders: (response: HttpResponse) => void = noop): void { - response.experimental_cork(()=>{ + response.cork(()=>{ response.writeStatus(statusCode); writeHeaders(response); if (contentType) { From ab5c1c33fc97be49cd1e59e188cac718a03d8fb8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 23 Apr 2020 21:03:15 -0400 Subject: [PATCH 139/691] Require strict node engine in development --- .npmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..4fd021952d --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true \ No newline at end of file From 4bb6383369872291ccc79c3eb34abb560303fe22 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 24 Apr 2020 16:41:26 -0400 Subject: [PATCH 140/691] Use private class fields --- npm-shrinkwrap.json | 82 ++++++---------- package.json | 6 +- src/engine.ts | 6 +- src/ledgers/ethereum/blockchain.ts | 44 ++++----- .../ethereum/components/account-manager.ts | 13 ++- .../ethereum/components/block-manager.ts | 2 +- src/ledgers/ethereum/components/manager.ts | 6 +- .../ethereum/components/transaction-pool.ts | 28 +++--- src/ledgers/ethereum/database.ts | 45 +++++---- src/ledgers/ethereum/ledger.ts | 16 ++-- src/ledgers/ethereum/miner.ts | 96 +++++++++---------- src/options/provider-options.ts | 6 +- src/provider.ts | 78 +++++++-------- src/server.ts | 38 ++++---- src/servers/http-server.ts | 17 ++-- src/servers/ws-server.ts | 93 +++++++++--------- src/types/json-rpc/json-rpc-base-types.ts | 4 +- src/types/transaction-receipt.ts | 24 ++--- src/types/transaction.ts | 2 +- src/utils/request-processor.ts | 20 ++-- test/provider.ts | 10 +- test/temp-tests.ts | 4 +- tsconfig.json | 7 +- typings/hdkey.d.ts | 31 ++++++ 24 files changed, 345 insertions(+), 333 deletions(-) create mode 100644 typings/hdkey.d.ts diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index dff3817e6d..28c3bc4221 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -317,6 +317,19 @@ "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", "dev": true }, + "@types/lodash": { + "version": "4.14.150", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.150.tgz", + "integrity": "sha512-kMNLM5JBcasgYscD9x/Gvr6lTAv2NVgsKtet/hm93qMyf/D1pt+7jeEZklKJKxMVmXjxbRVQQGfqDSfipYCO6w==" + }, + "@types/lodash.clonedeep": { + "version": "4.5.6", + "resolved": "https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz", + "integrity": "sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==", + "requires": { + "@types/lodash": "*" + } + }, "@types/mocha": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", @@ -328,6 +341,15 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==" }, + "@types/secp256k1": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-3.5.0.tgz", + "integrity": "sha512-ZE39QhkIaNK6xbKIp1VLN5O36r97LuslLmRnjAcT0sVDxcfvrk3zqp/VnIfmGza7J6jDxR8dIai3hsCxPYglPA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/seedrandom": { "version": "2.4.28", "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz", @@ -371,11 +393,6 @@ "xtend": "~4.0.0" } }, - "aes-js": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", - "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" - }, "aggregate-error": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", @@ -1441,22 +1458,6 @@ } } }, - "ethereumjs-wallet": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/ethereumjs-wallet/-/ethereumjs-wallet-0.6.3.tgz", - "integrity": "sha512-qiXPiZOsStem+Dj/CQHbn5qex+FVkuPmGH7SvSnA9F3tdRDt8dLMyvIj3+U05QzVZNPYh4HXEdnzoYI4dZkr9w==", - "requires": { - "aes-js": "^3.1.1", - "bs58check": "^2.1.2", - "ethereumjs-util": "^6.0.0", - "hdkey": "^1.1.0", - "randombytes": "^2.0.6", - "safe-buffer": "^5.1.2", - "scrypt.js": "^0.3.0", - "utf8": "^3.0.0", - "uuid": "^3.3.2" - } - }, "ethjs-util": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", @@ -2399,6 +2400,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" + }, "lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", @@ -3336,32 +3342,6 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" }, - "scrypt": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz", - "integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=", - "optional": true, - "requires": { - "nan": "^2.0.8" - } - }, - "scrypt.js": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz", - "integrity": "sha512-42LTc1nyFsyv/o0gcHtDztrn+aqpkaCNt5Qh7ATBZfhEZU7IC/0oT/qbBH+uRNoAPvs2fwiOId68FDEoSRA8/A==", - "requires": { - "scrypt": "^6.0.2", - "scryptsy": "^1.2.1" - } - }, - "scryptsy": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", - "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", - "requires": { - "pbkdf2": "^3.0.3" - } - }, "secp256k1": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", @@ -3897,11 +3877,6 @@ } } }, - "utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", - "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -3921,7 +3896,8 @@ "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true }, "which": { "version": "2.0.2", diff --git a/package.json b/package.json index 0ddc3d4a73..510f931f54 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ ] }, "dependencies": { + "@types/lodash.clonedeep": "4.5.6", "bip39": "3.0.2", "bn.js": "5.1.1", "cachedown": "1.0.0", @@ -34,11 +35,13 @@ "ethereumjs-tx": "2.1.2", "ethereumjs-util": "6.2.0", "ethereumjs-vm": "4.1.3", - "ethereumjs-wallet": "0.6.3", + "hdkey": "1.1.2", "keccak": "3.0.0", "leveldown": "5.6.0", "levelup": "4.4.0", + "lodash.clonedeep": "4.5.0", "merkle-patricia-tree": "3.0.0", + "secp256k1": "3.8.0", "seedrandom": "3.0.5", "subleveldown": "5.0.0", "tmp-promise": "2.0.2", @@ -47,6 +50,7 @@ "devDependencies": { "@types/mocha": "7.0.2", "@types/node": "13.13.2", + "@types/secp256k1": "3.5.0", "@types/seedrandom": "2.4.28", "@types/superagent": "4.1.7", "@types/uws": "0.13.2", diff --git a/src/engine.ts b/src/engine.ts index be402bf1c4..6dba0ba89b 100644 --- a/src/engine.ts +++ b/src/engine.ts @@ -3,14 +3,14 @@ import Emittery from "emittery"; export default class Engine extends Emittery { - private readonly _ledger: ILedger; + readonly #ledger: ILedger; /** * The Engine handles execution of methods on the given Ledger * @param ledger */ constructor(ledger: ILedger) { super(); - this._ledger = ledger; + this.#ledger = ledger; } /** @@ -22,7 +22,7 @@ export default class Engine extends Emittery { // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { - const ledger = this._ledger; + const ledger = this.#ledger; // Only allow executing our *own* methods: if (methodName !== "constructor" && ledger.__proto__.hasOwnProperty(methodName)) { const fn = ledger[methodName]; diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 36d7188e45..ead14c56cd 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -38,14 +38,14 @@ type BlockchainOptions = { }; export default class Blockchain extends Emittery { - private state: Status = Status.starting; + #state: Status = Status.starting; public blocks: BlockManager; public transactions: TransactionManager; public transactionReceipts: Manager; public accounts: AccountManager; public vm: any; public trie: Trie; - private readonly database: Database + readonly #database: Database /** * Initializes the underlying Database and handles synchronization between @@ -58,7 +58,7 @@ export default class Blockchain extends Emittery { constructor(options: BlockchainOptions) { super(); - const database = this.database = new Database(options, this); + const database = this.#database = new Database(options, this); database.on("ready", async () => { // TODO: get the latest block from the database @@ -72,10 +72,10 @@ export default class Blockchain extends Emittery { const miner = new Miner(this.vm, options); this.transactions = new TransactionManager(this, database.transactions, options); this.transactionReceipts = new Manager(this, database.transactionReceipts, TransactionReceipt); - this.accounts = new AccountManager(this); + this.accounts = new AccountManager(this, database.trie); - await this._initializeAccounts(options.accounts); - let lastBlock = this._initializeGenesisBlock(options.timestamp, options.gasLimit); + await this.#initializeAccounts(options.accounts); + let lastBlock = this.#initializeGenesisBlock(options.timestamp, options.gasLimit); const readyNextBlock = async () => { const previousBlock = await lastBlock; @@ -84,7 +84,7 @@ export default class Blockchain extends Emittery { return this.blocks.createBlock({ number: Quantity.from(previousNumber + 1n).toBuffer(), gasLimit: options.gasLimit.toBuffer(), - timestamp: this._currentTime(), + timestamp: this.#currentTime(), parentHash: previousHeader.hash(), }); } @@ -113,7 +113,7 @@ export default class Blockchain extends Emittery { parentHash: previousHeader.hash(), number: Quantity.from(previousNumber + 1n).toBuffer(), // coinbase: - timestamp: this._currentTime(), + timestamp: this.#currentTime(), // difficulty: gasLimit: options.gasLimit.toBuffer(), transactionsTrie: blockData.transactionsTrie.root, @@ -123,7 +123,7 @@ export default class Blockchain extends Emittery { }); this.blocks.latest = block; - lastBlock = this.database.batch(() => { + lastBlock = this.#database.batch(() => { blockData.blockTransactions.forEach((tx: Transaction, i: number) => { const hash = tx.hash(); // todo: clean up transction extra data stuffs because this is gross: @@ -147,12 +147,12 @@ export default class Blockchain extends Emittery { }); this.blocks.earliest = this.blocks.latest = await lastBlock; - this.state = Status.started; + this.#state = Status.started; this.emit("start"); }); } - private createVmFromStateTrie(stateTrie: Trie, hardfork: string, allowUnlimitedContractSize: boolean): any { + createVmFromStateTrie = (stateTrie: Trie, hardfork: string, allowUnlimitedContractSize: boolean): any => { const common = Common.forCustomChain( "mainnet", // TODO needs to match chain id { @@ -171,7 +171,7 @@ export default class Blockchain extends Emittery { allowUnlimitedContractSize, blockchain: { getBlock: async (number: BN, done: any) => { - const hash = await this._blockNumberToHash(number); + const hash = await this.#blockNumberToHash(number); done(this.blocks.get(hash)); } } @@ -180,7 +180,7 @@ export default class Blockchain extends Emittery { return vm; } - private async _initializeAccounts(accounts: Account[]): Promise { + #initializeAccounts = async (accounts: Account[]): Promise => { const stateManager = this.vm.stateManager; const putAccount = promisify(stateManager.putAccount.bind(stateManager)); const checkpoint = promisify(stateManager.checkpoint.bind(stateManager)) @@ -199,11 +199,11 @@ export default class Blockchain extends Emittery { return commit(); } - private async _initializeGenesisBlock(timestamp: Date, blockGasLimit: Quantity): Promise { + #initializeGenesisBlock = async (timestamp: Date, blockGasLimit: Quantity): Promise => { // create the genesis block const genesis = this.blocks.next({ // If we were given a timestamp, use it instead of the `_currentTime` - timestamp: ((timestamp as any) / 1000 | 0) || this._currentTime(), + timestamp: ((timestamp as any) / 1000 | 0) || this.#currentTime(), gasLimit: blockGasLimit.toBuffer(), stateRoot: this.trie.root, number: "0x0" @@ -213,7 +213,7 @@ export default class Blockchain extends Emittery { return this.blocks.putBlock(genesis); } - private _currentTime() { + #currentTime = () => { // Take the floor of the current time return (Date.now() / 1000) | 0; } @@ -222,7 +222,7 @@ export default class Blockchain extends Emittery { * Given a block number, find its hash in the database * @param number */ - private _blockNumberToHash(number: BN): Promise { + #blockNumberToHash = (number: BN): Promise => { return number.toString() as any; } @@ -251,15 +251,15 @@ export default class Blockchain extends Emittery { // yet because there may still be database calls in flight. Leveldb may // cause a segfault due to a race condition between a db write and the close // call. - if (this.state === Status.starting) { + if (this.#state === Status.starting) { await new Promise((resolve) => { this.on("start", resolve); }); } - if (this.state === Status.started) { - this.state = Status.stopping; - await this.database.close(); - this.state = Status.stopped; + if (this.#state === Status.started) { + this.#state = Status.stopping; + await this.#database.close(); + this.#state = Status.stopped; } this.emit("stop"); } diff --git a/src/ledgers/ethereum/components/account-manager.ts b/src/ledgers/ethereum/components/account-manager.ts index 827dcb666a..f208ad56e6 100644 --- a/src/ledgers/ethereum/components/account-manager.ts +++ b/src/ledgers/ethereum/components/account-manager.ts @@ -3,17 +3,20 @@ import Address from "../../../types/address"; import Trie from "merkle-patricia-tree/baseTrie"; import Blockchain from "../blockchain"; import Tag from "../../../types/tags"; +import { LevelUp } from "levelup"; export default class AccountManager { - private blockchain: Blockchain; - constructor(blockchain: Blockchain) { - this.blockchain = blockchain; + #blockchain: Blockchain; + #trie: LevelUp; + constructor(blockchain: Blockchain, trie: LevelUp) { + this.#blockchain = blockchain; + this.#trie = trie; } public async get(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { - const blockchain = this.blockchain; + const blockchain = this.#blockchain; const block = await blockchain.blocks.get(blockNumber); - const trieCopy = new Trie((blockchain as any).database.trie, block.value.header.stateRoot); + const trieCopy = new Trie(this.#trie, block.value.header.stateRoot); return new Promise((resolve, reject) => { trieCopy.get(address.toBuffer(), (err, data)=>{ if(err) return reject(err); diff --git a/src/ledgers/ethereum/components/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts index e9bffa0796..07bc6175a8 100644 --- a/src/ledgers/ethereum/components/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -131,7 +131,7 @@ export class Block { this.manager = manager; } - private getTxFn(include = false): (tx: Transaction) => {[key: string] : string} | Data { + getTxFn = (include = false): (tx: Transaction) => {[key: string] : string} | Data => { if (include) { return (tx: Transaction) => tx.toJSON(this) } else { diff --git a/src/ledgers/ethereum/components/manager.ts b/src/ledgers/ethereum/components/manager.ts index a261fd8947..dd6eb8347f 100644 --- a/src/ledgers/ethereum/components/manager.ts +++ b/src/ledgers/ethereum/components/manager.ts @@ -7,10 +7,10 @@ export type Instantiable = { new(...args: any[]): T }; export default class Manager { protected blockchain: Blockchain; - private Type: Instantiable; + #Type: Instantiable; protected base: levelup.LevelUp; constructor(blockchain: Blockchain, base: levelup.LevelUp, type: Instantiable) { - this.Type = type; + this.#Type = type; this.blockchain = blockchain; this.base = base; } @@ -27,7 +27,7 @@ export default class Manager { async get(key: string | Buffer) { const raw = await this.getRaw(key); if (!raw) return null; - return new this.Type(raw); + return new this.#Type(raw); } set(key: Buffer, value: Buffer): Promise { return this.base.put(key, value); diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index 9efe7889a8..7fc0755b5d 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -21,21 +21,21 @@ function byNonce(values: Transaction[], a: number, b: number) { } export default class TransactionPool extends Emittery { - private options: TransactionPoolOptions; + #options: TransactionPoolOptions; /** * Minimum price bump percentage to replace an already existing transaction (nonce) */ public priceBump: bigint = 10n - private blockchain: Blockchain; + #blockchain: Blockchain; constructor(blockchain: Blockchain, options: TransactionPoolOptions) { super(); - this.blockchain = blockchain; - this.options = options; + this.#blockchain = blockchain; + this.#options = options; } public executables: Map> = new Map(); - private origins: Map> = new Map(); + #origins: Map> = new Map(); public async insert(transaction: Transaction) { let err: Error; @@ -50,7 +50,7 @@ export default class TransactionPool extends Emittery { const transactionNonce = Quantity.from(transaction.nonce).toBigInt() || 0n; const origin = from.toString(); - const origins = this.origins; + const origins = this.#origins; let queuedOriginTransactions = origins.get(origin); let isExecutableTransaction = false; @@ -104,8 +104,8 @@ export default class TransactionPool extends Emittery { // TODO: since this is the only async code in this `insert` fn, maybe we can // put this into the miner? The VM itself does check for everything this // validation function checks for. - const transactor = await this.blockchain.accounts.get(from); - err = await this.validateTransactor(transaction, transactor); + const transactor = await this.#blockchain.accounts.get(from); + err = await this.#validateTransactor(transaction, transactor); if (err != null) { // TODO: how do we surface these transaction failures to the caller?! throw err; @@ -129,7 +129,7 @@ export default class TransactionPool extends Emittery { executables.set(origin, executableOriginTransactions); } - this.drainQueued(origin, queuedOriginTransactions, executableOriginTransactions, transactionNonce); + this.#drainQueued(origin, queuedOriginTransactions, executableOriginTransactions, transactionNonce); } else if (queuedOriginTransactions) { queuedOriginTransactions.push(transaction); } else { @@ -138,11 +138,11 @@ export default class TransactionPool extends Emittery { } } - private drainQueued(origin: string, queuedOriginTransactions: Heap, executableOriginTransactions: Heap, transactionNonce: bigint) { + #drainQueued = (origin: string, queuedOriginTransactions: Heap, executableOriginTransactions: Heap, transactionNonce: bigint) => { // Now we need to drain any queued transacions that were previously // not executable due to nonce gaps into the origin's queue... if (queuedOriginTransactions) { - const origins = this.origins; + const origins = this.#origins; let nextExpectedNonce: bigint = transactionNonce + 1n; while (true) { @@ -173,9 +173,9 @@ export default class TransactionPool extends Emittery { this.emit("drain", this.executables); } - private validateTransaction(transaction: Transaction): Error { + validateTransaction = (transaction: Transaction): Error => { // Check the transaction doesn't exceed the current block limit gas. - if (this.options.gasLimit < Quantity.from(transaction.gasLimit)) { + if (this.#options.gasLimit < Quantity.from(transaction.gasLimit)) { return new Error("Transaction gasLimit is too low"); } @@ -195,7 +195,7 @@ export default class TransactionPool extends Emittery { return null; } - private async validateTransactor(transaction: Transaction, transactor: any): Promise { + #validateTransactor = async (transaction: Transaction, transactor: any): Promise => { // Transactor should have enough funds to cover the costs if (transactor.balance.toBigInt() < transaction.cost()) { return new Error("Account does not have enough funds to complete transaction"); diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index d8b04ed813..610cc22c96 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -15,9 +15,9 @@ const noop = (callback: () => void): void => callback(); export default class Database extends Emittery { public readonly blockchain: Blockchain; - private readonly options: DatabaseOptions; - private _cleanupDirectory = noop; - private closed = false; + readonly #options: DatabaseOptions; + #cleanupDirectory = noop; + #closed = false; public directory: string = null; public db: levelup.LevelUp = null; public blocks: levelup.LevelUp; @@ -27,7 +27,7 @@ export default class Database extends Emittery { public transactionReceipts: levelup.LevelUp; public trie: levelup.LevelUp; public readonly initialized: boolean; - private _rootStore: AbstractLevelDOWN; + #rootStore: AbstractLevelDOWN; /** * The Database handles the creation of the database, and all access to it. @@ -40,46 +40,45 @@ export default class Database extends Emittery { constructor(options: DatabaseOptions, blockchain: Blockchain) { super(); - this.options = options; + this.#options = options; this.blockchain = blockchain; - this._initialize(); + this.#initialize(); } - private async _initialize() { + #initialize = async () => { const levelupOptions: any = { valueEncoding: "binary" }; - const store = this.options.db; + const store = this.#options.db; let db; if (store) { - this._rootStore = store as any; + this.#rootStore = store as any; db = levelup(store as any, levelupOptions); } else { - let directory = this.options.db_path; + let directory = this.#options.db_path; if (!directory) { const dirInfo = await dir(tmpOptions); directory = dirInfo.path; - this._cleanupDirectory = dirInfo.cleanup; + this.#cleanupDirectory = dirInfo.cleanup; // don't continue if we closed while we were waiting for the dir - if (this.closed) return this._cleanup(); + if (this.#closed) return this.#cleanup(); } this.directory = directory; const store = encode(leveldown(directory), levelupOptions); - this._rootStore = store; + this.#rootStore = store; db = levelup(store, {}); } // don't continue if we closed while we were waiting for the db - if (this.closed) return this._cleanup(); + if (this.#closed) return this.#cleanup(); const open = db.open(); - (db as any).___aaaa____ = true; this.trie = sub(db, "T", levelupOptions); this.db = db; await open; // don't continue if we closed while we were waiting for it to open - if (this.closed) return this._cleanup(); + if (this.#closed) return this.#cleanup(); this.blocks = sub(db, "b", levelupOptions); this.transactions = sub(db, "t", levelupOptions); @@ -99,8 +98,8 @@ export default class Database extends Emittery { * @returns {Promise} returns a Promise that resolves to the return value * of the provided function. */ - batch(fn: () => T): Promise { - const rootDb = this._rootStore.db; + public batch(fn: () => T): Promise { + const rootDb = this.#rootStore.db; const batch = this.db.batch(); const originalPut = rootDb.put; @@ -127,9 +126,9 @@ export default class Database extends Emittery { * Note: only emits `close` once. */ public async close() { - const wasClosed = this.closed; - this.closed = true; - await this._cleanup(); + const wasClosed = this.#closed; + this.#closed = true; + await this.#cleanup(); // only emit `close` once if (!wasClosed) { @@ -141,7 +140,7 @@ export default class Database extends Emittery { /** * Cleans up the database connections and our tmp directory. */ - private async _cleanup(){ + #cleanup = async() => { const db = this.db; if (db) { await db.close(); @@ -153,6 +152,6 @@ export default class Database extends Emittery { ] ); } - return new Promise(resolve => this._cleanupDirectory(resolve)); + return new Promise(resolve => this.#cleanupDirectory(resolve)); } } diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 78a2a730e8..d4ffc86c1f 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -13,27 +13,29 @@ import {decode as rlpDecode} from "rlp"; const createKeccakHash = require("keccak"); // Read in the current ganache version from the package.json -const {name, version} = require("../../../package.json"); +import {name, version} from "../../../package.json"; //#endregion //#region Constants -const CLIENT_VERSION = `EthereumJS ${name}/v${version}/ethereum-js` -const PROTOCOL_VERSION = Data.from("0x3f"); const BUFFER_EMPTY = Buffer.allocUnsafe(0); const BUFFER_ZERO = Buffer.from([0]); +const CLIENT_VERSION = `EthereumJS ${name}/v${version}/ethereum-js` +const PROTOCOL_VERSION = Data.from("0x3f"); const RPCQUANTITY_ZERO = Quantity.from("0x0"); //#endregion +// We use symbols for private properties because BaseLedger +// only allows index types of index type '(...args: any) => Promise' +const _blockchain = Symbol("blockchain"); +const _isMining = Symbol("isMining"); const _options = Symbol("options"); const _wallet = Symbol("wallet"); -const _isMining = Symbol("isMining"); -const _blockchain = Symbol("blockchain"); export default class Ethereum extends BaseLedger { - private readonly [_wallet]: Wallet; - private readonly [_options]: EthereumOptions; private readonly [_blockchain]: Blockchain; private [_isMining] = false; + private readonly [_options]: EthereumOptions; + private readonly [_wallet]: Wallet; /** * This is the Ethereum ledger that the provider interacts with. diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index 9af9e3bd71..6d15bec2a4 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -34,29 +34,29 @@ function byPrice(values: Transaction[], a: number, b: number) { } export default class Miner extends Emittery { - private currentlyExecutingPrice = 0n; - private origins = new Set(); - private pending: Map>; - private _isMining: boolean = false; - private readonly options: MinerOptions; - private readonly vm: VM; - private readonly _checkpoint: () => Promise; - private readonly _commit: () => Promise; - private readonly _revert: () => Promise; + #currentlyExecutingPrice = 0n; + #origins = new Set(); + #pending: Map>; + #isMining: boolean = false; + readonly #options: MinerOptions; + readonly #vm: VM; + readonly #checkpoint: () => Promise; + readonly #commit: () => Promise; + readonly #revert: () => Promise; // initialize a Heap that sorts by gasPrice - private readonly priced = new Heap(byPrice); + readonly #priced = new Heap(byPrice); constructor(vm: VM, options: MinerOptions) { super(); - this.vm = vm; - this.options = options; + this.#vm = vm; + this.#options = options; const stateManager = vm.stateManager; - this._checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); - this._commit = promisify(stateManager.commit.bind(stateManager)); - this._revert = promisify(stateManager.revert.bind(stateManager)); + this.#checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); + this.#commit = promisify(stateManager.commit.bind(stateManager)); + this.#revert = promisify(stateManager.revert.bind(stateManager)); // init the heap with an empty array - this.priced.init([]); + this.#priced.init([]); } /** @@ -70,30 +70,30 @@ export default class Miner extends Emittery { */ public async mine(pending: Map>, block: Block) { // only allow mining a single block at a time (per miner) - if (this._isMining) { + if (this.#isMining) { // if we are currently mining a block, set the `pending` property // so the miner knows it should immediately mine another block once it is // done with its current work. - this.pending = pending; - this.updatePricedHeap(pending); + this.#pending = pending; + this.#updatePricedHeap(pending); return; } else { - this.setPricedHeap(pending); + this.#setPricedHeap(pending); } - this._isMining = true; + this.#isMining = true; const blockTransactions: Transaction[] = []; - let blockGasLeft = this.options.gasLimit.toBigInt(); + let blockGasLeft = this.#options.gasLimit.toBigInt(); let counter = 0; const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); const promises: Promise[] = []; - await this._checkpoint(); + await this.#checkpoint(); - const priced = this.priced; + const priced = this.#priced; const rejectedTransactions: Transaction[] = []; const blockData = { blockTransactions, @@ -124,18 +124,18 @@ export default class Miner extends Emittery { const origin = Data.from(best.from).toString(); const pendingFromOrigin = pending.get(origin); - this.currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); + this.#currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); const runArgs = { tx: best as any, block }; - await this._checkpoint(); + await this.#checkpoint(); let result: RunTxResult; try { - result = await this.vm.runTx(runArgs); + result = await this.#vm.runTx(runArgs); } catch(err) { - await this._revert(); + await this.#revert(); const errorMessage = err.message; if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { // a race condition between the pool and the miner could potentially @@ -156,7 +156,7 @@ export default class Miner extends Emittery { const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); if (blockGasLeft >= gasUsed) { - await this._commit(); + await this.#commit(); blockGasLeft -= gasUsed; blockData.gasUsed += gasUsed; @@ -188,7 +188,7 @@ export default class Miner extends Emittery { // update `priced` with the next best for this account: replaceFromHeap(priced, pendingFromOrigin, pending, origin); } else { - await this._revert(); + await this.#revert(); // didn't fit. remove it from the priced transactions without replacing // it with another from the account. This transaction will have to be @@ -198,7 +198,7 @@ export default class Miner extends Emittery { } } await Promise.all(promises); - await this._commit(); + await this.#commit(); // TODO: put the rejected transactions back in their original origin heaps rejectedTransactions.forEach(transaction => { @@ -209,9 +209,9 @@ export default class Miner extends Emittery { this.emit("block", blockData); // reset the miner (this sets _isMining back to false) - this.reset(); + this.#reset(); - if (this.pending) { + if (this.#pending) { // TODO: hm... tricky... we know we need to mine a new block // but at what timestamp. We need to get the timestamp from `blockchain`, but so far, // we don't require the miner to know about the blockchain. @@ -225,21 +225,21 @@ export default class Miner extends Emittery { difficulty: block.header.difficulty, gasLimit: block.header.gasLimit, } as any); - this.mine(this.pending, nextBlock); - this.pending = null; + this.mine(this.#pending, nextBlock); + this.#pending = null; } } - private reset(){ - this.origins.clear(); - this.priced.clear(); - this._isMining = false; - this.currentlyExecutingPrice = 0n; + #reset = () => { + this.#origins.clear(); + this.#priced.clear(); + this.#isMining = false; + this.#currentlyExecutingPrice = 0n; } - private setPricedHeap(pending: Map>) { - const origins = this.origins; - const priced = this.priced; + #setPricedHeap = (pending: Map>) => { + const origins = this.#origins; + const priced = this.#priced; for (let mapping of pending) { const heap = mapping[1]; @@ -252,9 +252,9 @@ export default class Miner extends Emittery { } } - private updatePricedHeap(pending: Map>) { - const origins = this.origins; - const priced = this.priced; + #updatePricedHeap = (pending: Map>) => { + const origins = this.#origins; + const priced = this.#priced; // Note: the `pending` Map passed here is "live", meaning it is constantly // being updated by the `transactionPool`. This allows us to begin // processing a block with the _current_ pending transactions, and while @@ -265,7 +265,7 @@ export default class Miner extends Emittery { const next = heap.peek(); if (next) { const price = Quantity.from(next.gasPrice).toBigInt(); - if (this.currentlyExecutingPrice < price) { + if (this.#currentlyExecutingPrice < price) { // don't insert a transaction into the miner's `priced` heap // if it will be better than its last continue; @@ -282,4 +282,4 @@ export default class Miner extends Emittery { } } } -} \ No newline at end of file +} diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 0e63751309..2a71ff06b2 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -1,6 +1,6 @@ import Options, {getDefault as getDefaultOptions} from "./options"; -const bip39 = require("bip39"); +import { entropyToMnemonic } from "bip39"; import seedrandom, { seedrandom_prng } from "seedrandom"; function randomBytes(length: number, rng: () => number) { @@ -49,12 +49,12 @@ export const getDefault : (options: ProviderOptions) => ProviderOptions = (optio rng = seedrandom.alea as seedrandom_prng; seed = _options.seed = randomAlphaNumericString(10, rng()); } else { - // Use the default seedrandom PRNG for ganache-core <= 2 back-compatibility + // Use the default seedrandom PRNG for ganache-core < 3.0 back-compatibility rng = seedrandom; } // generate a randomized default mnemonic const _randomBytes = randomBytes(16, rng(seed)); - _options.mnemonic = bip39.entropyToMnemonic(_randomBytes); + _options.mnemonic = entropyToMnemonic(_randomBytes); } return _options; } diff --git a/src/provider.ts b/src/provider.ts index 3a577f79b2..7c671f5e7a 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -4,41 +4,39 @@ import RequestProcessor from "./utils/request-processor"; import ProviderOptions, { getDefault as getDefaultProviderOptions } from "./options/provider-options"; import Emittery from "emittery"; import Ethereum from "./ledgers/ethereum/ledger" -import { privateToAddress } from "ethereumjs-util"; +import { publicToAddress, privateToAddress } from "ethereumjs-util"; import Account from "./types/account"; import { mnemonicToSeedSync } from "bip39"; import Address from "./types/address"; import JsonRpc from "./servers/utils/jsonrpc"; import EthereumOptions from "./ledgers/ethereum/options"; - -const hdkey = require("ethereumjs-wallet/hdkey"); +import cloneDeep from "lodash.clonedeep"; +import secp256k1 from "secp256k1"; +import HDKey from "hdkey"; const WEI = 1000000000000000000n; -const options = Symbol("options"); -const requestProcessor = Symbol("requestProcessor"); - interface Callback { (err?: Error, response?: JsonRpc.Response): void; } export default class Provider extends Emittery { - private [options]: ProviderOptions; - private _engine: Engine; - private [requestProcessor]: RequestProcessor; + #options: ProviderOptions; + #engine: Engine; + #requestProcessor: RequestProcessor; - private wallet:any; + #wallet: HDKey; constructor(providerOptions?: ProviderOptions) { super(); - const _providerOptions = this[options] = getDefaultProviderOptions(providerOptions); + const _providerOptions = this.#options = getDefaultProviderOptions(providerOptions); // set up our request processor to either use FIFO or or async request processing - const _requestProcessor = this[requestProcessor] = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 0 : 1); + const _requestProcessor = this.#requestProcessor = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 0 : 1); - this.wallet = hdkey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); + this.#wallet = HDKey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); - const accounts = this.initializeAccounts(); + const accounts = this.#initializeAccounts(); // ethereum options' `accounts` are different than the provider options' // `accounts`, fix that up here: const ethereumOptions = _providerOptions as any as EthereumOptions; @@ -46,49 +44,49 @@ export default class Provider extends Emittery { const emitter = this as any; const ledger = _providerOptions.ledger || new Ethereum(ethereumOptions, emitter); emitter.on("ready", _requestProcessor.resume.bind(_requestProcessor)); - this._engine = new Engine(ledger); + this.#engine = new Engine(ledger); } // TODO: this doesn't seem like a provider-level function. Maybe we should // move this into the Ledger or its Blockchain? - private initializeAccounts(): Account[]{ - const _providerOptions = this[options]; + #initializeAccounts = (): Account[] => { + const _providerOptions = this.#options; const etherInWei = Quantity.from(Quantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); let accounts: Account[]; let givenAccounts = _providerOptions.accounts; let accountsLength; if (givenAccounts && (accountsLength = givenAccounts.length) !== 0) { - const wallet = this.wallet; - const hdPath = this[options].hdPath; + const wallet = this.#wallet; + const hdPath = this.#options.hdPath; accounts = Array(accountsLength); for (let i = 0; i < accountsLength; i++) { const account = givenAccounts[i]; const secretKey = account.secretKey; - let secretKeyData; + let privateKey; let address: Address; if (!secretKey) { - const acct = wallet.derivePath(hdPath + i); - const accountWallet = acct.getWallet(); - address = Address.from(accountWallet.getAddress()); - secretKeyData = Data.from(accountWallet.getPrivateKey()); + const acct = wallet.derive(hdPath + i); + const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); + address = Address.from(publicToAddress(publicKey)); + privateKey = Data.from(acct.privateKey); } else { - secretKeyData = Data.from(secretKey); + privateKey = Data.from(secretKey); } - accounts[i] = Provider.createAccount(Quantity.from(account.balance), secretKeyData, address); + accounts[i] = Provider.createAccount(Quantity.from(account.balance), privateKey, address); } } else { const numerOfAccounts =_providerOptions.total_accounts; if (numerOfAccounts) { accounts = Array(numerOfAccounts); - const hdPath = this[options].hdPath; - const wallet = this.wallet; + const hdPath = this.#options.hdPath; + const wallet = this.#wallet; for (let index = 0; index < numerOfAccounts; index++) { - const acct = wallet.derivePath(hdPath + index); - const accountWallet = acct.getWallet(); - const address = Address.from(accountWallet.getAddress()); - const privateKey = Data.from(accountWallet.getPrivateKey()); + const acct = wallet.derive(hdPath + index); + const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); + const address = Address.from(publicToAddress(publicKey)); + const privateKey = Data.from(acct.privateKey); accounts[index] = Provider.createAccount(etherInWei, privateKey, address); } } else { @@ -99,7 +97,7 @@ export default class Provider extends Emittery { } // TODO: this should probable be moved as well (see `initializeAccounts` above) - private static createAccount(balance: Quantity, privateKey: Data, address?: Address) { + static createAccount(balance: Quantity, privateKey: Data, address?: Address) { address = address || Address.from(privateToAddress(privateKey.toBuffer())); const account = new Account(address); @@ -109,18 +107,22 @@ export default class Provider extends Emittery { return account; } + public getOptions(){ + return cloneDeep(this.#options); + } + public send(payload: JsonRpc.Request, callback?: Callback): void; public send(method: string, params?: any[]): Promise; public send(arg1: string | JsonRpc.Request, arg2?: Callback | any[]): Promise { let method: string; let params: any[]; let response: Promise<{}>; - const engine = this._engine; + const engine = this.#engine; const execute = engine.execute.bind(engine); if (typeof arg1 === "string") { method = arg1; params = arg2 as any[]; - response = this[requestProcessor].queue(execute, method, params).then((result => { + response = this.#requestProcessor.queue(execute, method, params).then((result => { // convert to JSON return JSON.parse(JSON.stringify(result)); })); @@ -131,7 +133,7 @@ export default class Provider extends Emittery { method = payload.method; params = payload.params; - this[requestProcessor].queue(execute, method, params).then((result) => { + this.#requestProcessor.queue(execute, method, params).then((result) => { callback(null, JsonRpc.Response( payload.id, JSON.parse(JSON.stringify(result)) @@ -145,7 +147,7 @@ export default class Provider extends Emittery { ); } - const _options = this[options]; + const _options = this.#options; if (_options.verbose) { _options.logger.log(` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); } @@ -167,7 +169,7 @@ export default class Provider extends Emittery { // to finish before returning // stop accepting new requests - this[requestProcessor].pause(); + this.#requestProcessor.pause(); await this.emit("close"); return; diff --git a/src/server.ts b/src/server.ts index a699e456b8..3c2bd7d400 100644 --- a/src/server.ts +++ b/src/server.ts @@ -5,12 +5,6 @@ import Provider from "./provider"; import WebsocketServer from "./servers/ws-server"; import HttpServer from "./servers/http-server"; -const options = Symbol("options"); -const listenSocket = Symbol("listenSocket"); -const app = Symbol("app"); -const websocketServer = Symbol("websocketServer"); -const httpServer = Symbol("httpServer"); - export enum Status { // Flags open = 1, @@ -20,24 +14,24 @@ export enum Status { } export default class Server { - private [app]: TemplatedApp; + #app: TemplatedApp; public provider: Provider; - private [options]: ServerOptions; - private [httpServer]: HttpServer; - private [listenSocket]: us_listen_socket; - private [websocketServer]: WebsocketServer; + #options: ServerOptions; + #httpServer: HttpServer; + #listenSocket: us_listen_socket; + #websocketServer: WebsocketServer; public status = Status.closed; constructor(serverOptions?: ServerOptions) { - const opts = this[options] = getDefaultServerOptions(serverOptions); + const opts = this.#options = getDefaultServerOptions(serverOptions); const prov = this.provider = new Provider(opts); - const _app = this[app] = uWS.App(); + const _app = this.#app = uWS.App(); - if (this[options].ws) { - this[websocketServer] = new WebsocketServer(_app, prov, opts); + if (this.#options.ws) { + this.#websocketServer = new WebsocketServer(_app, prov, opts); } - this[httpServer] = new HttpServer(_app, prov); + this.#httpServer = new HttpServer(_app, prov); } async listen(port: number, callback?: (err: Error) => void): Promise { @@ -51,12 +45,12 @@ export default class Server { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - this[app].listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); }); if (_listenSocket) { this.status = Status.open; - this[listenSocket] = _listenSocket; + this.#listenSocket = _listenSocket; err = null; } else { this.status = Status.closed; @@ -73,20 +67,20 @@ export default class Server { } public async close() { - const _listenSocket = this[listenSocket]; + const _listenSocket = this.#listenSocket; this.status = Status.closing; if (_listenSocket) { - this[listenSocket] = undefined; + this.#listenSocket = undefined; // close the socket to prevent any more connections uWS.us_listen_socket_close(_listenSocket); } // close all the currently connection websockets: - const ws = this[websocketServer] + const ws = this.#websocketServer; if (ws) { ws.close(); } // and do all http cleanup, if any - this[httpServer].close(); + this.#httpServer.close(); this.status = Status.closed; await this.provider.close(); } diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index d76f86851a..a102689f69 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -4,9 +4,6 @@ import Provider from "../provider"; import JsonRpc from "./utils/jsonrpc" import HttpResponseCodes from "./utils/http-response-codes"; -const _handlePost = Symbol("handlePost"); -const _handleOptions = Symbol("handleOptions"); -const _provider = Symbol("provider"); const noop = () => { }; /** @@ -77,14 +74,14 @@ function sendResponse(response: HttpResponse, statusCode: HttpResponseCodes, con } export default class HttpServer { - private [_provider]: Provider; + #provider: Provider; constructor(app: TemplatedApp, provider: Provider) { - this[_provider] = provider; + this.#provider = provider; // JSON-RPC routes... app - .post("/", this[_handlePost].bind(this)) - .options("/", this[_handleOptions].bind(this)); + .post("/", this.#handlePost) + .options("/", this.#handleOptions); // because Easter Eggs are fun... app.get("/418", (response) => { @@ -105,7 +102,7 @@ export default class HttpServer { }); } - private [_handlePost](response: HttpResponse, request: HttpRequest) { + #handlePost = (response: HttpResponse, request: HttpRequest) => { // handle JSONRPC post requests... const writeHeaders = prepareCORSResponseHeaders("POST", request); @@ -138,7 +135,7 @@ export default class HttpServer { default: // `await`ing the `provider.send` instead of using `then` causes uWS // to delay cleaning up the `request` object, which we don't neccessarily want to delay. - this[_provider].send(method, payload.params).then((result) => { + this.#provider.send(method, payload.params).then((result) => { if (response.aborted) { // if the request has been aborted don't try sending (it'll // cause an `Unhandled promise rejection` if we try) @@ -159,7 +156,7 @@ export default class HttpServer { }); } - private [_handleOptions](response: HttpResponse, request: HttpRequest) { + #handleOptions = (response: HttpResponse, request: HttpRequest) => { // handle CORS preflight requests... const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); // OPTIONS responses don't have a body, so respond with `204 No Content`... diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index cca83ded97..50cecf2468 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -1,53 +1,54 @@ import uWS, { TemplatedApp, WebSocket } from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; import Provider from "../provider"; - -const _connections = Symbol("connections"); +import JsonRpc from "./utils/jsonrpc"; export default class WebsocketServer { - private [_connections] = new Set(); - constructor(app: TemplatedApp, provider: Provider, options: any) { - app.ws("/", { - /* WS Options */ - compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression - maxPayloadLength: 16 * 1024, // 128 Kibibits - idleTimeout: 120, // in seconds + #connections = new Set(); + constructor(app: TemplatedApp, provider: Provider, options: any) { + app.ws("/", { + /* WS Options */ + compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression + maxPayloadLength: 16 * 1024, // 128 Kibibits + idleTimeout: 120, // in seconds - /* Handlers */ - open: (ws: any) => { - this[_connections].add(ws); - }, - message: async (ws: any, message: ArrayBuffer, isBinary: boolean) => { - let payload: any; - try { - payload = JSON.parse(Buffer.from(message) as any); - } catch (e) { - ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); - return; - } - const method = payload.method; - const result = await provider.send(method, payload.params); - // The socket may have closed while we were waiting for the response - // Don't bother trying to send to it now. - if (!ws.closed) { - const json = { - "id": payload.id, - "jsonrpc": "2.0", - "result": result - }; - ws.send(JSON.stringify(json), isBinary, true); - } - }, - drain: (ws: WebSocket) => { - options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); - }, - close: (ws: WebSocket) => { - this[_connections].delete(ws); - ws.closed = true; - } - }); - } - close() { - this[_connections].forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); - } + /* Handlers */ + open: (ws: any) => { + this.#connections.add(ws); + }, + message: async (ws: any, message: ArrayBuffer, isBinary: boolean) => { + let payload: JsonRpc.Request; + try { + payload = JSON.parse(Buffer.from(message) as any); + } catch (e) { + ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); + return; + } + const method = payload.method; + const result = await provider.send(method, payload.params); + // The socket may have closed while we were waiting for the response + // Don't bother trying to send to it now. + if (!ws.closed) { + const json = { + "id": payload.id, + "jsonrpc": "2.0", + "result": result + }; + ws.send(JSON.stringify(json), isBinary, true); + } + }, + drain: (ws: WebSocket) => { + // This is there so tests can detect if a small amount of backpressure is happening and that things will still + // work if it does. We actually don't do anything to manage excessive backpressure. + options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); + }, + close: (ws: WebSocket) => { + this.#connections.delete(ws); + ws.closed = true; + } + }); + } + close() { + this.#connections.forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); + } }; diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index 3b1469e452..4532e74986 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -25,12 +25,12 @@ export const bufCache = new WeakMap(); export const toStrings = new WeakMap(); export const toBuffers = new WeakMap(); -const inspect = Symbol.for('nodejs.util.inspect.custom'); +const inspect = Symbol.for("nodejs.util.inspect.custom"); export class BaseJsonRpcType { protected value: T; // used to make console.log debugging a little easier - private [inspect](depth: number, options: any):T { + private [inspect](_depth: number, _options: any):T { return this.value; } constructor(value: T) { diff --git a/src/types/transaction-receipt.ts b/src/types/transaction-receipt.ts index 34c7ef8682..e55562135d 100644 --- a/src/types/transaction-receipt.ts +++ b/src/types/transaction-receipt.ts @@ -4,29 +4,29 @@ import { encode as rlpEncode, decode as rlpDecode } from "rlp"; import { Data, Quantity } from "./json-rpc"; export default class TransactionReceipt { - private contractAddress: Buffer; - private raw: [Buffer, Buffer, Buffer, Buffer[]]; + #contractAddress: Buffer; + #raw: [Buffer, Buffer, Buffer, Buffer[]]; constructor(data?: Buffer) { if (data) { const decoded = rlpDecode(data) as any as [Buffer, Buffer, Buffer, Buffer[], Buffer]; - this.init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4]); + this.#init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4]); } } - private init(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer = null) { - this.raw = [status, gasUsed, logsBloom, logs]; - this.contractAddress = contractAddress; + #init = (status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer = null) => { + this.#raw = [status, gasUsed, logsBloom, logs]; + this.#contractAddress = contractAddress; } static fromValues(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer) { const receipt = new TransactionReceipt(); - receipt.init(status, gasUsed, logsBloom, logs, contractAddress); + receipt.#init(status, gasUsed, logsBloom, logs, contractAddress); return receipt; } - serialize(all: boolean) { - return all ? rlpEncode([...this.raw, this.contractAddress]) : rlpEncode(this.raw); + public serialize(all: boolean) { + return all ? rlpEncode([...this.#raw, this.#contractAddress]) : rlpEncode(this.#raw); } - toJSON(block: Block, transaction: Transaction) { - const raw = this.raw; + public toJSON(block: Block, transaction: Transaction) { + const raw = this.#raw; return { transactionHash: Data.from(transaction.hash()), transactionIndex: Quantity.from((transaction as any)._index), @@ -34,7 +34,7 @@ export default class TransactionReceipt { blockHash: Data.from(block.value.hash()), cumulativeGasUsed: Quantity.from(block.value.header.gasUsed), gasUsed: Quantity.from(raw[1]), - contractAddress: Data.from(this.contractAddress), + contractAddress: Data.from(this.#contractAddress), logs: raw[3], // TODO: figure this out logsBloom: Data.from(raw[2], 256), status: Quantity.from(raw[0]) diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 3d89ad3705..3b8cb5b07a 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -182,7 +182,7 @@ class Transaction extends (EthereumJsTransaction as any) { _chainId: any; _hash: Buffer; readonly from: Buffer; - private _receipt: any; + #receipt: any; /** * @param {Object} [data] The data for this Transaction. * @param {Number} type The `Transaction.types` bit flag for this transaction diff --git a/src/utils/request-processor.ts b/src/utils/request-processor.ts index 44eb643146..47b016520c 100644 --- a/src/utils/request-processor.ts +++ b/src/utils/request-processor.ts @@ -12,9 +12,9 @@ export default class RequestProcessor { * The number of tasks currently being processed. */ public runningTasks: number = 0; - private _paused: boolean = true; + #paused: boolean = true; public get paused(): boolean { - return this._paused; + return this.#paused; } /** @@ -24,7 +24,7 @@ export default class RequestProcessor { */ constructor(limit: number) { this.limit = limit; - this.process(); + this.#process(); } /** @@ -32,18 +32,18 @@ export default class RequestProcessor { * running. */ public pause() { - this._paused = true; + this.#paused = true; } /** * Resume processing. */ public resume() { - this._paused = false; - this.process(); + this.#paused = false; + this.#process(); } - private process() { + #process = () => { // if we aren't paused and the number of things we're processing is under // our limit and we have things to process: do it! while (!this.paused && this.pending.length > 0 && (!this.limit || this.runningTasks < this.limit)) { @@ -51,7 +51,7 @@ export default class RequestProcessor { this.runningTasks++; current().finally(() => { this.runningTasks--; - this.process(); + this.#process(); }); } } @@ -59,13 +59,13 @@ export default class RequestProcessor { /** * Insert a new function into the queue. */ - public queue = function(fn: (...args: any[]) => Promise<{}>, ...args: any[]): Promise<{}> { + public queue = (fn: (...args: any[]) => Promise<{}>, ...args: any[]): Promise<{}> => { const promise = new Promise((resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { const executor = () => { return fn.apply(null, args).then(resolve).catch(reject); } this.pending.push(executor); - this.process(); + this.#process(); }); return promise; } diff --git a/test/provider.ts b/test/provider.ts index 46f563666d..d55fafb762 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -125,11 +125,13 @@ describe("provider", () => { })); // duck punch a property that shouldn't appear on the ledger. we test this - // to make sure that 3rd party ledger imlementations can't shoot themselves + // to make sure that 3rd party ledger implementations can't shoot themselves // in the foot on accident - (p as any)._engine._ledger.__proto__.illegalProperty = true; - await assert.rejects(p.send("illegalProperty"), { - message: "Invalid or unsupported method: illegalProperty" + it.skip("TODO: allow 'injecting' our own engine or ledger into a provider!", async () => { + (p as any)._engine._ledger.__proto__.illegalProperty = true; + await assert.rejects(p.send("illegalProperty"), { + message: "Invalid or unsupported method: illegalProperty" + }); }); // make sure we reject non-strings over the classical send interface diff --git a/test/temp-tests.ts b/test/temp-tests.ts index da7f9538e4..0a33c6713c 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -56,7 +56,7 @@ describe("Accounts", () => { to: accounts[1], value: 1 }]); - // TODO: remove and replace with something that detects with the block is "mined" + // TODO: remove and replace with something that detects when the block is "mined" await new Promise((resolve) => setTimeout(resolve, 3000)); const balance1_2 = await p.send("eth_getBalance", [accounts[1]]); @@ -65,7 +65,7 @@ describe("Accounts", () => { it("should create its own mnemonic", async() => { const p = Ganache.provider(); - const options = (p as any)[Object.getOwnPropertySymbols(p)[0] as any]; + const options = p.getOptions(); assert.deepStrictEqual(typeof options.mnemonic, "string"); }); diff --git a/tsconfig.json b/tsconfig.json index e9ff5097c4..13fcb105b4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,13 +4,14 @@ "experimentalDecorators": true, "module": "commonjs", "esModuleInterop": true, - "target": "esnext", + "target": "ESNext", "noImplicitAny": true, "moduleResolution": "node", "sourceMap": true, "outDir": "dist", - "lib": ["esnext"], - "incremental": true + "lib": ["ESNext"], + "incremental": true, + "resolveJsonModule": true }, "include": [ "./index.ts", diff --git a/typings/hdkey.d.ts b/typings/hdkey.d.ts new file mode 100644 index 0000000000..9f59d895ab --- /dev/null +++ b/typings/hdkey.d.ts @@ -0,0 +1,31 @@ +declare module "hdkey" { + type HDKeyJSON = { + xpriv: string + xpub: string + }; + type HDKeyVersions = {private: number, public: number}; + export default class HDKey { + public versions: HDKeyVersions; + public depth: number; + public index: number; + readonly public parentFingerprint: number; + readonly public fingerprint: number; + readonly public identifier?: Uint8Array; + readonly public pubKeyHash?: Uint8Array; + readonly public privateKey?: Buffer; + public publicKey?: Uint8Array; + readonly public privateExtendedKey?: string; + readonly public publicExtendedKey: string; + readonly public chainCode?: Buffer; + public derive: (path: string) => HDKey; + public deriveChild: (index: number) => HDKey; + public sign: (hash: Buffer) => Buffer; + public verify: (hash: Buffer, signature: Buffer) => boolean; + public wipePrivateData: () => HDKey; + public toJSON: (path: string) => HDKeyJSON; + static public fromMasterSeed: (seedBuffer: Buffer, version?: HDKeyVersions) => HDKey; + static public fromExtendedKey: (base58key: string, version?: HDKeyVersions) => HDKey; + static public fromJSON: (obj: HDKeyJSON) => HDKey; + static public HARDENED_OFFSET: 0x80000000; + } +} \ No newline at end of file From dd86e3597515436fd8261ce68f2d06882d523c55 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 24 Apr 2020 16:49:26 -0400 Subject: [PATCH 141/691] Target ES2020 so private fields work on Node 10 --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 13fcb105b4..e929feb288 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "experimentalDecorators": true, "module": "commonjs", "esModuleInterop": true, - "target": "ESNext", + "target": "ES2020", "noImplicitAny": true, "moduleResolution": "node", "sourceMap": true, From a666e50d54e246eed76fe82ad041c2611a6cc2c7 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 24 Apr 2020 16:55:15 -0400 Subject: [PATCH 142/691] Remove JSBI helpers --- index.ts | 3 -- npm-shrinkwrap.json | 6 --- package.json | 1 - src/types/json-rpc/json-rpc-base-types.ts | 17 +------- src/types/json-rpc/json-rpc-quantity.ts | 3 +- src/utils/bigint-to-buffer.ts | 15 +++++++ src/utils/jsbi-helpers.ts | 50 ----------------------- 7 files changed, 19 insertions(+), 76 deletions(-) create mode 100644 src/utils/bigint-to-buffer.ts delete mode 100644 src/utils/jsbi-helpers.ts diff --git a/index.ts b/index.ts index 8e37c3ad52..df9f887b48 100644 --- a/index.ts +++ b/index.ts @@ -1,6 +1,3 @@ -import * as jsbiHelpers from "./src/utils/jsbi-helpers"; -jsbiHelpers.install(); - import Provider from "./src/provider"; import ProviderOptions from "./src/options/provider-options"; import ServerOptions from "./src/options/server-options"; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 28c3bc4221..8582782819 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2046,12 +2046,6 @@ "esprima": "^4.0.0" } }, - "jsbi": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jsbi/-/jsbi-3.1.2.tgz", - "integrity": "sha512-5nDXo1X9QVaXK/Cpb5VECV9ss1QPbjUuk1qSruHB1PK/g39Sd414K4nci99ElFDZv0vzxDEnKn3o49/Tn9Yagw==", - "dev": true - }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", diff --git a/package.json b/package.json index 510f931f54..4bee037b41 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "bufferutil": "4.0.1", "cross-env": "7.0.2", "into-stream": "5.1.1", - "jsbi": "3.1.2", "mocha": "7.1.1", "nyc": "15.0.1", "solc": "0.6.6", diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index 4532e74986..3888f8e5f5 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -1,17 +1,4 @@ -let intToBuffer: (val: bigint) => Buffer; -try { - const toBufferBE = require('bigint-buffer').toBufferBE; - intToBuffer = (val: bigint) => { - const buffer = toBufferBE(val, 128); - for (let i = 0; i < buffer.length - 1; i++) if (buffer[i]) return buffer.slice(i) - return buffer.slice(buffer.length - 1) - } -} catch(e) { - intToBuffer = (val: bigint): Buffer => { - const hex = val.toString(16); - return Buffer.from(hex.length % 2 ? hex : `0${hex}`); - } -} +import bigintToBuffer from "../../utils/bigint-to-buffer"; export type IndexableJsonRpcType = string & { new(value: T): IndexableJsonRpcType, @@ -54,7 +41,7 @@ export class BaseJsonRpcType (value as bigint).toString(16)); toBuffers.set(this, () => { - return intToBuffer(value as bigint); + return bigintToBuffer(value as bigint); //onst value = (2n**64n); var max = (2n**64n)-1n; diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index c782485783..c3bee029f1 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -1,5 +1,5 @@ import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; -const toBigIntBE = require('bigint-buffer').toBigIntBE; +const toBigIntBE = require("bigint-buffer").toBigIntBE; class Quantity extends BaseJsonRpcType { _nullable: boolean; @@ -55,6 +55,7 @@ class Quantity extends BaseJsonRpcType { } else if (length === 8) { view = new DataView(value.buffer, value.byteOffset, length); } else { + // TODO: toBigIntBE is a native lib with no pure JS fallback yet. return toBigIntBE(value); // TODO: handle bigint's stored as Buffers that are this big? // It's not too hard. diff --git a/src/utils/bigint-to-buffer.ts b/src/utils/bigint-to-buffer.ts new file mode 100644 index 0000000000..8f26a8f9a8 --- /dev/null +++ b/src/utils/bigint-to-buffer.ts @@ -0,0 +1,15 @@ +let intToBuffer: (val: bigint) => Buffer; +try { + const toBufferBE = require("bigint-buffer").toBufferBE; + intToBuffer = (val: bigint) => { + const buffer = toBufferBE(val, 128); + for (let i = 0; i < buffer.length - 1; i++) if (buffer[i]) return buffer.slice(i) + return buffer.slice(buffer.length - 1) + } +} catch(e) { + intToBuffer = (val: bigint): Buffer => { + const hex = val.toString(16); + return Buffer.from(hex.length % 2 ? hex : `0${hex}`); + } +} +export default intToBuffer; diff --git a/src/utils/jsbi-helpers.ts b/src/utils/jsbi-helpers.ts deleted file mode 100644 index 95279c8732..0000000000 --- a/src/utils/jsbi-helpers.ts +++ /dev/null @@ -1,50 +0,0 @@ -import JSBI from "jsbi"; - -declare global { - interface DataView { - setBigUint64(byteOffset: number, value: bigint | JSBI, littleEndian?: boolean): void; - getBigUint64(byteOffset: number, littleEndian?: boolean): bigint | JSBI; - } -} - -/** - * Installs support for bigint helpers on the DataView prototype, allowing for - * converting bigint's to a Buffer, and vis-versa. - */ -export const install = () => { - DataView.prototype._setBigUint64 = DataView.prototype.setBigUint64; - DataView.prototype.setBigUint64 = function(byteOffset: number, value: bigint | JSBI, littleEndian: boolean = undefined) { - if (typeof value === 'bigint' && typeof this._setBigUint64 !== 'undefined') { - // the original native implementation for bigint - this._setBigUint64(byteOffset, value, littleEndian); - } else if (value.constructor === JSBI && typeof (value as any).sign === 'bigint' && typeof this._setBigUint64 !== 'undefined') { - // JSBI wrapping a native bigint - this._setBigUint64(byteOffset, (value as any).sign, littleEndian); - } else if (value.constructor === JSBI) { - // JSBI polyfill implementation - let lowWord = (value as any)[0], highWord = 0; - if ((value as any).length >= 2) { - highWord = (value as any)[1]; - } - this.setUint32(littleEndian ? 0 : 4, lowWord, littleEndian); - this.setUint32(littleEndian ? 4 : 0, highWord, littleEndian); - } else { - throw TypeError('Value needs to be BigInt or JSBI'); - } - } - - DataView.prototype._getBigUint64 = DataView.prototype.getBigUint64; - DataView.prototype.getBigUint64 = function(byteOffset: number, littleEndian: boolean = undefined) { - if (typeof this._setBigUint64 !== 'undefined') { - return BigInt(this._getBigUint64(byteOffset, littleEndian)); - } else { - let lowWord = 0, highWord = 0; - lowWord = this.getUint32(littleEndian ? 0 : 4, littleEndian); - highWord = this.getUint32(littleEndian ? 4 : 0, littleEndian); - const result = JSBI.BigInt(2); - (result as any).__setDigit(0, lowWord); - (result as any).__setDigit(1, highWord); - return result; - } - } -}; From a5390e55f10927bb0f46b3db38d1dd456a371d21 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Apr 2020 14:08:04 -0400 Subject: [PATCH 143/691] Refactor to make multi-chain integration easier --- index.ts | 4 +- package.json | 3 +- src/interfaces/IProvider.ts | 12 ++ src/ledgers/ethereum/index.ts | 175 ++++++++++++++++ src/ledgers/ethereum/ledger.ts | 2 +- src/options/provider-options.ts | 2 +- src/provider.ts | 191 +++--------------- src/server.ts | 9 +- src/servers/http-server.ts | 17 +- src/servers/utils/jsonrpc.ts | 12 +- src/servers/ws-server.ts | 11 +- src/{engine.ts => utils/executor.ts} | 14 +- ...st-processor.ts => request-coordinator.ts} | 9 +- test/interface.ts | 4 +- test/ledger.ts | 62 +++--- test/provider.ts | 18 +- test/server.ts | 12 +- tsconfig.json | 2 +- typings/emittery.d.ts | 41 ++++ ...{uWebsockets.js.ts => uWebsockets.js.d.ts} | 0 20 files changed, 349 insertions(+), 251 deletions(-) create mode 100644 src/interfaces/IProvider.ts create mode 100644 src/ledgers/ethereum/index.ts rename src/{engine.ts => utils/executor.ts} (71%) rename src/utils/{request-processor.ts => request-coordinator.ts} (90%) create mode 100644 typings/emittery.d.ts rename typings/{uWebsockets.js.ts => uWebsockets.js.d.ts} (100%) diff --git a/index.ts b/index.ts index df9f887b48..03f6f3d217 100644 --- a/index.ts +++ b/index.ts @@ -6,7 +6,5 @@ import Server from "./src/server"; // `server` and `provider` are here for backwards compatability export default { server: (options?: ServerOptions) => new Server(options), - provider: (options?: ProviderOptions) => new Provider(options), - Server, - Provider + provider: (options?: ProviderOptions) => Provider.initialize(options), }; diff --git a/package.json b/package.json index 4bee037b41..4b1a0147a9 100644 --- a/package.json +++ b/package.json @@ -76,5 +76,6 @@ "type": "git", "url": "https://github.com/trufflesuite/ganache-core" }, - "license": "MIT" + "license": "MIT", + "author": "David Murdoch" } diff --git a/src/interfaces/IProvider.ts b/src/interfaces/IProvider.ts new file mode 100644 index 0000000000..fd23cde797 --- /dev/null +++ b/src/interfaces/IProvider.ts @@ -0,0 +1,12 @@ +import Emittery from "emittery"; +import { ILedger } from "./base-ledger"; +import ProviderOptions from "../options/provider-options"; + +type KnownKeys = { + [K in keyof T]: string extends K ? never : number extends K ? never : K +} extends { [_ in keyof T]: infer U } ? U : never; + +export interface IProvider { + request: (method: KnownKeys, params?: any[]) => Promise; + close: () => Promise; +} \ No newline at end of file diff --git a/src/ledgers/ethereum/index.ts b/src/ledgers/ethereum/index.ts new file mode 100644 index 0000000000..6ad1b5cd8f --- /dev/null +++ b/src/ledgers/ethereum/index.ts @@ -0,0 +1,175 @@ +import { Quantity, Data } from "../../types/json-rpc"; +import ProviderOptions, { getDefault as getDefaultProviderOptions } from "../../options/provider-options"; +import Emittery from "emittery"; +import Ledger from "../../ledgers/ethereum/ledger" +import { publicToAddress, privateToAddress } from "ethereumjs-util"; +import Account from "../../types/account"; +import { mnemonicToSeedSync } from "bip39"; +import Address from "../../types/address"; +import JsonRpc from "../../servers/utils/jsonrpc"; +import EthereumOptions from "../../ledgers/ethereum/options"; +import cloneDeep from "lodash.clonedeep"; +import secp256k1 from "secp256k1"; +import HDKey from "hdkey"; +import { ILedger } from "../../interfaces/base-ledger"; +import { IProvider } from "../../interfaces/IProvider"; + +const WEI = 1000000000000000000n; + +interface Callback { + (err?: Error, response?: JsonRpc.Response): void; +} + +type KnownKeys = { + [K in keyof T]: string extends K ? never : number extends K ? never : K +} extends { [_ in keyof T]: infer U } ? U : never; + +type RequestType = (eventDetails: {ledger: T, method: KnownKeys, params?: Parameters}) => ReturnType; + +export default class Provider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements IProvider { + #options: ProviderOptions; + #ledger: Ledger; + #wallet: HDKey; + + constructor(providerOptions?: ProviderOptions) { + super(); + const _providerOptions = this.#options = getDefaultProviderOptions(providerOptions); + + this.#wallet = HDKey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); + + const accounts = this.#initializeAccounts(); + // ethereum options' `accounts` are different than the provider options' + // `accounts`, fix that up here: + const ethereumOptions = _providerOptions as any as EthereumOptions; + ethereumOptions.accounts = accounts; + const emitter = this as any; + this.#ledger = new Ledger(ethereumOptions, emitter); + } + + // TODO: this doesn't seem like a provider-level function. Maybe we should + // move this into the Ledger or its Blockchain? + #initializeAccounts = (): Account[] => { + const _providerOptions = this.#options; + const etherInWei = Quantity.from(Quantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); + let accounts: Account[]; + + let givenAccounts = _providerOptions.accounts; + let accountsLength; + if (givenAccounts && (accountsLength = givenAccounts.length) !== 0) { + const wallet = this.#wallet; + const hdPath = this.#options.hdPath; + accounts = Array(accountsLength); + for (let i = 0; i < accountsLength; i++) { + const account = givenAccounts[i]; + const secretKey = account.secretKey; + let privateKey; + let address: Address; + if (!secretKey) { + const acct = wallet.derive(hdPath + i); + const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); + address = Address.from(publicToAddress(publicKey)); + privateKey = Data.from(acct.privateKey); + } else { + privateKey = Data.from(secretKey); + } + accounts[i] = Provider.createAccount(Quantity.from(account.balance), privateKey, address); + } + } else { + const numerOfAccounts =_providerOptions.total_accounts; + if (numerOfAccounts) { + accounts = Array(numerOfAccounts); + const hdPath = this.#options.hdPath; + const wallet = this.#wallet; + + for (let index = 0; index < numerOfAccounts; index++) { + const acct = wallet.derive(hdPath + index); + const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); + const address = Address.from(publicToAddress(publicKey)); + const privateKey = Data.from(acct.privateKey); + accounts[index] = Provider.createAccount(etherInWei, privateKey, address); + } + } else { + throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); + } + } + return accounts; + } + + // TODO: this should probable be moved as well (see `initializeAccounts` above) + static createAccount(balance: Quantity, privateKey: Data, address?: Address) { + address = address || Address.from(privateToAddress(privateKey.toBuffer())); + + const account = new Account(address); + account.privateKey = privateKey; + account.balance = balance; + + return account; + } + + public getOptions(){ + return cloneDeep(this.#options); + } + + public send(payload: JsonRpc.Request, callback?: Callback): void; + public send(method: KnownKeys, params?: any[]): Promise; + public send(arg1: KnownKeys | JsonRpc.Request, arg2?: Callback | any[]): Promise { + let method: KnownKeys; + let params: any[]; + let response: Promise<{}>; + if (typeof arg1 === "string") { + method = arg1; + params = arg2 as any[]; + response = this.request(method, params); + } else if (typeof arg2 === "function") { + // handle backward compatibility with callback-style ganache-core + const payload = arg1; + const callback = arg2 as Callback; + method = payload.method as KnownKeys; + params = payload.params; + + this + .emit("request", {ledger: this.#ledger, method, params}) + .then(([result]) => void process.nextTick(callback, null, JsonRpc.Response( + payload.id, + JSON.parse(JSON.stringify(result)) + )) + ) + .catch((err) => void process.nextTick(callback, err)); + } + else { + throw new Error( + "No callback provided to provider's send function. As of web3 1.0, provider.send " + + "is no longer synchronous and must be passed a callback as its final argument." + ); + } + + const _options = this.#options; + if (_options.verbose) { + _options.logger.log(` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); + } + + return response; + } + + /** + * Legacy callback style API + * @param payload JSON-RPC payload + * @param callback callback + */ + public sendAsync(payload: JsonRpc.Request, callback?: Callback): void { + return this.send(payload, callback); + } + + public request(method: KnownKeys, params?: any[]): Promise { + return this.emit("request", {ledger: this.#ledger, method, params}).then(([result]) => { + // we convert to a string and then back to JSON to create a quick deep + // copy or the result values. + return JSON.parse(JSON.stringify(result)); + }); + } + + public close = async () => { + await this.emit("close"); + return; + } +} diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index d4ffc86c1f..77ecbf0954 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -31,7 +31,7 @@ const _isMining = Symbol("isMining"); const _options = Symbol("options"); const _wallet = Symbol("wallet"); -export default class Ethereum extends BaseLedger { +export default class Ledger extends BaseLedger { private readonly [_blockchain]: Blockchain; private [_isMining] = false; private readonly [_options]: EthereumOptions; diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 2a71ff06b2..332f6cad6a 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -28,7 +28,7 @@ export default interface ProviderOptions extends Options { /** * Array of strings to installed subproviders */ - subProviders?: any[] + subProviders?: any[], } export const getDefault : (options: ProviderOptions) => ProviderOptions = (options) => { diff --git a/src/provider.ts b/src/provider.ts index 7c671f5e7a..96e94eb460 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,177 +1,36 @@ -import { Quantity, Data } from "./types/json-rpc"; -import Engine from "./engine"; -import RequestProcessor from "./utils/request-processor"; +import Executor from "./utils/executor"; +import RequestCoordinator from "./utils/request-coordinator"; import ProviderOptions, { getDefault as getDefaultProviderOptions } from "./options/provider-options"; import Emittery from "emittery"; -import Ethereum from "./ledgers/ethereum/ledger" -import { publicToAddress, privateToAddress } from "ethereumjs-util"; -import Account from "./types/account"; -import { mnemonicToSeedSync } from "bip39"; -import Address from "./types/address"; +import Ethereum from "./ledgers/ethereum"; import JsonRpc from "./servers/utils/jsonrpc"; -import EthereumOptions from "./ledgers/ethereum/options"; -import cloneDeep from "lodash.clonedeep"; -import secp256k1 from "secp256k1"; -import HDKey from "hdkey"; - -const WEI = 1000000000000000000n; interface Callback { (err?: Error, response?: JsonRpc.Response): void; } - export default class Provider extends Emittery { - #options: ProviderOptions; - #engine: Engine; - #requestProcessor: RequestProcessor; - - #wallet: HDKey; - constructor(providerOptions?: ProviderOptions) { - super(); - const _providerOptions = this.#options = getDefaultProviderOptions(providerOptions); - - // set up our request processor to either use FIFO or or async request processing - const _requestProcessor = this.#requestProcessor = new RequestProcessor(_providerOptions.asyncRequestProcessing ? 0 : 1); - - this.#wallet = HDKey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); - - const accounts = this.#initializeAccounts(); - // ethereum options' `accounts` are different than the provider options' - // `accounts`, fix that up here: - const ethereumOptions = _providerOptions as any as EthereumOptions; - ethereumOptions.accounts = accounts; - const emitter = this as any; - const ledger = _providerOptions.ledger || new Ethereum(ethereumOptions, emitter); - emitter.on("ready", _requestProcessor.resume.bind(_requestProcessor)); - this.#engine = new Engine(ledger); - } - - // TODO: this doesn't seem like a provider-level function. Maybe we should - // move this into the Ledger or its Blockchain? - #initializeAccounts = (): Account[] => { - const _providerOptions = this.#options; - const etherInWei = Quantity.from(Quantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); - let accounts: Account[]; - - let givenAccounts = _providerOptions.accounts; - let accountsLength; - if (givenAccounts && (accountsLength = givenAccounts.length) !== 0) { - const wallet = this.#wallet; - const hdPath = this.#options.hdPath; - accounts = Array(accountsLength); - for (let i = 0; i < accountsLength; i++) { - const account = givenAccounts[i]; - const secretKey = account.secretKey; - let privateKey; - let address: Address; - if (!secretKey) { - const acct = wallet.derive(hdPath + i); - const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); - address = Address.from(publicToAddress(publicKey)); - privateKey = Data.from(acct.privateKey); - } else { - privateKey = Data.from(secretKey); - } - accounts[i] = Provider.createAccount(Quantity.from(account.balance), privateKey, address); - } - } else { - const numerOfAccounts =_providerOptions.total_accounts; - if (numerOfAccounts) { - accounts = Array(numerOfAccounts); - const hdPath = this.#options.hdPath; - const wallet = this.#wallet; - - for (let index = 0; index < numerOfAccounts; index++) { - const acct = wallet.derive(hdPath + index); - const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); - const address = Address.from(publicToAddress(publicKey)); - const privateKey = Data.from(acct.privateKey); - accounts[index] = Provider.createAccount(etherInWei, privateKey, address); - } - } else { - throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); - } - } - return accounts; - } - - // TODO: this should probable be moved as well (see `initializeAccounts` above) - static createAccount(balance: Quantity, privateKey: Data, address?: Address) { - address = address || Address.from(privateToAddress(privateKey.toBuffer())); - - const account = new Account(address); - account.privateKey = privateKey; - account.balance = balance; - - return account; - } - - public getOptions(){ - return cloneDeep(this.#options); - } - - public send(payload: JsonRpc.Request, callback?: Callback): void; - public send(method: string, params?: any[]): Promise; - public send(arg1: string | JsonRpc.Request, arg2?: Callback | any[]): Promise { - let method: string; - let params: any[]; - let response: Promise<{}>; - const engine = this.#engine; - const execute = engine.execute.bind(engine); - if (typeof arg1 === "string") { - method = arg1; - params = arg2 as any[]; - response = this.#requestProcessor.queue(execute, method, params).then((result => { - // convert to JSON - return JSON.parse(JSON.stringify(result)); - })); - } else if (typeof arg2 === "function") { - // handle backward compatibility with callback-style ganache-core - const payload = arg1 as JsonRpc.Request; - const callback = arg2 as Callback; - method = payload.method; - params = payload.params; - - this.#requestProcessor.queue(execute, method, params).then((result) => { - callback(null, JsonRpc.Response( - payload.id, - JSON.parse(JSON.stringify(result)) - )); - }).catch(callback); - } - else { - throw new Error( - "No callback provided to provider's send function. As of web3 1.0, provider.send " + - "is no longer synchronous and must be passed a callback as its final argument." - ); - } - - const _options = this.#options; - if (_options.verbose) { - _options.logger.log(` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); - } - - return response; - } - - /** - * Legacy callback style API - * @param payload JSON-RPC payload - * @param callback callback - */ - public sendAsync(payload: JsonRpc.Request, callback?: Callback): void { - return this.send(payload, callback); - } - - public async close() { - // wait for anything that subscribed to this close event (like the ledger) - // to finish before returning - - // stop accepting new requests - this.#requestProcessor.pause(); - - await this.emit("close"); - return; + public static initialize(providerOptions: ProviderOptions = {asyncRequestProcessing: true}) { + const provider = new Ethereum(providerOptions); + + // Set up our request coordinator to either use FIFO or or async request processing. + // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it + // for that (yet), instead of "all" (0) or just 1 as we are doing here: + const requestCoordinator = new RequestCoordinator(providerOptions.asyncRequestProcessing ? 0 : 1); + + // The Executor is responsible for actually executing the method on the chain/ledger. + // It performs some safety checks to ensure "safe" method execution. + const executor = new Executor(); + + // The request coordinator is initialized in a "paused" state, when the provider is ready we unpause + // this lets us accept queue requests before we've even fully initialized. + provider.on("ready", requestCoordinator.resume); + + // A provider should _not_ execute it's own methods, but should delegate that responsiblity here. + provider.on("request", ({ledger, method, params}) => { + return requestCoordinator.queue(executor.execute, ledger, method, params); + }); + + return provider; } } diff --git a/src/server.ts b/src/server.ts index 3c2bd7d400..13914b105f 100644 --- a/src/server.ts +++ b/src/server.ts @@ -4,6 +4,8 @@ import uWS, { TemplatedApp, us_listen_socket } from "uWebSockets.js"; import Provider from "./provider"; import WebsocketServer from "./servers/ws-server"; import HttpServer from "./servers/http-server"; +import { ILedger } from "./interfaces/base-ledger"; +import Ethereum from "./ledgers/ethereum"; export enum Status { // Flags @@ -15,16 +17,17 @@ export enum Status { export default class Server { #app: TemplatedApp; - public provider: Provider; + // TODO: make this a generic IProvider + public provider: Ethereum; #options: ServerOptions; #httpServer: HttpServer; #listenSocket: us_listen_socket; - #websocketServer: WebsocketServer; + #websocketServer: WebsocketServer; public status = Status.closed; constructor(serverOptions?: ServerOptions) { const opts = this.#options = getDefaultServerOptions(serverOptions); - const prov = this.provider = new Provider(opts); + const prov = this.provider = Provider.initialize(opts); const _app = this.#app = uWS.App(); diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index a102689f69..9b743f89c8 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -3,6 +3,8 @@ import ContentTypes from "./utils/content-types"; import Provider from "../provider"; import JsonRpc from "./utils/jsonrpc" import HttpResponseCodes from "./utils/http-response-codes"; +import { IProvider } from "../interfaces/IProvider"; +import { ILedger } from "../interfaces/base-ledger"; const noop = () => { }; @@ -74,8 +76,8 @@ function sendResponse(response: HttpResponse, statusCode: HttpResponseCodes, con } export default class HttpServer { - #provider: Provider; - constructor(app: TemplatedApp, provider: Provider) { + #provider: IProvider; + constructor(app: TemplatedApp, provider: IProvider) { this.#provider = provider; // JSON-RPC routes... @@ -106,15 +108,16 @@ export default class HttpServer { // handle JSONRPC post requests... const writeHeaders = prepareCORSResponseHeaders("POST", request); - // TODO: pre-allocate the buffer when we know the Content-Length + // TODO: pre-allocate the buffer if we know the Content-Length let buffer: Buffer; + let aborted = false; response.onAborted(() => { - response.aborted = true; + aborted = true; }); response.onData((message: ArrayBuffer, isLast: boolean) => { const chunk = Buffer.from(message); if (isLast) { - let payload: JsonRpc.Request; + let payload: JsonRpc.Request; try { const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; payload = JsonRpc.Request(JSON.parse(message)); @@ -135,8 +138,8 @@ export default class HttpServer { default: // `await`ing the `provider.send` instead of using `then` causes uWS // to delay cleaning up the `request` object, which we don't neccessarily want to delay. - this.#provider.send(method, payload.params).then((result) => { - if (response.aborted) { + this.#provider.request(method, payload.params).then((result) => { + if (aborted) { // if the request has been aborted don't try sending (it'll // cause an `Unhandled promise rejection` if we try) return; diff --git a/src/servers/utils/jsonrpc.ts b/src/servers/utils/jsonrpc.ts index 6bcbf2b9e8..16513a6351 100644 --- a/src/servers/utils/jsonrpc.ts +++ b/src/servers/utils/jsonrpc.ts @@ -1,3 +1,9 @@ +import { ILedger } from "../../interfaces/base-ledger"; + +type KnownKeys = { + [K in keyof T]: string extends K ? never : number extends K ? never : K + } extends { [_ in keyof T]: infer U } ? U : never; + namespace JsonRpc { const jsonrpc = "2.0"; type JsonRpc = { @@ -5,10 +11,10 @@ namespace JsonRpc { jsonrpc: string, toString(): string } - export type Request = JsonRpc & { + export type Request = JsonRpc & { id: string, jsonrpc: string, - method: string, + method: KnownKeys, params?: any[] }; export type Response = JsonRpc & { @@ -20,7 +26,7 @@ namespace JsonRpc { message: any } }; - export const Request = (json: any): Request => { + export const Request = (json: any): Request => { return { id: json.id, jsonrpc, diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index 50cecf2468..37c07b4b4e 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -1,11 +1,12 @@ import uWS, { TemplatedApp, WebSocket } from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; -import Provider from "../provider"; import JsonRpc from "./utils/jsonrpc"; +import { IProvider } from "../interfaces/IProvider"; +import { ILedger } from "../interfaces/base-ledger"; -export default class WebsocketServer { +export default class WebsocketServer { #connections = new Set(); - constructor(app: TemplatedApp, provider: Provider, options: any) { + constructor(app: TemplatedApp, provider: IProvider, options: any) { app.ws("/", { /* WS Options */ compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression @@ -17,7 +18,7 @@ export default class WebsocketServer { this.#connections.add(ws); }, message: async (ws: any, message: ArrayBuffer, isBinary: boolean) => { - let payload: JsonRpc.Request; + let payload: JsonRpc.Request; try { payload = JSON.parse(Buffer.from(message) as any); } catch (e) { @@ -25,7 +26,7 @@ export default class WebsocketServer { return; } const method = payload.method; - const result = await provider.send(method, payload.params); + const result = await provider.request(method, payload.params); // The socket may have closed while we were waiting for the response // Don't bother trying to send to it now. if (!ws.closed) { diff --git a/src/engine.ts b/src/utils/executor.ts similarity index 71% rename from src/engine.ts rename to src/utils/executor.ts index 6dba0ba89b..46a2e790e6 100644 --- a/src/engine.ts +++ b/src/utils/executor.ts @@ -1,16 +1,13 @@ -import {ILedger} from "./interfaces/base-ledger"; +import {ILedger} from "../interfaces/base-ledger"; import Emittery from "emittery"; -export default class Engine extends Emittery { - readonly #ledger: ILedger; +export default class Executor extends Emittery { /** - * The Engine handles execution of methods on the given Ledger - * @param ledger + * The Executor handles execution of methods on the given Ledger */ - constructor(ledger: ILedger) { + constructor() { super(); - this.#ledger = ledger; } /** @@ -18,11 +15,10 @@ export default class Engine extends Emittery { * @param methodName The name of the JSON-RPC method to execute. * @param params The params to pass to the JSON-RPC method. */ - public async execute(methodName: string, params: any[]): Promise { + public execute = async (ledger: T, methodName: M, params: Parameters): Promise> => { // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { - const ledger = this.#ledger; // Only allow executing our *own* methods: if (methodName !== "constructor" && ledger.__proto__.hasOwnProperty(methodName)) { const fn = ledger[methodName]; diff --git a/src/utils/request-processor.ts b/src/utils/request-coordinator.ts similarity index 90% rename from src/utils/request-processor.ts rename to src/utils/request-coordinator.ts index 47b016520c..32068e8e89 100644 --- a/src/utils/request-processor.ts +++ b/src/utils/request-coordinator.ts @@ -1,4 +1,4 @@ -export default class RequestProcessor { +export default class RequestCoordinator { /** * The number of concurrent requests. Set to null for no limit. */ @@ -8,6 +8,7 @@ export default class RequestProcessor { * The pending requests. You can't do anything with this array. */ public readonly pending: any[] = []; + /** * The number of tasks currently being processed. */ @@ -31,14 +32,14 @@ export default class RequestProcessor { * Pause processing. This will *not* cancel any promises that are currently * running. */ - public pause() { + public pause = () => { this.#paused = true; } /** * Resume processing. */ - public resume() { + public resume = () => { this.#paused = false; this.#process(); } @@ -59,7 +60,7 @@ export default class RequestProcessor { /** * Insert a new function into the queue. */ - public queue = (fn: (...args: any[]) => Promise<{}>, ...args: any[]): Promise<{}> => { + public queue = (fn: (...args: any[]) => Promise, ...args: any[]): Promise => { const promise = new Promise((resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { const executor = () => { return fn.apply(null, args).then(resolve).catch(reject); diff --git a/test/interface.ts b/test/interface.ts index ab6703f723..6826ba02b5 100644 --- a/test/interface.ts +++ b/test/interface.ts @@ -5,7 +5,7 @@ describe("interface", () => { it("has an interface", ()=>{ assert.ok(Ganache.server); assert.ok(Ganache.provider); - assert.ok(Ganache.Server); - assert.ok(Ganache.Provider); + assert.strictEqual("Server" in Ganache, false); + assert.strictEqual("Provider" in Ganache, false); }) }); diff --git a/test/ledger.ts b/test/ledger.ts index 180d732a16..931ed47c7c 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -1,74 +1,76 @@ import assert from "assert"; import GetProvider, { Provider } from "./helpers/getProvider"; import sleep from "./helpers/sleep"; +import { IProvider } from "../src/interfaces/IProvider"; +import { ILedger } from "../src/interfaces/base-ledger"; describe("ledger", () => { - let provider: Provider; + let provider: any; let accounts: string[]; beforeEach(async () => { provider = GetProvider(); - accounts = await provider.send("eth_accounts"); + accounts = await provider.request("eth_accounts"); }); it("eth_blockNumber", async () => { - const blockNumber = parseInt(await provider.send("eth_blockNumber"), 10); - await provider.send("eth_sendTransaction", [{ + const blockNumber = parseInt(await provider.request("eth_blockNumber"), 10); + await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 }]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const nextBlockNumber = await provider.send("eth_blockNumber"); + const nextBlockNumber = await provider.request("eth_blockNumber"); assert.equal(blockNumber, nextBlockNumber - 1); }); it("eth_getBlockByNumber", async() => { - await provider.send("eth_sendTransaction", [{ + await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 }]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const blocks = await Promise.all([provider.send("eth_getBlockByNumber", ["0x1", true]), provider.send("eth_getBlockByNumber", ["0x1"])]); + const blocks = await Promise.all([provider.request("eth_getBlockByNumber", ["0x1", true]), provider.request("eth_getBlockByNumber", ["0x1"])]); assert(blocks[0].hash, blocks[1].hash); }); it("eth_getBlockByHash", async() => { - await provider.send("eth_sendTransaction", [{ + await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 }]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const block = await provider.send("eth_getBlockByNumber", ["0x1"]); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - const blocks = await Promise.all([provider.send("eth_getBlockByHash", [block.hash, true]), provider.send("eth_getBlockByHash", [block.hash])]); + const blocks = await Promise.all([provider.request("eth_getBlockByHash", [block.hash, true]), provider.request("eth_getBlockByHash", [block.hash])]); assert(blocks[0].hash, blocks[1].hash); - const counts = await Promise.all([provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]), provider.send("eth_getBlockTransactionCountByHash", [blocks[0].hash])]); + const counts = await Promise.all([provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]), provider.request("eth_getBlockTransactionCountByHash", [blocks[0].hash])]); assert(true); }); it("eth_getBlockTransactionCountByHash", async() => { - await provider.send("eth_sendTransaction", [{ + await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 }]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const block = await provider.send("eth_getBlockByNumber", ["0x1"]); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - const count = await provider.send("eth_getBlockTransactionCountByHash", [block.hash]); + const count = await provider.request("eth_getBlockTransactionCountByHash", [block.hash]); assert(count, "1"); }); it("eth_getBlockTransactionCountByNumber", async() => { - await provider.send("eth_sendTransaction", [{ + await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 @@ -76,12 +78,12 @@ describe("ledger", () => { // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const count = await provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]); + const count = await provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]); assert(count, "1"); }); it("eth_getTransactionByBlockNumberAndIndex", async() => { - await provider.send("eth_sendTransaction", [{ + await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 @@ -89,40 +91,40 @@ describe("ledger", () => { // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const tx = await provider.send("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); + const tx = await provider.request("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); assert.equal(tx.hash, "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", "Unexpected transaction hash."); }); it("eth_getTransactionByBlockHashAndIndex", async() => { - await provider.send("eth_sendTransaction", [{ + await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 }]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const block = await provider.send("eth_getBlockByNumber", ["0x1"]); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - const tx = await provider.send("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); + const tx = await provider.request("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); assert.equal(tx.hash, "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", "Unexpected transaction hash."); }); it("eth_getUncleCountByBlockHash", async() => { - await provider.send("eth_sendTransaction", [{ + await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 }]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const block = await provider.send("eth_getBlockByNumber", ["0x1"]); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - const count = await provider.send("eth_getUncleCountByBlockHash", [block.hash]); + const count = await provider.request("eth_getUncleCountByBlockHash", [block.hash]); assert(count, "0"); }); it("eth_getUncleCountByBlockNumber", async() => { - await provider.send("eth_sendTransaction", [{ + await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 @@ -130,12 +132,12 @@ describe("ledger", () => { // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const count = await provider.send("eth_getUncleCountByBlockNumber", ["0x1"]); + const count = await provider.request("eth_getUncleCountByBlockNumber", ["0x1"]); assert(count, "0"); }); it("eth_getTransactionReceipt", async() => { - const hash = await provider.send("eth_sendTransaction", [{ + const hash = await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 @@ -143,12 +145,12 @@ describe("ledger", () => { // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const receipt = await provider.send("eth_getTransactionReceipt", [hash]); + const receipt = await provider.request("eth_getTransactionReceipt", [hash]); assert(receipt.transactionIndex, "0x0"); }); it("eth_getTransactionByHash", async() => { - const hash = await provider.send("eth_sendTransaction", [{ + const hash = await provider.request("eth_sendTransaction", [{ from: accounts[0], to: accounts[1], value: 1 @@ -156,7 +158,7 @@ describe("ledger", () => { // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const tx = await provider.send("eth_getTransactionByHash", [hash]); + const tx = await provider.request("eth_getTransactionByHash", [hash]); assert(tx.transactionIndex, "0x0"); }); }) diff --git a/test/provider.ts b/test/provider.ts index d55fafb762..18b278ae8f 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -1,6 +1,6 @@ import Ganache from "../index" import assert from "assert"; -import Provider from "../src/provider"; +import Provider from "../src/ledgers/ethereum"; describe("provider", () => { const networkId = "1234"; @@ -72,19 +72,19 @@ describe("provider", () => { it("generates predictable accounts when given a seed", async() => { const p = Ganache.provider({seed: "temet nosce"}); - const accounts = await p.send("eth_accounts"); + const accounts = await p.request("eth_accounts"); assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); }); it("gets balance", async() => { - const accounts = await p.send("eth_accounts"); - const balance = await p.send("eth_getBalance", [accounts[0]]); + const accounts = await p.request("eth_accounts"); + const balance = await p.request("eth_getBalance", [accounts[0]]); // TODO: this value is actually wrong! assert.strictEqual(balance, "0x56bc75e2d63100000", "Heyo!"); }); it("returns things via EIP-1193", async () => { - const version = await p.send("net_version"); + const version = await p.request("net_version"); assert.strictEqual(version, networkId); }); @@ -118,8 +118,8 @@ describe("provider", () => { "toString", "toValue", "__proto__", "prototype", "notAFunction", "", " ", "constructor", ]; - await Promise.all(illegalMethodNames.map((name) => { - return assert.rejects(p.send(name), { + await Promise.all(illegalMethodNames.map((name: any) => { + return assert.rejects(p.request(name), { message: `Invalid or unsupported method: ${name}` }); })); @@ -129,7 +129,7 @@ describe("provider", () => { // in the foot on accident it.skip("TODO: allow 'injecting' our own engine or ledger into a provider!", async () => { (p as any)._engine._ledger.__proto__.illegalProperty = true; - await assert.rejects(p.send("illegalProperty"), { + await assert.rejects(p.request("illegalProperty" as any), { message: "Invalid or unsupported method: illegalProperty" }); }); @@ -163,7 +163,7 @@ describe("provider", () => { // make sure we reject non-strings over the EIP-1193 send interface illegalMethodTypes.map((methodType) => { - assert.throws(() => p.send(methodType as string), { + assert.throws(() => p.send(methodType as any), { message: "No callback provided to provider's send function. As of " + "web3 1.0, provider.send is no longer synchronous and must be " + "passed a callback as its final argument." diff --git a/test/server.ts b/test/server.ts index 2e89f93e6d..f4c03dd348 100644 --- a/test/server.ts +++ b/test/server.ts @@ -214,10 +214,10 @@ describe("server", () => { await setup(); try { - const oldSend = s.provider.send; + const oldRequest = (s.provider as any).request; const req = request.post('http://localhost:' + port); const abortPromise = new Promise(resolve => { - s.provider.send = () => { + (s.provider as any).request = () => { // abort the request object after intercepting the request req.abort(); return new Promise(innerResolve => { @@ -239,7 +239,7 @@ describe("server", () => { // wait for the server to react to the requesrt's `abort` await abortPromise; - s.provider.send = oldSend; + (s.provider as any).request = oldRequest; // now make sure we are still up and running: await simpleTest(); @@ -412,7 +412,7 @@ describe("server", () => { }); it("doesn't crash when the connection is closed while a request is in flight", async () => { - s.provider.send = async () => { + (s.provider as any).request = async () => { // close our websocket after intercepting the request await s.close(); }; @@ -440,8 +440,8 @@ describe("server", () => { { // create tons of data to force websocket backpressure const huge = {} as any; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; - s.provider.send = async () => { - return huge + (s.provider as any).request = async () => { + return huge; }; } diff --git a/tsconfig.json b/tsconfig.json index e929feb288..0983cdbf8e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,6 @@ }, "include": [ "./index.ts", - "./typings/**/*.d.ts", "typings/uWebsockets.js.ts" + "./typings/**/*.d.ts" ] } diff --git a/typings/emittery.d.ts b/typings/emittery.d.ts new file mode 100644 index 0000000000..0ea267681f --- /dev/null +++ b/typings/emittery.d.ts @@ -0,0 +1,41 @@ +import "emittery" + +interface Events { + // Blocked by https://github.com/microsoft/TypeScript/issues/1863, should be + // `[eventName: EventName]: unknown;` +} + +/** +Maps event names to their emitted data type. +*/ +interface Events { + [eventName: any]: (args: Events) => Promise; +} + +declare module "emittery" { + export class Typed extends Emittery.Typed { + on>(eventName: Name, listener: (eventData: Parameters[0]) => void): Emittery.UnsubscribeFn; + on(eventName: Name, listener: () => void): Emittery.UnsubscribeFn; + + events>(eventName: Name): AsyncIterableIterator[0]>; + + once>(eventName: Name): Promise>; + once(eventName: Name): Promise>; + + off>(eventName: Name, listener: (eventData: Parameters[0]) => void): void; + off(eventName: Name, listener: () => void): void; + + onAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => void): Emittery.UnsubscribeFn; + anyEvent(): AsyncIterableIterator<[EventNameFromDataMap, EventDataMap[EventNameFromDataMap]]>; + + offAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => void): void; + + emit>(eventName: Name, eventData: Parameters[0]): Promise>; + emit(eventName: Name): Promise>; + + emitSerial>(eventName: Name, eventData: Parameters[0]): Promise>; + emitSerial(eventName: Name): Promise>; + } +} + +export = Emittery; \ No newline at end of file diff --git a/typings/uWebsockets.js.ts b/typings/uWebsockets.js.d.ts similarity index 100% rename from typings/uWebsockets.js.ts rename to typings/uWebsockets.js.d.ts From 9f6bdb4a06732df5acd6d679add74466f8eca2e0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Apr 2020 14:40:38 -0400 Subject: [PATCH 144/691] More refactoring --- src/ledgers/ethereum/index.ts | 6 +++--- src/options/options.ts | 4 ++-- src/options/provider-options.ts | 16 ++++++++++++++-- src/options/server-options.ts | 1 + src/provider.ts | 13 ++++--------- src/server.ts | 12 ++++++------ test/helpers/getProvider.ts | 2 +- test/server.ts | 2 +- 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/ledgers/ethereum/index.ts b/src/ledgers/ethereum/index.ts index 6ad1b5cd8f..e401c98415 100644 --- a/src/ledgers/ethereum/index.ts +++ b/src/ledgers/ethereum/index.ts @@ -26,7 +26,7 @@ type KnownKeys = { type RequestType = (eventDetails: {ledger: T, method: KnownKeys, params?: Parameters}) => ReturnType; -export default class Provider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements IProvider { +export default class EthereumProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements IProvider { #options: ProviderOptions; #ledger: Ledger; #wallet: HDKey; @@ -72,7 +72,7 @@ export default class Provider extends Emittery.Typed<{request: RequestType Options = (options) => { @@ -189,7 +189,7 @@ export const getDefault: (options: Options)=> Options = (options) => { defaultTransactionGasLimit: new Quantity(90000), verbose: false, asyncRequestProcessing: true, - hardfork: "petersburg", + hardfork: "muirGlacier", secure }, options); } diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 332f6cad6a..bd6a09d015 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -1,8 +1,17 @@ import Options, {getDefault as getDefaultOptions} from "./options"; - +import EthereumProvider from "../ledgers/ethereum"; import { entropyToMnemonic } from "bip39"; import seedrandom, { seedrandom_prng } from "seedrandom"; + +export type Flavors = { + ethereum: EthereumProvider +}; + +export const Flavors = { + ethereum: EthereumProvider +}; + function randomBytes(length: number, rng: () => number) { const buf = Buffer.allocUnsafe(length); for (let i = 0; i < length; i++) { @@ -29,12 +38,15 @@ export default interface ProviderOptions extends Options { * Array of strings to installed subproviders */ subProviders?: any[], + + flavor?: keyof typeof Flavors } export const getDefault : (options: ProviderOptions) => ProviderOptions = (options) => { const _options = Object.assign( { - subProviders: [] + subProviders: [], + flavor: "ethereum" as keyof typeof Flavors }, getDefaultOptions(options) ); diff --git a/src/options/server-options.ts b/src/options/server-options.ts index ec40e480d5..502f6bc9cf 100644 --- a/src/options/server-options.ts +++ b/src/options/server-options.ts @@ -1,4 +1,5 @@ import ProviderOptions, {getDefault as getDefaultProviderOptions} from "./provider-options"; +export { Flavors } from "./provider-options"; export default interface ServerOptions extends ProviderOptions { /** diff --git a/src/provider.ts b/src/provider.ts index 96e94eb460..6182c77702 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,17 +1,12 @@ import Executor from "./utils/executor"; import RequestCoordinator from "./utils/request-coordinator"; -import ProviderOptions, { getDefault as getDefaultProviderOptions } from "./options/provider-options"; +import ProviderOptions, { Flavors } from "./options/provider-options"; import Emittery from "emittery"; -import Ethereum from "./ledgers/ethereum"; -import JsonRpc from "./servers/utils/jsonrpc"; - -interface Callback { - (err?: Error, response?: JsonRpc.Response): void; -} export default class Provider extends Emittery { - public static initialize(providerOptions: ProviderOptions = {asyncRequestProcessing: true}) { - const provider = new Ethereum(providerOptions); + // TODO: set missing defaults automatically + public static initialize(providerOptions: ProviderOptions = {flavor: "ethereum", asyncRequestProcessing: true}) { + const provider = new Flavors[providerOptions.flavor || "ethereum"](providerOptions);; // Set up our request coordinator to either use FIFO or or async request processing. // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it diff --git a/src/server.ts b/src/server.ts index 13914b105f..5841301e99 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,11 +1,10 @@ -import ServerOptions, {getDefault as getDefaultServerOptions} from "./options/server-options"; +import ServerOptions, {Flavors, getDefault as getDefaultServerOptions} from "./options/server-options"; import uWS, { TemplatedApp, us_listen_socket } from "uWebSockets.js"; import Provider from "./provider"; import WebsocketServer from "./servers/ws-server"; import HttpServer from "./servers/http-server"; import { ILedger } from "./interfaces/base-ledger"; -import Ethereum from "./ledgers/ethereum"; export enum Status { // Flags @@ -15,17 +14,19 @@ export enum Status { closing = 12 } -export default class Server { +export default class Server { #app: TemplatedApp; // TODO: make this a generic IProvider - public provider: Ethereum; + public provider: Flavors[T["flavor"]]; #options: ServerOptions; #httpServer: HttpServer; #listenSocket: us_listen_socket; #websocketServer: WebsocketServer; public status = Status.closed; - constructor(serverOptions?: ServerOptions) { + constructor(serverOptions?: T) { + type g = T["flavor"]; + type f = typeof Flavors[g]; const opts = this.#options = getDefaultServerOptions(serverOptions); const prov = this.provider = Provider.initialize(opts); @@ -88,4 +89,3 @@ export default class Server { await this.provider.close(); } } - diff --git a/test/helpers/getProvider.ts b/test/helpers/getProvider.ts index 00573a7d1d..929c2131d8 100644 --- a/test/helpers/getProvider.ts +++ b/test/helpers/getProvider.ts @@ -3,7 +3,7 @@ import Provider from "../../src/provider"; import ProviderOptions from "../../src/options/provider-options"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; -const GetProvider = (options: ProviderOptions = {mnemonic}) => { +const GetProvider = (options: ProviderOptions = {flavor: "ethereum", mnemonic}) => { return Ganache.provider(options) } diff --git a/test/server.ts b/test/server.ts index f4c03dd348..399862753c 100644 --- a/test/server.ts +++ b/test/server.ts @@ -20,7 +20,7 @@ describe("server", () => { log: (_message: string) => {} } let s: Server; - async function setup(options: ServerOptions = { + async function setup(options = { network_id, logger } as ServerOptions) { From f3a050eff487c54cc041570b8813b96377990454 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Apr 2020 17:10:49 -0400 Subject: [PATCH 145/691] Tweak tsconfig.json --- tsconfig.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 0983cdbf8e..2574e76e9e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,16 +1,16 @@ { "compilerOptions": { "skipLibCheck": true, - "experimentalDecorators": true, - "module": "commonjs", + + "module": "CommonJS", "esModuleInterop": true, "target": "ES2020", "noImplicitAny": true, "moduleResolution": "node", + "noImplicitThis": true, + "noErrorTruncation": true, "sourceMap": true, "outDir": "dist", - "lib": ["ESNext"], - "incremental": true, "resolveJsonModule": true }, "include": [ From 7d46106bb6cd864d9750ac87fac27ed2d57815b8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Apr 2020 17:10:58 -0400 Subject: [PATCH 146/691] Fix up some things --- src/options/provider-options.ts | 5 ++-- src/server.ts | 47 ++++++++++++++++++--------------- src/types/transaction.ts | 2 +- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index bd6a09d015..f798069a11 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -3,12 +3,11 @@ import EthereumProvider from "../ledgers/ethereum"; import { entropyToMnemonic } from "bip39"; import seedrandom, { seedrandom_prng } from "seedrandom"; - -export type Flavors = { +export const Flavors = { ethereum: EthereumProvider }; -export const Flavors = { +export type Flavors = { ethereum: EthereumProvider }; diff --git a/src/server.ts b/src/server.ts index 5841301e99..3358dd415a 100644 --- a/src/server.ts +++ b/src/server.ts @@ -7,28 +7,33 @@ import HttpServer from "./servers/http-server"; import { ILedger } from "./interfaces/base-ledger"; export enum Status { - // Flags + // These are bit flags open = 1, opening = 3, closed = 4, closing = 12 -} +}; export default class Server { #app: TemplatedApp; - // TODO: make this a generic IProvider - public provider: Flavors[T["flavor"]]; - #options: ServerOptions; #httpServer: HttpServer; #listenSocket: us_listen_socket; + #options: ServerOptions; + #provider: Flavors[T["flavor"]]; + #status = Status.closed; #websocketServer: WebsocketServer; - public status = Status.closed; - + + public get provider () { + return this.#provider; + } + + public get status() { + return this.#status; + } + constructor(serverOptions?: T) { - type g = T["flavor"]; - type f = typeof Flavors[g]; const opts = this.#options = getDefaultServerOptions(serverOptions); - const prov = this.provider = Provider.initialize(opts); + const prov = this.#provider = Provider.initialize(opts); const _app = this.#app = uWS.App(); @@ -39,12 +44,12 @@ export default class Server { } async listen(port: number, callback?: (err: Error) => void): Promise { - let err; + let err: Error; // if open or opening - if (this.status & Status.open) { + if (this.#status & Status.open) { err = new Error(`Server is already listening on port: ${port}`); } else { - this.status = Status.opening; + this.#status = Status.opening; const _listenSocket = await new Promise((resolve) => { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 @@ -53,11 +58,11 @@ export default class Server { }); if (_listenSocket) { - this.status = Status.open; + this.#status = Status.open; this.#listenSocket = _listenSocket; err = null; } else { - this.status = Status.closed; + this.#status = Status.closed; err = new Error("Failed to listen on port: " + port); } } @@ -72,20 +77,18 @@ export default class Server { public async close() { const _listenSocket = this.#listenSocket; - this.status = Status.closing; + this.#status = Status.closing; if (_listenSocket) { this.#listenSocket = undefined; // close the socket to prevent any more connections uWS.us_listen_socket_close(_listenSocket); } // close all the currently connection websockets: - const ws = this.#websocketServer; - if (ws) { - ws.close(); - } + this.#websocketServer?.close(); + // and do all http cleanup, if any this.#httpServer.close(); - this.status = Status.closed; - await this.provider.close(); + this.#status = Status.closed; + await this.#provider.close(); } } diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 3b8cb5b07a..59e4fc9f95 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -16,7 +16,7 @@ const ONE_BUFFER = Buffer.from([0]); //#region helpers const sign = EthereumJsTransaction.prototype.sign; -const fakeHash = function () { +const fakeHash = function (this: Transaction) { // this isn't memoization of the hash. previous versions of ganache-core // created hashes in a different/incorrect way and are recorded this way // in snapshot dbs. We are preserving the chain's immutability by using the From 5f493a6c5670656eec6e7d9f4837ad8cab8f8c60 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Apr 2020 17:25:32 -0400 Subject: [PATCH 147/691] Some repo cleanup --- Dockerfile | 12 ------------ ISSUE_TEMPLATE.md | 40 ---------------------------------------- LICENSE | 29 +++++++++++++++-------------- index.ts | 1 - 4 files changed, 15 insertions(+), 67 deletions(-) delete mode 100644 Dockerfile delete mode 100644 ISSUE_TEMPLATE.md diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index b621f54072..0000000000 --- a/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM mhart/alpine-node:7.9.0 - -RUN apk add --no-cache make gcc g++ python git bash -COPY package.json /src/package.json -WORKDIR /src -RUN npm install - -ADD . . - -EXPOSE 8545 - -ENTRYPOINT ["node", "./bin/testrpc"] diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index 4d096d2025..0000000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - -## Expected Behavior - - - -## Current Behavior - - - -## Possible Solution - - - -## Steps to Reproduce (for bugs) - - -1. -2. -3. -4. - -## Context - - - -## Your Environment - -* Version used: -* Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): -* Server type and version: -* Operating System and version: -* Link to your project: diff --git a/LICENSE b/LICENSE index a5a4e4d44a..89ab9cf5a7 100644 --- a/LICENSE +++ b/LICENSE @@ -2,21 +2,22 @@ The MIT License (MIT) Copyright (c) 2015 Iuri Matias -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Copyright (c) 2020 Truffle Blockchain Group -The above copyright notice and this permission notice shall be included in all +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/index.ts b/index.ts index 03f6f3d217..0132ca50a8 100644 --- a/index.ts +++ b/index.ts @@ -3,7 +3,6 @@ import ProviderOptions from "./src/options/provider-options"; import ServerOptions from "./src/options/server-options"; import Server from "./src/server"; -// `server` and `provider` are here for backwards compatability export default { server: (options?: ServerOptions) => new Server(options), provider: (options?: ProviderOptions) => Provider.initialize(options), From 6746d878996005f785dfd61653b0d9b87babcf77 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Apr 2020 17:25:37 -0400 Subject: [PATCH 148/691] Typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b6b4456d7..2015530fba 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# JUST FOR EXPERIEMENTS +# JUST FOR EXPERIMENTS [![npm](https://img.shields.io/npm/v/ganache-core.svg)]() [![npm](https://img.shields.io/npm/dm/ganache-core.svg)]() From 42e1588dbdce1cb687b31a7fdb62a82a9b5c9ef4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Apr 2020 18:42:05 -0400 Subject: [PATCH 149/691] Some docs --- README.md | 144 +---------------------------------------------- docs/DATAFLOW.md | 42 ++++++++++++++ docs/README.md | 27 +++++++++ src/server.ts | 7 ++- 4 files changed, 75 insertions(+), 145 deletions(-) create mode 100644 docs/DATAFLOW.md create mode 100644 docs/README.md diff --git a/README.md b/README.md index 2015530fba..1cd0908944 100644 --- a/README.md +++ b/README.md @@ -1,145 +1,3 @@ # JUST FOR EXPERIMENTS -[![npm](https://img.shields.io/npm/v/ganache-core.svg)]() -[![npm](https://img.shields.io/npm/dm/ganache-core.svg)]() -[![Build Status](https://travis-ci.org/trufflesuite/ganache-core.svg?branch=master)](https://travis-ci.org/trufflesuite/ganache-core) -# Ganache Core - -This is the core code that powers the Ganache application and the the Ganache command line tool. - -# INSTALL - -`ganache-core` is written in Javascript and distributed as a Node package via `npm`. Make sure you have Node.js (>= v8.9.0) installed, and your environment is capable of installing and compiling `npm` modules. - -**macOS** Make sure you have the XCode Command Line Tools installed. These are needed in general to be able to compile most C based languages on your machine, as well as many npm modules. - -**Windows** See our [Windows install instructions](https://github.com/ethereumjs/testrpc/wiki/Installing-TestRPC-on-Windows). - -**Ubuntu/Linux** Follow the basic instructions for installing [Node.js](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions) and make sure that you have `npm` installed, as well as the `build-essential` `apt` package (it supplies `make` which you will need to compile most things). Use the official Node.js packages, *do not use the package supplied by your distribution.* - - -```Bash -npm install ganache-core -``` - -# USAGE - -As a Web3 provider: - -```javascript -var Ganache = require("ganache-core"); -web3.setProvider(Ganache.provider()); -``` - -As a general http server: - -```javascript -var Ganache = require("ganache-core"); -var server = Ganache.server(); -server.listen(port, function(err, blockchain) {...}); -``` - -Both `.provider()` and `.server()` take a single object which allows you to specify behavior of the Ganache instance. This parameter is optional. Available options are: - -* `"accounts"`: `Array` of `Object`'s. Each object should have a balance key with a hexadecimal value. The key `secretKey` can also be specified, which represents the account's private key. If no `secretKey`, the address is auto-generated with the given balance. If specified, the key is used to determine the account's address. -* `"debug"`: `boolean` - Output VM opcodes for debugging -* `"logger"`: `Object` - Object, like `console`, that implements a `log()` function. -* `"mnemonic"`: Use a specific HD wallet mnemonic to generate initial addresses. -* `"port"`: Port number to listen on when running as a server. -* `"seed"`: Use arbitrary data to generate the HD wallet mnemonic to be used. -* `"default_balance_ether"`: `number` - The default account balance, specified in ether. -* `"total_accounts"`: `number` - Number of accounts to generate at startup. -* `"fork"`: `string` or `object` - When a `string`, same as `--fork` option above. Can also be a Web3 Provider object, optionally used in conjunction with the `fork_block_number` option below. -* `"fork_block_number"`: `string` or `number` - Block number the provider should fork from, when the `fork` option is specified. If the `fork` option is specified as a string including the `@` sign and a block number, the block number in the `fork` parameter takes precedence. -* `"network_id"`: `string` - Same as `--networkId` option above. -* `"time"`: `Date` - Date that the first block should start. Use this feature, along with the `evm_increaseTime` method to test time-dependent code. -* `"locked"`: `boolean` - whether or not accounts are locked by default. -* `"unlocked_accounts"`: `Array` - array of addresses or address indexes specifying which accounts should be unlocked. -* `"db_path"`: `String` - Specify a path to a directory to save the chain database. If a database already exists, that chain will be initialized instead of creating a new one. -* `"db"`: `Object` - Specify an alternative database instance, for instance [MemDOWN](https://github.com/level/memdown). -* `"ws"`: Enable a websocket server. This is `true` by default. -* `"vmErrorsOnRPCResponse"`: Whether to report runtime errors from EVM code as RPC errors. This is `true` by default to replicate the error reporting behavior of previous versions of ganache. -* `"hdPath"`: The hierarchical deterministic path to use when generating accounts. Default: "m/44'/60'/0'/0/" -* `"allowUnlimitedContractSize"`: Allows unlimited contract sizes while debugging. By setting this to `true`, the check within the EVM for contract size limit of 24KB (see [EIP-170](https://git.io/vxZkK)) is bypassed. Setting this to `true` **will** cause `ganache-core` to behave differently than production environments. (default: `false`; **ONLY** set to `true` during debugging). -* `"gasPrice"`: Sets the default gas price for transactions if not otherwise specified. Must be specified as a hex string in wei. Defaults to `"0x77359400"`, or 2 gwei. -* `"gasLimit"`: Sets the block gas limit. Must be specified as a hex string. Defaults to `"0x6691b7"`. - -# IMPLEMENTED METHODS - -The RPC methods currently implemented are: - -* `bzz_hive` (stub) -* `bzz_info` (stub) -* `debug_traceTransaction` -* `eth_accounts` -* `eth_blockNumber` -* `eth_call` -* `eth_coinbase` -* `eth_estimateGas` -* `eth_gasPrice` -* `eth_getBalance` -* `eth_getBlockByNumber` -* `eth_getBlockByHash` -* `eth_getBlockTransactionCountByHash` -* `eth_getBlockTransactionCountByNumber` -* `eth_getCode` (only supports block number “latest”) -* `eth_getCompilers` -* `eth_getFilterChanges` -* `eth_getFilterLogs` -* `eth_getLogs` -* `eth_getStorageAt` -* `eth_getTransactionByHash` -* `eth_getTransactionByBlockHashAndIndex` -* `eth_getTransactionByBlockNumberAndIndex` -* `eth_getTransactionCount` -* `eth_getTransactionReceipt` -* `eth_hashrate` -* `eth_mining` -* `eth_newBlockFilter` -* `eth_newFilter` (includes log/event filters) -* `eth_protocolVersion` -* `eth_sendTransaction` -* `eth_sendRawTransaction` -* `eth_sign` -* `eth_subscribe` (only for websocket connections. "syncing" subscriptions are not yet supported) -* `eth_unsubscribe` (only for websocket connections. "syncing" subscriptions are not yet supported) -* `eth_syncing` -* `eth_uninstallFilter` -* `net_listening` -* `net_peerCount` -* `net_version` -* `miner_start` -* `miner_stop` -* `personal_listAccounts` -* `personal_lockAccount` -* `personal_newAccount` -* `personal_importRawKey` -* `personal_unlockAccount` -* `personal_sendTransaction` -* `shh_version` -* `rpc_modules` -* `web3_clientVersion` -* `web3_sha3` - -There’s also special non-standard methods that aren’t included within the original RPC specification: - -* `evm_snapshot` : Snapshot the state of the blockchain at the current block. Takes no parameters. Returns the integer id of the snapshot created. -* `evm_revert` : Revert the state of the blockchain to a previous snapshot. Takes a single parameter, which is the snapshot id to revert to. If no snapshot id is passed it will revert to the latest snapshot. Returns `true`. -* `evm_increaseTime` : Jump forward in time. Takes one parameter, which is the amount of time to increase in seconds. Returns the total time adjustment, in seconds. -* `evm_mine` : Force a block to be mined. Takes one optional parameter, which is the timestamp a block should setup as the mining time. Mines a block independent of whether or not mining is started or stopped. - -# Unsupported Methods - -* `eth_compileSolidity`: If you'd like Solidity compilation in Javascript, please see the [solc-js project](https://github.com/ethereum/solc-js). - - -# TESTING - -Run tests via: - -``` -$ npm test -``` - -# LICENSE -[MIT](https://tldrlegal.com/license/mit-license) +TODO: auuto generate some stuffs here: \ No newline at end of file diff --git a/docs/DATAFLOW.md b/docs/DATAFLOW.md new file mode 100644 index 0000000000..f87b36ff85 --- /dev/null +++ b/docs/DATAFLOW.md @@ -0,0 +1,42 @@ +Render at https://www.planttext.com/ + +```uml +@startuml + +title Ganache Core Data Flow \n + +start + +:Server; + +:HttpServer/WebsocketServer; + +:Provider; + +note left + Ethereum, Tezos, etc. + `request(method: string, params: any[])` +end note + +:RequestCoordinator; + +note left + Lets us limit how many simultenous requests we process. +end note + +:Executor; + +note left + Ensures the requested RPC is a valid Ledger endpoint +end note + +:Ledger; + +note left + Executes the request. Implementation dependent. +end note + +stop + +@enduml +``` \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000..b7dcf2a5f3 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,27 @@ +# Developer Documentation + +## Code Conventions + +These are guidelines, not rules. :-) + + * Use Node v10.7.0 for most local development. This is the earliest version we support. + * Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed + `Number.MAX_SAFE_INTEGER` + * Write tests. + * Do not use "Optional Chaining" (`obj?.prop`). I'd love to enable this, but TypeScript makes it hard to use bigint + literals and optional chaining together. + * Prefer using a single loop to functional chaining. + * Prefer performant code over your own developer experience. + * Document complex code. Explain why the code does what it does. + * Feel free to be clever, just document *why* you're being clever. If it's hard to read, comment _what_ the code does, + too. + * Add JSDoc comments to public class members where it makes sense. + * Before adding an external dependency check its code for quality, its # of external dependencies, its node version + support, and make sure it absolutely necessary. + * Pin all dependencies, even dev dependencies. + * Use npm; do not use yarn. + * Don't use web3, ethers, etc in ganache-core core code. (Tests are fine) + * Ensure a smooth development experience on Windows, Mac, and Linux. + * Do not use bash scripts. + * Do not use CLI commands in npm scripts or build scripts that aren't available by default on supported platforms. + diff --git a/src/server.ts b/src/server.ts index 3358dd415a..b41edad5b8 100644 --- a/src/server.ts +++ b/src/server.ts @@ -83,8 +83,11 @@ export default class Server { // close the socket to prevent any more connections uWS.us_listen_socket_close(_listenSocket); } - // close all the currently connection websockets: - this.#websocketServer?.close(); + // close all the connected websockets: + const ws = this.#websocketServer; + if (ws) { + ws.close(); + } // and do all http cleanup, if any this.#httpServer.close(); From d75ae42a3a89f64b131060c4b0101f1db8e92949 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Apr 2020 18:46:28 -0400 Subject: [PATCH 150/691] Add prettier --- .prettierrc.json | 5 + npm-shrinkwrap.json | 507 ++++++++++++++++++++++++++++++++++++++++++++ package.json | 10 +- 3 files changed, 521 insertions(+), 1 deletion(-) create mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000000..59184f5a2c --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "trailingComma": "none", + "printWidth": 120, + "arrowParens": "avoid" +} diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8582782819..03fa821c49 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -187,6 +187,15 @@ "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", "dev": true }, + "@babel/runtime": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", + "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, "@babel/template": { "version": "7.8.6", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", @@ -341,6 +350,12 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==" }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, "@types/secp256k1": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-3.5.0.tgz", @@ -691,6 +706,12 @@ "write-file-atomic": "^3.0.0" } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -743,6 +764,12 @@ "readdirp": "~3.2.0" } }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -758,6 +785,21 @@ "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-spinners": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", + "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", + "dev": true + }, "cliui": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", @@ -839,6 +881,12 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -883,6 +931,19 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -1002,6 +1063,12 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, + "diff-match-patch": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.4.tgz", + "integrity": "sha512-Uv3SW8bmH9nAtHKaKSanOQmj2DnlH65fUpcrMdfdaOxUG02QQ4YGZ8AE7kKOMisF7UqvOlGKVYWRvezdncW9lg==", + "dev": true + }, "drbg.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", @@ -1087,6 +1154,15 @@ "prr": "~1.0.1" } }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, "es-abstract": { "version": "1.17.5", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", @@ -1476,6 +1552,80 @@ "safe-buffer": "^5.1.1" } }, + "execa": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.9.0.tgz", + "integrity": "sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA==", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + } + } + }, "fake-merkle-patricia-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", @@ -1524,6 +1674,15 @@ "locate-path": "^3.0.0" } }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, "flat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", @@ -1628,6 +1787,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -1747,16 +1912,110 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "husky": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", + "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^6.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, "immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -1793,6 +2052,12 @@ "p-is-promise": "^3.0.0" } }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -2052,6 +2317,12 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "json5": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", @@ -2379,6 +2650,12 @@ } } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -2636,6 +2913,12 @@ "mime-db": "1.43.0" } }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -2726,6 +3009,12 @@ } } }, + "mri": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.5.tgz", + "integrity": "sha512-d2RKzMD4JNyHMbnbWnznPaa8vbdlq/4pNZ3IgdaGrVbBhebBsGUUE/6qorTMYNS6TwuH3ilfOlD2bf4Igh8CKg==", + "dev": true + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", @@ -2785,6 +3074,23 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + }, + "dependencies": { + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + } + } + }, "nyc": { "version": "15.0.1", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.1.tgz", @@ -3023,12 +3329,56 @@ "wrappy": "1" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true + }, + "ora": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-1.4.0.tgz", + "integrity": "sha512-iMK1DOQxzzh2MBlVsU42G80mnrvUhqsMh74phHtDlrcTZPK0pH6o7l7DRshK+0YsxDyEuaOkziVdvM3T0QTzpw==", + "dev": true, + "requires": { + "chalk": "^2.1.0", + "cli-cursor": "^2.1.0", + "cli-spinners": "^1.0.1", + "log-symbols": "^2.1.0" + }, + "dependencies": { + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + } + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, "p-is-promise": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", @@ -3080,6 +3430,27 @@ "release-zalgo": "^1.0.0" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -3103,6 +3474,12 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, "pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -3166,6 +3543,81 @@ } } }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, + "precise-commits": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/precise-commits/-/precise-commits-1.0.2.tgz", + "integrity": "sha512-PYkoNTFXVvZRzJTDxdgzmPanhSNGj5Wtj2NgSo7IhwNXGcKktX+L4DJhyIrhFSLsWWAvd+cYyyU2eXlaX5QxzA==", + "dev": true, + "requires": { + "diff-match-patch": "^1.0.0", + "execa": "^0.9.0", + "find-up": "^2.1.0", + "glob": "^7.1.2", + "ignore": "^3.3.7", + "mri": "^1.1.0", + "ora": "^1.3.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + } + } + }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -3252,6 +3704,12 @@ "picomatch": "^2.0.4" } }, + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -3294,6 +3752,16 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -3373,6 +3841,18 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -3424,6 +3904,12 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, "solc": { "version": "0.6.6", "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.6.tgz", @@ -3586,6 +4072,12 @@ "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", @@ -3908,6 +4400,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", @@ -3995,6 +4493,15 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, + "yaml": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.9.2.tgz", + "integrity": "sha512-HPT7cGGI0DuRcsO51qC1j9O16Dh1mZ2bnXwsi0jrSpsLz0WxOLSLXfkABVl6bZO629py3CU+OMJtpNHDLB97kg==", + "dev": true, + "requires": { + "@babel/runtime": "^7.9.2" + } + }, "yargs": { "version": "13.3.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", diff --git a/package.json b/package.json index 4b1a0147a9..475b8d05b1 100644 --- a/package.json +++ b/package.json @@ -57,9 +57,12 @@ "@types/ws": "7.2.4", "bufferutil": "4.0.1", "cross-env": "7.0.2", + "husky": "4.2.5", "into-stream": "5.1.1", "mocha": "7.1.1", "nyc": "15.0.1", + "precise-commits": "1.0.2", + "prettier": "2.0.5", "solc": "0.6.6", "source-map-support": "0.5.18", "superagent": "5.2.2", @@ -77,5 +80,10 @@ "url": "https://github.com/trufflesuite/ganache-core" }, "license": "MIT", - "author": "David Murdoch" + "author": "David Murdoch", + "husky": { + "hooks": { + "pre-commit": "precise-commits" + } + } } From 5cfa12c80a4a15222cf109930a323c7a6ed9a103 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Apr 2020 18:56:16 -0400 Subject: [PATCH 151/691] Use updated travis --- .travis.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8333bc44da..7b5463665e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,26 @@ +version: ~> 1.0 + language: node_js + node_js: - - "lts/dubnium" + - "10.7.0" + - "10" + - "11" + - "12" + - "13" + - "14" + +os: + - linux + - osx + - windows + +# using xcode9.2 forces osx 10.12, which is WAAAYYYYYY faster than 10.13 +# in fact, we couldn't get osx 10.13 to ever finish the running the tests +osx_image: xcode9.2 + +git: + autocrlf: false addons: apt: @@ -17,8 +37,3 @@ before_install: export LINK="gcc-5"; export LINKXX="g++-5"; fi - - nvm --version - - node --version - - npm --version - - gcc --version - - g++ --version From 4da6c15e2128c4856043a00510c7b0247cf0b1c3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 12:15:19 -0400 Subject: [PATCH 152/691] Code formatting --- .npmrc | 2 +- .nycrc | 3 + .prettierrc.json => .prettierrc | 3 +- .travis.yml | 8 +- README.md | 2 +- docs/DATAFLOW.md | 2 +- docs/README.md | 41 ++-- npm-shrinkwrap.json | 9 + package.json | 18 +- index.ts => src/index.ts | 2 +- src/interfaces/IProvider.ts | 10 +- src/interfaces/base-ledger.ts | 10 +- src/interfaces/ledger-options.ts | 4 +- src/ledgers/ethereum/blockchain.ts | 80 +++---- .../ethereum/components/account-manager.ts | 36 +-- .../ethereum/components/block-manager.ts | 214 +++++++++--------- src/ledgers/ethereum/components/manager.ts | 10 +- .../ethereum/components/transaction-pool.ts | 28 ++- src/ledgers/ethereum/database.ts | 30 +-- src/ledgers/ethereum/index.ts | 72 +++--- src/ledgers/ethereum/ledger.ts | 63 +++--- src/ledgers/ethereum/miner.ts | 43 ++-- src/ledgers/ethereum/options.ts | 19 +- src/ledgers/ethereum/wallet.ts | 19 +- src/options/options.ts | 142 ++++++------ src/options/provider-options.ts | 18 +- src/options/server-options.ts | 23 +- src/provider.ts | 6 +- src/server.ts | 22 +- src/servers/http-server.ts | 63 ++++-- src/servers/utils/content-types.ts | 4 +- src/servers/utils/http-response-codes.ts | 16 +- src/servers/utils/jsonrpc.ts | 95 ++++---- src/servers/utils/websocket-close-codes.ts | 6 +- .../views/components/app-tabs/marko-tag.json | 10 +- src/servers/ws-server.ts | 14 +- src/types/account.ts | 16 +- src/types/address.ts | 2 +- src/types/errors.ts | 44 ++-- src/types/json-rpc/json-rpc-base-types.ts | 39 ++-- src/types/json-rpc/json-rpc-data.ts | 30 +-- src/types/json-rpc/json-rpc-quantity.ts | 33 ++- src/types/params.ts | 28 +-- src/types/tags.ts | 2 +- src/types/transaction-receipt.ts | 10 +- src/types/transaction.ts | 43 ++-- src/utils/bigint-to-buffer.ts | 10 +- src/utils/executor.ts | 9 +- src/utils/heap.ts | 50 ++-- src/utils/request-coordinator.ts | 24 +- test/helpers/getProvider.ts | 8 +- test/helpers/sleep.ts | 2 +- test/interface.ts | 6 +- test/ledger.ts | 187 +++++++++------ test/provider.ts | 159 +++++++------ test/server.ts | 200 ++++++++-------- test/temp-tests.ts | 114 ++++++---- tsconfig.json | 6 +- typings/emittery.d.ts | 60 +++-- typings/ethereumjs-block/header.d.ts | 95 ++++---- typings/ethereumjs-block/index.d.ts | 83 ++++--- typings/hdkey.d.ts | 32 +-- typings/levelup/index.d.ts | 176 +++++++------- typings/merkle-patricia-tree/baseTrie.d.ts | 51 ++--- typings/merkle-patricia-tree/index.d.ts | 34 +-- typings/merkle-patricia-tree/readStream.d.ts | 10 +- typings/merkle-patricia-tree/trieNode.d.ts | 66 +++--- typings/superagent.d.ts | 2 +- typings/tmp.d.ts | 12 +- typings/uWebsockets.js.d.ts | 13 +- 70 files changed, 1475 insertions(+), 1328 deletions(-) create mode 100644 .nycrc rename .prettierrc.json => .prettierrc (50%) rename index.ts => src/index.ts (97%) diff --git a/.npmrc b/.npmrc index 4fd021952d..b6f27f1359 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -engine-strict=true \ No newline at end of file +engine-strict=true diff --git a/.nycrc b/.nycrc new file mode 100644 index 0000000000..0395a09274 --- /dev/null +++ b/.nycrc @@ -0,0 +1,3 @@ +{ + "extends": "@istanbuljs/nyc-config-typescript" +} diff --git a/.prettierrc.json b/.prettierrc similarity index 50% rename from .prettierrc.json rename to .prettierrc index 59184f5a2c..1c4ad36d29 100644 --- a/.prettierrc.json +++ b/.prettierrc @@ -1,5 +1,6 @@ { "trailingComma": "none", "printWidth": 120, - "arrowParens": "avoid" + "arrowParens": "avoid", + "bracketSpacing": false } diff --git a/.travis.yml b/.travis.yml index 7b5463665e..b1799c729d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,8 @@ addons: before_install: - if [ $TRAVIS_OS_NAME == "linux" ]; then - export CC="gcc-5"; - export CXX="g++-5"; - export LINK="gcc-5"; - export LINKXX="g++-5"; + export CC="gcc-5"; + export CXX="g++-5"; + export LINK="gcc-5"; + export LINKXX="g++-5"; fi diff --git a/README.md b/README.md index 1cd0908944..90805031e6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # JUST FOR EXPERIMENTS -TODO: auuto generate some stuffs here: \ No newline at end of file +TODO: auuto generate some stuffs here: diff --git a/docs/DATAFLOW.md b/docs/DATAFLOW.md index f87b36ff85..c87bae060d 100644 --- a/docs/DATAFLOW.md +++ b/docs/DATAFLOW.md @@ -39,4 +39,4 @@ end note stop @enduml -``` \ No newline at end of file +``` diff --git a/docs/README.md b/docs/README.md index b7dcf2a5f3..553875ff90 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,24 +4,23 @@ These are guidelines, not rules. :-) - * Use Node v10.7.0 for most local development. This is the earliest version we support. - * Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed - `Number.MAX_SAFE_INTEGER` - * Write tests. - * Do not use "Optional Chaining" (`obj?.prop`). I'd love to enable this, but TypeScript makes it hard to use bigint - literals and optional chaining together. - * Prefer using a single loop to functional chaining. - * Prefer performant code over your own developer experience. - * Document complex code. Explain why the code does what it does. - * Feel free to be clever, just document *why* you're being clever. If it's hard to read, comment _what_ the code does, - too. - * Add JSDoc comments to public class members where it makes sense. - * Before adding an external dependency check its code for quality, its # of external dependencies, its node version - support, and make sure it absolutely necessary. - * Pin all dependencies, even dev dependencies. - * Use npm; do not use yarn. - * Don't use web3, ethers, etc in ganache-core core code. (Tests are fine) - * Ensure a smooth development experience on Windows, Mac, and Linux. - * Do not use bash scripts. - * Do not use CLI commands in npm scripts or build scripts that aren't available by default on supported platforms. - +- Use Node v10.7.0 for most local development. This is the earliest version we support. +- Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed + `Number.MAX_SAFE_INTEGER` +- Write tests. +- Do not use "Optional Chaining" (`obj?.prop`). I'd love to enable this, but TypeScript makes it hard to use bigint + literals and optional chaining together. +- Prefer using a single loop to functional chaining. +- Prefer performant code over your own developer experience. +- Document complex code. Explain why the code does what it does. +- Feel free to be clever, just document _why_ you're being clever. If it's hard to read, comment _what_ the code does, + too. +- Add JSDoc comments to public class members where it makes sense. +- Before adding an external dependency check its code for quality, its # of external dependencies, its node version + support, and make sure it absolutely necessary. +- Pin all dependencies, even dev dependencies. +- Use npm; do not use yarn. +- Don't use web3, ethers, etc in ganache-core core code. (Tests are fine) +- Ensure a smooth development experience on Windows, Mac, and Linux. +- Do not use bash scripts. +- Do not use CLI commands in npm scripts or build scripts that aren't available by default on supported platforms. diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 03fa821c49..42421b5f17 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -294,6 +294,15 @@ } } }, + "@istanbuljs/nyc-config-typescript": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz", + "integrity": "sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2" + } + }, "@istanbuljs/schema": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", diff --git a/package.json b/package.json index 475b8d05b1..815ec142d7 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,20 @@ { "name": "ganache-core", "version": "2.2.1", - "main": "./index.js", + "main": "./dist/index.js", "engines": { "node": ">=10.7.0 <=14.0.0", "npm": ">=6.1.0" }, "directories": { - "lib": "./lib" + "lib": "./src", + "doc": "./docs", + "test": "./test" }, "scripts": { "build": "tsc", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --colors --require ts-node/register --require source-map-support/register --watch-extensions ts --recursive --check-leaks 'test/**.ts'" - }, - "nyc": { - "extension": [ - ".ts" - ], - "exclude": [ - "**/*.d.ts", - "test/**" - ] + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks 'test/**.ts'" }, "dependencies": { "@types/lodash.clonedeep": "4.5.6", @@ -48,6 +41,7 @@ "uWebSockets.js": "github:uNetworking/uWebSockets.js#v17.4.0" }, "devDependencies": { + "@istanbuljs/nyc-config-typescript": "1.0.1", "@types/mocha": "7.0.2", "@types/node": "13.13.2", "@types/secp256k1": "3.5.0", diff --git a/index.ts b/src/index.ts similarity index 97% rename from index.ts rename to src/index.ts index 0132ca50a8..9518e58dba 100644 --- a/index.ts +++ b/src/index.ts @@ -5,5 +5,5 @@ import Server from "./src/server"; export default { server: (options?: ServerOptions) => new Server(options), - provider: (options?: ProviderOptions) => Provider.initialize(options), + provider: (options?: ProviderOptions) => Provider.initialize(options) }; diff --git a/src/interfaces/IProvider.ts b/src/interfaces/IProvider.ts index fd23cde797..57b23fe520 100644 --- a/src/interfaces/IProvider.ts +++ b/src/interfaces/IProvider.ts @@ -1,12 +1,14 @@ import Emittery from "emittery"; -import { ILedger } from "./base-ledger"; +import {ILedger} from "./base-ledger"; import ProviderOptions from "../options/provider-options"; type KnownKeys = { - [K in keyof T]: string extends K ? never : number extends K ? never : K -} extends { [_ in keyof T]: infer U } ? U : never; + [K in keyof T]: string extends K ? never : number extends K ? never : K; +} extends {[_ in keyof T]: infer U} + ? U + : never; export interface IProvider { request: (method: KnownKeys, params?: any[]) => Promise; close: () => Promise; -} \ No newline at end of file +} diff --git a/src/interfaces/base-ledger.ts b/src/interfaces/base-ledger.ts index 511c6cb0fe..475bf63dba 100644 --- a/src/interfaces/base-ledger.ts +++ b/src/interfaces/base-ledger.ts @@ -1,7 +1,7 @@ export type Emitter = { - on(eventName: string, listener: (eventData?: any) => any): any - off(eventName: string, listener: (eventData?: any) => any): any - emit(eventName: string, eventData?: any): any + on(eventName: string, listener: (eventData?: any) => any): any; + off(eventName: string, listener: (eventData?: any) => any): any; + emit(eventName: string, eventData?: any): any; }; /** @@ -9,11 +9,11 @@ export type Emitter = { * All properties must be `async` callable or return a `Promise` */ export default class BaseLedger { - readonly [index: string]: (...args: any) => Promise; + readonly [index: string]: (...args: any) => Promise; } /** * Defines the interface for a Ledger. * All properties must be `async` callable or return a `Promise` */ -export interface ILedger extends BaseLedger { } +export interface ILedger extends BaseLedger {} diff --git a/src/interfaces/ledger-options.ts b/src/interfaces/ledger-options.ts index c6eed833fb..18c33cc8f9 100644 --- a/src/interfaces/ledger-options.ts +++ b/src/interfaces/ledger-options.ts @@ -4,5 +4,5 @@ import Account from "../types/account"; * Options that ledger implementations must implement */ export default interface ILedgerOptions { - accounts?: Account[] -} \ No newline at end of file + accounts?: Account[]; +} diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index ead14c56cd..5147563dd8 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -1,13 +1,13 @@ import Miner from "./miner"; import Database from "./database"; import Emittery from "emittery"; -import BlockManager, { Block } from "./components/block-manager"; +import BlockManager, {Block} from "./components/block-manager"; import TransactionManager from "./components/transaction-manager"; import Trie from "merkle-patricia-tree"; -import { BN } from "ethereumjs-util"; +import {BN} from "ethereumjs-util"; import Account from "../../types/account"; -import { promisify } from "util"; -import { Quantity, Data } from "../../types/json-rpc"; +import {promisify} from "util"; +import {Quantity, Data} from "../../types/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; import Heap from "../../utils/heap"; @@ -28,13 +28,13 @@ export enum Status { } type BlockchainOptions = { - db?: string | object, - db_path?: string, - accounts?: Account[], - hardfork?: string, - allowUnlimitedContractSize?: boolean, - gasLimit?: Quantity, - timestamp?: Date + db?: string | object; + db_path?: string; + accounts?: Account[]; + hardfork?: string; + allowUnlimitedContractSize?: boolean; + gasLimit?: Quantity; + timestamp?: Date; }; export default class Blockchain extends Emittery { @@ -45,20 +45,20 @@ export default class Blockchain extends Emittery { public accounts: AccountManager; public vm: any; public trie: Trie; - readonly #database: Database + readonly #database: Database; /** * Initializes the underlying Database and handles synchronization between * the ledger and the database. - * + * * Emits a `ready` event once the database and * all dependencies are fully initialized. - * @param options + * @param options */ constructor(options: BlockchainOptions) { super(); - const database = this.#database = new Database(options, this); + const database = (this.#database = new Database(options, this)); database.on("ready", async () => { // TODO: get the latest block from the database @@ -71,7 +71,11 @@ export default class Blockchain extends Emittery { const miner = new Miner(this.vm, options); this.transactions = new TransactionManager(this, database.transactions, options); - this.transactionReceipts = new Manager(this, database.transactionReceipts, TransactionReceipt); + this.transactionReceipts = new Manager( + this, + database.transactionReceipts, + TransactionReceipt + ); this.accounts = new AccountManager(this, database.trie); await this.#initializeAccounts(options.accounts); @@ -85,9 +89,9 @@ export default class Blockchain extends Emittery { number: Quantity.from(previousNumber + 1n).toBuffer(), gasLimit: options.gasLimit.toBuffer(), timestamp: this.#currentTime(), - parentHash: previousHeader.hash(), + parentHash: previousHeader.hash() }); - } + }; const instamining = true; if (instamining) { this.transactions.transactionPool.on("drain", async (pending: Map>) => { @@ -112,9 +116,9 @@ export default class Blockchain extends Emittery { const block = this.blocks.createBlock({ parentHash: previousHeader.hash(), number: Quantity.from(previousNumber + 1n).toBuffer(), - // coinbase: + // coinbase: timestamp: this.#currentTime(), - // difficulty: + // difficulty: gasLimit: options.gasLimit.toBuffer(), transactionsTrie: blockData.transactionsTrie.root, receiptTrie: blockData.receiptTrie.root, @@ -127,12 +131,7 @@ export default class Blockchain extends Emittery { blockData.blockTransactions.forEach((tx: Transaction, i: number) => { const hash = tx.hash(); // todo: clean up transction extra data stuffs because this is gross: - const extraData = [ - ...tx.raw, - block.value.hash(), - block.value.header.number, - Quantity.from(i).toBuffer() - ]; + const extraData = [...tx.raw, block.value.hash(), block.value.header.number, Quantity.from(i).toBuffer()]; const encodedTx = rlpEncode(extraData); this.transactions.set(hash, encodedTx); @@ -178,32 +177,31 @@ export default class Blockchain extends Emittery { }); vm.on("step", this.emit.bind(this, "step")); return vm; - } + }; - #initializeAccounts = async (accounts: Account[]): Promise => { + #initializeAccounts = async (accounts: Account[]): Promise => { const stateManager = this.vm.stateManager; const putAccount = promisify(stateManager.putAccount.bind(stateManager)); - const checkpoint = promisify(stateManager.checkpoint.bind(stateManager)) - const commit = promisify(stateManager.commit.bind(stateManager)) + const checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); + const commit = promisify(stateManager.commit.bind(stateManager)); await checkpoint(); const l = accounts.length; const pendingAccounts = Array(l); for (let i = 0; i < l; i++) { const account = accounts[i]; const ethereumJsAccount = new EthereumJsAccount(); - ethereumJsAccount.nonce = account.nonce.toBuffer(), - ethereumJsAccount.balance = account.balance.toBuffer() + (ethereumJsAccount.nonce = account.nonce.toBuffer()), (ethereumJsAccount.balance = account.balance.toBuffer()); pendingAccounts[i] = putAccount(account.address.toBuffer(), ethereumJsAccount); } await Promise.all(pendingAccounts); return commit(); - } + }; #initializeGenesisBlock = async (timestamp: Date, blockGasLimit: Quantity): Promise => { // create the genesis block const genesis = this.blocks.next({ // If we were given a timestamp, use it instead of the `_currentTime` - timestamp: ((timestamp as any) / 1000 | 0) || this.#currentTime(), + timestamp: ((timestamp as any) / 1000) | 0 || this.#currentTime(), gasLimit: blockGasLimit.toBuffer(), stateRoot: this.trie.root, number: "0x0" @@ -211,20 +209,20 @@ export default class Blockchain extends Emittery { // store the genesis block in the database return this.blocks.putBlock(genesis); - } + }; #currentTime = () => { // Take the floor of the current time return (Date.now() / 1000) | 0; - } + }; /** * Given a block number, find its hash in the database - * @param number + * @param number */ #blockNumberToHash = (number: BN): Promise => { return number.toString() as any; - } + }; public async queueTransaction(transaction: any): Promise { await this.transactions.push(transaction); @@ -235,7 +233,9 @@ export default class Blockchain extends Emittery { // TODO: this is just a prototype implementation const vm = this.vm.copy(); const stateManager = vm.stateManager; - const settingStateRootProm = promisify(stateManager.setStateRoot.bind(stateManager))(parentBlock.value.header.stateRoot); + const settingStateRootProm = promisify(stateManager.setStateRoot.bind(stateManager))( + parentBlock.value.header.stateRoot + ); transaction.block = block.value; transaction.caller = transaction.from; await settingStateRootProm; @@ -252,7 +252,7 @@ export default class Blockchain extends Emittery { // cause a segfault due to a race condition between a db write and the close // call. if (this.#state === Status.starting) { - await new Promise((resolve) => { + await new Promise(resolve => { this.on("start", resolve); }); } diff --git a/src/ledgers/ethereum/components/account-manager.ts b/src/ledgers/ethereum/components/account-manager.ts index f208ad56e6..3dc8ba96a5 100644 --- a/src/ledgers/ethereum/components/account-manager.ts +++ b/src/ledgers/ethereum/components/account-manager.ts @@ -3,25 +3,25 @@ import Address from "../../../types/address"; import Trie from "merkle-patricia-tree/baseTrie"; import Blockchain from "../blockchain"; import Tag from "../../../types/tags"; -import { LevelUp } from "levelup"; +import {LevelUp} from "levelup"; export default class AccountManager { - #blockchain: Blockchain; - #trie: LevelUp; - constructor(blockchain: Blockchain, trie: LevelUp) { - this.#blockchain = blockchain; - this.#trie = trie; - } + #blockchain: Blockchain; + #trie: LevelUp; + constructor(blockchain: Blockchain, trie: LevelUp) { + this.#blockchain = blockchain; + this.#trie = trie; + } - public async get(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { - const blockchain = this.#blockchain; - const block = await blockchain.blocks.get(blockNumber); - const trieCopy = new Trie(this.#trie, block.value.header.stateRoot); - return new Promise((resolve, reject) => { - trieCopy.get(address.toBuffer(), (err, data)=>{ - if(err) return reject(err); - resolve(new Account(data)); - }); - }); - } + public async get(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + const blockchain = this.#blockchain; + const block = await blockchain.blocks.get(blockNumber); + const trieCopy = new Trie(this.#trie, block.value.header.stateRoot); + return new Promise((resolve, reject) => { + trieCopy.get(address.toBuffer(), (err, data) => { + if (err) return reject(err); + resolve(new Account(data)); + }); + }); + } } diff --git a/src/ledgers/ethereum/components/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts index 07bc6175a8..20f9a95722 100644 --- a/src/ledgers/ethereum/components/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -3,141 +3,137 @@ import Manager from "./manager"; import Tag from "../../../types/tags"; import levelup from "levelup"; import Blockchain from "../blockchain"; -import { Quantity, Data } from "../../../types/json-rpc"; +import {Quantity, Data} from "../../../types/json-rpc"; import Transaction from "../../../types/transaction"; import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; export default class BlockManager extends Manager { - /** - * The earliest block - */ - public earliest: Block; - - /** - * The latest block - */ - public latest: Block; - - /** - * The next block - */ - public pending: Block; - - constructor(blockchain: Blockchain, base: levelup.LevelUp) { - super(blockchain, base, Block); - - blockchain.on("open", () => { - // TODO: get the last key, set as "earliest" - // TODO: get the first last key, set as "latest" - }); - } + /** + * The earliest block + */ + public earliest: Block; - /** - * Gets or creates the next block (which might be the *pending* block). Uses the values in the optional `header` object to create the block - * @param header The values to set on the block's header. These typically come from the parent block. - */ - next(header?: {}) { - if (!this.pending) { - this.pending = this.createBlock(header); - } - return this.pending; - } + /** + * The latest block + */ + public latest: Block; - /** - * Creates a Block object with the specified header values - * @param header - */ - createBlock(header: {}): Block { - const block = new Block(null, this); - // TODO: make better - Object.assign(block.value.header, header); - return block; - } + /** + * The next block + */ + public pending: Block; - async getNumberFromHash(hash: string | Buffer | Tag): Promise { - return this.base.get(Data.from(hash).toBuffer()); - } + constructor(blockchain: Blockchain, base: levelup.LevelUp) { + super(blockchain, base, Block); + + blockchain.on("open", () => { + // TODO: get the last key, set as "earliest" + // TODO: get the first last key, set as "latest" + }); + } - async getByHash(hash: string | Buffer | Tag): Promise { - const number = await this.getNumberFromHash(hash); - return super.get(number); + /** + * Gets or creates the next block (which might be the *pending* block). Uses the values in the optional `header` object to create the block + * @param header The values to set on the block's header. These typically come from the parent block. + */ + next(header?: {}) { + if (!this.pending) { + this.pending = this.createBlock(header); } + return this.pending; + } + + /** + * Creates a Block object with the specified header values + * @param header + */ + createBlock(header: {}): Block { + const block = new Block(null, this); + // TODO: make better + Object.assign(block.value.header, header); + return block; + } - async get(tagOrBlockNumber: string | Buffer | Tag): Promise { - if (typeof tagOrBlockNumber === "string") { - const tag = Tag.normalize(tagOrBlockNumber as Tag); - switch (tag) { - case Tag.LATEST: - return this.latest; - case undefined: - case null: - // the key is probably a hex string, let nature takes its course. + async getNumberFromHash(hash: string | Buffer | Tag): Promise { + return this.base.get(Data.from(hash).toBuffer()); + } + + async getByHash(hash: string | Buffer | Tag): Promise { + const number = await this.getNumberFromHash(hash); + return super.get(number); + } + + async get(tagOrBlockNumber: string | Buffer | Tag): Promise { + if (typeof tagOrBlockNumber === "string") { + const tag = Tag.normalize(tagOrBlockNumber as Tag); + switch (tag) { + case Tag.LATEST: + return this.latest; + case undefined: + case null: + // the key is probably a hex string, let nature takes its course. break; - case Tag.PENDING: - return this.pending; - case Tag.EARLIEST: - return this.earliest; - default: - // this probably can't happen. but if someone passed something like - // `toString` in as a block tag and it got this far... maybe we'd - // get here... - throw new Error(`Invalid block Tag: ${tagOrBlockNumber}`); - } + case Tag.PENDING: + return this.pending; + case Tag.EARLIEST: + return this.earliest; + default: + // this probably can't happen. but if someone passed something like + // `toString` in as a block tag and it got this far... maybe we'd + // get here... + throw new Error(`Invalid block Tag: ${tagOrBlockNumber}`); } - - return super.get(tagOrBlockNumber); } - /** - * Writes the block object to the underlying database. - * @param block - */ - async putBlock(block: Block) { - let key = block.value.header.number; - if (Buffer.isBuffer(key) && key.equals(Buffer.from([]))){ - key = Buffer.from([0]); - } - const secondaryKey = block.value.header.hash(); - const value = block.value.serialize(true); - await Promise.all([ - super.set(secondaryKey, key), - super.set(key, value) - ]); - return block; + return super.get(tagOrBlockNumber); + } + + /** + * Writes the block object to the underlying database. + * @param block + */ + async putBlock(block: Block) { + let key = block.value.header.number; + if (Buffer.isBuffer(key) && key.equals(Buffer.from([]))) { + key = Buffer.from([0]); } + const secondaryKey = block.value.header.hash(); + const value = block.value.serialize(true); + await Promise.all([super.set(secondaryKey, key), super.set(key, value)]); + return block; + } } export class Block { - public readonly manager: BlockManager; - public readonly value: EthereumJsBlock; - constructor(raw: Buffer, manager: BlockManager) - { - const common = {common: new Common("mainnet", "istanbul")}; - if (raw) { - const data = rlpDecode(raw) as any as [Buffer[], Buffer[], Buffer[]]; - this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, common); - const rawTransactions = data[1]; - - // parse transactions so we can use our own transaction class - for (let i = 0; i < rawTransactions.length; i++) { - const tx = new Transaction(rawTransactions[i]); - this.value.transactions.push(tx) - } - } else { - this.value = new EthereumJsBlock(null, common); + public readonly manager: BlockManager; + public readonly value: EthereumJsBlock; + constructor(raw: Buffer, manager: BlockManager) { + const common = {common: new Common("mainnet", "istanbul")}; + if (raw) { + const data = (rlpDecode(raw) as any) as [Buffer[], Buffer[], Buffer[]]; + this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, common); + const rawTransactions = data[1]; + + // parse transactions so we can use our own transaction class + for (let i = 0; i < rawTransactions.length; i++) { + const tx = new Transaction(rawTransactions[i]); + this.value.transactions.push(tx); } - - this.manager = manager; + } else { + this.value = new EthereumJsBlock(null, common); } - getTxFn = (include = false): (tx: Transaction) => {[key: string] : string} | Data => { + this.manager = manager; + } + + getTxFn = (include = false): ((tx: Transaction) => {[key: string]: string} | Data) => { if (include) { - return (tx: Transaction) => tx.toJSON(this) + return (tx: Transaction) => tx.toJSON(this); } else { return (tx: Transaction) => Data.from(tx.hash()); } - } + }; toJSON(includeFullTransactions = false) { const header = this.value.header; diff --git a/src/ledgers/ethereum/components/manager.ts b/src/ledgers/ethereum/components/manager.ts index dd6eb8347f..d5d7a648f3 100644 --- a/src/ledgers/ethereum/components/manager.ts +++ b/src/ledgers/ethereum/components/manager.ts @@ -1,9 +1,9 @@ import levelup from "levelup"; -import { Data } from "../../../types/json-rpc"; +import {Data} from "../../../types/json-rpc"; import Blockchain from "../blockchain"; const NOTFOUND = 404; -export type Instantiable = { new(...args: any[]): T }; +export type Instantiable = {new (...args: any[]): T}; export default class Manager { protected blockchain: Blockchain; @@ -18,8 +18,8 @@ export default class Manager { if (typeof key === "string") { key = Data.from(key).toBuffer(); } - - return this.base.get(key).catch(e =>{ + + return this.base.get(key).catch(e => { if (e.status === NOTFOUND) return null; throw e; }); @@ -32,4 +32,4 @@ export default class Manager { set(key: Buffer, value: Buffer): Promise { return this.base.put(key, value); } -} \ No newline at end of file +} diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index 7fc0755b5d..949c45dcf7 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -2,18 +2,18 @@ import Emittery from "emittery"; import Blockchain from "../blockchain"; import Heap from "../../../utils/heap"; import Transaction from "../../../types/transaction"; -import { Data, Quantity } from "../../../types/json-rpc"; +import {Data, Quantity} from "../../../types/json-rpc"; export type TransactionPoolOptions = { /** * TODO: use this value. */ - gasPrice?: Quantity, + gasPrice?: Quantity; /** * Minimum gas price to enforce for acceptance into the pool */ - gasLimit?: Quantity + gasLimit?: Quantity; }; function byNonce(values: Transaction[], a: number, b: number) { @@ -26,7 +26,7 @@ export default class TransactionPool extends Emittery { /** * Minimum price bump percentage to replace an already existing transaction (nonce) */ - public priceBump: bigint = 10n + public priceBump: bigint = 10n; #blockchain: Blockchain; constructor(blockchain: Blockchain, options: TransactionPoolOptions) { @@ -73,7 +73,7 @@ export default class TransactionPool extends Emittery { const thisNonce = Quantity.from(currentPendingTx.nonce).toBigInt(); if (thisNonce === transactionNonce) { const gasPrice = Quantity.from(currentPendingTx.gasPrice).toBigInt(); - const thisPricePremium = gasPrice + ((gasPrice * priceBump) / 100n); + const thisPricePremium = gasPrice + (gasPrice * priceBump) / 100n; // TODO: how do we surface these transaction failures to the caller?! @@ -138,7 +138,12 @@ export default class TransactionPool extends Emittery { } } - #drainQueued = (origin: string, queuedOriginTransactions: Heap, executableOriginTransactions: Heap, transactionNonce: bigint) => { + #drainQueued = ( + origin: string, + queuedOriginTransactions: Heap, + executableOriginTransactions: Heap, + transactionNonce: bigint + ) => { // Now we need to drain any queued transacions that were previously // not executable due to nonce gaps into the origin's queue... if (queuedOriginTransactions) { @@ -167,11 +172,10 @@ export default class TransactionPool extends Emittery { } } - // notify listeners (the miner, probably) that we have executables // transactions ready for it this.emit("drain", this.executables); - } + }; validateTransaction = (transaction: Transaction): Error => { // Check the transaction doesn't exceed the current block limit gas. @@ -193,7 +197,7 @@ export default class TransactionPool extends Emittery { } return null; - } + }; #validateTransactor = async (transaction: Transaction, transactor: any): Promise => { // Transactor should have enough funds to cover the costs @@ -206,10 +210,10 @@ export default class TransactionPool extends Emittery { if (transactorNonce == null) { transactorNonce = -1n; } - const transactionNonce = (Quantity.from(transaction.nonce).toBigInt() || 0n); + const transactionNonce = Quantity.from(transaction.nonce).toBigInt() || 0n; if (transactorNonce >= transactionNonce) { return new Error("Transaction nonce is too low"); } return null; - } -} \ No newline at end of file + }; +} diff --git a/src/ledgers/ethereum/database.ts b/src/ledgers/ethereum/database.ts index 610cc22c96..325521e40a 100644 --- a/src/ledgers/ethereum/database.ts +++ b/src/ledgers/ethereum/database.ts @@ -1,13 +1,13 @@ -import { AbstractLevelDOWN } from 'abstract-leveldown'; +import {AbstractLevelDOWN} from "abstract-leveldown"; import Emittery from "emittery"; -import { dir, setGracefulCleanup } from "tmp-promise"; +import {dir, setGracefulCleanup} from "tmp-promise"; import levelup from "levelup"; import Blockchain from "./blockchain"; const leveldown = require("leveldown"); const sub = require("subleveldown"); const encode = require("encoding-down"); -type DatabaseOptions = {db?: string | object, db_path?: string}; +type DatabaseOptions = {db?: string | object; db_path?: string}; setGracefulCleanup(); const tmpOptions = {prefix: "ganache-core_", unsafeCleanup: true}; @@ -35,7 +35,7 @@ export default class Database extends Emittery { * event. * @param options Supports one of two options: `db` (a leveldown compliant * store instance) or `db_path` (the path to store/read the db instance) - * @param blockchain + * @param blockchain */ constructor(options: DatabaseOptions, blockchain: Blockchain) { super(); @@ -44,9 +44,9 @@ export default class Database extends Emittery { this.blockchain = blockchain; this.#initialize(); } - + #initialize = async () => { - const levelupOptions: any = { valueEncoding: "binary" }; + const levelupOptions: any = {valueEncoding: "binary"}; const store = this.#options.db; let db; if (store) { @@ -79,17 +79,17 @@ export default class Database extends Emittery { // don't continue if we closed while we were waiting for it to open if (this.#closed) return this.#cleanup(); - + this.blocks = sub(db, "b", levelupOptions); this.transactions = sub(db, "t", levelupOptions); this.transactionReceipts = sub(db, "r", levelupOptions); return this.emit("ready"); - } + }; /** * Call `batch` to batch `put` and `del` operations within the same - * event loop tick of the provided function. All db operations within the + * event loop tick of the provided function. All db operations within the * batch _must_ be executed synchronously. * @param fn {Function} Within this function's event loop tick, all `put` and * `del` database operations are applied in a single atomic operation. This @@ -140,18 +140,12 @@ export default class Database extends Emittery { /** * Cleans up the database connections and our tmp directory. */ - #cleanup = async() => { + #cleanup = async () => { const db = this.db; if (db) { await db.close(); - await Promise.all( - [ - this.blocks.close(), - this.transactions.close(), - this.trie.close() - ] - ); + await Promise.all([this.blocks.close(), this.transactions.close(), this.trie.close()]); } return new Promise(resolve => this.#cleanupDirectory(resolve)); - } + }; } diff --git a/src/ledgers/ethereum/index.ts b/src/ledgers/ethereum/index.ts index e401c98415..aaa72466f4 100644 --- a/src/ledgers/ethereum/index.ts +++ b/src/ledgers/ethereum/index.ts @@ -1,18 +1,18 @@ -import { Quantity, Data } from "../../types/json-rpc"; -import ProviderOptions, { getDefault as getDefaultProviderOptions } from "../../options/provider-options"; +import {Quantity, Data} from "../../types/json-rpc"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "../../options/provider-options"; import Emittery from "emittery"; -import Ledger from "../../ledgers/ethereum/ledger" -import { publicToAddress, privateToAddress } from "ethereumjs-util"; +import Ledger from "../../ledgers/ethereum/ledger"; +import {publicToAddress, privateToAddress} from "ethereumjs-util"; import Account from "../../types/account"; -import { mnemonicToSeedSync } from "bip39"; +import {mnemonicToSeedSync} from "bip39"; import Address from "../../types/address"; import JsonRpc from "../../servers/utils/jsonrpc"; import EthereumOptions from "../../ledgers/ethereum/options"; import cloneDeep from "lodash.clonedeep"; import secp256k1 from "secp256k1"; import HDKey from "hdkey"; -import { ILedger } from "../../interfaces/base-ledger"; -import { IProvider } from "../../interfaces/IProvider"; +import {ILedger} from "../../interfaces/base-ledger"; +import {IProvider} from "../../interfaces/IProvider"; const WEI = 1000000000000000000n; @@ -21,26 +21,33 @@ interface Callback { } type KnownKeys = { - [K in keyof T]: string extends K ? never : number extends K ? never : K -} extends { [_ in keyof T]: infer U } ? U : never; - -type RequestType = (eventDetails: {ledger: T, method: KnownKeys, params?: Parameters}) => ReturnType; - -export default class EthereumProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements IProvider { + [K in keyof T]: string extends K ? never : number extends K ? never : K; +} extends {[_ in keyof T]: infer U} + ? U + : never; + +type RequestType = (eventDetails: { + ledger: T; + method: KnownKeys; + params?: Parameters; +}) => ReturnType; + +export default class EthereumProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> + implements IProvider { #options: ProviderOptions; #ledger: Ledger; #wallet: HDKey; constructor(providerOptions?: ProviderOptions) { super(); - const _providerOptions = this.#options = getDefaultProviderOptions(providerOptions); + const _providerOptions = (this.#options = getDefaultProviderOptions(providerOptions)); this.#wallet = HDKey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); const accounts = this.#initializeAccounts(); // ethereum options' `accounts` are different than the provider options' // `accounts`, fix that up here: - const ethereumOptions = _providerOptions as any as EthereumOptions; + const ethereumOptions = (_providerOptions as any) as EthereumOptions; ethereumOptions.accounts = accounts; const emitter = this as any; this.#ledger = new Ledger(ethereumOptions, emitter); @@ -75,7 +82,7 @@ export default class EthereumProvider extends Emittery.Typed<{request: RequestTy accounts[i] = EthereumProvider.createAccount(Quantity.from(account.balance), privateKey, address); } } else { - const numerOfAccounts =_providerOptions.total_accounts; + const numerOfAccounts = _providerOptions.total_accounts; if (numerOfAccounts) { accounts = Array(numerOfAccounts); const hdPath = this.#options.hdPath; @@ -93,20 +100,20 @@ export default class EthereumProvider extends Emittery.Typed<{request: RequestTy } } return accounts; - } - + }; + // TODO: this should probable be moved as well (see `initializeAccounts` above) static createAccount(balance: Quantity, privateKey: Data, address?: Address) { address = address || Address.from(privateToAddress(privateKey.toBuffer())); - + const account = new Account(address); account.privateKey = privateKey; account.balance = balance; - + return account; } - public getOptions(){ + public getOptions() { return cloneDeep(this.#options); } @@ -127,25 +134,24 @@ export default class EthereumProvider extends Emittery.Typed<{request: RequestTy method = payload.method as KnownKeys; params = payload.params; - this - .emit("request", {ledger: this.#ledger, method, params}) - .then(([result]) => void process.nextTick(callback, null, JsonRpc.Response( - payload.id, - JSON.parse(JSON.stringify(result)) - )) + this.emit("request", {ledger: this.#ledger, method, params}) + .then( + ([result]) => + void process.nextTick(callback, null, JsonRpc.Response(payload.id, JSON.parse(JSON.stringify(result)))) ) - .catch((err) => void process.nextTick(callback, err)); - } - else { + .catch(err => void process.nextTick(callback, err)); + } else { throw new Error( "No callback provided to provider's send function. As of web3 1.0, provider.send " + - "is no longer synchronous and must be passed a callback as its final argument." + "is no longer synchronous and must be passed a callback as its final argument." ); } const _options = this.#options; if (_options.verbose) { - _options.logger.log(` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}`); + _options.logger.log( + ` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}` + ); } return response; @@ -171,5 +177,5 @@ export default class EthereumProvider extends Emittery.Typed<{request: RequestTy public close = async () => { await this.emit("close"); return; - } + }; } diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/ledger.ts index 77ecbf0954..7b6d83ba55 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/ledger.ts @@ -1,12 +1,12 @@ //#region Imports import BaseLedger, {Emitter} from "../../interfaces/base-ledger"; import EthereumOptions from "./options"; -import { Data, Quantity, IndexableData } from "../../types/json-rpc"; +import {Data, Quantity, IndexableData} from "../../types/json-rpc"; import Blockchain from "./blockchain"; import Tag from "../../types/tags"; -import Address, { IndexableAddress } from "../../types/address"; +import Address, {IndexableAddress} from "../../types/address"; import Transaction from "../../types/transaction"; -import { Block } from "./components/block-manager"; +import {Block} from "./components/block-manager"; import Wallet from "./wallet"; import Account from "ethereumjs-account"; import {decode as rlpDecode} from "rlp"; @@ -19,7 +19,7 @@ import {name, version} from "../../../package.json"; //#region Constants const BUFFER_EMPTY = Buffer.allocUnsafe(0); const BUFFER_ZERO = Buffer.from([0]); -const CLIENT_VERSION = `EthereumJS ${name}/v${version}/ethereum-js` +const CLIENT_VERSION = `EthereumJS ${name}/v${version}/ethereum-js`; const PROTOCOL_VERSION = Data.from("0x3f"); const RPCQUANTITY_ZERO = Quantity.from("0x0"); //#endregion @@ -47,11 +47,11 @@ export default class Ledger extends BaseLedger { constructor(options: EthereumOptions, emitter: Emitter) { super(); - const opts = this[_options] = options; + const opts = (this[_options] = options); this[_wallet] = new Wallet(opts); - const blockchain = this[_blockchain] = new Blockchain(options); + const blockchain = (this[_blockchain] = new Blockchain(options)); blockchain.on("start", () => emitter.emit("ready")); emitter.on("close", async () => await blockchain.stop()); } @@ -63,7 +63,7 @@ export default class Ledger extends BaseLedger { */ async web3_clientVersion(): Promise { return CLIENT_VERSION; - }; + } /** * Returns Keccak-256 (not the standardized SHA3-256) of the given data. @@ -72,7 +72,7 @@ export default class Ledger extends BaseLedger { */ async web3_sha3(string: string): Promise { return Data.from(createKeccakHash("keccak256").update(string).digest()); - }; + } //#endregion //#region net @@ -113,7 +113,7 @@ export default class Ledger extends BaseLedger { /** * Returns an object with data about the sync status or false. * @returns An object with sync status data or false, when not syncing: - * startingBlock: {bigint} - The block at which the import started (will + * startingBlock: {bigint} - The block at which the import started (will * only be reset, after the sync reached his head) * currentBlock: {bigint} - The current block, same as eth_blockNumber * highestBlock: {bigint} - The estimated highest block @@ -140,7 +140,7 @@ export default class Ledger extends BaseLedger { const block = await this[_blockchain].blocks.get(number); return block.toJSON(transactions); } - + /** * Returns information about a block by block hash. * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in th e default block parameter. @@ -148,8 +148,8 @@ export default class Ledger extends BaseLedger { * @returns Block */ async eth_getBlockByHash(hash: string | Buffer, transactions = false) { - const block = await this[_blockchain].blocks.getByHash(hash); - return block.toJSON(transactions); + const block = await this[_blockchain].blocks.getByHash(hash); + return block.toJSON(transactions); } /** @@ -161,7 +161,7 @@ export default class Ledger extends BaseLedger { const data = rlpDecode(rawBlock); return (data[1] as any).length; } - + /** * Returns the number of transactions in a block from a block matching the given block hash. * @param hash DATA, 32 Bytes - hash of a block. @@ -265,10 +265,7 @@ export default class Ledger extends BaseLedger { * @param blockNumber integer block number, or the string "latest", "earliest" * or "pending", see the default block parameter */ - async eth_getBalance( - address: IndexableAddress, - blockNumber: Buffer | Tag = Tag.LATEST - ): Promise { + async eth_getBalance(address: IndexableAddress, blockNumber: Buffer | Tag = Tag.LATEST): Promise { const chain = this[_blockchain]; const account = await chain.accounts.get(Address.from(address), blockNumber); return account.balance; @@ -289,16 +286,21 @@ export default class Ledger extends BaseLedger { const blockProm = this[_blockchain].blocks.getRaw(blockNumber); const trie = this[_blockchain].trie.copy(); - const getFromTrie = (address: Buffer): Promise => new Promise((resolve, reject) => { - trie.get(address, (err, data) => { - if(err) return reject(err); - resolve(data); + const getFromTrie = (address: Buffer): Promise => + new Promise((resolve, reject) => { + trie.get(address, (err, data) => { + if (err) return reject(err); + resolve(data); + }); }); - }); const block = await blockProm; if (!block) return Data.from("0x"); - const blockData = rlpDecode(block) as any as [[Buffer, Buffer, Buffer, Buffer /* stateRoot */] /* header */, Buffer[], Buffer[]]; + const blockData = (rlpDecode(block) as any) as [ + [Buffer, Buffer, Buffer, Buffer /* stateRoot */] /* header */, + Buffer[], + Buffer[] + ]; const headerData = blockData[0]; const blockStateRoot = headerData[3]; trie.root = blockStateRoot; @@ -322,14 +324,19 @@ export default class Ledger extends BaseLedger { const addressData = await addressDataPromise; // An address's stateRoot is stored in the 3rd rlp entry - trie.root = (rlpDecode(addressData) as any as [Buffer /*nonce*/, Buffer /*amount*/, Buffer /*stateRoot*/, Buffer /*codeHash*/])[2]; + trie.root = ((rlpDecode(addressData) as any) as [ + Buffer /*nonce*/, + Buffer /*amount*/, + Buffer /*stateRoot*/, + Buffer /*codeHash*/ + ])[2]; const value = await getFromTrie(paddedPosBuff); return Data.from(value); } /** * Returns the information about a transaction requested by transaction hash. - * + * * @param transactionHash 32 Bytes - hash of a transaction */ async eth_getTransactionByHash(transactionHash: string): Promise { @@ -350,7 +357,7 @@ export default class Ledger extends BaseLedger { const blockchain = this[_blockchain]; const transactionPromise = blockchain.transactions.get(transactionHash); const receiptPromise = blockchain.transactionReceipts.get(transactionHash); - const blockPromise = transactionPromise.then(t => t ? blockchain.blocks.get(t._blockNum) : null); + const blockPromise = transactionPromise.then(t => (t ? blockchain.blocks.get(t._blockNum) : null)); const [transaction, receipt, block] = await Promise.all([transactionPromise, receiptPromise, blockPromise]); if (receipt && block && transaction) { return receipt.toJSON(block, transaction); @@ -361,7 +368,7 @@ export default class Ledger extends BaseLedger { /** * Creates new message call transaction or a contract creation, if the data field contains code. - * @param transaction + * @param transaction * @returns The transaction hash */ async eth_sendTransaction(transaction: any): Promise { @@ -428,7 +435,7 @@ export default class Ledger extends BaseLedger { /** * Creates new message call transaction or a contract creation for signed transactions. - * @param transaction + * @param transaction * @returns The transaction hash */ async eth_sendRawTransaction(transaction: any): Promise { diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index 6d15bec2a4..cb8fd839b2 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -1,18 +1,23 @@ import params from "../../types/params"; import Heap from "../../utils/heap"; import Transaction from "../../types/transaction"; -import { Quantity, Data } from "../../types/json-rpc"; -import { promisify } from "util"; +import {Quantity, Data} from "../../types/json-rpc"; +import {promisify} from "util"; import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; import Block from "ethereumjs-block"; import VM from "ethereumjs-vm"; -import { RunTxResult } from "ethereumjs-vm/dist/runTx"; +import {RunTxResult} from "ethereumjs-vm/dist/runTx"; import {encode as rlpEncode} from "rlp"; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); -function replaceFromHeap(priced: Heap, source: Heap, pending: Map>, key: string) { +function replaceFromHeap( + priced: Heap, + source: Heap, + pending: Map>, + key: string +) { // get the next best for this account, removing from the source Heap: const next = source.shift(); if (next) { @@ -26,8 +31,8 @@ function replaceFromHeap(priced: Heap, source: Heap, p } type MinerOptions = { - gasLimit?: Quantity -} + gasLimit?: Quantity; +}; function byPrice(values: Transaction[], a: number, b: number) { return Quantity.from(values[a].gasPrice) > Quantity.from(values[b].gasPrice); @@ -60,7 +65,7 @@ export default class Miner extends Emittery { } /** - * + * * @param pending A live Map of pending transactions from the transaction * pool. The miner will update this Map by removing the best transactions * and putting them in a block. @@ -85,7 +90,7 @@ export default class Miner extends Emittery { const blockTransactions: Transaction[] = []; let blockGasLeft = this.#options.gasLimit.toBigInt(); - + let counter = 0; const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); @@ -107,7 +112,7 @@ export default class Miner extends Emittery { // `replace` this top transaction with the next top transaction from the same // origin. let best: Transaction; - while (best = priced.peek()) { + while ((best = priced.peek())) { // if the current best transaction can't possibly fit in this block // go ahead and run the next best transaction, ignoring all other // pending transactions from this account for this block. @@ -134,7 +139,7 @@ export default class Miner extends Emittery { let result: RunTxResult; try { result = await this.#vm.runTx(runArgs); - } catch(err) { + } catch (err) { await this.#revert(); const errorMessage = err.message; if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { @@ -174,8 +179,8 @@ export default class Miner extends Emittery { } blockTransactions[counter] = best; - - counter++ + + counter++; // if we don't have enough gas left for even the smallest of // transactions we're done @@ -205,7 +210,7 @@ export default class Miner extends Emittery { // TODO: this transaction should probably be validated again...? console.log(transaction); }); - + this.emit("block", blockData); // reset the miner (this sets _isMining back to false) @@ -223,19 +228,19 @@ export default class Miner extends Emittery { coinbase: block.header.coinbase, timestamp: block.header.timestamp, difficulty: block.header.difficulty, - gasLimit: block.header.gasLimit, + gasLimit: block.header.gasLimit } as any); this.mine(this.#pending, nextBlock); this.#pending = null; } } - + #reset = () => { this.#origins.clear(); this.#priced.clear(); this.#isMining = false; this.#currentlyExecutingPrice = 0n; - } + }; #setPricedHeap = (pending: Map>) => { const origins = this.#origins; @@ -250,7 +255,7 @@ export default class Miner extends Emittery { priced.push(next); } } - } + }; #updatePricedHeap = (pending: Map>) => { const origins = this.#origins; @@ -267,7 +272,7 @@ export default class Miner extends Emittery { const price = Quantity.from(next.gasPrice).toBigInt(); if (this.#currentlyExecutingPrice < price) { // don't insert a transaction into the miner's `priced` heap - // if it will be better than its last + // if it will be better than its last continue; } const origin = Data.from(next.from).toString(); @@ -281,5 +286,5 @@ export default class Miner extends Emittery { heap.removeBest(); } } - } + }; } diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index f9c748a9cc..853f94ec5a 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,9 +1,22 @@ import Options from "../../options/provider-options"; import Account from "../../types/account"; -type EthereumOptions = Pick & { - timestamp: Date, - accounts: Account[] +type EthereumOptions = Pick< + Options, + | "defaultTransactionGasLimit" + | "chainId" + | "networkId" + | "gasPrice" + | "unlocked_accounts" + | "allowUnlimitedContractSize" + | "hardfork" + | "gasLimit" + | "db" + | "db_path" + | "secure" +> & { + timestamp: Date; + accounts: Account[]; }; export default EthereumOptions; diff --git a/src/ledgers/ethereum/wallet.ts b/src/ledgers/ethereum/wallet.ts index a33ba7b437..53ae3310c4 100644 --- a/src/ledgers/ethereum/wallet.ts +++ b/src/ledgers/ethereum/wallet.ts @@ -1,8 +1,8 @@ -import { Data } from "../../types/json-rpc"; +import {Data} from "../../types/json-rpc"; import Address from "../../types/address"; import EthereumOptions from "./options"; import Account from "../../types/account"; -const { toChecksumAddress } = require("ethereumjs-util"); +import {toChecksumAddress} from "ethereumjs-util"; export default class Wallet { readonly accounts: Address[]; @@ -18,7 +18,7 @@ export default class Wallet { //#region Configure Known and Unlocked Accounts this.coinbase = accounts[0]; const l = accounts.length; - const accountsCache = this.accounts = Array(l); + const accountsCache = (this.accounts = Array(l)); for (let i = 0; i < l; i++) { const account = accounts[i]; const address = account.address; @@ -54,7 +54,7 @@ export default class Wallet { // to `123`, and there is probably an error on the user's side we'd // want to uncover. const index = (arg as any) - 0; - // if we don't have a valid number, or the number isn't an valid JS + // if we don't have a valid number, or the number isn't an valid JS // integer (no bigints or decimals, please), throw an error. if (!Number.isSafeInteger(index)) { throw new Error(`Invalid value in unlocked_accounts: ${arg}`); @@ -68,21 +68,16 @@ export default class Wallet { case "number": const account = accounts[arg]; if (account == null) { - throw new Error( - `Account at index ${arg} not found. Max index available is ${l - 1}.` - ); + throw new Error(`Account at index ${arg} not found. Max index available is ${l - 1}.`); } address = account.address.toString().toLowerCase(); break; default: - throw new Error( - `Invalid value specified in unlocked_accounts` - ); + throw new Error(`Invalid value specified in unlocked_accounts`); } unlockedAccounts.add(address); } } //#endregion - } -} \ No newline at end of file +} diff --git a/src/options/options.ts b/src/options/options.ts index a524e3a36f..2b22685816 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -5,191 +5,197 @@ interface Logger { log(message?: any, ...optionalParams: any[]): void; } -// Okay, so a "bug" in TS treats types with the same shape as having the same +// Okay, so a "bug" in TS treats types with the same shape as having the same // name, so Intellisense would say that AccountType requires `[Address, Address]` // instead of `[Address, PrivateKey]`, flip flopping like this "fixes" it. -type Account = {balance: string, secretKey?: string}; +type Account = {balance: string; secretKey?: string}; export default interface Options { - ledger?: ILedger, + ledger?: ILedger; /** * Array of Accounts. Each object should have a balance key with a hexadecimal - * value. The key secretKey can also be specified, which represents the + * value. The key secretKey can also be specified, which represents the * account's private key. If no secretKey, the address is auto-generated with * the given balance. If specified, the key is used to determine the account's * address. */ - accounts?: Account[], + accounts?: Account[]; /** * Output VM opcodes for debugging. Defaults to `false` */ - debug?: boolean, + debug?: boolean; /** * An object, like console, that implements a log() function. */ - logger?: Logger, + logger?: Logger; /** * Use a specific HD wallet mnemonic to generate initial addresses. */ - mnemonic?: string, + mnemonic?: string; /** * Use arbitrary data to generate the HD wallet mnemonic to be used. */ - seed?: string, + seed?: string; /** * The default account balance, specified in ether. Defaults to `100` ether */ - default_balance_ether?: bigint, + default_balance_ether?: bigint; /** * Number of accounts to generate at startup. Default to `10`. */ - total_accounts?: number, + total_accounts?: number; /** - * When a string, same as --fork option above. Can also be a Web3 Provider + * When a string, same as --fork option above. Can also be a Web3 Provider * object, optionally used in conjunction with the fork_block_number */ - fork?: string | object, + fork?: string | object; /** - * Block number the provider should fork from, when the fork option is - * specified. If the fork option is specified as a string including the @ - * sign and a block number, the block number in the fork parameter takes + * Block number the provider should fork from, when the fork option is + * specified. If the fork option is specified as a string including the @ + * sign and a block number, the block number in the fork parameter takes * precedence. */ - fork_block_number?: string | bigint, + fork_block_number?: string | bigint; /** * The currently configured chain id, a value used in replay-protected * transaction signing as introduced by EIP-155. Default's to `1337` */ - chainId?: string | number, + chainId?: string | number; /** * Alias of `networkId`. */ - netVersion?: string | number, - + netVersion?: string | number; + /** * Alias of `networkId`. */ - net_version?: string | number, + net_version?: string | number; /** * The id of the network returned by the RPC method `net_version`. * Defaults to the current timestamp (`Date.now()`). */ - networkId?: string | number, + networkId?: string | number; /** * Alias of `networkId`. */ - network_id?: string | number, + network_id?: string | number; /** * Date that the first block should start. Use this feature, along with the * `evm_increaseTime` RPC, to test time-dependent code. */ - time?: Date, + time?: Date; /** * Alias of `secure` */ - locked?: boolean, + locked?: boolean; /** * Lock available accounts by default (good for third party transaction signing). Defaults to `false`. */ - secure?: boolean, + secure?: boolean; /** * Array of addresses or address indexes specifying which accounts should be unlocked. Alias of unlockedAccounts */ - unlocked_accounts?: Array, + unlocked_accounts?: Array; /** - * Specify a path to a directory to save the chain database. If a database - * already exists, that chain will be initialized instead of creating a new + * Specify a path to a directory to save the chain database. If a database + * already exists, that chain will be initialized instead of creating a new * one. */ - db_path?: string, + db_path?: string; /** * Specify an alternative database instance, for instance MemDOWN. */ - db?: object, + db?: object; /** * Whether to report runtime errors from EVM code as RPC errors. - * This is `true` by default to replicate the error reporting behavior of + * This is `true` by default to replicate the error reporting behavior of * previous versions of ganache. */ - vmErrorsOnRPCResponse?: boolean, + vmErrorsOnRPCResponse?: boolean; /** * The hierarchical deterministic path to use when generating accounts. * Default: "m/44'/60'/0'/0/" */ - hdPath?: string, + hdPath?: string; /** * Allows unlimited contract sizes while debugging. By setting this to true, the check within the EVM for contract size limit of 24KB (see EIP-170) is bypassed. Setting this to true will cause ganache-core to behave differently than production environments. (default: false; ONLY set to true during debugging). */ - allowUnlimitedContractSize?: boolean, + allowUnlimitedContractSize?: boolean; /** - * Sets the default gas price for transactions if not otherwise specified. + * Sets the default gas price for transactions if not otherwise specified. * Must be specified as a hex string in wei. Defaults to "0x77359400", or 2 gwei. */ - gasPrice?: Quantity, + gasPrice?: Quantity; /** - * Sets the block gas limit. Must be specified as a hex string. Defaults to + * Sets the block gas limit. Must be specified as a hex string. Defaults to * "0x6691b7". */ - gasLimit?: Quantity, + gasLimit?: Quantity; - defaultTransactionGasLimit?: Quantity, + defaultTransactionGasLimit?: Quantity; /** - * + * */ - verbose?: boolean, + verbose?: boolean; /** - * + * */ - asyncRequestProcessing?: boolean, + asyncRequestProcessing?: boolean; - hardfork?: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier" -}; + hardfork?: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier"; +} -export const getDefault: (options: Options)=> Options = (options) => { +export const getDefault: (options: Options) => Options = options => { // TODO: convert to null propagation operator after updating TS to a version that supports it - const networkId = (options ? options.networkId || options.netVersion || options.network_id || options.net_version || Date.now() : Date.now()).toString(); - const chainId = options ? (options.chainId) || 1337 : 1337; + const networkId = (options + ? options.networkId || options.netVersion || options.network_id || options.net_version || Date.now() + : Date.now() + ).toString(); + const chainId = options ? options.chainId || 1337 : 1337; const secure = options ? options.secure || options.locked || false : false; - return Object.assign({ - chainId, - debug: false, - logger: {log: () => {}}, - default_balance_ether: 100n, - total_accounts: 10n, - networkId, - vmErrorsOnRPCResponse: true, - hdPath: "m/44'/60'/0'/0/", - allowUnlimitedContractSize: false, - gasPrice: new Quantity(2000000000), - gasLimit: new Quantity(6721975), - defaultTransactionGasLimit: new Quantity(90000), - verbose: false, - asyncRequestProcessing: true, - hardfork: "muirGlacier", - secure - }, options); -} + return Object.assign( + { + chainId, + debug: false, + logger: {log: () => {}}, + default_balance_ether: 100n, + total_accounts: 10n, + networkId, + vmErrorsOnRPCResponse: true, + hdPath: "m/44'/60'/0'/0/", + allowUnlimitedContractSize: false, + gasPrice: new Quantity(2000000000), + gasLimit: new Quantity(6721975), + defaultTransactionGasLimit: new Quantity(90000), + verbose: false, + asyncRequestProcessing: true, + hardfork: "muirGlacier", + secure + }, + options + ); +}; diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index f798069a11..b7e0db96d4 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -1,20 +1,20 @@ import Options, {getDefault as getDefaultOptions} from "./options"; import EthereumProvider from "../ledgers/ethereum"; -import { entropyToMnemonic } from "bip39"; -import seedrandom, { seedrandom_prng } from "seedrandom"; +import {entropyToMnemonic} from "bip39"; +import seedrandom, {seedrandom_prng} from "seedrandom"; export const Flavors = { ethereum: EthereumProvider }; export type Flavors = { - ethereum: EthereumProvider + ethereum: EthereumProvider; }; function randomBytes(length: number, rng: () => number) { const buf = Buffer.allocUnsafe(length); for (let i = 0; i < length; i++) { - buf[i] = rng() * 255 | 0; + buf[i] = (rng() * 255) | 0; } return buf; } @@ -25,7 +25,7 @@ const randomAlphaNumericString = (() => { return (length: number, rng: () => number) => { let text = ""; for (let i = 0; i < length; i++) { - text += alphabet[rng() * alphabetLength | 0]; + text += alphabet[(rng() * alphabetLength) | 0]; } return text; @@ -36,12 +36,12 @@ export default interface ProviderOptions extends Options { /** * Array of strings to installed subproviders */ - subProviders?: any[], + subProviders?: any[]; - flavor?: keyof typeof Flavors + flavor?: keyof typeof Flavors; } -export const getDefault : (options: ProviderOptions) => ProviderOptions = (options) => { +export const getDefault: (options: ProviderOptions) => ProviderOptions = options => { const _options = Object.assign( { subProviders: [], @@ -68,4 +68,4 @@ export const getDefault : (options: ProviderOptions) => ProviderOptions = (optio _options.mnemonic = entropyToMnemonic(_randomBytes); } return _options; -} +}; diff --git a/src/options/server-options.ts b/src/options/server-options.ts index 502f6bc9cf..a72f520a2f 100644 --- a/src/options/server-options.ts +++ b/src/options/server-options.ts @@ -1,29 +1,29 @@ import ProviderOptions, {getDefault as getDefaultProviderOptions} from "./provider-options"; -export { Flavors } from "./provider-options"; +export {Flavors} from "./provider-options"; export default interface ServerOptions extends ProviderOptions { /** * The number of milliseconds of inactivity the http server needs to wait for - * additional incoming data, after it has finished writing the last response, - * before a socket will be destroyed. This does not affect the websocket + * additional incoming data, after it has finished writing the last response, + * before a socket will be destroyed. This does not affect the websocket * server. - * + * * A value of 0 will disable the keep-alive timeout behavior on incoming connections. Defaults to `5000` - */ - keepAliveTimeout: number, + */ + keepAliveTimeout: number; - /** + /** * Port number to listen on when running as a server. Defaults to `8545` */ - port: number, + port: number; /** * Enable a websocket server. This is `true` by default. */ - ws: boolean + ws: boolean; } -export const getDefault : (options: ServerOptions) => ServerOptions = (options) => { +export const getDefault: (options: ServerOptions) => ServerOptions = options => { return Object.assign( { keepAliveTimeout: 5000, @@ -32,5 +32,4 @@ export const getDefault : (options: ServerOptions) => ServerOptions = (options) }, getDefaultProviderOptions(options as ProviderOptions) ) as ServerOptions; -} - +}; diff --git a/src/provider.ts b/src/provider.ts index 6182c77702..15f793bc7d 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -1,13 +1,13 @@ import Executor from "./utils/executor"; import RequestCoordinator from "./utils/request-coordinator"; -import ProviderOptions, { Flavors } from "./options/provider-options"; +import ProviderOptions, {Flavors} from "./options/provider-options"; import Emittery from "emittery"; export default class Provider extends Emittery { // TODO: set missing defaults automatically public static initialize(providerOptions: ProviderOptions = {flavor: "ethereum", asyncRequestProcessing: true}) { - const provider = new Flavors[providerOptions.flavor || "ethereum"](providerOptions);; - + const provider = new Flavors[providerOptions.flavor || "ethereum"](providerOptions); + // Set up our request coordinator to either use FIFO or or async request processing. // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it // for that (yet), instead of "all" (0) or just 1 as we are doing here: diff --git a/src/server.ts b/src/server.ts index b41edad5b8..df90839cba 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,10 +1,10 @@ import ServerOptions, {Flavors, getDefault as getDefaultServerOptions} from "./options/server-options"; -import uWS, { TemplatedApp, us_listen_socket } from "uWebSockets.js"; +import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; import Provider from "./provider"; import WebsocketServer from "./servers/ws-server"; import HttpServer from "./servers/http-server"; -import { ILedger } from "./interfaces/base-ledger"; +import {ILedger} from "./interfaces/base-ledger"; export enum Status { // These are bit flags @@ -12,7 +12,7 @@ export enum Status { opening = 3, closed = 4, closing = 12 -}; +} export default class Server { #app: TemplatedApp; @@ -23,7 +23,7 @@ export default class Server { #status = Status.closed; #websocketServer: WebsocketServer; - public get provider () { + public get provider() { return this.#provider; } @@ -32,17 +32,17 @@ export default class Server { } constructor(serverOptions?: T) { - const opts = this.#options = getDefaultServerOptions(serverOptions); - const prov = this.#provider = Provider.initialize(opts); + const opts = (this.#options = getDefaultServerOptions(serverOptions)); + const prov = (this.#provider = Provider.initialize(opts)); - const _app = this.#app = uWS.App(); + const _app = (this.#app = uWS.App()); if (this.#options.ws) { this.#websocketServer = new WebsocketServer(_app, prov, opts); } this.#httpServer = new HttpServer(_app, prov); } - + async listen(port: number, callback?: (err: Error) => void): Promise { let err: Error; // if open or opening @@ -50,13 +50,13 @@ export default class Server { err = new Error(`Server is already listening on port: ${port}`); } else { this.#status = Status.opening; - const _listenSocket = await new Promise((resolve) => { + const _listenSocket = await new Promise(resolve => { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); }); - + if (_listenSocket) { this.#status = Status.open; this.#listenSocket = _listenSocket; @@ -70,7 +70,7 @@ export default class Server { // support legacy callback style if (typeof callback === "function") { callback(err); - } else if (err){ + } else if (err) { throw err; } } diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 9b743f89c8..e1637f1a24 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -1,12 +1,12 @@ -import { TemplatedApp, HttpResponse, HttpRequest, RecognizedString } from "uWebSockets.js"; +import {TemplatedApp, HttpResponse, HttpRequest, RecognizedString} from "uWebSockets.js"; import ContentTypes from "./utils/content-types"; import Provider from "../provider"; -import JsonRpc from "./utils/jsonrpc" +import JsonRpc from "./utils/jsonrpc"; import HttpResponseCodes from "./utils/http-response-codes"; -import { IProvider } from "../interfaces/IProvider"; -import { ILedger } from "../interfaces/base-ledger"; +import {IProvider} from "../interfaces/IProvider"; +import {ILedger} from "../interfaces/base-ledger"; -const noop = () => { }; +const noop = () => {}; /** * uWS doesn't let us use the request after the request method has completed. @@ -14,8 +14,8 @@ const noop = () => { }; * know the status code until the provider returns asynchronously. * So this does request-related work immediately and returns a function to do the * rest of the work later. - * @param method - * @param request + * @param method + * @param request */ function prepareCORSResponseHeaders(method: string, request: HttpRequest) { // https://fetch.spec.whatwg.org/#http-requests @@ -60,12 +60,17 @@ function prepareCORSResponseHeaders(method: string, request: HttpRequest) { /// for valid preflight requests. response.writeHeader("Access-Control-Allow-Origin", origin); } - } + }; } - -function sendResponse(response: HttpResponse, statusCode: HttpResponseCodes, contentType?: RecognizedString, data?: RecognizedString, writeHeaders: (response: HttpResponse) => void = noop): void { - response.cork(()=>{ +function sendResponse( + response: HttpResponse, + statusCode: HttpResponseCodes, + contentType?: RecognizedString, + data?: RecognizedString, + writeHeaders: (response: HttpResponse) => void = noop +): void { + response.cork(() => { response.writeStatus(statusCode); writeHeaders(response); if (contentType) { @@ -81,17 +86,15 @@ export default class HttpServer { this.#provider = provider; // JSON-RPC routes... - app - .post("/", this.#handlePost) - .options("/", this.#handleOptions); + app.post("/", this.#handlePost).options("/", this.#handleOptions); // because Easter Eggs are fun... - app.get("/418", (response) => { + app.get("/418", response => { sendResponse(response, HttpResponseCodes.IM_A_TEAPOT, ContentTypes.PLAIN, "418 I'm a teapot"); }); // fallback routes... - app.any("/*", (response ,request) => { + app.any("/*", (response, request) => { const connectionHeader = request.getHeader("connection"); if (connectionHeader && connectionHeader.toLowerCase() === "upgrade") { // if we got here it means the websocket server wasn't enabled but @@ -122,10 +125,16 @@ export default class HttpServer { const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; payload = JsonRpc.Request(JSON.parse(message)); } catch (e) { - sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request: " + e.message, writeHeaders); + sendResponse( + response, + HttpResponseCodes.BAD_REQUEST, + ContentTypes.PLAIN, + "400 Bad Request: " + e.message, + writeHeaders + ); return; } - + const id = payload.id; const method = payload.method; switch (method) { @@ -133,12 +142,18 @@ export default class HttpServer { case "eth_subscribe": case "eth_unsubscribe": const error = JsonRpc.Error(id, "-32000", "notifications not supported"); - sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.JSON, JSON.stringify(error), writeHeaders); + sendResponse( + response, + HttpResponseCodes.BAD_REQUEST, + ContentTypes.JSON, + JSON.stringify(error), + writeHeaders + ); break; default: - // `await`ing the `provider.send` instead of using `then` causes uWS + // `await`ing the `provider.send` instead of using `then` causes uWS // to delay cleaning up the `request` object, which we don't neccessarily want to delay. - this.#provider.request(method, payload.params).then((result) => { + this.#provider.request(method, payload.params).then(result => { if (aborted) { // if the request has been aborted don't try sending (it'll // cause an `Unhandled promise rejection` if we try) @@ -157,15 +172,15 @@ export default class HttpServer { } } }); - } + }; #handleOptions = (response: HttpResponse, request: HttpRequest) => { // handle CORS preflight requests... const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); // OPTIONS responses don't have a body, so respond with `204 No Content`... sendResponse(response, HttpResponseCodes.NO_CONTENT, null, "", writeHeaders); - } + }; public close() { // currently a no op. } -}; +} diff --git a/src/servers/utils/content-types.ts b/src/servers/utils/content-types.ts index cbb8a65492..debf586fc9 100644 --- a/src/servers/utils/content-types.ts +++ b/src/servers/utils/content-types.ts @@ -1,5 +1,5 @@ enum ContentTypes { - PLAIN = "text/plain", - JSON = "application/json" + PLAIN = "text/plain", + JSON = "application/json" } export default ContentTypes; diff --git a/src/servers/utils/http-response-codes.ts b/src/servers/utils/http-response-codes.ts index d05d06ad6d..d0deaa7dad 100644 --- a/src/servers/utils/http-response-codes.ts +++ b/src/servers/utils/http-response-codes.ts @@ -1,9 +1,9 @@ -enum HttpResponseCodes{ - OK = "200", - NO_CONTENT = "204", - BAD_REQUEST = "400", - NOT_FOUND = "404", - METHOD_NOT_ALLOWED = "405", - IM_A_TEAPOT = "418" +enum HttpResponseCodes { + OK = "200", + NO_CONTENT = "204", + BAD_REQUEST = "400", + NOT_FOUND = "404", + METHOD_NOT_ALLOWED = "405", + IM_A_TEAPOT = "418" } -export default HttpResponseCodes; \ No newline at end of file +export default HttpResponseCodes; diff --git a/src/servers/utils/jsonrpc.ts b/src/servers/utils/jsonrpc.ts index 16513a6351..b1b90e34a4 100644 --- a/src/servers/utils/jsonrpc.ts +++ b/src/servers/utils/jsonrpc.ts @@ -1,57 +1,58 @@ -import { ILedger } from "../../interfaces/base-ledger"; +import {ILedger} from "../../interfaces/base-ledger"; type KnownKeys = { - [K in keyof T]: string extends K ? never : number extends K ? never : K - } extends { [_ in keyof T]: infer U } ? U : never; + [K in keyof T]: string extends K ? never : number extends K ? never : K; +} extends {[_ in keyof T]: infer U} + ? U + : never; namespace JsonRpc { - const jsonrpc = "2.0"; - type JsonRpc = { - id: string, - jsonrpc: string, - toString(): string - } - export type Request = JsonRpc & { - id: string, - jsonrpc: string, - method: KnownKeys, - params?: any[] + const jsonrpc = "2.0"; + type JsonRpc = { + id: string; + jsonrpc: string; + toString(): string; + }; + export type Request = JsonRpc & { + id: string; + jsonrpc: string; + method: KnownKeys; + params?: any[]; + }; + export type Response = JsonRpc & { + result: any; + }; + export type Error = JsonRpc & { + error: { + code: string; + message: any; }; - export type Response = JsonRpc & { - result: any + }; + export const Request = (json: any): Request => { + return { + id: json.id, + jsonrpc, + method: json.method, + params: json.params }; - export type Error = JsonRpc & { - error: { - code: string, - message: any - } + }; + export const Response = (id: string, result: any): Response => { + return { + id: id, + jsonrpc, + result }; - export const Request = (json: any): Request => { - return { - id: json.id, - jsonrpc, - method: json.method, - params: json.params - }; - } - export const Response = (id: string, result: any): Response => { - return { - id: id, - jsonrpc, - result - }; - } - export const Error = (id: string, code: string, message: any): Error => { - return { - id, - jsonrpc, - error: { - code, - message - } - }; - } - + }; + export const Error = (id: string, code: string, message: any): Error => { + return { + id, + jsonrpc, + error: { + code, + message + } + }; + }; } export default JsonRpc; diff --git a/src/servers/utils/websocket-close-codes.ts b/src/servers/utils/websocket-close-codes.ts index 7ddd05d9ac..1c821c2555 100644 --- a/src/servers/utils/websocket-close-codes.ts +++ b/src/servers/utils/websocket-close-codes.ts @@ -1,7 +1,7 @@ // 1001 indicates that an endpoint is "going away", such as a server // going down or a browser having navigated away from a page. enum WebSocketCloseCodes { - CLOSE_GOING_AWAY = 1001, - CLOSE_PROTOCOL_ERROR = 1002 -}; + CLOSE_GOING_AWAY = 1001, + CLOSE_PROTOCOL_ERROR = 1002 +} export default WebSocketCloseCodes; diff --git a/src/servers/views/components/app-tabs/marko-tag.json b/src/servers/views/components/app-tabs/marko-tag.json index 4af597513b..974cf52e6c 100644 --- a/src/servers/views/components/app-tabs/marko-tag.json +++ b/src/servers/views/components/app-tabs/marko-tag.json @@ -1,6 +1,6 @@ { - "@tabs []": { - "@label": "string", - "@active": "bool" - } - } \ No newline at end of file + "@tabs []": { + "@label": "string", + "@active": "bool" + } +} diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index 37c07b4b4e..be4b9af5e0 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -1,8 +1,8 @@ -import uWS, { TemplatedApp, WebSocket } from "uWebSockets.js"; +import uWS, {TemplatedApp, WebSocket} from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; import JsonRpc from "./utils/jsonrpc"; -import { IProvider } from "../interfaces/IProvider"; -import { ILedger } from "../interfaces/base-ledger"; +import {IProvider} from "../interfaces/IProvider"; +import {ILedger} from "../interfaces/base-ledger"; export default class WebsocketServer { #connections = new Set(); @@ -31,9 +31,9 @@ export default class WebsocketServer { // Don't bother trying to send to it now. if (!ws.closed) { const json = { - "id": payload.id, - "jsonrpc": "2.0", - "result": result + id: payload.id, + jsonrpc: "2.0", + result: result }; ws.send(JSON.stringify(json), isBinary, true); } @@ -52,4 +52,4 @@ export default class WebsocketServer { close() { this.#connections.forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); } -}; +} diff --git a/src/types/account.ts b/src/types/account.ts index caf220dcb3..d9f8e53cbc 100644 --- a/src/types/account.ts +++ b/src/types/account.ts @@ -1,6 +1,6 @@ -import { Data, Quantity } from "./json-rpc"; +import {Data, Quantity} from "./json-rpc"; import Address from "./address"; -import { rlp, KECCAK256_RLP, KECCAK256_NULL } from "ethereumjs-util"; +import {rlp, KECCAK256_RLP, KECCAK256_NULL} from "ethereumjs-util"; export default class Account { public address: Address; @@ -9,16 +9,16 @@ export default class Account { public nonce: Quantity; public stateRoot: Buffer = KECCAK256_RLP; public codeHash: Buffer = KECCAK256_NULL; - - constructor(address: Address) - constructor(buffer: Buffer) + + constructor(address: Address); + constructor(buffer: Buffer); constructor(arg: Address | Buffer) { - if (arg instanceof Address){ + if (arg instanceof Address) { this.address = arg; this.balance = new Quantity(0n); this.nonce = new Quantity(0n); - } else if (Buffer.isBuffer(arg)){ - const arr = rlp.decode(arg) as any as Buffer[]; + } else if (Buffer.isBuffer(arg)) { + const arr = (rlp.decode(arg) as any) as Buffer[]; this.nonce = Quantity.from(arr[0]); this.balance = Quantity.from(arr[1]); this.stateRoot = arr[2]; diff --git a/src/types/address.ts b/src/types/address.ts index bcc040eaef..4413a7fcee 100644 --- a/src/types/address.ts +++ b/src/types/address.ts @@ -4,4 +4,4 @@ const Address = Data; interface Address extends Data {} export type IndexableAddress = Address & IndexableJsonRpcType; -export default Address; \ No newline at end of file +export default Address; diff --git a/src/types/errors.ts b/src/types/errors.ts index b9c4133964..85c56f5790 100644 --- a/src/types/errors.ts +++ b/src/types/errors.ts @@ -1,26 +1,26 @@ export default { - /** - * Returned if the transaction contains an invalid signature. - */ - INVALID_SENDER: "invalid sender", - - /** - * Returned if the nonce of a transaction is lower than the one present in the local chain. - */ - NONCE_TOO_LOW: "nonce too low", + /** + * Returned if the transaction contains an invalid signature. + */ + INVALID_SENDER: "invalid sender", - /** - * Returned if a transaction's gas price is below the minimum configured for the transaction pool. - */ - UNDERPRICED: "transaction underpriced", + /** + * Returned if the nonce of a transaction is lower than the one present in the local chain. + */ + NONCE_TOO_LOW: "nonce too low", - /** - * Returned if the transaction is specified to use less gas than required to start the invocation. - */ - INTRINSIC_GAS_TOO_LOW: "intrinsic gas too low", + /** + * Returned if a transaction's gas price is below the minimum configured for the transaction pool. + */ + UNDERPRICED: "transaction underpriced", - /** - * Returned if a transaction's requested gas limit exceeds the maximum allowance of the current block. - */ - GAS_LIMIT: "exceeds block gas limit" -}; \ No newline at end of file + /** + * Returned if the transaction is specified to use less gas than required to start the invocation. + */ + INTRINSIC_GAS_TOO_LOW: "intrinsic gas too low", + + /** + * Returned if a transaction's requested gas limit exceeds the maximum allowance of the current block. + */ + GAS_LIMIT: "exceeds block gas limit" +}; diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/types/json-rpc/json-rpc-base-types.ts index 3888f8e5f5..e02834798e 100644 --- a/src/types/json-rpc/json-rpc-base-types.ts +++ b/src/types/json-rpc/json-rpc-base-types.ts @@ -1,9 +1,11 @@ import bigintToBuffer from "../../utils/bigint-to-buffer"; -export type IndexableJsonRpcType = string & { - new(value: T): IndexableJsonRpcType, - toString(): string -} +export type IndexableJsonRpcType< + T extends number | bigint | string | Buffer = number | bigint | string | Buffer +> = string & { + new (value: T): IndexableJsonRpcType; + toString(): string; +}; const EMPTY_BUFFER = Buffer.allocUnsafe(0); @@ -17,7 +19,7 @@ const inspect = Symbol.for("nodejs.util.inspect.custom"); export class BaseJsonRpcType { protected value: T; // used to make console.log debugging a little easier - private [inspect](_depth: number, _options: any):T { + private [inspect](_depth: number, _options: any): T { return this.value; } constructor(value: T) { @@ -43,25 +45,25 @@ export class BaseJsonRpcType { return bigintToBuffer(value as bigint); //onst value = (2n**64n); - var max = (2n**64n)-1n; + var max = 2n ** 64n - 1n; var val = value as bigint; var size = 4; var buff = new ArrayBuffer(size * 8); var view = new DataView(buff); - if(val > max) { - var long = val; - var index = size - 1; - while (long > 0) { - var byte = long & max; - view.setBigUint64(index * 8, byte); - long = (long - byte) / max; - index--; - } + if (val > max) { + var long = val; + var index = size - 1; + while (long > 0) { + var byte = long & max; + view.setBigUint64(index * 8, byte); + long = (long - byte) / max; + index--; + } } else { view.setBigUint64(0, val); } - return Buffer.from(buff.slice((index+1) * 8)); + return Buffer.from(buff.slice((index + 1) * 8)); }); break; case "string": { @@ -81,7 +83,7 @@ export class BaseJsonRpcType Buffer.from(value as string)); } @@ -124,9 +126,8 @@ export class BaseJsonRpcType = BaseJsonRpcType & IndexableJsonRpcType; diff --git a/src/types/json-rpc/json-rpc-data.ts b/src/types/json-rpc/json-rpc-data.ts index 14d3cf9361..89ee7d474b 100644 --- a/src/types/json-rpc/json-rpc-data.ts +++ b/src/types/json-rpc/json-rpc-data.ts @@ -1,7 +1,7 @@ -import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; -import { strCache, toStrings } from "./json-rpc-base-types"; +import {BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType} from "."; +import {strCache, toStrings} from "./json-rpc-base-types"; -function validateByteLength(byteLength?: number){ +function validateByteLength(byteLength?: number) { if (typeof byteLength !== "number" || byteLength < 0) { throw new Error(`byteLength must be a number greater than 0`); } @@ -9,7 +9,7 @@ function validateByteLength(byteLength?: number){ const byteLengths = new WeakMap(); export class Data extends BaseJsonRpcType { constructor(value: string | Buffer, byteLength?: number) { - if (typeof value === "bigint"){ + if (typeof value === "bigint") { throw new Error(`Cannot create a ${typeof value} as a Data`); } super(value); @@ -49,23 +49,23 @@ export class Data extends BaseJsonRpcType { return `0x${str}`; } } - public static from(value: T, byteLength?: number) { + public static from(value: T, byteLength?: number) { return new _Data(value, byteLength); } } -type $ = { - new(value: T, byteLength?: number): _Data & JsonRpcType, - from(value: T, byteLength?: number): _Data & JsonRpcType, - toString(byteLength?: number): string, - toBuffer(): Buffer -} +type $ = { + new (value: T, byteLength?: number): _Data & JsonRpcType; + from(value: T, byteLength?: number): _Data & JsonRpcType; + toString(byteLength?: number): string; + toBuffer(): Buffer; +}; const _Data = Data as $; interface _Data { - constructor(value: T, byteLength?: number): _Data - from(value: T, byteLength?: number): _Data, - toString(byteLength?: number): string, - toBuffer(): Buffer + constructor(value: T, byteLength?: number): _Data; + from(value: T, byteLength?: number): _Data; + toString(byteLength?: number): string; + toBuffer(): Buffer; } export type IndexableData = _Data & IndexableJsonRpcType; diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/types/json-rpc/json-rpc-quantity.ts index c3bee029f1..22fbfd90c2 100644 --- a/src/types/json-rpc/json-rpc-quantity.ts +++ b/src/types/json-rpc/json-rpc-quantity.ts @@ -1,16 +1,16 @@ -import { BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType } from "."; +import {BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType} from "."; const toBigIntBE = require("bigint-buffer").toBigIntBE; class Quantity extends BaseJsonRpcType { _nullable: boolean; public static from(value: number | bigint | string | Buffer, nullable = false) { - const q = new _Quantity(value, nullable); + const q = new _Quantity(value, nullable); q._nullable = nullable; return q; } public toString(): string { if (Buffer.isBuffer(this.value)) { - let val = this.value.toString("hex").replace(/^(?:0+(.+?))?$/, "$1");; + let val = this.value.toString("hex").replace(/^(?:0+(.+?))?$/, "$1"); if (val === "") { if (this._nullable) { @@ -35,7 +35,6 @@ class Quantity extends BaseJsonRpcType { // it because it is possible values returned from the VM could be negative // and stored in a buffer. - const length = value.byteLength; if (length === 0) { return null; @@ -44,7 +43,7 @@ class Quantity extends BaseJsonRpcType { if (length <= 6) { return BigInt(value.readUIntBE(0, length)); } - + let view: DataView; // Buffers that are 7 bytes need to be padded to 8 bytes if (length === 7) { @@ -70,21 +69,21 @@ class Quantity extends BaseJsonRpcType { return this.toBigInt(); } } -type $ = { - _nullable: boolean - new(value: T, nullable?: boolean): _Quantity & JsonRpcType, - from(value: T, nullable?: boolean): _Quantity & JsonRpcType, - toBigInt(): bigint, - toBuffer(): Buffer -} +type $ = { + _nullable: boolean; + new (value: T, nullable?: boolean): _Quantity & JsonRpcType; + from(value: T, nullable?: boolean): _Quantity & JsonRpcType; + toBigInt(): bigint; + toBuffer(): Buffer; +}; const _Quantity = Quantity as $; interface _Quantity { - _nullable: boolean - constructor(value: T, nullable?: boolean): _Quantity - from(): _Quantity, - toBigInt(): bigint, - toBuffer(): Buffer + _nullable: boolean; + constructor(value: T, nullable?: boolean): _Quantity; + from(): _Quantity; + toBigInt(): bigint; + toBuffer(): Buffer; } export default _Quantity; diff --git a/src/types/params.ts b/src/types/params.ts index 8e495e23c8..4562dddb1e 100644 --- a/src/types/params.ts +++ b/src/types/params.ts @@ -1,15 +1,15 @@ export default { - /** - * Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. - */ - TRANSACTION_GAS: 21000n, - - /** - * Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. - */ - TRANSACTION_DATA_NON_ZERO_GAS: 68n, - /** - * Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. - */ - TRANSACTION_DATA_ZERO_GAS: 4n - }; \ No newline at end of file + /** + * Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. + */ + TRANSACTION_GAS: 21000n, + + /** + * Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. + */ + TRANSACTION_DATA_NON_ZERO_GAS: 68n, + /** + * Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. + */ + TRANSACTION_DATA_ZERO_GAS: 4n +}; diff --git a/src/types/tags.ts b/src/types/tags.ts index dad438d946..d84768f768 100644 --- a/src/types/tags.ts +++ b/src/types/tags.ts @@ -10,7 +10,7 @@ enum _Tag { } namespace Tag { - export function normalize(tag: keyof typeof _Tag|Tag): Tag { + export function normalize(tag: keyof typeof _Tag | Tag): Tag { let t: Tag; if (typeof tag === "string") { t = (Tag)[tag.toUpperCase()]; diff --git a/src/types/transaction-receipt.ts b/src/types/transaction-receipt.ts index e55562135d..e1ed8aa785 100644 --- a/src/types/transaction-receipt.ts +++ b/src/types/transaction-receipt.ts @@ -1,7 +1,7 @@ import Transaction from "./transaction"; -import { Block } from "../ledgers/ethereum/components/block-manager"; -import { encode as rlpEncode, decode as rlpDecode } from "rlp"; -import { Data, Quantity } from "./json-rpc"; +import {Block} from "../ledgers/ethereum/components/block-manager"; +import {encode as rlpEncode, decode as rlpDecode} from "rlp"; +import {Data, Quantity} from "./json-rpc"; export default class TransactionReceipt { #contractAddress: Buffer; @@ -9,14 +9,14 @@ export default class TransactionReceipt { constructor(data?: Buffer) { if (data) { - const decoded = rlpDecode(data) as any as [Buffer, Buffer, Buffer, Buffer[], Buffer]; + const decoded = (rlpDecode(data) as any) as [Buffer, Buffer, Buffer, Buffer[], Buffer]; this.#init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4]); } } #init = (status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer = null) => { this.#raw = [status, gasUsed, logsBloom, logs]; this.#contractAddress = contractAddress; - } + }; static fromValues(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer) { const receipt = new TransactionReceipt(); receipt.#init(status, gasUsed, logsBloom, logs, contractAddress); diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 59e4fc9f95..285600e4d2 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -1,13 +1,13 @@ -import Errors from "./errors" -import { Data } from "./json-rpc/json-rpc-data"; -import { Quantity } from "./json-rpc"; +import Errors from "./errors"; +import {Data} from "./json-rpc/json-rpc-data"; +import {Quantity} from "./json-rpc"; import params from "./params"; -import { Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction } from "ethereumjs-tx"; +import {Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction} from "ethereumjs-tx"; import * as ethUtil from "ethereumjs-util"; import assert from "assert"; import {decode as rlpDecode} from "rlp"; -import { RunTxResult } from "ethereumjs-vm/dist/runTx"; -import { Block } from "../ledgers/ethereum/components/block-manager"; +import {RunTxResult} from "ethereumjs-vm/dist/runTx"; +import {Block} from "../ledgers/ethereum/components/block-manager"; import TransactionReceipt from "./transaction-receipt"; const MAX_UINT64 = (1n << 64n) - 1n; @@ -33,7 +33,7 @@ function configZeroableField(tx: any, fieldName: string, fieldLength = 32) { const descriptor = Object.getOwnPropertyDescriptor(tx, fieldName); // eslint-disable-next-line accessor-pairs Object.defineProperty(tx, fieldName, { - set: (v) => { + set: v => { descriptor.set.call(tx, v); v = ethUtil.toBuffer(v); assert(fieldLength >= v.length, `The field ${fieldName} must not have more ${fieldLength} bytes`); @@ -63,7 +63,7 @@ function fixProps(tx: any, data: any) { // and `null`/`undefined`. tx._originals = []; const fieldNames = ["nonce", "gasPrice", "gasLimit", "value"]; - fieldNames.forEach((fieldName) => configZeroableField(tx, fieldName, 32)); + fieldNames.forEach(fieldName => configZeroableField(tx, fieldName, 32)); // Ethereumjs-tx doesn't set the _chainId value whenever the v value is set, // which causes transaction signing to fail on transactions that include a @@ -72,7 +72,7 @@ function fixProps(tx: any, data: any) { const vDescriptors = Object.getOwnPropertyDescriptor(tx, "v"); // eslint-disable-next-line accessor-pairs Object.defineProperty(tx, "v", { - set: (v) => { + set: v => { vDescriptors.set.call(tx, v); // calculate chainId from signature const sigV = ethUtil.bufferToInt(tx.v); @@ -93,7 +93,7 @@ function fixProps(tx: any, data: any) { enumerable: true, configurable: true, get: tx.getSenderAddress.bind(tx), - set: (val) => { + set: val => { if (val) { tx._from = ethUtil.toBuffer(val); } else { @@ -128,7 +128,7 @@ function initData(tx: any, data: any) { // add in our hacked-in properties // which is the index in the block the transaciton // was mined in - if (data.length === tx._fields.length + 3){ + if (data.length === tx._fields.length + 3) { tx._index = data.pop(); tx._blockNum = data.pop(); tx._blockHash = data.pop(); @@ -210,9 +210,10 @@ class Transaction extends (EthereumJsTransaction as any) { } cost(): bigint { - return Quantity.from(this.gasPrice).toBigInt() - * Quantity.from(this.gasLimit).toBigInt() - + Quantity.from(this.value).toBigInt(); + return ( + Quantity.from(this.gasPrice).toBigInt() * Quantity.from(this.gasLimit).toBigInt() + + Quantity.from(this.value).toBigInt() + ); } /** @@ -377,21 +378,15 @@ class Transaction extends (EthereumJsTransaction as any) { const logsBloom = result.bloom.bitvector; const logs = vmResult.logs || []; - this._receipt = TransactionReceipt.fromValues( - status, - gasUsed, - logsBloom, - logs, - result.createdAddress - ); + this._receipt = TransactionReceipt.fromValues(status, gasUsed, logsBloom, logs, result.createdAddress); // returns RLP encoded data for use in a transaction trie return this._receipt.serialize(false); - } + }; getReceipt = () => { return this._receipt; - } -}; + }; +} export default Transaction; diff --git a/src/utils/bigint-to-buffer.ts b/src/utils/bigint-to-buffer.ts index 8f26a8f9a8..c40d6b2db4 100644 --- a/src/utils/bigint-to-buffer.ts +++ b/src/utils/bigint-to-buffer.ts @@ -3,13 +3,13 @@ try { const toBufferBE = require("bigint-buffer").toBufferBE; intToBuffer = (val: bigint) => { const buffer = toBufferBE(val, 128); - for (let i = 0; i < buffer.length - 1; i++) if (buffer[i]) return buffer.slice(i) - return buffer.slice(buffer.length - 1) - } -} catch(e) { + for (let i = 0; i < buffer.length - 1; i++) if (buffer[i]) return buffer.slice(i); + return buffer.slice(buffer.length - 1); + }; +} catch (e) { intToBuffer = (val: bigint): Buffer => { const hex = val.toString(16); return Buffer.from(hex.length % 2 ? hex : `0${hex}`); - } + }; } export default intToBuffer; diff --git a/src/utils/executor.ts b/src/utils/executor.ts index 46a2e790e6..c58cfaa38a 100644 --- a/src/utils/executor.ts +++ b/src/utils/executor.ts @@ -1,7 +1,6 @@ import {ILedger} from "../interfaces/base-ledger"; import Emittery from "emittery"; - export default class Executor extends Emittery { /** * The Executor handles execution of methods on the given Ledger @@ -15,7 +14,11 @@ export default class Executor extends Emittery { * @param methodName The name of the JSON-RPC method to execute. * @param params The params to pass to the JSON-RPC method. */ - public execute = async (ledger: T, methodName: M, params: Parameters): Promise> => { + public execute = async ( + ledger: T, + methodName: M, + params: Parameters + ): Promise> => { // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { @@ -31,5 +34,5 @@ export default class Executor extends Emittery { } throw new Error(`Invalid or unsupported method: ${methodName}`); - } + }; } diff --git a/src/utils/heap.ts b/src/utils/heap.ts index f4b9f79bb8..172644c46b 100644 --- a/src/utils/heap.ts +++ b/src/utils/heap.ts @@ -19,15 +19,15 @@ class Heap { public init(array: T[]) { this.array = array; - const length = this.length = array.length; - for (let i = ((length / 2) | 0) - 1; i >= 0;) { + const length = (this.length = array.length); + for (let i = ((length / 2) | 0) - 1; i >= 0; ) { this.down(i--, length); } } /** * Pushes a new element onto the heap - * @param value + * @param value */ public push(value: T) { const i = this.length++; @@ -61,18 +61,18 @@ class Heap { // if we are empty or about to be empty... if (length <= 1) { - if (length === 0) return; - const element = this.array[0]; - // finally, clear the array - this.clear(); - return element; + if (length === 0) return; + const element = this.array[0]; + // finally, clear the array + this.clear(); + return element; } // otherwise... - + // remember the best element const array = this.array; const best = array[0]; - const newLength = this.length = length - 1; + const newLength = (this.length = length - 1); // put our last element at the start of the heap array[0] = array[newLength]; // then sort from the new first element to the second to last element @@ -86,7 +86,7 @@ class Heap { * `replace(0, newValue);`. * If you call this on an empty heap (`this.size() === 0`) you may find * unexpected behavior. - * @param newValue + * @param newValue */ public replaceBest(newValue: T) { this.array[0] = newValue; @@ -94,11 +94,11 @@ class Heap { } /** - * Replaces the element at position `i` with the `newValue`. If the element at + * Replaces the element at position `i` with the `newValue`. If the element at * position `i` doesn't exist, or if `i < 0` or `i > this.size()` you may * find unexpected behavior. - * @param i - * @param newValue + * @param i + * @param newValue */ public replace(i: number, newValue: T) { this.array[i] = newValue; @@ -131,9 +131,9 @@ class Heap { const array = this.array; const length = this.length; if (length === 1) { - // finally, clear the array - this.length = array.length = 0; - return false; + // finally, clear the array + this.length = array.length = 0; + return false; } const newLength = --this.length; @@ -146,11 +146,11 @@ class Heap { /** * Re-establishes the heap ordering after the element at index `i` changes - * its value. Changing the value of the element at index `i` and then + * its value. Changing the value of the element at index `i` and then * calling fix is equivalent to, but faster than, calling * `remove(i); push(newValue);`. * The complexity is O(log n) where n = this.size(). - * @param i + * @param i */ public fix(i: number) { if (!this.down(i, this.length)) { @@ -160,7 +160,7 @@ class Heap { private up(j: number) { const less = this.less.bind(null, this.array); - for (let i: number; ((i = (j - 1) / 2 | 0), i !== j && less(j, i)); j = i) { + for (let i: number; (i = ((j - 1) / 2) | 0), i !== j && less(j, i); j = i) { this.swap(i, j); } } @@ -168,7 +168,7 @@ class Heap { private down(i0: number, l: number): boolean { const less = this.less.bind(null, this.array); let i = i0; - for (let j1: number; (j1 = 2 * i + 1) < l;) { + for (let j1: number; (j1 = 2 * i + 1) < l; ) { let j = j1; // left child let j2 = j1 + 1; if (j2 < l && less(j2, j1)) { @@ -196,12 +196,12 @@ class Heap { } /** - * Heap initialization helper for when you only know of a single item for the + * Heap initialization helper for when you only know of a single item for the * heap. - * @param item - * @param less + * @param item + * @param less */ - public static from(item: T, less: Comparator){ + public static from(item: T, less: Comparator) { const heap = new Heap(less); heap.array = [item]; heap.length = 1; diff --git a/src/utils/request-coordinator.ts b/src/utils/request-coordinator.ts index 32068e8e89..ad513d14ed 100644 --- a/src/utils/request-coordinator.ts +++ b/src/utils/request-coordinator.ts @@ -20,7 +20,7 @@ export default class RequestCoordinator { /** * Promise-based FIFO queue. - * @param limit The number of requests that can be processed at a time. + * @param limit The number of requests that can be processed at a time. * Default value is is no limit (`0`). */ constructor(limit: number) { @@ -34,7 +34,7 @@ export default class RequestCoordinator { */ public pause = () => { this.#paused = true; - } + }; /** * Resume processing. @@ -42,7 +42,7 @@ export default class RequestCoordinator { public resume = () => { this.#paused = false; this.#process(); - } + }; #process = () => { // if we aren't paused and the number of things we're processing is under @@ -55,19 +55,21 @@ export default class RequestCoordinator { this.#process(); }); } - } + }; /** * Insert a new function into the queue. */ public queue = (fn: (...args: any[]) => Promise, ...args: any[]): Promise => { - const promise = new Promise((resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { - const executor = () => { - return fn.apply(null, args).then(resolve).catch(reject); + const promise = new Promise( + (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { + const executor = () => { + return fn.apply(null, args).then(resolve).catch(reject); + }; + this.pending.push(executor); + this.#process(); } - this.pending.push(executor); - this.#process(); - }); + ); return promise; - } + }; } diff --git a/test/helpers/getProvider.ts b/test/helpers/getProvider.ts index 929c2131d8..56afed838e 100644 --- a/test/helpers/getProvider.ts +++ b/test/helpers/getProvider.ts @@ -4,10 +4,8 @@ import ProviderOptions from "../../src/options/provider-options"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; const GetProvider = (options: ProviderOptions = {flavor: "ethereum", mnemonic}) => { - return Ganache.provider(options) -} + return Ganache.provider(options); +}; export default GetProvider; -export { - Provider -} +export {Provider}; diff --git a/test/helpers/sleep.ts b/test/helpers/sleep.ts index eb7471261c..6e4a2e375b 100644 --- a/test/helpers/sleep.ts +++ b/test/helpers/sleep.ts @@ -1,3 +1,3 @@ -const sleep = (time: number = 100) => new Promise((resolve) => setTimeout(resolve, time)); +const sleep = (time: number = 100) => new Promise(resolve => setTimeout(resolve, time)); export default sleep; diff --git a/test/interface.ts b/test/interface.ts index 6826ba02b5..37e07e889d 100644 --- a/test/interface.ts +++ b/test/interface.ts @@ -1,11 +1,11 @@ -import Ganache from "../index" +import Ganache from "../index"; import * as assert from "assert"; describe("interface", () => { - it("has an interface", ()=>{ + it("has an interface", () => { assert.ok(Ganache.server); assert.ok(Ganache.provider); assert.strictEqual("Server" in Ganache, false); assert.strictEqual("Provider" in Ganache, false); - }) + }); }); diff --git a/test/ledger.ts b/test/ledger.ts index 931ed47c7c..41ad603f1a 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -1,8 +1,8 @@ import assert from "assert"; -import GetProvider, { Provider } from "./helpers/getProvider"; +import GetProvider, {Provider} from "./helpers/getProvider"; import sleep from "./helpers/sleep"; -import { IProvider } from "../src/interfaces/IProvider"; -import { ILedger } from "../src/interfaces/base-ledger"; +import {IProvider} from "../src/interfaces/IProvider"; +import {ILedger} from "../src/interfaces/base-ledger"; describe("ledger", () => { let provider: any; @@ -15,52 +15,69 @@ describe("ledger", () => { it("eth_blockNumber", async () => { const blockNumber = parseInt(await provider.request("eth_blockNumber"), 10); - await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); const nextBlockNumber = await provider.request("eth_blockNumber"); assert.equal(blockNumber, nextBlockNumber - 1); }); - it("eth_getBlockByNumber", async() => { - await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getBlockByNumber", async () => { + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); - const blocks = await Promise.all([provider.request("eth_getBlockByNumber", ["0x1", true]), provider.request("eth_getBlockByNumber", ["0x1"])]); + const blocks = await Promise.all([ + provider.request("eth_getBlockByNumber", ["0x1", true]), + provider.request("eth_getBlockByNumber", ["0x1"]) + ]); assert(blocks[0].hash, blocks[1].hash); }); - it("eth_getBlockByHash", async() => { - await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getBlockByHash", async () => { + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - const blocks = await Promise.all([provider.request("eth_getBlockByHash", [block.hash, true]), provider.request("eth_getBlockByHash", [block.hash])]); + const blocks = await Promise.all([ + provider.request("eth_getBlockByHash", [block.hash, true]), + provider.request("eth_getBlockByHash", [block.hash]) + ]); assert(blocks[0].hash, blocks[1].hash); - const counts = await Promise.all([provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]), provider.request("eth_getBlockTransactionCountByHash", [blocks[0].hash])]); + const counts = await Promise.all([ + provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]), + provider.request("eth_getBlockTransactionCountByHash", [blocks[0].hash]) + ]); assert(true); }); - it("eth_getBlockTransactionCountByHash", async() => { - await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getBlockTransactionCountByHash", async () => { + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); const block = await provider.request("eth_getBlockByNumber", ["0x1"]); @@ -69,12 +86,14 @@ describe("ledger", () => { assert(count, "1"); }); - it("eth_getBlockTransactionCountByNumber", async() => { - await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getBlockTransactionCountByNumber", async () => { + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); @@ -82,39 +101,53 @@ describe("ledger", () => { assert(count, "1"); }); - it("eth_getTransactionByBlockNumberAndIndex", async() => { - await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getTransactionByBlockNumberAndIndex", async () => { + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); const tx = await provider.request("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); - assert.equal(tx.hash, "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", "Unexpected transaction hash."); + assert.equal( + tx.hash, + "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", + "Unexpected transaction hash." + ); }); - it("eth_getTransactionByBlockHashAndIndex", async() => { - await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getTransactionByBlockHashAndIndex", async () => { + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); const block = await provider.request("eth_getBlockByNumber", ["0x1"]); const tx = await provider.request("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); - assert.equal(tx.hash, "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", "Unexpected transaction hash."); + assert.equal( + tx.hash, + "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", + "Unexpected transaction hash." + ); }); - it("eth_getUncleCountByBlockHash", async() => { - await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getUncleCountByBlockHash", async () => { + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); const block = await provider.request("eth_getBlockByNumber", ["0x1"]); @@ -123,12 +156,14 @@ describe("ledger", () => { assert(count, "0"); }); - it("eth_getUncleCountByBlockNumber", async() => { - await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getUncleCountByBlockNumber", async () => { + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); @@ -136,12 +171,14 @@ describe("ledger", () => { assert(count, "0"); }); - it("eth_getTransactionReceipt", async() => { - const hash = await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getTransactionReceipt", async () => { + const hash = await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); @@ -149,16 +186,18 @@ describe("ledger", () => { assert(receipt.transactionIndex, "0x0"); }); - it("eth_getTransactionByHash", async() => { - const hash = await provider.request("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + it("eth_getTransactionByHash", async () => { + const hash = await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects with the block is "mined" await sleep(); const tx = await provider.request("eth_getTransactionByHash", [hash]); assert(tx.transactionIndex, "0x0"); }); -}) +}); diff --git a/test/provider.ts b/test/provider.ts index 18b278ae8f..9acb546e2d 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -1,4 +1,4 @@ -import Ganache from "../index" +import Ganache from "../index"; import assert from "assert"; import Provider from "../src/ledgers/ethereum"; @@ -6,17 +6,17 @@ describe("provider", () => { const networkId = "1234"; let p: Provider; - beforeEach("set up", () =>{ + beforeEach("set up", () => { p = Ganache.provider({ network_id: networkId }); }); - it("works without passing options", async() => { + it("works without passing options", async () => { assert.doesNotThrow(() => Ganache.provider()); }); - it("it logs when `options.verbose` is `true`", async() => { + it("it logs when `options.verbose` is `true`", async () => { const logger = { log: (msg: string) => { assert.strictEqual(msg, " > net_version: undefined"); @@ -24,16 +24,14 @@ describe("provider", () => { }; const p = Ganache.provider({logger, verbose: true}); - logger.log = (msg) => { + logger.log = msg => { assert.strictEqual(msg, " > net_version: undefined", "doesn't work when no params"); }; await p.send("net_version"); - return new Promise(async (resolve) => { - logger.log = (msg) => { - const expected = " > web3_sha3: [\n" + - " > \"Tim is a swell guy.\"\n" + - " > ]"; + return new Promise(async resolve => { + logger.log = msg => { + const expected = " > web3_sha3: [\n" + ' > "Tim is a swell guy."\n' + " > ]"; assert.strictEqual(msg, expected, "doesn't work with params"); resolve(); }; @@ -41,11 +39,11 @@ describe("provider", () => { }); }).timeout(500); - it("it logs with options.verbose", async() => { + it("it logs with options.verbose", async () => { assert.doesNotThrow(() => Ganache.provider()); }); - it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async() => { + it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { const p = Ganache.provider(); const accounts = await p.send("eth_accounts"); // eth_accounts should always be faster than eth_getBalance; it should @@ -57,7 +55,7 @@ describe("provider", () => { assert.strictEqual(result.length, 10); }); - it("it processes requests in order when `asyncRequestProcessing` is false", async() => { + it("it processes requests in order when `asyncRequestProcessing` is false", async () => { const p = Ganache.provider({asyncRequestProcessing: false}); const accounts = await p.send("eth_accounts"); // eth_accounts should always be faster than eth_getBalance, but shouldn't @@ -70,13 +68,13 @@ describe("provider", () => { assert.strictEqual(result, "0x56bc75e2d63100000"); }); - it("generates predictable accounts when given a seed", async() => { + it("generates predictable accounts when given a seed", async () => { const p = Ganache.provider({seed: "temet nosce"}); const accounts = await p.request("eth_accounts"); assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); }); - it("gets balance", async() => { + it("gets balance", async () => { const accounts = await p.request("eth_accounts"); const balance = await p.request("eth_getBalance", [accounts[0]]); // TODO: this value is actually wrong! @@ -88,46 +86,60 @@ describe("provider", () => { assert.strictEqual(version, networkId); }); - it("returns things via legacy", async() => { - await new Promise((resolve) => { - const ret = p.send({ - id: "1", - jsonrpc: "2.0", - method: "net_version" - } as any, (_err: Error, result: any): void => { - assert.strictEqual(result.result, networkId); - resolve(); - }); + it("returns things via legacy", async () => { + await new Promise(resolve => { + const ret = p.send( + { + id: "1", + jsonrpc: "2.0", + method: "net_version" + } as any, + (_err: Error, result: any): void => { + assert.strictEqual(result.result, networkId); + resolve(); + } + ); assert.strictEqual(ret, undefined); }); - return new Promise((resolve) => { - const ret = p.sendAsync({ - id: "1", - jsonrpc: "2.0", - method: "net_version" - } as any, (_err: Error, result: any): void => { - assert.strictEqual(result.result, networkId); - resolve(); - }); + return new Promise(resolve => { + const ret = p.sendAsync( + { + id: "1", + jsonrpc: "2.0", + method: "net_version" + } as any, + (_err: Error, result: any): void => { + assert.strictEqual(result.result, networkId); + resolve(); + } + ); assert.strictEqual(ret, undefined); }); }); it("rejects invalid rpc methods", async () => { const illegalMethodNames = [ - "toString", "toValue", "__proto__", "prototype", "notAFunction", "", " ", - "constructor", + "toString", + "toValue", + "__proto__", + "prototype", + "notAFunction", + "", + " ", + "constructor" ]; - await Promise.all(illegalMethodNames.map((name: any) => { - return assert.rejects(p.request(name), { - message: `Invalid or unsupported method: ${name}` - }); - })); + await Promise.all( + illegalMethodNames.map((name: any) => { + return assert.rejects(p.request(name), { + message: `Invalid or unsupported method: ${name}` + }); + }) + ); // duck punch a property that shouldn't appear on the ledger. we test this // to make sure that 3rd party ledger implementations can't shoot themselves // in the foot on accident - it.skip("TODO: allow 'injecting' our own engine or ledger into a provider!", async () => { + it.skip("TODO: allow 'injecting' our own engine or ledger into a provider!", async () => { (p as any)._engine._ledger.__proto__.illegalProperty = true; await assert.rejects(p.request("illegalProperty" as any), { message: "Invalid or unsupported method: illegalProperty" @@ -138,33 +150,50 @@ describe("provider", () => { const circular = {} as any; circular.circular = circular; const illegalMethodTypes = [ - 123, Buffer.from([1]) as any as string, null, undefined, {}, [], - {foo: "bar"}, [1,2], new Date(), Infinity, NaN, circular + 123, + (Buffer.from([1]) as any) as string, + null, + undefined, + {}, + [], + {foo: "bar"}, + [1, 2], + new Date(), + Infinity, + NaN, + circular ]; - await Promise.all(illegalMethodTypes.map((methodType) => { - return assert.rejects( - new Promise((resolve, reject) => { - p.send({ - id: "1", - jsonrpc: "2.0", - method: methodType as any - } as any, (err: Error, result: any): void => { - if(err) { - reject(err); - } else { - resolve(result); - } - }) - }), - { - message: `Invalid or unsupported method: ${methodType}` - }); - })); + await Promise.all( + illegalMethodTypes.map(methodType => { + return assert.rejects( + new Promise((resolve, reject) => { + p.send( + { + id: "1", + jsonrpc: "2.0", + method: methodType as any + } as any, + (err: Error, result: any): void => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }), + { + message: `Invalid or unsupported method: ${methodType}` + } + ); + }) + ); // make sure we reject non-strings over the EIP-1193 send interface - illegalMethodTypes.map((methodType) => { + illegalMethodTypes.map(methodType => { assert.throws(() => p.send(methodType as any), { - message: "No callback provided to provider's send function. As of " + + message: + "No callback provided to provider's send function. As of " + "web3 1.0, provider.send is no longer synchronous and must be " + "passed a callback as its final argument." }); diff --git a/test/server.ts b/test/server.ts index 399862753c..761c649e91 100644 --- a/test/server.ts +++ b/test/server.ts @@ -1,4 +1,4 @@ -import Ganache from "../index" +import Ganache from "../index"; import * as assert from "assert"; import request from "superagent"; import WebSocket from "ws"; @@ -18,31 +18,31 @@ describe("server", () => { }; const logger = { log: (_message: string) => {} - } + }; let s: Server; - async function setup(options = { - network_id, - logger - } as ServerOptions) { + async function setup( + options = { + network_id, + logger + } as ServerOptions + ) { s = Ganache.server(options); return s.listen(port); - }; - async function teardown(){ - s && await s.close(); + } + async function teardown() { + s && (await s.close()); s = undefined; } describe("http", () => { - async function simpleTest(){ - const response = await request - .post('http://localhost:' + port) - .send(jsonRpcJson); + async function simpleTest() { + const response = await request.post("http://localhost:" + port).send(jsonRpcJson); assert.strictEqual(response.status, 200); const json = JSON.parse(response.text); assert.strictEqual(json.result, network_id); return response; } - + it("returns the net_version", async () => { await setup(); try { @@ -52,7 +52,7 @@ describe("server", () => { } }); - it("returns the net_version over a legacy-style connection listener", (done) => { + it("returns the net_version over a legacy-style connection listener", done => { s = Ganache.server({ network_id } as ServerOptions); @@ -69,7 +69,7 @@ describe("server", () => { it("fails to `.listen()` twice", async () => { await setup(); try { - // the call to `setup()` above calls `listen()` already. if we call it + // the call to `setup()` above calls `listen()` already. if we call it // again it should fail. await assert.rejects(s.listen(port), { message: `Server is already listening on port: ${port}` @@ -102,7 +102,7 @@ describe("server", () => { await assert.rejects(s2.listen(port), { message: `Failed to listen on port: ${port}` }); - } catch(e) { + } catch (e) { console.log(e); } finally { await teardown(); @@ -114,7 +114,7 @@ describe("server", () => { ws: false } as ServerOptions); try { - const ws = new WebSocket('ws://localhost:' + port); + const ws = new WebSocket("ws://localhost:" + port); await assert.rejects(new Promise((_, reject) => ws.on("error", reject)), { message: "Unexpected server response: 400" @@ -127,12 +127,12 @@ describe("server", () => { it("handles chunked requests (note: doesn't test `transfer-encoding: chunked`)", async () => { await setup(); try { - const req = request.post('http://localhost:' + port); - const json =JSON.stringify(jsonRpcJson); + const req = request.post("http://localhost:" + port); + const json = JSON.stringify(jsonRpcJson); // we have to set the content-length because we can't use // `Transfer-Encoding: chunked` with uWebSockets.js as of v15.9.0 - req.set('Content-Length', json.length.toString()); + req.set("Content-Length", json.length.toString()); await new Promise((resolve, reject) => { req.on("response", response => { @@ -154,7 +154,7 @@ describe("server", () => { } }); - it("fails to subscribe and unsubscribe over HTTP", async () =>{ + it("fails to subscribe and unsubscribe over HTTP", async () => { await setup(); const jsonRpcJson: any = { jsonrpc: "2.0", @@ -165,18 +165,12 @@ describe("server", () => { try { // TODO: should we expect a 200 OK response with an `error` property // in a json rpc body? Probably, because we _do_ already send one. :-/ - await assert.rejects(request - .post('http://localhost:' + port) - .send(jsonRpcJson) - , { - status: 400, - message: "Bad Request" + await assert.rejects(request.post("http://localhost:" + port).send(jsonRpcJson), { + status: 400, + message: "Bad Request" }); jsonRpcJson.method = "eth_unsubscribe"; - await assert.rejects(request - .post('http://localhost:' + port) - .send(jsonRpcJson) - , { + await assert.rejects(request.post("http://localhost:" + port).send(jsonRpcJson), { message: "Bad Request" }); } finally { @@ -187,7 +181,7 @@ describe("server", () => { it("returns a teapot", async () => { await setup(); try { - const result = await request.get('http://localhost:' + port + "/418").catch(e => e); + const result = await request.get("http://localhost:" + port + "/418").catch(e => e); assert.strictEqual(result.status, 418); assert.strictEqual(result.message, "I'm a Teapot"); } finally { @@ -199,8 +193,10 @@ describe("server", () => { await setup(); const methods = ["get", "post", "head", "options", "put", "delete", "patch", "trace"]; try { - const requests = methods.map(async (method) => { - const result = await (request as any)[method]('http://localhost:' + port + "/there-is-no-spoon").catch((e: any) => e); + const requests = methods.map(async method => { + const result = await (request as any) + [method]("http://localhost:" + port + "/there-is-no-spoon") + .catch((e: any) => e); assert.strictEqual(result.status, 404); assert.strictEqual(result.message, "Not Found"); }); @@ -215,7 +211,7 @@ describe("server", () => { try { const oldRequest = (s.provider as any).request; - const req = request.post('http://localhost:' + port); + const req = request.post("http://localhost:" + port); const abortPromise = new Promise(resolve => { (s.provider as any).request = () => { // abort the request object after intercepting the request @@ -224,11 +220,11 @@ describe("server", () => { // It takes 2 passes of the event loop to register the `abort` // server-side: setImmediate(setImmediate, () => { - // resolve the `provider.send` to make sure the server can - // handle _not_ responding to a request that has been aborted: - innerResolve(); - // and finally, resolve the `abort` promise: - resolve(); + // resolve the `provider.send` to make sure the server can + // handle _not_ responding to a request that has been aborted: + innerResolve(); + // and finally, resolve the `abort` promise: + resolve(); }); }); }; @@ -243,7 +239,6 @@ describe("server", () => { // now make sure we are still up and running: await simpleTest(); - } finally { await teardown(); } @@ -254,7 +249,7 @@ describe("server", () => { try { await s.close(); - const req = request.post('http://localhost:' + port); + const req = request.post("http://localhost:" + port); await assert.rejects(req.send(jsonRpcJson), { code: "ECONNREFUSED" }); @@ -264,25 +259,18 @@ describe("server", () => { }); describe("CORS", () => { - const optionsHeaders = [ - "Access-Control-Allow-Methods", - "Access-Control-Allow-Headers", - "Access-Control-Max-Age" - ]; - const baseHeaders = [ - "Access-Control-Allow-Credentials", - "Access-Control-Allow-Origin" - ]; - const allCorsHeaders = optionsHeaders.concat(baseHeaders);; - - it("does not return CORS headers for non-CORS requests", async() => { + const optionsHeaders = ["Access-Control-Allow-Methods", "Access-Control-Allow-Headers", "Access-Control-Max-Age"]; + const baseHeaders = ["Access-Control-Allow-Credentials", "Access-Control-Allow-Origin"]; + const allCorsHeaders = optionsHeaders.concat(baseHeaders); + + it("does not return CORS headers for non-CORS requests", async () => { await setup(); try { const resp = await simpleTest(); - allCorsHeaders.forEach((header) => { + allCorsHeaders.forEach(header => { assert.strictEqual( resp.header[header.toLowerCase()], - undefined , + undefined, `Non-CORS response should not contain header ${header}` ); }); @@ -291,62 +279,62 @@ describe("server", () => { } }); - it("returns only base CORS headers for post request with origin header", async() => { + it("returns only base CORS headers for post request with origin header", async () => { await setup(); const origin = "origin"; try { const resp = await request - .post('http://localhost:' + port) + .post("http://localhost:" + port) .set("origin", origin) .send(jsonRpcJson); - assert.strictEqual(resp.status, 200); - assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); - assert.strictEqual(resp.header["access-control-allow-origin"], origin); - optionsHeaders.forEach((header) => { - assert.strictEqual( - resp.header[header.toLowerCase()], - undefined , - `Non-CORS response should not contain header ${header}` - ); - }); + assert.strictEqual(resp.status, 200); + assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); + assert.strictEqual(resp.header["access-control-allow-origin"], origin); + optionsHeaders.forEach(header => { + assert.strictEqual( + resp.header[header.toLowerCase()], + undefined, + `Non-CORS response should not contain header ${header}` + ); + }); } finally { await teardown(); } }); - it("returns all CORS headers for request options request with origin header", async() => { + it("returns all CORS headers for request options request with origin header", async () => { await setup(); const origin = "origin"; try { const resp = await request - .options('http://localhost:' + port) + .options("http://localhost:" + port) .set("origin", origin) .send(jsonRpcJson); - assert.strictEqual(resp.status, 204); - assert.strictEqual(resp.header["access-control-allow-methods"], "POST"); - assert.strictEqual(resp.header["access-control-allow-origin"], origin); - assert.strictEqual(resp.header["access-control-max-age"], "600"); - assert.strictEqual(resp.header["content-length"], "0"); - assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); - assert.strictEqual(resp.header["access-control-allow-origin"], origin); + assert.strictEqual(resp.status, 204); + assert.strictEqual(resp.header["access-control-allow-methods"], "POST"); + assert.strictEqual(resp.header["access-control-allow-origin"], origin); + assert.strictEqual(resp.header["access-control-max-age"], "600"); + assert.strictEqual(resp.header["content-length"], "0"); + assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); + assert.strictEqual(resp.header["access-control-allow-origin"], origin); } finally { await teardown(); } }); - it("echos Access-Control-Request-Headers for options request", async() => { + it("echos Access-Control-Request-Headers for options request", async () => { await setup(); const origin = "origin"; const acrh = "origin, content-length, x-random"; try { const resp = await request - .options('http://localhost:' + port) + .options("http://localhost:" + port) .set("origin", origin) .set("Access-Control-Request-Headers", acrh) .send(jsonRpcJson); - assert.strictEqual(resp.status, 204); - assert.strictEqual(resp.header["access-control-allow-headers"], acrh); + assert.strictEqual(resp.status, 204); + assert.strictEqual(resp.header["access-control-allow-headers"], acrh); } finally { await teardown(); } @@ -359,26 +347,26 @@ describe("server", () => { afterEach("teardown", teardown); it("returns the net_version over a websocket", async () => { - const ws = new WebSocket('ws://localhost:' + port); + const ws = new WebSocket("ws://localhost:" + port); - const response: any = await new Promise((resolve) => { + const response: any = await new Promise(resolve => { ws.on("open", () => { ws.send(JSON.stringify(jsonRpcJson)); }); - ws.on('message', resolve); + ws.on("message", resolve); }); const json = JSON.parse(response); assert.strictEqual(json.result, network_id); }); it("returns the net_version over a websocket as binary", async () => { - const ws = new WebSocket('ws://localhost:' + port); - const response: any = await new Promise((resolve) => { + const ws = new WebSocket("ws://localhost:" + port); + const response: any = await new Promise(resolve => { ws.on("open", () => { - const strToAB = (str: string) => new Uint8Array(str.split('').map(c => c.charCodeAt(0))).buffer; + const strToAB = (str: string) => new Uint8Array(str.split("").map(c => c.charCodeAt(0))).buffer; ws.send(strToAB(JSON.stringify(jsonRpcJson))); }); - ws.on('message', resolve); + ws.on("message", resolve); }); assert.strictEqual(response.constructor, Buffer, "response doesn't seem to be a Buffer as expect"); const json = JSON.parse(response); @@ -386,23 +374,18 @@ describe("server", () => { }); it("doesn't crash when sending bad data over http", async () => { - await assert.rejects(request - .post('http://localhost:' + port) - .send("This is _not_ pudding.") - , { + await assert.rejects(request.post("http://localhost:" + port).send("This is _not_ pudding."), { message: "Bad Request" }); - const response = await request - .post('http://localhost:' + port) - .send(jsonRpcJson); - const json = JSON.parse(response.text) + const response = await request.post("http://localhost:" + port).send(jsonRpcJson); + const json = JSON.parse(response.text); assert.strictEqual(json.result, network_id); }); it("doesn't crash when sending bad data over websocket", async () => { - const ws = new WebSocket('ws://localhost:' + port); - const result: number = await new Promise((resolve) => { + const ws = new WebSocket("ws://localhost:" + port); + const result: number = await new Promise(resolve => { ws.on("open", () => { ws.on("close", resolve); ws.send("What is it?"); @@ -417,8 +400,8 @@ describe("server", () => { await s.close(); }; - const ws = new WebSocket('ws://localhost:' + port); - return new Promise((resolve, reject) => { + const ws = new WebSocket("ws://localhost:" + port); + return new Promise((resolve, reject) => { ws.on("open", () => { // If we get a message that means things didn't get closed as they // should have OR they are closing too late for some reason and @@ -437,15 +420,16 @@ describe("server", () => { }); it("can handle backpressure", async () => { - { // create tons of data to force websocket backpressure + { + // create tons of data to force websocket backpressure const huge = {} as any; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; (s.provider as any).request = async () => { return huge; }; } - - const ws = new WebSocket('ws://localhost:' + port); + + const ws = new WebSocket("ws://localhost:" + port); const oldLog = logger.log; try { let gotBackpressure = false; @@ -454,18 +438,18 @@ describe("server", () => { if (message.indexOf("WebSocket backpressure: ") === 0) { gotBackpressure = true; } - } + }; return await new Promise((resolve, reject) => { ws.on("open", () => { - ws.on("message", (_message) => { + ws.on("message", _message => { if (gotBackpressure) { resolve(); } else { reject( new Error( "Possible false positive: Didn't detect backpressure " + - " before receiving a message. Ensure `s.provider.send` is" + - " sending enough data." + " before receiving a message. Ensure `s.provider.send` is" + + " sending enough data." ) ); } diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 0a33c6713c..9b4182c9af 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -1,6 +1,6 @@ -import Ganache from "../index" +import Ganache from "../index"; import assert from "assert"; -import { Quantity } from "../src/types/json-rpc"; +import {Quantity} from "../src/types/json-rpc"; const solc = require("solc"); function compileSolidity(source: string) { @@ -38,47 +38,59 @@ describe("Accounts", () => { const expectedAddress = "0x604a95C9165Bc95aE016a5299dd7d400dDDBEa9A"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; - it("should respect the BIP99 mnemonic", async() => { - const options = { mnemonic }; + it("should respect the BIP99 mnemonic", async () => { + const options = {mnemonic}; const p = Ganache.provider(options); const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts[0], expectedAddress); }); - it("eth_sendTransaction", async() => { - const options = { mnemonic }; + it("eth_sendTransaction", async () => { + const options = {mnemonic}; const p = Ganache.provider(options); const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); - await p.send("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 1 - }]); + await p.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); // TODO: remove and replace with something that detects when the block is "mined" - await new Promise((resolve) => setTimeout(resolve, 3000)); + await new Promise(resolve => setTimeout(resolve, 3000)); const balance1_2 = await p.send("eth_getBalance", [accounts[1]]); assert.strictEqual(parseInt(balance1_1) + 1, parseInt(balance1_2)); }).timeout(5000); - it("should create its own mnemonic", async() => { + it("should create its own mnemonic", async () => { const p = Ganache.provider(); const options = p.getOptions(); assert.deepStrictEqual(typeof options.mnemonic, "string"); }); - it("shouldn't allow initialization without accounts", async() => { + it("shouldn't allow initialization without accounts", async () => { const options = {total_accounts: 0} as any; - assert.throws(()=>{ Ganache.provider(options); }, { - message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" - }); + assert.throws( + () => { + Ganache.provider(options); + }, + { + message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" + } + ); options.accounts = [] as any; - assert.throws(()=>{ Ganache.provider(options); }, { - message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" - }); + assert.throws( + () => { + Ganache.provider(options); + }, + { + message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" + } + ); }); it("sets up accounts", async () => { @@ -114,45 +126,53 @@ describe("Accounts", () => { locked: true, unlocked_accounts: ["0", 1] }); - + const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); const badSend = () => { - return p.send("eth_sendTransaction", [{ - from: accounts[2], - to: accounts[1], - value: 123 - }]); + return p.send("eth_sendTransaction", [ + { + from: accounts[2], + to: accounts[1], + value: 123 + } + ]); }; await assert.rejects(badSend, "Error: signer account is locked"); - await p.send("eth_sendTransaction", [{ - from: accounts[0], - to: accounts[1], - value: 123 - }]); + await p.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 123 + } + ]); - await new Promise((resolve) => setTimeout(resolve, 5000)); + await new Promise(resolve => setTimeout(resolve, 5000)); const balance1_2 = await p.send("eth_getBalance", [accounts[1]]); assert.strictEqual(BigInt(balance1_1) + 123n, BigInt(balance1_2)); const balance0_1 = await p.send("eth_getBalance", [accounts[0]]); - await p.send("eth_sendTransaction", [{ - from: accounts[1], - to: accounts[0], - value: 123 - }]); + await p.send("eth_sendTransaction", [ + { + from: accounts[1], + to: accounts[0], + value: 123 + } + ]); - await new Promise((resolve) => setTimeout(resolve, 5000)); + await new Promise(resolve => setTimeout(resolve, 5000)); const balance0_2 = await p.send("eth_getBalance", [accounts[0]]); assert.strictEqual(BigInt(balance0_1) + 123n, BigInt(balance0_2)); }).timeout(12000); it("deploys contracts", async () => { - const contract = await compileSolidity("pragma solidity ^0.6.1; contract Example { uint public value; event Event(); constructor() public { value = 5; emit Event(); } function getVal() public pure returns (uint8) { return 123; } }"); + const contract = await compileSolidity( + "pragma solidity ^0.6.1; contract Example { uint public value; event Event(); constructor() public { value = 5; emit Event(); } function getVal() public pure returns (uint8) { return 123; } }" + ); const p = Ganache.provider({ defaultTransactionGasLimit: Quantity.from(6721975) }); @@ -172,17 +192,21 @@ describe("Accounts", () => { assert.strictEqual(result.blockNumber, "0x1"); - const hash = await p.send("eth_sendTransaction", [{ - from: accounts[1], - to: accounts[2], - value: 1 - }]); + const hash = await p.send("eth_sendTransaction", [ + { + from: accounts[1], + to: accounts[2], + value: 1 + } + ]); let result2 = null; while (!result2) { result2 = await p.send("eth_getTransactionReceipt", [hash]); } - const ret = await p.send("eth_call", [{from: accounts[3], to: result.contractAddress, gasLimit: 6721975, data: "0xe1cb0e52"}]); + const ret = await p.send("eth_call", [ + {from: accounts[3], to: result.contractAddress, gasLimit: 6721975, data: "0xe1cb0e52"} + ]); assert.strictEqual(ret, "0x000000000000000000000000000000000000000000000000000000000000007b"); diff --git a/tsconfig.json b/tsconfig.json index 2574e76e9e..7471ab3a71 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,6 @@ { "compilerOptions": { "skipLibCheck": true, - "module": "CommonJS", "esModuleInterop": true, "target": "ES2020", @@ -13,8 +12,5 @@ "outDir": "dist", "resolveJsonModule": true }, - "include": [ - "./index.ts", - "./typings/**/*.d.ts" - ] + "include": ["./src/**.*.ts", "./typings/**/*.d.ts"] } diff --git a/typings/emittery.d.ts b/typings/emittery.d.ts index 0ea267681f..13f48525ab 100644 --- a/typings/emittery.d.ts +++ b/typings/emittery.d.ts @@ -1,4 +1,4 @@ -import "emittery" +import "emittery"; interface Events { // Blocked by https://github.com/microsoft/TypeScript/issues/1863, should be @@ -14,28 +14,54 @@ interface Events { declare module "emittery" { export class Typed extends Emittery.Typed { - on>(eventName: Name, listener: (eventData: Parameters[0]) => void): Emittery.UnsubscribeFn; - on(eventName: Name, listener: () => void): Emittery.UnsubscribeFn; + on>( + eventName: Name, + listener: (eventData: Parameters[0]) => void + ): Emittery.UnsubscribeFn; + on(eventName: Name, listener: () => void): Emittery.UnsubscribeFn; - events>(eventName: Name): AsyncIterableIterator[0]>; + events>( + eventName: Name + ): AsyncIterableIterator[0]>; - once>(eventName: Name): Promise>; - once(eventName: Name): Promise>; + once>(eventName: Name): Promise>; + once(eventName: Name): Promise>; - off>(eventName: Name, listener: (eventData: Parameters[0]) => void): void; - off(eventName: Name, listener: () => void): void; + off>( + eventName: Name, + listener: (eventData: Parameters[0]) => void + ): void; + off(eventName: Name, listener: () => void): void; - onAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => void): Emittery.UnsubscribeFn; - anyEvent(): AsyncIterableIterator<[EventNameFromDataMap, EventDataMap[EventNameFromDataMap]]>; + onAny( + listener: ( + eventName: EventNameFromDataMap | EmptyEvents, + eventData?: EventDataMap[EventNameFromDataMap] + ) => void + ): Emittery.UnsubscribeFn; + anyEvent(): AsyncIterableIterator< + [EventNameFromDataMap, EventDataMap[EventNameFromDataMap]] + >; - offAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => void): void; + offAny( + listener: ( + eventName: EventNameFromDataMap | EmptyEvents, + eventData?: EventDataMap[EventNameFromDataMap] + ) => void + ): void; - emit>(eventName: Name, eventData: Parameters[0]): Promise>; - emit(eventName: Name): Promise>; + emit>( + eventName: Name, + eventData: Parameters[0] + ): Promise>; + emit(eventName: Name): Promise>; - emitSerial>(eventName: Name, eventData: Parameters[0]): Promise>; - emitSerial(eventName: Name): Promise>; - } + emitSerial>( + eventName: Name, + eventData: Parameters[0] + ): Promise>; + emitSerial(eventName: Name): Promise>; + } } -export = Emittery; \ No newline at end of file +export = Emittery; diff --git a/typings/ethereumjs-block/header.d.ts b/typings/ethereumjs-block/header.d.ts index c8a9380004..3c2ff7bada 100644 --- a/typings/ethereumjs-block/header.d.ts +++ b/typings/ethereumjs-block/header.d.ts @@ -1,58 +1,55 @@ -declare module 'ethereumjs-block/header' { - import BN from 'bn.js' - import { Block } from 'ethereumjs-block' - import { Blockchain } from 'ethereumjs-blockchain' +declare module "ethereumjs-block/header" { + import BN from "bn.js"; + import {Block} from "ethereumjs-block"; + import {Blockchain} from "ethereumjs-blockchain"; - type LargeNumber = string | Buffer | BN - type Callback = (err: Error | null, result: T) => void + type LargeNumber = string | Buffer | BN; + type Callback = (err: Error | null, result: T) => void; export interface IBlockHeader { - parentHash: Buffer - uncleHash: Buffer - coinbase: Buffer - stateRoot: Buffer - transactionTrie: Buffer - receiptTrie: Buffer - bloom: Buffer - difficulty: Buffer - number: Buffer - gasLimit: Buffer - gasUsed: Buffer - timestamp: Buffer - extraData: Buffer + parentHash: Buffer; + uncleHash: Buffer; + coinbase: Buffer; + stateRoot: Buffer; + transactionTrie: Buffer; + receiptTrie: Buffer; + bloom: Buffer; + difficulty: Buffer; + number: Buffer; + gasLimit: Buffer; + gasUsed: Buffer; + timestamp: Buffer; + extraData: Buffer; } export class BlockHeader { - public raw!: Buffer[] - public parentHash!: Buffer - public uncleHash!: Buffer - public coinbase!: Buffer - public stateRoot!: Buffer - public transactionsTrie!: Buffer - public receiptTrie!: Buffer - public bloom!: Buffer - public difficulty!: Buffer - public number!: Buffer - public gasLimit!: Buffer - public gasUsed!: Buffer - public timestamp!: Buffer - public extraData!: Buffer - public mixHash!: Buffer - public nonce!: Buffer + public raw!: Buffer[]; + public parentHash!: Buffer; + public uncleHash!: Buffer; + public coinbase!: Buffer; + public stateRoot!: Buffer; + public transactionsTrie!: Buffer; + public receiptTrie!: Buffer; + public bloom!: Buffer; + public difficulty!: Buffer; + public number!: Buffer; + public gasLimit!: Buffer; + public gasUsed!: Buffer; + public timestamp!: Buffer; + public extraData!: Buffer; + public mixHash!: Buffer; + public nonce!: Buffer; - constructor( - data: Buffer | PrefixedHexString | BufferLike[] | BlockHeaderData = {}, - opts: ChainOptions = {} - ) - serialize(): Buffer - canonicalDifficulty(block: Block): BN - validateDifficulty(block: Block): boolean - validateGasLimit(block: Block): boolean - validate(blockChain: Blockchain, height: BN | Callback, cb?: Callback): void - hash(): Buffer - isGenesis(): boolean - toJSON(labeled: boolean): object + constructor(data: Buffer | PrefixedHexString | BufferLike[] | BlockHeaderData = {}, opts: ChainOptions = {}); + serialize(): Buffer; + canonicalDifficulty(block: Block): BN; + validateDifficulty(block: Block): boolean; + validateGasLimit(block: Block): boolean; + validate(blockChain: Blockchain, height: BN | Callback, cb?: Callback): void; + hash(): Buffer; + isGenesis(): boolean; + toJSON(labeled: boolean): object; } - export default BlockHeader -} \ No newline at end of file + export default BlockHeader; +} diff --git a/typings/ethereumjs-block/index.d.ts b/typings/ethereumjs-block/index.d.ts index b73a65aa3f..5ed0bca68c 100644 --- a/typings/ethereumjs-block/index.d.ts +++ b/typings/ethereumjs-block/index.d.ts @@ -1,43 +1,40 @@ -declare module 'ethereumjs-block' { - import BN from 'bn.js' - import { Blockchain } from 'ethereumjs-blockchain' - import Transaction from 'ethereumjs-tx' - import BlockHeader from 'ethereumjs-block/header' - import Trie from 'merkle-patricia-tree/baseTrie' - - type LargeNumber = string | Buffer | BN - type Callback = (err: Error | null, result: T) => void - - export interface IBlock { - transactions: Transaction[] - uncleHeaders: BlockHeader[] - txTrie: Trie - header: BlockHeader - } - - export class Block { - transactions: Transaction[] - uncleHeaders: BlockHeader[] - txTrie: Trie - header: BlockHeader - raw: Buffer[] - - constructor( - data: Buffer | [Buffer[], Buffer[], Buffer[]] | BlockData = {}, - opts: ChainOptions = {}, - ) - hash(): Buffer - isGenesis(): boolean - setGenesisParams(): void - serialize(rlpEncode: boolean): Buffer - genTxTrie(cb: Callback): void - validateTransactionTrie(): boolean - validateTransactions(sringError: boolean): boolean | string - validate(blockChain: Blockchain, cb: Callback): void - validateUnclesHash(): boolean - validateUncles(blockChain: Blockchain, cb: Callback): void - toJSON(labeled?: boolean): object - } - - export default Block - } \ No newline at end of file +declare module "ethereumjs-block" { + import BN from "bn.js"; + import {Blockchain} from "ethereumjs-blockchain"; + import Transaction from "ethereumjs-tx"; + import BlockHeader from "ethereumjs-block/header"; + import Trie from "merkle-patricia-tree/baseTrie"; + + type LargeNumber = string | Buffer | BN; + type Callback = (err: Error | null, result: T) => void; + + export interface IBlock { + transactions: Transaction[]; + uncleHeaders: BlockHeader[]; + txTrie: Trie; + header: BlockHeader; + } + + export class Block { + transactions: Transaction[]; + uncleHeaders: BlockHeader[]; + txTrie: Trie; + header: BlockHeader; + raw: Buffer[]; + + constructor(data: Buffer | [Buffer[], Buffer[], Buffer[]] | BlockData = {}, opts: ChainOptions = {}); + hash(): Buffer; + isGenesis(): boolean; + setGenesisParams(): void; + serialize(rlpEncode: boolean): Buffer; + genTxTrie(cb: Callback): void; + validateTransactionTrie(): boolean; + validateTransactions(sringError: boolean): boolean | string; + validate(blockChain: Blockchain, cb: Callback): void; + validateUnclesHash(): boolean; + validateUncles(blockChain: Blockchain, cb: Callback): void; + toJSON(labeled?: boolean): object; + } + + export default Block; +} diff --git a/typings/hdkey.d.ts b/typings/hdkey.d.ts index 9f59d895ab..8c11d6840f 100644 --- a/typings/hdkey.d.ts +++ b/typings/hdkey.d.ts @@ -1,31 +1,31 @@ declare module "hdkey" { type HDKeyJSON = { - xpriv: string - xpub: string + xpriv: string; + xpub: string; }; - type HDKeyVersions = {private: number, public: number}; + type HDKeyVersions = {private: number; public: number}; export default class HDKey { public versions: HDKeyVersions; public depth: number; public index: number; - readonly public parentFingerprint: number; - readonly public fingerprint: number; - readonly public identifier?: Uint8Array; - readonly public pubKeyHash?: Uint8Array; - readonly public privateKey?: Buffer; + public readonly parentFingerprint: number; + public readonly fingerprint: number; + public readonly identifier?: Uint8Array; + public readonly pubKeyHash?: Uint8Array; + public readonly privateKey?: Buffer; public publicKey?: Uint8Array; - readonly public privateExtendedKey?: string; - readonly public publicExtendedKey: string; - readonly public chainCode?: Buffer; + public readonly privateExtendedKey?: string; + public readonly publicExtendedKey: string; + public readonly chainCode?: Buffer; public derive: (path: string) => HDKey; public deriveChild: (index: number) => HDKey; public sign: (hash: Buffer) => Buffer; public verify: (hash: Buffer, signature: Buffer) => boolean; public wipePrivateData: () => HDKey; public toJSON: (path: string) => HDKeyJSON; - static public fromMasterSeed: (seedBuffer: Buffer, version?: HDKeyVersions) => HDKey; - static public fromExtendedKey: (base58key: string, version?: HDKeyVersions) => HDKey; - static public fromJSON: (obj: HDKeyJSON) => HDKey; - static public HARDENED_OFFSET: 0x80000000; + public static fromMasterSeed: (seedBuffer: Buffer, version?: HDKeyVersions) => HDKey; + public static fromExtendedKey: (base58key: string, version?: HDKeyVersions) => HDKey; + public static fromJSON: (obj: HDKeyJSON) => HDKey; + public static HARDENED_OFFSET: 0x80000000; } -} \ No newline at end of file +} diff --git a/typings/levelup/index.d.ts b/typings/levelup/index.d.ts index 6ee9976ad7..2881ca2f39 100644 --- a/typings/levelup/index.d.ts +++ b/typings/levelup/index.d.ts @@ -1,83 +1,93 @@ -/// - -declare module 'levelup' { - import { AbstractLevelDOWN } from 'abstract-leveldown' - - export = levelup; - - var levelup: levelup.LevelUpConstructor; - - namespace levelup { - interface CustomEncoding { - encode(val: any): Buffer| string; - decode(val: Buffer | string): any; - buffer: boolean; - type: string; - } - - type Encoding = string | CustomEncoding; - - interface Batch { - type: string; - key: any; - value?: any; - keyEncoding?: Encoding; - valueEncoding?: Encoding; - } - - interface LevelUpBase { - open(callback ?: (error : any) => any): void; - - close(callback ?: (error : any) => any): void; - - put(key: any, value: any): Promise; - put(key: any, value: any, callback: (error: any) => any): void; - put(key: any, value: any, options: { sync?: boolean }): Promise; - put(key: any, value: any, options: { sync?: boolean }, callback: (error: any) => any): void; - - get(key: any): Promise; - get(key: any, callback: (error: any, value: any) => any): void; - get(key: any, options: { keyEncoding?: Encoding; fillCache?: boolean }): Promise; - get(key: any, options: { keyEncoding?: Encoding; fillCache?: boolean }, callback: (error: any, value: any) => any): void; - - del(key: any): Promise; - del(key: any, callback: (error: any) => any): void; - del(key: any, options: { keyEncoding?: Encoding; sync?: boolean }): Promise; - del(key: any, options: { keyEncoding?: Encoding; sync?: boolean }, callback: (error: any) => any): void; - - - batch():LevelUpChain; - batch(array: BatchType[]): Promise; - batch(array: BatchType[], callback: (error?: any)=>any): void; - batch(array: BatchType[], options: { keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean }): Promise; - batch(array: BatchType[], options: { keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean }, callback: (error?: any)=>any): void; - - isOpen():boolean; - isClosed():boolean; - createReadStream(options?: any): any; - createKeyStream(options?: any): any; - createValueStream(options?: any): any; - } - - type LevelUp = LevelUpBase - - interface LevelUpChain { - put(key: any, value: any): LevelUpChain; - put(key: any, value: any, options?: { sync?: boolean }): LevelUpChain; - del(key: any): LevelUpChain; - del(key: any, options ?: { keyEncoding?: Encoding; sync?: boolean }): LevelUpChain; - clear(): LevelUpChain; - write(): Promise; - write(callback?: (error?: any)=>any): void; - } - - interface levelupOptions { - db?: (location: string) => AbstractLevelDOWN - } - - interface LevelUpConstructor { - (location: string, options?: levelupOptions): LevelUp; - (options: levelupOptions): LevelUp; - } - } -} +/// + +declare module "levelup" { + import {AbstractLevelDOWN} from "abstract-leveldown"; + + export = levelup; + + var levelup: levelup.LevelUpConstructor; + + namespace levelup { + interface CustomEncoding { + encode(val: any): Buffer | string; + decode(val: Buffer | string): any; + buffer: boolean; + type: string; + } + + type Encoding = string | CustomEncoding; + + interface Batch { + type: string; + key: any; + value?: any; + keyEncoding?: Encoding; + valueEncoding?: Encoding; + } + + interface LevelUpBase { + open(callback?: (error: any) => any): void; + + close(callback?: (error: any) => any): void; + + put(key: any, value: any): Promise; + put(key: any, value: any, callback: (error: any) => any): void; + put(key: any, value: any, options: {sync?: boolean}): Promise; + put(key: any, value: any, options: {sync?: boolean}, callback: (error: any) => any): void; + + get(key: any): Promise; + get(key: any, callback: (error: any, value: any) => any): void; + get(key: any, options: {keyEncoding?: Encoding; fillCache?: boolean}): Promise; + get( + key: any, + options: {keyEncoding?: Encoding; fillCache?: boolean}, + callback: (error: any, value: any) => any + ): void; + + del(key: any): Promise; + del(key: any, callback: (error: any) => any): void; + del(key: any, options: {keyEncoding?: Encoding; sync?: boolean}): Promise; + del(key: any, options: {keyEncoding?: Encoding; sync?: boolean}, callback: (error: any) => any): void; + + batch(): LevelUpChain; + batch(array: BatchType[]): Promise; + batch(array: BatchType[], callback: (error?: any) => any): void; + batch( + array: BatchType[], + options: {keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean} + ): Promise; + batch( + array: BatchType[], + options: {keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean}, + callback: (error?: any) => any + ): void; + + isOpen(): boolean; + isClosed(): boolean; + createReadStream(options?: any): any; + createKeyStream(options?: any): any; + createValueStream(options?: any): any; + } + + type LevelUp = LevelUpBase; + + interface LevelUpChain { + put(key: any, value: any): LevelUpChain; + put(key: any, value: any, options?: {sync?: boolean}): LevelUpChain; + del(key: any): LevelUpChain; + del(key: any, options?: {keyEncoding?: Encoding; sync?: boolean}): LevelUpChain; + clear(): LevelUpChain; + write(): Promise; + write(callback?: (error?: any) => any): void; + } + + interface levelupOptions { + db?: (location: string) => AbstractLevelDOWN; + } + + interface LevelUpConstructor { + (location: string, options?: levelupOptions): LevelUp; + (options: levelupOptions): LevelUp; + } + } +} diff --git a/typings/merkle-patricia-tree/baseTrie.d.ts b/typings/merkle-patricia-tree/baseTrie.d.ts index 4fa12f2319..663bff4cff 100644 --- a/typings/merkle-patricia-tree/baseTrie.d.ts +++ b/typings/merkle-patricia-tree/baseTrie.d.ts @@ -1,41 +1,40 @@ -declare module 'merkle-patricia-tree/baseTrie' { - import BN from 'bn.js' +declare module "merkle-patricia-tree/baseTrie" { + import BN from "bn.js"; - import TrieNode from 'merkle-patricia-tree/trieNode' - import ReadStream from 'merkle-patricia-tree/readStream' + import TrieNode from "merkle-patricia-tree/trieNode"; + import ReadStream from "merkle-patricia-tree/readStream"; - type Callback = (err: Error | null, result: T) => void - type FindPathCallback = (err: Error, node: TrieNode, keyRemainder: Buffer, stack: TrieNode[]) => void - type LargeNumber = string | Buffer | BN + type Callback = (err: Error | null, result: T) => void; + type FindPathCallback = (err: Error, node: TrieNode, keyRemainder: Buffer, stack: TrieNode[]) => void; + type LargeNumber = string | Buffer | BN; - // Rather than using LevelUp here, specify the minimal interface we need // so that other structurally identical types can be used in its place export interface Database { - get(key: Buffer, opt: any, cb: Callback): void - put(key: Buffer, val: Buffer, options: any, cb: Callback): void - del(key: Buffer, opt: any, cb: Callback): void + get(key: Buffer, opt: any, cb: Callback): void; + put(key: Buffer, val: Buffer, options: any, cb: Callback): void; + del(key: Buffer, opt: any, cb: Callback): void; } export interface BatchOperation { - type: 'del' | 'put' - key: LargeNumber - value?: LargeNumber + type: "del" | "put"; + key: LargeNumber; + value?: LargeNumber; } export class Trie { - root: Buffer - constructor(db: Database, root: Buffer) - get(key: LargeNumber, cb: Callback): void - put(key: LargeNumber, value: LargeNumber, cb: Callback): void - del(key: LargeNumber, cb: Callback): void - getRaw(key: LargeNumber, cb: Callback): void - findPath(key: LargeNumber, cb: FindPathCallback): void - createReadStream(): ReadStream - copy(): Trie - batch(ops: BatchOperation[], cb: (err: Error[]) => void): void - checkRoot(root: LargeNumber, cb: Callback): void + root: Buffer; + constructor(db: Database, root: Buffer); + get(key: LargeNumber, cb: Callback): void; + put(key: LargeNumber, value: LargeNumber, cb: Callback): void; + del(key: LargeNumber, cb: Callback): void; + getRaw(key: LargeNumber, cb: Callback): void; + findPath(key: LargeNumber, cb: FindPathCallback): void; + createReadStream(): ReadStream; + copy(): Trie; + batch(ops: BatchOperation[], cb: (err: Error[]) => void): void; + checkRoot(root: LargeNumber, cb: Callback): void; } - export default Trie + export default Trie; } diff --git a/typings/merkle-patricia-tree/index.d.ts b/typings/merkle-patricia-tree/index.d.ts index 10bd8c40b3..eb6e3dc527 100644 --- a/typings/merkle-patricia-tree/index.d.ts +++ b/typings/merkle-patricia-tree/index.d.ts @@ -1,28 +1,28 @@ -declare module 'merkle-patricia-tree' { - import BN from 'bn.js' - import { Readable } from 'stream' +declare module "merkle-patricia-tree" { + import BN from "bn.js"; + import {Readable} from "stream"; - import { Trie, Database } from 'merkle-patricia-tree/baseTrie' - import TrieNode from 'merkle-patricia-tree/trieNode' + import {Trie, Database} from "merkle-patricia-tree/baseTrie"; + import TrieNode from "merkle-patricia-tree/trieNode"; - type MerkleProof = TrieNode[] - type Callback = (err: Error | null, result: T) => void - type LargeNumber = string | Buffer | BN + type MerkleProof = TrieNode[]; + type Callback = (err: Error | null, result: T) => void; + type LargeNumber = string | Buffer | BN; export class ScratchReadStream extends Readable { - trie: Trie + trie: Trie; } export class CheckpointTrie extends Trie { - readonly isCheckpoint: boolean + readonly isCheckpoint: boolean; - checkpoint(): void - commit(cb: Callback): void - revert(cb: Callback): void - createScratchReadStream(scratch: Database): ScratchReadStream - static prove(trie: Trie, key: LargeNumber, cb: Callback): void - static verifyProof(rootHash: LargeNumber, key: LargeNumber, proof: MerkleProof, cb: Callback): void + checkpoint(): void; + commit(cb: Callback): void; + revert(cb: Callback): void; + createScratchReadStream(scratch: Database): ScratchReadStream; + static prove(trie: Trie, key: LargeNumber, cb: Callback): void; + static verifyProof(rootHash: LargeNumber, key: LargeNumber, proof: MerkleProof, cb: Callback): void; } - export default CheckpointTrie + export default CheckpointTrie; } diff --git a/typings/merkle-patricia-tree/readStream.d.ts b/typings/merkle-patricia-tree/readStream.d.ts index ca05f2587f..ed00cbabdd 100644 --- a/typings/merkle-patricia-tree/readStream.d.ts +++ b/typings/merkle-patricia-tree/readStream.d.ts @@ -1,10 +1,10 @@ -declare module 'merkle-patricia-tree/readStream' { - import Trie from 'merkle-patricia-tree/baseTrie' - import { Readable } from 'stream' +declare module "merkle-patricia-tree/readStream" { + import Trie from "merkle-patricia-tree/baseTrie"; + import {Readable} from "stream"; export class TrieReadStream extends Readable { - constructor(trie: Trie) + constructor(trie: Trie); } - export default TrieReadStream + export default TrieReadStream; } diff --git a/typings/merkle-patricia-tree/trieNode.d.ts b/typings/merkle-patricia-tree/trieNode.d.ts index 08d616a359..4f7bc096bf 100644 --- a/typings/merkle-patricia-tree/trieNode.d.ts +++ b/typings/merkle-patricia-tree/trieNode.d.ts @@ -1,41 +1,41 @@ -declare module 'merkle-patricia-tree/trieNode' { - import BN from 'bn.js' +declare module "merkle-patricia-tree/trieNode" { + import BN from "bn.js"; - type LargeNumber = string | Buffer | BN - type Callback = (err: Error | null, result: T) => void - type NodeType = 'branch' | 'leaf' | 'extension' - type NibbleArray = number[] + type LargeNumber = string | Buffer | BN; + type Callback = (err: Error | null, result: T) => void; + type NodeType = "branch" | "leaf" | "extension"; + type NibbleArray = number[]; export class TrieNode { - value: Buffer - key: Buffer - type: NodeType - raw: number[] + value: Buffer; + key: Buffer; + type: NodeType; + raw: number[]; - constructor(type: NodeType | NibbleArray, key?: NibbleArray, value?: NibbleArray) - parseNode(node: NibbleArray): void - setValue(key: NibbleArray, value: NibbleArray): void - getValue(key: NibbleArray): NibbleArray - setKey(key: NibbleArray): void - getKey(): NibbleArray - serialize(): Buffer - hash(): Buffer - toString: string - getChildren(): TrieNode[] - static addHexPrefix(key: NibbleArray, terminator: boolean): NibbleArray - static removeHexPrefix(val: NibbleArray): NibbleArray - static isTerminator(key: NibbleArray): boolean - static stringToNibbles(key: LargeNumber): NibbleArray - static nibblesToBuffer(arr: NibbleArray): Buffer - static getNodeType(node: TrieNode): NodeType + constructor(type: NodeType | NibbleArray, key?: NibbleArray, value?: NibbleArray); + parseNode(node: NibbleArray): void; + setValue(key: NibbleArray, value: NibbleArray): void; + getValue(key: NibbleArray): NibbleArray; + setKey(key: NibbleArray): void; + getKey(): NibbleArray; + serialize(): Buffer; + hash(): Buffer; + toString: string; + getChildren(): TrieNode[]; + static addHexPrefix(key: NibbleArray, terminator: boolean): NibbleArray; + static removeHexPrefix(val: NibbleArray): NibbleArray; + static isTerminator(key: NibbleArray): boolean; + static stringToNibbles(key: LargeNumber): NibbleArray; + static nibblesToBuffer(arr: NibbleArray): Buffer; + static getNodeType(node: TrieNode): NodeType; } - function addHexPrefix(key: NibbleArray, terminator: boolean): NibbleArray - function removeHexPrefix(val: NibbleArray): NibbleArray - function isTerminator(key: NibbleArray): boolean - function stringToNibbles(key: LargeNumber): NibbleArray - function nibblesToBuffer(arr: NibbleArray): Buffer - function getNodeType(node: TrieNode): NodeType + function addHexPrefix(key: NibbleArray, terminator: boolean): NibbleArray; + function removeHexPrefix(val: NibbleArray): NibbleArray; + function isTerminator(key: NibbleArray): boolean; + function stringToNibbles(key: LargeNumber): NibbleArray; + function nibblesToBuffer(arr: NibbleArray): Buffer; + function getNodeType(node: TrieNode): NodeType; - export default TrieNode + export default TrieNode; } diff --git a/typings/superagent.d.ts b/typings/superagent.d.ts index a9e792bd34..f1211cd567 100644 --- a/typings/superagent.d.ts +++ b/typings/superagent.d.ts @@ -3,4 +3,4 @@ // error TS2304: Cannot find name 'XMLHttpRequest' declare interface XMLHttpRequest {} // error TS2304: Cannot find name 'Blob' -declare interface Blob {} \ No newline at end of file +declare interface Blob {} diff --git a/typings/tmp.d.ts b/typings/tmp.d.ts index b4832a9858..cf0a102cb4 100644 --- a/typings/tmp.d.ts +++ b/typings/tmp.d.ts @@ -1,8 +1,8 @@ declare module "tmp" { - export class Options {} - export class SimpleOptions {} - export const fileSync: any; - export const dirSync: any; - export const tmpNameSync: any; - export const setGracefulCleanup: any; + export class Options {} + export class SimpleOptions {} + export const fileSync: any; + export const dirSync: any; + export const tmpNameSync: any; + export const setGracefulCleanup: any; } diff --git a/typings/uWebsockets.js.d.ts b/typings/uWebsockets.js.d.ts index edc9b7c569..cce80c6161 100644 --- a/typings/uWebsockets.js.d.ts +++ b/typings/uWebsockets.js.d.ts @@ -1,13 +1,12 @@ -import "uWebSockets.js" +import "uWebSockets.js"; enum ListenOptions { - LIBUS_LISTEN_DEFAULT = 0, - LIBUS_LISTEN_EXCLUSIVE_PORT = 1 + LIBUS_LISTEN_DEFAULT = 0, + LIBUS_LISTEN_EXCLUSIVE_PORT = 1 } // uWebSockets.js doesn't include these in its TS def file. declare module "uWebSockets.js" { - - export interface TemplatedApp { - listen(port: number, options: ListenOptions, cb: (listenSocket: any) => void): TemplatedApp; - } + export interface TemplatedApp { + listen(port: number, options: ListenOptions, cb: (listenSocket: any) => void): TemplatedApp; + } } From 17d4de5cc61c4bcf7da5344c204280df846d43e2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 12:19:05 -0400 Subject: [PATCH 153/691] Fix imports from previous file move --- src/index.ts | 8 ++++---- test/helpers/getProvider.ts | 2 +- test/interface.ts | 2 +- test/provider.ts | 2 +- test/server.ts | 2 +- test/temp-tests.ts | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9518e58dba..7093913821 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ -import Provider from "./src/provider"; -import ProviderOptions from "./src/options/provider-options"; -import ServerOptions from "./src/options/server-options"; -import Server from "./src/server"; +import Provider from "./provider"; +import ProviderOptions from "./options/provider-options"; +import ServerOptions from "./options/server-options"; +import Server from "./server"; export default { server: (options?: ServerOptions) => new Server(options), diff --git a/test/helpers/getProvider.ts b/test/helpers/getProvider.ts index 56afed838e..cb9f801f3b 100644 --- a/test/helpers/getProvider.ts +++ b/test/helpers/getProvider.ts @@ -1,4 +1,4 @@ -import Ganache from "../../index"; +import Ganache from "../../src/"; import Provider from "../../src/provider"; import ProviderOptions from "../../src/options/provider-options"; diff --git a/test/interface.ts b/test/interface.ts index 37e07e889d..6fe3cad29b 100644 --- a/test/interface.ts +++ b/test/interface.ts @@ -1,4 +1,4 @@ -import Ganache from "../index"; +import Ganache from "../src/"; import * as assert from "assert"; describe("interface", () => { diff --git a/test/provider.ts b/test/provider.ts index 9acb546e2d..590507e49c 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -1,4 +1,4 @@ -import Ganache from "../index"; +import Ganache from "../src/"; import assert from "assert"; import Provider from "../src/ledgers/ethereum"; diff --git a/test/server.ts b/test/server.ts index 761c649e91..9c646429df 100644 --- a/test/server.ts +++ b/test/server.ts @@ -1,4 +1,4 @@ -import Ganache from "../index"; +import Ganache from "../src/"; import * as assert from "assert"; import request from "superagent"; import WebSocket from "ws"; diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 9b4182c9af..6b7c9a5ec9 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -1,4 +1,4 @@ -import Ganache from "../index"; +import Ganache from "../src"; import assert from "assert"; import {Quantity} from "../src/types/json-rpc"; const solc = require("solc"); From 51c81b75e5ffdb7419d19b58c7cd1fee71e5dc3d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 18:54:58 -0400 Subject: [PATCH 154/691] Refactor lots --- docs/README.md | 1 + package.json | 3 +- patches/emittery+0.6.0.patch | 59 ++++++ src/{provider.ts => connector.ts} | 22 ++- src/index.ts | 4 +- .../{ledger-options.ts => api-options.ts} | 2 +- src/interfaces/{base-ledger.ts => api.ts} | 8 +- src/interfaces/connector.ts | 28 +++ src/interfaces/{IProvider.ts => provider.ts} | 6 +- src/ledgers/ethereum/{ledger.ts => api.ts} | 16 +- src/ledgers/ethereum/blockchain.ts | 8 +- .../ethereum/components/account-manager.ts | 6 +- .../ethereum/components/block-manager.ts | 6 +- src/ledgers/ethereum/components/manager.ts | 2 +- .../components/transaction-manager.ts | 2 +- .../ethereum/components/transaction-pool.ts | 4 +- src/ledgers/ethereum/index.ts | 183 ++---------------- src/ledgers/ethereum/miner.ts | 6 +- src/ledgers/ethereum/options.ts | 2 +- src/ledgers/ethereum/provider.ts | 170 ++++++++++++++++ src/ledgers/ethereum/wallet.ts | 6 +- src/ledgers/tezos/api.ts | 9 + src/ledgers/tezos/index.ts | 41 ++++ src/ledgers/tezos/provider.ts | 12 ++ src/options/options.ts | 6 +- src/options/provider-options.ts | 24 ++- src/options/server-options.ts | 2 +- src/server.ts | 30 +-- src/servers/http-server.ts | 29 +-- src/servers/utils/jsonrpc.ts | 6 +- src/servers/ws-server.ts | 30 ++- src/{types => things}/account.ts | 0 src/{types => things}/address.ts | 0 src/{types => things}/errors.ts | 0 src/{types => things}/json-rpc/index.ts | 0 .../json-rpc/json-rpc-base-types.ts | 0 .../json-rpc/json-rpc-data.ts | 0 .../json-rpc/json-rpc-quantity.ts | 0 src/{types => things}/params.ts | 0 src/{types => things}/tags.ts | 0 src/{types => things}/transaction-receipt.ts | 0 src/{types => things}/transaction.ts | 0 src/types/index.ts | 14 ++ src/utils/executor.ts | 12 +- test/helpers/getProvider.ts | 2 - test/ledger.ts | 5 +- test/provider.ts | 14 +- test/temp-tests.ts | 17 +- typings/emittery.d.ts | 5 +- 49 files changed, 503 insertions(+), 299 deletions(-) create mode 100644 patches/emittery+0.6.0.patch rename src/{provider.ts => connector.ts} (54%) rename src/interfaces/{ledger-options.ts => api-options.ts} (75%) rename src/interfaces/{base-ledger.ts => api.ts} (72%) create mode 100644 src/interfaces/connector.ts rename src/interfaces/{IProvider.ts => provider.ts} (58%) rename src/ledgers/ethereum/{ledger.ts => api.ts} (97%) create mode 100644 src/ledgers/ethereum/provider.ts create mode 100644 src/ledgers/tezos/api.ts create mode 100644 src/ledgers/tezos/index.ts create mode 100644 src/ledgers/tezos/provider.ts rename src/{types => things}/account.ts (100%) rename src/{types => things}/address.ts (100%) rename src/{types => things}/errors.ts (100%) rename src/{types => things}/json-rpc/index.ts (100%) rename src/{types => things}/json-rpc/json-rpc-base-types.ts (100%) rename src/{types => things}/json-rpc/json-rpc-data.ts (100%) rename src/{types => things}/json-rpc/json-rpc-quantity.ts (100%) rename src/{types => things}/params.ts (100%) rename src/{types => things}/tags.ts (100%) rename src/{types => things}/transaction-receipt.ts (100%) rename src/{types => things}/transaction.ts (100%) create mode 100644 src/types/index.ts diff --git a/docs/README.md b/docs/README.md index 553875ff90..36df1220db 100644 --- a/docs/README.md +++ b/docs/README.md @@ -24,3 +24,4 @@ These are guidelines, not rules. :-) - Ensure a smooth development experience on Windows, Mac, and Linux. - Do not use bash scripts. - Do not use CLI commands in npm scripts or build scripts that aren't available by default on supported platforms. +- Push your code often (at least every-other day!), even broken WIP code (to your own branch, of course). diff --git a/package.json b/package.json index 815ec142d7..0ebe1dd247 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "scripts": { "build": "tsc", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks 'test/**.ts'" + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks 'test/**.ts'", + "postinstall": "patch-package" }, "dependencies": { "@types/lodash.clonedeep": "4.5.6", diff --git a/patches/emittery+0.6.0.patch b/patches/emittery+0.6.0.patch new file mode 100644 index 0000000000..97db0f0c3b --- /dev/null +++ b/patches/emittery+0.6.0.patch @@ -0,0 +1,59 @@ +diff --git a/node_modules/emittery/index.d.ts b/node_modules/emittery/index.d.ts +index d386ddb..0cb4161 100644 +--- a/node_modules/emittery/index.d.ts ++++ b/node_modules/emittery/index.d.ts +@@ -259,11 +259,15 @@ declare namespace Emittery { + /** + Maps event names to their emitted data type. + */ +- interface Events { ++ interface Args { + // Blocked by https://github.com/microsoft/TypeScript/issues/1863, should be + // `[eventName: EventName]: unknown;` + } + ++ interface Events { ++ [eventName: string]: (args: Args) => Promise; ++ } ++ + /** + The data provided as `eventData` when listening for `Emittery.listenerAdded` or `Emittery.listenerRemoved`. + */ +@@ -296,27 +300,27 @@ declare namespace Emittery { + emitter.emit('end'); // TS compilation error + ``` + */ +- class Typed extends Emittery { +- on>(eventName: Name, listener: (eventData: EventDataMap[Name]) => void): Emittery.UnsubscribeFn; ++ class Typed { ++ on>(eventName: Name, listener: (eventData: Parameters[0]) => ReturnType): Emittery.UnsubscribeFn; + on(eventName: Name, listener: () => void): Emittery.UnsubscribeFn; + +- events>(eventName: Name): AsyncIterableIterator; ++ events>(eventName: Name): AsyncIterableIterator[0]>; + +- once>(eventName: Name): Promise; +- once(eventName: Name): Promise; ++ once>(eventName: Name, listener: (eventData: Parameters[0]) => ReturnType): Emittery.UnsubscribeFn; ++ once(eventName: Name, listener: () => void): Emittery.UnsubscribeFn; + +- off>(eventName: Name, listener: (eventData: EventDataMap[Name]) => void): void; ++ off>(eventName: Name, listener: (eventData: Parameters[0]) => ReturnType): void; + off(eventName: Name, listener: () => void): void; + +- onAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => void): Emittery.UnsubscribeFn; ++ onAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => ReturnType): Emittery.UnsubscribeFn; + anyEvent(): AsyncIterableIterator<[EventNameFromDataMap, EventDataMap[EventNameFromDataMap]]>; + +- offAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => void): void; ++ offAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => ReturnType): void; + +- emit>(eventName: Name, eventData: EventDataMap[Name]): Promise; ++ emit>(eventName: Name, eventData: Parameters[0]): Promise<[ReturnType]>; + emit(eventName: Name): Promise; + +- emitSerial>(eventName: Name, eventData: EventDataMap[Name]): Promise; ++ emitSerial>(eventName: Name, eventData: Parameters[0]): Promise<[ReturnType]>; + emitSerial(eventName: Name): Promise; + } + } diff --git a/src/provider.ts b/src/connector.ts similarity index 54% rename from src/provider.ts rename to src/connector.ts index 15f793bc7d..f48a939501 100644 --- a/src/provider.ts +++ b/src/connector.ts @@ -1,12 +1,17 @@ import Executor from "./utils/executor"; import RequestCoordinator from "./utils/request-coordinator"; -import ProviderOptions, {Flavors} from "./options/provider-options"; +import ProviderOptions, {FlavorMap} from "./options/provider-options"; import Emittery from "emittery"; +import Connector from "./interfaces/connector"; +import { Provider } from "./interfaces/provider"; +import EthereumApi from "./ledgers/ethereum/api"; +import EthereumProvider from "./ledgers/ethereum/provider"; -export default class Provider extends Emittery { +export default class Connector2 extends Emittery { // TODO: set missing defaults automatically public static initialize(providerOptions: ProviderOptions = {flavor: "ethereum", asyncRequestProcessing: true}) { - const provider = new Flavors[providerOptions.flavor || "ethereum"](providerOptions); + const flavor = providerOptions.flavor || "ethereum"; + const connector = new FlavorMap[flavor](providerOptions); // Set up our request coordinator to either use FIFO or or async request processing. // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it @@ -19,13 +24,14 @@ export default class Provider extends Emittery { // The request coordinator is initialized in a "paused" state, when the provider is ready we unpause // this lets us accept queue requests before we've even fully initialized. - provider.on("ready", requestCoordinator.resume); + (connector.provider as EthereumProvider).on("ready", requestCoordinator.resume); - // A provider should _not_ execute it's own methods, but should delegate that responsiblity here. - provider.on("request", ({ledger, method, params}) => { - return requestCoordinator.queue(executor.execute, ledger, method, params); + // A provider should _not_ execute its own methods, but should delegate that responsiblity here. + // Need to cast here because of https://github.com/microsoft/TypeScript/issues/7294 + (connector.provider as EthereumProvider).on("request", ({api, method, params}) => { + return requestCoordinator.queue(executor.execute, api, method, params); }); - return provider; + return connector; } } diff --git a/src/index.ts b/src/index.ts index 7093913821..d9bcd72e77 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,9 @@ -import Provider from "./provider"; +import Connector from "./connector"; import ProviderOptions from "./options/provider-options"; import ServerOptions from "./options/server-options"; import Server from "./server"; export default { server: (options?: ServerOptions) => new Server(options), - provider: (options?: ProviderOptions) => Provider.initialize(options) + provider: (options?: ProviderOptions) => Connector.initialize(options).provider }; diff --git a/src/interfaces/ledger-options.ts b/src/interfaces/api-options.ts similarity index 75% rename from src/interfaces/ledger-options.ts rename to src/interfaces/api-options.ts index 18c33cc8f9..755c056349 100644 --- a/src/interfaces/ledger-options.ts +++ b/src/interfaces/api-options.ts @@ -3,6 +3,6 @@ import Account from "../types/account"; /** * Options that ledger implementations must implement */ -export default interface ILedgerOptions { +export default interface ApiOptions { accounts?: Account[]; } diff --git a/src/interfaces/base-ledger.ts b/src/interfaces/api.ts similarity index 72% rename from src/interfaces/base-ledger.ts rename to src/interfaces/api.ts index 475bf63dba..6da2c15bc5 100644 --- a/src/interfaces/base-ledger.ts +++ b/src/interfaces/api.ts @@ -5,15 +5,15 @@ export type Emitter = { }; /** - * Base implementation for a Ledger. + * Base implementation for an API. * All properties must be `async` callable or return a `Promise` */ -export default class BaseLedger { +class ApiBase { readonly [index: string]: (...args: any) => Promise; } /** - * Defines the interface for a Ledger. + * Defines the interface for a API. * All properties must be `async` callable or return a `Promise` */ -export interface ILedger extends BaseLedger {} +export default interface Api extends ApiBase {} diff --git a/src/interfaces/connector.ts b/src/interfaces/connector.ts new file mode 100644 index 0000000000..c8adb8718a --- /dev/null +++ b/src/interfaces/connector.ts @@ -0,0 +1,28 @@ +import { Provider } from "./provider"; +import { RecognizedString } from "uWebSockets.js"; +import Api from "./api"; +import Emittery from "emittery"; +import { RequestType } from "../types"; + +export default interface Connector extends Emittery.Typed<{request: RequestType}, "ready" | "close">{ + provider: Provider; + + /** + * Parses a raw message into something that can be handled by `handle` + * @param message + */ + parse(message: Buffer): RequestFormat; + + /** + * Handles a parse message + * @param payload + */ + handle(payload: RequestFormat): Promise; + + /** + * Formats the response (from handle) + * @param response + * @param payload + */ + format(result: ResponseFormat, payload: RequestFormat): RecognizedString; +} \ No newline at end of file diff --git a/src/interfaces/IProvider.ts b/src/interfaces/provider.ts similarity index 58% rename from src/interfaces/IProvider.ts rename to src/interfaces/provider.ts index 57b23fe520..4625e9215b 100644 --- a/src/interfaces/IProvider.ts +++ b/src/interfaces/provider.ts @@ -1,6 +1,4 @@ -import Emittery from "emittery"; -import {ILedger} from "./base-ledger"; -import ProviderOptions from "../options/provider-options"; +import Api from "./api"; type KnownKeys = { [K in keyof T]: string extends K ? never : number extends K ? never : K; @@ -8,7 +6,7 @@ type KnownKeys = { ? U : never; -export interface IProvider { +export interface Provider { request: (method: KnownKeys, params?: any[]) => Promise; close: () => Promise; } diff --git a/src/ledgers/ethereum/ledger.ts b/src/ledgers/ethereum/api.ts similarity index 97% rename from src/ledgers/ethereum/ledger.ts rename to src/ledgers/ethereum/api.ts index 7b6d83ba55..f00108c2ee 100644 --- a/src/ledgers/ethereum/ledger.ts +++ b/src/ledgers/ethereum/api.ts @@ -1,11 +1,11 @@ //#region Imports -import BaseLedger, {Emitter} from "../../interfaces/base-ledger"; +import Api, { Emitter } from "../../interfaces/api"; import EthereumOptions from "./options"; -import {Data, Quantity, IndexableData} from "../../types/json-rpc"; +import {Data, Quantity} from "../../things/json-rpc"; import Blockchain from "./blockchain"; -import Tag from "../../types/tags"; -import Address, {IndexableAddress} from "../../types/address"; -import Transaction from "../../types/transaction"; +import Tag from "../../things/tags"; +import Address, {IndexableAddress} from "../../things/address"; +import Transaction from "../../things/transaction"; import {Block} from "./components/block-manager"; import Wallet from "./wallet"; import Account from "ethereumjs-account"; @@ -31,7 +31,9 @@ const _isMining = Symbol("isMining"); const _options = Symbol("options"); const _wallet = Symbol("wallet"); -export default class Ledger extends BaseLedger { +export default class EthereumApi implements Api { + readonly [index: string]: (...args: any) => Promise; + private readonly [_blockchain]: Blockchain; private [_isMining] = false; private readonly [_options]: EthereumOptions; @@ -45,8 +47,6 @@ export default class Ledger extends BaseLedger { * @param ready Callback for when the ledger is fully initialized */ constructor(options: EthereumOptions, emitter: Emitter) { - super(); - const opts = (this[_options] = options); this[_wallet] = new Wallet(opts); diff --git a/src/ledgers/ethereum/blockchain.ts b/src/ledgers/ethereum/blockchain.ts index 5147563dd8..31fabdac6f 100644 --- a/src/ledgers/ethereum/blockchain.ts +++ b/src/ledgers/ethereum/blockchain.ts @@ -5,15 +5,15 @@ import BlockManager, {Block} from "./components/block-manager"; import TransactionManager from "./components/transaction-manager"; import Trie from "merkle-patricia-tree"; import {BN} from "ethereumjs-util"; -import Account from "../../types/account"; +import Account from "../../things/account"; import {promisify} from "util"; -import {Quantity, Data} from "../../types/json-rpc"; +import {Quantity, Data} from "../../things/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; import Heap from "../../utils/heap"; -import Transaction from "../../types/transaction"; +import Transaction from "../../things/transaction"; import Manager from "./components/manager"; -import TransactionReceipt from "../../types/transaction-receipt"; +import TransactionReceipt from "../../things/transaction-receipt"; import {encode as rlpEncode} from "rlp"; import Common from "ethereumjs-common"; diff --git a/src/ledgers/ethereum/components/account-manager.ts b/src/ledgers/ethereum/components/account-manager.ts index 3dc8ba96a5..7dd186d071 100644 --- a/src/ledgers/ethereum/components/account-manager.ts +++ b/src/ledgers/ethereum/components/account-manager.ts @@ -1,8 +1,8 @@ -import Account from "../../../types/account"; -import Address from "../../../types/address"; +import Account from "../../../things/account"; +import Address from "../../../things/address"; import Trie from "merkle-patricia-tree/baseTrie"; import Blockchain from "../blockchain"; -import Tag from "../../../types/tags"; +import Tag from "../../../things/tags"; import {LevelUp} from "levelup"; export default class AccountManager { diff --git a/src/ledgers/ethereum/components/block-manager.ts b/src/ledgers/ethereum/components/block-manager.ts index 20f9a95722..428c530f1f 100644 --- a/src/ledgers/ethereum/components/block-manager.ts +++ b/src/ledgers/ethereum/components/block-manager.ts @@ -1,10 +1,10 @@ import EthereumJsBlock from "ethereumjs-block"; import Manager from "./manager"; -import Tag from "../../../types/tags"; +import Tag from "../../../things/tags"; import levelup from "levelup"; import Blockchain from "../blockchain"; -import {Quantity, Data} from "../../../types/json-rpc"; -import Transaction from "../../../types/transaction"; +import {Quantity, Data} from "../../../things/json-rpc"; +import Transaction from "../../../things/transaction"; import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; diff --git a/src/ledgers/ethereum/components/manager.ts b/src/ledgers/ethereum/components/manager.ts index d5d7a648f3..78aea20dcb 100644 --- a/src/ledgers/ethereum/components/manager.ts +++ b/src/ledgers/ethereum/components/manager.ts @@ -1,5 +1,5 @@ import levelup from "levelup"; -import {Data} from "../../../types/json-rpc"; +import {Data} from "../../../things/json-rpc"; import Blockchain from "../blockchain"; const NOTFOUND = 404; diff --git a/src/ledgers/ethereum/components/transaction-manager.ts b/src/ledgers/ethereum/components/transaction-manager.ts index 65e82c3335..63929b8204 100644 --- a/src/ledgers/ethereum/components/transaction-manager.ts +++ b/src/ledgers/ethereum/components/transaction-manager.ts @@ -1,4 +1,4 @@ -import Transaction from "../../../types/transaction"; +import Transaction from "../../../things/transaction"; import Manager from "./manager"; import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; import levelup from "levelup"; diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/src/ledgers/ethereum/components/transaction-pool.ts index 949c45dcf7..bff947719e 100644 --- a/src/ledgers/ethereum/components/transaction-pool.ts +++ b/src/ledgers/ethereum/components/transaction-pool.ts @@ -1,8 +1,8 @@ import Emittery from "emittery"; import Blockchain from "../blockchain"; import Heap from "../../../utils/heap"; -import Transaction from "../../../types/transaction"; -import {Data, Quantity} from "../../../types/json-rpc"; +import Transaction from "../../../things/transaction"; +import {Data, Quantity} from "../../../things/json-rpc"; export type TransactionPoolOptions = { /** diff --git a/src/ledgers/ethereum/index.ts b/src/ledgers/ethereum/index.ts index aaa72466f4..717cd827a1 100644 --- a/src/ledgers/ethereum/index.ts +++ b/src/ledgers/ethereum/index.ts @@ -1,181 +1,36 @@ -import {Quantity, Data} from "../../types/json-rpc"; import ProviderOptions, {getDefault as getDefaultProviderOptions} from "../../options/provider-options"; import Emittery from "emittery"; -import Ledger from "../../ledgers/ethereum/ledger"; -import {publicToAddress, privateToAddress} from "ethereumjs-util"; -import Account from "../../types/account"; -import {mnemonicToSeedSync} from "bip39"; -import Address from "../../types/address"; +import EthereumApi from "./api"; import JsonRpc from "../../servers/utils/jsonrpc"; -import EthereumOptions from "../../ledgers/ethereum/options"; -import cloneDeep from "lodash.clonedeep"; -import secp256k1 from "secp256k1"; -import HDKey from "hdkey"; -import {ILedger} from "../../interfaces/base-ledger"; -import {IProvider} from "../../interfaces/IProvider"; +import Connector from "../../interfaces/connector"; +import { RequestType } from "../../types"; +import EthereumProvider from "./provider"; +import { RecognizedString } from "uWebSockets.js"; -const WEI = 1000000000000000000n; +export default class EthereumConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> + implements Connector> { -interface Callback { - (err?: Error, response?: JsonRpc.Response): void; -} - -type KnownKeys = { - [K in keyof T]: string extends K ? never : number extends K ? never : K; -} extends {[_ in keyof T]: infer U} - ? U - : never; - -type RequestType = (eventDetails: { - ledger: T; - method: KnownKeys; - params?: Parameters; -}) => ReturnType; - -export default class EthereumProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> - implements IProvider { - #options: ProviderOptions; - #ledger: Ledger; - #wallet: HDKey; + #provider: EthereumProvider; + get provider() { + return this.#provider; + } constructor(providerOptions?: ProviderOptions) { super(); - const _providerOptions = (this.#options = getDefaultProviderOptions(providerOptions)); - this.#wallet = HDKey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); - - const accounts = this.#initializeAccounts(); - // ethereum options' `accounts` are different than the provider options' - // `accounts`, fix that up here: - const ethereumOptions = (_providerOptions as any) as EthereumOptions; - ethereumOptions.accounts = accounts; - const emitter = this as any; - this.#ledger = new Ledger(ethereumOptions, emitter); + this.#provider = new EthereumProvider(providerOptions); } - // TODO: this doesn't seem like a provider-level function. Maybe we should - // move this into the Ledger or its Blockchain? - #initializeAccounts = (): Account[] => { - const _providerOptions = this.#options; - const etherInWei = Quantity.from(Quantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); - let accounts: Account[]; - - let givenAccounts = _providerOptions.accounts; - let accountsLength; - if (givenAccounts && (accountsLength = givenAccounts.length) !== 0) { - const wallet = this.#wallet; - const hdPath = this.#options.hdPath; - accounts = Array(accountsLength); - for (let i = 0; i < accountsLength; i++) { - const account = givenAccounts[i]; - const secretKey = account.secretKey; - let privateKey; - let address: Address; - if (!secretKey) { - const acct = wallet.derive(hdPath + i); - const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); - address = Address.from(publicToAddress(publicKey)); - privateKey = Data.from(acct.privateKey); - } else { - privateKey = Data.from(secretKey); - } - accounts[i] = EthereumProvider.createAccount(Quantity.from(account.balance), privateKey, address); - } - } else { - const numerOfAccounts = _providerOptions.total_accounts; - if (numerOfAccounts) { - accounts = Array(numerOfAccounts); - const hdPath = this.#options.hdPath; - const wallet = this.#wallet; - - for (let index = 0; index < numerOfAccounts; index++) { - const acct = wallet.derive(hdPath + index); - const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); - const address = Address.from(publicToAddress(publicKey)); - const privateKey = Data.from(acct.privateKey); - accounts[index] = EthereumProvider.createAccount(etherInWei, privateKey, address); - } - } else { - throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); - } - } - return accounts; - }; - - // TODO: this should probable be moved as well (see `initializeAccounts` above) - static createAccount(balance: Quantity, privateKey: Data, address?: Address) { - address = address || Address.from(privateToAddress(privateKey.toBuffer())); - - const account = new Account(address); - account.privateKey = privateKey; - account.balance = balance; - - return account; + parse = (message: Buffer) => { + return JSON.parse(message as any) as JsonRpc.Request; } - public getOptions() { - return cloneDeep(this.#options); + handle(payload: JsonRpc.Request): Promise { + return this.#provider.request(payload.method, payload.params); } - public send(payload: JsonRpc.Request, callback?: Callback): void; - public send(method: KnownKeys, params?: any[]): Promise; - public send(arg1: KnownKeys | JsonRpc.Request, arg2?: Callback | any[]): Promise { - let method: KnownKeys; - let params: any[]; - let response: Promise<{}>; - if (typeof arg1 === "string") { - method = arg1; - params = arg2 as any[]; - response = this.request(method, params); - } else if (typeof arg2 === "function") { - // handle backward compatibility with callback-style ganache-core - const payload = arg1; - const callback = arg2 as Callback; - method = payload.method as KnownKeys; - params = payload.params; - - this.emit("request", {ledger: this.#ledger, method, params}) - .then( - ([result]) => - void process.nextTick(callback, null, JsonRpc.Response(payload.id, JSON.parse(JSON.stringify(result)))) - ) - .catch(err => void process.nextTick(callback, err)); - } else { - throw new Error( - "No callback provided to provider's send function. As of web3 1.0, provider.send " + - "is no longer synchronous and must be passed a callback as its final argument." - ); - } - - const _options = this.#options; - if (_options.verbose) { - _options.logger.log( - ` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}` - ); - } - - return response; + format(result: any, payload: JsonRpc.Request): RecognizedString { + const json = JsonRpc.Response(payload.id, result); + return JSON.stringify(json); } - - /** - * Legacy callback style API - * @param payload JSON-RPC payload - * @param callback callback - */ - public sendAsync(payload: JsonRpc.Request, callback?: Callback): void { - return this.send(payload, callback); - } - - public request(method: KnownKeys, params?: any[]): Promise { - return this.emit("request", {ledger: this.#ledger, method, params}).then(([result]) => { - // we convert to a string and then back to JSON to create a quick deep - // copy or the result values. - return JSON.parse(JSON.stringify(result)); - }); - } - - public close = async () => { - await this.emit("close"); - return; - }; } diff --git a/src/ledgers/ethereum/miner.ts b/src/ledgers/ethereum/miner.ts index cb8fd839b2..73c738d069 100644 --- a/src/ledgers/ethereum/miner.ts +++ b/src/ledgers/ethereum/miner.ts @@ -1,7 +1,7 @@ -import params from "../../types/params"; +import params from "../../things/params"; import Heap from "../../utils/heap"; -import Transaction from "../../types/transaction"; -import {Quantity, Data} from "../../types/json-rpc"; +import Transaction from "../../things/transaction"; +import {Quantity, Data} from "../../things/json-rpc"; import {promisify} from "util"; import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; diff --git a/src/ledgers/ethereum/options.ts b/src/ledgers/ethereum/options.ts index 853f94ec5a..22482da0b9 100644 --- a/src/ledgers/ethereum/options.ts +++ b/src/ledgers/ethereum/options.ts @@ -1,5 +1,5 @@ import Options from "../../options/provider-options"; -import Account from "../../types/account"; +import Account from "../../things/account"; type EthereumOptions = Pick< Options, diff --git a/src/ledgers/ethereum/provider.ts b/src/ledgers/ethereum/provider.ts new file mode 100644 index 0000000000..e8507f6c25 --- /dev/null +++ b/src/ledgers/ethereum/provider.ts @@ -0,0 +1,170 @@ +import {Quantity, Data} from "../../things/json-rpc"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "../../options/provider-options"; +import Emittery from "emittery"; +import EthereumApi from "./api"; +import {publicToAddress, privateToAddress} from "ethereumjs-util"; +import Account from "../../things/account"; +import {mnemonicToSeedSync} from "bip39"; +import Address from "../../things/address"; +import JsonRpc from "../../servers/utils/jsonrpc"; +import EthereumOptions from "../../ledgers/ethereum/options"; +import cloneDeep from "lodash.clonedeep"; +import secp256k1 from "secp256k1"; +import HDKey from "hdkey"; +import { RequestType, KnownKeys } from "../../types"; +import { Provider } from "../../interfaces/provider"; + +const WEI = 1000000000000000000n; + +interface Callback { + (err?: Error, response?: JsonRpc.Response): void; +} + + +export default class EthereumProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> + implements Provider { + #options: ProviderOptions; + #api: EthereumApi; + #wallet: HDKey; + + constructor(providerOptions?: ProviderOptions) { + super(); + const _providerOptions = (this.#options = getDefaultProviderOptions(providerOptions)); + + this.#wallet = HDKey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); + + const accounts = this.#initializeAccounts(); + // ethereum options' `accounts` are different than the provider options' + // `accounts`, fix that up here: + const ethereumOptions = (_providerOptions as any) as EthereumOptions; + ethereumOptions.accounts = accounts; + const emitter = this as any; + this.#api = new EthereumApi(ethereumOptions, emitter); + } + + // TODO: this doesn't seem like a provider-level function. Maybe we should + // move this into the Ledger or its Blockchain? + #initializeAccounts = (): Account[] => { + const _providerOptions = this.#options; + const etherInWei = Quantity.from(Quantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); + let accounts: Account[]; + + let givenAccounts = _providerOptions.accounts; + let accountsLength; + if (givenAccounts && (accountsLength = givenAccounts.length) !== 0) { + const wallet = this.#wallet; + const hdPath = this.#options.hdPath; + accounts = Array(accountsLength); + for (let i = 0; i < accountsLength; i++) { + const account = givenAccounts[i]; + const secretKey = account.secretKey; + let privateKey; + let address: Address; + if (!secretKey) { + const acct = wallet.derive(hdPath + i); + const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); + address = Address.from(publicToAddress(publicKey)); + privateKey = Data.from(acct.privateKey); + } else { + privateKey = Data.from(secretKey); + } + accounts[i] = EthereumProvider.createAccount(Quantity.from(account.balance), privateKey, address); + } + } else { + const numerOfAccounts = _providerOptions.total_accounts; + if (numerOfAccounts) { + accounts = Array(numerOfAccounts); + const hdPath = this.#options.hdPath; + const wallet = this.#wallet; + + for (let index = 0; index < numerOfAccounts; index++) { + const acct = wallet.derive(hdPath + index); + const publicKey = secp256k1.publicKeyConvert(acct.publicKey as Buffer, false).slice(1); + const address = Address.from(publicToAddress(publicKey)); + const privateKey = Data.from(acct.privateKey); + accounts[index] = EthereumProvider.createAccount(etherInWei, privateKey, address); + } + } else { + throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); + } + } + return accounts; + }; + + // TODO: this should probable be moved as well (see `initializeAccounts` above) + static createAccount(balance: Quantity, privateKey: Data, address?: Address) { + address = address || Address.from(privateToAddress(privateKey.toBuffer())); + + const account = new Account(address); + account.privateKey = privateKey; + account.balance = balance; + + return account; + } + + public getOptions() { + return cloneDeep(this.#options); + } + + public send(payload: JsonRpc.Request, callback?: Callback): void; + public send(method: KnownKeys, params?: any[]): Promise; + public send(arg1: KnownKeys | JsonRpc.Request, arg2?: Callback | any[]): Promise { + let method: KnownKeys; + let params: any[]; + let response: Promise<{}>; + if (typeof arg1 === "string") { + method = arg1; + params = arg2 as any[]; + response = this.request(method, params); + } else if (typeof arg2 === "function") { + // handle backward compatibility with callback-style ganache-core + const payload = arg1; + const callback = arg2 as Callback; + method = payload.method as KnownKeys; + params = payload.params; + + this.emit("request", {api: this.#api, method, params}) + .then( + ([result]) => + void process.nextTick(callback, null, JsonRpc.Response(payload.id, JSON.parse(JSON.stringify(result)))) + ) + .catch(err => void process.nextTick(callback, err)); + } else { + throw new Error( + "No callback provided to provider's send function. As of web3 1.0, provider.send " + + "is no longer synchronous and must be passed a callback as its final argument." + ); + } + + const _options = this.#options; + if (_options.verbose) { + _options.logger.log( + ` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}` + ); + } + + return response; + } + + /** + * Legacy callback style API + * @param payload JSON-RPC payload + * @param callback callback + */ + public sendAsync(payload: JsonRpc.Request, callback?: Callback): void { + return this.send(payload, callback); + } + + public request(method: KnownKeys, params?: any[]): Promise { + return this.emit("request", {api: this.#api, method, params}).then(([result]) => { + // we convert to a string and then back to JSON to create a quick deep + // copy or the result values. + return JSON.parse(JSON.stringify(result)); + }); + } + + public close = async () => { + await this.emit("close"); + return; + }; +} diff --git a/src/ledgers/ethereum/wallet.ts b/src/ledgers/ethereum/wallet.ts index 53ae3310c4..9d8d0a1e30 100644 --- a/src/ledgers/ethereum/wallet.ts +++ b/src/ledgers/ethereum/wallet.ts @@ -1,7 +1,7 @@ -import {Data} from "../../types/json-rpc"; -import Address from "../../types/address"; +import {Data} from "../../things/json-rpc"; +import Address from "../../things/address"; import EthereumOptions from "./options"; -import Account from "../../types/account"; +import Account from "../../things/account"; import {toChecksumAddress} from "ethereumjs-util"; export default class Wallet { diff --git a/src/ledgers/tezos/api.ts b/src/ledgers/tezos/api.ts new file mode 100644 index 0000000000..9470c306a1 --- /dev/null +++ b/src/ledgers/tezos/api.ts @@ -0,0 +1,9 @@ +import Api from "../../interfaces/api"; + +export default class TezosApi implements Api { + readonly [index: string]: (...args: any) => Promise; + + async version(): Promise { + return "just an example"; + } +} \ No newline at end of file diff --git a/src/ledgers/tezos/index.ts b/src/ledgers/tezos/index.ts new file mode 100644 index 0000000000..e919219b7c --- /dev/null +++ b/src/ledgers/tezos/index.ts @@ -0,0 +1,41 @@ +import Emittery from "emittery"; +import { RequestType } from "../../types"; +import Connector from "../../interfaces/connector"; +import TezosProvider from "./provider"; +import JsonRpc from "../../servers/utils/jsonrpc"; +import ProviderOptions from "../../options/provider-options"; +import TezosApi from "./api"; + + + + +export default class TezosConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> + implements Connector { + provider: TezosProvider; + #api: TezosApi; + + constructor(providerOptions: ProviderOptions) { + super(); + + const api = this.#api = new TezosApi(); + this.provider = new TezosProvider(); + } + + format(result: any) { + return JSON.stringify(JsonRpc.Response("123", result)); + } + + parse = (message: Buffer) => { + return JsonRpc.Request(JSON.parse(message as any)) + } + + handle = async (payload: any) => { + const [result] = await this.emit("request", { api: this.#api, method: payload.method, params: payload.params }); + return result; + } + + close() { + return {} as any; + } +} + diff --git a/src/ledgers/tezos/provider.ts b/src/ledgers/tezos/provider.ts new file mode 100644 index 0000000000..3d6ea3ea8e --- /dev/null +++ b/src/ledgers/tezos/provider.ts @@ -0,0 +1,12 @@ +import { Provider } from "../../interfaces/provider"; +import TezosApi from "./api"; +import { KnownKeys } from "../../types"; + +export default class TezosProvider implements Provider { + request = async (method: KnownKeys, params?: any[]) => { + return {} as any; + } + close = async () => { + + } +} \ No newline at end of file diff --git a/src/options/options.ts b/src/options/options.ts index 2b22685816..7de20035f0 100644 --- a/src/options/options.ts +++ b/src/options/options.ts @@ -1,5 +1,5 @@ -import {Quantity} from "../types/json-rpc"; -import {ILedger} from "../interfaces/base-ledger"; +import {Quantity} from "../things/json-rpc"; +import Api from "../interfaces/api"; interface Logger { log(message?: any, ...optionalParams: any[]): void; @@ -11,7 +11,7 @@ interface Logger { type Account = {balance: string; secretKey?: string}; export default interface Options { - ledger?: ILedger; + api?: Api; /** * Array of Accounts. Each object should have a balance key with a hexadecimal * value. The key secretKey can also be specified, which represents the diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index b7e0db96d4..18dd55f5c9 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -1,16 +1,26 @@ import Options, {getDefault as getDefaultOptions} from "./options"; -import EthereumProvider from "../ledgers/ethereum"; +import TezosConnector from "../ledgers/tezos"; +import EthereumConnector from "../ledgers/ethereum"; import {entropyToMnemonic} from "bip39"; import seedrandom, {seedrandom_prng} from "seedrandom"; +import Connector from "../interfaces/connector"; -export const Flavors = { - ethereum: EthereumProvider +export const FlavorMap = { + tezos: TezosConnector, + ethereum: EthereumConnector, }; -export type Flavors = { - ethereum: EthereumProvider; +export type FlavorMap = { + tezos: TezosConnector; + ethereum: EthereumConnector; }; +export type Flavors = { + [k in keyof FlavorMap]: FlavorMap[k] +}[keyof FlavorMap]; + +export type Apis = T extends Connector ? R : never; + function randomBytes(length: number, rng: () => number) { const buf = Buffer.allocUnsafe(length); for (let i = 0; i < length; i++) { @@ -38,14 +48,14 @@ export default interface ProviderOptions extends Options { */ subProviders?: any[]; - flavor?: keyof typeof Flavors; + flavor?: keyof typeof FlavorMap; } export const getDefault: (options: ProviderOptions) => ProviderOptions = options => { const _options = Object.assign( { subProviders: [], - flavor: "ethereum" as keyof typeof Flavors + flavor: "ethereum" as keyof typeof FlavorMap }, getDefaultOptions(options) ); diff --git a/src/options/server-options.ts b/src/options/server-options.ts index a72f520a2f..540709bcb2 100644 --- a/src/options/server-options.ts +++ b/src/options/server-options.ts @@ -1,5 +1,5 @@ import ProviderOptions, {getDefault as getDefaultProviderOptions} from "./provider-options"; -export {Flavors} from "./provider-options"; +export {Apis, Flavors, FlavorMap} from "./provider-options"; export default interface ServerOptions extends ProviderOptions { /** diff --git a/src/server.ts b/src/server.ts index df90839cba..b28d93a867 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,10 +1,10 @@ import ServerOptions, {Flavors, getDefault as getDefaultServerOptions} from "./options/server-options"; import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; -import Provider from "./provider"; +import Connector from "./connector"; import WebsocketServer from "./servers/ws-server"; import HttpServer from "./servers/http-server"; -import {ILedger} from "./interfaces/base-ledger"; +import { FlavorMap } from "./options/provider-options"; export enum Status { // These are bit flags @@ -19,12 +19,12 @@ export default class Server { #httpServer: HttpServer; #listenSocket: us_listen_socket; #options: ServerOptions; - #provider: Flavors[T["flavor"]]; + #connector: FlavorMap[T["flavor"]]; #status = Status.closed; - #websocketServer: WebsocketServer; + #websocketServer: WebsocketServer; public get provider() { - return this.#provider; + return this.#connector.provider; } public get status() { @@ -33,28 +33,34 @@ export default class Server { constructor(serverOptions?: T) { const opts = (this.#options = getDefaultServerOptions(serverOptions)); - const prov = (this.#provider = Provider.initialize(opts)); + const connector = Connector.initialize(opts); const _app = (this.#app = uWS.App()); if (this.#options.ws) { - this.#websocketServer = new WebsocketServer(_app, prov, opts); + this.#websocketServer = new WebsocketServer(_app, connector as any, opts); } - this.#httpServer = new HttpServer(_app, prov); + this.#httpServer = new HttpServer(_app, connector as any); } - async listen(port: number, callback?: (err: Error) => void): Promise { + async listen(port: string | number, callback?: (err: Error) => void): Promise { + const callbackIsFunction = typeof callback === "function"; let err: Error; // if open or opening if (this.#status & Status.open) { err = new Error(`Server is already listening on port: ${port}`); + // ensure sure we don't call the `callback` in the current event loop, otherwise an error in the callback would + // bubble back up into this function. This is a problem here because we aren't awaiting anything + if (callbackIsFunction) { + callback = (err: Error) => process.nextTick(callback, err); + } } else { this.#status = Status.opening; const _listenSocket = await new Promise(resolve => { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + this.#app.listen(port.toString(10), LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); }); if (_listenSocket) { @@ -68,7 +74,7 @@ export default class Server { } // support legacy callback style - if (typeof callback === "function") { + if (callbackIsFunction) { callback(err); } else if (err) { throw err; @@ -92,6 +98,6 @@ export default class Server { // and do all http cleanup, if any this.#httpServer.close(); this.#status = Status.closed; - await this.#provider.close(); + await this.provider.close(); } } diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index e1637f1a24..9d7e6fcc9f 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -1,10 +1,9 @@ import {TemplatedApp, HttpResponse, HttpRequest, RecognizedString} from "uWebSockets.js"; import ContentTypes from "./utils/content-types"; -import Provider from "../provider"; import JsonRpc from "./utils/jsonrpc"; import HttpResponseCodes from "./utils/http-response-codes"; -import {IProvider} from "../interfaces/IProvider"; -import {ILedger} from "../interfaces/base-ledger"; +import Connector from "../interfaces/connector"; +import { Apis } from "../options/server-options"; const noop = () => {}; @@ -81,9 +80,9 @@ function sendResponse( } export default class HttpServer { - #provider: IProvider; - constructor(app: TemplatedApp, provider: IProvider) { - this.#provider = provider; + #connector: Connector; + constructor(app: TemplatedApp, connector: Connector) { + this.#connector = connector; // JSON-RPC routes... app.post("/", this.#handlePost).options("/", this.#handleOptions); @@ -120,10 +119,11 @@ export default class HttpServer { response.onData((message: ArrayBuffer, isLast: boolean) => { const chunk = Buffer.from(message); if (isLast) { - let payload: JsonRpc.Request; + const connector = this.#connector; + let payload: ReturnType; try { - const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk) as any; - payload = JsonRpc.Request(JSON.parse(message)); + const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk); + payload = connector.parse(message); } catch (e) { sendResponse( response, @@ -151,16 +151,17 @@ export default class HttpServer { ); break; default: - // `await`ing the `provider.send` instead of using `then` causes uWS - // to delay cleaning up the `request` object, which we don't neccessarily want to delay. - this.#provider.request(method, payload.params).then(result => { + // `await`ing the `connector.handle` instead of using `then` causes + // uWS to delay cleaning up the `request` object, which we don't + // neccessarily want to delay. + connector.handle(payload).then(result => { if (aborted) { // if the request has been aborted don't try sending (it'll // cause an `Unhandled promise rejection` if we try) return; } - const json = JsonRpc.Response(id, result); - sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, JSON.stringify(json), writeHeaders); + const data = connector.format(result, payload); + sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); }); break; } diff --git a/src/servers/utils/jsonrpc.ts b/src/servers/utils/jsonrpc.ts index b1b90e34a4..60d5a5cd57 100644 --- a/src/servers/utils/jsonrpc.ts +++ b/src/servers/utils/jsonrpc.ts @@ -1,4 +1,4 @@ -import {ILedger} from "../../interfaces/base-ledger"; +import Api from "../../interfaces/api"; type KnownKeys = { [K in keyof T]: string extends K ? never : number extends K ? never : K; @@ -13,7 +13,7 @@ namespace JsonRpc { jsonrpc: string; toString(): string; }; - export type Request = JsonRpc & { + export type Request = JsonRpc & { id: string; jsonrpc: string; method: KnownKeys; @@ -28,7 +28,7 @@ namespace JsonRpc { message: any; }; }; - export const Request = (json: any): Request => { + export const Request = (json: any): Request => { return { id: json.id, jsonrpc, diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index be4b9af5e0..ef4a805296 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -1,12 +1,11 @@ import uWS, {TemplatedApp, WebSocket} from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; -import JsonRpc from "./utils/jsonrpc"; -import {IProvider} from "../interfaces/IProvider"; -import {ILedger} from "../interfaces/base-ledger"; +import Connector from "../interfaces/connector"; +import { Apis } from "../options/server-options"; -export default class WebsocketServer { +export default class WebsocketServer { #connections = new Set(); - constructor(app: TemplatedApp, provider: IProvider, options: any) { + constructor(app: TemplatedApp, connector: Connector, options: any) { app.ws("/", { /* WS Options */ compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression @@ -14,28 +13,23 @@ export default class WebsocketServer { idleTimeout: 120, // in seconds /* Handlers */ - open: (ws: any) => { + open: (ws: WebSocket) => { this.#connections.add(ws); }, - message: async (ws: any, message: ArrayBuffer, isBinary: boolean) => { - let payload: JsonRpc.Request; + message: async (ws: WebSocket, message: ArrayBuffer, isBinary: boolean) => { + let payload: ReturnType; try { - payload = JSON.parse(Buffer.from(message) as any); + payload = connector.parse(Buffer.from(message)); } catch (e) { ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); return; } - const method = payload.method; - const result = await provider.request(method, payload.params); + const result = await connector.handle(payload); // The socket may have closed while we were waiting for the response - // Don't bother trying to send to it now. + // Don't bother trying to send to it if it was. if (!ws.closed) { - const json = { - id: payload.id, - jsonrpc: "2.0", - result: result - }; - ws.send(JSON.stringify(json), isBinary, true); + const message = connector.format(result, payload); + ws.send(message, isBinary, true); } }, drain: (ws: WebSocket) => { diff --git a/src/types/account.ts b/src/things/account.ts similarity index 100% rename from src/types/account.ts rename to src/things/account.ts diff --git a/src/types/address.ts b/src/things/address.ts similarity index 100% rename from src/types/address.ts rename to src/things/address.ts diff --git a/src/types/errors.ts b/src/things/errors.ts similarity index 100% rename from src/types/errors.ts rename to src/things/errors.ts diff --git a/src/types/json-rpc/index.ts b/src/things/json-rpc/index.ts similarity index 100% rename from src/types/json-rpc/index.ts rename to src/things/json-rpc/index.ts diff --git a/src/types/json-rpc/json-rpc-base-types.ts b/src/things/json-rpc/json-rpc-base-types.ts similarity index 100% rename from src/types/json-rpc/json-rpc-base-types.ts rename to src/things/json-rpc/json-rpc-base-types.ts diff --git a/src/types/json-rpc/json-rpc-data.ts b/src/things/json-rpc/json-rpc-data.ts similarity index 100% rename from src/types/json-rpc/json-rpc-data.ts rename to src/things/json-rpc/json-rpc-data.ts diff --git a/src/types/json-rpc/json-rpc-quantity.ts b/src/things/json-rpc/json-rpc-quantity.ts similarity index 100% rename from src/types/json-rpc/json-rpc-quantity.ts rename to src/things/json-rpc/json-rpc-quantity.ts diff --git a/src/types/params.ts b/src/things/params.ts similarity index 100% rename from src/types/params.ts rename to src/things/params.ts diff --git a/src/types/tags.ts b/src/things/tags.ts similarity index 100% rename from src/types/tags.ts rename to src/things/tags.ts diff --git a/src/types/transaction-receipt.ts b/src/things/transaction-receipt.ts similarity index 100% rename from src/types/transaction-receipt.ts rename to src/things/transaction-receipt.ts diff --git a/src/types/transaction.ts b/src/things/transaction.ts similarity index 100% rename from src/types/transaction.ts rename to src/things/transaction.ts diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000000..b54061897d --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,14 @@ +import Api from "../interfaces/api"; + +export type KnownKeys = { + [K in keyof T]: string extends K ? never : number extends K ? never : K; +} extends {[_ in keyof T]: infer U} + ? U + : never; + +export type RequestType = (eventDetails: { + api: T; + method: KnownKeys; + params?: Parameters; + }) => ReturnType; + \ No newline at end of file diff --git a/src/utils/executor.ts b/src/utils/executor.ts index c58cfaa38a..396b79e616 100644 --- a/src/utils/executor.ts +++ b/src/utils/executor.ts @@ -1,4 +1,4 @@ -import {ILedger} from "../interfaces/base-ledger"; +import Api from "../interfaces/api"; import Emittery from "emittery"; export default class Executor extends Emittery { @@ -14,8 +14,8 @@ export default class Executor extends Emittery { * @param methodName The name of the JSON-RPC method to execute. * @param params The params to pass to the JSON-RPC method. */ - public execute = async ( - ledger: T, + public execute = async ( + api: T, methodName: M, params: Parameters ): Promise> => { @@ -23,12 +23,12 @@ export default class Executor extends Emittery { // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { // Only allow executing our *own* methods: - if (methodName !== "constructor" && ledger.__proto__.hasOwnProperty(methodName)) { - const fn = ledger[methodName]; + if (methodName !== "constructor" && api.__proto__.hasOwnProperty(methodName)) { + const fn = api[methodName]; // just double check, in case a Ledger breaks the rules and adds non-fns // to their Ledger interface. if (typeof fn === "function") { - return fn.apply(ledger, params); + return fn.apply(api, params); } } } diff --git a/test/helpers/getProvider.ts b/test/helpers/getProvider.ts index cb9f801f3b..d1fdd3b7e0 100644 --- a/test/helpers/getProvider.ts +++ b/test/helpers/getProvider.ts @@ -1,5 +1,4 @@ import Ganache from "../../src/"; -import Provider from "../../src/provider"; import ProviderOptions from "../../src/options/provider-options"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; @@ -8,4 +7,3 @@ const GetProvider = (options: ProviderOptions = {flavor: "ethereum", mnemonic}) }; export default GetProvider; -export {Provider}; diff --git a/test/ledger.ts b/test/ledger.ts index 41ad603f1a..92edf812ab 100644 --- a/test/ledger.ts +++ b/test/ledger.ts @@ -1,8 +1,7 @@ import assert from "assert"; -import GetProvider, {Provider} from "./helpers/getProvider"; +import GetProvider from "./helpers/getProvider"; import sleep from "./helpers/sleep"; -import {IProvider} from "../src/interfaces/IProvider"; -import {ILedger} from "../src/interfaces/base-ledger"; +import EthereumProvider from "../src/ledgers/ethereum/provider"; describe("ledger", () => { let provider: any; diff --git a/test/provider.ts b/test/provider.ts index 590507e49c..05725be79c 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -1,15 +1,15 @@ import Ganache from "../src/"; import assert from "assert"; -import Provider from "../src/ledgers/ethereum"; +import EthereumProvider from "../src/ledgers/ethereum/provider"; describe("provider", () => { const networkId = "1234"; - let p: Provider; + let p: EthereumProvider; beforeEach("set up", () => { p = Ganache.provider({ network_id: networkId - }); + }) as EthereumProvider }); it("works without passing options", async () => { @@ -22,7 +22,7 @@ describe("provider", () => { assert.strictEqual(msg, " > net_version: undefined"); } }; - const p = Ganache.provider({logger, verbose: true}); + const p = Ganache.provider({logger, verbose: true}) as EthereumProvider; logger.log = msg => { assert.strictEqual(msg, " > net_version: undefined", "doesn't work when no params"); @@ -44,7 +44,7 @@ describe("provider", () => { }); it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { - const p = Ganache.provider(); + const p = Ganache.provider() as EthereumProvider; const accounts = await p.send("eth_accounts"); // eth_accounts should always be faster than eth_getBalance; it should // return before eth_getBalance because of the `asyncRequestProcessing` flag @@ -56,7 +56,7 @@ describe("provider", () => { }); it("it processes requests in order when `asyncRequestProcessing` is false", async () => { - const p = Ganache.provider({asyncRequestProcessing: false}); + const p = Ganache.provider({asyncRequestProcessing: false}) as EthereumProvider; const accounts = await p.send("eth_accounts"); // eth_accounts should always be faster than eth_getBalance, but shouldn't // return before eth_getBalance because of the `asyncRequestProcessing` flag @@ -69,7 +69,7 @@ describe("provider", () => { }); it("generates predictable accounts when given a seed", async () => { - const p = Ganache.provider({seed: "temet nosce"}); + const p = Ganache.provider({seed: "temet nosce"}) as EthereumProvider; const accounts = await p.request("eth_accounts"); assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); }); diff --git a/test/temp-tests.ts b/test/temp-tests.ts index 6b7c9a5ec9..c38b0e61ef 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -1,6 +1,7 @@ import Ganache from "../src"; import assert from "assert"; -import {Quantity} from "../src/types/json-rpc"; +import {Quantity} from "../src/things/json-rpc"; +import EthereumProvider from "../src/ledgers/ethereum/provider"; const solc = require("solc"); function compileSolidity(source: string) { @@ -40,7 +41,7 @@ describe("Accounts", () => { it("should respect the BIP99 mnemonic", async () => { const options = {mnemonic}; - const p = Ganache.provider(options); + const p = Ganache.provider(options) as EthereumProvider; const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts[0], expectedAddress); @@ -48,7 +49,7 @@ describe("Accounts", () => { it("eth_sendTransaction", async () => { const options = {mnemonic}; - const p = Ganache.provider(options); + const p = Ganache.provider(options) as EthereumProvider; const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); await p.send("eth_sendTransaction", [ @@ -66,7 +67,7 @@ describe("Accounts", () => { }).timeout(5000); it("should create its own mnemonic", async () => { - const p = Ganache.provider(); + const p = Ganache.provider() as EthereumProvider; const options = p.getOptions(); assert.deepStrictEqual(typeof options.mnemonic, "string"); }); @@ -97,7 +98,7 @@ describe("Accounts", () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }); + }) as EthereumProvider; const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts.length, 2); }); @@ -125,7 +126,7 @@ describe("Accounts", () => { const p = Ganache.provider({ locked: true, unlocked_accounts: ["0", 1] - }); + }) as EthereumProvider; const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); @@ -175,7 +176,7 @@ describe("Accounts", () => { ); const p = Ganache.provider({ defaultTransactionGasLimit: Quantity.from(6721975) - }); + }) as EthereumProvider; const accounts = await p.send("eth_accounts"); const transactionHash = await p.send("eth_sendTransaction", [ { @@ -218,7 +219,7 @@ describe("Accounts", () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }); + }) as EthereumProvider const accounts = await p.send("eth_accounts"); const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); assert(true); diff --git a/typings/emittery.d.ts b/typings/emittery.d.ts index 13f48525ab..6712ded619 100644 --- a/typings/emittery.d.ts +++ b/typings/emittery.d.ts @@ -12,8 +12,9 @@ interface Events { [eventName: any]: (args: Events) => Promise; } -declare module "emittery" { - export class Typed extends Emittery.Typed { +declare namespace Emittery { + declare class Typed { + hey: number; on>( eventName: Name, listener: (eventData: Parameters[0]) => void From 865fa3c29f310fb9c009040bcd013adc0330c248 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 18:56:33 -0400 Subject: [PATCH 155/691] Refactor lots --- src/connector.ts | 2 +- src/interfaces/connector.ts | 21 ++-- src/ledgers/ethereum/index.ts | 7 +- src/ledgers/ethereum/provider.ts | 5 +- src/ledgers/tezos/api.ts | 4 +- src/ledgers/tezos/index.ts | 17 ++- src/ledgers/tezos/provider.ts | 12 +- src/options/provider-options.ts | 4 +- src/server.ts | 2 +- src/servers/http-server.ts | 198 +++++++++++++++---------------- src/servers/ws-server.ts | 99 +++++++++------- src/types/index.ts | 9 +- test/provider.ts | 2 +- test/temp-tests.ts | 2 +- 14 files changed, 195 insertions(+), 189 deletions(-) diff --git a/src/connector.ts b/src/connector.ts index f48a939501..6f670bcd27 100644 --- a/src/connector.ts +++ b/src/connector.ts @@ -3,7 +3,7 @@ import RequestCoordinator from "./utils/request-coordinator"; import ProviderOptions, {FlavorMap} from "./options/provider-options"; import Emittery from "emittery"; import Connector from "./interfaces/connector"; -import { Provider } from "./interfaces/provider"; +import {Provider} from "./interfaces/provider"; import EthereumApi from "./ledgers/ethereum/api"; import EthereumProvider from "./ledgers/ethereum/provider"; diff --git a/src/interfaces/connector.ts b/src/interfaces/connector.ts index c8adb8718a..b21d0fc247 100644 --- a/src/interfaces/connector.ts +++ b/src/interfaces/connector.ts @@ -1,28 +1,29 @@ -import { Provider } from "./provider"; -import { RecognizedString } from "uWebSockets.js"; +import {Provider} from "./provider"; +import {RecognizedString} from "uWebSockets.js"; import Api from "./api"; import Emittery from "emittery"; -import { RequestType } from "../types"; +import {RequestType} from "../types"; -export default interface Connector extends Emittery.Typed<{request: RequestType}, "ready" | "close">{ +export default interface Connector + extends Emittery.Typed<{request: RequestType}, "ready" | "close"> { provider: Provider; - + /** * Parses a raw message into something that can be handled by `handle` - * @param message + * @param message */ parse(message: Buffer): RequestFormat; /** * Handles a parse message - * @param payload + * @param payload */ handle(payload: RequestFormat): Promise; /** * Formats the response (from handle) - * @param response - * @param payload + * @param response + * @param payload */ format(result: ResponseFormat, payload: RequestFormat): RecognizedString; -} \ No newline at end of file +} diff --git a/src/ledgers/ethereum/index.ts b/src/ledgers/ethereum/index.ts index 717cd827a1..ac61083970 100644 --- a/src/ledgers/ethereum/index.ts +++ b/src/ledgers/ethereum/index.ts @@ -3,13 +3,12 @@ import Emittery from "emittery"; import EthereumApi from "./api"; import JsonRpc from "../../servers/utils/jsonrpc"; import Connector from "../../interfaces/connector"; -import { RequestType } from "../../types"; +import {RequestType} from "../../types"; import EthereumProvider from "./provider"; -import { RecognizedString } from "uWebSockets.js"; +import {RecognizedString} from "uWebSockets.js"; export default class EthereumConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements Connector> { - #provider: EthereumProvider; get provider() { return this.#provider; @@ -23,7 +22,7 @@ export default class EthereumConnector extends Emittery.Typed<{request: RequestT parse = (message: Buffer) => { return JSON.parse(message as any) as JsonRpc.Request; - } + }; handle(payload: JsonRpc.Request): Promise { return this.#provider.request(payload.method, payload.params); diff --git a/src/ledgers/ethereum/provider.ts b/src/ledgers/ethereum/provider.ts index e8507f6c25..1f1bd943dc 100644 --- a/src/ledgers/ethereum/provider.ts +++ b/src/ledgers/ethereum/provider.ts @@ -11,8 +11,8 @@ import EthereumOptions from "../../ledgers/ethereum/options"; import cloneDeep from "lodash.clonedeep"; import secp256k1 from "secp256k1"; import HDKey from "hdkey"; -import { RequestType, KnownKeys } from "../../types"; -import { Provider } from "../../interfaces/provider"; +import {RequestType, KnownKeys} from "../../types"; +import {Provider} from "../../interfaces/provider"; const WEI = 1000000000000000000n; @@ -20,7 +20,6 @@ interface Callback { (err?: Error, response?: JsonRpc.Response): void; } - export default class EthereumProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements Provider { #options: ProviderOptions; diff --git a/src/ledgers/tezos/api.ts b/src/ledgers/tezos/api.ts index 9470c306a1..8a1d9c6dfc 100644 --- a/src/ledgers/tezos/api.ts +++ b/src/ledgers/tezos/api.ts @@ -2,8 +2,8 @@ import Api from "../../interfaces/api"; export default class TezosApi implements Api { readonly [index: string]: (...args: any) => Promise; - + async version(): Promise { return "just an example"; } -} \ No newline at end of file +} diff --git a/src/ledgers/tezos/index.ts b/src/ledgers/tezos/index.ts index e919219b7c..8a4d52df94 100644 --- a/src/ledgers/tezos/index.ts +++ b/src/ledgers/tezos/index.ts @@ -1,15 +1,12 @@ import Emittery from "emittery"; -import { RequestType } from "../../types"; +import {RequestType} from "../../types"; import Connector from "../../interfaces/connector"; import TezosProvider from "./provider"; import JsonRpc from "../../servers/utils/jsonrpc"; import ProviderOptions from "../../options/provider-options"; import TezosApi from "./api"; - - - -export default class TezosConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> +export default class TezosConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements Connector { provider: TezosProvider; #api: TezosApi; @@ -17,7 +14,7 @@ export default class TezosConnector extends Emittery.Typed<{request: RequestT constructor(providerOptions: ProviderOptions) { super(); - const api = this.#api = new TezosApi(); + const api = (this.#api = new TezosApi()); this.provider = new TezosProvider(); } @@ -26,13 +23,13 @@ export default class TezosConnector extends Emittery.Typed<{request: RequestT } parse = (message: Buffer) => { - return JsonRpc.Request(JSON.parse(message as any)) - } + return JsonRpc.Request(JSON.parse(message as any)); + }; handle = async (payload: any) => { - const [result] = await this.emit("request", { api: this.#api, method: payload.method, params: payload.params }); + const [result] = await this.emit("request", {api: this.#api, method: payload.method, params: payload.params}); return result; - } + }; close() { return {} as any; diff --git a/src/ledgers/tezos/provider.ts b/src/ledgers/tezos/provider.ts index 3d6ea3ea8e..275a524169 100644 --- a/src/ledgers/tezos/provider.ts +++ b/src/ledgers/tezos/provider.ts @@ -1,12 +1,10 @@ -import { Provider } from "../../interfaces/provider"; +import {Provider} from "../../interfaces/provider"; import TezosApi from "./api"; -import { KnownKeys } from "../../types"; +import {KnownKeys} from "../../types"; export default class TezosProvider implements Provider { request = async (method: KnownKeys, params?: any[]) => { return {} as any; - } - close = async () => { - - } -} \ No newline at end of file + }; + close = async () => {}; +} diff --git a/src/options/provider-options.ts b/src/options/provider-options.ts index 18dd55f5c9..d6c67d6de7 100644 --- a/src/options/provider-options.ts +++ b/src/options/provider-options.ts @@ -7,7 +7,7 @@ import Connector from "../interfaces/connector"; export const FlavorMap = { tezos: TezosConnector, - ethereum: EthereumConnector, + ethereum: EthereumConnector }; export type FlavorMap = { @@ -16,7 +16,7 @@ export type FlavorMap = { }; export type Flavors = { - [k in keyof FlavorMap]: FlavorMap[k] + [k in keyof FlavorMap]: FlavorMap[k]; }[keyof FlavorMap]; export type Apis = T extends Connector ? R : never; diff --git a/src/server.ts b/src/server.ts index b28d93a867..ad97d0f0ef 100644 --- a/src/server.ts +++ b/src/server.ts @@ -4,7 +4,7 @@ import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; import Connector from "./connector"; import WebsocketServer from "./servers/ws-server"; import HttpServer from "./servers/http-server"; -import { FlavorMap } from "./options/provider-options"; +import {FlavorMap} from "./options/provider-options"; export enum Status { // These are bit flags diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 9d7e6fcc9f..6df0ce3f88 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -3,7 +3,7 @@ import ContentTypes from "./utils/content-types"; import JsonRpc from "./utils/jsonrpc"; import HttpResponseCodes from "./utils/http-response-codes"; import Connector from "../interfaces/connector"; -import { Apis } from "../options/server-options"; +import {Apis} from "../options/server-options"; const noop = () => {}; @@ -80,108 +80,108 @@ function sendResponse( } export default class HttpServer { - #connector: Connector; - constructor(app: TemplatedApp, connector: Connector) { - this.#connector = connector; + #connector: Connector; + constructor(app: TemplatedApp, connector: Connector) { + this.#connector = connector; - // JSON-RPC routes... - app.post("/", this.#handlePost).options("/", this.#handleOptions); + // JSON-RPC routes... + app.post("/", this.#handlePost).options("/", this.#handleOptions); - // because Easter Eggs are fun... - app.get("/418", response => { - sendResponse(response, HttpResponseCodes.IM_A_TEAPOT, ContentTypes.PLAIN, "418 I'm a teapot"); - }); + // because Easter Eggs are fun... + app.get("/418", response => { + sendResponse(response, HttpResponseCodes.IM_A_TEAPOT, ContentTypes.PLAIN, "418 I'm a teapot"); + }); - // fallback routes... - app.any("/*", (response, request) => { - const connectionHeader = request.getHeader("connection"); - if (connectionHeader && connectionHeader.toLowerCase() === "upgrade") { - // if we got here it means the websocket server wasn't enabled but - // a client tried to connect via websocket. This is a Bad Request. - sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request"); - } else { - // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... - sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); - } - }); - } + // fallback routes... + app.any("/*", (response, request) => { + const connectionHeader = request.getHeader("connection"); + if (connectionHeader && connectionHeader.toLowerCase() === "upgrade") { + // if we got here it means the websocket server wasn't enabled but + // a client tried to connect via websocket. This is a Bad Request. + sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request"); + } else { + // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... + sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); + } + }); + } - #handlePost = (response: HttpResponse, request: HttpRequest) => { - // handle JSONRPC post requests... - const writeHeaders = prepareCORSResponseHeaders("POST", request); + #handlePost = (response: HttpResponse, request: HttpRequest) => { + // handle JSONRPC post requests... + const writeHeaders = prepareCORSResponseHeaders("POST", request); - // TODO: pre-allocate the buffer if we know the Content-Length - let buffer: Buffer; - let aborted = false; - response.onAborted(() => { - aborted = true; - }); - response.onData((message: ArrayBuffer, isLast: boolean) => { - const chunk = Buffer.from(message); - if (isLast) { - const connector = this.#connector; - let payload: ReturnType; - try { - const message = (buffer ? Buffer.concat([buffer, chunk]) : chunk); - payload = connector.parse(message); - } catch (e) { - sendResponse( - response, - HttpResponseCodes.BAD_REQUEST, - ContentTypes.PLAIN, - "400 Bad Request: " + e.message, - writeHeaders - ); - return; - } + // TODO: pre-allocate the buffer if we know the Content-Length + let buffer: Bu; + let aborted = false; + response.onAborted(() => { + aborted = true; + }); + response.onData((message: ArrayBuffer, isLast: boolean) => { + const chunk = Buffer.from(message); + if (isLast) { + const connector = this.#connector; + let payload: ReturnType; + try { + const message = buffer ? Buffer.concat([buffer, chunk]) : chunk; + payload = connector.parse(message); + } catch (e) { + sendResponse( + response, + HttpResponseCodes.BAD_REQUEST, + ContentTypes.PLAIN, + "400 Bad Request: " + e.message, + writeHeaders + ); + return; + } - const id = payload.id; - const method = payload.method; - switch (method) { - // http connections do not support subscriptions - case "eth_subscribe": - case "eth_unsubscribe": - const error = JsonRpc.Error(id, "-32000", "notifications not supported"); - sendResponse( - response, - HttpResponseCodes.BAD_REQUEST, - ContentTypes.JSON, - JSON.stringify(error), - writeHeaders - ); - break; - default: - // `await`ing the `connector.handle` instead of using `then` causes - // uWS to delay cleaning up the `request` object, which we don't - // neccessarily want to delay. - connector.handle(payload).then(result => { - if (aborted) { - // if the request has been aborted don't try sending (it'll - // cause an `Unhandled promise rejection` if we try) - return; - } - const data = connector.format(result, payload); - sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); - }); - break; - } - } else { - if (buffer) { - buffer = Buffer.concat([buffer, chunk]); - } else { - buffer = Buffer.concat([chunk]); - } - } - }); - }; + const id = payload.id; + const method = payload.method; + switch (method) { + // http connections do not support subscriptions + case "eth_subscribe": + case "eth_unsubscribe": + const error = JsonRpc.Error(id, "-32000", "notifications not supported"); + sendResponse( + response, + HttpResponseCodes.BAD_REQUEST, + ContentTypes.JSON, + JSON.stringify(error), + writeHeaders + ); + break; + default: + // `await`ing the `connector.handle` instead of using `then` causes + // uWS to delay cleaning up the `request` object, which we don't + // neccessarily want to delay. + connector.handle(payload).then(result => { + if (aborted) { + // if the request has been aborted don't try sending (it'll + // cause an `Unhandled promise rejection` if we try) + return; + } + const data = connector.format(result, payload); + sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); + }); + break; + } + } else { + if (buffer) { + buffer = Buffer.concat([buffer, chunk]); + } else { + buffer = Buffer.concat([chunk]); + } + } + }); + }; - #handleOptions = (response: HttpResponse, request: HttpRequest) => { - // handle CORS preflight requests... - const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); - // OPTIONS responses don't have a body, so respond with `204 No Content`... - sendResponse(response, HttpResponseCodes.NO_CONTENT, null, "", writeHeaders); - }; - public close() { - // currently a no op. - } -} + #handleOptions = (response: HttpResponse, request: HttpRequest) => { + // handle CORS preflight requests... + const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); + // OPTIONS responses don't have a body, so respond with `204 No Content`... + sendResponse(response, HttpResponseCodes.NO_CONTENT, null, "", writeHeaders); + }; + public close() { + // currently a no op. + } + } diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index ef4a805296..8d47f50b72 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -1,49 +1,62 @@ import uWS, {TemplatedApp, WebSocket} from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; import Connector from "../interfaces/connector"; -import { Apis } from "../options/server-options"; +import {Apis} from "../options/server-options"; export default class WebsocketServer { - #connections = new Set(); - constructor(app: TemplatedApp, connector: Connector, options: any) { - app.ws("/", { - /* WS Options */ - compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression - maxPayloadLength: 16 * 1024, // 128 Kibibits - idleTimeout: 120, // in seconds + #connections = new Set(); + constructor(app: TemplatedApp, connector: Connector, options: any) { + app.ws("/", { + /* WS Options */ + compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression + maxPayloadLength: 16 * 1024, // 128 Kibibits + idleTimeout: 120, // in seconds - /* Handlers */ - open: (ws: WebSocket) => { - this.#connections.add(ws); - }, - message: async (ws: WebSocket, message: ArrayBuffer, isBinary: boolean) => { - let payload: ReturnType; - try { - payload = connector.parse(Buffer.from(message)); - } catch (e) { - ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); - return; - } - const result = await connector.handle(payload); - // The socket may have closed while we were waiting for the response - // Don't bother trying to send to it if it was. - if (!ws.closed) { - const message = connector.format(result, payload); - ws.send(message, isBinary, true); - } - }, - drain: (ws: WebSocket) => { - // This is there so tests can detect if a small amount of backpressure is happening and that things will still - // work if it does. We actually don't do anything to manage excessive backpressure. - options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); - }, - close: (ws: WebSocket) => { - this.#connections.delete(ws); - ws.closed = true; - } - }); - } - close() { - this.#connections.forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); - } -} + /* Handlers */ + open: (ws: WebSocket) => { + this.#connections.add(ws); + }, + message: async (ws: WebSocket, message: ArrayBuffer, isBinary: boolean) => { + let payload: ReturnType; + try { + payload = connector.parse( + Buffer.from(message) + ); + } catch (e) { + ws.end( + WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, + "Received a malformed frame: " + + e.message + ); + return; + } + const result = await connector.handle( + payload + ); + // The socket may have closed while we were waiting for the response + // Don't bother trying to send to it if it was. + if (!ws.closed) { + const message = connector.format( + result, + payload + ); + ws.send(message, isBinary, true); + } + }, + drain: (ws: WebSocket) => { + // This is there so tests can detect if a small amount of backpressure is happening and that things will still + // work if it does. We actually don't do anything to manage excessive backpressure. + options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); + }, + close: (ws: WebSocket) => { + this.#connections.delete(ws); + ws.closed = true; + } + }); + } + close() { + this.#connections.forEach(ws => + ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client") + ); + } + } diff --git a/src/types/index.ts b/src/types/index.ts index b54061897d..33c41ef469 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -7,8 +7,7 @@ export type KnownKeys = { : never; export type RequestType = (eventDetails: { - api: T; - method: KnownKeys; - params?: Parameters; - }) => ReturnType; - \ No newline at end of file + api: T; + method: KnownKeys; + params?: Parameters; +}) => ReturnType; diff --git a/test/provider.ts b/test/provider.ts index 05725be79c..877024d141 100644 --- a/test/provider.ts +++ b/test/provider.ts @@ -9,7 +9,7 @@ describe("provider", () => { beforeEach("set up", () => { p = Ganache.provider({ network_id: networkId - }) as EthereumProvider + }) as EthereumProvider; }); it("works without passing options", async () => { diff --git a/test/temp-tests.ts b/test/temp-tests.ts index c38b0e61ef..5349b19212 100644 --- a/test/temp-tests.ts +++ b/test/temp-tests.ts @@ -219,7 +219,7 @@ describe("Accounts", () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }) as EthereumProvider + }) as EthereumProvider; const accounts = await p.send("eth_accounts"); const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); assert(true); From ca42225c5cc807e5488b6f61a49b15f2bb763c35 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 18:59:27 -0400 Subject: [PATCH 156/691] Well --- src/servers/http-server.ts | 196 ++++++++++++++++++------------------- src/servers/ws-server.ts | 97 ++++++++---------- 2 files changed, 140 insertions(+), 153 deletions(-) diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 6df0ce3f88..656dbaed4f 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -80,108 +80,108 @@ function sendResponse( } export default class HttpServer { - #connector: Connector; - constructor(app: TemplatedApp, connector: Connector) { - this.#connector = connector; + #connector: Connector; + constructor(app: TemplatedApp, connector: Connector) { + this.#connector = connector; - // JSON-RPC routes... - app.post("/", this.#handlePost).options("/", this.#handleOptions); + // JSON-RPC routes... + app.post("/", this.#handlePost).options("/", this.#handleOptions); - // because Easter Eggs are fun... - app.get("/418", response => { - sendResponse(response, HttpResponseCodes.IM_A_TEAPOT, ContentTypes.PLAIN, "418 I'm a teapot"); - }); + // because Easter Eggs are fun... + app.get("/418", response => { + sendResponse(response, HttpResponseCodes.IM_A_TEAPOT, ContentTypes.PLAIN, "418 I'm a teapot"); + }); - // fallback routes... - app.any("/*", (response, request) => { - const connectionHeader = request.getHeader("connection"); - if (connectionHeader && connectionHeader.toLowerCase() === "upgrade") { - // if we got here it means the websocket server wasn't enabled but - // a client tried to connect via websocket. This is a Bad Request. - sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request"); - } else { - // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... - sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); - } - }); - } + // fallback routes... + app.any("/*", (response, request) => { + const connectionHeader = request.getHeader("connection"); + if (connectionHeader && connectionHeader.toLowerCase() === "upgrade") { + // if we got here it means the websocket server wasn't enabled but + // a client tried to connect via websocket. This is a Bad Request. + sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request"); + } else { + // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... + sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); + } + }); + } - #handlePost = (response: HttpResponse, request: HttpRequest) => { - // handle JSONRPC post requests... - const writeHeaders = prepareCORSResponseHeaders("POST", request); + #handlePost = (response: HttpResponse, request: HttpRequest) => { + // handle JSONRPC post requests... + const writeHeaders = prepareCORSResponseHeaders("POST", request); - // TODO: pre-allocate the buffer if we know the Content-Length - let buffer: Bu; - let aborted = false; - response.onAborted(() => { - aborted = true; - }); - response.onData((message: ArrayBuffer, isLast: boolean) => { - const chunk = Buffer.from(message); - if (isLast) { - const connector = this.#connector; - let payload: ReturnType; - try { - const message = buffer ? Buffer.concat([buffer, chunk]) : chunk; - payload = connector.parse(message); - } catch (e) { - sendResponse( - response, - HttpResponseCodes.BAD_REQUEST, - ContentTypes.PLAIN, - "400 Bad Request: " + e.message, - writeHeaders - ); - return; - } + // TODO: pre-allocate the buffer if we know the Content-Length + let buffer: Bu; + let aborted = false; + response.onAborted(() => { + aborted = true; + }); + response.onData((message: ArrayBuffer, isLast: boolean) => { + const chunk = Buffer.from(message); + if (isLast) { + const connector = this.#connector; + let payload: ReturnType; + try { + const message = buffer ? Buffer.concat([buffer, chunk]) : chunk; + payload = connector.parse(message); + } catch (e) { + sendResponse( + response, + HttpResponseCodes.BAD_REQUEST, + ContentTypes.PLAIN, + "400 Bad Request: " + e.message, + writeHeaders + ); + return; + } - const id = payload.id; - const method = payload.method; - switch (method) { - // http connections do not support subscriptions - case "eth_subscribe": - case "eth_unsubscribe": - const error = JsonRpc.Error(id, "-32000", "notifications not supported"); - sendResponse( - response, - HttpResponseCodes.BAD_REQUEST, - ContentTypes.JSON, - JSON.stringify(error), - writeHeaders - ); - break; - default: - // `await`ing the `connector.handle` instead of using `then` causes - // uWS to delay cleaning up the `request` object, which we don't - // neccessarily want to delay. - connector.handle(payload).then(result => { - if (aborted) { - // if the request has been aborted don't try sending (it'll - // cause an `Unhandled promise rejection` if we try) - return; - } - const data = connector.format(result, payload); - sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); - }); - break; - } - } else { - if (buffer) { - buffer = Buffer.concat([buffer, chunk]); - } else { - buffer = Buffer.concat([chunk]); - } - } - }); - }; + const id = payload.id; + const method = payload.method; + switch (method) { + // http connections do not support subscriptions + case "eth_subscribe": + case "eth_unsubscribe": + const error = JsonRpc.Error(id, "-32000", "notifications not supported"); + sendResponse( + response, + HttpResponseCodes.BAD_REQUEST, + ContentTypes.JSON, + JSON.stringify(error), + writeHeaders + ); + break; + default: + // `await`ing the `connector.handle` instead of using `then` causes + // uWS to delay cleaning up the `request` object, which we don't + // neccessarily want to delay. + connector.handle(payload).then(result => { + if (aborted) { + // if the request has been aborted don't try sending (it'll + // cause an `Unhandled promise rejection` if we try) + return; + } + const data = connector.format(result, payload); + sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); + }); + break; + } + } else { + if (buffer) { + buffer = Buffer.concat([buffer, chunk]); + } else { + buffer = Buffer.concat([chunk]); + } + } + }); + }; - #handleOptions = (response: HttpResponse, request: HttpRequest) => { - // handle CORS preflight requests... - const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); - // OPTIONS responses don't have a body, so respond with `204 No Content`... - sendResponse(response, HttpResponseCodes.NO_CONTENT, null, "", writeHeaders); - }; - public close() { - // currently a no op. - } - } + #handleOptions = (response: HttpResponse, request: HttpRequest) => { + // handle CORS preflight requests... + const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); + // OPTIONS responses don't have a body, so respond with `204 No Content`... + sendResponse(response, HttpResponseCodes.NO_CONTENT, null, "", writeHeaders); + }; + public close() { + // currently a no op. + } +} diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index 8d47f50b72..c2e505755f 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -4,59 +4,46 @@ import Connector from "../interfaces/connector"; import {Apis} from "../options/server-options"; export default class WebsocketServer { - #connections = new Set(); - constructor(app: TemplatedApp, connector: Connector, options: any) { - app.ws("/", { - /* WS Options */ - compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression - maxPayloadLength: 16 * 1024, // 128 Kibibits - idleTimeout: 120, // in seconds + #connections = new Set(); + constructor(app: TemplatedApp, connector: Connector, options: any) { + app.ws("/", { + /* WS Options */ + compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression + maxPayloadLength: 16 * 1024, // 128 Kibibits + idleTimeout: 120, // in seconds - /* Handlers */ - open: (ws: WebSocket) => { - this.#connections.add(ws); - }, - message: async (ws: WebSocket, message: ArrayBuffer, isBinary: boolean) => { - let payload: ReturnType; - try { - payload = connector.parse( - Buffer.from(message) - ); - } catch (e) { - ws.end( - WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, - "Received a malformed frame: " + - e.message - ); - return; - } - const result = await connector.handle( - payload - ); - // The socket may have closed while we were waiting for the response - // Don't bother trying to send to it if it was. - if (!ws.closed) { - const message = connector.format( - result, - payload - ); - ws.send(message, isBinary, true); - } - }, - drain: (ws: WebSocket) => { - // This is there so tests can detect if a small amount of backpressure is happening and that things will still - // work if it does. We actually don't do anything to manage excessive backpressure. - options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); - }, - close: (ws: WebSocket) => { - this.#connections.delete(ws); - ws.closed = true; - } - }); - } - close() { - this.#connections.forEach(ws => - ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client") - ); - } - } + /* Handlers */ + open: (ws: WebSocket) => { + this.#connections.add(ws); + }, + message: async (ws: WebSocket, message: ArrayBuffer, isBinary: boolean) => { + let payload: ReturnType; + try { + payload = connector.parse(Buffer.from(message)); + } catch (e) { + ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); + return; + } + const result = await connector.handle(payload); + // The socket may have closed while we were waiting for the response + // Don't bother trying to send to it if it was. + if (!ws.closed) { + const message = connector.format(result, payload); + ws.send(message, isBinary, true); + } + }, + drain: (ws: WebSocket) => { + // This is there so tests can detect if a small amount of backpressure is happening and that things will still + // work if it does. We actually don't do anything to manage excessive backpressure. + options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); + }, + close: (ws: WebSocket) => { + this.#connections.delete(ws); + ws.closed = true; + } + }); + } + close() { + this.#connections.forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); + } +} From 6524e77b7b10ef3d33bde527376f9c4b39bf4381 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 18:59:42 -0400 Subject: [PATCH 157/691] ... --- src/servers/http-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 656dbaed4f..7823741e1d 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -111,7 +111,7 @@ export default class HttpServer { const writeHeaders = prepareCORSResponseHeaders("POST", request); // TODO: pre-allocate the buffer if we know the Content-Length - let buffer: Bu; + let buffer: Buffer; let aborted = false; response.onAborted(() => { aborted = true; From ccd71b362a5120e641a12092fa7bdc29097c6d8c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 19:05:28 -0400 Subject: [PATCH 158/691] More types and stuffs --- src/connector.ts | 12 +++++------- src/interfaces/provider.ts | 12 ++++-------- src/ledgers/tezos/provider.ts | 9 ++++----- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/connector.ts b/src/connector.ts index 6f670bcd27..c9f4e688c6 100644 --- a/src/connector.ts +++ b/src/connector.ts @@ -1,13 +1,11 @@ import Executor from "./utils/executor"; import RequestCoordinator from "./utils/request-coordinator"; -import ProviderOptions, {FlavorMap} from "./options/provider-options"; +import ProviderOptions, {FlavorMap, Apis} from "./options/provider-options"; import Emittery from "emittery"; -import Connector from "./interfaces/connector"; -import {Provider} from "./interfaces/provider"; -import EthereumApi from "./ledgers/ethereum/api"; import EthereumProvider from "./ledgers/ethereum/provider"; +import { Provider } from "./interfaces/provider"; -export default class Connector2 extends Emittery { +export default class Connector extends Emittery { // TODO: set missing defaults automatically public static initialize(providerOptions: ProviderOptions = {flavor: "ethereum", asyncRequestProcessing: true}) { const flavor = providerOptions.flavor || "ethereum"; @@ -24,11 +22,11 @@ export default class Connector2 extends Emittery { // The request coordinator is initialized in a "paused" state, when the provider is ready we unpause // this lets us accept queue requests before we've even fully initialized. - (connector.provider as EthereumProvider).on("ready", requestCoordinator.resume); + connector.provider.on("ready", requestCoordinator.resume); // A provider should _not_ execute its own methods, but should delegate that responsiblity here. // Need to cast here because of https://github.com/microsoft/TypeScript/issues/7294 - (connector.provider as EthereumProvider).on("request", ({api, method, params}) => { + (connector.provider as Provider).on("request", ({api, method, params}) => { return requestCoordinator.queue(executor.execute, api, method, params); }); diff --git a/src/interfaces/provider.ts b/src/interfaces/provider.ts index 4625e9215b..3f1a69024c 100644 --- a/src/interfaces/provider.ts +++ b/src/interfaces/provider.ts @@ -1,12 +1,8 @@ import Api from "./api"; +import Emittery from "emittery"; +import { RequestType } from "../types"; -type KnownKeys = { - [K in keyof T]: string extends K ? never : number extends K ? never : K; -} extends {[_ in keyof T]: infer U} - ? U - : never; - -export interface Provider { - request: (method: KnownKeys, params?: any[]) => Promise; +export interface Provider + extends Emittery.Typed<{request: RequestType}, "ready" | "close"> { close: () => Promise; } diff --git a/src/ledgers/tezos/provider.ts b/src/ledgers/tezos/provider.ts index 275a524169..4b2b20b187 100644 --- a/src/ledgers/tezos/provider.ts +++ b/src/ledgers/tezos/provider.ts @@ -1,10 +1,9 @@ import {Provider} from "../../interfaces/provider"; import TezosApi from "./api"; -import {KnownKeys} from "../../types"; +import {RequestType} from "../../types"; +import Emittery from "emittery"; -export default class TezosProvider implements Provider { - request = async (method: KnownKeys, params?: any[]) => { - return {} as any; - }; +export default class TezosProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> + implements Provider { close = async () => {}; } From 5d6bd0f3ee9bb99b62ceac0f471d768528b62ded Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 19:05:39 -0400 Subject: [PATCH 159/691] Sometimes vscode is annoying --- src/connector.ts | 2 +- src/interfaces/provider.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connector.ts b/src/connector.ts index c9f4e688c6..e9ca551718 100644 --- a/src/connector.ts +++ b/src/connector.ts @@ -3,7 +3,7 @@ import RequestCoordinator from "./utils/request-coordinator"; import ProviderOptions, {FlavorMap, Apis} from "./options/provider-options"; import Emittery from "emittery"; import EthereumProvider from "./ledgers/ethereum/provider"; -import { Provider } from "./interfaces/provider"; +import {Provider} from "./interfaces/provider"; export default class Connector extends Emittery { // TODO: set missing defaults automatically diff --git a/src/interfaces/provider.ts b/src/interfaces/provider.ts index 3f1a69024c..dbda6177e4 100644 --- a/src/interfaces/provider.ts +++ b/src/interfaces/provider.ts @@ -1,6 +1,6 @@ import Api from "./api"; import Emittery from "emittery"; -import { RequestType } from "../types"; +import {RequestType} from "../types"; export interface Provider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> { From 3b909b4a241c899b20c2956f1ecfc28b0bae9ada Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 21:23:10 -0400 Subject: [PATCH 160/691] Fixes to the server --- .npmignore | 1 - src/interfaces/api-options.ts | 2 +- src/ledgers/ethereum/index.ts | 2 +- src/server.ts | 16 ++--- src/servers/http-server.ts | 2 +- src/servers/ws-server.ts | 2 +- test/server.ts | 2 +- typings/emittery.d.ts | 68 ------------------- ...{uWebsockets.js.d.ts => uWebsockets.js.ts} | 2 +- 9 files changed, 14 insertions(+), 83 deletions(-) delete mode 100644 typings/emittery.d.ts rename typings/{uWebsockets.js.d.ts => uWebsockets.js.ts} (85%) diff --git a/.npmignore b/.npmignore index 2119bc01d9..d77afc7d23 100644 --- a/.npmignore +++ b/.npmignore @@ -9,6 +9,5 @@ Dockerfile ISSUE_TEMPLATE.md .vscode/ build/ -dist/ webpack/ perf/ diff --git a/src/interfaces/api-options.ts b/src/interfaces/api-options.ts index 755c056349..56bf0fc4e9 100644 --- a/src/interfaces/api-options.ts +++ b/src/interfaces/api-options.ts @@ -1,4 +1,4 @@ -import Account from "../types/account"; +import Account from "../things/account"; /** * Options that ledger implementations must implement diff --git a/src/ledgers/ethereum/index.ts b/src/ledgers/ethereum/index.ts index ac61083970..68fb1507f2 100644 --- a/src/ledgers/ethereum/index.ts +++ b/src/ledgers/ethereum/index.ts @@ -20,7 +20,7 @@ export default class EthereumConnector extends Emittery.Typed<{request: RequestT this.#provider = new EthereumProvider(providerOptions); } - parse = (message: Buffer) => { + parse (message: Buffer) { return JSON.parse(message as any) as JsonRpc.Request; }; diff --git a/src/server.ts b/src/server.ts index ad97d0f0ef..bbc0465135 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,10 +1,10 @@ -import ServerOptions, {Flavors, getDefault as getDefaultServerOptions} from "./options/server-options"; +import ServerOptions, {getDefault as getDefaultServerOptions} from "./options/server-options"; import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; import Connector from "./connector"; import WebsocketServer from "./servers/ws-server"; import HttpServer from "./servers/http-server"; -import {FlavorMap} from "./options/provider-options"; +import {Flavors} from "./options/provider-options"; export enum Status { // These are bit flags @@ -19,7 +19,7 @@ export default class Server { #httpServer: HttpServer; #listenSocket: us_listen_socket; #options: ServerOptions; - #connector: FlavorMap[T["flavor"]]; + #connector: Flavors; #status = Status.closed; #websocketServer: WebsocketServer; @@ -33,17 +33,17 @@ export default class Server { constructor(serverOptions?: T) { const opts = (this.#options = getDefaultServerOptions(serverOptions)); - const connector = Connector.initialize(opts); + const connector = this.#connector = Connector.initialize(opts); const _app = (this.#app = uWS.App()); if (this.#options.ws) { - this.#websocketServer = new WebsocketServer(_app, connector as any, opts); + this.#websocketServer = new WebsocketServer(_app, connector, opts); } - this.#httpServer = new HttpServer(_app, connector as any); + this.#httpServer = new HttpServer(_app, connector); } - async listen(port: string | number, callback?: (err: Error) => void): Promise { + async listen(port: number, callback?: (err: Error) => void): Promise { const callbackIsFunction = typeof callback === "function"; let err: Error; // if open or opening @@ -60,7 +60,7 @@ export default class Server { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - this.#app.listen(port.toString(10), LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); }); if (_listenSocket) { diff --git a/src/servers/http-server.ts b/src/servers/http-server.ts index 7823741e1d..0a237bb37e 100644 --- a/src/servers/http-server.ts +++ b/src/servers/http-server.ts @@ -81,7 +81,7 @@ function sendResponse( export default class HttpServer { #connector: Connector; - constructor(app: TemplatedApp, connector: Connector) { + constructor(app: TemplatedApp, connector: Connector) { this.#connector = connector; // JSON-RPC routes... diff --git a/src/servers/ws-server.ts b/src/servers/ws-server.ts index c2e505755f..b5735ec8cc 100644 --- a/src/servers/ws-server.ts +++ b/src/servers/ws-server.ts @@ -5,7 +5,7 @@ import {Apis} from "../options/server-options"; export default class WebsocketServer { #connections = new Set(); - constructor(app: TemplatedApp, connector: Connector, options: any) { + constructor(app: TemplatedApp, connector: Connector, options: any) { app.ws("/", { /* WS Options */ compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression diff --git a/test/server.ts b/test/server.ts index 9c646429df..bb3c4ea549 100644 --- a/test/server.ts +++ b/test/server.ts @@ -33,7 +33,7 @@ describe("server", () => { s && (await s.close()); s = undefined; } - describe("http", () => { + describe.only("http", () => { async function simpleTest() { const response = await request.post("http://localhost:" + port).send(jsonRpcJson); assert.strictEqual(response.status, 200); diff --git a/typings/emittery.d.ts b/typings/emittery.d.ts deleted file mode 100644 index 6712ded619..0000000000 --- a/typings/emittery.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import "emittery"; - -interface Events { - // Blocked by https://github.com/microsoft/TypeScript/issues/1863, should be - // `[eventName: EventName]: unknown;` -} - -/** -Maps event names to their emitted data type. -*/ -interface Events { - [eventName: any]: (args: Events) => Promise; -} - -declare namespace Emittery { - declare class Typed { - hey: number; - on>( - eventName: Name, - listener: (eventData: Parameters[0]) => void - ): Emittery.UnsubscribeFn; - on(eventName: Name, listener: () => void): Emittery.UnsubscribeFn; - - events>( - eventName: Name - ): AsyncIterableIterator[0]>; - - once>(eventName: Name): Promise>; - once(eventName: Name): Promise>; - - off>( - eventName: Name, - listener: (eventData: Parameters[0]) => void - ): void; - off(eventName: Name, listener: () => void): void; - - onAny( - listener: ( - eventName: EventNameFromDataMap | EmptyEvents, - eventData?: EventDataMap[EventNameFromDataMap] - ) => void - ): Emittery.UnsubscribeFn; - anyEvent(): AsyncIterableIterator< - [EventNameFromDataMap, EventDataMap[EventNameFromDataMap]] - >; - - offAny( - listener: ( - eventName: EventNameFromDataMap | EmptyEvents, - eventData?: EventDataMap[EventNameFromDataMap] - ) => void - ): void; - - emit>( - eventName: Name, - eventData: Parameters[0] - ): Promise>; - emit(eventName: Name): Promise>; - - emitSerial>( - eventName: Name, - eventData: Parameters[0] - ): Promise>; - emitSerial(eventName: Name): Promise>; - } -} - -export = Emittery; diff --git a/typings/uWebsockets.js.d.ts b/typings/uWebsockets.js.ts similarity index 85% rename from typings/uWebsockets.js.d.ts rename to typings/uWebsockets.js.ts index cce80c6161..d7f3003d30 100644 --- a/typings/uWebsockets.js.d.ts +++ b/typings/uWebsockets.js.ts @@ -7,6 +7,6 @@ enum ListenOptions { // uWebSockets.js doesn't include these in its TS def file. declare module "uWebSockets.js" { export interface TemplatedApp { - listen(port: number, options: ListenOptions, cb: (listenSocket: any) => void): TemplatedApp; + listen(port: number, options: ListenOptions, cb: (listenSocket: us_listen_socket | false) => void): TemplatedApp; } } From f23c4c619ca6155096656d2d9b9af30d8e30b059 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 21:36:38 -0400 Subject: [PATCH 161/691] MOAR --- .../ethereumjs-block/header.d.ts | 0 .../ethereumjs-block/index.d.ts | 0 {typings => @types}/hdkey.d.ts | 0 {typings => @types}/levelup/index.d.ts | 0 .../merkle-patricia-tree/baseTrie.d.ts | 0 .../merkle-patricia-tree/index.d.ts | 0 .../merkle-patricia-tree/readStream.d.ts | 0 .../merkle-patricia-tree/trieNode.d.ts | 0 {typings => @types}/superagent.d.ts | 0 {typings => @types}/tmp.d.ts | 0 {typings => @types}/uWebsockets.js.ts | 0 npm-shrinkwrap.json | 501 ------------------ package.json | 9 +- src/connector.ts | 2 +- src/ledgers/ethereum/index.ts | 4 +- src/ledgers/tezos/index.ts | 2 +- src/ledgers/tezos/provider.ts | 6 +- src/server.ts | 2 +- src/servers/utils/jsonrpc.ts | 7 +- src/utils/executor.ts | 4 +- src/utils/request-coordinator.ts | 6 +- test/server.ts | 2 +- tsconfig.json | 5 +- 23 files changed, 22 insertions(+), 528 deletions(-) rename {typings => @types}/ethereumjs-block/header.d.ts (100%) rename {typings => @types}/ethereumjs-block/index.d.ts (100%) rename {typings => @types}/hdkey.d.ts (100%) rename {typings => @types}/levelup/index.d.ts (100%) rename {typings => @types}/merkle-patricia-tree/baseTrie.d.ts (100%) rename {typings => @types}/merkle-patricia-tree/index.d.ts (100%) rename {typings => @types}/merkle-patricia-tree/readStream.d.ts (100%) rename {typings => @types}/merkle-patricia-tree/trieNode.d.ts (100%) rename {typings => @types}/superagent.d.ts (100%) rename {typings => @types}/tmp.d.ts (100%) rename {typings => @types}/uWebsockets.js.ts (100%) diff --git a/typings/ethereumjs-block/header.d.ts b/@types/ethereumjs-block/header.d.ts similarity index 100% rename from typings/ethereumjs-block/header.d.ts rename to @types/ethereumjs-block/header.d.ts diff --git a/typings/ethereumjs-block/index.d.ts b/@types/ethereumjs-block/index.d.ts similarity index 100% rename from typings/ethereumjs-block/index.d.ts rename to @types/ethereumjs-block/index.d.ts diff --git a/typings/hdkey.d.ts b/@types/hdkey.d.ts similarity index 100% rename from typings/hdkey.d.ts rename to @types/hdkey.d.ts diff --git a/typings/levelup/index.d.ts b/@types/levelup/index.d.ts similarity index 100% rename from typings/levelup/index.d.ts rename to @types/levelup/index.d.ts diff --git a/typings/merkle-patricia-tree/baseTrie.d.ts b/@types/merkle-patricia-tree/baseTrie.d.ts similarity index 100% rename from typings/merkle-patricia-tree/baseTrie.d.ts rename to @types/merkle-patricia-tree/baseTrie.d.ts diff --git a/typings/merkle-patricia-tree/index.d.ts b/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from typings/merkle-patricia-tree/index.d.ts rename to @types/merkle-patricia-tree/index.d.ts diff --git a/typings/merkle-patricia-tree/readStream.d.ts b/@types/merkle-patricia-tree/readStream.d.ts similarity index 100% rename from typings/merkle-patricia-tree/readStream.d.ts rename to @types/merkle-patricia-tree/readStream.d.ts diff --git a/typings/merkle-patricia-tree/trieNode.d.ts b/@types/merkle-patricia-tree/trieNode.d.ts similarity index 100% rename from typings/merkle-patricia-tree/trieNode.d.ts rename to @types/merkle-patricia-tree/trieNode.d.ts diff --git a/typings/superagent.d.ts b/@types/superagent.d.ts similarity index 100% rename from typings/superagent.d.ts rename to @types/superagent.d.ts diff --git a/typings/tmp.d.ts b/@types/tmp.d.ts similarity index 100% rename from typings/tmp.d.ts rename to @types/tmp.d.ts diff --git a/typings/uWebsockets.js.ts b/@types/uWebsockets.js.ts similarity index 100% rename from typings/uWebsockets.js.ts rename to @types/uWebsockets.js.ts diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 42421b5f17..f4f615056b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -187,15 +187,6 @@ "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", "dev": true }, - "@babel/runtime": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", - "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, "@babel/template": { "version": "7.8.6", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", @@ -359,12 +350,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==" }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "@types/secp256k1": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-3.5.0.tgz", @@ -715,12 +700,6 @@ "write-file-atomic": "^3.0.0" } }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -773,12 +752,6 @@ "readdirp": "~3.2.0" } }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -794,21 +767,6 @@ "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-spinners": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", - "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", - "dev": true - }, "cliui": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", @@ -890,12 +848,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -940,19 +892,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - } - }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -1072,12 +1011,6 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "diff-match-patch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.4.tgz", - "integrity": "sha512-Uv3SW8bmH9nAtHKaKSanOQmj2DnlH65fUpcrMdfdaOxUG02QQ4YGZ8AE7kKOMisF7UqvOlGKVYWRvezdncW9lg==", - "dev": true - }, "drbg.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", @@ -1163,15 +1096,6 @@ "prr": "~1.0.1" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, "es-abstract": { "version": "1.17.5", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", @@ -1561,80 +1485,6 @@ "safe-buffer": "^5.1.1" } }, - "execa": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.9.0.tgz", - "integrity": "sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA==", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - } - } - }, "fake-merkle-patricia-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", @@ -1683,15 +1533,6 @@ "locate-path": "^3.0.0" } }, - "find-versions": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", - "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", - "dev": true, - "requires": { - "semver-regex": "^2.0.0" - } - }, "flat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", @@ -1796,12 +1637,6 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -1921,110 +1756,16 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, - "husky": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", - "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^6.0.0", - "find-versions": "^3.2.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^4.2.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", - "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", - "dev": true - }, "immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" }, - "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - } - } - }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -2061,12 +1802,6 @@ "p-is-promise": "^3.0.0" } }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -2326,12 +2061,6 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, "json5": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", @@ -2659,12 +2388,6 @@ } } }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -2922,12 +2645,6 @@ "mime-db": "1.43.0" } }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -3018,12 +2735,6 @@ } } }, - "mri": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.5.tgz", - "integrity": "sha512-d2RKzMD4JNyHMbnbWnznPaa8vbdlq/4pNZ3IgdaGrVbBhebBsGUUE/6qorTMYNS6TwuH3ilfOlD2bf4Igh8CKg==", - "dev": true - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", @@ -3083,23 +2794,6 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - }, - "dependencies": { - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - } - } - }, "nyc": { "version": "15.0.1", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.1.tgz", @@ -3338,56 +3032,12 @@ "wrappy": "1" } }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "opencollective-postinstall": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", - "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", - "dev": true - }, - "ora": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ora/-/ora-1.4.0.tgz", - "integrity": "sha512-iMK1DOQxzzh2MBlVsU42G80mnrvUhqsMh74phHtDlrcTZPK0pH6o7l7DRshK+0YsxDyEuaOkziVdvM3T0QTzpw==", - "dev": true, - "requires": { - "chalk": "^2.1.0", - "cli-cursor": "^2.1.0", - "cli-spinners": "^1.0.1", - "log-symbols": "^2.1.0" - }, - "dependencies": { - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "requires": { - "chalk": "^2.0.1" - } - } - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, "p-is-promise": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", @@ -3439,27 +3089,6 @@ "release-zalgo": "^1.0.0" } }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-json": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", - "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", - "lines-and-columns": "^1.1.6" - } - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -3483,12 +3112,6 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -3552,75 +3175,6 @@ } } }, - "please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", - "dev": true, - "requires": { - "semver-compare": "^1.0.0" - } - }, - "precise-commits": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/precise-commits/-/precise-commits-1.0.2.tgz", - "integrity": "sha512-PYkoNTFXVvZRzJTDxdgzmPanhSNGj5Wtj2NgSo7IhwNXGcKktX+L4DJhyIrhFSLsWWAvd+cYyyU2eXlaX5QxzA==", - "dev": true, - "requires": { - "diff-match-patch": "^1.0.0", - "execa": "^0.9.0", - "find-up": "^2.1.0", - "glob": "^7.1.2", - "ignore": "^3.3.7", - "mri": "^1.1.0", - "ora": "^1.3.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - } - } - }, "prettier": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", @@ -3713,12 +3267,6 @@ "picomatch": "^2.0.4" } }, - "regenerator-runtime": { - "version": "0.13.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", - "dev": true - }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -3761,16 +3309,6 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -3850,18 +3388,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, - "semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", - "dev": true - }, - "semver-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", - "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", - "dev": true - }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -3913,12 +3439,6 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, "solc": { "version": "0.6.6", "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.6.tgz", @@ -4081,12 +3601,6 @@ "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", @@ -4409,12 +3923,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", - "dev": true - }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", @@ -4502,15 +4010,6 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, - "yaml": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.9.2.tgz", - "integrity": "sha512-HPT7cGGI0DuRcsO51qC1j9O16Dh1mZ2bnXwsi0jrSpsLz0WxOLSLXfkABVl6bZO629py3CU+OMJtpNHDLB97kg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.9.2" - } - }, "yargs": { "version": "13.3.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", diff --git a/package.json b/package.json index 0ebe1dd247..debd47e7cb 100644 --- a/package.json +++ b/package.json @@ -52,11 +52,9 @@ "@types/ws": "7.2.4", "bufferutil": "4.0.1", "cross-env": "7.0.2", - "husky": "4.2.5", "into-stream": "5.1.1", "mocha": "7.1.1", "nyc": "15.0.1", - "precise-commits": "1.0.2", "prettier": "2.0.5", "solc": "0.6.6", "source-map-support": "0.5.18", @@ -75,10 +73,5 @@ "url": "https://github.com/trufflesuite/ganache-core" }, "license": "MIT", - "author": "David Murdoch", - "husky": { - "hooks": { - "pre-commit": "precise-commits" - } - } + "author": "David Murdoch" } diff --git a/src/connector.ts b/src/connector.ts index e9ca551718..8e858227e7 100644 --- a/src/connector.ts +++ b/src/connector.ts @@ -5,7 +5,7 @@ import Emittery from "emittery"; import EthereumProvider from "./ledgers/ethereum/provider"; import {Provider} from "./interfaces/provider"; -export default class Connector extends Emittery { +export default class Connector { // TODO: set missing defaults automatically public static initialize(providerOptions: ProviderOptions = {flavor: "ethereum", asyncRequestProcessing: true}) { const flavor = providerOptions.flavor || "ethereum"; diff --git a/src/ledgers/ethereum/index.ts b/src/ledgers/ethereum/index.ts index 68fb1507f2..3d50992d4a 100644 --- a/src/ledgers/ethereum/index.ts +++ b/src/ledgers/ethereum/index.ts @@ -20,9 +20,9 @@ export default class EthereumConnector extends Emittery.Typed<{request: RequestT this.#provider = new EthereumProvider(providerOptions); } - parse (message: Buffer) { + parse(message: Buffer) { return JSON.parse(message as any) as JsonRpc.Request; - }; + } handle(payload: JsonRpc.Request): Promise { return this.#provider.request(payload.method, payload.params); diff --git a/src/ledgers/tezos/index.ts b/src/ledgers/tezos/index.ts index 8a4d52df94..4b3f2b44f9 100644 --- a/src/ledgers/tezos/index.ts +++ b/src/ledgers/tezos/index.ts @@ -15,7 +15,7 @@ export default class TezosConnector extends Emittery.Typed<{request: RequestType super(); const api = (this.#api = new TezosApi()); - this.provider = new TezosProvider(); + this.provider = new TezosProvider(providerOptions); } format(result: any) { diff --git a/src/ledgers/tezos/provider.ts b/src/ledgers/tezos/provider.ts index 4b2b20b187..851749d589 100644 --- a/src/ledgers/tezos/provider.ts +++ b/src/ledgers/tezos/provider.ts @@ -2,8 +2,12 @@ import {Provider} from "../../interfaces/provider"; import TezosApi from "./api"; import {RequestType} from "../../types"; import Emittery from "emittery"; +import ProviderOptions from "../../options/provider-options"; export default class TezosProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements Provider { - close = async () => {}; + constructor(providerOptions?: ProviderOptions) { + super(); + } + public async close () {}; } diff --git a/src/server.ts b/src/server.ts index bbc0465135..77fdbea8eb 100644 --- a/src/server.ts +++ b/src/server.ts @@ -33,7 +33,7 @@ export default class Server { constructor(serverOptions?: T) { const opts = (this.#options = getDefaultServerOptions(serverOptions)); - const connector = this.#connector = Connector.initialize(opts); + const connector = (this.#connector = Connector.initialize(opts)); const _app = (this.#app = uWS.App()); diff --git a/src/servers/utils/jsonrpc.ts b/src/servers/utils/jsonrpc.ts index 60d5a5cd57..5794bf7976 100644 --- a/src/servers/utils/jsonrpc.ts +++ b/src/servers/utils/jsonrpc.ts @@ -1,10 +1,5 @@ import Api from "../../interfaces/api"; - -type KnownKeys = { - [K in keyof T]: string extends K ? never : number extends K ? never : K; -} extends {[_ in keyof T]: infer U} - ? U - : never; +import { KnownKeys } from "../../types"; namespace JsonRpc { const jsonrpc = "2.0"; diff --git a/src/utils/executor.ts b/src/utils/executor.ts index 396b79e616..2972bd5bf6 100644 --- a/src/utils/executor.ts +++ b/src/utils/executor.ts @@ -14,11 +14,11 @@ export default class Executor extends Emittery { * @param methodName The name of the JSON-RPC method to execute. * @param params The params to pass to the JSON-RPC method. */ - public execute = async ( + public async execute ( api: T, methodName: M, params: Parameters - ): Promise> => { + ): Promise> { // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { diff --git a/src/utils/request-coordinator.ts b/src/utils/request-coordinator.ts index ad513d14ed..770ccbb00f 100644 --- a/src/utils/request-coordinator.ts +++ b/src/utils/request-coordinator.ts @@ -32,14 +32,14 @@ export default class RequestCoordinator { * Pause processing. This will *not* cancel any promises that are currently * running. */ - public pause = () => { + public pause() { this.#paused = true; }; /** * Resume processing. */ - public resume = () => { + public resume() { this.#paused = false; this.#process(); }; @@ -60,7 +60,7 @@ export default class RequestCoordinator { /** * Insert a new function into the queue. */ - public queue = (fn: (...args: any[]) => Promise, ...args: any[]): Promise => { + public queue (fn: (...args: any[]) => Promise, ...args: any[]): Promise { const promise = new Promise( (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { const executor = () => { diff --git a/test/server.ts b/test/server.ts index bb3c4ea549..9c646429df 100644 --- a/test/server.ts +++ b/test/server.ts @@ -33,7 +33,7 @@ describe("server", () => { s && (await s.close()); s = undefined; } - describe.only("http", () => { + describe("http", () => { async function simpleTest() { const response = await request.post("http://localhost:" + port).send(jsonRpcJson); assert.strictEqual(response.status, 200); diff --git a/tsconfig.json b/tsconfig.json index 7471ab3a71..e8cf08d1b7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,5 +12,8 @@ "outDir": "dist", "resolveJsonModule": true }, - "include": ["./src/**.*.ts", "./typings/**/*.d.ts"] + "include": [ + "src/**/*", + "@types/**/*", + ], } From dd51e93d8522a2aad8ca6cd608dbaa5aa114bb6f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 21:52:39 -0400 Subject: [PATCH 162/691] FIx binding issue in requestCoordinator --- src/utils/request-coordinator.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/request-coordinator.ts b/src/utils/request-coordinator.ts index 770ccbb00f..ad513d14ed 100644 --- a/src/utils/request-coordinator.ts +++ b/src/utils/request-coordinator.ts @@ -32,14 +32,14 @@ export default class RequestCoordinator { * Pause processing. This will *not* cancel any promises that are currently * running. */ - public pause() { + public pause = () => { this.#paused = true; }; /** * Resume processing. */ - public resume() { + public resume = () => { this.#paused = false; this.#process(); }; @@ -60,7 +60,7 @@ export default class RequestCoordinator { /** * Insert a new function into the queue. */ - public queue (fn: (...args: any[]) => Promise, ...args: any[]): Promise { + public queue = (fn: (...args: any[]) => Promise, ...args: any[]): Promise => { const promise = new Promise( (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { const executor = () => { From 7428b9de4e339de8445cacce50f9c7da32d92522 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 29 Apr 2020 22:01:18 -0400 Subject: [PATCH 163/691] Add server.listen callback & status tests, & fix. --- src/server.ts | 5 +++-- test/server.ts | 30 ++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/server.ts b/src/server.ts index 77fdbea8eb..a3b256bca7 100644 --- a/src/server.ts +++ b/src/server.ts @@ -52,7 +52,8 @@ export default class Server { // ensure sure we don't call the `callback` in the current event loop, otherwise an error in the callback would // bubble back up into this function. This is a problem here because we aren't awaiting anything if (callbackIsFunction) { - callback = (err: Error) => process.nextTick(callback, err); + const originalCallback = callback; + callback = (err: Error) => process.nextTick(originalCallback, err); } } else { this.#status = Status.opening; @@ -97,7 +98,7 @@ export default class Server { // and do all http cleanup, if any this.#httpServer.close(); - this.#status = Status.closed; await this.provider.close(); + this.#status = Status.closed; } } diff --git a/test/server.ts b/test/server.ts index 9c646429df..9a22779e21 100644 --- a/test/server.ts +++ b/test/server.ts @@ -2,7 +2,7 @@ import Ganache from "../src/"; import * as assert from "assert"; import request from "superagent"; import WebSocket from "ws"; -import Server from "../src/server"; +import Server, {Status} from "../src/server"; import ServerOptions from "../src/options/server-options"; import http from "http"; import intoStream from "into-stream"; @@ -43,6 +43,19 @@ describe("server", () => { return response; } + it("returns its status", async () => { + const s = Ganache.server(); + assert.strictEqual(s.status & Status.closed, Status.closed); + const pendingListen = s.listen(port); + assert.strictEqual(s.status & Status.opening, Status.opening); + await pendingListen; + assert.strictEqual(s.status & Status.open, Status.open); + const pendingClose = s.close(); + assert.strictEqual(s.status & Status.closing, Status.closing); + await pendingClose; + assert.strictEqual(s.status & Status.closed, Status.closed); + }); + it("returns the net_version", async () => { await setup(); try { @@ -66,7 +79,7 @@ describe("server", () => { }); }); - it("fails to `.listen()` twice", async () => { + it("fails to `.listen()` twice, Promise", async () => { await setup(); try { // the call to `setup()` above calls `listen()` already. if we call it @@ -79,6 +92,19 @@ describe("server", () => { } }); + it("fails to `.listen()` twice, callback", async () => { + await setup(); + try { + // the call to `setup()` above calls `listen()` already. if we call it + // again it should fail. + s.listen(port, err => { + assert.strict(err.message, `Server is already listening on port: ${port}`); + }); + } finally { + await teardown(); + } + }); + it("fails to listen if the socket is already in use by 3rd party", async () => { const server = http.createServer(); server.listen(port); From b163f66ce64635d47ef46b749eec5aa10b9cecf9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 14:59:14 -0400 Subject: [PATCH 164/691] Move to monorepo WIP --- .gitignore | 5 +- lerna.json | 6 + npm-shrinkwrap.json | 4087 ------ package-lock.json | 10371 ++++++++++++++++ package.json | 24 +- packages/core/README.md | 11 + .../core/__tests__}/contracts/helloWorld.sol | 0 .../core/__tests__}/helpers/getProvider.ts | 0 .../core/__tests__}/helpers/sleep.ts | 0 .../core/__tests__}/interface.ts | 0 {test => packages/core/__tests__}/ledger.ts | 0 {test => packages/core/__tests__}/provider.ts | 0 {test => packages/core/__tests__}/server.ts | 0 .../core/__tests__}/temp-tests.ts | 0 ...a4012219db100ef0a340307869393f9df55ebd470c | 1 + ...3d12ccdd1938364fb8e72dcdda25d6baa70992b80f | 1 + ...a730bb0282bbaaadd8ac1b94510b69a499527c3505 | 1 + ...243a1661770198770b14029eed74f0eb473c79cd83 | 1 + packages/core/compile.ts | 108 + packages/core/package-lock.json | 341 + packages/core/package.json | 36 + .../core/patches}/emittery+0.6.0.patch | 0 .../src/@types}/ethereumjs-block/header.d.ts | 0 .../src/@types}/ethereumjs-block/index.d.ts | 0 .../core/src/@types}/hdkey.d.ts | 0 .../core/src/@types}/levelup/index.d.ts | 0 .../merkle-patricia-tree/baseTrie.d.ts | 0 .../@types}/merkle-patricia-tree/index.d.ts | 0 .../merkle-patricia-tree/readStream.d.ts | 0 .../merkle-patricia-tree/trieNode.d.ts | 0 .../core/src/@types}/superagent.d.ts | 0 {@types => packages/core/src/@types}/tmp.d.ts | 0 .../core/src/@types}/uWebsockets.js.ts | 0 {src => packages/core/src}/connector.ts | 0 {src => packages/core/src}/index.ts | 0 .../core/src}/interfaces/api-options.ts | 0 {src => packages/core/src}/interfaces/api.ts | 0 .../core/src}/interfaces/connector.ts | 0 .../core/src}/interfaces/provider.ts | 0 .../core/src}/ledgers/ethereum/api.ts | 2 +- .../core/src}/ledgers/ethereum/blockchain.ts | 0 .../ethereum/components/account-manager.ts | 0 .../ethereum/components/block-manager.ts | 0 .../ledgers/ethereum/components/manager.ts | 0 .../components/transaction-manager.ts | 0 .../ethereum/components/transaction-pool.ts | 0 .../core/src}/ledgers/ethereum/database.ts | 0 .../core/src}/ledgers/ethereum/index.ts | 0 .../core/src}/ledgers/ethereum/miner.ts | 0 .../core/src}/ledgers/ethereum/options.ts | 0 .../core/src}/ledgers/ethereum/provider.ts | 2 +- .../core/src}/ledgers/ethereum/wallet.ts | 0 .../core/src}/ledgers/tezos/api.ts | 0 .../core/src}/ledgers/tezos/index.ts | 0 .../core/src}/ledgers/tezos/provider.ts | 0 {src => packages/core/src}/options/options.ts | 0 .../core/src}/options/provider-options.ts | 0 .../core/src}/options/server-options.ts | 0 {src => packages/core/src}/server.ts | 0 .../core/src}/servers/http-server.ts | 0 .../core/src}/servers/utils/content-types.ts | 0 .../src}/servers/utils/http-response-codes.ts | 0 .../core/src}/servers/utils/jsonrpc.ts | 0 .../servers/utils/websocket-close-codes.ts | 0 .../views/components/accounts/accounts.marko | 0 .../components/accounts/components/info.marko | 0 .../views/components/app-tabs/index.marko | 0 .../views/components/app-tabs/marko-tag.json | 0 .../servers/views/components/blocks.marko | 0 .../servers/views/components/events.marko | 0 .../src}/servers/views/components/logs.marko | 0 .../views/components/status-bar/index.marko | 0 .../views/components/transactions.marko | 0 .../core/src}/servers/views/index.marko | 0 .../core/src}/servers/ws-server.ts | 0 packages/core/src/test.ts | 2 + {src => packages/core/src}/things/account.ts | 0 {src => packages/core/src}/things/address.ts | 0 {src => packages/core/src}/things/errors.ts | 0 .../core/src}/things/json-rpc/index.ts | 0 .../things/json-rpc/json-rpc-base-types.ts | 0 .../src}/things/json-rpc/json-rpc-data.ts | 0 .../src}/things/json-rpc/json-rpc-quantity.ts | 0 {src => packages/core/src}/things/params.ts | 0 {src => packages/core/src}/things/tags.ts | 0 .../core/src}/things/transaction-receipt.ts | 0 .../core/src}/things/transaction.ts | 0 {src => packages/core/src}/types/index.ts | 0 .../core/src}/utils/bigint-to-buffer.ts | 0 {src => packages/core/src}/utils/executor.ts | 0 {src => packages/core/src}/utils/heap.ts | 0 .../core/src}/utils/request-coordinator.ts | 0 packages/core/transform.ts | 161 + packages/core/tsconfig.json | 9 + packages/ethereum/README.md | 11 + packages/ethereum/__tests__/ethereum.test.js | 7 + packages/ethereum/package.json | 30 + packages/ethereum/src/ethereum.ts | 3 + packages/ethereum/tsconfig.json | 7 + packages/tezos/README.md | 11 + packages/tezos/__tests__/tezos.test.js | 7 + packages/tezos/package.json | 30 + packages/tezos/src/tezos.ts | 3 + packages/tezos/tsconfig.json | 7 + packages/utils/README.md | 11 + packages/utils/__tests__/utils.test.js | 7 + packages/utils/package.json | 29 + packages/utils/src/utils.ts | 3 + packages/utils/tsconfig.json | 7 + tsconfig.json | 7 +- 110 files changed, 11233 insertions(+), 4116 deletions(-) create mode 100644 lerna.json delete mode 100644 npm-shrinkwrap.json create mode 100644 package-lock.json create mode 100644 packages/core/README.md rename {test => packages/core/__tests__}/contracts/helloWorld.sol (100%) rename {test => packages/core/__tests__}/helpers/getProvider.ts (100%) rename {test => packages/core/__tests__}/helpers/sleep.ts (100%) rename {test => packages/core/__tests__}/interface.ts (100%) rename {test => packages/core/__tests__}/ledger.ts (100%) rename {test => packages/core/__tests__}/provider.ts (100%) rename {test => packages/core/__tests__}/server.ts (100%) rename {test => packages/core/__tests__}/temp-tests.ts (100%) create mode 100644 packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c create mode 100644 packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f create mode 100644 packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 create mode 100644 packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 create mode 100644 packages/core/compile.ts create mode 100644 packages/core/package-lock.json create mode 100644 packages/core/package.json rename {patches => packages/core/patches}/emittery+0.6.0.patch (100%) rename {@types => packages/core/src/@types}/ethereumjs-block/header.d.ts (100%) rename {@types => packages/core/src/@types}/ethereumjs-block/index.d.ts (100%) rename {@types => packages/core/src/@types}/hdkey.d.ts (100%) rename {@types => packages/core/src/@types}/levelup/index.d.ts (100%) rename {@types => packages/core/src/@types}/merkle-patricia-tree/baseTrie.d.ts (100%) rename {@types => packages/core/src/@types}/merkle-patricia-tree/index.d.ts (100%) rename {@types => packages/core/src/@types}/merkle-patricia-tree/readStream.d.ts (100%) rename {@types => packages/core/src/@types}/merkle-patricia-tree/trieNode.d.ts (100%) rename {@types => packages/core/src/@types}/superagent.d.ts (100%) rename {@types => packages/core/src/@types}/tmp.d.ts (100%) rename {@types => packages/core/src/@types}/uWebsockets.js.ts (100%) rename {src => packages/core/src}/connector.ts (100%) rename {src => packages/core/src}/index.ts (100%) rename {src => packages/core/src}/interfaces/api-options.ts (100%) rename {src => packages/core/src}/interfaces/api.ts (100%) rename {src => packages/core/src}/interfaces/connector.ts (100%) rename {src => packages/core/src}/interfaces/provider.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/api.ts (99%) rename {src => packages/core/src}/ledgers/ethereum/blockchain.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/components/account-manager.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/components/block-manager.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/components/manager.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/components/transaction-manager.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/components/transaction-pool.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/database.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/index.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/miner.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/options.ts (100%) rename {src => packages/core/src}/ledgers/ethereum/provider.ts (99%) rename {src => packages/core/src}/ledgers/ethereum/wallet.ts (100%) rename {src => packages/core/src}/ledgers/tezos/api.ts (100%) rename {src => packages/core/src}/ledgers/tezos/index.ts (100%) rename {src => packages/core/src}/ledgers/tezos/provider.ts (100%) rename {src => packages/core/src}/options/options.ts (100%) rename {src => packages/core/src}/options/provider-options.ts (100%) rename {src => packages/core/src}/options/server-options.ts (100%) rename {src => packages/core/src}/server.ts (100%) rename {src => packages/core/src}/servers/http-server.ts (100%) rename {src => packages/core/src}/servers/utils/content-types.ts (100%) rename {src => packages/core/src}/servers/utils/http-response-codes.ts (100%) rename {src => packages/core/src}/servers/utils/jsonrpc.ts (100%) rename {src => packages/core/src}/servers/utils/websocket-close-codes.ts (100%) rename {src => packages/core/src}/servers/views/components/accounts/accounts.marko (100%) rename {src => packages/core/src}/servers/views/components/accounts/components/info.marko (100%) rename {src => packages/core/src}/servers/views/components/app-tabs/index.marko (100%) rename {src => packages/core/src}/servers/views/components/app-tabs/marko-tag.json (100%) rename {src => packages/core/src}/servers/views/components/blocks.marko (100%) rename {src => packages/core/src}/servers/views/components/events.marko (100%) rename {src => packages/core/src}/servers/views/components/logs.marko (100%) rename {src => packages/core/src}/servers/views/components/status-bar/index.marko (100%) rename {src => packages/core/src}/servers/views/components/transactions.marko (100%) rename {src => packages/core/src}/servers/views/index.marko (100%) rename {src => packages/core/src}/servers/ws-server.ts (100%) create mode 100644 packages/core/src/test.ts rename {src => packages/core/src}/things/account.ts (100%) rename {src => packages/core/src}/things/address.ts (100%) rename {src => packages/core/src}/things/errors.ts (100%) rename {src => packages/core/src}/things/json-rpc/index.ts (100%) rename {src => packages/core/src}/things/json-rpc/json-rpc-base-types.ts (100%) rename {src => packages/core/src}/things/json-rpc/json-rpc-data.ts (100%) rename {src => packages/core/src}/things/json-rpc/json-rpc-quantity.ts (100%) rename {src => packages/core/src}/things/params.ts (100%) rename {src => packages/core/src}/things/tags.ts (100%) rename {src => packages/core/src}/things/transaction-receipt.ts (100%) rename {src => packages/core/src}/things/transaction.ts (100%) rename {src => packages/core/src}/types/index.ts (100%) rename {src => packages/core/src}/utils/bigint-to-buffer.ts (100%) rename {src => packages/core/src}/utils/executor.ts (100%) rename {src => packages/core/src}/utils/heap.ts (100%) rename {src => packages/core/src}/utils/request-coordinator.ts (100%) create mode 100644 packages/core/transform.ts create mode 100644 packages/core/tsconfig.json create mode 100644 packages/ethereum/README.md create mode 100644 packages/ethereum/__tests__/ethereum.test.js create mode 100644 packages/ethereum/package.json create mode 100644 packages/ethereum/src/ethereum.ts create mode 100644 packages/ethereum/tsconfig.json create mode 100644 packages/tezos/README.md create mode 100644 packages/tezos/__tests__/tezos.test.js create mode 100644 packages/tezos/package.json create mode 100644 packages/tezos/src/tezos.ts create mode 100644 packages/tezos/tsconfig.json create mode 100644 packages/utils/README.md create mode 100644 packages/utils/__tests__/utils.test.js create mode 100644 packages/utils/package.json create mode 100644 packages/utils/src/utils.ts create mode 100644 packages/utils/tsconfig.json diff --git a/.gitignore b/.gitignore index bbf10c1b63..80163b1382 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,7 @@ build dist .nyc_output test/testdb/* -**/*.marko.js \ No newline at end of file +**/*.marko.js +lerna-debug.log +npm-debug.log +packages/*/lib diff --git a/lerna.json b/lerna.json new file mode 100644 index 0000000000..af954df769 --- /dev/null +++ b/lerna.json @@ -0,0 +1,6 @@ +{ + "packages": [ + "packages/*" + ], + "version": "2.2.1" +} diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json deleted file mode 100644 index f4f615056b..0000000000 --- a/npm-shrinkwrap.json +++ /dev/null @@ -1,4087 +0,0 @@ -{ - "name": "ganache-core", - "version": "2.2.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", - "dev": true, - "requires": { - "@babel/highlight": "^7.8.3" - } - }, - "@babel/core": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", - "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.0", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.0", - "@babel/parser": "^7.9.0", - "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.13", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } - } - }, - "@babel/generator": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", - "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", - "dev": true, - "requires": { - "@babel/types": "^7.9.5", - "jsesc": "^2.5.1", - "lodash": "^4.17.13", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", - "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.9.5" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-module-transforms": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", - "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.6", - "@babel/types": "^7.9.0", - "lodash": "^4.17.13" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-replace-supers": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", - "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.8.6", - "@babel/types": "^7.8.6" - } - }, - "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", - "dev": true, - "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", - "dev": true, - "requires": { - "@babel/types": "^7.8.3" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", - "dev": true - }, - "@babel/helpers": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", - "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", - "dev": true, - "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0" - } - }, - "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.0", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", - "dev": true - }, - "@babel/template": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", - "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6" - } - }, - "@babel/traverse": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", - "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.5", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.13" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } - } - }, - "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.9.5", - "lodash": "^4.17.13", - "to-fast-properties": "^2.0.0" - } - }, - "@istanbuljs/load-nyc-config": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", - "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - } - } - }, - "@istanbuljs/nyc-config-typescript": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz", - "integrity": "sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2" - } - }, - "@istanbuljs/schema": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", - "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", - "dev": true - }, - "@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "requires": { - "@types/node": "*" - } - }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, - "@types/cookiejar": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz", - "integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==", - "dev": true - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/lodash": { - "version": "4.14.150", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.150.tgz", - "integrity": "sha512-kMNLM5JBcasgYscD9x/Gvr6lTAv2NVgsKtet/hm93qMyf/D1pt+7jeEZklKJKxMVmXjxbRVQQGfqDSfipYCO6w==" - }, - "@types/lodash.clonedeep": { - "version": "4.5.6", - "resolved": "https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz", - "integrity": "sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==", - "requires": { - "@types/lodash": "*" - } - }, - "@types/mocha": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", - "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", - "dev": true - }, - "@types/node": { - "version": "13.13.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", - "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==" - }, - "@types/secp256k1": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-3.5.0.tgz", - "integrity": "sha512-ZE39QhkIaNK6xbKIp1VLN5O36r97LuslLmRnjAcT0sVDxcfvrk3zqp/VnIfmGza7J6jDxR8dIai3hsCxPYglPA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/seedrandom": { - "version": "2.4.28", - "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz", - "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", - "dev": true - }, - "@types/superagent": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.7.tgz", - "integrity": "sha512-JSwNPgRYjIC4pIeOqLwWwfGj6iP1n5NE6kNBEbGx2V8H78xCPwx7QpNp9plaI30+W3cFEzJO7BIIsXE+dbtaGg==", - "dev": true, - "requires": { - "@types/cookiejar": "*", - "@types/node": "*" - } - }, - "@types/uws": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", - "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/node": "*" - } - }, - "@types/ws": { - "version": "7.2.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.4.tgz", - "integrity": "sha512-9S6Ask71vujkVyeEXKxjBSUV8ZUB0mjL5la4IncBoheu04bDaYyUKErh1BQcY9+WzOUOiKqz/OnpJHYckbMfNg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "requires": { - "xtend": "~4.0.0" - } - }, - "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "append-transform": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", - "dev": true, - "requires": { - "default-require-extensions": "^3.0.0" - } - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "argparse": { - "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.2" - } - }, - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "requires": { - "lodash": "^4.17.14" - } - }, - "async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "requires": { - "async": "^2.4.0" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base-x": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", - "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" - }, - "bigint-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", - "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", - "optional": true, - "requires": { - "bindings": "^1.3.0" - } - }, - "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", - "dev": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bip39": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", - "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", - "requires": { - "@types/node": "11.11.6", - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1" - }, - "dependencies": { - "@types/node": { - "version": "11.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", - "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" - } - } - }, - "bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "bn.js": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.1.tgz", - "integrity": "sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-sha3": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.4.tgz", - "integrity": "sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY=", - "requires": { - "js-sha3": "^0.6.1", - "safe-buffer": "^5.1.1" - } - }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", - "requires": { - "base-x": "^3.0.2" - } - }, - "bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "requires": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, - "buffer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", - "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" - }, - "bufferutil": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz", - "integrity": "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==", - "dev": true, - "requires": { - "node-gyp-build": "~3.7.0" - }, - "dependencies": { - "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", - "dev": true - } - } - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "cachedown": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cachedown/-/cachedown-1.0.0.tgz", - "integrity": "sha1-1D8DbkUQaWsxJG19sx6/D3rDLRU=", - "requires": { - "abstract-leveldown": "^2.4.1", - "lru-cache": "^3.2.0" - } - }, - "caching-transform": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", - "dev": true, - "requires": { - "hasha": "^5.0.0", - "make-dir": "^3.0.0", - "package-hash": "^4.0.0", - "write-file-atomic": "^3.0.0" - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "checkpoint-store": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", - "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", - "requires": { - "functional-red-black-tree": "^1.0.1" - } - }, - "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.1", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - } - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "command-exists": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "dev": true - }, - "commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - } - } - }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", - "dev": true - }, - "core-js-pure": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", - "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" - }, - "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=" - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-env": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz", - "integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.1" - } - }, - "cross-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", - "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "default-require-extensions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", - "dev": true, - "requires": { - "strip-bom": "^4.0.0" - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", - "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", - "requires": { - "abstract-leveldown": "~2.6.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } - } - }, - "defined": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", - "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", - "requires": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - } - }, - "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } - } - }, - "emittery": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.6.0.tgz", - "integrity": "sha512-6EMRGr9KzYWp8DzHFZsKVZBsMO6QhAeHMeHND8rhyBNCHKMLpgW9tZv40bwN3rAIKRS5CxcK8oLRKUJSB9h7yQ==" - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "encoding-down": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", - "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", - "requires": { - "abstract-leveldown": "^5.0.0", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "xtend": "^4.0.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "level-codec": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", - "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - } - } - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "requires": { - "prr": "~1.0.1" - } - }, - "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true - }, - "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=", - "dev": true - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "ethashjs": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.7.tgz", - "integrity": "sha1-ML/kGWcmaQoMWdO4Jy5w1NDDS64=", - "requires": { - "async": "^1.4.2", - "buffer-xor": "^1.0.3", - "ethereumjs-util": "^4.0.1", - "miller-rabin": "^4.0.0" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "ethereumjs-util": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", - "integrity": "sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=", - "requires": { - "bn.js": "^4.8.0", - "create-hash": "^1.1.2", - "keccakjs": "^0.2.0", - "rlp": "^2.0.0", - "secp256k1": "^3.0.1" - } - } - } - }, - "ethereumjs-account": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", - "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", - "requires": { - "ethereumjs-util": "^6.0.0", - "rlp": "^2.2.1", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-block": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", - "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", - "requires": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - } - } - } - } - }, - "ethereumjs-blockchain": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.3.tgz", - "integrity": "sha512-0nJWbyA+Gu0ZKZr/cywMtB/77aS/4lOVsIKbgUN2sFQYscXO5rPbUfrEe7G2Zhjp86/a0VqLllemDSTHvx3vZA==", - "requires": { - "async": "^2.6.1", - "ethashjs": "~0.0.7", - "ethereumjs-block": "~2.2.2", - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "~6.1.0", - "flow-stoplight": "^1.0.0", - "level-mem": "^3.0.1", - "lru-cache": "^5.1.1", - "rlp": "^2.2.2", - "semaphore": "^1.1.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "ethereumjs-util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", - "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" - } - } - } - }, - "ethereumjs-common": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz", - "integrity": "sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ==" - }, - "ethereumjs-tx": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", - "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "ethereumjs-util": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", - "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^2.0.0", - "rlp": "^2.2.3", - "secp256k1": "^3.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "keccak": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", - "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", - "requires": { - "bindings": "^1.5.0", - "inherits": "^2.0.4", - "nan": "^2.14.0", - "safe-buffer": "^5.2.0" - } - } - } - }, - "ethereumjs-vm": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.1.3.tgz", - "integrity": "sha512-RTrD0y7My4O6Qr1P2ZIsMfD6RzL6kU/RhBZ0a5XrPzAeR61crBS7or66ohDrvxDI/rDBxMi+6SnsELih6fzalw==", - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "core-js-pure": "^3.0.1", - "ethereumjs-account": "^3.0.0", - "ethereumjs-block": "^2.2.2", - "ethereumjs-blockchain": "^4.0.3", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.2", - "ethereumjs-util": "^6.2.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1", - "util.promisify": "^1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - } - } - } - } - }, - "ethjs-util": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "requires": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - } - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "fake-merkle-patricia-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", - "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", - "requires": { - "checkpoint-store": "^1.1.0" - } - }, - "fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", - "dev": true - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-cache-dir": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", - "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "flat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", - "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", - "dev": true, - "requires": { - "is-buffer": "~2.0.3" - } - }, - "flow-stoplight": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", - "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" - }, - "foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - } - }, - "form-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", - "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", - "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", - "dev": true - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fromentries": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", - "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", - "dev": true - }, - "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" - }, - "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "requires": { - "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" - } - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", - "dev": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" - }, - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hasha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", - "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", - "dev": true, - "requires": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - } - }, - "hdkey": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.2.tgz", - "integrity": "sha512-PTQ4VKu0oRnCrYfLp04iQZ7T2Cxz0UsEXYauk2j8eh6PJXCpbXuCFhOmtIFtbET0i3PMWmHN9J11gU8LEgUljQ==", - "requires": { - "bs58check": "^2.1.2", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" - }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "into-stream": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.1.tgz", - "integrity": "sha512-krrAJ7McQxGGmvaYbB7Q1mcA+cRwg9Ij2RfWIeVesNBgVDZmzY/Fa4IpZUT3bmdRzMzdf/mzltCG2Dq99IZGBA==", - "dev": true, - "requires": { - "from2": "^2.3.0", - "p-is-promise": "^3.0.0" - } - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", - "dev": true - }, - "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" - }, - "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-hex-prefixed": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", - "requires": { - "has": "^1.0.3" - } - }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", - "dev": true - }, - "istanbul-lib-hook": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", - "dev": true, - "requires": { - "append-transform": "^2.0.0" - } - }, - "istanbul-lib-instrument": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz", - "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==", - "dev": true, - "requires": { - "@babel/core": "^7.7.5", - "@babel/parser": "^7.7.5", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "istanbul-lib-processinfo": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "cross-spawn": "^7.0.0", - "istanbul-lib-coverage": "^3.0.0-alpha.1", - "make-dir": "^3.0.0", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^3.3.3" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "istanbul-reports": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", - "dev": true, - "requires": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - } - }, - "js-sha3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", - "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "keccak": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", - "integrity": "sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==", - "requires": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, - "keccakjs": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.3.tgz", - "integrity": "sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg==", - "requires": { - "browserify-sha3": "^0.0.4", - "sha3": "^1.2.2" - } - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "level-codec": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", - "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" - }, - "level-concat-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" - }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, - "level-mem": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", - "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", - "requires": { - "level-packager": "~4.0.0", - "memdown": "~3.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "memdown": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", - "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", - "requires": { - "abstract-leveldown": "~5.0.0", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "level-option-wrap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/level-option-wrap/-/level-option-wrap-1.1.0.tgz", - "integrity": "sha1-rSDmjZ88IsiJdTHMaqevWWse0Sk=", - "requires": { - "defined": "~0.0.0" - } - }, - "level-packager": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", - "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", - "requires": { - "encoding-down": "~5.0.0", - "levelup": "^3.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", - "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", - "requires": { - "abstract-leveldown": "~5.0.0", - "inherits": "^2.0.3" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", - "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "xtend": "^4.0.0" - } - }, - "levelup": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", - "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", - "requires": { - "deferred-leveldown": "~4.0.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~3.0.0", - "xtend": "~4.0.0" - } - } - } - }, - "level-supports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", - "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", - "requires": { - "xtend": "^4.0.2" - } - }, - "level-ws": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", - "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } - } - } - }, - "leveldown": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", - "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", - "requires": { - "abstract-leveldown": "~6.2.1", - "napi-macros": "~2.0.0", - "node-gyp-build": "~4.1.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "node-gyp-build": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", - "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" - } - } - }, - "levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", - "requires": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - } - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, - "log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", - "dev": true, - "requires": { - "chalk": "^2.4.2" - } - }, - "lru-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", - "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", - "requires": { - "pseudomap": "^1.0.1" - } - }, - "ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "memdown": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", - "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", - "dev": true - }, - "merkle-patricia-tree": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", - "integrity": "sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==", - "requires": { - "async": "^2.6.1", - "ethereumjs-util": "^5.2.0", - "level-mem": "^3.0.1", - "level-ws": "^1.0.0", - "readable-stream": "^3.0.6", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "level-ws": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", - "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.2.8", - "xtend": "^4.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - } - } - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } - } - }, - "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", - "dev": true - }, - "mime-db": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", - "dev": true - }, - "mime-types": { - "version": "2.1.26", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", - "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", - "dev": true, - "requires": { - "mime-db": "1.43.0" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "mocha": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.1.tgz", - "integrity": "sha512-3qQsu3ijNS3GkWcccT5Zw0hf/rWvu1fTN9sPvEd81hlwsr30GX2GcDSSoBxo24IR8FelmrAydGC6/1J5QQP4WA==", - "dev": true, - "requires": { - "ansi-colors": "3.2.3", - "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.3", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "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" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" - }, - "napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" - }, - "node-addon-api": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.0.tgz", - "integrity": "sha512-ASCL5U13as7HhOExbT6OlWJJUV/lLzL2voOSP1UVehpRD8FbSrSDjfScK/KwAvVTI5AS6r4VwbOMlIqtvRidnA==" - }, - "node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "node-gyp-build": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.1.tgz", - "integrity": "sha512-XyCKXsqZfLqHep1hhsMncoXuUNt/cXCjg1+8CLbu69V1TKuPiOeSGbL9n+k/ByKH8UT0p4rdIX8XkTRZV0i7Sw==" - }, - "node-preload": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", - "dev": true, - "requires": { - "process-on-spawn": "^1.0.0" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "nyc": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.1.tgz", - "integrity": "sha512-n0MBXYBYRqa67IVt62qW1r/d9UH/Qtr7SF1w/nQLJ9KxvWF6b2xCHImRAixHN9tnMMYHC2P14uo6KddNGwMgGg==", - "dev": true, - "requires": { - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "caching-transform": "^4.0.0", - "convert-source-map": "^1.7.0", - "decamelize": "^1.2.0", - "find-cache-dir": "^3.2.0", - "find-up": "^4.1.0", - "foreground-child": "^2.0.0", - "glob": "^7.1.6", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-processinfo": "^2.0.2", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "make-dir": "^3.0.0", - "node-preload": "^0.2.1", - "p-map": "^3.0.0", - "process-on-spawn": "^1.0.0", - "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "spawn-wrap": "^2.0.0", - "test-exclude": "^6.0.0", - "yargs": "^15.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "yargs": { - "version": "15.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", - "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.1" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "object-inspect": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", - "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } - } - }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "p-is-promise": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", - "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", - "dev": true - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "package-hash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "hasha": "^5.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "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-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - } - } - }, - "prettier": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", - "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "process-on-spawn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", - "dev": true, - "requires": { - "fromentries": "^1.2.0" - } - }, - "prr": { - "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", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "qs": { - "version": "6.9.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", - "integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "reachdown": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz", - "integrity": "sha512-6LsdRe4cZyOjw4NnvbhUd/rGG7WQ9HMopPr+kyL018Uci4kijtxcGR5kVb5Ln13k4PEE+fEFQbjfOvNw7cnXmA==" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", - "dev": true, - "requires": { - "picomatch": "^2.0.4" - } - }, - "release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rlp": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.4.tgz", - "integrity": "sha512-fdq2yYCWpAQBhwkZv+Z8o/Z4sPmYm1CUq6P7n6lVTOdb949CnqA0sndXal5C1NleSVSZm6q5F3iEbauyVln/iw==", - "requires": { - "bn.js": "^4.11.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } - } - }, - "rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" - }, - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" - }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } - } - }, - "seedrandom": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", - "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" - }, - "semaphore": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", - "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" - }, - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "sha3": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.6.tgz", - "integrity": "sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ==", - "requires": { - "nan": "2.13.2" - }, - "dependencies": { - "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" - } - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, - "solc": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.6.tgz", - "integrity": "sha512-p0IO/1fRaHWKN+qR+mUivpwnBpFYD8EoFAzT8VL4lmllNwsyEO7TJJAc2QK0XUeWOYOT92NWKhDNNNLTVbHShA==", - "dev": true, - "requires": { - "command-exists": "^1.2.8", - "commander": "3.0.2", - "fs-extra": "^0.30.0", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", - "tmp": "0.0.33" - }, - "dependencies": { - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-support": { - "version": "0.5.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.18.tgz", - "integrity": "sha512-9luZr/BZ2QeU6tO2uG8N2aZpVSli4TSAOAqFOyTO51AJcD9P99c0K1h6dD6r6qo5dyT44BR5exweOaLLeldTkQ==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "spawn-wrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", - "dev": true, - "requires": { - "foreground-child": "^2.0.0", - "is-windows": "^1.0.2", - "make-dir": "^3.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "which": "^2.0.1" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "string.prototype.trimend": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", - "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string.prototype.trimleft": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", - "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimstart": "^1.0.0" - } - }, - "string.prototype.trimright": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", - "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimend": "^1.0.0" - } - }, - "string.prototype.trimstart": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", - "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true - }, - "strip-hex-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", - "requires": { - "is-hex-prefixed": "1.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "subleveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.0.tgz", - "integrity": "sha512-DotbiAIyOWSsidM06/m+EsBHXRyP7EgPlDDD5GVn6JcoDFcVZbp+VN9bOdErNtDWwgR+lJDuKwcJ8nKqSq9Ixg==", - "requires": { - "abstract-leveldown": "^6.2.3", - "encoding-down": "^6.2.0", - "inherits": "^2.0.3", - "level-option-wrap": "^1.1.0", - "levelup": "^4.3.1", - "reachdown": "^1.1.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", - "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "encoding-down": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", - "requires": { - "abstract-leveldown": "^6.2.1", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0" - } - }, - "level-codec": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", - "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - } - } - }, - "superagent": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.2.2.tgz", - "integrity": "sha512-pMWBUnIllK4ZTw7p/UaobiQPwAO5w/1NRRTDpV0FTVNmECztsxKspj3ZWEordVEaqpZtmOQJJna4yTLyC/q7PQ==", - "dev": true, - "requires": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.2", - "debug": "^4.1.1", - "fast-safe-stringify": "^2.0.7", - "form-data": "^3.0.0", - "formidable": "^1.2.1", - "methods": "^1.1.2", - "mime": "^2.4.4", - "qs": "^6.9.1", - "readable-stream": "^3.4.0", - "semver": "^6.3.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } - } - }, - "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - } - }, - "tmp": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", - "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", - "requires": { - "rimraf": "^2.6.3" - } - }, - "tmp-promise": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-2.0.2.tgz", - "integrity": "sha512-zl71nFWjPKW2KXs+73gEk8RmqvtAeXPxhWDkTUoa3MSMkjq3I+9OeknjF178MQoMYsdqL730hfzvNfEkePxq9Q==", - "requires": { - "tmp": "0.1.0" - } - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "ts-node": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.9.0.tgz", - "integrity": "sha512-rwkXfOs9zmoHrV8xE++dmNd6ZIS+nmHHCxcV53ekGJrxFLMbp+pizpPS07ARvhwneCIECPppOwbZHvw9sQtU4w==", - "dev": true, - "requires": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - }, - "dependencies": { - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - } - } - }, - "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", - "dev": true - }, - "tslint": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.1.tgz", - "integrity": "sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.10.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - } - } - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", - "dev": true - }, - "uWebSockets.js": { - "version": "github:uNetworking/uWebSockets.js#116a85f9668dcb03e7799db06dc8275bc43c0963", - "from": "github:uNetworking/uWebSockets.js#v17.4.0" - }, - "utf-8-validate": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", - "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", - "dev": true, - "requires": { - "node-gyp-build": "~3.7.0" - }, - "dependencies": { - "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", - "dev": true - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "util.promisify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", - "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.2", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.0" - } - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "ws": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", - "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==", - "dev": true - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", - "dev": true, - "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" - } - }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true - } - } -} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..b757c1bea8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,10371 @@ +{ + "name": "root", + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/core": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", + "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.0", + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helpers": "^7.9.0", + "@babel/parser": "^7.9.0", + "@babel/template": "^7.8.6", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "@babel/generator": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", + "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "dev": true, + "requires": { + "@babel/types": "^7.9.5", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", + "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/types": "^7.9.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", + "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", + "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", + "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-replace-supers": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", + "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "requires": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, + "@babel/helpers": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", + "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", + "dev": true, + "requires": { + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0" + } + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true + }, + "@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "@babel/traverse": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", + "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.5", + "@babel/helper-function-name": "^7.9.5", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/parser": "^7.9.0", + "@babel/types": "^7.9.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "@evocateur/libnpmaccess": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz", + "integrity": "sha512-KSCAHwNWro0CF2ukxufCitT9K5LjL/KuMmNzSu8wuwN2rjyKHD8+cmOsiybK+W5hdnwc5M1SmRlVCaMHQo+3rg==", + "dev": true, + "requires": { + "@evocateur/npm-registry-fetch": "^4.0.0", + "aproba": "^2.0.0", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.0.0", + "npm-package-arg": "^6.1.0" + }, + "dependencies": { + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + } + } + }, + "@evocateur/libnpmpublish": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@evocateur/libnpmpublish/-/libnpmpublish-1.2.2.tgz", + "integrity": "sha512-MJrrk9ct1FeY9zRlyeoyMieBjGDG9ihyyD9/Ft6MMrTxql9NyoEx2hw9casTIP4CdqEVu+3nQ2nXxoJ8RCXyFg==", + "dev": true, + "requires": { + "@evocateur/npm-registry-fetch": "^4.0.0", + "aproba": "^2.0.0", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.0.0", + "lodash.clonedeep": "^4.5.0", + "normalize-package-data": "^2.4.0", + "npm-package-arg": "^6.1.0", + "semver": "^5.5.1", + "ssri": "^6.0.1" + }, + "dependencies": { + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@evocateur/npm-registry-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@evocateur/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz", + "integrity": "sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g==", + "dev": true, + "requires": { + "JSONStream": "^1.3.4", + "bluebird": "^3.5.1", + "figgy-pudding": "^3.4.1", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", + "npm-package-arg": "^6.1.0", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + } + } + }, + "@evocateur/pacote": { + "version": "9.6.5", + "resolved": "https://registry.npmjs.org/@evocateur/pacote/-/pacote-9.6.5.tgz", + "integrity": "sha512-EI552lf0aG2nOV8NnZpTxNo2PcXKPmDbF9K8eCBFQdIZwHNGN/mi815fxtmUMa2wTa1yndotICIDt/V0vpEx2w==", + "dev": true, + "requires": { + "@evocateur/npm-registry-fetch": "^4.0.0", + "bluebird": "^3.5.3", + "cacache": "^12.0.3", + "chownr": "^1.1.2", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.1.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", + "minimatch": "^3.0.4", + "minipass": "^2.3.5", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "normalize-package-data": "^2.5.0", + "npm-package-arg": "^6.1.0", + "npm-packlist": "^1.4.4", + "npm-pick-manifest": "^3.0.0", + "osenv": "^0.1.5", + "promise-inflight": "^1.0.1", + "promise-retry": "^1.1.1", + "protoduck": "^5.0.1", + "rimraf": "^2.6.3", + "safe-buffer": "^5.2.0", + "semver": "^5.7.0", + "ssri": "^6.0.1", + "tar": "^4.4.10", + "unique-filename": "^1.1.1", + "which": "^1.3.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", + "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, + "@istanbuljs/nyc-config-typescript": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz", + "integrity": "sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2" + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, + "@lerna/add": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/add/-/add-3.20.0.tgz", + "integrity": "sha512-AnH1oRIEEg/VDa3SjYq4x1/UglEAvrZuV0WssHUMN81RTZgQk3we+Mv3qZNddrZ/fBcZu2IAdN/EQ3+ie2JxKQ==", + "dev": true, + "requires": { + "@evocateur/pacote": "^9.6.3", + "@lerna/bootstrap": "3.20.0", + "@lerna/command": "3.18.5", + "@lerna/filter-options": "3.20.0", + "@lerna/npm-conf": "3.16.0", + "@lerna/validation-error": "3.13.0", + "dedent": "^0.7.0", + "npm-package-arg": "^6.1.0", + "p-map": "^2.1.0", + "semver": "^6.2.0" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/bootstrap": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.20.0.tgz", + "integrity": "sha512-Wylullx3uthKE7r4izo09qeRGL20Y5yONlQEjPCfnbxCC2Elu+QcPu4RC6kqKQ7b+g7pdC3OOgcHZjngrwr5XQ==", + "dev": true, + "requires": { + "@lerna/command": "3.18.5", + "@lerna/filter-options": "3.20.0", + "@lerna/has-npm-version": "3.16.5", + "@lerna/npm-install": "3.16.5", + "@lerna/package-graph": "3.18.5", + "@lerna/pulse-till-done": "3.13.0", + "@lerna/rimraf-dir": "3.16.5", + "@lerna/run-lifecycle": "3.16.2", + "@lerna/run-topologically": "3.18.5", + "@lerna/symlink-binary": "3.17.0", + "@lerna/symlink-dependencies": "3.17.0", + "@lerna/validation-error": "3.13.0", + "dedent": "^0.7.0", + "get-port": "^4.2.0", + "multimatch": "^3.0.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "p-finally": "^1.0.0", + "p-map": "^2.1.0", + "p-map-series": "^1.0.0", + "p-waterfall": "^1.0.0", + "read-package-tree": "^5.1.6", + "semver": "^6.2.0" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/changed": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-3.20.0.tgz", + "integrity": "sha512-+hzMFSldbRPulZ0vbKk6RD9f36gaH3Osjx34wrrZ62VB4pKmjyuS/rxVYkCA3viPLHoiIw2F8zHM5BdYoDSbjw==", + "dev": true, + "requires": { + "@lerna/collect-updates": "3.20.0", + "@lerna/command": "3.18.5", + "@lerna/listable": "3.18.5", + "@lerna/output": "3.13.0" + } + }, + "@lerna/check-working-tree": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-3.16.5.tgz", + "integrity": "sha512-xWjVBcuhvB8+UmCSb5tKVLB5OuzSpw96WEhS2uz6hkWVa/Euh1A0/HJwn2cemyK47wUrCQXtczBUiqnq9yX5VQ==", + "dev": true, + "requires": { + "@lerna/collect-uncommitted": "3.16.5", + "@lerna/describe-ref": "3.16.5", + "@lerna/validation-error": "3.13.0" + } + }, + "@lerna/child-process": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-3.16.5.tgz", + "integrity": "sha512-vdcI7mzei9ERRV4oO8Y1LHBZ3A5+ampRKg1wq5nutLsUA4mEBN6H7JqjWOMY9xZemv6+kATm2ofjJ3lW5TszQg==", + "dev": true, + "requires": { + "chalk": "^2.3.1", + "execa": "^1.0.0", + "strong-log-transformer": "^2.0.0" + } + }, + "@lerna/clean": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-3.20.0.tgz", + "integrity": "sha512-9ZdYrrjQvR5wNXmHfDsfjWjp0foOkCwKe3hrckTzkAeQA1ibyz5llGwz5e1AeFrV12e2/OLajVqYfe+qdkZUgg==", + "dev": true, + "requires": { + "@lerna/command": "3.18.5", + "@lerna/filter-options": "3.20.0", + "@lerna/prompt": "3.18.5", + "@lerna/pulse-till-done": "3.13.0", + "@lerna/rimraf-dir": "3.16.5", + "p-map": "^2.1.0", + "p-map-series": "^1.0.0", + "p-waterfall": "^1.0.0" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "@lerna/cli": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/cli/-/cli-3.18.5.tgz", + "integrity": "sha512-erkbxkj9jfc89vVs/jBLY/fM0I80oLmJkFUV3Q3wk9J3miYhP14zgVEBsPZY68IZlEjT6T3Xlq2xO1AVaatHsA==", + "dev": true, + "requires": { + "@lerna/global-options": "3.13.0", + "dedent": "^0.7.0", + "npmlog": "^4.1.2", + "yargs": "^14.2.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "yargs": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^15.0.1" + } + }, + "yargs-parser": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "@lerna/collect-uncommitted": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-3.16.5.tgz", + "integrity": "sha512-ZgqnGwpDZiWyzIQVZtQaj9tRizsL4dUOhuOStWgTAw1EMe47cvAY2kL709DzxFhjr6JpJSjXV5rZEAeU3VE0Hg==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "chalk": "^2.3.1", + "figgy-pudding": "^3.5.1", + "npmlog": "^4.1.2" + } + }, + "@lerna/collect-updates": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-3.20.0.tgz", + "integrity": "sha512-qBTVT5g4fupVhBFuY4nI/3FSJtQVcDh7/gEPOpRxoXB/yCSnT38MFHXWl+y4einLciCjt/+0x6/4AG80fjay2Q==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/describe-ref": "3.16.5", + "minimatch": "^3.0.4", + "npmlog": "^4.1.2", + "slash": "^2.0.0" + } + }, + "@lerna/command": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/command/-/command-3.18.5.tgz", + "integrity": "sha512-36EnqR59yaTU4HrR1C9XDFti2jRx0BgpIUBeWn129LZZB8kAB3ov1/dJNa1KcNRKp91DncoKHLY99FZ6zTNpMQ==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/package-graph": "3.18.5", + "@lerna/project": "3.18.0", + "@lerna/validation-error": "3.13.0", + "@lerna/write-log-file": "3.13.0", + "clone-deep": "^4.0.1", + "dedent": "^0.7.0", + "execa": "^1.0.0", + "is-ci": "^2.0.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/conventional-commits": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-3.18.5.tgz", + "integrity": "sha512-qcvXIEJ3qSgalxXnQ7Yxp5H9Ta5TVyai6vEor6AAEHc20WiO7UIdbLDCxBtiiHMdGdpH85dTYlsoYUwsCJu3HQ==", + "dev": true, + "requires": { + "@lerna/validation-error": "3.13.0", + "conventional-changelog-angular": "^5.0.3", + "conventional-changelog-core": "^3.1.6", + "conventional-recommended-bump": "^5.0.0", + "fs-extra": "^8.1.0", + "get-stream": "^4.0.0", + "lodash.template": "^4.5.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "pify": "^4.0.1", + "semver": "^6.2.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/create": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.18.5.tgz", + "integrity": "sha512-cHpjocbpKmLopCuZFI7cKEM3E/QY8y+yC7VtZ4FQRSaLU8D8i2xXtXmYaP1GOlVNavji0iwoXjuNpnRMInIr2g==", + "dev": true, + "requires": { + "@evocateur/pacote": "^9.6.3", + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.18.5", + "@lerna/npm-conf": "3.16.0", + "@lerna/validation-error": "3.13.0", + "camelcase": "^5.0.0", + "dedent": "^0.7.0", + "fs-extra": "^8.1.0", + "globby": "^9.2.0", + "init-package-json": "^1.10.3", + "npm-package-arg": "^6.1.0", + "p-reduce": "^1.0.0", + "pify": "^4.0.1", + "semver": "^6.2.0", + "slash": "^2.0.0", + "validate-npm-package-license": "^3.0.3", + "validate-npm-package-name": "^3.0.0", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/create-symlink": { + "version": "3.16.2", + "resolved": "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-3.16.2.tgz", + "integrity": "sha512-pzXIJp6av15P325sgiIRpsPXLFmkisLhMBCy4764d+7yjf2bzrJ4gkWVMhsv4AdF0NN3OyZ5jjzzTtLNqfR+Jw==", + "dev": true, + "requires": { + "@zkochan/cmd-shim": "^3.1.0", + "fs-extra": "^8.1.0", + "npmlog": "^4.1.2" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + } + } + }, + "@lerna/describe-ref": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-3.16.5.tgz", + "integrity": "sha512-c01+4gUF0saOOtDBzbLMFOTJDHTKbDFNErEY6q6i9QaXuzy9LNN62z+Hw4acAAZuJQhrVWncVathcmkkjvSVGw==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "npmlog": "^4.1.2" + } + }, + "@lerna/diff": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-3.18.5.tgz", + "integrity": "sha512-u90lGs+B8DRA9Z/2xX4YaS3h9X6GbypmGV6ITzx9+1Ga12UWGTVlKaCXBgONMBjzJDzAQOK8qPTwLA57SeBLgA==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.18.5", + "@lerna/validation-error": "3.13.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/exec": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-3.20.0.tgz", + "integrity": "sha512-pS1mmC7kzV668rHLWuv31ClngqeXjeHC8kJuM+W2D6IpUVMGQHLcCTYLudFgQsuKGVpl0DGNYG+sjLhAPiiu6A==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.18.5", + "@lerna/filter-options": "3.20.0", + "@lerna/profiler": "3.20.0", + "@lerna/run-topologically": "3.18.5", + "@lerna/validation-error": "3.13.0", + "p-map": "^2.1.0" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "@lerna/filter-options": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-3.20.0.tgz", + "integrity": "sha512-bmcHtvxn7SIl/R9gpiNMVG7yjx7WyT0HSGw34YVZ9B+3xF/83N3r5Rgtjh4hheLZ+Q91Or0Jyu5O3Nr+AwZe2g==", + "dev": true, + "requires": { + "@lerna/collect-updates": "3.20.0", + "@lerna/filter-packages": "3.18.0", + "dedent": "^0.7.0", + "figgy-pudding": "^3.5.1", + "npmlog": "^4.1.2" + } + }, + "@lerna/filter-packages": { + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-3.18.0.tgz", + "integrity": "sha512-6/0pMM04bCHNATIOkouuYmPg6KH3VkPCIgTfQmdkPJTullERyEQfNUKikrefjxo1vHOoCACDpy65JYyKiAbdwQ==", + "dev": true, + "requires": { + "@lerna/validation-error": "3.13.0", + "multimatch": "^3.0.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/get-npm-exec-opts": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.13.0.tgz", + "integrity": "sha512-Y0xWL0rg3boVyJk6An/vurKzubyJKtrxYv2sj4bB8Mc5zZ3tqtv0ccbOkmkXKqbzvNNF7VeUt1OJ3DRgtC/QZw==", + "dev": true, + "requires": { + "npmlog": "^4.1.2" + } + }, + "@lerna/get-packed": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-3.16.0.tgz", + "integrity": "sha512-AjsFiaJzo1GCPnJUJZiTW6J1EihrPkc2y3nMu6m3uWFxoleklsSCyImumzVZJssxMi3CPpztj8LmADLedl9kXw==", + "dev": true, + "requires": { + "fs-extra": "^8.1.0", + "ssri": "^6.0.1", + "tar": "^4.4.8" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + } + } + }, + "@lerna/github-client": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-3.16.5.tgz", + "integrity": "sha512-rHQdn8Dv/CJrO3VouOP66zAcJzrHsm+wFuZ4uGAai2At2NkgKH+tpNhQy2H1PSC0Ezj9LxvdaHYrUzULqVK5Hw==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@octokit/plugin-enterprise-rest": "^3.6.1", + "@octokit/rest": "^16.28.4", + "git-url-parse": "^11.1.2", + "npmlog": "^4.1.2" + } + }, + "@lerna/gitlab-client": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-3.15.0.tgz", + "integrity": "sha512-OsBvRSejHXUBMgwWQqNoioB8sgzL/Pf1pOUhHKtkiMl6aAWjklaaq5HPMvTIsZPfS6DJ9L5OK2GGZuooP/5c8Q==", + "dev": true, + "requires": { + "node-fetch": "^2.5.0", + "npmlog": "^4.1.2", + "whatwg-url": "^7.0.0" + } + }, + "@lerna/global-options": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/global-options/-/global-options-3.13.0.tgz", + "integrity": "sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ==", + "dev": true + }, + "@lerna/has-npm-version": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-3.16.5.tgz", + "integrity": "sha512-WL7LycR9bkftyqbYop5rEGJ9sRFIV55tSGmbN1HLrF9idwOCD7CLrT64t235t3t4O5gehDnwKI5h2U3oxTrF8Q==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/import": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.18.5.tgz", + "integrity": "sha512-PH0WVLEgp+ORyNKbGGwUcrueW89K3Iuk/DDCz8mFyG2IG09l/jOF0vzckEyGyz6PO5CMcz4TI1al/qnp3FrahQ==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.18.5", + "@lerna/prompt": "3.18.5", + "@lerna/pulse-till-done": "3.13.0", + "@lerna/validation-error": "3.13.0", + "dedent": "^0.7.0", + "fs-extra": "^8.1.0", + "p-map-series": "^1.0.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + } + } + }, + "@lerna/info": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/info/-/info-3.20.0.tgz", + "integrity": "sha512-Rsz+KQF9mczbGUbPTrtOed1N0C+cA08Qz0eX/oI+NNjvsryZIju/o7uedG4I3P55MBiAioNrJI88fHH3eTgYug==", + "dev": true, + "requires": { + "@lerna/command": "3.18.5", + "@lerna/output": "3.13.0", + "envinfo": "^7.3.1" + } + }, + "@lerna/init": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/init/-/init-3.18.5.tgz", + "integrity": "sha512-oCwipWrha98EcJAHm8AGd2YFFLNI7AW9AWi0/LbClj1+XY9ah+uifXIgYGfTk63LbgophDd8936ZEpHMxBsbAg==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.18.5", + "fs-extra": "^8.1.0", + "p-map": "^2.1.0", + "write-json-file": "^3.2.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "@lerna/link": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/link/-/link-3.18.5.tgz", + "integrity": "sha512-xTN3vktJpkT7Nqc3QkZRtHO4bT5NvuLMtKNIBDkks0HpGxC9PRyyqwOoCoh1yOGbrWIuDezhfMg3Qow+6I69IQ==", + "dev": true, + "requires": { + "@lerna/command": "3.18.5", + "@lerna/package-graph": "3.18.5", + "@lerna/symlink-dependencies": "3.17.0", + "p-map": "^2.1.0", + "slash": "^2.0.0" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "@lerna/list": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/list/-/list-3.20.0.tgz", + "integrity": "sha512-fXTicPrfioVnRzknyPawmYIVkzDRBaQqk9spejS1S3O1DOidkihK0xxNkr8HCVC0L22w6f92g83qWDp2BYRUbg==", + "dev": true, + "requires": { + "@lerna/command": "3.18.5", + "@lerna/filter-options": "3.20.0", + "@lerna/listable": "3.18.5", + "@lerna/output": "3.13.0" + } + }, + "@lerna/listable": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/listable/-/listable-3.18.5.tgz", + "integrity": "sha512-Sdr3pVyaEv5A7ZkGGYR7zN+tTl2iDcinryBPvtuv20VJrXBE8wYcOks1edBTcOWsPjCE/rMP4bo1pseyk3UTsg==", + "dev": true, + "requires": { + "@lerna/query-graph": "3.18.5", + "chalk": "^2.3.1", + "columnify": "^1.5.4" + } + }, + "@lerna/log-packed": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-3.16.0.tgz", + "integrity": "sha512-Fp+McSNBV/P2mnLUYTaSlG8GSmpXM7krKWcllqElGxvAqv6chk2K3c2k80MeVB4WvJ9tRjUUf+i7HUTiQ9/ckQ==", + "dev": true, + "requires": { + "byte-size": "^5.0.1", + "columnify": "^1.5.4", + "has-unicode": "^2.0.1", + "npmlog": "^4.1.2" + } + }, + "@lerna/npm-conf": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-3.16.0.tgz", + "integrity": "sha512-HbO3DUrTkCAn2iQ9+FF/eisDpWY5POQAOF1m7q//CZjdC2HSW3UYbKEGsSisFxSfaF9Z4jtrV+F/wX6qWs3CuA==", + "dev": true, + "requires": { + "config-chain": "^1.1.11", + "pify": "^4.0.1" + } + }, + "@lerna/npm-dist-tag": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-3.18.5.tgz", + "integrity": "sha512-xw0HDoIG6HreVsJND9/dGls1c+lf6vhu7yJoo56Sz5bvncTloYGLUppIfDHQr4ZvmPCK8rsh0euCVh2giPxzKQ==", + "dev": true, + "requires": { + "@evocateur/npm-registry-fetch": "^4.0.0", + "@lerna/otplease": "3.18.5", + "figgy-pudding": "^3.5.1", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/npm-install": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-3.16.5.tgz", + "integrity": "sha512-hfiKk8Eku6rB9uApqsalHHTHY+mOrrHeWEs+gtg7+meQZMTS3kzv4oVp5cBZigndQr3knTLjwthT/FX4KvseFg==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/get-npm-exec-opts": "3.13.0", + "fs-extra": "^8.1.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "signal-exit": "^3.0.2", + "write-pkg": "^3.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + } + } + }, + "@lerna/npm-publish": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-3.18.5.tgz", + "integrity": "sha512-3etLT9+2L8JAx5F8uf7qp6iAtOLSMj+ZYWY6oUgozPi/uLqU0/gsMsEXh3F0+YVW33q0M61RpduBoAlOOZnaTg==", + "dev": true, + "requires": { + "@evocateur/libnpmpublish": "^1.2.2", + "@lerna/otplease": "3.18.5", + "@lerna/run-lifecycle": "3.16.2", + "figgy-pudding": "^3.5.1", + "fs-extra": "^8.1.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "pify": "^4.0.1", + "read-package-json": "^2.0.13" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + } + } + }, + "@lerna/npm-run-script": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-3.16.5.tgz", + "integrity": "sha512-1asRi+LjmVn3pMjEdpqKJZFT/3ZNpb+VVeJMwrJaV/3DivdNg7XlPK9LTrORuKU4PSvhdEZvJmSlxCKyDpiXsQ==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/get-npm-exec-opts": "3.13.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/otplease": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/otplease/-/otplease-3.18.5.tgz", + "integrity": "sha512-S+SldXAbcXTEDhzdxYLU0ZBKuYyURP/ND2/dK6IpKgLxQYh/z4ScljPDMyKymmEvgiEJmBsPZAAPfmNPEzxjog==", + "dev": true, + "requires": { + "@lerna/prompt": "3.18.5", + "figgy-pudding": "^3.5.1" + } + }, + "@lerna/output": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/output/-/output-3.13.0.tgz", + "integrity": "sha512-7ZnQ9nvUDu/WD+bNsypmPG5MwZBwu86iRoiW6C1WBuXXDxM5cnIAC1m2WxHeFnjyMrYlRXM9PzOQ9VDD+C15Rg==", + "dev": true, + "requires": { + "npmlog": "^4.1.2" + } + }, + "@lerna/pack-directory": { + "version": "3.16.4", + "resolved": "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-3.16.4.tgz", + "integrity": "sha512-uxSF0HZeGyKaaVHz5FroDY9A5NDDiCibrbYR6+khmrhZtY0Bgn6hWq8Gswl9iIlymA+VzCbshWIMX4o2O8C8ng==", + "dev": true, + "requires": { + "@lerna/get-packed": "3.16.0", + "@lerna/package": "3.16.0", + "@lerna/run-lifecycle": "3.16.2", + "figgy-pudding": "^3.5.1", + "npm-packlist": "^1.4.4", + "npmlog": "^4.1.2", + "tar": "^4.4.10", + "temp-write": "^3.4.0" + } + }, + "@lerna/package": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/package/-/package-3.16.0.tgz", + "integrity": "sha512-2lHBWpaxcBoiNVbtyLtPUuTYEaB/Z+eEqRS9duxpZs6D+mTTZMNy6/5vpEVSCBmzvdYpyqhqaYjjSLvjjr5Riw==", + "dev": true, + "requires": { + "load-json-file": "^5.3.0", + "npm-package-arg": "^6.1.0", + "write-pkg": "^3.1.0" + } + }, + "@lerna/package-graph": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-3.18.5.tgz", + "integrity": "sha512-8QDrR9T+dBegjeLr+n9WZTVxUYUhIUjUgZ0gvNxUBN8S1WB9r6H5Yk56/MVaB64tA3oGAN9IIxX6w0WvTfFudA==", + "dev": true, + "requires": { + "@lerna/prerelease-id-from-version": "3.16.0", + "@lerna/validation-error": "3.13.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/prerelease-id-from-version": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.16.0.tgz", + "integrity": "sha512-qZyeUyrE59uOK8rKdGn7jQz+9uOpAaF/3hbslJVFL1NqF9ELDTqjCPXivuejMX/lN4OgD6BugTO4cR7UTq/sZA==", + "dev": true, + "requires": { + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/profiler": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/profiler/-/profiler-3.20.0.tgz", + "integrity": "sha512-bh8hKxAlm6yu8WEOvbLENm42i2v9SsR4WbrCWSbsmOElx3foRnMlYk7NkGECa+U5c3K4C6GeBbwgqs54PP7Ljg==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1", + "fs-extra": "^8.1.0", + "npmlog": "^4.1.2", + "upath": "^1.2.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + } + } + }, + "@lerna/project": { + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/@lerna/project/-/project-3.18.0.tgz", + "integrity": "sha512-+LDwvdAp0BurOAWmeHE3uuticsq9hNxBI0+FMHiIai8jrygpJGahaQrBYWpwbshbQyVLeQgx3+YJdW2TbEdFWA==", + "dev": true, + "requires": { + "@lerna/package": "3.16.0", + "@lerna/validation-error": "3.13.0", + "cosmiconfig": "^5.1.0", + "dedent": "^0.7.0", + "dot-prop": "^4.2.0", + "glob-parent": "^5.0.0", + "globby": "^9.2.0", + "load-json-file": "^5.3.0", + "npmlog": "^4.1.2", + "p-map": "^2.1.0", + "resolve-from": "^4.0.0", + "write-json-file": "^3.2.0" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, + "@lerna/prompt": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/prompt/-/prompt-3.18.5.tgz", + "integrity": "sha512-rkKj4nm1twSbBEb69+Em/2jAERK8htUuV8/xSjN0NPC+6UjzAwY52/x9n5cfmpa9lyKf/uItp7chCI7eDmNTKQ==", + "dev": true, + "requires": { + "inquirer": "^6.2.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/publish": { + "version": "3.20.2", + "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.20.2.tgz", + "integrity": "sha512-N7Y6PdhJ+tYQPdI1tZum8W25cDlTp4D6brvRacKZusweWexxaopbV8RprBaKexkEX/KIbncuADq7qjDBdQHzaA==", + "dev": true, + "requires": { + "@evocateur/libnpmaccess": "^3.1.2", + "@evocateur/npm-registry-fetch": "^4.0.0", + "@evocateur/pacote": "^9.6.3", + "@lerna/check-working-tree": "3.16.5", + "@lerna/child-process": "3.16.5", + "@lerna/collect-updates": "3.20.0", + "@lerna/command": "3.18.5", + "@lerna/describe-ref": "3.16.5", + "@lerna/log-packed": "3.16.0", + "@lerna/npm-conf": "3.16.0", + "@lerna/npm-dist-tag": "3.18.5", + "@lerna/npm-publish": "3.18.5", + "@lerna/otplease": "3.18.5", + "@lerna/output": "3.13.0", + "@lerna/pack-directory": "3.16.4", + "@lerna/prerelease-id-from-version": "3.16.0", + "@lerna/prompt": "3.18.5", + "@lerna/pulse-till-done": "3.13.0", + "@lerna/run-lifecycle": "3.16.2", + "@lerna/run-topologically": "3.18.5", + "@lerna/validation-error": "3.13.0", + "@lerna/version": "3.20.2", + "figgy-pudding": "^3.5.1", + "fs-extra": "^8.1.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "p-finally": "^1.0.0", + "p-map": "^2.1.0", + "p-pipe": "^1.2.0", + "semver": "^6.2.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/pulse-till-done": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-3.13.0.tgz", + "integrity": "sha512-1SOHpy7ZNTPulzIbargrgaJX387csN7cF1cLOGZiJQA6VqnS5eWs2CIrG8i8wmaUavj2QlQ5oEbRMVVXSsGrzA==", + "dev": true, + "requires": { + "npmlog": "^4.1.2" + } + }, + "@lerna/query-graph": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-3.18.5.tgz", + "integrity": "sha512-50Lf4uuMpMWvJ306be3oQDHrWV42nai9gbIVByPBYJuVW8dT8O8pA3EzitNYBUdLL9/qEVbrR0ry1HD7EXwtRA==", + "dev": true, + "requires": { + "@lerna/package-graph": "3.18.5", + "figgy-pudding": "^3.5.1" + } + }, + "@lerna/resolve-symlink": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-3.16.0.tgz", + "integrity": "sha512-Ibj5e7njVHNJ/NOqT4HlEgPFPtPLWsO7iu59AM5bJDcAJcR96mLZ7KGVIsS2tvaO7akMEJvt2P+ErwCdloG3jQ==", + "dev": true, + "requires": { + "fs-extra": "^8.1.0", + "npmlog": "^4.1.2", + "read-cmd-shim": "^1.0.1" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + } + } + }, + "@lerna/rimraf-dir": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-3.16.5.tgz", + "integrity": "sha512-bQlKmO0pXUsXoF8lOLknhyQjOZsCc0bosQDoX4lujBXSWxHVTg1VxURtWf2lUjz/ACsJVDfvHZbDm8kyBk5okA==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "npmlog": "^4.1.2", + "path-exists": "^3.0.0", + "rimraf": "^2.6.2" + } + }, + "@lerna/run": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/run/-/run-3.20.0.tgz", + "integrity": "sha512-9U3AqeaCeB7KsGS9oyKNp62s9vYoULg/B4cqXTKZkc+OKL6QOEjYHYVSBcMK9lUXrMjCjDIuDSX3PnTCPxQ2Dw==", + "dev": true, + "requires": { + "@lerna/command": "3.18.5", + "@lerna/filter-options": "3.20.0", + "@lerna/npm-run-script": "3.16.5", + "@lerna/output": "3.13.0", + "@lerna/profiler": "3.20.0", + "@lerna/run-topologically": "3.18.5", + "@lerna/timer": "3.13.0", + "@lerna/validation-error": "3.13.0", + "p-map": "^2.1.0" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "@lerna/run-lifecycle": { + "version": "3.16.2", + "resolved": "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-3.16.2.tgz", + "integrity": "sha512-RqFoznE8rDpyyF0rOJy3+KjZCeTkO8y/OB9orPauR7G2xQ7PTdCpgo7EO6ZNdz3Al+k1BydClZz/j78gNCmL2A==", + "dev": true, + "requires": { + "@lerna/npm-conf": "3.16.0", + "figgy-pudding": "^3.5.1", + "npm-lifecycle": "^3.1.2", + "npmlog": "^4.1.2" + } + }, + "@lerna/run-topologically": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-3.18.5.tgz", + "integrity": "sha512-6N1I+6wf4hLOnPW+XDZqwufyIQ6gqoPfHZFkfWlvTQ+Ue7CuF8qIVQ1Eddw5HKQMkxqN10thKOFfq/9NQZ4NUg==", + "dev": true, + "requires": { + "@lerna/query-graph": "3.18.5", + "figgy-pudding": "^3.5.1", + "p-queue": "^4.0.0" + } + }, + "@lerna/symlink-binary": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-3.17.0.tgz", + "integrity": "sha512-RLpy9UY6+3nT5J+5jkM5MZyMmjNHxZIZvXLV+Q3MXrf7Eaa1hNqyynyj4RO95fxbS+EZc4XVSk25DGFQbcRNSQ==", + "dev": true, + "requires": { + "@lerna/create-symlink": "3.16.2", + "@lerna/package": "3.16.0", + "fs-extra": "^8.1.0", + "p-map": "^2.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "@lerna/symlink-dependencies": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-3.17.0.tgz", + "integrity": "sha512-KmjU5YT1bpt6coOmdFueTJ7DFJL4H1w5eF8yAQ2zsGNTtZ+i5SGFBWpb9AQaw168dydc3s4eu0W0Sirda+F59Q==", + "dev": true, + "requires": { + "@lerna/create-symlink": "3.16.2", + "@lerna/resolve-symlink": "3.16.0", + "@lerna/symlink-binary": "3.17.0", + "fs-extra": "^8.1.0", + "p-finally": "^1.0.0", + "p-map": "^2.1.0", + "p-map-series": "^1.0.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + } + } + }, + "@lerna/timer": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/timer/-/timer-3.13.0.tgz", + "integrity": "sha512-RHWrDl8U4XNPqY5MQHkToWS9jHPnkLZEt5VD+uunCKTfzlxGnRCr3/zVr8VGy/uENMYpVP3wJa4RKGY6M0vkRw==", + "dev": true + }, + "@lerna/validation-error": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-3.13.0.tgz", + "integrity": "sha512-SiJP75nwB8GhgwLKQfdkSnDufAaCbkZWJqEDlKOUPUvVOplRGnfL+BPQZH5nvq2BYSRXsksXWZ4UHVnQZI/HYA==", + "dev": true, + "requires": { + "npmlog": "^4.1.2" + } + }, + "@lerna/version": { + "version": "3.20.2", + "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.20.2.tgz", + "integrity": "sha512-ckBJMaBWc+xJen0cMyCE7W67QXLLrc0ELvigPIn8p609qkfNM0L0CF803MKxjVOldJAjw84b8ucNWZLvJagP/Q==", + "dev": true, + "requires": { + "@lerna/check-working-tree": "3.16.5", + "@lerna/child-process": "3.16.5", + "@lerna/collect-updates": "3.20.0", + "@lerna/command": "3.18.5", + "@lerna/conventional-commits": "3.18.5", + "@lerna/github-client": "3.16.5", + "@lerna/gitlab-client": "3.15.0", + "@lerna/output": "3.13.0", + "@lerna/prerelease-id-from-version": "3.16.0", + "@lerna/prompt": "3.18.5", + "@lerna/run-lifecycle": "3.16.2", + "@lerna/run-topologically": "3.18.5", + "@lerna/validation-error": "3.13.0", + "chalk": "^2.3.1", + "dedent": "^0.7.0", + "load-json-file": "^5.3.0", + "minimatch": "^3.0.4", + "npmlog": "^4.1.2", + "p-map": "^2.1.0", + "p-pipe": "^1.2.0", + "p-reduce": "^1.0.0", + "p-waterfall": "^1.0.0", + "semver": "^6.2.0", + "slash": "^2.0.0", + "temp-write": "^3.4.0", + "write-json-file": "^3.2.0" + }, + "dependencies": { + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/write-log-file": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-3.13.0.tgz", + "integrity": "sha512-RibeMnDPvlL8bFYW5C8cs4mbI3AHfQef73tnJCQ/SgrXZHehmHnsyWUiE7qDQCAo+B1RfTapvSyFF69iPj326A==", + "dev": true, + "requires": { + "npmlog": "^4.1.2", + "write-file-atomic": "^2.3.0" + }, + "dependencies": { + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + } + } + }, + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "dev": true + }, + "@octokit/auth-token": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.0.tgz", + "integrity": "sha512-eoOVMjILna7FVQf96iWc3+ZtE/ZT6y8ob8ZzcqKY1ibSQCnu4O/B7pJvzMx5cyZ/RjAff6DAdEb0O0Cjcxidkg==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.0" + } + }, + "@octokit/endpoint": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.1.tgz", + "integrity": "sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A==", + "dev": true, + "requires": { + "@octokit/types": "^2.11.1", + "is-plain-object": "^3.0.0", + "universal-user-agent": "^5.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", + "dev": true, + "requires": { + "isobject": "^4.0.0" + } + }, + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "dev": true + }, + "universal-user-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", + "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", + "dev": true, + "requires": { + "os-name": "^3.1.0" + } + } + } + }, + "@octokit/plugin-enterprise-rest": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-3.6.2.tgz", + "integrity": "sha512-3wF5eueS5OHQYuAEudkpN+xVeUsg8vYEMMenEzLphUZ7PRZ8OJtDcsreL3ad9zxXmBbaFWzLmFcdob5CLyZftA==", + "dev": true + }, + "@octokit/plugin-paginate-rest": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", + "integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.1" + } + }, + "@octokit/plugin-request-log": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz", + "integrity": "sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw==", + "dev": true + }, + "@octokit/plugin-rest-endpoint-methods": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz", + "integrity": "sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.1", + "deprecation": "^2.3.1" + } + }, + "@octokit/request": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz", + "integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==", + "dev": true, + "requires": { + "@octokit/endpoint": "^6.0.1", + "@octokit/request-error": "^2.0.0", + "@octokit/types": "^2.11.1", + "deprecation": "^2.0.0", + "is-plain-object": "^3.0.0", + "node-fetch": "^2.3.0", + "once": "^1.4.0", + "universal-user-agent": "^5.0.0" + }, + "dependencies": { + "@octokit/request-error": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz", + "integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", + "dev": true, + "requires": { + "isobject": "^4.0.0" + } + }, + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "dev": true + }, + "universal-user-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", + "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", + "dev": true, + "requires": { + "os-name": "^3.1.0" + } + } + } + }, + "@octokit/request-error": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz", + "integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/rest": { + "version": "16.43.1", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz", + "integrity": "sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==", + "dev": true, + "requires": { + "@octokit/auth-token": "^2.4.0", + "@octokit/plugin-paginate-rest": "^1.1.1", + "@octokit/plugin-request-log": "^1.0.0", + "@octokit/plugin-rest-endpoint-methods": "2.4.0", + "@octokit/request": "^5.2.0", + "@octokit/request-error": "^1.0.2", + "atob-lite": "^2.0.0", + "before-after-hook": "^2.0.0", + "btoa-lite": "^1.0.0", + "deprecation": "^2.0.0", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "octokit-pagination-methods": "^1.1.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" + } + }, + "@octokit/types": { + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.12.2.tgz", + "integrity": "sha512-1GHLI/Jll3j6F0GbYyZPFTcHZMGjAiRfkTEoRUyaVVk2IWbDdwEiClAJvXzfXCDayuGSNCqAUH8lpjZtqW9GDw==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + }, + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "requires": { + "@types/node": "*" + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/cookiejar": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz", + "integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==", + "dev": true + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/lodash": { + "version": "4.14.150", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.150.tgz", + "integrity": "sha512-kMNLM5JBcasgYscD9x/Gvr6lTAv2NVgsKtet/hm93qMyf/D1pt+7jeEZklKJKxMVmXjxbRVQQGfqDSfipYCO6w==" + }, + "@types/lodash.clonedeep": { + "version": "4.5.6", + "resolved": "https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz", + "integrity": "sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==", + "requires": { + "@types/lodash": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/mocha": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", + "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", + "dev": true + }, + "@types/node": { + "version": "13.13.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", + "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==" + }, + "@types/secp256k1": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-3.5.0.tgz", + "integrity": "sha512-ZE39QhkIaNK6xbKIp1VLN5O36r97LuslLmRnjAcT0sVDxcfvrk3zqp/VnIfmGza7J6jDxR8dIai3hsCxPYglPA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/seedrandom": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz", + "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", + "dev": true + }, + "@types/superagent": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.7.tgz", + "integrity": "sha512-JSwNPgRYjIC4pIeOqLwWwfGj6iP1n5NE6kNBEbGx2V8H78xCPwx7QpNp9plaI30+W3cFEzJO7BIIsXE+dbtaGg==", + "dev": true, + "requires": { + "@types/cookiejar": "*", + "@types/node": "*" + } + }, + "@types/uws": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", + "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/node": "*" + } + }, + "@types/ws": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.4.tgz", + "integrity": "sha512-9S6Ask71vujkVyeEXKxjBSUV8ZUB0mjL5la4IncBoheu04bDaYyUKErh1BQcY9+WzOUOiKqz/OnpJHYckbMfNg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@zkochan/cmd-shim": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", + "integrity": "sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg==", + "dev": true, + "requires": { + "is-windows": "^1.0.0", + "mkdirp-promise": "^5.0.1", + "mz": "^2.5.0" + } + }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "~4.0.0" + } + }, + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + }, + "agentkeepalive": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", + "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", + "dev": true, + "requires": { + "humanize-ms": "^1.2.1" + } + }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "dev": true + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "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.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "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==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-differ": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", + "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "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=", + "dev": true + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "requires": { + "async": "^2.4.0" + } + }, + "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.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "atob-lite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", + "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", + "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "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=", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "before-after-hook": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", + "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", + "dev": true + }, + "bigint-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", + "optional": true, + "requires": { + "bindings": "^1.3.0" + } + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bip39": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", + "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", + "requires": { + "@types/node": "11.11.6", + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1" + }, + "dependencies": { + "@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" + } + } + }, + "bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "bn.js": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.1.tgz", + "integrity": "sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-sha3": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.4.tgz", + "integrity": "sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY=", + "requires": { + "js-sha3": "^0.6.1", + "safe-buffer": "^5.1.1" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "btoa-lite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", + "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", + "dev": true + }, + "buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "bufferutil": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz", + "integrity": "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==", + "dev": true, + "requires": { + "node-gyp-build": "~3.7.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", + "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "dev": true + } + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", + "dev": true + }, + "byline": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", + "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=", + "dev": true + }, + "byte-size": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz", + "integrity": "sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw==", + "dev": true + }, + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "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" + } + }, + "cachedown": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cachedown/-/cachedown-1.0.0.tgz", + "integrity": "sha1-1D8DbkUQaWsxJG19sx6/D3rDLRU=", + "requires": { + "abstract-leveldown": "^2.4.1", + "lru-cache": "^3.2.0" + } + }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "checkpoint-store": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", + "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", + "requires": { + "functional-red-black-tree": "^1.0.1" + } + }, + "chokidar": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", + "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "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==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "columnify": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", + "integrity": "sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=", + "dev": true, + "requires": { + "strip-ansi": "^3.0.0", + "wcwidth": "^1.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true + }, + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "compare-func": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz", + "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=", + "dev": true, + "requires": { + "array-ify": "^1.0.0", + "dot-prop": "^3.0.0" + }, + "dependencies": { + "dot-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", + "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", + "dev": true, + "requires": { + "is-obj": "^1.0.0" + } + } + } + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "config-chain": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", + "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", + "dev": true, + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "conventional-changelog-angular": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.6.tgz", + "integrity": "sha512-QDEmLa+7qdhVIv8sFZfVxU1VSyVvnXPsxq8Vam49mKUcO1Z8VTLEJk9uI21uiJUsnmm0I4Hrsdc9TgkOQo9WSA==", + "dev": true, + "requires": { + "compare-func": "^1.3.1", + "q": "^1.5.1" + } + }, + "conventional-changelog-core": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz", + "integrity": "sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ==", + "dev": true, + "requires": { + "conventional-changelog-writer": "^4.0.6", + "conventional-commits-parser": "^3.0.3", + "dateformat": "^3.0.0", + "get-pkg-repo": "^1.0.0", + "git-raw-commits": "2.0.0", + "git-remote-origin-url": "^2.0.0", + "git-semver-tags": "^2.0.3", + "lodash": "^4.2.1", + "normalize-package-data": "^2.3.5", + "q": "^1.5.1", + "read-pkg": "^3.0.0", + "read-pkg-up": "^3.0.0", + "through2": "^3.0.0" + }, + "dependencies": { + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "dev": true, + "requires": { + "readable-stream": "2 || 3" + } + } + } + }, + "conventional-changelog-preset-loader": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.0.tgz", + "integrity": "sha512-/rHb32J2EJnEXeK4NpDgMaAVTFZS3o1ExmjKMtYVgIC4MQn0vkNSbYpdGRotkfGGRWiqk3Ri3FBkiZGbAfIfOQ==", + "dev": true + }, + "conventional-changelog-writer": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.11.tgz", + "integrity": "sha512-g81GQOR392I+57Cw3IyP1f+f42ME6aEkbR+L7v1FBBWolB0xkjKTeCWVguzRrp6UiT1O6gBpJbEy2eq7AnV1rw==", + "dev": true, + "requires": { + "compare-func": "^1.3.1", + "conventional-commits-filter": "^2.0.2", + "dateformat": "^3.0.0", + "handlebars": "^4.4.0", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.15", + "meow": "^5.0.0", + "semver": "^6.0.0", + "split": "^1.0.0", + "through2": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "dev": true, + "requires": { + "readable-stream": "2 || 3" + } + } + } + }, + "conventional-commits-filter": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.2.tgz", + "integrity": "sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ==", + "dev": true, + "requires": { + "lodash.ismatch": "^4.4.0", + "modify-values": "^1.0.0" + } + }, + "conventional-commits-parser": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.0.8.tgz", + "integrity": "sha512-YcBSGkZbYp7d+Cr3NWUeXbPDFUN6g3SaSIzOybi8bjHL5IJ5225OSCxJJ4LgziyEJ7AaJtE9L2/EU6H7Nt/DDQ==", + "dev": true, + "requires": { + "JSONStream": "^1.0.4", + "is-text-path": "^1.0.1", + "lodash": "^4.17.15", + "meow": "^5.0.0", + "split2": "^2.0.0", + "through2": "^3.0.0", + "trim-off-newlines": "^1.0.0" + }, + "dependencies": { + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "dev": true, + "requires": { + "readable-stream": "2 || 3" + } + } + } + }, + "conventional-recommended-bump": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-5.0.1.tgz", + "integrity": "sha512-RVdt0elRcCxL90IrNP0fYCpq1uGt2MALko0eyeQ+zQuDVWtMGAy9ng6yYn3kax42lCj9+XBxQ8ZN6S9bdKxDhQ==", + "dev": true, + "requires": { + "concat-stream": "^2.0.0", + "conventional-changelog-preset-loader": "^2.1.1", + "conventional-commits-filter": "^2.0.2", + "conventional-commits-parser": "^3.0.3", + "git-raw-commits": "2.0.0", + "git-semver-tags": "^2.0.3", + "meow": "^4.0.0", + "q": "^1.5.1" + }, + "dependencies": { + "concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "meow": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + } + } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js-pure": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" + }, + "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=" + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-env": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz", + "integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, + "cross-spawn": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true + }, + "dargs": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", + "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "debuglog": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=", + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": 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=", + "dev": true + }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + } + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "requires": { + "abstract-leveldown": "~2.6.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "~4.0.0" + } + } + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "defined": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", + "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, + "detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", + "dev": true + }, + "dezalgo": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", + "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", + "dev": true, + "requires": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "dir-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", + "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "dev": true, + "requires": { + "path-type": "^3.0.0" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "^1.0.0" + } + }, + "drbg.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", + "requires": { + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" + } + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "elliptic": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } + } + }, + "emittery": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.6.0.tgz", + "integrity": "sha512-6EMRGr9KzYWp8DzHFZsKVZBsMO6QhAeHMeHND8rhyBNCHKMLpgW9tZv40bwN3rAIKRS5CxcK8oLRKUJSB9h7yQ==" + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "dev": true, + "requires": { + "iconv-lite": "~0.4.13" + } + }, + "encoding-down": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", + "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", + "requires": { + "abstract-leveldown": "^5.0.0", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0", + "xtend": "^4.0.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "level-codec": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", + "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + } + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "env-paths": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", + "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==", + "dev": true + }, + "envinfo": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.5.1.tgz", + "integrity": "sha512-hQBkDf2iO4Nv0CNHpCuSBeaSrveU6nThVxFGTrq/eDlV716UQk09zChaJae4mZRsos1x4YLY2TaH3LHUae3ZmQ==", + "dev": true + }, + "err-code": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", + "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=", + "dev": true + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3" + } + }, + "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=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "ethashjs": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.7.tgz", + "integrity": "sha1-ML/kGWcmaQoMWdO4Jy5w1NDDS64=", + "requires": { + "async": "^1.4.2", + "buffer-xor": "^1.0.3", + "ethereumjs-util": "^4.0.1", + "miller-rabin": "^4.0.0" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "ethereumjs-util": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", + "integrity": "sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=", + "requires": { + "bn.js": "^4.8.0", + "create-hash": "^1.1.2", + "keccakjs": "^0.2.0", + "rlp": "^2.0.0", + "secp256k1": "^3.0.1" + } + } + } + }, + "ethereumjs-account": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", + "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", + "requires": { + "ethereumjs-util": "^6.0.0", + "rlp": "^2.2.1", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-block": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "requires": { + "async": "^2.0.1", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + } + } + } + } + }, + "ethereumjs-blockchain": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.3.tgz", + "integrity": "sha512-0nJWbyA+Gu0ZKZr/cywMtB/77aS/4lOVsIKbgUN2sFQYscXO5rPbUfrEe7G2Zhjp86/a0VqLllemDSTHvx3vZA==", + "requires": { + "async": "^2.6.1", + "ethashjs": "~0.0.7", + "ethereumjs-block": "~2.2.2", + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "~6.1.0", + "flow-stoplight": "^1.0.0", + "level-mem": "^3.0.1", + "lru-cache": "^5.1.1", + "rlp": "^2.2.2", + "semaphore": "^1.1.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "ethereumjs-util": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + } + } + }, + "ethereumjs-common": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz", + "integrity": "sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ==" + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^2.0.0", + "rlp": "^2.2.3", + "secp256k1": "^3.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "keccak": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", + "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", + "requires": { + "bindings": "^1.5.0", + "inherits": "^2.0.4", + "nan": "^2.14.0", + "safe-buffer": "^5.2.0" + } + } + } + }, + "ethereumjs-vm": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.1.3.tgz", + "integrity": "sha512-RTrD0y7My4O6Qr1P2ZIsMfD6RzL6kU/RhBZ0a5XrPzAeR61crBS7or66ohDrvxDI/rDBxMi+6SnsELih6fzalw==", + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "core-js-pure": "^3.0.1", + "ethereumjs-account": "^3.0.0", + "ethereumjs-block": "^2.2.2", + "ethereumjs-blockchain": "^4.0.3", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^6.2.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.3.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1", + "util.promisify": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + } + } + } + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "eventemitter3": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "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": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "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==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "dependencies": { + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fake-merkle-patricia-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", + "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", + "requires": { + "checkpoint-store": "^1.1.0" + } + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + }, + "dependencies": { + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + } + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-safe-stringify": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", + "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", + "dev": true + }, + "figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + } + }, + "flow-stoplight": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", + "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "formidable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", + "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fromentries": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", + "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", + "dev": true + }, + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, + "requires": { + "minipass": "^2.6.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "genfun": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", + "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-pkg-repo": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", + "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "meow": "^3.3.0", + "normalize-package-data": "^2.3.0", + "parse-github-repo-url": "^1.3.0", + "through2": "^2.0.0" + }, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + } + } + }, + "get-port": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-4.2.0.tgz", + "integrity": "sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw==", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "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" + } + }, + "git-raw-commits": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", + "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", + "dev": true, + "requires": { + "dargs": "^4.0.1", + "lodash.template": "^4.0.2", + "meow": "^4.0.0", + "split2": "^2.0.0", + "through2": "^2.0.0" + }, + "dependencies": { + "meow": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" + } + } + } + }, + "git-remote-origin-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", + "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", + "dev": true, + "requires": { + "gitconfiglocal": "^1.0.0", + "pify": "^2.3.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "git-semver-tags": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-2.0.3.tgz", + "integrity": "sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA==", + "dev": true, + "requires": { + "meow": "^4.0.0", + "semver": "^6.0.0" + }, + "dependencies": { + "meow": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "git-up": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/git-up/-/git-up-4.0.1.tgz", + "integrity": "sha512-LFTZZrBlrCrGCG07/dm1aCjjpL1z9L3+5aEeI9SBhAqSc+kiA9Or1bgZhQFNppJX6h/f5McrvJt1mQXTFm6Qrw==", + "dev": true, + "requires": { + "is-ssh": "^1.3.0", + "parse-url": "^5.0.0" + } + }, + "git-url-parse": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.1.2.tgz", + "integrity": "sha512-gZeLVGY8QVKMIkckncX+iCq2/L8PlwncvDFKiWkBn9EtCfYDbliRTTp6qzyQ1VMdITUfq7293zDzfpjdiGASSQ==", + "dev": true, + "requires": { + "git-up": "^4.0.0" + } + }, + "gitconfiglocal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", + "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", + "dev": true, + "requires": { + "ini": "^1.3.2" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "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" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "globby": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", + "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^1.0.2", + "dir-glob": "^2.2.2", + "fast-glob": "^2.2.6", + "glob": "^7.1.3", + "ignore": "^4.0.3", + "pify": "^4.0.1", + "slash": "^2.0.0" + } + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "handlebars": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hasha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + } + }, + "hdkey": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.2.tgz", + "integrity": "sha512-PTQ4VKu0oRnCrYfLp04iQZ7T2Cxz0UsEXYauk2j8eh6PJXCpbXuCFhOmtIFtbET0i3PMWmHN9J11gU8LEgUljQ==", + "requires": { + "bs58check": "^2.1.2", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", + "dev": true + }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "dev": true, + "requires": { + "agent-base": "4", + "debug": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-proxy-agent": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", + "dev": true, + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + } + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "requires": { + "ms": "^2.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "ignore-walk": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", + "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + }, + "dependencies": { + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "init-package-json": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz", + "integrity": "sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==", + "dev": true, + "requires": { + "glob": "^7.1.1", + "npm-package-arg": "^4.0.0 || ^5.0.0 || ^6.0.0", + "promzard": "^0.3.0", + "read": "~1.0.1", + "read-package-json": "1 || 2", + "semver": "2.x || 3.x || 4 || 5", + "validate-npm-package-license": "^3.0.1", + "validate-npm-package-name": "^3.0.0" + } + }, + "inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "into-stream": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.1.tgz", + "integrity": "sha512-krrAJ7McQxGGmvaYbB7Q1mcA+cRwg9Ij2RfWIeVesNBgVDZmzY/Fa4IpZUT3bmdRzMzdf/mzltCG2Dq99IZGBA==", + "dev": true, + "requires": { + "from2": "^2.3.0", + "p-is-promise": "^3.0.0" + } + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "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=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "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" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "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=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "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" + } + } + } + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "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==", + "dev": true + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "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==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "requires": { + "has": "^1.0.3" + } + }, + "is-ssh": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.1.tgz", + "integrity": "sha512-0eRIASHZt1E68/ixClI8bp2YK2wmBPVWEismTs6M+M099jKgrzl/3E976zIbImSIob48N2/XGe9y7ZiYdImSlg==", + "dev": true, + "requires": { + "protocols": "^1.1.0" + } + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-text-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", + "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", + "dev": true, + "requires": { + "text-extensions": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz", + "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@babel/parser": "^7.7.5", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "js-sha3": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", + "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "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=", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keccak": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", + "integrity": "sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==", + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "keccakjs": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.3.tgz", + "integrity": "sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg==", + "requires": { + "browserify-sha3": "^0.0.4", + "sha3": "^1.2.2" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "lerna": { + "version": "3.20.2", + "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.20.2.tgz", + "integrity": "sha512-bjdL7hPLpU3Y8CBnw/1ys3ynQMUjiK6l9iDWnEGwFtDy48Xh5JboR9ZJwmKGCz9A/sarVVIGwf1tlRNKUG9etA==", + "dev": true, + "requires": { + "@lerna/add": "3.20.0", + "@lerna/bootstrap": "3.20.0", + "@lerna/changed": "3.20.0", + "@lerna/clean": "3.20.0", + "@lerna/cli": "3.18.5", + "@lerna/create": "3.18.5", + "@lerna/diff": "3.18.5", + "@lerna/exec": "3.20.0", + "@lerna/import": "3.18.5", + "@lerna/info": "3.20.0", + "@lerna/init": "3.18.5", + "@lerna/link": "3.18.5", + "@lerna/list": "3.20.0", + "@lerna/publish": "3.20.2", + "@lerna/run": "3.20.0", + "@lerna/version": "3.20.2", + "import-local": "^2.0.0", + "npmlog": "^4.1.2" + } + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + }, + "level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "level-mem": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", + "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", + "requires": { + "level-packager": "~4.0.0", + "memdown": "~3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "memdown": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", + "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", + "requires": { + "abstract-leveldown": "~5.0.0", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "level-option-wrap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/level-option-wrap/-/level-option-wrap-1.1.0.tgz", + "integrity": "sha1-rSDmjZ88IsiJdTHMaqevWWse0Sk=", + "requires": { + "defined": "~0.0.0" + } + }, + "level-packager": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", + "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", + "requires": { + "encoding-down": "~5.0.0", + "levelup": "^3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", + "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", + "requires": { + "abstract-leveldown": "~5.0.0", + "inherits": "^2.0.3" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", + "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "xtend": "^4.0.0" + } + }, + "levelup": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", + "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", + "requires": { + "deferred-leveldown": "~4.0.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~3.0.0", + "xtend": "~4.0.0" + } + } + } + }, + "level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "requires": { + "xtend": "^4.0.2" + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } + } + } + }, + "leveldown": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", + "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", + "requires": { + "abstract-leveldown": "~6.2.1", + "napi-macros": "~2.0.0", + "node-gyp-build": "~4.1.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "node-gyp-build": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", + "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" + } + } + }, + "levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "requires": { + "deferred-leveldown": "~5.3.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "requires": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + } + } + }, + "load-json-file": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", + "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "parse-json": "^4.0.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0", + "type-fest": "^0.3.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "dev": true + } + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.ismatch": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", + "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", + "dev": true + }, + "lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "lodash.template": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "dev": true, + "requires": { + "lodash._reinterpolate": "^3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", + "dev": true, + "requires": { + "lodash._reinterpolate": "^3.0.0" + } + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lru-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", + "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", + "requires": { + "pseudomap": "^1.0.1" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + }, + "macos-release": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", + "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "make-fetch-happen": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz", + "integrity": "sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==", + "dev": true, + "requires": { + "agentkeepalive": "^3.4.1", + "cacache": "^12.0.0", + "http-cache-semantics": "^3.8.1", + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "node-fetch-npm": "^2.0.2", + "promise-retry": "^1.1.1", + "socks-proxy-agent": "^4.0.0", + "ssri": "^6.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + } + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "dev": true + }, + "merkle-patricia-tree": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", + "integrity": "sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==", + "requires": { + "async": "^2.6.1", + "ethereumjs-util": "^5.2.0", + "level-mem": "^3.0.1", + "level-ws": "^1.0.0", + "readable-stream": "^3.0.6", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "level-ws": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", + "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.2.8", + "xtend": "^4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + } + } + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "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" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } + } + }, + "mime": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", + "dev": true + }, + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "dev": true, + "requires": { + "mime-db": "1.43.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, + "requires": { + "minipass": "^2.9.0" + } + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mkdirp-promise": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", + "dev": true, + "requires": { + "mkdirp": "*" + } + }, + "mocha": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.1.tgz", + "integrity": "sha512-3qQsu3ijNS3GkWcccT5Zw0hf/rWvu1fTN9sPvEd81hlwsr30GX2GcDSSoBxo24IR8FelmrAydGC6/1J5QQP4WA==", + "dev": true, + "requires": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "chokidar": "3.3.0", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.3", + "ms": "2.1.1", + "node-environment-flags": "1.0.6", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "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" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "modify-values": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", + "dev": true + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "multimatch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", + "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", + "dev": true, + "requires": { + "array-differ": "^2.0.3", + "array-union": "^1.0.2", + "arrify": "^1.0.1", + "minimatch": "^3.0.4" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "nan": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "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-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" + } + }, + "napi-macros": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", + "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-addon-api": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.0.tgz", + "integrity": "sha512-ASCL5U13as7HhOExbT6OlWJJUV/lLzL2voOSP1UVehpRD8FbSrSDjfScK/KwAvVTI5AS6r4VwbOMlIqtvRidnA==" + }, + "node-environment-flags": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", + "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "dev": true + }, + "node-fetch-npm": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz", + "integrity": "sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg==", + "dev": true, + "requires": { + "encoding": "^0.1.11", + "json-parse-better-errors": "^1.0.0", + "safe-buffer": "^5.1.1" + } + }, + "node-gyp": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.0.tgz", + "integrity": "sha512-OUTryc5bt/P8zVgNUmC6xdXiDJxLMAW8cF5tLQOT9E5sOQj+UeQxnnPy74K3CLCa/SOjjBlbuzDLR8ANwA+wmw==", + "dev": true, + "requires": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.2", + "mkdirp": "^0.5.1", + "nopt": "^4.0.1", + "npmlog": "^4.1.2", + "request": "^2.88.0", + "rimraf": "^2.6.3", + "semver": "^5.7.1", + "tar": "^4.4.12", + "which": "^1.3.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "node-gyp-build": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.1.tgz", + "integrity": "sha512-XyCKXsqZfLqHep1hhsMncoXuUNt/cXCjg1+8CLbu69V1TKuPiOeSGbL9n+k/ByKH8UT0p4rdIX8XkTRZV0i7Sw==" + }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", + "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", + "dev": true + }, + "npm-bundled": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "dev": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-lifecycle": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz", + "integrity": "sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g==", + "dev": true, + "requires": { + "byline": "^5.0.0", + "graceful-fs": "^4.1.15", + "node-gyp": "^5.0.2", + "resolve-from": "^4.0.0", + "slide": "^1.1.6", + "uid-number": "0.0.6", + "umask": "^1.1.0", + "which": "^1.3.1" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "npm-packlist": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", + "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", + "dev": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-pick-manifest": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz", + "integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1", + "npm-package-arg": "^6.0.0", + "semver": "^5.4.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + }, + "dependencies": { + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + } + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nyc": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.1.tgz", + "integrity": "sha512-n0MBXYBYRqa67IVt62qW1r/d9UH/Qtr7SF1w/nQLJ9KxvWF6b2xCHImRAixHN9tnMMYHC2P14uo6KddNGwMgGg==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "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" + } + } + } + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "octokit-pagination-methods": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", + "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-name": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", + "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", + "dev": true, + "requires": { + "macos-release": "^2.2.0", + "windows-release": "^3.1.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", + "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-map-series": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-map-series/-/p-map-series-1.0.0.tgz", + "integrity": "sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco=", + "dev": true, + "requires": { + "p-reduce": "^1.0.0" + } + }, + "p-pipe": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-pipe/-/p-pipe-1.2.0.tgz", + "integrity": "sha1-SxoROZoRUgpneQ7loMHViB1r7+k=", + "dev": true + }, + "p-queue": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-4.0.0.tgz", + "integrity": "sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg==", + "dev": true, + "requires": { + "eventemitter3": "^3.1.0" + } + }, + "p-reduce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", + "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", + "dev": true + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "p-waterfall": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-waterfall/-/p-waterfall-1.0.0.tgz", + "integrity": "sha1-ftlLPOszMngjU69qrhGqn8I1uwA=", + "dev": true, + "requires": { + "p-reduce": "^1.0.0" + } + }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, + "parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "dev": true, + "requires": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "parse-github-repo-url": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", + "integrity": "sha1-nn2LslKmy2ukJZUGC3v23z28H1A=", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.1.tgz", + "integrity": "sha512-d7yhga0Oc+PwNXDvQ0Jv1BuWkLVPXcAoQ/WREgd6vNNoKYaW52KI+RdOFjI63wjkmps9yUE8VS4veP+AgpQ/hA==", + "dev": true, + "requires": { + "is-ssh": "^1.3.0", + "protocols": "^1.4.0" + } + }, + "parse-url": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-5.0.1.tgz", + "integrity": "sha512-flNUPP27r3vJpROi0/R3/2efgKkyXqnXwyP1KQ2U0SfFRgdizOdWfvrrvJg1LuOoxs7GQhmxJlq23IpQ/BkByg==", + "dev": true, + "requires": { + "is-ssh": "^1.3.0", + "normalize-url": "^3.3.0", + "parse-path": "^4.0.0", + "protocols": "^1.4.0" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "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-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, + "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=", + "dev": true + }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "promise-retry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", + "integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=", + "dev": true, + "requires": { + "err-code": "^1.0.0", + "retry": "^0.10.0" + } + }, + "promzard": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", + "integrity": "sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=", + "dev": true, + "requires": { + "read": "1" + } + }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true + }, + "protocols": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.7.tgz", + "integrity": "sha512-Fx65lf9/YDn3hUX08XUc0J8rSux36rEsyiv21ZGUC1mOyeM3lTRpZLcrm8aAolzS4itwVfm7TAPyxC2E5zd6xg==", + "dev": true + }, + "protoduck": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", + "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", + "dev": true, + "requires": { + "genfun": "^5.0.0" + } + }, + "prr": { + "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", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "qs": { + "version": "6.9.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", + "integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", + "dev": true + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "reachdown": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz", + "integrity": "sha512-6LsdRe4cZyOjw4NnvbhUd/rGG7WQ9HMopPr+kyL018Uci4kijtxcGR5kVb5Ln13k4PEE+fEFQbjfOvNw7cnXmA==" + }, + "read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", + "dev": true, + "requires": { + "mute-stream": "~0.0.4" + } + }, + "read-cmd-shim": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz", + "integrity": "sha512-v5yCqQ/7okKoZZkBQUAfTsQ3sVJtXdNfbPnI5cceppoxEVLYA3k+VtV2omkeo8MS94JCy4fSiUwlRBAwCVRPUA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2" + } + }, + "read-package-json": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.1.tgz", + "integrity": "sha512-dAiqGtVc/q5doFz6096CcnXhpYk0ZN8dEKVkGLU0CsASt8SrgF6SF7OTKAYubfvFhWaqofl+Y8HK19GR8jwW+A==", + "dev": true, + "requires": { + "glob": "^7.1.1", + "graceful-fs": "^4.1.2", + "json-parse-better-errors": "^1.0.1", + "normalize-package-data": "^2.0.0", + "npm-normalize-package-bin": "^1.0.0" + } + }, + "read-package-tree": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz", + "integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==", + "dev": true, + "requires": { + "read-package-json": "^2.0.0", + "readdir-scoped-modules": "^1.0.0", + "util-promisify": "^2.1.0" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "readdir-scoped-modules": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", + "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", + "dev": true, + "requires": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "graceful-fs": "^4.1.2", + "once": "^1.3.0" + } + }, + "readdirp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + }, + "dependencies": { + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + } + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.4.tgz", + "integrity": "sha512-fdq2yYCWpAQBhwkZv+Z8o/Z4sPmYm1CUq6P7n6lVTOdb949CnqA0sndXal5C1NleSVSZm6q5F3iEbauyVln/iw==", + "requires": { + "bn.js": "^4.11.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } + } + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + }, + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "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==", + "dev": true + }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + } + } + }, + "seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" + }, + "semaphore": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", + "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "sha3": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.6.tgz", + "integrity": "sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ==", + "requires": { + "nan": "2.13.2" + }, + "dependencies": { + "nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" + } + } + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "dev": true + }, + "smart-buffer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", + "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "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": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "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==", + "dev": true, + "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=", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "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" + } + } + } + }, + "socks": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz", + "integrity": "sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==", + "dev": true, + "requires": { + "ip": "1.1.5", + "smart-buffer": "^4.1.0" + } + }, + "socks-proxy-agent": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", + "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", + "dev": true, + "requires": { + "agent-base": "~4.2.1", + "socks": "~2.3.2" + }, + "dependencies": { + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + } + } + }, + "solc": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.6.tgz", + "integrity": "sha512-p0IO/1fRaHWKN+qR+mUivpwnBpFYD8EoFAzT8VL4lmllNwsyEO7TJJAc2QK0XUeWOYOT92NWKhDNNNLTVbHShA==", + "dev": true, + "requires": { + "command-exists": "^1.2.8", + "commander": "3.0.2", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "dependencies": { + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + } + } + }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.18.tgz", + "integrity": "sha512-9luZr/BZ2QeU6tO2uG8N2aZpVSli4TSAOAqFOyTO51AJcD9P99c0K1h6dD6r6qo5dyT44BR5exweOaLLeldTkQ==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "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=", + "dev": true + }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "requires": { + "through": "2" + } + }, + "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==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "split2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "dev": true, + "requires": { + "through2": "^2.0.2" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "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", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "strong-log-transformer": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz", + "integrity": "sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "minimist": "^1.2.0", + "through": "^2.3.4" + } + }, + "subleveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.0.tgz", + "integrity": "sha512-DotbiAIyOWSsidM06/m+EsBHXRyP7EgPlDDD5GVn6JcoDFcVZbp+VN9bOdErNtDWwgR+lJDuKwcJ8nKqSq9Ixg==", + "requires": { + "abstract-leveldown": "^6.2.3", + "encoding-down": "^6.2.0", + "inherits": "^2.0.3", + "level-option-wrap": "^1.1.0", + "levelup": "^4.3.1", + "reachdown": "^1.1.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", + "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "encoding-down": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", + "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", + "requires": { + "abstract-leveldown": "^6.2.1", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0" + } + }, + "level-codec": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", + "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + } + } + }, + "superagent": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.2.2.tgz", + "integrity": "sha512-pMWBUnIllK4ZTw7p/UaobiQPwAO5w/1NRRTDpV0FTVNmECztsxKspj3ZWEordVEaqpZtmOQJJna4yTLyC/q7PQ==", + "dev": true, + "requires": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.2", + "debug": "^4.1.1", + "fast-safe-stringify": "^2.0.7", + "form-data": "^3.0.0", + "formidable": "^1.2.1", + "methods": "^1.1.2", + "mime": "^2.4.4", + "qs": "^6.9.1", + "readable-stream": "^3.4.0", + "semver": "^6.3.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + } + } + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "dev": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + } + }, + "temp-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", + "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=", + "dev": true + }, + "temp-write": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-3.4.0.tgz", + "integrity": "sha1-jP9jD7fp2gXwR8dM5M5NaFRX1JI=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "is-stream": "^1.1.0", + "make-dir": "^1.0.0", + "pify": "^3.0.0", + "temp-dir": "^1.0.0", + "uuid": "^3.0.1" + }, + "dependencies": { + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "text-extensions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", + "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", + "dev": true + }, + "thenify": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", + "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "dev": true, + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "dev": true, + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "tmp": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", + "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "requires": { + "rimraf": "^2.6.3" + } + }, + "tmp-promise": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-2.0.2.tgz", + "integrity": "sha512-zl71nFWjPKW2KXs+73gEk8RmqvtAeXPxhWDkTUoa3MSMkjq3I+9OeknjF178MQoMYsdqL730hfzvNfEkePxq9Q==", + "requires": { + "tmp": "0.1.0" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "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=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "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" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "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": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "trim-off-newlines": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", + "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", + "dev": true + }, + "ts-node": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.9.0.tgz", + "integrity": "sha512-rwkXfOs9zmoHrV8xE++dmNd6ZIS+nmHHCxcV53ekGJrxFLMbp+pizpPS07ARvhwneCIECPppOwbZHvw9sQtU4w==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } + } + }, + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true + }, + "tslint": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.1.tgz", + "integrity": "sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.3", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.10.0", + "tsutils": "^2.29.0" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "dev": true + }, + "uWebSockets.js": { + "version": "github:uNetworking/uWebSockets.js#116a85f9668dcb03e7799db06dc8275bc43c0963", + "from": "github:uNetworking/uWebSockets.js#v17.4.0" + }, + "uglify-js": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz", + "integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==", + "dev": true, + "optional": true, + "requires": { + "commander": "~2.20.3" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + } + } + }, + "uid-number": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", + "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", + "dev": true + }, + "umask": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", + "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "universal-user-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz", + "integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==", + "dev": true, + "requires": { + "os-name": "^3.1.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "utf-8-validate": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", + "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", + "dev": true, + "requires": { + "node-gyp-build": "~3.7.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", + "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "util-promisify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz", + "integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", + "dev": true, + "requires": { + "builtins": "^1.0.3" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "windows-release": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz", + "integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==", + "dev": true, + "requires": { + "execa": "^1.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "write-json-file": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", + "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", + "dev": true, + "requires": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.15", + "make-dir": "^2.1.0", + "pify": "^4.0.1", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.4.2" + }, + "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + } + } + }, + "write-pkg": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz", + "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", + "dev": true, + "requires": { + "sort-keys": "^2.0.0", + "write-json-file": "^2.2.0" + }, + "dependencies": { + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "write-json-file": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", + "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", + "dev": true, + "requires": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "pify": "^3.0.0", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.0.0" + } + } + } + }, + "ws": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", + "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" + } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json index debd47e7cb..c46e7c2d34 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,10 @@ { - "name": "ganache-core", - "version": "2.2.1", - "main": "./dist/index.js", + "name": "root", + "private": true, "engines": { "node": ">=10.7.0 <=14.0.0", "npm": ">=6.1.0" }, - "directories": { - "lib": "./src", - "doc": "./docs", - "test": "./test" - }, - "scripts": { - "build": "tsc", - "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks 'test/**.ts'", - "postinstall": "patch-package" - }, "dependencies": { "@types/lodash.clonedeep": "4.5.6", "bip39": "3.0.2", @@ -53,6 +41,7 @@ "bufferutil": "4.0.1", "cross-env": "7.0.2", "into-stream": "5.1.1", + "lerna": "3.20.2", "mocha": "7.1.1", "nyc": "15.0.1", "prettier": "2.0.5", @@ -68,10 +57,5 @@ "optionalDependencies": { "bigint-buffer": "1.1.5" }, - "repository": { - "type": "git", - "url": "https://github.com/trufflesuite/ganache-core" - }, - "license": "MIT", - "author": "David Murdoch" + "license": "MIT" } diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 0000000000..ff63f7d2ec --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,11 @@ +# `@ganache/core` + +> TODO: description + +## Usage + +``` +const core = require('@ganache/core'); + +// TODO: DEMONSTRATE API +``` diff --git a/test/contracts/helloWorld.sol b/packages/core/__tests__/contracts/helloWorld.sol similarity index 100% rename from test/contracts/helloWorld.sol rename to packages/core/__tests__/contracts/helloWorld.sol diff --git a/test/helpers/getProvider.ts b/packages/core/__tests__/helpers/getProvider.ts similarity index 100% rename from test/helpers/getProvider.ts rename to packages/core/__tests__/helpers/getProvider.ts diff --git a/test/helpers/sleep.ts b/packages/core/__tests__/helpers/sleep.ts similarity index 100% rename from test/helpers/sleep.ts rename to packages/core/__tests__/helpers/sleep.ts diff --git a/test/interface.ts b/packages/core/__tests__/interface.ts similarity index 100% rename from test/interface.ts rename to packages/core/__tests__/interface.ts diff --git a/test/ledger.ts b/packages/core/__tests__/ledger.ts similarity index 100% rename from test/ledger.ts rename to packages/core/__tests__/ledger.ts diff --git a/test/provider.ts b/packages/core/__tests__/provider.ts similarity index 100% rename from test/provider.ts rename to packages/core/__tests__/provider.ts diff --git a/test/server.ts b/packages/core/__tests__/server.ts similarity index 100% rename from test/server.ts rename to packages/core/__tests__/server.ts diff --git a/test/temp-tests.ts b/packages/core/__tests__/temp-tests.ts similarity index 100% rename from test/temp-tests.ts rename to packages/core/__tests__/temp-tests.ts diff --git a/packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c b/packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c new file mode 100644 index 0000000000..a64fa743b7 --- /dev/null +++ b/packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c @@ -0,0 +1 @@ +"0xf871a06990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f808080808080808080808080a07559bb4901892880aec39ee574a87e32492071f22d0a42e184892f6b225df9b380a0de941f06d6f99270e651ece36725c555afc7fdfc4855bd86add2cdcdec4a4de380" \ No newline at end of file diff --git a/packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f b/packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f new file mode 100644 index 0000000000..6ff361512c --- /dev/null +++ b/packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f @@ -0,0 +1 @@ +"0xf59310000000000000000000000000000000000000a0b0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505" \ No newline at end of file diff --git a/packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 b/packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 new file mode 100644 index 0000000000..6a23c9999a --- /dev/null +++ b/packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 @@ -0,0 +1 @@ +"0xf90131a0304356a9ff9f36e260c1ef38658725d9067d9e85450d043946d439cae014547ba05911f24d96912350de50f297c2d34d5d10e136757bf4cfff5fa41bfca219554aa05911f24d96912350de50f297c2d34d5d10e136757bf4cfff5fa41bfca219554aa05911f24d96912350de50f297c2d34d5d10e136757bf4cfff5fa41bfca219554aa05911f24d96912350de50f297c2d34d5d10e136757bf4cfff5fa41bfca219554aa05911f24d96912350de50f297c2d34d5d10e136757bf4cfff5fa41bfca219554aa05911f24d96912350de50f297c2d34d5d10e136757bf4cfff5fa41bfca219554aa05911f24d96912350de50f297c2d34d5d10e136757bf4cfff5fa41bfca219554aa05911f24d96912350de50f297c2d34d5d10e136757bf4cfff5fa41bfca219554a8080808080808080" \ No newline at end of file diff --git a/packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 b/packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 new file mode 100644 index 0000000000..3472769b46 --- /dev/null +++ b/packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 @@ -0,0 +1 @@ +"0xf8f1a008ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c80a0fa71baff75cc869d687859edac6345402a902e385a2829b9bded7697113e98368080a0a692717e52ff2d01d314834d9a639e60fad01fac4634d78c7203c6916e3f17fca03781707048c5d3acf2d0a78e1c8990e0f19a3fe5909007a6aefe8a9b0402689980a0a9c678e4e10500df2d3c913e87ce2f1b38b12409f5c65078b201783d6280e764808080a069b7a8125fdd1dac0b872648905e0e1410b8859b9fdfc1991e3860eecbcaa2da8080a003a0f12083f4cdb767e0f47613296e562cafa8a25a91deb88a47433ccc4e138e80" \ No newline at end of file diff --git a/packages/core/compile.ts b/packages/core/compile.ts new file mode 100644 index 0000000000..7baaf9dc4b --- /dev/null +++ b/packages/core/compile.ts @@ -0,0 +1,108 @@ +import { ts, ImportDeclarationStructure, Project, ImportDeclaration, SourceFile } from "ts-morph"; +import { resolve, dirname } from 'path' +import { NodeFlags } from "typescript"; + +function trimQuote(path: string) { + return path.slice(1, path.length - 1) +} + +function resolveJsonImport(path: string): string { + if (path.endsWith('.json')) { + return path + } + try { + path = require.resolve(path + '.json') + } catch (_) { + return '' + } + return path +} + + +function serializeToAst(v: any): ts.Expression { + if (Array.isArray(v)) { + return ts.createArrayLiteral(v.map(el => serializeToAst(el))) + } + switch (typeof v) { + case 'string': + return ts.createStringLiteral(v) + case 'number': + return ts.createNumericLiteral(String(v)) + case 'boolean': + return v ? ts.createTrue() : ts.createFalse() + case 'object': + if (!v) { + return ts.createNull() + } + const keys = Object.keys(v) + return ts.createObjectLiteral( + keys.map(k => ts.createPropertyAssignment(ts.createStringLiteral(k), serializeToAst(v[k]))) + ) + } +} + +function serializeToTypeAst(v: any): ts.TypeNode { + if (Array.isArray(v)) { + return ts.createTupleTypeNode(v.map(el => serializeToTypeAst(el))) + } + switch (typeof v) { + case 'string': + return ts.createKeywordTypeNode(ts.SyntaxKind.StringKeyword) + case 'number': + return ts.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword) + case 'boolean': + return v ? ts.createTrue() : ts.createFalse() + case 'object': + if (!v) { + return ts.createNull() + } + const keys = Object.keys(v) + return ts.createTypeLiteralNode( + keys.map(k => + ts.createPropertySignature( + undefined, + ts.createStringLiteral(k), + undefined, + serializeToTypeAst(v[k]), + undefined + ) + ) + ) + } +} + +function resolveJsonImportFromNode(node: ImportDeclaration, sf: SourceFile): string { + const jsonPath = trimQuote((node as any).moduleSpecifier.getText()) + return jsonPath && resolveJsonImport(resolve(dirname(sf.getFilePath()), jsonPath)) +} + +import options from "./tsconfig.json"; + +const project = new Project(options); +const sources = project.addSourceFilesAtPaths("./src/**/*.ts"); + +sources.forEach(sourceFile => { + sourceFile.transform(traversal => { + const node = traversal.visitChildren(); + let jsonPath: string; + if (ts.isImportDeclaration(node) && (jsonPath = resolveJsonImportFromNode(node as any as ImportDeclaration, sourceFile))){ + console.log(node.moduleSpecifier.getText()); + const namedBindings = node.importClause.namedBindings as ts.NamedImports; + const jsonFile = require(jsonPath); + // const n = node as any as ImportDeclarationStructure; + const json = namedBindings.elements.map(element => { + const name = element.propertyName ? element.propertyName.getText() : element.getText(); + const value = jsonFile[name]; + return ts.createVariableDeclaration(name, serializeToTypeAst(value), serializeToAst(value)) + }) + return ts.createVariableStatement( + [], + ts.createVariableDeclarationList(json, NodeFlags.Const) + ); + } + + return node; + }); +}); + +project.emit(); diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json new file mode 100644 index 0000000000..7f35edf81a --- /dev/null +++ b/packages/core/package-lock.json @@ -0,0 +1,341 @@ +{ + "name": "@ganache/core", + "version": "2.2.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@dsherret/to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-H2R13IvZdM6gei2vOGSzF7HdMyw=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, + "@ts-morph/common": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.4.0.tgz", + "integrity": "sha512-VV5/F8k/9RnSZnNpnaOarKb7LOzYhITjHB9JIcpl1l+zlt99H1HeZH/yI2Xs6BtAV4WjPX+SjjRVybdEm6IOEQ==", + "dev": true, + "requires": { + "@dsherret/to-absolute-glob": "^2.0.2", + "fast-glob": "^3.1.1", + "fs-extra": "^8.1.0", + "is-negated-glob": "^1.0.0", + "multimatch": "^4.0.0", + "typescript": "~3.8.2" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "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", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "code-block-writer": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.0.tgz", + "integrity": "sha512-RG9hpXtWFeUWhuUav1YuP/vGcyncW+t90yJLk9fNZs1De2OuHTHKAKThVCokt29PYq5RoJ0QSZaIZ+rvPO23hA==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "fast-glob": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fastq": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", + "integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "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.7" + } + }, + "multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + } + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "ts-morph": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.0.3.tgz", + "integrity": "sha512-IKvg8h5yQBubv7XQ8ku5exqgQbF7YgWm5/whaR1GV9+vaHOhn0zj7+A2/t0UNfNafH0Fxxz7m7ZK+QioYc1Dfg==", + "dev": true, + "requires": { + "@dsherret/to-absolute-glob": "^2.0.2", + "@ts-morph/common": "~0.4.0", + "code-block-writer": "^10.1.0" + } + }, + "typescript": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "dev": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } +} diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000000..83535edb9c --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,36 @@ +{ + "name": "@ganache/core", + "version": "2.2.1", + "description": "> TODO: description", + "author": "David Murdoch ", + "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "license": "MIT", + "main": "lib/index.js", + "typings": "lib/index.d.ts", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/trufflesuite/ganache-core.git" + }, + "scripts": { + "tsc": "tsc", + "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks 'test/**.ts'", + "postinstall": "patch-package" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "devDependencies": { + "ts-morph": "7.0.3" + } +} diff --git a/patches/emittery+0.6.0.patch b/packages/core/patches/emittery+0.6.0.patch similarity index 100% rename from patches/emittery+0.6.0.patch rename to packages/core/patches/emittery+0.6.0.patch diff --git a/@types/ethereumjs-block/header.d.ts b/packages/core/src/@types/ethereumjs-block/header.d.ts similarity index 100% rename from @types/ethereumjs-block/header.d.ts rename to packages/core/src/@types/ethereumjs-block/header.d.ts diff --git a/@types/ethereumjs-block/index.d.ts b/packages/core/src/@types/ethereumjs-block/index.d.ts similarity index 100% rename from @types/ethereumjs-block/index.d.ts rename to packages/core/src/@types/ethereumjs-block/index.d.ts diff --git a/@types/hdkey.d.ts b/packages/core/src/@types/hdkey.d.ts similarity index 100% rename from @types/hdkey.d.ts rename to packages/core/src/@types/hdkey.d.ts diff --git a/@types/levelup/index.d.ts b/packages/core/src/@types/levelup/index.d.ts similarity index 100% rename from @types/levelup/index.d.ts rename to packages/core/src/@types/levelup/index.d.ts diff --git a/@types/merkle-patricia-tree/baseTrie.d.ts b/packages/core/src/@types/merkle-patricia-tree/baseTrie.d.ts similarity index 100% rename from @types/merkle-patricia-tree/baseTrie.d.ts rename to packages/core/src/@types/merkle-patricia-tree/baseTrie.d.ts diff --git a/@types/merkle-patricia-tree/index.d.ts b/packages/core/src/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from @types/merkle-patricia-tree/index.d.ts rename to packages/core/src/@types/merkle-patricia-tree/index.d.ts diff --git a/@types/merkle-patricia-tree/readStream.d.ts b/packages/core/src/@types/merkle-patricia-tree/readStream.d.ts similarity index 100% rename from @types/merkle-patricia-tree/readStream.d.ts rename to packages/core/src/@types/merkle-patricia-tree/readStream.d.ts diff --git a/@types/merkle-patricia-tree/trieNode.d.ts b/packages/core/src/@types/merkle-patricia-tree/trieNode.d.ts similarity index 100% rename from @types/merkle-patricia-tree/trieNode.d.ts rename to packages/core/src/@types/merkle-patricia-tree/trieNode.d.ts diff --git a/@types/superagent.d.ts b/packages/core/src/@types/superagent.d.ts similarity index 100% rename from @types/superagent.d.ts rename to packages/core/src/@types/superagent.d.ts diff --git a/@types/tmp.d.ts b/packages/core/src/@types/tmp.d.ts similarity index 100% rename from @types/tmp.d.ts rename to packages/core/src/@types/tmp.d.ts diff --git a/@types/uWebsockets.js.ts b/packages/core/src/@types/uWebsockets.js.ts similarity index 100% rename from @types/uWebsockets.js.ts rename to packages/core/src/@types/uWebsockets.js.ts diff --git a/src/connector.ts b/packages/core/src/connector.ts similarity index 100% rename from src/connector.ts rename to packages/core/src/connector.ts diff --git a/src/index.ts b/packages/core/src/index.ts similarity index 100% rename from src/index.ts rename to packages/core/src/index.ts diff --git a/src/interfaces/api-options.ts b/packages/core/src/interfaces/api-options.ts similarity index 100% rename from src/interfaces/api-options.ts rename to packages/core/src/interfaces/api-options.ts diff --git a/src/interfaces/api.ts b/packages/core/src/interfaces/api.ts similarity index 100% rename from src/interfaces/api.ts rename to packages/core/src/interfaces/api.ts diff --git a/src/interfaces/connector.ts b/packages/core/src/interfaces/connector.ts similarity index 100% rename from src/interfaces/connector.ts rename to packages/core/src/interfaces/connector.ts diff --git a/src/interfaces/provider.ts b/packages/core/src/interfaces/provider.ts similarity index 100% rename from src/interfaces/provider.ts rename to packages/core/src/interfaces/provider.ts diff --git a/src/ledgers/ethereum/api.ts b/packages/core/src/ledgers/ethereum/api.ts similarity index 99% rename from src/ledgers/ethereum/api.ts rename to packages/core/src/ledgers/ethereum/api.ts index f00108c2ee..6dab0b1df1 100644 --- a/src/ledgers/ethereum/api.ts +++ b/packages/core/src/ledgers/ethereum/api.ts @@ -19,7 +19,7 @@ import {name, version} from "../../../package.json"; //#region Constants const BUFFER_EMPTY = Buffer.allocUnsafe(0); const BUFFER_ZERO = Buffer.from([0]); -const CLIENT_VERSION = `EthereumJS ${name}/v${version}/ethereum-js`; +const CLIENT_VERSION = `EthereumJS${name}/v${version}/ethereum-js`; const PROTOCOL_VERSION = Data.from("0x3f"); const RPCQUANTITY_ZERO = Quantity.from("0x0"); //#endregion diff --git a/src/ledgers/ethereum/blockchain.ts b/packages/core/src/ledgers/ethereum/blockchain.ts similarity index 100% rename from src/ledgers/ethereum/blockchain.ts rename to packages/core/src/ledgers/ethereum/blockchain.ts diff --git a/src/ledgers/ethereum/components/account-manager.ts b/packages/core/src/ledgers/ethereum/components/account-manager.ts similarity index 100% rename from src/ledgers/ethereum/components/account-manager.ts rename to packages/core/src/ledgers/ethereum/components/account-manager.ts diff --git a/src/ledgers/ethereum/components/block-manager.ts b/packages/core/src/ledgers/ethereum/components/block-manager.ts similarity index 100% rename from src/ledgers/ethereum/components/block-manager.ts rename to packages/core/src/ledgers/ethereum/components/block-manager.ts diff --git a/src/ledgers/ethereum/components/manager.ts b/packages/core/src/ledgers/ethereum/components/manager.ts similarity index 100% rename from src/ledgers/ethereum/components/manager.ts rename to packages/core/src/ledgers/ethereum/components/manager.ts diff --git a/src/ledgers/ethereum/components/transaction-manager.ts b/packages/core/src/ledgers/ethereum/components/transaction-manager.ts similarity index 100% rename from src/ledgers/ethereum/components/transaction-manager.ts rename to packages/core/src/ledgers/ethereum/components/transaction-manager.ts diff --git a/src/ledgers/ethereum/components/transaction-pool.ts b/packages/core/src/ledgers/ethereum/components/transaction-pool.ts similarity index 100% rename from src/ledgers/ethereum/components/transaction-pool.ts rename to packages/core/src/ledgers/ethereum/components/transaction-pool.ts diff --git a/src/ledgers/ethereum/database.ts b/packages/core/src/ledgers/ethereum/database.ts similarity index 100% rename from src/ledgers/ethereum/database.ts rename to packages/core/src/ledgers/ethereum/database.ts diff --git a/src/ledgers/ethereum/index.ts b/packages/core/src/ledgers/ethereum/index.ts similarity index 100% rename from src/ledgers/ethereum/index.ts rename to packages/core/src/ledgers/ethereum/index.ts diff --git a/src/ledgers/ethereum/miner.ts b/packages/core/src/ledgers/ethereum/miner.ts similarity index 100% rename from src/ledgers/ethereum/miner.ts rename to packages/core/src/ledgers/ethereum/miner.ts diff --git a/src/ledgers/ethereum/options.ts b/packages/core/src/ledgers/ethereum/options.ts similarity index 100% rename from src/ledgers/ethereum/options.ts rename to packages/core/src/ledgers/ethereum/options.ts diff --git a/src/ledgers/ethereum/provider.ts b/packages/core/src/ledgers/ethereum/provider.ts similarity index 99% rename from src/ledgers/ethereum/provider.ts rename to packages/core/src/ledgers/ethereum/provider.ts index 1f1bd943dc..ed0ae77c2d 100644 --- a/src/ledgers/ethereum/provider.ts +++ b/packages/core/src/ledgers/ethereum/provider.ts @@ -7,7 +7,7 @@ import Account from "../../things/account"; import {mnemonicToSeedSync} from "bip39"; import Address from "../../things/address"; import JsonRpc from "../../servers/utils/jsonrpc"; -import EthereumOptions from "../../ledgers/ethereum/options"; +import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; import secp256k1 from "secp256k1"; import HDKey from "hdkey"; diff --git a/src/ledgers/ethereum/wallet.ts b/packages/core/src/ledgers/ethereum/wallet.ts similarity index 100% rename from src/ledgers/ethereum/wallet.ts rename to packages/core/src/ledgers/ethereum/wallet.ts diff --git a/src/ledgers/tezos/api.ts b/packages/core/src/ledgers/tezos/api.ts similarity index 100% rename from src/ledgers/tezos/api.ts rename to packages/core/src/ledgers/tezos/api.ts diff --git a/src/ledgers/tezos/index.ts b/packages/core/src/ledgers/tezos/index.ts similarity index 100% rename from src/ledgers/tezos/index.ts rename to packages/core/src/ledgers/tezos/index.ts diff --git a/src/ledgers/tezos/provider.ts b/packages/core/src/ledgers/tezos/provider.ts similarity index 100% rename from src/ledgers/tezos/provider.ts rename to packages/core/src/ledgers/tezos/provider.ts diff --git a/src/options/options.ts b/packages/core/src/options/options.ts similarity index 100% rename from src/options/options.ts rename to packages/core/src/options/options.ts diff --git a/src/options/provider-options.ts b/packages/core/src/options/provider-options.ts similarity index 100% rename from src/options/provider-options.ts rename to packages/core/src/options/provider-options.ts diff --git a/src/options/server-options.ts b/packages/core/src/options/server-options.ts similarity index 100% rename from src/options/server-options.ts rename to packages/core/src/options/server-options.ts diff --git a/src/server.ts b/packages/core/src/server.ts similarity index 100% rename from src/server.ts rename to packages/core/src/server.ts diff --git a/src/servers/http-server.ts b/packages/core/src/servers/http-server.ts similarity index 100% rename from src/servers/http-server.ts rename to packages/core/src/servers/http-server.ts diff --git a/src/servers/utils/content-types.ts b/packages/core/src/servers/utils/content-types.ts similarity index 100% rename from src/servers/utils/content-types.ts rename to packages/core/src/servers/utils/content-types.ts diff --git a/src/servers/utils/http-response-codes.ts b/packages/core/src/servers/utils/http-response-codes.ts similarity index 100% rename from src/servers/utils/http-response-codes.ts rename to packages/core/src/servers/utils/http-response-codes.ts diff --git a/src/servers/utils/jsonrpc.ts b/packages/core/src/servers/utils/jsonrpc.ts similarity index 100% rename from src/servers/utils/jsonrpc.ts rename to packages/core/src/servers/utils/jsonrpc.ts diff --git a/src/servers/utils/websocket-close-codes.ts b/packages/core/src/servers/utils/websocket-close-codes.ts similarity index 100% rename from src/servers/utils/websocket-close-codes.ts rename to packages/core/src/servers/utils/websocket-close-codes.ts diff --git a/src/servers/views/components/accounts/accounts.marko b/packages/core/src/servers/views/components/accounts/accounts.marko similarity index 100% rename from src/servers/views/components/accounts/accounts.marko rename to packages/core/src/servers/views/components/accounts/accounts.marko diff --git a/src/servers/views/components/accounts/components/info.marko b/packages/core/src/servers/views/components/accounts/components/info.marko similarity index 100% rename from src/servers/views/components/accounts/components/info.marko rename to packages/core/src/servers/views/components/accounts/components/info.marko diff --git a/src/servers/views/components/app-tabs/index.marko b/packages/core/src/servers/views/components/app-tabs/index.marko similarity index 100% rename from src/servers/views/components/app-tabs/index.marko rename to packages/core/src/servers/views/components/app-tabs/index.marko diff --git a/src/servers/views/components/app-tabs/marko-tag.json b/packages/core/src/servers/views/components/app-tabs/marko-tag.json similarity index 100% rename from src/servers/views/components/app-tabs/marko-tag.json rename to packages/core/src/servers/views/components/app-tabs/marko-tag.json diff --git a/src/servers/views/components/blocks.marko b/packages/core/src/servers/views/components/blocks.marko similarity index 100% rename from src/servers/views/components/blocks.marko rename to packages/core/src/servers/views/components/blocks.marko diff --git a/src/servers/views/components/events.marko b/packages/core/src/servers/views/components/events.marko similarity index 100% rename from src/servers/views/components/events.marko rename to packages/core/src/servers/views/components/events.marko diff --git a/src/servers/views/components/logs.marko b/packages/core/src/servers/views/components/logs.marko similarity index 100% rename from src/servers/views/components/logs.marko rename to packages/core/src/servers/views/components/logs.marko diff --git a/src/servers/views/components/status-bar/index.marko b/packages/core/src/servers/views/components/status-bar/index.marko similarity index 100% rename from src/servers/views/components/status-bar/index.marko rename to packages/core/src/servers/views/components/status-bar/index.marko diff --git a/src/servers/views/components/transactions.marko b/packages/core/src/servers/views/components/transactions.marko similarity index 100% rename from src/servers/views/components/transactions.marko rename to packages/core/src/servers/views/components/transactions.marko diff --git a/src/servers/views/index.marko b/packages/core/src/servers/views/index.marko similarity index 100% rename from src/servers/views/index.marko rename to packages/core/src/servers/views/index.marko diff --git a/src/servers/ws-server.ts b/packages/core/src/servers/ws-server.ts similarity index 100% rename from src/servers/ws-server.ts rename to packages/core/src/servers/ws-server.ts diff --git a/packages/core/src/test.ts b/packages/core/src/test.ts new file mode 100644 index 0000000000..602a5eb26c --- /dev/null +++ b/packages/core/src/test.ts @@ -0,0 +1,2 @@ +import {version, name} from "../package.json"; +console.log(`${name}/${version}`); \ No newline at end of file diff --git a/src/things/account.ts b/packages/core/src/things/account.ts similarity index 100% rename from src/things/account.ts rename to packages/core/src/things/account.ts diff --git a/src/things/address.ts b/packages/core/src/things/address.ts similarity index 100% rename from src/things/address.ts rename to packages/core/src/things/address.ts diff --git a/src/things/errors.ts b/packages/core/src/things/errors.ts similarity index 100% rename from src/things/errors.ts rename to packages/core/src/things/errors.ts diff --git a/src/things/json-rpc/index.ts b/packages/core/src/things/json-rpc/index.ts similarity index 100% rename from src/things/json-rpc/index.ts rename to packages/core/src/things/json-rpc/index.ts diff --git a/src/things/json-rpc/json-rpc-base-types.ts b/packages/core/src/things/json-rpc/json-rpc-base-types.ts similarity index 100% rename from src/things/json-rpc/json-rpc-base-types.ts rename to packages/core/src/things/json-rpc/json-rpc-base-types.ts diff --git a/src/things/json-rpc/json-rpc-data.ts b/packages/core/src/things/json-rpc/json-rpc-data.ts similarity index 100% rename from src/things/json-rpc/json-rpc-data.ts rename to packages/core/src/things/json-rpc/json-rpc-data.ts diff --git a/src/things/json-rpc/json-rpc-quantity.ts b/packages/core/src/things/json-rpc/json-rpc-quantity.ts similarity index 100% rename from src/things/json-rpc/json-rpc-quantity.ts rename to packages/core/src/things/json-rpc/json-rpc-quantity.ts diff --git a/src/things/params.ts b/packages/core/src/things/params.ts similarity index 100% rename from src/things/params.ts rename to packages/core/src/things/params.ts diff --git a/src/things/tags.ts b/packages/core/src/things/tags.ts similarity index 100% rename from src/things/tags.ts rename to packages/core/src/things/tags.ts diff --git a/src/things/transaction-receipt.ts b/packages/core/src/things/transaction-receipt.ts similarity index 100% rename from src/things/transaction-receipt.ts rename to packages/core/src/things/transaction-receipt.ts diff --git a/src/things/transaction.ts b/packages/core/src/things/transaction.ts similarity index 100% rename from src/things/transaction.ts rename to packages/core/src/things/transaction.ts diff --git a/src/types/index.ts b/packages/core/src/types/index.ts similarity index 100% rename from src/types/index.ts rename to packages/core/src/types/index.ts diff --git a/src/utils/bigint-to-buffer.ts b/packages/core/src/utils/bigint-to-buffer.ts similarity index 100% rename from src/utils/bigint-to-buffer.ts rename to packages/core/src/utils/bigint-to-buffer.ts diff --git a/src/utils/executor.ts b/packages/core/src/utils/executor.ts similarity index 100% rename from src/utils/executor.ts rename to packages/core/src/utils/executor.ts diff --git a/src/utils/heap.ts b/packages/core/src/utils/heap.ts similarity index 100% rename from src/utils/heap.ts rename to packages/core/src/utils/heap.ts diff --git a/src/utils/request-coordinator.ts b/packages/core/src/utils/request-coordinator.ts similarity index 100% rename from src/utils/request-coordinator.ts rename to packages/core/src/utils/request-coordinator.ts diff --git a/packages/core/transform.ts b/packages/core/transform.ts new file mode 100644 index 0000000000..6c5c6a837a --- /dev/null +++ b/packages/core/transform.ts @@ -0,0 +1,161 @@ +import * as ts from 'typescript' +import { resolve, dirname } from 'path' + +type JSONValue = string | number | boolean | JSONObject | JSONArray + +interface JSONObject { + [x: string]: JSONValue +} + +interface JSONArray extends Array {} + +function serializeToAst(v: JSONValue): ts.Expression { + if (Array.isArray(v)) { + return ts.createArrayLiteral(v.map(el => serializeToAst(el))) + } + switch (typeof v) { + case 'string': + return ts.createStringLiteral(v) + case 'number': + return ts.createNumericLiteral(String(v)) + case 'boolean': + return v ? ts.createTrue() : ts.createFalse() + case 'object': + if (!v) { + return ts.createNull() + } + const keys = Object.keys(v) + return ts.createObjectLiteral( + keys.map(k => ts.createPropertyAssignment(ts.createStringLiteral(k), serializeToAst(v[k]))) + ) + } +} + +function serializeToTypeAst(v: JSONValue): ts.TypeNode { + if (Array.isArray(v)) { + return ts.createTupleTypeNode(v.map(el => serializeToTypeAst(el))) + } + switch (typeof v) { + case 'string': + return ts.createKeywordTypeNode(ts.SyntaxKind.StringKeyword) + case 'number': + return ts.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword) + case 'boolean': + return v ? ts.createTrue() : ts.createFalse() + case 'object': + if (!v) { + return ts.createNull() + } + const keys = Object.keys(v) + return ts.createTypeLiteralNode( + keys.map(k => + ts.createPropertySignature( + undefined, + ts.createStringLiteral(k), + undefined, + serializeToTypeAst(v[k]), + undefined + ) + ) + ) + } +} + +function trimQuote(path: string) { + return path.slice(1, path.length - 1) +} + +function resolveJsonImport(path: string): string { + if (path.endsWith('.json')) { + return path + } + try { + path = require.resolve(path + '.json') + } catch (_) { + return '' + } + return path +} + +function resolveJsonImportFromNode(node: ts.ImportDeclaration | ts.ExportDeclaration, sf: ts.SourceFile): string { + const jsonPath = trimQuote(node.moduleSpecifier.getText(sf)) + return jsonPath && resolveJsonImport(resolve(dirname(sf.fileName), jsonPath)) +} + +export interface Opts { + isDeclaration?: boolean +} +const set = new Set(); +function inlineJson (node: ts.ImportDeclaration | ts.ExportDeclaration, sf: ts.SourceFile, jsonPath: string, isDeclaration: boolean): ts.Node { + const json = require(jsonPath) + // Default import, inline the whole json + // and convert it to const foo = {json} + let value: ts.VariableDeclarationList + let namespaceImport: ts.NamespaceImport | ts.NamespaceExportDeclaration + let namedImports: ts.NamedImports | ts.NamedExports + const isExportDeclaration = ts.isExportDeclaration(node) + if (ts.isImportDeclaration(node)) { + if (ts.isNamespaceImport(node.importClause.namedBindings)) { + namespaceImport = node.importClause.namedBindings + } else if (ts.isNamedImports(node.importClause.namedBindings)) { + namedImports = node.importClause.namedBindings + } + } else if (isExportDeclaration) { + namedImports = node.exportClause as any + } + if (namespaceImport) { + value = ts.createVariableDeclarationList([ + ts.createVariableDeclaration( + namespaceImport.name.getText(sf), + isDeclaration && serializeToTypeAst(json), + !isDeclaration ? serializeToAst(json) : undefined + ), + ]) + } + if (namedImports) { + // Create alias in case we have alias import + const aliases: Record = (namedImports.elements as ReadonlyArray).reduce((all: Record, el) => { + if (el.propertyName) { + all[el.propertyName.getText(sf)] = el.name.getText(sf) + } else { + all[el.name.getText(sf)] = el.name.getText(sf) + } + return all + }, {}) + value = ts.createVariableDeclarationList( + Object.keys(aliases).map(k => ts.createVariableDeclaration(aliases[k], isDeclaration && serializeToTypeAst(json[k]), !isDeclaration ? serializeToAst(json[k]) : undefined)) + ) + } + return ts.createVariableStatement([ + ...isExportDeclaration ? [ts.createModifier(ts.SyntaxKind.ExportKeyword)] : [], + isDeclaration ? ts.createModifier(ts.SyntaxKind.DeclareKeyword) : ts.createModifier(ts.SyntaxKind.ConstKeyword) + ], value) +} + +function visitor({isDeclaration}: Opts, ctx: ts.TransformationContext, sf: ts.SourceFile) { + const visitor: ts.Visitor = (node: ts.Node): ts.Node => { + let jsonPath: string + if (ts.isImportDeclaration(node) && (jsonPath = resolveJsonImportFromNode(node, sf))) { + // If it has no import class (e.g import 'foo'), rm the node + if (!node.importClause) { + return null + } + return inlineJson(node, sf, jsonPath, isDeclaration) || ts.visitEachChild(node, visitor, ctx) + } + if (ts.isExportDeclaration(node) && node.moduleSpecifier && (jsonPath = resolveJsonImportFromNode(node, sf))) { + return inlineJson(node, sf, jsonPath, isDeclaration) || ts.visitEachChild(node, visitor, ctx) + } + if (node.kind === 75) { + console.log(node.modifiers); + } + return ts.visitEachChild(node, visitor, ctx) + } + + return visitor +} + +export function transform(opts: Opts): ts.TransformerFactory { + return (ctx: ts.TransformationContext): ts.Transformer => { + return (sf: ts.SourceFile) => ts.visitNode(sf, visitor(opts, ctx, sf)) + } +} \ No newline at end of file diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 0000000000..fdfdb95a1d --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] +} \ No newline at end of file diff --git a/packages/ethereum/README.md b/packages/ethereum/README.md new file mode 100644 index 0000000000..2d0213bd50 --- /dev/null +++ b/packages/ethereum/README.md @@ -0,0 +1,11 @@ +# `@ganache/ethereum` + +> TODO: description + +## Usage + +``` +const ethereum = require('@ganache/ethereum'); + +// TODO: DEMONSTRATE API +``` diff --git a/packages/ethereum/__tests__/ethereum.test.js b/packages/ethereum/__tests__/ethereum.test.js new file mode 100644 index 0000000000..a061e5527b --- /dev/null +++ b/packages/ethereum/__tests__/ethereum.test.js @@ -0,0 +1,7 @@ +'use strict'; + +const ethereum = require('..'); + +describe('@ganache/ethereum', () => { + it('needs tests'); +}); diff --git a/packages/ethereum/package.json b/packages/ethereum/package.json new file mode 100644 index 0000000000..cefda81ca5 --- /dev/null +++ b/packages/ethereum/package.json @@ -0,0 +1,30 @@ +{ + "name": "@ganache/ethereum", + "version": "2.2.1", + "description": "> TODO: description", + "author": "David Murdoch ", + "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "license": "MIT", + "main": "lib/ethereum.js", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/trufflesuite/ganache-core.git" + }, + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1", + "tsc": "tsc" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + } +} diff --git a/packages/ethereum/src/ethereum.ts b/packages/ethereum/src/ethereum.ts new file mode 100644 index 0000000000..aaf72d23dc --- /dev/null +++ b/packages/ethereum/src/ethereum.ts @@ -0,0 +1,3 @@ +export default function ethereum() { + // TODO +} diff --git a/packages/ethereum/tsconfig.json b/packages/ethereum/tsconfig.json new file mode 100644 index 0000000000..1b551f4e9e --- /dev/null +++ b/packages/ethereum/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["src"] +} diff --git a/packages/tezos/README.md b/packages/tezos/README.md new file mode 100644 index 0000000000..e09a9ea2a7 --- /dev/null +++ b/packages/tezos/README.md @@ -0,0 +1,11 @@ +# `@ganache/tezos` + +> TODO: description + +## Usage + +``` +const tezos = require('@ganache/tezos'); + +// TODO: DEMONSTRATE API +``` diff --git a/packages/tezos/__tests__/tezos.test.js b/packages/tezos/__tests__/tezos.test.js new file mode 100644 index 0000000000..46b373c464 --- /dev/null +++ b/packages/tezos/__tests__/tezos.test.js @@ -0,0 +1,7 @@ +'use strict'; + +const tezos = require('..'); + +describe('@ganache/tezos', () => { + it('needs tests'); +}); diff --git a/packages/tezos/package.json b/packages/tezos/package.json new file mode 100644 index 0000000000..9f63dd7ac7 --- /dev/null +++ b/packages/tezos/package.json @@ -0,0 +1,30 @@ +{ + "name": "@ganache/tezos", + "version": "2.2.1", + "description": "> TODO: description", + "author": "David Murdoch ", + "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "license": "MIT", + "main": "lib/tezos.js", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/trufflesuite/ganache-core.git" + }, + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1", + "tsc": "tsc" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + } +} diff --git a/packages/tezos/src/tezos.ts b/packages/tezos/src/tezos.ts new file mode 100644 index 0000000000..ae5e744311 --- /dev/null +++ b/packages/tezos/src/tezos.ts @@ -0,0 +1,3 @@ +export default function tezos() { + // TODO +} diff --git a/packages/tezos/tsconfig.json b/packages/tezos/tsconfig.json new file mode 100644 index 0000000000..1b551f4e9e --- /dev/null +++ b/packages/tezos/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["src"] +} diff --git a/packages/utils/README.md b/packages/utils/README.md new file mode 100644 index 0000000000..52e545daf2 --- /dev/null +++ b/packages/utils/README.md @@ -0,0 +1,11 @@ +# `@ganache/utils` + +> TODO: description + +## Usage + +``` +const utils = require('@ganache/utils'); + +// TODO: DEMONSTRATE API +``` diff --git a/packages/utils/__tests__/utils.test.js b/packages/utils/__tests__/utils.test.js new file mode 100644 index 0000000000..8eac9026b5 --- /dev/null +++ b/packages/utils/__tests__/utils.test.js @@ -0,0 +1,7 @@ +'use strict'; + +const utils = require('..'); + +describe('@ganache/utils', () => { + it('needs tests'); +}); diff --git a/packages/utils/package.json b/packages/utils/package.json new file mode 100644 index 0000000000..cd96e78b1f --- /dev/null +++ b/packages/utils/package.json @@ -0,0 +1,29 @@ +{ + "name": "@ganache/utils", + "version": "2.2.1", + "description": "> TODO: description", + "author": "David Murdoch ", + "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "license": "MIT", + "main": "lib/utils.js", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/trufflesuite/ganache-core.git" + }, + "scripts": { + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + } +} diff --git a/packages/utils/src/utils.ts b/packages/utils/src/utils.ts new file mode 100644 index 0000000000..d98008d704 --- /dev/null +++ b/packages/utils/src/utils.ts @@ -0,0 +1,3 @@ +export default function utils() { + // TODO +} diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json new file mode 100644 index 0000000000..1b551f4e9e --- /dev/null +++ b/packages/utils/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["src"] +} diff --git a/tsconfig.json b/tsconfig.json index e8cf08d1b7..5a4dbe3731 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,11 +9,6 @@ "noImplicitThis": true, "noErrorTruncation": true, "sourceMap": true, - "outDir": "dist", "resolveJsonModule": true - }, - "include": [ - "src/**/*", - "@types/**/*", - ], + } } From c763b07fc0579771ecb0ede705ee4c25b21e1c30 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 15:43:24 -0400 Subject: [PATCH 165/691] More monorepo work --- package-lock.json | 147 ++++++++++++++++++ package.json | 4 + packages/core/compile.ts | 137 ++++++++-------- packages/core/package.json | 5 +- packages/core/src/test.ts | 2 - .../patches => patches}/emittery+0.6.0.patch | 0 6 files changed, 222 insertions(+), 73 deletions(-) delete mode 100644 packages/core/src/test.ts rename {packages/core/patches => patches}/emittery+0.6.0.patch (100%) diff --git a/package-lock.json b/package-lock.json index b757c1bea8..22875aac2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2052,6 +2052,12 @@ "@types/node": "*" } }, + "@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true + }, "@zkochan/cmd-shim": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", @@ -4550,6 +4556,38 @@ "locate-path": "^3.0.0" } }, + "find-yarn-workspace-root": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz", + "integrity": "sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==", + "dev": true, + "requires": { + "fs-extra": "^4.0.3", + "micromatch": "^3.1.4" + }, + "dependencies": { + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + } + } + }, "flat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", @@ -6108,6 +6146,15 @@ "graceful-fs": "^4.1.9" } }, + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11" + } + }, "lerna": { "version": "3.20.2", "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.20.2.tgz", @@ -7994,6 +8041,106 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, + "patch-package": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.2.2.tgz", + "integrity": "sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg==", + "dev": true, + "requires": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^2.4.2", + "cross-spawn": "^6.0.5", + "find-yarn-workspace-root": "^1.2.1", + "fs-extra": "^7.0.1", + "is-ci": "^2.0.0", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.0", + "rimraf": "^2.6.3", + "semver": "^5.6.0", + "slash": "^2.0.0", + "tmp": "^0.0.33" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", diff --git a/package.json b/package.json index c46e7c2d34..d5ae9e4e6e 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,9 @@ "node": ">=10.7.0 <=14.0.0", "npm": ">=6.1.0" }, + "scripts": { + "postinstall": "patch-package" + }, "dependencies": { "@types/lodash.clonedeep": "4.5.6", "bip39": "3.0.2", @@ -44,6 +47,7 @@ "lerna": "3.20.2", "mocha": "7.1.1", "nyc": "15.0.1", + "patch-package": "6.2.2", "prettier": "2.0.5", "solc": "0.6.6", "source-map-support": "0.5.18", diff --git a/packages/core/compile.ts b/packages/core/compile.ts index 7baaf9dc4b..7045e17fab 100644 --- a/packages/core/compile.ts +++ b/packages/core/compile.ts @@ -1,104 +1,105 @@ -import { ts, ImportDeclarationStructure, Project, ImportDeclaration, SourceFile } from "ts-morph"; -import { resolve, dirname } from 'path' -import { NodeFlags } from "typescript"; +import {ts, Project, SourceFile} from "ts-morph"; +import {resolve, dirname} from "path"; +import {NodeFlags} from "typescript"; function trimQuote(path: string) { - return path.slice(1, path.length - 1) + return path.slice(1, path.length - 1); } function resolveJsonImport(path: string): string { - if (path.endsWith('.json')) { - return path + if (path.endsWith(".json")) { + return path; } try { - path = require.resolve(path + '.json') + path = require.resolve(path + ".json"); } catch (_) { - return '' + return ""; } - return path + return path; } - function serializeToAst(v: any): ts.Expression { if (Array.isArray(v)) { - return ts.createArrayLiteral(v.map(el => serializeToAst(el))) + return ts.createArrayLiteral(v.map(el => serializeToAst(el))); } switch (typeof v) { - case 'string': - return ts.createStringLiteral(v) - case 'number': - return ts.createNumericLiteral(String(v)) - case 'boolean': - return v ? ts.createTrue() : ts.createFalse() - case 'object': - if (!v) { - return ts.createNull() - } - const keys = Object.keys(v) - return ts.createObjectLiteral( - keys.map(k => ts.createPropertyAssignment(ts.createStringLiteral(k), serializeToAst(v[k]))) - ) + case "string": + return ts.createStringLiteral(v); + case "number": + return ts.createNumericLiteral(String(v)); + case "boolean": + return v ? ts.createTrue() : ts.createFalse(); + case "object": + if (!v) { + return ts.createNull(); + } + const keys = Object.keys(v); + return ts.createObjectLiteral( + keys.map(k => ts.createPropertyAssignment(ts.createStringLiteral(k), serializeToAst(v[k]))) + ); } } function serializeToTypeAst(v: any): ts.TypeNode { if (Array.isArray(v)) { - return ts.createTupleTypeNode(v.map(el => serializeToTypeAst(el))) + return ts.createTupleTypeNode(v.map(el => serializeToTypeAst(el))); } switch (typeof v) { - case 'string': - return ts.createKeywordTypeNode(ts.SyntaxKind.StringKeyword) - case 'number': - return ts.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword) - case 'boolean': - return v ? ts.createTrue() : ts.createFalse() - case 'object': - if (!v) { - return ts.createNull() - } - const keys = Object.keys(v) - return ts.createTypeLiteralNode( - keys.map(k => - ts.createPropertySignature( - undefined, - ts.createStringLiteral(k), - undefined, - serializeToTypeAst(v[k]), - undefined - ) - ) + case "string": + return ts.createKeywordTypeNode(ts.SyntaxKind.StringKeyword); + case "number": + return ts.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword); + case "boolean": + return v ? ts.createTrue() : ts.createFalse(); + case "object": + if (!v) { + return ts.createNull(); + } + const keys = Object.keys(v); + return ts.createTypeLiteralNode( + keys.map(k => + ts.createPropertySignature( + undefined, + ts.createStringLiteral(k), + undefined, + serializeToTypeAst(v[k]), + undefined ) + ) + ); } } -function resolveJsonImportFromNode(node: ImportDeclaration, sf: SourceFile): string { - const jsonPath = trimQuote((node as any).moduleSpecifier.getText()) - return jsonPath && resolveJsonImport(resolve(dirname(sf.getFilePath()), jsonPath)) +function resolveJsonImportFromNode(node: ts.ImportDeclaration, sf: SourceFile): string { + const jsonPath = trimQuote(node.moduleSpecifier.getText()); + return jsonPath && resolveJsonImport(resolve(dirname(sf.getFilePath()), jsonPath)); } -import options from "./tsconfig.json"; - -const project = new Project(options); -const sources = project.addSourceFilesAtPaths("./src/**/*.ts"); +const parseConfigHost: ts.ParseConfigHost = ts.sys; +const configFileName = ts.findConfigFile("./", ts.sys.fileExists, "tsconfig.json"); +const configFile = ts.readConfigFile(configFileName, ts.sys.readFile); +const compilerOptions = ts.parseJsonConfigFileContent(configFile.config, parseConfigHost, "./"); +const project = new Project({ + compilerOptions: compilerOptions.options +}); +const sources = project.addSourceFilesAtPaths(compilerOptions.fileNames); sources.forEach(sourceFile => { sourceFile.transform(traversal => { const node = traversal.visitChildren(); let jsonPath: string; - if (ts.isImportDeclaration(node) && (jsonPath = resolveJsonImportFromNode(node as any as ImportDeclaration, sourceFile))){ - console.log(node.moduleSpecifier.getText()); - const namedBindings = node.importClause.namedBindings as ts.NamedImports; - const jsonFile = require(jsonPath); - // const n = node as any as ImportDeclarationStructure; - const json = namedBindings.elements.map(element => { - const name = element.propertyName ? element.propertyName.getText() : element.getText(); - const value = jsonFile[name]; - return ts.createVariableDeclaration(name, serializeToTypeAst(value), serializeToAst(value)) - }) - return ts.createVariableStatement( - [], - ts.createVariableDeclarationList(json, NodeFlags.Const) - ); + if (ts.isImportDeclaration(node) && (jsonPath = resolveJsonImportFromNode(node, sourceFile))) { + const namedBindings = node.importClause.namedBindings; + if ("elements" in namedBindings){ + const jsonFile = require(jsonPath); + const json = namedBindings.elements.map(element => { + const name = element.name.text; + const propertyName = element.propertyName ? element.propertyName.text : name; + const value = jsonFile[propertyName]; + return ts.createVariableDeclaration(name, serializeToTypeAst(value), serializeToAst(value)); + }); + return ts.createVariableStatement([], ts.createVariableDeclarationList(json, NodeFlags.Const)); + } } return node; diff --git a/packages/core/package.json b/packages/core/package.json index 83535edb9c..06e20b5914 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -22,10 +22,9 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "tsc", + "tsc": "ts-node compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks 'test/**.ts'", - "postinstall": "patch-package" + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks 'test/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/core/src/test.ts b/packages/core/src/test.ts deleted file mode 100644 index 602a5eb26c..0000000000 --- a/packages/core/src/test.ts +++ /dev/null @@ -1,2 +0,0 @@ -import {version, name} from "../package.json"; -console.log(`${name}/${version}`); \ No newline at end of file diff --git a/packages/core/patches/emittery+0.6.0.patch b/patches/emittery+0.6.0.patch similarity index 100% rename from packages/core/patches/emittery+0.6.0.patch rename to patches/emittery+0.6.0.patch From 55572d80272ee6bcc87fac0106961e0055459f57 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 15:48:13 -0400 Subject: [PATCH 166/691] More --- packages/cli/README.md | 11 ++++++++ packages/cli/__tests__/cli.test.js | 7 +++++ packages/cli/npm-shrinkwrap.json | 5 ++++ packages/cli/package.json | 27 +++++++++++++++++++ packages/cli/tsconfig.json | 9 +++++++ ...{package-lock.json => npm-shrinkwrap.json} | 0 packages/ethereum/npm-shrinkwrap.json | 5 ++++ packages/tezos/npm-shrinkwrap.json | 5 ++++ packages/utils/npm-shrinkwrap.json | 5 ++++ 9 files changed, 74 insertions(+) create mode 100644 packages/cli/README.md create mode 100644 packages/cli/__tests__/cli.test.js create mode 100644 packages/cli/npm-shrinkwrap.json create mode 100644 packages/cli/package.json create mode 100644 packages/cli/tsconfig.json rename packages/core/{package-lock.json => npm-shrinkwrap.json} (100%) create mode 100644 packages/ethereum/npm-shrinkwrap.json create mode 100644 packages/tezos/npm-shrinkwrap.json create mode 100644 packages/utils/npm-shrinkwrap.json diff --git a/packages/cli/README.md b/packages/cli/README.md new file mode 100644 index 0000000000..5ed7bd3c9e --- /dev/null +++ b/packages/cli/README.md @@ -0,0 +1,11 @@ +# `cli` + +> TODO: description + +## Usage + +``` +const cli = require('cli'); + +// TODO: DEMONSTRATE API +``` diff --git a/packages/cli/__tests__/cli.test.js b/packages/cli/__tests__/cli.test.js new file mode 100644 index 0000000000..79a6562a9d --- /dev/null +++ b/packages/cli/__tests__/cli.test.js @@ -0,0 +1,7 @@ +'use strict'; + +const cli = require('..'); + +describe('cli', () => { + it('needs tests'); +}); diff --git a/packages/cli/npm-shrinkwrap.json b/packages/cli/npm-shrinkwrap.json new file mode 100644 index 0000000000..84cc6599df --- /dev/null +++ b/packages/cli/npm-shrinkwrap.json @@ -0,0 +1,5 @@ +{ + "name": "cli", + "version": "2.2.1", + "lockfileVersion": 1 +} diff --git a/packages/cli/package.json b/packages/cli/package.json new file mode 100644 index 0000000000..0bf7c0239b --- /dev/null +++ b/packages/cli/package.json @@ -0,0 +1,27 @@ +{ + "name": "cli", + "version": "2.2.1", + "description": "> TODO: description", + "author": "David Murdoch ", + "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "license": "MIT", + "main": "lib/index.js", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/trufflesuite/ganache-core.git" + }, + "scripts": { + "tsc": "tsc", + "test": "echo \"Error: run tests from root\" && exit 1" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + } +} diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json new file mode 100644 index 0000000000..fdfdb95a1d --- /dev/null +++ b/packages/cli/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib" + }, + "include": [ + "./src" + ] +} \ No newline at end of file diff --git a/packages/core/package-lock.json b/packages/core/npm-shrinkwrap.json similarity index 100% rename from packages/core/package-lock.json rename to packages/core/npm-shrinkwrap.json diff --git a/packages/ethereum/npm-shrinkwrap.json b/packages/ethereum/npm-shrinkwrap.json new file mode 100644 index 0000000000..5a73f495fd --- /dev/null +++ b/packages/ethereum/npm-shrinkwrap.json @@ -0,0 +1,5 @@ +{ + "name": "@ganache/ethereum", + "version": "2.2.1", + "lockfileVersion": 1 +} diff --git a/packages/tezos/npm-shrinkwrap.json b/packages/tezos/npm-shrinkwrap.json new file mode 100644 index 0000000000..81819558a7 --- /dev/null +++ b/packages/tezos/npm-shrinkwrap.json @@ -0,0 +1,5 @@ +{ + "name": "@ganache/tezos", + "version": "2.2.1", + "lockfileVersion": 1 +} diff --git a/packages/utils/npm-shrinkwrap.json b/packages/utils/npm-shrinkwrap.json new file mode 100644 index 0000000000..64fd593d48 --- /dev/null +++ b/packages/utils/npm-shrinkwrap.json @@ -0,0 +1,5 @@ +{ + "name": "@ganache/utils", + "version": "2.2.1", + "lockfileVersion": 1 +} From 452dab1f1da1c9f451c6c0dec3c76cf22bdd5d35 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 16:04:25 -0400 Subject: [PATCH 167/691] Update readme --- README.md | 3 ++- docs/README.md | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 90805031e6..697f6107a1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # JUST FOR EXPERIMENTS -TODO: auuto generate some stuffs here: + +[Developer Documentation](./docs/README.md); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 36df1220db..cd5d50cea6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,13 @@ # Developer Documentation +## Getting set up + + * Use node v10.7.0 (or whatever the lowest engine is in the root package.json) + * `git clone git@github.com:trufflesuite/ganache-core.git && cd ganache-core` + * `npm install lerna -g` + * `lerna bootstrap` + + ## Code Conventions These are guidelines, not rules. :-) From 43534052c078abc8afb06a2ed2040c4f92e2268f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 16:04:41 -0400 Subject: [PATCH 168/691] Some more changes --- packages/core/compile.ts => compile.ts | 0 package-lock.json | 213 +++++++++++ package.json | 1 + .../__tests__/{cli.test.js => cli.test.ts} | 0 packages/cli/package.json | 3 +- packages/cli/tsconfig.json | 8 +- packages/core/npm-shrinkwrap.json | 338 +----------------- packages/core/package.json | 6 +- packages/core/src/servers/ws-server.ts | 1 - packages/core/transform.ts | 161 --------- packages/core/tsconfig.json | 8 +- .../{ethereum.test.js => ethereum.test.ts} | 0 packages/ethereum/package.json | 7 +- .../{tezos.test.js => tezos.test.ts} | 0 packages/tezos/package.json | 7 +- .../{utils.test.js => utils.test.ts} | 0 packages/utils/package.json | 4 +- 17 files changed, 236 insertions(+), 521 deletions(-) rename packages/core/compile.ts => compile.ts (100%) rename packages/cli/__tests__/{cli.test.js => cli.test.ts} (100%) delete mode 100644 packages/core/transform.ts rename packages/ethereum/__tests__/{ethereum.test.js => ethereum.test.ts} (100%) rename packages/tezos/__tests__/{tezos.test.js => tezos.test.ts} (100%) rename packages/utils/__tests__/{utils.test.js => utils.test.ts} (100%) diff --git a/packages/core/compile.ts b/compile.ts similarity index 100% rename from packages/core/compile.ts rename to compile.ts diff --git a/package-lock.json b/package-lock.json index 22875aac2e..cafcc14f00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -236,6 +236,16 @@ "to-fast-properties": "^2.0.0" } }, + "@dsherret/to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-H2R13IvZdM6gei2vOGSzF7HdMyw=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + } + }, "@evocateur/libnpmaccess": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz", @@ -1761,12 +1771,40 @@ "glob-to-regexp": "^0.3.0" } }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + } + } + }, "@nodelib/fs.stat": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, "@octokit/auth-token": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.0.tgz", @@ -1941,6 +1979,103 @@ "@types/node": ">= 8" } }, + "@ts-morph/common": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.4.0.tgz", + "integrity": "sha512-VV5/F8k/9RnSZnNpnaOarKb7LOzYhITjHB9JIcpl1l+zlt99H1HeZH/yI2Xs6BtAV4WjPX+SjjRVybdEm6IOEQ==", + "dev": true, + "requires": { + "@dsherret/to-absolute-glob": "^2.0.2", + "fast-glob": "^3.1.1", + "fs-extra": "^8.1.0", + "is-negated-glob": "^1.0.0", + "multimatch": "^4.0.0", + "typescript": "~3.8.2" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "fast-glob": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + } + } + } + }, "@types/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", @@ -2948,6 +3083,12 @@ "shallow-clone": "^3.0.0" } }, + "code-block-writer": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.0.tgz", + "integrity": "sha512-RG9hpXtWFeUWhuUav1YuP/vGcyncW+t90yJLk9fNZs1De2OuHTHKAKThVCokt29PYq5RoJ0QSZaIZ+rvPO23hA==", + "dev": true + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -4507,6 +4648,15 @@ "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", "dev": true }, + "fastq": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", + "integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", @@ -5627,6 +5777,16 @@ "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", "dev": true }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "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", @@ -5782,6 +5942,12 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -5817,6 +5983,15 @@ "has": "^1.0.3" } }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, "is-ssh": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.1.tgz", @@ -5855,6 +6030,15 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", @@ -8807,6 +8991,12 @@ "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -8845,6 +9035,12 @@ "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -9859,6 +10055,17 @@ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, + "ts-morph": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.0.3.tgz", + "integrity": "sha512-IKvg8h5yQBubv7XQ8ku5exqgQbF7YgWm5/whaR1GV9+vaHOhn0zj7+A2/t0UNfNafH0Fxxz7m7ZK+QioYc1Dfg==", + "dev": true, + "requires": { + "@dsherret/to-absolute-glob": "^2.0.2", + "@ts-morph/common": "~0.4.0", + "code-block-writer": "^10.1.0" + } + }, "ts-node": { "version": "8.9.0", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.9.0.tgz", @@ -10007,6 +10214,12 @@ "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=", "dev": true }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", diff --git a/package.json b/package.json index d5ae9e4e6e..2443e69eaa 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "solc": "0.6.6", "source-map-support": "0.5.18", "superagent": "5.2.2", + "ts-morph": "7.0.3", "ts-node": "8.9.0", "tslint": "6.1.1", "typescript": "3.8.3", diff --git a/packages/cli/__tests__/cli.test.js b/packages/cli/__tests__/cli.test.ts similarity index 100% rename from packages/cli/__tests__/cli.test.js rename to packages/cli/__tests__/cli.test.ts diff --git a/packages/cli/package.json b/packages/cli/package.json index 0bf7c0239b..bf56c81a0a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -6,6 +6,7 @@ "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", + "typings": "lib/index.d.ts", "directories": { "lib": "lib", "test": "__tests__" @@ -18,7 +19,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "tsc", + "tsc": "ts-node ../../compile", "test": "echo \"Error: run tests from root\" && exit 1" }, "bugs": { diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index fdfdb95a1d..1b551f4e9e 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./lib" + "outDir": "lib" }, - "include": [ - "./src" - ] -} \ No newline at end of file + "include": ["src"] +} diff --git a/packages/core/npm-shrinkwrap.json b/packages/core/npm-shrinkwrap.json index 7f35edf81a..bf6c57f431 100644 --- a/packages/core/npm-shrinkwrap.json +++ b/packages/core/npm-shrinkwrap.json @@ -1,341 +1,5 @@ { "name": "@ganache/core", "version": "2.2.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@dsherret/to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-H2R13IvZdM6gei2vOGSzF7HdMyw=", - "dev": true, - "requires": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.3", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.3", - "fastq": "^1.6.0" - } - }, - "@ts-morph/common": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.4.0.tgz", - "integrity": "sha512-VV5/F8k/9RnSZnNpnaOarKb7LOzYhITjHB9JIcpl1l+zlt99H1HeZH/yI2Xs6BtAV4WjPX+SjjRVybdEm6IOEQ==", - "dev": true, - "requires": { - "@dsherret/to-absolute-glob": "^2.0.2", - "fast-glob": "^3.1.1", - "fs-extra": "^8.1.0", - "is-negated-glob": "^1.0.0", - "multimatch": "^4.0.0", - "typescript": "~3.8.2" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "array-differ": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", - "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "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", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "code-block-writer": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.0.tgz", - "integrity": "sha512-RG9hpXtWFeUWhuUav1YuP/vGcyncW+t90yJLk9fNZs1De2OuHTHKAKThVCokt29PYq5RoJ0QSZaIZ+rvPO23hA==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "fast-glob": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", - "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fastq": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", - "integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "dev": true, - "requires": { - "is-relative": "^1.0.0", - "is-windows": "^1.0.1" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", - "dev": true - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "dev": true, - "requires": { - "is-unc-path": "^1.0.0" - } - }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "dev": true, - "requires": { - "unc-path-regex": "^0.1.2" - } - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "merge2": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", - "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "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.7" - } - }, - "multimatch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", - "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", - "dev": true, - "requires": { - "@types/minimatch": "^3.0.3", - "array-differ": "^3.0.0", - "array-union": "^2.1.0", - "arrify": "^2.0.1", - "minimatch": "^3.0.4" - } - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "ts-morph": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.0.3.tgz", - "integrity": "sha512-IKvg8h5yQBubv7XQ8ku5exqgQbF7YgWm5/whaR1GV9+vaHOhn0zj7+A2/t0UNfNafH0Fxxz7m7ZK+QioYc1Dfg==", - "dev": true, - "requires": { - "@dsherret/to-absolute-glob": "^2.0.2", - "@ts-morph/common": "~0.4.0", - "code-block-writer": "^10.1.0" - } - }, - "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", - "dev": true - }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } + "lockfileVersion": 1 } diff --git a/packages/core/package.json b/packages/core/package.json index 06e20b5914..7e3a945573 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -22,14 +22,12 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node compile", + "tsc": "ts-node ../../compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks 'test/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, - "devDependencies": { - "ts-morph": "7.0.3" - } + "devDependencies": {} } diff --git a/packages/core/src/servers/ws-server.ts b/packages/core/src/servers/ws-server.ts index b5735ec8cc..fea58c651e 100644 --- a/packages/core/src/servers/ws-server.ts +++ b/packages/core/src/servers/ws-server.ts @@ -1,7 +1,6 @@ import uWS, {TemplatedApp, WebSocket} from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; import Connector from "../interfaces/connector"; -import {Apis} from "../options/server-options"; export default class WebsocketServer { #connections = new Set(); diff --git a/packages/core/transform.ts b/packages/core/transform.ts deleted file mode 100644 index 6c5c6a837a..0000000000 --- a/packages/core/transform.ts +++ /dev/null @@ -1,161 +0,0 @@ -import * as ts from 'typescript' -import { resolve, dirname } from 'path' - -type JSONValue = string | number | boolean | JSONObject | JSONArray - -interface JSONObject { - [x: string]: JSONValue -} - -interface JSONArray extends Array {} - -function serializeToAst(v: JSONValue): ts.Expression { - if (Array.isArray(v)) { - return ts.createArrayLiteral(v.map(el => serializeToAst(el))) - } - switch (typeof v) { - case 'string': - return ts.createStringLiteral(v) - case 'number': - return ts.createNumericLiteral(String(v)) - case 'boolean': - return v ? ts.createTrue() : ts.createFalse() - case 'object': - if (!v) { - return ts.createNull() - } - const keys = Object.keys(v) - return ts.createObjectLiteral( - keys.map(k => ts.createPropertyAssignment(ts.createStringLiteral(k), serializeToAst(v[k]))) - ) - } -} - -function serializeToTypeAst(v: JSONValue): ts.TypeNode { - if (Array.isArray(v)) { - return ts.createTupleTypeNode(v.map(el => serializeToTypeAst(el))) - } - switch (typeof v) { - case 'string': - return ts.createKeywordTypeNode(ts.SyntaxKind.StringKeyword) - case 'number': - return ts.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword) - case 'boolean': - return v ? ts.createTrue() : ts.createFalse() - case 'object': - if (!v) { - return ts.createNull() - } - const keys = Object.keys(v) - return ts.createTypeLiteralNode( - keys.map(k => - ts.createPropertySignature( - undefined, - ts.createStringLiteral(k), - undefined, - serializeToTypeAst(v[k]), - undefined - ) - ) - ) - } -} - -function trimQuote(path: string) { - return path.slice(1, path.length - 1) -} - -function resolveJsonImport(path: string): string { - if (path.endsWith('.json')) { - return path - } - try { - path = require.resolve(path + '.json') - } catch (_) { - return '' - } - return path -} - -function resolveJsonImportFromNode(node: ts.ImportDeclaration | ts.ExportDeclaration, sf: ts.SourceFile): string { - const jsonPath = trimQuote(node.moduleSpecifier.getText(sf)) - return jsonPath && resolveJsonImport(resolve(dirname(sf.fileName), jsonPath)) -} - -export interface Opts { - isDeclaration?: boolean -} -const set = new Set(); -function inlineJson (node: ts.ImportDeclaration | ts.ExportDeclaration, sf: ts.SourceFile, jsonPath: string, isDeclaration: boolean): ts.Node { - const json = require(jsonPath) - // Default import, inline the whole json - // and convert it to const foo = {json} - let value: ts.VariableDeclarationList - let namespaceImport: ts.NamespaceImport | ts.NamespaceExportDeclaration - let namedImports: ts.NamedImports | ts.NamedExports - const isExportDeclaration = ts.isExportDeclaration(node) - if (ts.isImportDeclaration(node)) { - if (ts.isNamespaceImport(node.importClause.namedBindings)) { - namespaceImport = node.importClause.namedBindings - } else if (ts.isNamedImports(node.importClause.namedBindings)) { - namedImports = node.importClause.namedBindings - } - } else if (isExportDeclaration) { - namedImports = node.exportClause as any - } - if (namespaceImport) { - value = ts.createVariableDeclarationList([ - ts.createVariableDeclaration( - namespaceImport.name.getText(sf), - isDeclaration && serializeToTypeAst(json), - !isDeclaration ? serializeToAst(json) : undefined - ), - ]) - } - if (namedImports) { - // Create alias in case we have alias import - const aliases: Record = (namedImports.elements as ReadonlyArray).reduce((all: Record, el) => { - if (el.propertyName) { - all[el.propertyName.getText(sf)] = el.name.getText(sf) - } else { - all[el.name.getText(sf)] = el.name.getText(sf) - } - return all - }, {}) - value = ts.createVariableDeclarationList( - Object.keys(aliases).map(k => ts.createVariableDeclaration(aliases[k], isDeclaration && serializeToTypeAst(json[k]), !isDeclaration ? serializeToAst(json[k]) : undefined)) - ) - } - return ts.createVariableStatement([ - ...isExportDeclaration ? [ts.createModifier(ts.SyntaxKind.ExportKeyword)] : [], - isDeclaration ? ts.createModifier(ts.SyntaxKind.DeclareKeyword) : ts.createModifier(ts.SyntaxKind.ConstKeyword) - ], value) -} - -function visitor({isDeclaration}: Opts, ctx: ts.TransformationContext, sf: ts.SourceFile) { - const visitor: ts.Visitor = (node: ts.Node): ts.Node => { - let jsonPath: string - if (ts.isImportDeclaration(node) && (jsonPath = resolveJsonImportFromNode(node, sf))) { - // If it has no import class (e.g import 'foo'), rm the node - if (!node.importClause) { - return null - } - return inlineJson(node, sf, jsonPath, isDeclaration) || ts.visitEachChild(node, visitor, ctx) - } - if (ts.isExportDeclaration(node) && node.moduleSpecifier && (jsonPath = resolveJsonImportFromNode(node, sf))) { - return inlineJson(node, sf, jsonPath, isDeclaration) || ts.visitEachChild(node, visitor, ctx) - } - if (node.kind === 75) { - console.log(node.modifiers); - } - return ts.visitEachChild(node, visitor, ctx) - } - - return visitor -} - -export function transform(opts: Opts): ts.TransformerFactory { - return (ctx: ts.TransformationContext): ts.Transformer => { - return (sf: ts.SourceFile) => ts.visitNode(sf, visitor(opts, ctx, sf)) - } -} \ No newline at end of file diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index fdfdb95a1d..1b551f4e9e 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./lib" + "outDir": "lib" }, - "include": [ - "./src" - ] -} \ No newline at end of file + "include": ["src"] +} diff --git a/packages/ethereum/__tests__/ethereum.test.js b/packages/ethereum/__tests__/ethereum.test.ts similarity index 100% rename from packages/ethereum/__tests__/ethereum.test.js rename to packages/ethereum/__tests__/ethereum.test.ts diff --git a/packages/ethereum/package.json b/packages/ethereum/package.json index cefda81ca5..1fecc4e522 100644 --- a/packages/ethereum/package.json +++ b/packages/ethereum/package.json @@ -5,7 +5,8 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "lib/ethereum.js", + "main": "lib/index.js", + "typings": "lib/index.d.ts", "directories": { "lib": "lib", "test": "__tests__" @@ -21,8 +22,8 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "test": "echo \"Error: run tests from root\" && exit 1", - "tsc": "tsc" + "tsc": "ts-node ../../compile", + "test": "echo \"Error: run tests from root\" && exit 1" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/tezos/__tests__/tezos.test.js b/packages/tezos/__tests__/tezos.test.ts similarity index 100% rename from packages/tezos/__tests__/tezos.test.js rename to packages/tezos/__tests__/tezos.test.ts diff --git a/packages/tezos/package.json b/packages/tezos/package.json index 9f63dd7ac7..7928311c46 100644 --- a/packages/tezos/package.json +++ b/packages/tezos/package.json @@ -5,7 +5,8 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "lib/tezos.js", + "main": "lib/index.js", + "typings": "lib/index.d.ts", "directories": { "lib": "lib", "test": "__tests__" @@ -21,8 +22,8 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "test": "echo \"Error: run tests from root\" && exit 1", - "tsc": "tsc" + "tsc": "ts-node ../../compile", + "test": "echo \"Error: run tests from root\" && exit 1" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/utils/__tests__/utils.test.js b/packages/utils/__tests__/utils.test.ts similarity index 100% rename from packages/utils/__tests__/utils.test.js rename to packages/utils/__tests__/utils.test.ts diff --git a/packages/utils/package.json b/packages/utils/package.json index cd96e78b1f..ce631d498e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -5,7 +5,8 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "lib/utils.js", + "main": "lib/index.js", + "typings": "lib/index.d.ts", "directories": { "lib": "lib", "test": "__tests__" @@ -21,6 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { + "tsc": "ts-node ../../compile", "test": "echo \"Error: run tests from root\" && exit 1" }, "bugs": { From cd20f58eb57da332945cbb3323801a1c077b0083 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 17:39:00 -0400 Subject: [PATCH 169/691] Create a litte node script to create packages --- docs/README.md | 19 ++ package-lock.json => npm-shrinkwrap.json | 398 +++++++++++++++++++---- package.json | 9 +- packages/cli/package.json | 3 +- packages/core/package.json | 2 +- packages/ethereum/package.json | 3 +- packages/tezos/package.json | 3 +- packages/utils/package.json | 3 +- scripts/create.ts | 113 +++++++ 9 files changed, 478 insertions(+), 75 deletions(-) rename package-lock.json => npm-shrinkwrap.json (96%) create mode 100644 scripts/create.ts diff --git a/docs/README.md b/docs/README.md index cd5d50cea6..2181d279ad 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,6 +7,25 @@ * `npm install lerna -g` * `lerna bootstrap` +## To build + +Builds all packages: + +* `npm run tsc` + +## To test + +Runs all tests: + +* `npm test` + +## To create a new package + +* `npm run create [loc]` + +## To add a package to another package: + +* `lerna ` ## Code Conventions diff --git a/package-lock.json b/npm-shrinkwrap.json similarity index 96% rename from package-lock.json rename to npm-shrinkwrap.json index cafcc14f00..81c38cc97e 100644 --- a/package-lock.json +++ b/npm-shrinkwrap.json @@ -13,19 +13,19 @@ } }, "@babel/core": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", - "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.6.tgz", + "integrity": "sha512-nD3deLvbsApbHAHttzIssYqgb883yU/d9roe4RZymBCDaZryMJDbptVpEpeQuRh4BJ+SYI8le9YGxKvFEvl1Wg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.0", + "@babel/generator": "^7.9.6", "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.0", - "@babel/parser": "^7.9.0", + "@babel/helpers": "^7.9.6", + "@babel/parser": "^7.9.6", "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0", + "@babel/traverse": "^7.9.6", + "@babel/types": "^7.9.6", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -48,12 +48,12 @@ } }, "@babel/generator": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", - "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", + "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", "dev": true, "requires": { - "@babel/types": "^7.9.5", + "@babel/types": "^7.9.6", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -122,15 +122,15 @@ } }, "@babel/helper-replace-supers": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", - "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.9.6.tgz", + "integrity": "sha512-qX+chbxkbArLyCImk3bWV+jB5gTNU/rsze+JlcF6Nf8tVTigPJSI1o1oBow/9Resa1yehUO9lIipsmu9oG4RzA==", "dev": true, "requires": { "@babel/helper-member-expression-to-functions": "^7.8.3", "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.8.6", - "@babel/types": "^7.8.6" + "@babel/traverse": "^7.9.6", + "@babel/types": "^7.9.6" } }, "@babel/helper-simple-access": { @@ -159,14 +159,14 @@ "dev": true }, "@babel/helpers": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", - "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.6.tgz", + "integrity": "sha512-tI4bUbldloLcHWoRUMAj4g1bF313M/o6fBKhIsb3QnGVPwRm9JsNf/gqMkQ7zjqReABiffPV6RWj7hEglID5Iw==", "dev": true, "requires": { "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.0", - "@babel/types": "^7.9.0" + "@babel/traverse": "^7.9.6", + "@babel/types": "^7.9.6" } }, "@babel/highlight": { @@ -181,9 +181,9 @@ } }, "@babel/parser": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", - "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", "dev": true }, "@babel/template": { @@ -198,17 +198,17 @@ } }, "@babel/traverse": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", - "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", + "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", "dev": true, "requires": { "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.5", + "@babel/generator": "^7.9.6", "@babel/helper-function-name": "^7.9.5", "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.0", - "@babel/types": "^7.9.5", + "@babel/parser": "^7.9.6", + "@babel/types": "^7.9.6", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" @@ -226,9 +226,9 @@ } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.9.5", @@ -2102,6 +2102,15 @@ "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", "dev": true }, + "@types/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-UoOfVEzAUpeSPmjm7h1uk5MH6KZma2z2O7a75onTGjnNvAvMVrPzPL/vBbT65iIGHWj6rokwfmYcmxmlSf2uwg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/glob": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", @@ -2143,6 +2152,12 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==" }, + "@types/prettier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.0.tgz", + "integrity": "sha512-/rM+sWiuOZ5dvuVzV37sUuklsbg+JPOP8d+nNFlo2ZtfpzPiPvh1/gc8liWOLBqe+sR+ZM7guPaIcTt6UZTo7Q==", + "dev": true + }, "@types/secp256k1": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-3.5.0.tgz", @@ -2187,6 +2202,21 @@ "@types/node": "*" } }, + "@types/yargs": { + "version": "15.0.4", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.4.tgz", + "integrity": "sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", + "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", + "dev": true + }, "@yarnpkg/lockfile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", @@ -2469,6 +2499,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -4827,16 +4863,23 @@ "dev": true }, "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", + "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + }, + "dependencies": { + "universalify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", + "dev": true + } } }, "fs-minipass": { @@ -6271,12 +6314,21 @@ } }, "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", + "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", "dev": true, "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "^4.1.6", + "universalify": "^1.0.0" + }, + "dependencies": { + "universalify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", + "dev": true + } } }, "jsonparse": { @@ -7352,6 +7404,12 @@ "yargs-unparser": "1.6.0" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", @@ -7366,6 +7424,26 @@ "path-is-absolute": "^1.0.0" } }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -7374,6 +7452,24 @@ "requires": { "isexe": "^2.0.0" } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } } } }, @@ -9397,12 +9493,34 @@ "tmp": "0.0.33" }, "dependencies": { + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, "js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", "dev": true }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -10655,47 +10773,151 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", "dev": true, "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^3.0.0", + "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "yargs-parser": "^18.1.1" }, "dependencies": { "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } @@ -10719,6 +10941,52 @@ "flat": "^4.1.0", "lodash": "^4.17.15", "yargs": "^13.3.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + } } }, "yn": { diff --git a/package.json b/package.json index 2443e69eaa..7a429f2b4a 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "npm": ">=6.1.0" }, "scripts": { + "test": "lerna exec -- npm run test", + "create": "ts-node ./scripts/create", "postinstall": "patch-package" }, "dependencies": { @@ -34,15 +36,19 @@ }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "1.0.1", + "@types/fs-extra": "8.1.0", "@types/mocha": "7.0.2", "@types/node": "13.13.2", + "@types/prettier": "2.0.0", "@types/secp256k1": "3.5.0", "@types/seedrandom": "2.4.28", "@types/superagent": "4.1.7", "@types/uws": "0.13.2", "@types/ws": "7.2.4", + "@types/yargs": "15.0.4", "bufferutil": "4.0.1", "cross-env": "7.0.2", + "fs-extra": "9.0.0", "into-stream": "5.1.1", "lerna": "3.20.2", "mocha": "7.1.1", @@ -57,7 +63,8 @@ "tslint": "6.1.1", "typescript": "3.8.3", "utf-8-validate": "5.0.2", - "ws": "7.2.3" + "ws": "7.2.3", + "yargs": "15.3.1" }, "optionalDependencies": { "bigint-buffer": "1.1.5" diff --git a/packages/cli/package.json b/packages/cli/package.json index bf56c81a0a..e6d22e85ae 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -19,8 +19,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../compile", - "test": "echo \"Error: run tests from root\" && exit 1" + "tsc": "ts-node ../../compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/core/package.json b/packages/core/package.json index 7e3a945573..293ab77869 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -24,7 +24,7 @@ "scripts": { "tsc": "ts-node ../../compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks 'test/**.ts'" + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/ethereum/package.json b/packages/ethereum/package.json index 1fecc4e522..75a60f520d 100644 --- a/packages/ethereum/package.json +++ b/packages/ethereum/package.json @@ -22,8 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../compile", - "test": "echo \"Error: run tests from root\" && exit 1" + "tsc": "ts-node ../../compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/tezos/package.json b/packages/tezos/package.json index 7928311c46..eaa733ae65 100644 --- a/packages/tezos/package.json +++ b/packages/tezos/package.json @@ -22,8 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../compile", - "test": "echo \"Error: run tests from root\" && exit 1" + "tsc": "ts-node ../../compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/utils/package.json b/packages/utils/package.json index ce631d498e..5fa51523f5 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -22,8 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../compile", - "test": "echo \"Error: run tests from root\" && exit 1" + "tsc": "ts-node ../../compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/scripts/create.ts b/scripts/create.ts new file mode 100644 index 0000000000..11239c9608 --- /dev/null +++ b/scripts/create.ts @@ -0,0 +1,113 @@ +import {mkdir, mkdirSync, writeFile} from "fs-extra"; +import yargs from "yargs"; +import {join, resolve} from "path"; +import prettier from "prettier"; +import {version} from "../lerna.json"; + +const COLORS = { + FgGreen: "\x1b[32m", + Reset: "\x1b[0m", + FgRed: "\x1b[31m", + FgMagenta: "\x1b[35m" +}; + +const argv = yargs.command("$0 ", "Package Name").demandCommand().help().argv; + +(async function () { + const prettierConfig = await prettier.resolveConfig(process.cwd()); + const name = argv.name as string; + + const pkg = { + name: name, + version: version, + homepage: "https://github.com/trufflesuite/ganache-core#readme", + license: "MIT", + main: "lib/index.js", + typings: "lib/index.d.ts", + directories: { + lib: "lib", + test: "__tests__" + }, + files: ["lib"], + repository: { + type: "git", + url: "git+https://github.com/trufflesuite/ganache-core.git" + }, + scripts: { + tsc: "ts-node ../../compile", + test: "nyc npm run mocha -- --throw-deprecation --trace-warnings", + mocha: + "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" + }, + bugs: { + url: "https://github.com/trufflesuite/ganache-core/issues" + } + }; + + const shrinkwrap = { + name: name, + version: version, + lockfileVersion: 1 + }; + + const testFile = `import assert from "assert"; + +describe("interface", () => { + it("TODO", async () => { + assert.fail(\`TODO: write tests for package "${name.replace(/`/g, "-")}".\`); + }); +})`; + + const indexFile = `export default { + // TODO +} +`; + + const dir = join("./packages", name); + const tests = join(dir, "__tests__"); + const src = join(dir, "src"); + + function initSrc() { + return writeFile(join(src, "index.ts"), prettier.format(indexFile, {...prettierConfig, parser: "typescript"})); + } + + function initTests() { + return writeFile( + join(tests, "index.test.ts"), + prettier.format(testFile, {...prettierConfig, parser: "typescript"}) + ); + } + + const pkgStr = JSON.stringify(pkg, null, 2) + "\n"; + const pkgPath = join(dir, "package.json"); + + console.log(`About to write to ${resolve(__dirname, pkgPath)}`); + console.log(""); + + try { + mkdirSync(dir); + + await Promise.all([ + mkdir(tests).then(initTests), + mkdir(src).then(initSrc), + writeFile( + join(dir, "README.md"), + prettier.format(`# ${name}\n> TODO: description`, {...prettierConfig, parser: "markdown"}) + ), + writeFile(pkgPath, pkgStr), + writeFile(join(dir, "npm-shrinkwrap.json"), JSON.stringify(shrinkwrap) + "\n") + ]); + + console.log(pkgStr); + + console.log( + `${COLORS.FgGreen}success${COLORS.Reset} ${COLORS.FgMagenta}create${COLORS.Reset} New package ${name} created at ./packages/${name}` + ); + } catch (e) { + console.error(e); + console.log(""); + console.log( + `${COLORS.FgRed}fail${COLORS.Reset} ${COLORS.FgMagenta}create${COLORS.Reset} New package ${name} not created. See error above. ` + ); + } +})(); From 3d5f82a03bb4969b5d9fc05f4ac0328b6aae0ee8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 17:42:22 -0400 Subject: [PATCH 170/691] Change up the default `create` test text --- scripts/create.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/create.ts b/scripts/create.ts index 11239c9608..d02e45c808 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -52,8 +52,8 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a const testFile = `import assert from "assert"; -describe("interface", () => { - it("TODO", async () => { +describe("@ganache/${name}", () => { + it("needs tests", async () => { assert.fail(\`TODO: write tests for package "${name.replace(/`/g, "-")}".\`); }); })`; From f8d0b92532c60dfa8efc677030ba1aa726f701a1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 18:30:30 -0400 Subject: [PATCH 171/691] Tweak create process --- .npmrc | 2 + npm-shrinkwrap.json | 603 +++++++++++++++++-- package.json | 4 + packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/ethereum/__tests__/ethereum.test.ts | 7 - packages/ethereum/__tests__/index.test.ts | 5 + packages/ethereum/package.json | 2 +- packages/ethereum/src/ethereum.ts | 3 - packages/ethereum/src/index.ts | 3 + packages/tezos/package.json | 2 +- packages/utils/package.json | 2 +- compile.ts => scripts/compile.ts | 0 scripts/create.ts | 133 ++-- 14 files changed, 663 insertions(+), 107 deletions(-) delete mode 100644 packages/ethereum/__tests__/ethereum.test.ts create mode 100644 packages/ethereum/__tests__/index.test.ts delete mode 100644 packages/ethereum/src/ethereum.ts create mode 100644 packages/ethereum/src/index.ts rename compile.ts => scripts/compile.ts (100%) diff --git a/.npmrc b/.npmrc index b6f27f1359..682648b40b 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,3 @@ engine-strict=true +save-exact=true +sign-git-tag=true diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 81c38cc97e..1eb45cc3f3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -178,6 +178,28 @@ "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/parser": { @@ -264,6 +286,24 @@ "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, @@ -290,6 +330,18 @@ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -321,6 +373,24 @@ "requires": { "yallist": "^3.0.2" } + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, @@ -370,6 +440,18 @@ "yallist": "^3.0.2" } }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -399,6 +481,12 @@ "resolve-from": "^5.0.0" }, "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -468,6 +556,26 @@ "semver": "^6.2.0" }, "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "p-map": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", @@ -513,6 +621,26 @@ "semver": "^6.2.0" }, "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "p-map": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", @@ -559,6 +687,28 @@ "chalk": "^2.3.1", "execa": "^1.0.0", "strong-log-transformer": "^2.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@lerna/clean": { @@ -650,6 +800,14 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } } } } @@ -664,6 +822,28 @@ "chalk": "^2.3.1", "figgy-pudding": "^3.5.1", "npmlog": "^4.1.2" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@lerna/collect-updates": { @@ -736,6 +916,26 @@ "graceful-fs": "^4.1.6" } }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -770,6 +970,12 @@ "whatwg-url": "^7.0.0" }, "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -790,6 +996,26 @@ "graceful-fs": "^4.1.6" } }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -1122,6 +1348,28 @@ "@lerna/query-graph": "3.18.5", "chalk": "^2.3.1", "columnify": "^1.5.4" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@lerna/log-packed": { @@ -1157,6 +1405,26 @@ "figgy-pudding": "^3.5.1", "npm-package-arg": "^6.1.0", "npmlog": "^4.1.2" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "@lerna/npm-install": { @@ -1193,6 +1461,24 @@ "requires": { "graceful-fs": "^4.1.6" } + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, @@ -1232,6 +1518,24 @@ "requires": { "graceful-fs": "^4.1.6" } + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true } } }, @@ -1290,6 +1594,26 @@ "load-json-file": "^5.3.0", "npm-package-arg": "^6.1.0", "write-pkg": "^3.1.0" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "@lerna/package-graph": { @@ -1305,6 +1629,26 @@ "semver": "^6.2.0" }, "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -1466,6 +1810,26 @@ "graceful-fs": "^4.1.6" } }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "p-map": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", @@ -1724,6 +2088,17 @@ "write-json-file": "^3.2.0" }, "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "p-map": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", @@ -1735,6 +2110,15 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -2152,6 +2536,12 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==" }, + "@types/npm-package-arg": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@types/npm-package-arg/-/npm-package-arg-6.1.0.tgz", + "integrity": "sha512-vbt5fb0y1svMhu++1lwtKmZL76d0uPChFlw7kEzyUmTwfmpHRcFb8i0R8ElT69q/L+QLgK2hgECivIAvaEDwag==", + "dev": true + }, "@types/prettier": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.0.tgz", @@ -2916,9 +3306,9 @@ "dev": true }, "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", + "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", "dev": true }, "camelcase-keys": { @@ -2946,28 +3336,6 @@ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", @@ -5764,6 +6132,28 @@ "semver": "2.x || 3.x || 4 || 5", "validate-npm-package-license": "^3.0.1", "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + } } }, "inquirer": { @@ -5793,6 +6183,17 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -5801,6 +6202,15 @@ "requires": { "ansi-regex": "^4.1.0" } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -6814,6 +7224,28 @@ "dev": true, "requires": { "chalk": "^2.4.2" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "loud-rejection": { @@ -7742,21 +8174,38 @@ "dev": true }, "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.0.1.tgz", + "integrity": "sha512-/h5Fm6a/exByzFSTm7jAyHbgOqErl9qSNJDQF32Si/ZzgwT2TERVxRxn3Jurw1wflgyVVAxnFR4fRHPM7y1ClQ==", "dev": true, "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", + "hosted-git-info": "^3.0.2", + "semver": "^7.0.0", "validate-npm-package-name": "^3.0.0" }, "dependencies": { + "hosted-git-info": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.4.tgz", + "integrity": "sha512-4oT62d2jwSDBbLLFLZE+1vPuQ1h8p9wjrJ8Mqx5TjsyWmBMV5B13eJqn8pvluqubLf3cJPTfiYCIwNwDNmzScQ==", + "dev": true, + "requires": { + "lru-cache": "^5.1.1" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true } } @@ -7781,6 +8230,28 @@ "figgy-pudding": "^3.5.1", "npm-package-arg": "^6.0.0", "semver": "^5.4.1" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + } } }, "npm-run-path": { @@ -8007,6 +8478,14 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } } } } @@ -8341,6 +8820,17 @@ "tmp": "^0.0.33" }, "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -8401,6 +8891,15 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -10232,6 +10731,17 @@ "tsutils": "^2.29.0" }, "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -10243,6 +10753,15 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -10918,6 +11437,14 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } } } } @@ -10930,6 +11457,14 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } } }, "yargs-unparser": { diff --git a/package.json b/package.json index 7a429f2b4a..574eb20d0c 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "npm": ">=6.1.0" }, "scripts": { + "tsc": "lerna exec -- npm run tsc", "test": "lerna exec -- npm run test", "create": "ts-node ./scripts/create", "postinstall": "patch-package" @@ -39,6 +40,7 @@ "@types/fs-extra": "8.1.0", "@types/mocha": "7.0.2", "@types/node": "13.13.2", + "@types/npm-package-arg": "6.1.0", "@types/prettier": "2.0.0", "@types/secp256k1": "3.5.0", "@types/seedrandom": "2.4.28", @@ -47,11 +49,13 @@ "@types/ws": "7.2.4", "@types/yargs": "15.0.4", "bufferutil": "4.0.1", + "camelcase": "6.0.0", "cross-env": "7.0.2", "fs-extra": "9.0.0", "into-stream": "5.1.1", "lerna": "3.20.2", "mocha": "7.1.1", + "npm-package-arg": "8.0.1", "nyc": "15.0.1", "patch-package": "6.2.2", "prettier": "2.0.5", diff --git a/packages/cli/package.json b/packages/cli/package.json index e6d22e85ae..f0dda10d26 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -19,7 +19,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../compile" + "tsc": "ts-node ../../scripts/compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/core/package.json b/packages/core/package.json index 293ab77869..80274d758a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -22,7 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../compile", + "tsc": "ts-node ../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" }, diff --git a/packages/ethereum/__tests__/ethereum.test.ts b/packages/ethereum/__tests__/ethereum.test.ts deleted file mode 100644 index a061e5527b..0000000000 --- a/packages/ethereum/__tests__/ethereum.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const ethereum = require('..'); - -describe('@ganache/ethereum', () => { - it('needs tests'); -}); diff --git a/packages/ethereum/__tests__/index.test.ts b/packages/ethereum/__tests__/index.test.ts new file mode 100644 index 0000000000..9bb6ff417e --- /dev/null +++ b/packages/ethereum/__tests__/index.test.ts @@ -0,0 +1,5 @@ +import ethereum from "../src/"; + +describe("@ganache/ethereum", () => { + it("needs tests"); +}); diff --git a/packages/ethereum/package.json b/packages/ethereum/package.json index 75a60f520d..8eea927a61 100644 --- a/packages/ethereum/package.json +++ b/packages/ethereum/package.json @@ -22,7 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../compile" + "tsc": "ts-node ../../scripts/compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/ethereum/src/ethereum.ts b/packages/ethereum/src/ethereum.ts deleted file mode 100644 index aaf72d23dc..0000000000 --- a/packages/ethereum/src/ethereum.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default function ethereum() { - // TODO -} diff --git a/packages/ethereum/src/index.ts b/packages/ethereum/src/index.ts new file mode 100644 index 0000000000..808108c3a8 --- /dev/null +++ b/packages/ethereum/src/index.ts @@ -0,0 +1,3 @@ +export default { + // TODO +}; diff --git a/packages/tezos/package.json b/packages/tezos/package.json index eaa733ae65..f237fc1ccf 100644 --- a/packages/tezos/package.json +++ b/packages/tezos/package.json @@ -22,7 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../compile" + "tsc": "ts-node ../../scripts/compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/packages/utils/package.json b/packages/utils/package.json index 5fa51523f5..eb711acfda 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -22,7 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../compile" + "tsc": "ts-node ../../scripts/compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/compile.ts b/scripts/compile.ts similarity index 100% rename from compile.ts rename to scripts/compile.ts diff --git a/scripts/create.ts b/scripts/create.ts index d02e45c808..8e55dbaa84 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -3,54 +3,68 @@ import yargs from "yargs"; import {join, resolve} from "path"; import prettier from "prettier"; import {version} from "../lerna.json"; +import camelCase from "camelcase"; +import npa from "npm-package-arg"; const COLORS = { FgGreen: "\x1b[32m", Reset: "\x1b[0m", FgRed: "\x1b[31m", - FgMagenta: "\x1b[35m" + FgMagenta: "\x1b[35m", + BgBlack: "\x1b[40m" }; const argv = yargs.command("$0 ", "Package Name").demandCommand().help().argv; (async function () { - const prettierConfig = await prettier.resolveConfig(process.cwd()); - const name = argv.name as string; - - const pkg = { - name: name, - version: version, - homepage: "https://github.com/trufflesuite/ganache-core#readme", - license: "MIT", - main: "lib/index.js", - typings: "lib/index.d.ts", - directories: { - lib: "lib", - test: "__tests__" - }, - files: ["lib"], - repository: { - type: "git", - url: "git+https://github.com/trufflesuite/ganache-core.git" - }, - scripts: { - tsc: "ts-node ../../compile", - test: "nyc npm run mocha -- --throw-deprecation --trace-warnings", - mocha: - "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" - }, - bugs: { - url: "https://github.com/trufflesuite/ganache-core/issues" - } - }; - - const shrinkwrap = { - name: name, - version: version, - lockfileVersion: 1 - }; - - const testFile = `import assert from "assert"; + let name = argv.name as string; + try { + const prettierConfig = await prettier.resolveConfig(process.cwd()); + name = npa(argv.name as string).name; + + const pkg = { + name: name, + version: version, + homepage: "https://github.com/trufflesuite/ganache-core#readme", + license: "MIT", + main: "lib/index.js", + typings: "lib/index.d.ts", + directories: { + lib: "lib", + test: "__tests__" + }, + files: ["lib"], + repository: { + type: "git", + url: "git+https://github.com/trufflesuite/ganache-core.git" + }, + scripts: { + tsc: "ts-node ../../scripts/compile", + test: "nyc npm run mocha -- --throw-deprecation --trace-warnings", + mocha: + "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" + }, + bugs: { + url: "https://github.com/trufflesuite/ganache-core/issues" + } + }; + + const tsConfig = { + extends: "../../tsconfig.json", + compilerOptions: { + outDir: "lib" + }, + include: ["src"] + }; + + const shrinkwrap = { + name: name, + version: version, + lockfileVersion: 1 + }; + + const testFile = `import assert from "assert"; +import ${camelCase(name)} from "../src/"; describe("@ganache/${name}", () => { it("needs tests", async () => { @@ -58,38 +72,41 @@ describe("@ganache/${name}", () => { }); })`; - const indexFile = `export default { + const indexFile = `export default { // TODO } `; - const dir = join("./packages", name); - const tests = join(dir, "__tests__"); - const src = join(dir, "src"); + const dir = join("./packages", name); + const tests = join(dir, "__tests__"); + const src = join(dir, "src"); - function initSrc() { - return writeFile(join(src, "index.ts"), prettier.format(indexFile, {...prettierConfig, parser: "typescript"})); - } + function initSrc() { + return writeFile(join(src, "index.ts"), prettier.format(indexFile, {...prettierConfig, parser: "typescript"})); + } - function initTests() { - return writeFile( - join(tests, "index.test.ts"), - prettier.format(testFile, {...prettierConfig, parser: "typescript"}) - ); - } + function initTests() { + return writeFile( + join(tests, "index.test.ts"), + prettier.format(testFile, {...prettierConfig, parser: "typescript"}) + ); + } - const pkgStr = JSON.stringify(pkg, null, 2) + "\n"; - const pkgPath = join(dir, "package.json"); + const pkgStr = JSON.stringify(pkg, null, 2) + "\n"; + const pkgPath = join(dir, "package.json"); - console.log(`About to write to ${resolve(__dirname, pkgPath)}`); - console.log(""); + console.log(`About to write to ${resolve(__dirname, pkgPath)}`); + console.log(""); - try { mkdirSync(dir); await Promise.all([ mkdir(tests).then(initTests), mkdir(src).then(initSrc), + writeFile( + join(dir, "tsconfig.json"), + JSON.stringify(tsConfig, null, 2) + "\n" + ), writeFile( join(dir, "README.md"), prettier.format(`# ${name}\n> TODO: description`, {...prettierConfig, parser: "markdown"}) @@ -101,13 +118,13 @@ describe("@ganache/${name}", () => { console.log(pkgStr); console.log( - `${COLORS.FgGreen}success${COLORS.Reset} ${COLORS.FgMagenta}create${COLORS.Reset} New package ${name} created at ./packages/${name}` + `${COLORS.FgGreen}success${COLORS.Reset} ${COLORS.FgMagenta}create${COLORS.Reset} New package ${COLORS.BgBlack}${name}${COLORS.Reset} created at ./packages/${name}.` ); } catch (e) { console.error(e); console.log(""); console.log( - `${COLORS.FgRed}fail${COLORS.Reset} ${COLORS.FgMagenta}create${COLORS.Reset} New package ${name} not created. See error above. ` + `${COLORS.FgRed}fail${COLORS.Reset} ${COLORS.FgMagenta}create${COLORS.Reset} New package ${COLORS.BgBlack}${name}${COLORS.Reset} not created. See error above.` ); } })(); From aff4e5b2ac3049b0961ace8fb50b70684f3c8daa Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 18:39:05 -0400 Subject: [PATCH 172/691] Add some more docs --- docs/README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index 2181d279ad..afbe1a130e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -21,11 +21,20 @@ Runs all tests: ## To create a new package -* `npm run create [loc]` +* `npm run create ` -## To add a package to another package: +This will create a new package with Ganache defaults at `packages/`. -* `lerna ` +## To add a module to a package: + +* `lerna add [@version] [--dev] [--peer] --scope=` + +Where `` is the npm-module you want to add and `` is where you +want to add it. See [@lerna/add documentation](https://github.com/lerna/lerna/tree/master/commands/add) for more details. + +## To remove a module from another package: + +`cd` to the package and then run `npm uninstall ` ## Code Conventions From ee268b403d8cd46ca5f6bb7678abea5e008cefe9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 18:46:54 -0400 Subject: [PATCH 173/691] WebSocket test is hanging on Travis+Windows Try to fix --- packages/core/__tests__/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/__tests__/server.ts b/packages/core/__tests__/server.ts index 9a22779e21..ef7a257cde 100644 --- a/packages/core/__tests__/server.ts +++ b/packages/core/__tests__/server.ts @@ -140,7 +140,7 @@ describe("server", () => { ws: false } as ServerOptions); try { - const ws = new WebSocket("ws://localhost:" + port); + const ws = new WebSocket("ws://localhost:" + port, {handshakeTimeout: 500}); await assert.rejects(new Promise((_, reject) => ws.on("error", reject)), { message: "Unexpected server response: 400" From a9799ec96d7fc5f58610e8928aed780ba5c42b0e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 19:29:35 -0400 Subject: [PATCH 174/691] Remove pointless test --- packages/core/__tests__/provider.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/core/__tests__/provider.ts b/packages/core/__tests__/provider.ts index 877024d141..e5aca5b409 100644 --- a/packages/core/__tests__/provider.ts +++ b/packages/core/__tests__/provider.ts @@ -39,10 +39,6 @@ describe("provider", () => { }); }).timeout(500); - it("it logs with options.verbose", async () => { - assert.doesNotThrow(() => Ganache.provider()); - }); - it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { const p = Ganache.provider() as EthereumProvider; const accounts = await p.send("eth_accounts"); From 3f997f534e36011668c901897cda82dc8b0a4fbf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Apr 2020 19:29:45 -0400 Subject: [PATCH 175/691] Try this to fix the windows test --- packages/core/__tests__/server.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/core/__tests__/server.ts b/packages/core/__tests__/server.ts index ef7a257cde..60d1f33f52 100644 --- a/packages/core/__tests__/server.ts +++ b/packages/core/__tests__/server.ts @@ -140,11 +140,17 @@ describe("server", () => { ws: false } as ServerOptions); try { - const ws = new WebSocket("ws://localhost:" + port, {handshakeTimeout: 500}); - - await assert.rejects(new Promise((_, reject) => ws.on("error", reject)), { - message: "Unexpected server response: 400" - }); + const ws = new WebSocket("ws://localhost:" + port); + + await assert.rejects( + new Promise((resolve, reject) => { + ws.on("open", resolve); + ws.on("error", reject); + }), + { + message: "Unexpected server response: 400" + } + ); } finally { await teardown(); } From 61e34bbc6540f7316330ddb106639f7befcb7cc3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 14:48:38 -0400 Subject: [PATCH 176/691] Fix some server stuff --- packages/core/__tests__/server.ts | 75 +++++++++++++++--------- packages/core/src/server.ts | 95 +++++++++++++++++++++---------- 2 files changed, 113 insertions(+), 57 deletions(-) diff --git a/packages/core/__tests__/server.ts b/packages/core/__tests__/server.ts index 60d1f33f52..e71cbf34d4 100644 --- a/packages/core/__tests__/server.ts +++ b/packages/core/__tests__/server.ts @@ -2,11 +2,13 @@ import Ganache from "../src/"; import * as assert from "assert"; import request from "superagent"; import WebSocket from "ws"; -import Server, {Status} from "../src/server"; +import Server, { Status } from "../src/server"; import ServerOptions from "../src/options/server-options"; import http from "http"; import intoStream from "into-stream"; +const IS_WINDOWS = process.platform === "win32" + describe("server", () => { const port = 5234; const network_id = "1234"; @@ -17,7 +19,7 @@ describe("server", () => { params: [] }; const logger = { - log: (_message: string) => {} + log: (_message: string) => { } }; let s: Server; async function setup( @@ -30,7 +32,9 @@ describe("server", () => { return s.listen(port); } async function teardown() { - s && (await s.close()); + if (s && (s.status & Status.open)) { + await s.close(); + } s = undefined; } describe("http", () => { @@ -45,15 +49,27 @@ describe("server", () => { it("returns its status", async () => { const s = Ganache.server(); - assert.strictEqual(s.status & Status.closed, Status.closed); - const pendingListen = s.listen(port); - assert.strictEqual(s.status & Status.opening, Status.opening); - await pendingListen; - assert.strictEqual(s.status & Status.open, Status.open); - const pendingClose = s.close(); - assert.strictEqual(s.status & Status.closing, Status.closing); - await pendingClose; - assert.strictEqual(s.status & Status.closed, Status.closed); + try { + assert.strictEqual(s.status, Status.closed); + const pendingListen = s.listen(port); + assert.strictEqual(s.status, Status.opening); + assert.ok(s.status & Status.opening, "Bitmask broken: can't be used to determine `open || closed` state"); + await pendingListen; + assert.strictEqual(s.status, Status.open); + assert.ok(s.status & Status.open, "Bitmask broken: can't be used to determine `open || closed` state"); + const pendingClose = s.close(); + assert.strictEqual(s.status, Status.closing); + assert.ok(s.status & Status.closing, "Bitmask broken: can't be used to determine `closed || closing` state"); + await pendingClose; + assert.strictEqual(s.status, Status.closed); + assert.ok(s.status & Status.closed, "Bitmask broken: can't be used to determine `closed || closing` state"); + } catch (e) { + // in case of failure, make sure we properly shut things down + if (s.status & Status.open) { + await s.close().catch(e => e); + } + throw e; + } }); it("returns the net_version", async () => { @@ -85,7 +101,7 @@ describe("server", () => { // the call to `setup()` above calls `listen()` already. if we call it // again it should fail. await assert.rejects(s.listen(port), { - message: `Server is already listening on port: ${port}` + message: `Server is already open on port: ${port}.` }); } finally { await teardown(); @@ -98,7 +114,7 @@ describe("server", () => { // the call to `setup()` above calls `listen()` already. if we call it // again it should fail. s.listen(port, err => { - assert.strict(err.message, `Server is already listening on port: ${port}`); + assert.strict(err.message, `Server is already listening on port: ${port}.`); }); } finally { await teardown(); @@ -111,25 +127,29 @@ describe("server", () => { try { await assert.rejects(setup, { - message: `Failed to listen on port: ${port}` + message: `Failed to listen on port: ${port}.` }); } finally { await teardown(); - await server.close(); + server.close(); } }); - // TODO: un-skip this test once uWebsockets is updated to include seese's fix - it("fails to listen if the socket is already in use by Ganache", async () => { + // skip on Windows until https://github.com/uNetworking/uSockets/pull/101 is merged + (IS_WINDOWS ? xit : it)("fails to listen if the socket is already in use by Ganache", async () => { await setup(); const s2 = Ganache.server(); try { await assert.rejects(s2.listen(port), { - message: `Failed to listen on port: ${port}` + message: `Failed to listen on port: ${port}.` }); } catch (e) { - console.log(e); + // in case of failure, make sure we properly shut things down + if (s2.status & Status.open) { + await s2.close().catch(e => e); + } + throw e; } finally { await teardown(); } @@ -227,7 +247,7 @@ describe("server", () => { try { const requests = methods.map(async method => { const result = await (request as any) - [method]("http://localhost:" + port + "/there-is-no-spoon") + [method]("http://localhost:" + port + "/there-is-no-spoon") .catch((e: any) => e); assert.strictEqual(result.status, 404); assert.strictEqual(result.message, "Not Found"); @@ -288,7 +308,8 @@ describe("server", () => { } finally { await teardown(); } - }); + // On Windows it takes over 2 seconds for req.send to finally fail! + }).timeout(4000); describe("CORS", () => { const optionsHeaders = ["Access-Control-Allow-Methods", "Access-Control-Allow-Headers", "Access-Control-Max-Age"]; @@ -451,11 +472,13 @@ describe("server", () => { }); }); - it("can handle backpressure", async () => { + // I can't get backpressure working on Windows. It's not super important because we + // don't actually handle backpressure anyway. + (IS_WINDOWS ? xit : it)("can handle backpressure", async () => { { // create tons of data to force websocket backpressure const huge = {} as any; - for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; + for (let i = 0; i < 1e6; i++) huge["prop_" + i] = { i, j: i }; (s.provider as any).request = async () => { return huge; }; @@ -480,8 +503,8 @@ describe("server", () => { reject( new Error( "Possible false positive: Didn't detect backpressure " + - " before receiving a message. Ensure `s.provider.send` is" + - " sending enough data." + " before receiving a message. Ensure `s.provider.send` is" + + " sending enough data." ) ); } diff --git a/packages/core/src/server.ts b/packages/core/src/server.ts index a3b256bca7..1ad1544081 100644 --- a/packages/core/src/server.ts +++ b/packages/core/src/server.ts @@ -6,11 +6,35 @@ import WebsocketServer from "./servers/ws-server"; import HttpServer from "./servers/http-server"; import {Flavors} from "./options/provider-options"; +type Callback = (err: Error) => void + +/** + * Server ready state constants. + * + * These are bit flags. This means that you can check if the status is: + * * open: `status === Status.open` + * * opening: `status === Status.opening` + * * open || opening: `status & Status.open !== 0` or `status & Status.opening !== 0` + * * closed: `status === Status.closed` + * * closing: `status === Status.closing` + * * open || closing: `status & Status.closed !== 0` or `status & Status.closing !== 0` + */ export enum Status { - // These are bit flags + /** + * The connection is open and ready to communicate. + */ open = 1, + /** + * The connection is not yet open. + */ opening = 3, + /** + * The connection is closed. + */ closed = 4, + /** + * The connection is in the process of closing. + */ closing = 12 } @@ -43,46 +67,55 @@ export default class Server { this.#httpServer = new HttpServer(_app, connector); } - async listen(port: number, callback?: (err: Error) => void): Promise { + listen(port: number): Promise; + listen(port: number, callback: Callback): void; + listen(port: number, callback?: Callback): void | Promise { const callbackIsFunction = typeof callback === "function"; - let err: Error; - // if open or opening - if (this.#status & Status.open) { - err = new Error(`Server is already listening on port: ${port}`); - // ensure sure we don't call the `callback` in the current event loop, otherwise an error in the callback would - // bubble back up into this function. This is a problem here because we aren't awaiting anything - if (callbackIsFunction) { - const originalCallback = callback; - callback = (err: Error) => process.nextTick(originalCallback, err); - } - } else { - this.#status = Status.opening; - const _listenSocket = await new Promise(resolve => { - // Make sure we have *exclusive* use of this port. - // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 - const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); - }); - - if (_listenSocket) { + const status = this.#status; + if (status === Status.closing) { + // if closing + const err = new Error(`Cannot start server while it is closing.`); + return callbackIsFunction ? process.nextTick(callback, err) : Promise.reject(err); + } else if (status & Status.open) { + // if open or opening + const err = new Error(`Server is already open on port: ${port}.`); + return callbackIsFunction ? process.nextTick(callback, err) : Promise.reject(err); + } + + this.#status = Status.opening; + + const promise = new Promise(resolve => { + // Make sure we have *exclusive* use of this port. + // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 + const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; + this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + }).then(listenSocket => { + if (listenSocket) { this.#status = Status.open; - this.#listenSocket = _listenSocket; - err = null; + this.#listenSocket = listenSocket; + if (callbackIsFunction) callback(null); } else { this.#status = Status.closed; - err = new Error("Failed to listen on port: " + port); + const err = new Error(`Failed to listen on port: ${port}.`); + if (callbackIsFunction) callback(err); + else throw err; } - } + }); - // support legacy callback style - if (callbackIsFunction) { - callback(err); - } else if (err) { - throw err; + if (!callbackIsFunction) { + return promise; } } public async close() { + if (this.#status === Status.opening) { + // if closed or closing + throw new Error(`Cannot close server while it is opening.`); + } else if (this.#status & Status.closed) { + // if closed or closing + throw new Error(`Server is already closed or closing.`); + } + const _listenSocket = this.#listenSocket; this.#status = Status.closing; if (_listenSocket) { From 44373185dca1548066de63faa266aed3c276dae7 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 14:50:16 -0400 Subject: [PATCH 177/691] Mocha's `it` is "pending" without a callback --- scripts/create.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/create.ts b/scripts/create.ts index 8e55dbaa84..574714f120 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -67,9 +67,7 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a import ${camelCase(name)} from "../src/"; describe("@ganache/${name}", () => { - it("needs tests", async () => { - assert.fail(\`TODO: write tests for package "${name.replace(/`/g, "-")}".\`); - }); + it("needs tests"); })`; const indexFile = `export default { From c90aa04f2976c70ba82905a4eec17c33182d54c6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 14:57:50 -0400 Subject: [PATCH 178/691] Move ethereum stuff to the ethereum package --- packages/core/__tests__/ledger.ts | 2 +- packages/core/__tests__/provider.ts | 2 +- packages/core/__tests__/temp-tests.ts | 2 +- packages/core/src/connector.ts | 2 +- packages/core/src/ledgers/ethereum/index.ts | 35 ----------------- packages/core/src/options/provider-options.ts | 2 +- .../core/src/things/transaction-receipt.ts | 2 +- packages/core/src/things/transaction.ts | 2 +- .../ledgers/ethereum => ethereum/src}/api.ts | 12 +++--- .../ethereum => ethereum/src}/blockchain.ts | 10 ++--- .../src}/components/account-manager.ts | 6 +-- .../src}/components/block-manager.ts | 6 +-- .../src}/components/manager.ts | 2 +- .../src}/components/transaction-manager.ts | 2 +- .../src}/components/transaction-pool.ts | 6 +-- .../ethereum => ethereum/src}/database.ts | 0 packages/ethereum/src/index.ts | 38 +++++++++++++++++-- .../ethereum => ethereum/src}/miner.ts | 8 ++-- .../ethereum => ethereum/src}/options.ts | 4 +- .../ethereum => ethereum/src}/provider.ts | 14 +++---- .../ethereum => ethereum/src}/wallet.ts | 6 +-- 21 files changed, 80 insertions(+), 83 deletions(-) delete mode 100644 packages/core/src/ledgers/ethereum/index.ts rename packages/{core/src/ledgers/ethereum => ethereum/src}/api.ts (97%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/blockchain.ts (96%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/components/account-manager.ts (83%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/components/block-manager.ts (96%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/components/manager.ts (94%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/components/transaction-manager.ts (92%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/components/transaction-pool.ts (97%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/database.ts (100%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/miner.ts (97%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/options.ts (73%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/provider.ts (93%) rename packages/{core/src/ledgers/ethereum => ethereum/src}/wallet.ts (94%) diff --git a/packages/core/__tests__/ledger.ts b/packages/core/__tests__/ledger.ts index 92edf812ab..b4086b2151 100644 --- a/packages/core/__tests__/ledger.ts +++ b/packages/core/__tests__/ledger.ts @@ -1,7 +1,7 @@ import assert from "assert"; import GetProvider from "./helpers/getProvider"; import sleep from "./helpers/sleep"; -import EthereumProvider from "../src/ledgers/ethereum/provider"; +import EthereumProvider from "../../ethereum/src/provider"; describe("ledger", () => { let provider: any; diff --git a/packages/core/__tests__/provider.ts b/packages/core/__tests__/provider.ts index e5aca5b409..5133a78097 100644 --- a/packages/core/__tests__/provider.ts +++ b/packages/core/__tests__/provider.ts @@ -1,6 +1,6 @@ import Ganache from "../src/"; import assert from "assert"; -import EthereumProvider from "../src/ledgers/ethereum/provider"; +import EthereumProvider from "../../ethereum/src/provider"; describe("provider", () => { const networkId = "1234"; diff --git a/packages/core/__tests__/temp-tests.ts b/packages/core/__tests__/temp-tests.ts index 5349b19212..1445f4d1bc 100644 --- a/packages/core/__tests__/temp-tests.ts +++ b/packages/core/__tests__/temp-tests.ts @@ -1,7 +1,7 @@ import Ganache from "../src"; import assert from "assert"; import {Quantity} from "../src/things/json-rpc"; -import EthereumProvider from "../src/ledgers/ethereum/provider"; +import EthereumProvider from "../../ethereum/src/provider"; const solc = require("solc"); function compileSolidity(source: string) { diff --git a/packages/core/src/connector.ts b/packages/core/src/connector.ts index 8e858227e7..aaad9cf1a2 100644 --- a/packages/core/src/connector.ts +++ b/packages/core/src/connector.ts @@ -2,7 +2,7 @@ import Executor from "./utils/executor"; import RequestCoordinator from "./utils/request-coordinator"; import ProviderOptions, {FlavorMap, Apis} from "./options/provider-options"; import Emittery from "emittery"; -import EthereumProvider from "./ledgers/ethereum/provider"; +import EthereumProvider from "../../ethereum/src/provider"; import {Provider} from "./interfaces/provider"; export default class Connector { diff --git a/packages/core/src/ledgers/ethereum/index.ts b/packages/core/src/ledgers/ethereum/index.ts deleted file mode 100644 index 3d50992d4a..0000000000 --- a/packages/core/src/ledgers/ethereum/index.ts +++ /dev/null @@ -1,35 +0,0 @@ -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "../../options/provider-options"; -import Emittery from "emittery"; -import EthereumApi from "./api"; -import JsonRpc from "../../servers/utils/jsonrpc"; -import Connector from "../../interfaces/connector"; -import {RequestType} from "../../types"; -import EthereumProvider from "./provider"; -import {RecognizedString} from "uWebSockets.js"; - -export default class EthereumConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> - implements Connector> { - #provider: EthereumProvider; - get provider() { - return this.#provider; - } - - constructor(providerOptions?: ProviderOptions) { - super(); - - this.#provider = new EthereumProvider(providerOptions); - } - - parse(message: Buffer) { - return JSON.parse(message as any) as JsonRpc.Request; - } - - handle(payload: JsonRpc.Request): Promise { - return this.#provider.request(payload.method, payload.params); - } - - format(result: any, payload: JsonRpc.Request): RecognizedString { - const json = JsonRpc.Response(payload.id, result); - return JSON.stringify(json); - } -} diff --git a/packages/core/src/options/provider-options.ts b/packages/core/src/options/provider-options.ts index d6c67d6de7..8c115eaf9c 100644 --- a/packages/core/src/options/provider-options.ts +++ b/packages/core/src/options/provider-options.ts @@ -1,6 +1,6 @@ import Options, {getDefault as getDefaultOptions} from "./options"; import TezosConnector from "../ledgers/tezos"; -import EthereumConnector from "../ledgers/ethereum"; +import EthereumConnector from "../../../ethereum/src"; import {entropyToMnemonic} from "bip39"; import seedrandom, {seedrandom_prng} from "seedrandom"; import Connector from "../interfaces/connector"; diff --git a/packages/core/src/things/transaction-receipt.ts b/packages/core/src/things/transaction-receipt.ts index e1ed8aa785..7a8a700ecc 100644 --- a/packages/core/src/things/transaction-receipt.ts +++ b/packages/core/src/things/transaction-receipt.ts @@ -1,5 +1,5 @@ import Transaction from "./transaction"; -import {Block} from "../ledgers/ethereum/components/block-manager"; +import {Block} from "../../../ethereum/src/components/block-manager"; import {encode as rlpEncode, decode as rlpDecode} from "rlp"; import {Data, Quantity} from "./json-rpc"; diff --git a/packages/core/src/things/transaction.ts b/packages/core/src/things/transaction.ts index 285600e4d2..a090b3b6e9 100644 --- a/packages/core/src/things/transaction.ts +++ b/packages/core/src/things/transaction.ts @@ -7,7 +7,7 @@ import * as ethUtil from "ethereumjs-util"; import assert from "assert"; import {decode as rlpDecode} from "rlp"; import {RunTxResult} from "ethereumjs-vm/dist/runTx"; -import {Block} from "../ledgers/ethereum/components/block-manager"; +import {Block} from "../../../ethereum/src/components/block-manager"; import TransactionReceipt from "./transaction-receipt"; const MAX_UINT64 = (1n << 64n) - 1n; diff --git a/packages/core/src/ledgers/ethereum/api.ts b/packages/ethereum/src/api.ts similarity index 97% rename from packages/core/src/ledgers/ethereum/api.ts rename to packages/ethereum/src/api.ts index 6dab0b1df1..54ce8b5374 100644 --- a/packages/core/src/ledgers/ethereum/api.ts +++ b/packages/ethereum/src/api.ts @@ -1,11 +1,11 @@ //#region Imports -import Api, { Emitter } from "../../interfaces/api"; +import Api, { Emitter } from "../../core/src/interfaces/api"; import EthereumOptions from "./options"; -import {Data, Quantity} from "../../things/json-rpc"; +import {Data, Quantity} from "../../core/src/things/json-rpc"; import Blockchain from "./blockchain"; -import Tag from "../../things/tags"; -import Address, {IndexableAddress} from "../../things/address"; -import Transaction from "../../things/transaction"; +import Tag from "../../core/src/things/tags"; +import Address, {IndexableAddress} from "../../core/src/things/address"; +import Transaction from "../../core/src/things/transaction"; import {Block} from "./components/block-manager"; import Wallet from "./wallet"; import Account from "ethereumjs-account"; @@ -13,7 +13,7 @@ import {decode as rlpDecode} from "rlp"; const createKeccakHash = require("keccak"); // Read in the current ganache version from the package.json -import {name, version} from "../../../package.json"; +import {name, version} from "../../core/package.json"; //#endregion //#region Constants diff --git a/packages/core/src/ledgers/ethereum/blockchain.ts b/packages/ethereum/src/blockchain.ts similarity index 96% rename from packages/core/src/ledgers/ethereum/blockchain.ts rename to packages/ethereum/src/blockchain.ts index 31fabdac6f..a67adbaf47 100644 --- a/packages/core/src/ledgers/ethereum/blockchain.ts +++ b/packages/ethereum/src/blockchain.ts @@ -5,15 +5,15 @@ import BlockManager, {Block} from "./components/block-manager"; import TransactionManager from "./components/transaction-manager"; import Trie from "merkle-patricia-tree"; import {BN} from "ethereumjs-util"; -import Account from "../../things/account"; +import Account from "../../core/src/things/account"; import {promisify} from "util"; -import {Quantity, Data} from "../../things/json-rpc"; +import {Quantity, Data} from "../../core/src/things/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; -import Heap from "../../utils/heap"; -import Transaction from "../../things/transaction"; +import Heap from "../../core/src/utils/heap"; +import Transaction from "../../core/src/things/transaction"; import Manager from "./components/manager"; -import TransactionReceipt from "../../things/transaction-receipt"; +import TransactionReceipt from "../../core/src/things/transaction-receipt"; import {encode as rlpEncode} from "rlp"; import Common from "ethereumjs-common"; diff --git a/packages/core/src/ledgers/ethereum/components/account-manager.ts b/packages/ethereum/src/components/account-manager.ts similarity index 83% rename from packages/core/src/ledgers/ethereum/components/account-manager.ts rename to packages/ethereum/src/components/account-manager.ts index 7dd186d071..eff96c3cc1 100644 --- a/packages/core/src/ledgers/ethereum/components/account-manager.ts +++ b/packages/ethereum/src/components/account-manager.ts @@ -1,8 +1,8 @@ -import Account from "../../../things/account"; -import Address from "../../../things/address"; +import Account from "../../../core/src/things/account"; +import Address from "../../../core/src/things/address"; import Trie from "merkle-patricia-tree/baseTrie"; import Blockchain from "../blockchain"; -import Tag from "../../../things/tags"; +import Tag from "../../../core/src/things/tags"; import {LevelUp} from "levelup"; export default class AccountManager { diff --git a/packages/core/src/ledgers/ethereum/components/block-manager.ts b/packages/ethereum/src/components/block-manager.ts similarity index 96% rename from packages/core/src/ledgers/ethereum/components/block-manager.ts rename to packages/ethereum/src/components/block-manager.ts index 428c530f1f..733f3a0555 100644 --- a/packages/core/src/ledgers/ethereum/components/block-manager.ts +++ b/packages/ethereum/src/components/block-manager.ts @@ -1,10 +1,10 @@ import EthereumJsBlock from "ethereumjs-block"; import Manager from "./manager"; -import Tag from "../../../things/tags"; +import Tag from "../../../core/src/things/tags"; import levelup from "levelup"; import Blockchain from "../blockchain"; -import {Quantity, Data} from "../../../things/json-rpc"; -import Transaction from "../../../things/transaction"; +import {Quantity, Data} from "../../../core/src/things/json-rpc"; +import Transaction from "../../../core/src/things/transaction"; import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; diff --git a/packages/core/src/ledgers/ethereum/components/manager.ts b/packages/ethereum/src/components/manager.ts similarity index 94% rename from packages/core/src/ledgers/ethereum/components/manager.ts rename to packages/ethereum/src/components/manager.ts index 78aea20dcb..a12d32ec1b 100644 --- a/packages/core/src/ledgers/ethereum/components/manager.ts +++ b/packages/ethereum/src/components/manager.ts @@ -1,5 +1,5 @@ import levelup from "levelup"; -import {Data} from "../../../things/json-rpc"; +import {Data} from "../../../core/src/things/json-rpc"; import Blockchain from "../blockchain"; const NOTFOUND = 404; diff --git a/packages/core/src/ledgers/ethereum/components/transaction-manager.ts b/packages/ethereum/src/components/transaction-manager.ts similarity index 92% rename from packages/core/src/ledgers/ethereum/components/transaction-manager.ts rename to packages/ethereum/src/components/transaction-manager.ts index 63929b8204..7be0061fc8 100644 --- a/packages/core/src/ledgers/ethereum/components/transaction-manager.ts +++ b/packages/ethereum/src/components/transaction-manager.ts @@ -1,4 +1,4 @@ -import Transaction from "../../../things/transaction"; +import Transaction from "../../../core/src/things/transaction"; import Manager from "./manager"; import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; import levelup from "levelup"; diff --git a/packages/core/src/ledgers/ethereum/components/transaction-pool.ts b/packages/ethereum/src/components/transaction-pool.ts similarity index 97% rename from packages/core/src/ledgers/ethereum/components/transaction-pool.ts rename to packages/ethereum/src/components/transaction-pool.ts index bff947719e..8672305b89 100644 --- a/packages/core/src/ledgers/ethereum/components/transaction-pool.ts +++ b/packages/ethereum/src/components/transaction-pool.ts @@ -1,8 +1,8 @@ import Emittery from "emittery"; import Blockchain from "../blockchain"; -import Heap from "../../../utils/heap"; -import Transaction from "../../../things/transaction"; -import {Data, Quantity} from "../../../things/json-rpc"; +import Heap from "../../../core/src/utils/heap"; +import Transaction from "../../../core/src/things/transaction"; +import {Data, Quantity} from "../../../core/src/things/json-rpc"; export type TransactionPoolOptions = { /** diff --git a/packages/core/src/ledgers/ethereum/database.ts b/packages/ethereum/src/database.ts similarity index 100% rename from packages/core/src/ledgers/ethereum/database.ts rename to packages/ethereum/src/database.ts diff --git a/packages/ethereum/src/index.ts b/packages/ethereum/src/index.ts index 808108c3a8..2bae804b7f 100644 --- a/packages/ethereum/src/index.ts +++ b/packages/ethereum/src/index.ts @@ -1,3 +1,35 @@ -export default { - // TODO -}; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "../../core/src/options/provider-options"; +import Emittery from "emittery"; +import EthereumApi from "./api"; +import JsonRpc from "../../core/src/servers/utils/jsonrpc"; +import Connector from "../../core/src/interfaces/connector"; +import {RequestType} from "../../core/src/types"; +import EthereumProvider from "./provider"; +import {RecognizedString} from "uWebSockets.js"; + +export default class EthereumConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> + implements Connector> { + #provider: EthereumProvider; + get provider() { + return this.#provider; + } + + constructor(providerOptions?: ProviderOptions) { + super(); + + this.#provider = new EthereumProvider(providerOptions); + } + + parse(message: Buffer) { + return JSON.parse(message as any) as JsonRpc.Request; + } + + handle(payload: JsonRpc.Request): Promise { + return this.#provider.request(payload.method, payload.params); + } + + format(result: any, payload: JsonRpc.Request): RecognizedString { + const json = JsonRpc.Response(payload.id, result); + return JSON.stringify(json); + } +} diff --git a/packages/core/src/ledgers/ethereum/miner.ts b/packages/ethereum/src/miner.ts similarity index 97% rename from packages/core/src/ledgers/ethereum/miner.ts rename to packages/ethereum/src/miner.ts index 73c738d069..e68951dfe8 100644 --- a/packages/core/src/ledgers/ethereum/miner.ts +++ b/packages/ethereum/src/miner.ts @@ -1,7 +1,7 @@ -import params from "../../things/params"; -import Heap from "../../utils/heap"; -import Transaction from "../../things/transaction"; -import {Quantity, Data} from "../../things/json-rpc"; +import params from "../../core/src/things/params"; +import Heap from "../../core/src/utils/heap"; +import Transaction from "../../core/src/things/transaction"; +import {Quantity, Data} from "../../core/src/things/json-rpc"; import {promisify} from "util"; import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; diff --git a/packages/core/src/ledgers/ethereum/options.ts b/packages/ethereum/src/options.ts similarity index 73% rename from packages/core/src/ledgers/ethereum/options.ts rename to packages/ethereum/src/options.ts index 22482da0b9..f4e7c6dd74 100644 --- a/packages/core/src/ledgers/ethereum/options.ts +++ b/packages/ethereum/src/options.ts @@ -1,5 +1,5 @@ -import Options from "../../options/provider-options"; -import Account from "../../things/account"; +import Options from "../../core/src/options/provider-options"; +import Account from "../../core/src/things/account"; type EthereumOptions = Pick< Options, diff --git a/packages/core/src/ledgers/ethereum/provider.ts b/packages/ethereum/src/provider.ts similarity index 93% rename from packages/core/src/ledgers/ethereum/provider.ts rename to packages/ethereum/src/provider.ts index ed0ae77c2d..9113f4867f 100644 --- a/packages/core/src/ledgers/ethereum/provider.ts +++ b/packages/ethereum/src/provider.ts @@ -1,18 +1,18 @@ -import {Quantity, Data} from "../../things/json-rpc"; -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "../../options/provider-options"; +import {Quantity, Data} from "../../core/src/things/json-rpc"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "../../core/src/options/provider-options"; import Emittery from "emittery"; import EthereumApi from "./api"; import {publicToAddress, privateToAddress} from "ethereumjs-util"; -import Account from "../../things/account"; +import Account from "../../core/src/things/account"; import {mnemonicToSeedSync} from "bip39"; -import Address from "../../things/address"; -import JsonRpc from "../../servers/utils/jsonrpc"; +import Address from "../../core/src/things/address"; +import JsonRpc from "../../core/src/servers/utils/jsonrpc"; import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; import secp256k1 from "secp256k1"; import HDKey from "hdkey"; -import {RequestType, KnownKeys} from "../../types"; -import {Provider} from "../../interfaces/provider"; +import {RequestType, KnownKeys} from "../../core/src/types"; +import {Provider} from "../../core/src/interfaces/provider"; const WEI = 1000000000000000000n; diff --git a/packages/core/src/ledgers/ethereum/wallet.ts b/packages/ethereum/src/wallet.ts similarity index 94% rename from packages/core/src/ledgers/ethereum/wallet.ts rename to packages/ethereum/src/wallet.ts index 9d8d0a1e30..987e418f37 100644 --- a/packages/core/src/ledgers/ethereum/wallet.ts +++ b/packages/ethereum/src/wallet.ts @@ -1,7 +1,7 @@ -import {Data} from "../../things/json-rpc"; -import Address from "../../things/address"; +import {Data} from "../../core/src/things/json-rpc"; +import Address from "../../core/src/things/address"; import EthereumOptions from "./options"; -import Account from "../../things/account"; +import Account from "../../core/src/things/account"; import {toChecksumAddress} from "ethereumjs-util"; export default class Wallet { From 0cd1916530c67e3129bfdc03a015fbf5b74fbbe9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 15:16:30 -0400 Subject: [PATCH 179/691] Move tezos stuff --- packages/core/src/options/provider-options.ts | 2 +- packages/tezos/__tests__/{tezos.test.ts => index.test.ts} | 0 packages/{core/src/ledgers/tezos => tezos/src}/api.ts | 2 +- packages/{core/src/ledgers/tezos => tezos/src}/index.ts | 8 ++++---- .../{core/src/ledgers/tezos => tezos/src}/provider.ts | 6 +++--- packages/tezos/src/tezos.ts | 3 --- 6 files changed, 9 insertions(+), 12 deletions(-) rename packages/tezos/__tests__/{tezos.test.ts => index.test.ts} (100%) rename packages/{core/src/ledgers/tezos => tezos/src}/api.ts (78%) rename packages/{core/src/ledgers/tezos => tezos/src}/index.ts (78%) rename packages/{core/src/ledgers/tezos => tezos/src}/provider.ts (62%) delete mode 100644 packages/tezos/src/tezos.ts diff --git a/packages/core/src/options/provider-options.ts b/packages/core/src/options/provider-options.ts index 8c115eaf9c..d84bbfc1c4 100644 --- a/packages/core/src/options/provider-options.ts +++ b/packages/core/src/options/provider-options.ts @@ -1,5 +1,5 @@ import Options, {getDefault as getDefaultOptions} from "./options"; -import TezosConnector from "../ledgers/tezos"; +import TezosConnector from "../../../tezos/src"; import EthereumConnector from "../../../ethereum/src"; import {entropyToMnemonic} from "bip39"; import seedrandom, {seedrandom_prng} from "seedrandom"; diff --git a/packages/tezos/__tests__/tezos.test.ts b/packages/tezos/__tests__/index.test.ts similarity index 100% rename from packages/tezos/__tests__/tezos.test.ts rename to packages/tezos/__tests__/index.test.ts diff --git a/packages/core/src/ledgers/tezos/api.ts b/packages/tezos/src/api.ts similarity index 78% rename from packages/core/src/ledgers/tezos/api.ts rename to packages/tezos/src/api.ts index 8a1d9c6dfc..9a25f70b62 100644 --- a/packages/core/src/ledgers/tezos/api.ts +++ b/packages/tezos/src/api.ts @@ -1,4 +1,4 @@ -import Api from "../../interfaces/api"; +import Api from "../../core/src/interfaces/api"; export default class TezosApi implements Api { readonly [index: string]: (...args: any) => Promise; diff --git a/packages/core/src/ledgers/tezos/index.ts b/packages/tezos/src/index.ts similarity index 78% rename from packages/core/src/ledgers/tezos/index.ts rename to packages/tezos/src/index.ts index 4b3f2b44f9..ff38faf1ca 100644 --- a/packages/core/src/ledgers/tezos/index.ts +++ b/packages/tezos/src/index.ts @@ -1,9 +1,9 @@ import Emittery from "emittery"; -import {RequestType} from "../../types"; -import Connector from "../../interfaces/connector"; +import {RequestType} from "../../core/src/types"; +import Connector from "../../core/src/interfaces/connector"; import TezosProvider from "./provider"; -import JsonRpc from "../../servers/utils/jsonrpc"; -import ProviderOptions from "../../options/provider-options"; +import JsonRpc from "../../core/src/servers/utils/jsonrpc"; +import ProviderOptions from "../../core/src/options/provider-options"; import TezosApi from "./api"; export default class TezosConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> diff --git a/packages/core/src/ledgers/tezos/provider.ts b/packages/tezos/src/provider.ts similarity index 62% rename from packages/core/src/ledgers/tezos/provider.ts rename to packages/tezos/src/provider.ts index 851749d589..65dcd6e6c7 100644 --- a/packages/core/src/ledgers/tezos/provider.ts +++ b/packages/tezos/src/provider.ts @@ -1,8 +1,8 @@ -import {Provider} from "../../interfaces/provider"; +import {Provider} from "../../core/src/interfaces/provider"; import TezosApi from "./api"; -import {RequestType} from "../../types"; +import {RequestType} from "../../core/src/types"; import Emittery from "emittery"; -import ProviderOptions from "../../options/provider-options"; +import ProviderOptions from "../../core/src/options/provider-options"; export default class TezosProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements Provider { diff --git a/packages/tezos/src/tezos.ts b/packages/tezos/src/tezos.ts deleted file mode 100644 index ae5e744311..0000000000 --- a/packages/tezos/src/tezos.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default function tezos() { - // TODO -} From 8e81b92280c2378f57b3241361de73e5bc8a5071 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 15:16:51 -0400 Subject: [PATCH 180/691] Try to make tests pass on CI --- packages/core/__tests__/ledger.ts | 4 ++-- packages/core/__tests__/provider.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/__tests__/ledger.ts b/packages/core/__tests__/ledger.ts index b4086b2151..c5718caf4b 100644 --- a/packages/core/__tests__/ledger.ts +++ b/packages/core/__tests__/ledger.ts @@ -10,7 +10,7 @@ describe("ledger", () => { beforeEach(async () => { provider = GetProvider(); accounts = await provider.request("eth_accounts"); - }); + }) it("eth_blockNumber", async () => { const blockNumber = parseInt(await provider.request("eth_blockNumber"), 10); @@ -25,7 +25,7 @@ describe("ledger", () => { await sleep(); const nextBlockNumber = await provider.request("eth_blockNumber"); assert.equal(blockNumber, nextBlockNumber - 1); - }); + }).timeout(4000); it("eth_getBlockByNumber", async () => { await provider.request("eth_sendTransaction", [ diff --git a/packages/core/__tests__/provider.ts b/packages/core/__tests__/provider.ts index 5133a78097..5283a7bdc1 100644 --- a/packages/core/__tests__/provider.ts +++ b/packages/core/__tests__/provider.ts @@ -37,7 +37,7 @@ describe("provider", () => { }; await p.send("web3_sha3", ["Tim is a swell guy."]); }); - }).timeout(500); + }).timeout(1000); it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { const p = Ganache.provider() as EthereumProvider; From c37420d9bfb5d1c857e5a31e7fb6ad49041d3e8e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 15:32:40 -0400 Subject: [PATCH 181/691] Increase time even more --- packages/core/__tests__/helpers/sleep.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/__tests__/helpers/sleep.ts b/packages/core/__tests__/helpers/sleep.ts index 6e4a2e375b..aead12e8a5 100644 --- a/packages/core/__tests__/helpers/sleep.ts +++ b/packages/core/__tests__/helpers/sleep.ts @@ -1,3 +1,3 @@ -const sleep = (time: number = 100) => new Promise(resolve => setTimeout(resolve, time)); +const sleep = (time: number = 500) => new Promise(resolve => setTimeout(resolve, time)); export default sleep; From 7a5337e475aba71d6ddc753a5a1955f6736a9c4d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 18:16:36 -0400 Subject: [PATCH 182/691] try it --- .github/actions/nodejs.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/actions/nodejs.yml diff --git a/.github/actions/nodejs.yml b/.github/actions/nodejs.yml new file mode 100644 index 0000000000..763b8766a6 --- /dev/null +++ b/.github/actions/nodejs.yml @@ -0,0 +1,24 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: [push,pull_request] + +jobs: + build: + + runs-on: [windows-2019, ubuntu-16.04, ubuntu-18.04, macos-10.15] + + strategy: + matrix: + node-version: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test \ No newline at end of file From a06059609b515adbd05109bf93614066a1c2895c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 18:17:53 -0400 Subject: [PATCH 183/691] . --- .github/{actions => workflows}/nodejs.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{actions => workflows}/nodejs.yml (100%) diff --git a/.github/actions/nodejs.yml b/.github/workflows/nodejs.yml similarity index 100% rename from .github/actions/nodejs.yml rename to .github/workflows/nodejs.yml From 9c9ee30f35df78d45251057b9e862bc7b10681d3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 18:20:55 -0400 Subject: [PATCH 184/691] /shrug --- .github/workflows/nodejs.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 763b8766a6..3e6bfcd76a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -7,18 +7,18 @@ on: [push,pull_request] jobs: build: - - runs-on: [windows-2019, ubuntu-16.04, ubuntu-18.04, macos-10.15] - strategy: matrix: - node-version: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] + node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] + os: [windows-2019, ubuntu-16.04, ubuntu-18.04, macos-10.15] + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ matrix.node }} - run: npm ci - run: npm test \ No newline at end of file From 860527e1a31754f0f279cc8524d094447136cd04 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 18:29:25 -0400 Subject: [PATCH 185/691] . --- .github/workflows/nodejs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 3e6bfcd76a..85f7f5225b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -8,6 +8,7 @@ on: [push,pull_request] jobs: build: strategy: + fail-fast: false matrix: node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] os: [windows-2019, ubuntu-16.04, ubuntu-18.04, macos-10.15] From 4ac4c85da8e3234c7073e4ef9f8d8529c82a683f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 18:34:58 -0400 Subject: [PATCH 186/691] . --- .github/workflows/nodejs.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 85f7f5225b..58c0662f19 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -21,5 +21,15 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} + - name: install node tools + run: npm install --global --production windows-build-tools@4.0.0 + - name: install node-gyp + run: npm install --global node-gyp@latest + - name: Set node config to use python2.7 + run: npm config set python python2.7 + - name: Set node config to set msvs_version to 2015 + run: npm config set msvs_version 2015 + - name: Work around for Windows Server 2019 + run: set path=%path%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin - run: npm ci - run: npm test \ No newline at end of file From 94256b272b36237ce93a0202287c85c67b8872f4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 18:47:15 -0400 Subject: [PATCH 187/691] .2 --- .github/workflows/nodejs.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 58c0662f19..e906dfc4c2 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -22,14 +22,19 @@ jobs: with: node-version: ${{ matrix.node }} - name: install node tools + if: matrix.os == 'windows-2019' run: npm install --global --production windows-build-tools@4.0.0 - name: install node-gyp + if: matrix.os == 'windows-2019' run: npm install --global node-gyp@latest - name: Set node config to use python2.7 + if: matrix.os == 'windows-2019' run: npm config set python python2.7 - name: Set node config to set msvs_version to 2015 + if: matrix.os == 'windows-2019' run: npm config set msvs_version 2015 - name: Work around for Windows Server 2019 + if: matrix.os == 'windows-2019' run: set path=%path%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin - run: npm ci - run: npm test \ No newline at end of file From ea11fd1aa37b0074ca096f786c78d77c89900afc Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 18:52:18 -0400 Subject: [PATCH 188/691] ? --- .github/workflows/nodejs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index e906dfc4c2..d1374d15ad 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -33,8 +33,5 @@ jobs: - name: Set node config to set msvs_version to 2015 if: matrix.os == 'windows-2019' run: npm config set msvs_version 2015 - - name: Work around for Windows Server 2019 - if: matrix.os == 'windows-2019' - run: set path=%path%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin - run: npm ci - run: npm test \ No newline at end of file From 17eb912506dde5d747aaf54338b390e98279a258 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 20:35:16 -0400 Subject: [PATCH 189/691] Make sure github actions shows mocha colors --- .github/workflows/nodejs.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index d1374d15ad..8060a8bfbf 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -34,4 +34,6 @@ jobs: if: matrix.os == 'windows-2019' run: npm config set msvs_version 2015 - run: npm ci - - run: npm test \ No newline at end of file + - run: npm test + env: + FORCE_COLOR: 1 \ No newline at end of file From 2e4d6cbc5d64ec01ce9cd3c4ff4b23c9ed477fdc Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 1 May 2020 20:37:19 -0400 Subject: [PATCH 190/691] Switch to github actions --- .npmignore | 2 +- .travis.yml | 39 --------------------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 .travis.yml diff --git a/.npmignore b/.npmignore index d77afc7d23..d6fb74ccab 100644 --- a/.npmignore +++ b/.npmignore @@ -2,8 +2,8 @@ .tern-project .tern-port .dockerignore -.travis.yml .eslintrc.js +.github/ *.log Dockerfile ISSUE_TEMPLATE.md diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b1799c729d..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: ~> 1.0 - -language: node_js - -node_js: - - "10.7.0" - - "10" - - "11" - - "12" - - "13" - - "14" - -os: - - linux - - osx - - windows - -# using xcode9.2 forces osx 10.12, which is WAAAYYYYYY faster than 10.13 -# in fact, we couldn't get osx 10.13 to ever finish the running the tests -osx_image: xcode9.2 - -git: - autocrlf: false - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-5 - - g++-5 - -before_install: - - if [ $TRAVIS_OS_NAME == "linux" ]; then - export CC="gcc-5"; - export CXX="g++-5"; - export LINK="gcc-5"; - export LINKXX="g++-5"; - fi From b3895dbd8a960b27c69e24e9aedc76bd46c6d4fe Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 2 May 2020 15:14:34 -0400 Subject: [PATCH 191/691] More more things around --- docs/README.md | 4 ++++ packages/cli/package.json | 6 ++++++ packages/core/__tests__/ledger.ts | 1 - packages/core/__tests__/provider.ts | 13 ++++++------- packages/core/__tests__/temp-tests.ts | 15 +++++++-------- packages/core/package.json | 6 +++++- packages/core/src/connector.ts | 2 -- packages/core/src/interfaces/api-options.ts | 2 +- packages/core/src/options/provider-options.ts | 4 ++-- packages/core/tsconfig.json | 6 +++++- packages/ethereum/package.json | 4 ++++ .../src/@types/ethereumjs-block/header.d.ts | 0 .../src/@types/ethereumjs-block/index.d.ts | 0 packages/{core => ethereum}/src/@types/hdkey.d.ts | 0 .../src/@types/levelup/index.d.ts | 0 .../src/@types/merkle-patricia-tree/baseTrie.d.ts | 0 .../src/@types/merkle-patricia-tree/index.d.ts | 0 .../@types/merkle-patricia-tree/readStream.d.ts | 0 .../src/@types/merkle-patricia-tree/trieNode.d.ts | 0 packages/ethereum/src/api.ts | 12 ++++++------ packages/ethereum/src/blockchain.ts | 10 +++++----- .../ethereum/src/components/account-manager.ts | 6 +++--- packages/ethereum/src/components/block-manager.ts | 6 +++--- packages/ethereum/src/components/manager.ts | 2 +- .../src/components/transaction-manager.ts | 2 +- .../ethereum/src/components/transaction-pool.ts | 6 +++--- packages/ethereum/src/index.ts | 8 ++++---- packages/ethereum/src/miner.ts | 8 ++++---- packages/ethereum/src/options.ts | 4 ++-- packages/ethereum/src/provider.ts | 14 +++++++------- packages/{core => ethereum}/src/things/account.ts | 2 +- packages/{core => ethereum}/src/things/address.ts | 2 +- packages/{core => ethereum}/src/things/errors.ts | 0 packages/{core => ethereum}/src/things/params.ts | 0 packages/{core => ethereum}/src/things/tags.ts | 0 .../src/things/transaction-receipt.ts | 4 ++-- .../{core => ethereum}/src/things/transaction.ts | 6 +++--- packages/ethereum/src/wallet.ts | 6 +++--- packages/tezos/package.json | 5 +++++ packages/tezos/src/api.ts | 2 +- packages/tezos/src/index.ts | 8 ++++---- packages/tezos/src/provider.ts | 6 +++--- packages/utils/package.json | 5 +++++ 43 files changed, 107 insertions(+), 80 deletions(-) rename packages/{core => ethereum}/src/@types/ethereumjs-block/header.d.ts (100%) rename packages/{core => ethereum}/src/@types/ethereumjs-block/index.d.ts (100%) rename packages/{core => ethereum}/src/@types/hdkey.d.ts (100%) rename packages/{core => ethereum}/src/@types/levelup/index.d.ts (100%) rename packages/{core => ethereum}/src/@types/merkle-patricia-tree/baseTrie.d.ts (100%) rename packages/{core => ethereum}/src/@types/merkle-patricia-tree/index.d.ts (100%) rename packages/{core => ethereum}/src/@types/merkle-patricia-tree/readStream.d.ts (100%) rename packages/{core => ethereum}/src/@types/merkle-patricia-tree/trieNode.d.ts (100%) rename packages/{core => ethereum}/src/things/account.ts (93%) rename packages/{core => ethereum}/src/things/address.ts (65%) rename packages/{core => ethereum}/src/things/errors.ts (100%) rename packages/{core => ethereum}/src/things/params.ts (100%) rename packages/{core => ethereum}/src/things/tags.ts (100%) rename packages/{core => ethereum}/src/things/transaction-receipt.ts (93%) rename packages/{core => ethereum}/src/things/transaction.ts (98%) diff --git a/docs/README.md b/docs/README.md index afbe1a130e..9b81efd234 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,6 +7,10 @@ * `npm install lerna -g` * `lerna bootstrap` + ## VSCode On Windows (10) + + * Enable "Developer Mode" by going to Settings -> Developer Settings -> Then select Developer Mode. + ## To build Builds all packages: diff --git a/packages/cli/package.json b/packages/cli/package.json index f0dda10d26..891b307af0 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -23,5 +23,11 @@ }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "dependencies": { + "@ganache/core": "^2.2.1", + "@ganache/ethereum": "^2.2.1", + "@ganache/tezos": "^2.2.1", + "@ganache/utils": "^2.2.1" } } diff --git a/packages/core/__tests__/ledger.ts b/packages/core/__tests__/ledger.ts index c5718caf4b..bd73ce70a7 100644 --- a/packages/core/__tests__/ledger.ts +++ b/packages/core/__tests__/ledger.ts @@ -1,7 +1,6 @@ import assert from "assert"; import GetProvider from "./helpers/getProvider"; import sleep from "./helpers/sleep"; -import EthereumProvider from "../../ethereum/src/provider"; describe("ledger", () => { let provider: any; diff --git a/packages/core/__tests__/provider.ts b/packages/core/__tests__/provider.ts index 5283a7bdc1..49af9beaa6 100644 --- a/packages/core/__tests__/provider.ts +++ b/packages/core/__tests__/provider.ts @@ -1,15 +1,14 @@ import Ganache from "../src/"; import assert from "assert"; -import EthereumProvider from "../../ethereum/src/provider"; describe("provider", () => { const networkId = "1234"; - let p: EthereumProvider; + let p: any; beforeEach("set up", () => { p = Ganache.provider({ network_id: networkId - }) as EthereumProvider; + }); }); it("works without passing options", async () => { @@ -22,7 +21,7 @@ describe("provider", () => { assert.strictEqual(msg, " > net_version: undefined"); } }; - const p = Ganache.provider({logger, verbose: true}) as EthereumProvider; + const p = Ganache.provider({logger, verbose: true}) as any; logger.log = msg => { assert.strictEqual(msg, " > net_version: undefined", "doesn't work when no params"); @@ -40,7 +39,7 @@ describe("provider", () => { }).timeout(1000); it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { - const p = Ganache.provider() as EthereumProvider; + const p = Ganache.provider() as any; const accounts = await p.send("eth_accounts"); // eth_accounts should always be faster than eth_getBalance; it should // return before eth_getBalance because of the `asyncRequestProcessing` flag @@ -52,7 +51,7 @@ describe("provider", () => { }); it("it processes requests in order when `asyncRequestProcessing` is false", async () => { - const p = Ganache.provider({asyncRequestProcessing: false}) as EthereumProvider; + const p = Ganache.provider({asyncRequestProcessing: false}) as any; const accounts = await p.send("eth_accounts"); // eth_accounts should always be faster than eth_getBalance, but shouldn't // return before eth_getBalance because of the `asyncRequestProcessing` flag @@ -65,7 +64,7 @@ describe("provider", () => { }); it("generates predictable accounts when given a seed", async () => { - const p = Ganache.provider({seed: "temet nosce"}) as EthereumProvider; + const p = Ganache.provider({seed: "temet nosce"}) as any; const accounts = await p.request("eth_accounts"); assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); }); diff --git a/packages/core/__tests__/temp-tests.ts b/packages/core/__tests__/temp-tests.ts index 1445f4d1bc..454309f7e6 100644 --- a/packages/core/__tests__/temp-tests.ts +++ b/packages/core/__tests__/temp-tests.ts @@ -1,7 +1,6 @@ import Ganache from "../src"; import assert from "assert"; import {Quantity} from "../src/things/json-rpc"; -import EthereumProvider from "../../ethereum/src/provider"; const solc = require("solc"); function compileSolidity(source: string) { @@ -41,7 +40,7 @@ describe("Accounts", () => { it("should respect the BIP99 mnemonic", async () => { const options = {mnemonic}; - const p = Ganache.provider(options) as EthereumProvider; + const p = Ganache.provider(options) as any; const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts[0], expectedAddress); @@ -49,7 +48,7 @@ describe("Accounts", () => { it("eth_sendTransaction", async () => { const options = {mnemonic}; - const p = Ganache.provider(options) as EthereumProvider; + const p = Ganache.provider(options) as any; const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); await p.send("eth_sendTransaction", [ @@ -67,7 +66,7 @@ describe("Accounts", () => { }).timeout(5000); it("should create its own mnemonic", async () => { - const p = Ganache.provider() as EthereumProvider; + const p = Ganache.provider() as any; const options = p.getOptions(); assert.deepStrictEqual(typeof options.mnemonic, "string"); }); @@ -98,7 +97,7 @@ describe("Accounts", () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }) as EthereumProvider; + }) as any; const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts.length, 2); }); @@ -126,7 +125,7 @@ describe("Accounts", () => { const p = Ganache.provider({ locked: true, unlocked_accounts: ["0", 1] - }) as EthereumProvider; + }) as any; const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); @@ -176,7 +175,7 @@ describe("Accounts", () => { ); const p = Ganache.provider({ defaultTransactionGasLimit: Quantity.from(6721975) - }) as EthereumProvider; + }) as any; const accounts = await p.send("eth_accounts"); const transactionHash = await p.send("eth_sendTransaction", [ { @@ -219,7 +218,7 @@ describe("Accounts", () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }) as EthereumProvider; + }) as any; const accounts = await p.send("eth_accounts"); const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); assert(true); diff --git a/packages/core/package.json b/packages/core/package.json index 80274d758a..5c137dee0c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -29,5 +29,9 @@ "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, - "devDependencies": {} + "dependencies": { + "@ganache/ethereum": "^2.2.1", + "@ganache/tezos": "^2.2.1", + "@ganache/utils": "^2.2.1" + } } diff --git a/packages/core/src/connector.ts b/packages/core/src/connector.ts index aaad9cf1a2..404f3e0bca 100644 --- a/packages/core/src/connector.ts +++ b/packages/core/src/connector.ts @@ -1,8 +1,6 @@ import Executor from "./utils/executor"; import RequestCoordinator from "./utils/request-coordinator"; import ProviderOptions, {FlavorMap, Apis} from "./options/provider-options"; -import Emittery from "emittery"; -import EthereumProvider from "../../ethereum/src/provider"; import {Provider} from "./interfaces/provider"; export default class Connector { diff --git a/packages/core/src/interfaces/api-options.ts b/packages/core/src/interfaces/api-options.ts index 56bf0fc4e9..91c1306a10 100644 --- a/packages/core/src/interfaces/api-options.ts +++ b/packages/core/src/interfaces/api-options.ts @@ -1,4 +1,4 @@ -import Account from "../things/account"; +import Account from "../../../ethereum/src/things/account"; /** * Options that ledger implementations must implement diff --git a/packages/core/src/options/provider-options.ts b/packages/core/src/options/provider-options.ts index d84bbfc1c4..cd83490ac0 100644 --- a/packages/core/src/options/provider-options.ts +++ b/packages/core/src/options/provider-options.ts @@ -1,6 +1,6 @@ import Options, {getDefault as getDefaultOptions} from "./options"; -import TezosConnector from "../../../tezos/src"; -import EthereumConnector from "../../../ethereum/src"; +import TezosConnector from "@ganache/tezos/src/index"; +import EthereumConnector from "@ganache/ethereum/src/index"; import {entropyToMnemonic} from "bip39"; import seedrandom, {seedrandom_prng} from "seedrandom"; import Connector from "../interfaces/connector"; diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 1b551f4e9e..5d133e0c3a 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -3,5 +3,9 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": [ + "src", + "../ethereum/src/@types/merkle-patricia-tree", + "../ethereum/src/@types/levelup", "../ethereum/src/@types/ethereumjs-block", "../ethereum/src/@types/hdkey.d.ts", "../ethereum/src/things/account.ts" + ] } diff --git a/packages/ethereum/package.json b/packages/ethereum/package.json index 8eea927a61..1de2737839 100644 --- a/packages/ethereum/package.json +++ b/packages/ethereum/package.json @@ -26,5 +26,9 @@ }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "dependencies": { + "@ganache/core": "^2.2.1", + "@ganache/utils": "^2.2.1" } } diff --git a/packages/core/src/@types/ethereumjs-block/header.d.ts b/packages/ethereum/src/@types/ethereumjs-block/header.d.ts similarity index 100% rename from packages/core/src/@types/ethereumjs-block/header.d.ts rename to packages/ethereum/src/@types/ethereumjs-block/header.d.ts diff --git a/packages/core/src/@types/ethereumjs-block/index.d.ts b/packages/ethereum/src/@types/ethereumjs-block/index.d.ts similarity index 100% rename from packages/core/src/@types/ethereumjs-block/index.d.ts rename to packages/ethereum/src/@types/ethereumjs-block/index.d.ts diff --git a/packages/core/src/@types/hdkey.d.ts b/packages/ethereum/src/@types/hdkey.d.ts similarity index 100% rename from packages/core/src/@types/hdkey.d.ts rename to packages/ethereum/src/@types/hdkey.d.ts diff --git a/packages/core/src/@types/levelup/index.d.ts b/packages/ethereum/src/@types/levelup/index.d.ts similarity index 100% rename from packages/core/src/@types/levelup/index.d.ts rename to packages/ethereum/src/@types/levelup/index.d.ts diff --git a/packages/core/src/@types/merkle-patricia-tree/baseTrie.d.ts b/packages/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts similarity index 100% rename from packages/core/src/@types/merkle-patricia-tree/baseTrie.d.ts rename to packages/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts diff --git a/packages/core/src/@types/merkle-patricia-tree/index.d.ts b/packages/ethereum/src/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from packages/core/src/@types/merkle-patricia-tree/index.d.ts rename to packages/ethereum/src/@types/merkle-patricia-tree/index.d.ts diff --git a/packages/core/src/@types/merkle-patricia-tree/readStream.d.ts b/packages/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts similarity index 100% rename from packages/core/src/@types/merkle-patricia-tree/readStream.d.ts rename to packages/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts diff --git a/packages/core/src/@types/merkle-patricia-tree/trieNode.d.ts b/packages/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts similarity index 100% rename from packages/core/src/@types/merkle-patricia-tree/trieNode.d.ts rename to packages/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts diff --git a/packages/ethereum/src/api.ts b/packages/ethereum/src/api.ts index 54ce8b5374..2f401b470b 100644 --- a/packages/ethereum/src/api.ts +++ b/packages/ethereum/src/api.ts @@ -1,18 +1,18 @@ //#region Imports -import Api, { Emitter } from "../../core/src/interfaces/api"; +import Api, { Emitter } from "@ganache/core/src/interfaces/api"; import EthereumOptions from "./options"; -import {Data, Quantity} from "../../core/src/things/json-rpc"; +import {Data, Quantity} from "@ganache/core/src/things/json-rpc"; import Blockchain from "./blockchain"; -import Tag from "../../core/src/things/tags"; -import Address, {IndexableAddress} from "../../core/src/things/address"; -import Transaction from "../../core/src/things/transaction"; +import Tag from "./things/tags"; +import Address, {IndexableAddress} from "./things/address"; +import Transaction from "./things/transaction"; import {Block} from "./components/block-manager"; import Wallet from "./wallet"; import Account from "ethereumjs-account"; import {decode as rlpDecode} from "rlp"; const createKeccakHash = require("keccak"); -// Read in the current ganache version from the package.json +// Read in the current ganache version from core's package.json import {name, version} from "../../core/package.json"; //#endregion diff --git a/packages/ethereum/src/blockchain.ts b/packages/ethereum/src/blockchain.ts index a67adbaf47..a4b150337e 100644 --- a/packages/ethereum/src/blockchain.ts +++ b/packages/ethereum/src/blockchain.ts @@ -5,15 +5,15 @@ import BlockManager, {Block} from "./components/block-manager"; import TransactionManager from "./components/transaction-manager"; import Trie from "merkle-patricia-tree"; import {BN} from "ethereumjs-util"; -import Account from "../../core/src/things/account"; +import Account from "./things/account"; import {promisify} from "util"; -import {Quantity, Data} from "../../core/src/things/json-rpc"; +import {Quantity, Data} from "@ganache/core/src/things/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; -import Heap from "../../core/src/utils/heap"; -import Transaction from "../../core/src/things/transaction"; +import Heap from "@ganache/core/src/utils/heap"; +import Transaction from "./things/transaction"; import Manager from "./components/manager"; -import TransactionReceipt from "../../core/src/things/transaction-receipt"; +import TransactionReceipt from "./things/transaction-receipt"; import {encode as rlpEncode} from "rlp"; import Common from "ethereumjs-common"; diff --git a/packages/ethereum/src/components/account-manager.ts b/packages/ethereum/src/components/account-manager.ts index eff96c3cc1..7d8250951e 100644 --- a/packages/ethereum/src/components/account-manager.ts +++ b/packages/ethereum/src/components/account-manager.ts @@ -1,8 +1,8 @@ -import Account from "../../../core/src/things/account"; -import Address from "../../../core/src/things/address"; +import Account from "../things/account"; +import Address from "../things/address"; import Trie from "merkle-patricia-tree/baseTrie"; import Blockchain from "../blockchain"; -import Tag from "../../../core/src/things/tags"; +import Tag from "../things/tags"; import {LevelUp} from "levelup"; export default class AccountManager { diff --git a/packages/ethereum/src/components/block-manager.ts b/packages/ethereum/src/components/block-manager.ts index 733f3a0555..f3775ec3d9 100644 --- a/packages/ethereum/src/components/block-manager.ts +++ b/packages/ethereum/src/components/block-manager.ts @@ -1,10 +1,10 @@ import EthereumJsBlock from "ethereumjs-block"; import Manager from "./manager"; -import Tag from "../../../core/src/things/tags"; +import Tag from "../things/tags"; import levelup from "levelup"; import Blockchain from "../blockchain"; -import {Quantity, Data} from "../../../core/src/things/json-rpc"; -import Transaction from "../../../core/src/things/transaction"; +import {Quantity, Data} from "@ganache/core/src/things/json-rpc"; +import Transaction from "../things/transaction"; import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; diff --git a/packages/ethereum/src/components/manager.ts b/packages/ethereum/src/components/manager.ts index a12d32ec1b..e1bc8a6fec 100644 --- a/packages/ethereum/src/components/manager.ts +++ b/packages/ethereum/src/components/manager.ts @@ -1,5 +1,5 @@ import levelup from "levelup"; -import {Data} from "../../../core/src/things/json-rpc"; +import {Data} from "@ganache/core/src/things/json-rpc"; import Blockchain from "../blockchain"; const NOTFOUND = 404; diff --git a/packages/ethereum/src/components/transaction-manager.ts b/packages/ethereum/src/components/transaction-manager.ts index 7be0061fc8..dfc9c4ec37 100644 --- a/packages/ethereum/src/components/transaction-manager.ts +++ b/packages/ethereum/src/components/transaction-manager.ts @@ -1,4 +1,4 @@ -import Transaction from "../../../core/src/things/transaction"; +import Transaction from "../things/transaction"; import Manager from "./manager"; import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; import levelup from "levelup"; diff --git a/packages/ethereum/src/components/transaction-pool.ts b/packages/ethereum/src/components/transaction-pool.ts index 8672305b89..396e3000f6 100644 --- a/packages/ethereum/src/components/transaction-pool.ts +++ b/packages/ethereum/src/components/transaction-pool.ts @@ -1,8 +1,8 @@ import Emittery from "emittery"; import Blockchain from "../blockchain"; -import Heap from "../../../core/src/utils/heap"; -import Transaction from "../../../core/src/things/transaction"; -import {Data, Quantity} from "../../../core/src/things/json-rpc"; +import Heap from "@ganache/core/src/utils/heap"; +import Transaction from "../things/transaction"; +import {Data, Quantity} from "@ganache/core/src/things/json-rpc"; export type TransactionPoolOptions = { /** diff --git a/packages/ethereum/src/index.ts b/packages/ethereum/src/index.ts index 2bae804b7f..c46923895b 100644 --- a/packages/ethereum/src/index.ts +++ b/packages/ethereum/src/index.ts @@ -1,9 +1,9 @@ -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "../../core/src/options/provider-options"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/core/src/options/provider-options"; import Emittery from "emittery"; import EthereumApi from "./api"; -import JsonRpc from "../../core/src/servers/utils/jsonrpc"; -import Connector from "../../core/src/interfaces/connector"; -import {RequestType} from "../../core/src/types"; +import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; +import Connector from "@ganache/core/src/interfaces/connector"; +import {RequestType} from "@ganache/core/src/types"; import EthereumProvider from "./provider"; import {RecognizedString} from "uWebSockets.js"; diff --git a/packages/ethereum/src/miner.ts b/packages/ethereum/src/miner.ts index e68951dfe8..bc60a9d71b 100644 --- a/packages/ethereum/src/miner.ts +++ b/packages/ethereum/src/miner.ts @@ -1,7 +1,7 @@ -import params from "../../core/src/things/params"; -import Heap from "../../core/src/utils/heap"; -import Transaction from "../../core/src/things/transaction"; -import {Quantity, Data} from "../../core/src/things/json-rpc"; +import params from "./things/params"; +import Heap from "@ganache/core/src/utils/heap"; +import Transaction from "./things/transaction"; +import {Quantity, Data} from "@ganache/core/src/things/json-rpc"; import {promisify} from "util"; import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; diff --git a/packages/ethereum/src/options.ts b/packages/ethereum/src/options.ts index f4e7c6dd74..1bd73835ca 100644 --- a/packages/ethereum/src/options.ts +++ b/packages/ethereum/src/options.ts @@ -1,5 +1,5 @@ -import Options from "../../core/src/options/provider-options"; -import Account from "../../core/src/things/account"; +import Options from "@ganache/core/src/options/provider-options"; +import Account from "./things/account"; type EthereumOptions = Pick< Options, diff --git a/packages/ethereum/src/provider.ts b/packages/ethereum/src/provider.ts index 9113f4867f..52d1da4346 100644 --- a/packages/ethereum/src/provider.ts +++ b/packages/ethereum/src/provider.ts @@ -1,18 +1,18 @@ -import {Quantity, Data} from "../../core/src/things/json-rpc"; -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "../../core/src/options/provider-options"; +import {Quantity, Data} from "@ganache/core/src/things/json-rpc"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/core/src/options/provider-options"; import Emittery from "emittery"; import EthereumApi from "./api"; import {publicToAddress, privateToAddress} from "ethereumjs-util"; -import Account from "../../core/src/things/account"; +import Account from "./things/account"; import {mnemonicToSeedSync} from "bip39"; -import Address from "../../core/src/things/address"; -import JsonRpc from "../../core/src/servers/utils/jsonrpc"; +import Address from "./things/address"; +import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; import secp256k1 from "secp256k1"; import HDKey from "hdkey"; -import {RequestType, KnownKeys} from "../../core/src/types"; -import {Provider} from "../../core/src/interfaces/provider"; +import {RequestType, KnownKeys} from "@ganache/core/src/types"; +import {Provider} from "@ganache/core/src/interfaces/provider"; const WEI = 1000000000000000000n; diff --git a/packages/core/src/things/account.ts b/packages/ethereum/src/things/account.ts similarity index 93% rename from packages/core/src/things/account.ts rename to packages/ethereum/src/things/account.ts index d9f8e53cbc..60c38c6b64 100644 --- a/packages/core/src/things/account.ts +++ b/packages/ethereum/src/things/account.ts @@ -1,4 +1,4 @@ -import {Data, Quantity} from "./json-rpc"; +import {Data, Quantity} from "@ganache/core/src/things/json-rpc"; import Address from "./address"; import {rlp, KECCAK256_RLP, KECCAK256_NULL} from "ethereumjs-util"; diff --git a/packages/core/src/things/address.ts b/packages/ethereum/src/things/address.ts similarity index 65% rename from packages/core/src/things/address.ts rename to packages/ethereum/src/things/address.ts index 4413a7fcee..fc8bc1788d 100644 --- a/packages/core/src/things/address.ts +++ b/packages/ethereum/src/things/address.ts @@ -1,4 +1,4 @@ -import {IndexableJsonRpcType, Data} from "./json-rpc"; +import {IndexableJsonRpcType, Data} from "@ganache/core/src/things/json-rpc"; const Address = Data; diff --git a/packages/core/src/things/errors.ts b/packages/ethereum/src/things/errors.ts similarity index 100% rename from packages/core/src/things/errors.ts rename to packages/ethereum/src/things/errors.ts diff --git a/packages/core/src/things/params.ts b/packages/ethereum/src/things/params.ts similarity index 100% rename from packages/core/src/things/params.ts rename to packages/ethereum/src/things/params.ts diff --git a/packages/core/src/things/tags.ts b/packages/ethereum/src/things/tags.ts similarity index 100% rename from packages/core/src/things/tags.ts rename to packages/ethereum/src/things/tags.ts diff --git a/packages/core/src/things/transaction-receipt.ts b/packages/ethereum/src/things/transaction-receipt.ts similarity index 93% rename from packages/core/src/things/transaction-receipt.ts rename to packages/ethereum/src/things/transaction-receipt.ts index 7a8a700ecc..e84a6e65d7 100644 --- a/packages/core/src/things/transaction-receipt.ts +++ b/packages/ethereum/src/things/transaction-receipt.ts @@ -1,7 +1,7 @@ import Transaction from "./transaction"; -import {Block} from "../../../ethereum/src/components/block-manager"; +import {Block} from "../components/block-manager"; import {encode as rlpEncode, decode as rlpDecode} from "rlp"; -import {Data, Quantity} from "./json-rpc"; +import {Data, Quantity} from "@ganache/core/src/things/json-rpc"; export default class TransactionReceipt { #contractAddress: Buffer; diff --git a/packages/core/src/things/transaction.ts b/packages/ethereum/src/things/transaction.ts similarity index 98% rename from packages/core/src/things/transaction.ts rename to packages/ethereum/src/things/transaction.ts index a090b3b6e9..43e82f8e2e 100644 --- a/packages/core/src/things/transaction.ts +++ b/packages/ethereum/src/things/transaction.ts @@ -1,13 +1,13 @@ import Errors from "./errors"; -import {Data} from "./json-rpc/json-rpc-data"; -import {Quantity} from "./json-rpc"; +import {Data} from "@ganache/core/src/things/json-rpc/json-rpc-data"; +import {Quantity} from "@ganache/core/src/things/json-rpc"; import params from "./params"; import {Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction} from "ethereumjs-tx"; import * as ethUtil from "ethereumjs-util"; import assert from "assert"; import {decode as rlpDecode} from "rlp"; import {RunTxResult} from "ethereumjs-vm/dist/runTx"; -import {Block} from "../../../ethereum/src/components/block-manager"; +import {Block} from "../components/block-manager"; import TransactionReceipt from "./transaction-receipt"; const MAX_UINT64 = (1n << 64n) - 1n; diff --git a/packages/ethereum/src/wallet.ts b/packages/ethereum/src/wallet.ts index 987e418f37..b7b7fb9fb7 100644 --- a/packages/ethereum/src/wallet.ts +++ b/packages/ethereum/src/wallet.ts @@ -1,7 +1,7 @@ -import {Data} from "../../core/src/things/json-rpc"; -import Address from "../../core/src/things/address"; +import {Data} from "@ganache/core/src/things/json-rpc"; +import Address from "./things/address"; import EthereumOptions from "./options"; -import Account from "../../core/src/things/account"; +import Account from "./things/account"; import {toChecksumAddress} from "ethereumjs-util"; export default class Wallet { diff --git a/packages/tezos/package.json b/packages/tezos/package.json index f237fc1ccf..6ef51fd458 100644 --- a/packages/tezos/package.json +++ b/packages/tezos/package.json @@ -26,5 +26,10 @@ }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "dependencies": { + "@ganache/core": "^2.2.1", + "@ganache/ethereum": "^2.2.1", + "@ganache/utils": "^2.2.1" } } diff --git a/packages/tezos/src/api.ts b/packages/tezos/src/api.ts index 9a25f70b62..4c43242b2f 100644 --- a/packages/tezos/src/api.ts +++ b/packages/tezos/src/api.ts @@ -1,4 +1,4 @@ -import Api from "../../core/src/interfaces/api"; +import Api from "@ganache/core/src/interfaces/api"; export default class TezosApi implements Api { readonly [index: string]: (...args: any) => Promise; diff --git a/packages/tezos/src/index.ts b/packages/tezos/src/index.ts index ff38faf1ca..7564151f2d 100644 --- a/packages/tezos/src/index.ts +++ b/packages/tezos/src/index.ts @@ -1,9 +1,9 @@ import Emittery from "emittery"; -import {RequestType} from "../../core/src/types"; -import Connector from "../../core/src/interfaces/connector"; +import {RequestType} from "@ganache/core/src/types"; +import Connector from "@ganache/core/src/interfaces/connector"; import TezosProvider from "./provider"; -import JsonRpc from "../../core/src/servers/utils/jsonrpc"; -import ProviderOptions from "../../core/src/options/provider-options"; +import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; +import ProviderOptions from "@ganache/core/src/options/provider-options"; import TezosApi from "./api"; export default class TezosConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> diff --git a/packages/tezos/src/provider.ts b/packages/tezos/src/provider.ts index 65dcd6e6c7..012bcd721d 100644 --- a/packages/tezos/src/provider.ts +++ b/packages/tezos/src/provider.ts @@ -1,8 +1,8 @@ -import {Provider} from "../../core/src/interfaces/provider"; +import {Provider} from "@ganache/core/src/interfaces/provider"; import TezosApi from "./api"; -import {RequestType} from "../../core/src/types"; +import {RequestType} from "@ganache/core/src/types"; import Emittery from "emittery"; -import ProviderOptions from "../../core/src/options/provider-options"; +import ProviderOptions from "@ganache/core/src/options/provider-options"; export default class TezosProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements Provider { diff --git a/packages/utils/package.json b/packages/utils/package.json index eb711acfda..c51d3256ba 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -26,5 +26,10 @@ }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "dependencies": { + "@ganache/core": "^2.2.1", + "@ganache/ethereum": "^2.2.1", + "@ganache/tezos": "^2.2.1" } } From ab9b0324f4ad02c51f48cfe16ad1c22bbc69ac84 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 2 May 2020 21:26:38 -0400 Subject: [PATCH 192/691] Stricter typing and output types --- packages/core/__tests__/server.ts | 3 +-- packages/core/src/@types/tmp.d.ts | 8 -------- packages/core/src/interfaces/api-options.ts | 2 +- packages/core/src/options/options.ts | 2 +- packages/core/src/options/provider-options.ts | 6 +++--- packages/core/src/options/server-options.ts | 2 +- packages/core/src/server.ts | 16 ++++++++-------- packages/core/src/servers/http-server.ts | 2 +- .../src/things/json-rpc/json-rpc-base-types.ts | 6 +++--- .../src/things/json-rpc/json-rpc-quantity.ts | 8 ++++---- packages/core/src/utils/heap.ts | 6 +++--- packages/core/src/utils/request-coordinator.ts | 2 +- scripts/compile.ts | 10 +++++++--- tsconfig.json | 9 ++++++--- 14 files changed, 40 insertions(+), 42 deletions(-) delete mode 100644 packages/core/src/@types/tmp.d.ts diff --git a/packages/core/__tests__/server.ts b/packages/core/__tests__/server.ts index e71cbf34d4..76c15dc326 100644 --- a/packages/core/__tests__/server.ts +++ b/packages/core/__tests__/server.ts @@ -35,7 +35,6 @@ describe("server", () => { if (s && (s.status & Status.open)) { await s.close(); } - s = undefined; } describe("http", () => { async function simpleTest() { @@ -114,7 +113,7 @@ describe("server", () => { // the call to `setup()` above calls `listen()` already. if we call it // again it should fail. s.listen(port, err => { - assert.strict(err.message, `Server is already listening on port: ${port}.`); + assert.strict(err!.message, `Server is already listening on port: ${port}.`); }); } finally { await teardown(); diff --git a/packages/core/src/@types/tmp.d.ts b/packages/core/src/@types/tmp.d.ts deleted file mode 100644 index cf0a102cb4..0000000000 --- a/packages/core/src/@types/tmp.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module "tmp" { - export class Options {} - export class SimpleOptions {} - export const fileSync: any; - export const dirSync: any; - export const tmpNameSync: any; - export const setGracefulCleanup: any; -} diff --git a/packages/core/src/interfaces/api-options.ts b/packages/core/src/interfaces/api-options.ts index 91c1306a10..c6e05288de 100644 --- a/packages/core/src/interfaces/api-options.ts +++ b/packages/core/src/interfaces/api-options.ts @@ -1,4 +1,4 @@ -import Account from "../../../ethereum/src/things/account"; +import Account from "@ganache/ethereum/src/things/account"; /** * Options that ledger implementations must implement diff --git a/packages/core/src/options/options.ts b/packages/core/src/options/options.ts index 7de20035f0..9051201c3f 100644 --- a/packages/core/src/options/options.ts +++ b/packages/core/src/options/options.ts @@ -169,7 +169,7 @@ export default interface Options { hardfork?: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier"; } -export const getDefault: (options: Options) => Options = options => { +export const getDefault: (options?: Options) => Options = options => { // TODO: convert to null propagation operator after updating TS to a version that supports it const networkId = (options ? options.networkId || options.netVersion || options.network_id || options.net_version || Date.now() diff --git a/packages/core/src/options/provider-options.ts b/packages/core/src/options/provider-options.ts index cd83490ac0..6a6b7e6474 100644 --- a/packages/core/src/options/provider-options.ts +++ b/packages/core/src/options/provider-options.ts @@ -1,6 +1,6 @@ import Options, {getDefault as getDefaultOptions} from "./options"; -import TezosConnector from "@ganache/tezos/src/index"; -import EthereumConnector from "@ganache/ethereum/src/index"; +import TezosConnector from "@ganache/tezos"; +import EthereumConnector from "@ganache/ethereum"; import {entropyToMnemonic} from "bip39"; import seedrandom, {seedrandom_prng} from "seedrandom"; import Connector from "../interfaces/connector"; @@ -51,7 +51,7 @@ export default interface ProviderOptions extends Options { flavor?: keyof typeof FlavorMap; } -export const getDefault: (options: ProviderOptions) => ProviderOptions = options => { +export const getDefault: (options?: ProviderOptions) => ProviderOptions = options => { const _options = Object.assign( { subProviders: [], diff --git a/packages/core/src/options/server-options.ts b/packages/core/src/options/server-options.ts index 540709bcb2..1d4f3b3e2b 100644 --- a/packages/core/src/options/server-options.ts +++ b/packages/core/src/options/server-options.ts @@ -23,7 +23,7 @@ export default interface ServerOptions extends ProviderOptions { ws: boolean; } -export const getDefault: (options: ServerOptions) => ServerOptions = options => { +export const getDefault: (options?: ServerOptions) => ServerOptions = options => { return Object.assign( { keepAliveTimeout: 5000, diff --git a/packages/core/src/server.ts b/packages/core/src/server.ts index 1ad1544081..007e0e7c9c 100644 --- a/packages/core/src/server.ts +++ b/packages/core/src/server.ts @@ -6,7 +6,7 @@ import WebsocketServer from "./servers/ws-server"; import HttpServer from "./servers/http-server"; import {Flavors} from "./options/provider-options"; -type Callback = (err: Error) => void +type Callback = (err: Error | null) => void /** * Server ready state constants. @@ -41,11 +41,11 @@ export enum Status { export default class Server { #app: TemplatedApp; #httpServer: HttpServer; - #listenSocket: us_listen_socket; + #listenSocket?: us_listen_socket; #options: ServerOptions; #connector: Flavors; #status = Status.closed; - #websocketServer: WebsocketServer; + #websocketServer: WebsocketServer | null = null; public get provider() { return this.#connector.provider; @@ -75,16 +75,16 @@ export default class Server { if (status === Status.closing) { // if closing const err = new Error(`Cannot start server while it is closing.`); - return callbackIsFunction ? process.nextTick(callback, err) : Promise.reject(err); + return callbackIsFunction ? process.nextTick(callback!, err) : Promise.reject(err); } else if (status & Status.open) { // if open or opening const err = new Error(`Server is already open on port: ${port}.`); - return callbackIsFunction ? process.nextTick(callback, err) : Promise.reject(err); + return callbackIsFunction ? process.nextTick(callback!, err) : Promise.reject(err); } this.#status = Status.opening; - const promise = new Promise(resolve => { + const promise = new Promise((resolve: (listenSocket: false | uWS.us_listen_socket) => void) => { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; @@ -93,11 +93,11 @@ export default class Server { if (listenSocket) { this.#status = Status.open; this.#listenSocket = listenSocket; - if (callbackIsFunction) callback(null); + if (callbackIsFunction) callback!(null); } else { this.#status = Status.closed; const err = new Error(`Failed to listen on port: ${port}.`); - if (callbackIsFunction) callback(err); + if (callbackIsFunction) callback!(err); else throw err; } }); diff --git a/packages/core/src/servers/http-server.ts b/packages/core/src/servers/http-server.ts index 0a237bb37e..63850aa0d6 100644 --- a/packages/core/src/servers/http-server.ts +++ b/packages/core/src/servers/http-server.ts @@ -179,7 +179,7 @@ export default class HttpServer { // handle CORS preflight requests... const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); // OPTIONS responses don't have a body, so respond with `204 No Content`... - sendResponse(response, HttpResponseCodes.NO_CONTENT, null, "", writeHeaders); + sendResponse(response, HttpResponseCodes.NO_CONTENT, undefined, "", writeHeaders); }; public close() { // currently a no op. diff --git a/packages/core/src/things/json-rpc/json-rpc-base-types.ts b/packages/core/src/things/json-rpc/json-rpc-base-types.ts index e02834798e..cbd3719f0a 100644 --- a/packages/core/src/things/json-rpc/json-rpc-base-types.ts +++ b/packages/core/src/things/json-rpc/json-rpc-base-types.ts @@ -106,7 +106,7 @@ export class BaseJsonRpcType = (values: T[], a: number, b: number) => boolean; class Heap { - public length: number; - public array: T[]; + public length: number = 0; + public array: T[] = []; protected readonly less: Comparator; /** @@ -56,7 +56,7 @@ class Heap { * @returns the element with the highest priority. returns `undefined` if * there are no more elements in the heap. */ - public shift(): T { + public shift(): T | undefined { const length = this.length; // if we are empty or about to be empty... diff --git a/packages/core/src/utils/request-coordinator.ts b/packages/core/src/utils/request-coordinator.ts index ad513d14ed..d8fd08eb84 100644 --- a/packages/core/src/utils/request-coordinator.ts +++ b/packages/core/src/utils/request-coordinator.ts @@ -2,7 +2,7 @@ export default class RequestCoordinator { /** * The number of concurrent requests. Set to null for no limit. */ - public limit: number = null; + public limit: number; /** * The pending requests. You can't do anything with this array. diff --git a/scripts/compile.ts b/scripts/compile.ts index 7045e17fab..4623e26d8e 100644 --- a/scripts/compile.ts +++ b/scripts/compile.ts @@ -37,6 +37,8 @@ function serializeToAst(v: any): ts.Expression { return ts.createObjectLiteral( keys.map(k => ts.createPropertyAssignment(ts.createStringLiteral(k), serializeToAst(v[k]))) ); + default: + throw new Error(`Can't serializeToAst ${typeof v}`); } } @@ -67,6 +69,8 @@ function serializeToTypeAst(v: any): ts.TypeNode { ) ) ); + default: + throw new Error(`Can't serializeToTypeAst ${typeof v}`); } } @@ -76,7 +80,7 @@ function resolveJsonImportFromNode(node: ts.ImportDeclaration, sf: SourceFile): } const parseConfigHost: ts.ParseConfigHost = ts.sys; -const configFileName = ts.findConfigFile("./", ts.sys.fileExists, "tsconfig.json"); +const configFileName = ts.findConfigFile("./", ts.sys.fileExists, "tsconfig.json") as string; const configFile = ts.readConfigFile(configFileName, ts.sys.readFile); const compilerOptions = ts.parseJsonConfigFileContent(configFile.config, parseConfigHost, "./"); const project = new Project({ @@ -88,9 +92,9 @@ sources.forEach(sourceFile => { sourceFile.transform(traversal => { const node = traversal.visitChildren(); let jsonPath: string; - if (ts.isImportDeclaration(node) && (jsonPath = resolveJsonImportFromNode(node, sourceFile))) { + if (ts.isImportDeclaration(node) && (jsonPath = resolveJsonImportFromNode(node, sourceFile)) && node.importClause) { const namedBindings = node.importClause.namedBindings; - if ("elements" in namedBindings){ + if (namedBindings && "elements" in namedBindings){ const jsonFile = require(jsonPath); const json = namedBindings.elements.map(element => { const name = element.name.text; diff --git a/tsconfig.json b/tsconfig.json index 5a4dbe3731..4e5e8764ab 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,17 @@ { "compilerOptions": { + "alwaysStrict": true, + "declaration": true, "skipLibCheck": true, "module": "CommonJS", "esModuleInterop": true, "target": "ES2020", - "noImplicitAny": true, "moduleResolution": "node", - "noImplicitThis": true, "noErrorTruncation": true, "sourceMap": true, - "resolveJsonModule": true + "resolveJsonModule": true, + "strict": true, + "newLine": "lf", + "lib": ["ES2020"] } } From 8aa709692380b8882976f6066e4444a2a1426ee5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 4 May 2020 17:45:49 -0400 Subject: [PATCH 193/691] Prevent accidental root-level `tsc` from mucking things up --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 4e5e8764ab..410dc114aa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "outDir": "lib", "alwaysStrict": true, "declaration": true, "skipLibCheck": true, From ef0ac7f5fd4bbbc311992540c7f65557931673e8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 4 May 2020 17:46:23 -0400 Subject: [PATCH 194/691] Move more ethereum logic out of core --- packages/core/__tests__/provider.ts | 4 +- packages/core/__tests__/server.ts | 4 +- packages/core/src/interfaces/connector.ts | 2 +- packages/core/src/server.ts | 2 +- packages/core/src/servers/http-server.ts | 51 ++++++++----------- packages/core/src/servers/ws-server.ts | 2 +- .../things/json-rpc/json-rpc-base-types.ts | 4 +- .../core/src/things/json-rpc/json-rpc-data.ts | 8 +-- packages/core/src/utils/executor.ts | 21 +++++--- packages/ethereum/src/api.ts | 9 ++++ .../ethereum/src/components/block-manager.ts | 2 +- packages/ethereum/src/index.ts | 9 +++- packages/ethereum/src/things/transaction.ts | 2 +- packages/tezos/src/index.ts | 9 ++-- patches/emittery+0.6.0.patch | 29 +++++------ scripts/compile.ts | 6 +-- 16 files changed, 87 insertions(+), 77 deletions(-) diff --git a/packages/core/__tests__/provider.ts b/packages/core/__tests__/provider.ts index 49af9beaa6..e01b50b364 100644 --- a/packages/core/__tests__/provider.ts +++ b/packages/core/__tests__/provider.ts @@ -94,7 +94,7 @@ describe("provider", () => { resolve(); } ); - assert.strictEqual(ret, undefined); + assert.strictEqual(ret, void 0); }); return new Promise(resolve => { const ret = p.sendAsync( @@ -148,7 +148,7 @@ describe("provider", () => { 123, (Buffer.from([1]) as any) as string, null, - undefined, + void 0, {}, [], {foo: "bar"}, diff --git a/packages/core/__tests__/server.ts b/packages/core/__tests__/server.ts index 76c15dc326..9bd0e14bd7 100644 --- a/packages/core/__tests__/server.ts +++ b/packages/core/__tests__/server.ts @@ -322,7 +322,7 @@ describe("server", () => { allCorsHeaders.forEach(header => { assert.strictEqual( resp.header[header.toLowerCase()], - undefined, + void 0, `Non-CORS response should not contain header ${header}` ); }); @@ -345,7 +345,7 @@ describe("server", () => { optionsHeaders.forEach(header => { assert.strictEqual( resp.header[header.toLowerCase()], - undefined, + void 0, `Non-CORS response should not contain header ${header}` ); }); diff --git a/packages/core/src/interfaces/connector.ts b/packages/core/src/interfaces/connector.ts index b21d0fc247..a25e79d4e2 100644 --- a/packages/core/src/interfaces/connector.ts +++ b/packages/core/src/interfaces/connector.ts @@ -18,7 +18,7 @@ export default interface Connector; + handle(payload: RequestFormat, protocol: "http" | "ws"): Promise; /** * Formats the response (from handle) diff --git a/packages/core/src/server.ts b/packages/core/src/server.ts index 007e0e7c9c..5b97069ca5 100644 --- a/packages/core/src/server.ts +++ b/packages/core/src/server.ts @@ -119,7 +119,7 @@ export default class Server { const _listenSocket = this.#listenSocket; this.#status = Status.closing; if (_listenSocket) { - this.#listenSocket = undefined; + this.#listenSocket = void 0; // close the socket to prevent any more connections uWS.us_listen_socket_close(_listenSocket); } diff --git a/packages/core/src/servers/http-server.ts b/packages/core/src/servers/http-server.ts index 63850aa0d6..4625516d12 100644 --- a/packages/core/src/servers/http-server.ts +++ b/packages/core/src/servers/http-server.ts @@ -135,36 +135,25 @@ export default class HttpServer { return; } - const id = payload.id; - const method = payload.method; - switch (method) { - // http connections do not support subscriptions - case "eth_subscribe": - case "eth_unsubscribe": - const error = JsonRpc.Error(id, "-32000", "notifications not supported"); - sendResponse( - response, - HttpResponseCodes.BAD_REQUEST, - ContentTypes.JSON, - JSON.stringify(error), - writeHeaders - ); - break; - default: - // `await`ing the `connector.handle` instead of using `then` causes - // uWS to delay cleaning up the `request` object, which we don't - // neccessarily want to delay. - connector.handle(payload).then(result => { - if (aborted) { - // if the request has been aborted don't try sending (it'll - // cause an `Unhandled promise rejection` if we try) - return; - } - const data = connector.format(result, payload); - sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); - }); - break; - } + connector.handle(payload, "http").then(result => { + if (aborted) { + // if the request has been aborted don't try sending (it'll + // cause an `Unhandled promise rejection` if we try) + return; + } + const data = connector.format(result, payload); + sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); + }).catch(error => { + sendResponse( + response, + HttpResponseCodes.BAD_REQUEST, + ContentTypes.JSON, + // TODO: handle "real" Error objects by properly serializing them. + // JSON.stringify can't do this on its own. + JSON.stringify(error), + writeHeaders + ); + }) } else { if (buffer) { buffer = Buffer.concat([buffer, chunk]); @@ -179,7 +168,7 @@ export default class HttpServer { // handle CORS preflight requests... const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); // OPTIONS responses don't have a body, so respond with `204 No Content`... - sendResponse(response, HttpResponseCodes.NO_CONTENT, undefined, "", writeHeaders); + sendResponse(response, HttpResponseCodes.NO_CONTENT, void 0, "", writeHeaders); }; public close() { // currently a no op. diff --git a/packages/core/src/servers/ws-server.ts b/packages/core/src/servers/ws-server.ts index fea58c651e..716c01aafa 100644 --- a/packages/core/src/servers/ws-server.ts +++ b/packages/core/src/servers/ws-server.ts @@ -23,7 +23,7 @@ export default class WebsocketServer { ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); return; } - const result = await connector.handle(payload); + const result = await connector.handle(payload, "ws"); // The socket may have closed while we were waiting for the response // Don't bother trying to send to it if it was. if (!ws.closed) { diff --git a/packages/core/src/things/json-rpc/json-rpc-base-types.ts b/packages/core/src/things/json-rpc/json-rpc-base-types.ts index cbd3719f0a..47d57c7d60 100644 --- a/packages/core/src/things/json-rpc/json-rpc-base-types.ts +++ b/packages/core/src/things/json-rpc/json-rpc-base-types.ts @@ -108,7 +108,7 @@ export class BaseJsonRpcType {} // api.hasOwnProperty("method") === true + // } + // * Or by the class' prototype: + // class SomeClass { + // method(){} // api.__proto__.hasOwnProperty("method") === true + // } + if ((hasOwn(api.__proto__, methodName) && methodName !== "constructor") || hasOwn(api, methodName)) { const fn = api[methodName]; // just double check, in case a Ledger breaks the rules and adds non-fns // to their Ledger interface. if (typeof fn === "function") { - return fn.apply(api, params); + // use Reflect.apply because fn.apply can be shadowed/overwritten. + return Reflect.apply(fn, api, params || []); } } } diff --git a/packages/ethereum/src/api.ts b/packages/ethereum/src/api.ts index 2f401b470b..e4b77adafb 100644 --- a/packages/ethereum/src/api.ts +++ b/packages/ethereum/src/api.ts @@ -39,6 +39,8 @@ export default class EthereumApi implements Api { private readonly [_options]: EthereumOptions; private readonly [_wallet]: Wallet; + public illegalProperty: any = true; + /** * This is the Ethereum ledger that the provider interacts with. * The only methods permitted on the prototype are the supported json-rpc @@ -442,6 +444,13 @@ export default class EthereumApi implements Api { return await this[_blockchain].queueTransaction(transaction); } + async eth_subscribe(): Promise{ + throw new Error("TODO: implement me"); + } + async eth_unsubscribe(): Promise{ + throw new Error("TODO: implement me"); + } + async eth_call(transaction: any, blockNumber: Buffer | Tag = Tag.LATEST): Promise { const blocks = this[_blockchain].blocks; const parentBlock = await blocks.get(blockNumber); diff --git a/packages/ethereum/src/components/block-manager.ts b/packages/ethereum/src/components/block-manager.ts index f3775ec3d9..62afb28bb4 100644 --- a/packages/ethereum/src/components/block-manager.ts +++ b/packages/ethereum/src/components/block-manager.ts @@ -70,7 +70,7 @@ export default class BlockManager extends Manager { switch (tag) { case Tag.LATEST: return this.latest; - case undefined: + case void 0: case null: // the key is probably a hex string, let nature takes its course. break; diff --git a/packages/ethereum/src/index.ts b/packages/ethereum/src/index.ts index c46923895b..0583c606a6 100644 --- a/packages/ethereum/src/index.ts +++ b/packages/ethereum/src/index.ts @@ -24,8 +24,13 @@ export default class EthereumConnector extends Emittery.Typed<{request: RequestT return JSON.parse(message as any) as JsonRpc.Request; } - handle(payload: JsonRpc.Request): Promise { - return this.#provider.request(payload.method, payload.params); + handle(payload: JsonRpc.Request, protocol: "http" | "ws"): Promise { + const method = payload.method; + if (protocol === "http" && method === "eth_subscribe" || method == "eth_unsubscribe") { + const error = JsonRpc.Error(payload.id, "-32000", "notifications not supported"); + return Promise.reject(error); + } + return this.#provider.request(method, payload.params); } format(result: any, payload: JsonRpc.Request): RecognizedString { diff --git a/packages/ethereum/src/things/transaction.ts b/packages/ethereum/src/things/transaction.ts index 43e82f8e2e..db023c9fbb 100644 --- a/packages/ethereum/src/things/transaction.ts +++ b/packages/ethereum/src/things/transaction.ts @@ -189,7 +189,7 @@ class Transaction extends (EthereumJsTransaction as any) { * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ constructor(data: any, type: number = Transaction.types.none, options?: any) { - super(undefined, options); + super(void 0, options); // EthereumJS-TX Transaction overwrites our `toJSON`, so we overwrite it back here: this.toJSON = Transaction.prototype.toJSON.bind(this); diff --git a/packages/tezos/src/index.ts b/packages/tezos/src/index.ts index 7564151f2d..21e77ec615 100644 --- a/packages/tezos/src/index.ts +++ b/packages/tezos/src/index.ts @@ -22,13 +22,14 @@ export default class TezosConnector extends Emittery.Typed<{request: RequestType return JSON.stringify(JsonRpc.Response("123", result)); } - parse = (message: Buffer) => { + parse(message: Buffer){ return JsonRpc.Request(JSON.parse(message as any)); }; - handle = async (payload: any) => { - const [result] = await this.emit("request", {api: this.#api, method: payload.method, params: payload.params}); - return result; + handle (payload: any, _protocol: "http" | "ws"): Promise { + return this.emit("request", {api: this.#api, method: payload.method, params: payload.params}).then(([result]) => { + return result; + }); }; close() { diff --git a/patches/emittery+0.6.0.patch b/patches/emittery+0.6.0.patch index 97db0f0c3b..c0f70ef4f2 100644 --- a/patches/emittery+0.6.0.patch +++ b/patches/emittery+0.6.0.patch @@ -1,25 +1,22 @@ diff --git a/node_modules/emittery/index.d.ts b/node_modules/emittery/index.d.ts -index d386ddb..0cb4161 100644 +index d386ddb..0937558 100644 --- a/node_modules/emittery/index.d.ts +++ b/node_modules/emittery/index.d.ts -@@ -259,11 +259,15 @@ declare namespace Emittery { - /** - Maps event names to their emitted data type. - */ -- interface Events { -+ interface Args { - // Blocked by https://github.com/microsoft/TypeScript/issues/1863, should be - // `[eventName: EventName]: unknown;` +@@ -256,12 +256,8 @@ declare namespace Emittery { + type UnsubscribeFn = () => void; + type EventNameFromDataMap = Extract; + +- /** +- Maps event names to their emitted data type. +- */ + interface Events { +- // Blocked by https://github.com/microsoft/TypeScript/issues/1863, should be +- // `[eventName: EventName]: unknown;` ++ [eventName: string]: (...args: any[]) => Promise; } -+ interface Events { -+ [eventName: string]: (args: Args) => Promise; -+ } -+ /** - The data provided as `eventData` when listening for `Emittery.listenerAdded` or `Emittery.listenerRemoved`. - */ -@@ -296,27 +300,27 @@ declare namespace Emittery { +@@ -296,27 +292,27 @@ declare namespace Emittery { emitter.emit('end'); // TS compilation error ``` */ diff --git a/scripts/compile.ts b/scripts/compile.ts index 4623e26d8e..f25da7245f 100644 --- a/scripts/compile.ts +++ b/scripts/compile.ts @@ -61,11 +61,11 @@ function serializeToTypeAst(v: any): ts.TypeNode { return ts.createTypeLiteralNode( keys.map(k => ts.createPropertySignature( - undefined, + void 0, ts.createStringLiteral(k), - undefined, + void 0, serializeToTypeAst(v[k]), - undefined + void 0 ) ) ); From e173538f75d3801d03e41ef2db30e4512b32ee35 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 17:22:00 -0400 Subject: [PATCH 195/691] strictNullChecks are annoying --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 410dc114aa..f76560a318 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ "sourceMap": true, "resolveJsonModule": true, "strict": true, + "strictNullChecks": false, "newLine": "lf", "lib": ["ES2020"] } From ed6268d2085ad550dfd9263f4aaa657f814d657c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 17:27:29 -0400 Subject: [PATCH 196/691] Don't make typings rely on built types --- packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/ethereum/package.json | 2 +- packages/tezos/package.json | 2 +- packages/utils/package.json | 2 +- scripts/create.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 891b307af0..42b29ba3a9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -6,7 +6,7 @@ "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", - "typings": "lib/index.d.ts", + "typings": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/packages/core/package.json b/packages/core/package.json index 5c137dee0c..d9f680e1b2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -6,7 +6,7 @@ "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", - "typings": "lib/index.d.ts", + "typings": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/packages/ethereum/package.json b/packages/ethereum/package.json index 1de2737839..fe1acf607f 100644 --- a/packages/ethereum/package.json +++ b/packages/ethereum/package.json @@ -6,7 +6,7 @@ "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", - "typings": "lib/index.d.ts", + "typings": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/packages/tezos/package.json b/packages/tezos/package.json index 6ef51fd458..d94d9bdfc4 100644 --- a/packages/tezos/package.json +++ b/packages/tezos/package.json @@ -6,7 +6,7 @@ "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", - "typings": "lib/index.d.ts", + "typings": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/packages/utils/package.json b/packages/utils/package.json index c51d3256ba..d9dcbe791a 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -6,7 +6,7 @@ "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", - "typings": "lib/index.d.ts", + "typings": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/scripts/create.ts b/scripts/create.ts index 574714f120..00e8c9bfa8 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -28,7 +28,7 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a homepage: "https://github.com/trufflesuite/ganache-core#readme", license: "MIT", main: "lib/index.js", - typings: "lib/index.d.ts", + typings: "src/index.ts", directories: { lib: "lib", test: "__tests__" From de1040e4c7fa44cf3b7e255164aab99071b26268 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 17:27:47 -0400 Subject: [PATCH 197/691] Add clearListeners to Emittery types --- patches/emittery+0.6.0.patch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/patches/emittery+0.6.0.patch b/patches/emittery+0.6.0.patch index c0f70ef4f2..3ef0401545 100644 --- a/patches/emittery+0.6.0.patch +++ b/patches/emittery+0.6.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/emittery/index.d.ts b/node_modules/emittery/index.d.ts -index d386ddb..0937558 100644 +index d386ddb..96d6739 100644 --- a/node_modules/emittery/index.d.ts +++ b/node_modules/emittery/index.d.ts @@ -256,12 +256,8 @@ declare namespace Emittery { @@ -12,11 +12,11 @@ index d386ddb..0937558 100644 interface Events { - // Blocked by https://github.com/microsoft/TypeScript/issues/1863, should be - // `[eventName: EventName]: unknown;` -+ [eventName: string]: (...args: any[]) => Promise; ++ [eventName: string]: (...args: any[]) => any; } /** -@@ -296,27 +292,27 @@ declare namespace Emittery { +@@ -296,28 +292,30 @@ declare namespace Emittery { emitter.emit('end'); // TS compilation error ``` */ @@ -52,5 +52,7 @@ index d386ddb..0937558 100644 - emitSerial>(eventName: Name, eventData: EventDataMap[Name]): Promise; + emitSerial>(eventName: Name, eventData: Parameters[0]): Promise<[ReturnType]>; emitSerial(eventName: Name): Promise; ++ ++ clearListeners(eventName?: EventName): void; } } From 03aca4c77f4d6c4b6a5793d54c49ad0dfc06dcf6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 17:28:57 -0400 Subject: [PATCH 198/691] Simply account constructor logic --- packages/ethereum/src/things/account.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/ethereum/src/things/account.ts b/packages/ethereum/src/things/account.ts index 60c38c6b64..045b9f086e 100644 --- a/packages/ethereum/src/things/account.ts +++ b/packages/ethereum/src/things/account.ts @@ -13,16 +13,16 @@ export default class Account { constructor(address: Address); constructor(buffer: Buffer); constructor(arg: Address | Buffer) { - if (arg instanceof Address) { - this.address = arg; - this.balance = new Quantity(0n); - this.nonce = new Quantity(0n); - } else if (Buffer.isBuffer(arg)) { + if (Buffer.isBuffer(arg)) { const arr = (rlp.decode(arg) as any) as Buffer[]; this.nonce = Quantity.from(arr[0]); this.balance = Quantity.from(arr[1]); this.stateRoot = arr[2]; this.codeHash = arr[3]; + } else { + this.address = arg; + this.balance = new Quantity(0n); + this.nonce = new Quantity(0n); } } public serialize() { From ba24e5839db6bc7795e3fea787dfcb94c5ecfb29 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 17:55:34 -0400 Subject: [PATCH 199/691] Simplify Tag --- packages/ethereum/src/things/tags.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/ethereum/src/things/tags.ts b/packages/ethereum/src/things/tags.ts index d84768f768..2a7963a2e2 100644 --- a/packages/ethereum/src/things/tags.ts +++ b/packages/ethereum/src/things/tags.ts @@ -11,9 +11,8 @@ enum _Tag { namespace Tag { export function normalize(tag: keyof typeof _Tag | Tag): Tag { - let t: Tag; if (typeof tag === "string") { - t = (Tag)[tag.toUpperCase()]; + return (Tag)[tag.toUpperCase()]; } else { switch (tag) { case _Tag.earliest: @@ -24,7 +23,6 @@ namespace Tag { return Tag.PENDING; } } - return t; } } From 5c292779a688e3086b93d1ea2b5867c298e99711 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 17:55:57 -0400 Subject: [PATCH 200/691] Make a promievent --- packages/core/src/things/promievent.ts | 21 ++++++++++++++++ patches/emittery+0.6.0.patch | 33 ++++++++++++++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 packages/core/src/things/promievent.ts diff --git a/packages/core/src/things/promievent.ts b/packages/core/src/things/promievent.ts new file mode 100644 index 0000000000..4464509dac --- /dev/null +++ b/packages/core/src/things/promievent.ts @@ -0,0 +1,21 @@ +import Emittery from "emittery"; + +class PromiEvent extends Promise{ + constructor (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) { + super(executor); + this.init(); + } +} + +interface PromiEvent extends Promise, Emittery {} +applyMixins(PromiEvent, [Promise, Emittery]); + +export default PromiEvent; + +function applyMixins(derivedCtor: any, baseCtors: any[]) { + baseCtors.forEach(baseCtor => { + Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => { + Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name)!); + }); + }); +} diff --git a/patches/emittery+0.6.0.patch b/patches/emittery+0.6.0.patch index 3ef0401545..70739a4c3e 100644 --- a/patches/emittery+0.6.0.patch +++ b/patches/emittery+0.6.0.patch @@ -1,8 +1,17 @@ diff --git a/node_modules/emittery/index.d.ts b/node_modules/emittery/index.d.ts -index d386ddb..96d6739 100644 +index d386ddb..4373fbb 100644 --- a/node_modules/emittery/index.d.ts +++ b/node_modules/emittery/index.d.ts -@@ -256,12 +256,8 @@ declare namespace Emittery { +@@ -77,6 +77,8 @@ declare class Emittery { + */ + static readonly listenerRemoved: unique symbol; + ++ init(){} ++ + /** + Subscribe to an event. + +@@ -256,12 +258,8 @@ declare namespace Emittery { type UnsubscribeFn = () => void; type EventNameFromDataMap = Extract; @@ -16,14 +25,14 @@ index d386ddb..96d6739 100644 } /** -@@ -296,28 +292,30 @@ declare namespace Emittery { +@@ -296,28 +294,30 @@ declare namespace Emittery { emitter.emit('end'); // TS compilation error ``` */ - class Typed extends Emittery { - on>(eventName: Name, listener: (eventData: EventDataMap[Name]) => void): Emittery.UnsubscribeFn; + class Typed { -+ on>(eventName: Name, listener: (eventData: Parameters[0]) => ReturnType): Emittery.UnsubscribeFn; ++ on> (eventName: Name, listener: (eventData: Parameters[0]) => ReturnType): Emittery.UnsubscribeFn; on(eventName: Name, listener: () => void): Emittery.UnsubscribeFn; - events>(eventName: Name): AsyncIterableIterator; @@ -56,3 +65,19 @@ index d386ddb..96d6739 100644 + clearListeners(eventName?: EventName): void; } } + +diff --git a/node_modules/emittery/index.js b/node_modules/emittery/index.js +index 5ddd3db..9a68c72 100644 +--- a/node_modules/emittery/index.js ++++ b/node_modules/emittery/index.js +@@ -182,6 +182,10 @@ class Emittery { + } + + constructor() { ++ this.init(); ++ } ++ ++ init() { + anyMap.set(this, new Set()); + eventsMap.set(this, new Map()); + producersMap.set(this, new Map()); From 07df1c9ec5824424a1e334f8e1f17c4a7d11c0b5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 17:56:24 -0400 Subject: [PATCH 201/691] Update due to stricter type checking --- packages/ethereum/src/things/transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ethereum/src/things/transaction.ts b/packages/ethereum/src/things/transaction.ts index db023c9fbb..5fa5ebebde 100644 --- a/packages/ethereum/src/things/transaction.ts +++ b/packages/ethereum/src/things/transaction.ts @@ -24,7 +24,7 @@ const fakeHash = function (this: Transaction) { if (this._hash != null) { return this._hash; } - return EthereumJsFakeTransaction.prototype.hash.apply(this, arguments); + return EthereumJsFakeTransaction.prototype.hash.apply(this, arguments as unknown as [(boolean | undefined)?]); }; const BUFFER_ZERO = Buffer.from([0]); From 07cbd049e0013062062d5c4aa59dcb175caebd1b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 17:59:03 -0400 Subject: [PATCH 202/691] Ensure from is typed in `eth_sendTransaction` --- packages/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ethereum/src/api.ts b/packages/ethereum/src/api.ts index e4b77adafb..5439781709 100644 --- a/packages/ethereum/src/api.ts +++ b/packages/ethereum/src/api.ts @@ -375,7 +375,7 @@ export default class EthereumApi implements Api { */ async eth_sendTransaction(transaction: any): Promise { let fromString = transaction.from; - let from; + let from: Address; if (fromString) { from = Address.from(transaction.from); fromString = from.toString().toLowerCase(); From 16dc5630359a8c7a7cf0677b843ce97d665151ec Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 18:00:21 -0400 Subject: [PATCH 203/691] Mix types on Pool draining event --- packages/ethereum/src/components/transaction-pool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ethereum/src/components/transaction-pool.ts b/packages/ethereum/src/components/transaction-pool.ts index 396e3000f6..16304cb0b0 100644 --- a/packages/ethereum/src/components/transaction-pool.ts +++ b/packages/ethereum/src/components/transaction-pool.ts @@ -20,7 +20,7 @@ function byNonce(values: Transaction[], a: number, b: number) { return (Quantity.from(values[b].nonce).toBigInt() || 0n) > (Quantity.from(values[a].nonce).toBigInt() || 0n); } -export default class TransactionPool extends Emittery { +export default class TransactionPool extends Emittery.Typed<{drain: (transactions: Map>) => void}> { #options: TransactionPoolOptions; /** From a58ff63595e28318bb953780c0e307a2d7b8ebe6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 7 May 2020 18:01:57 -0400 Subject: [PATCH 204/691] Use promievent --- packages/core/src/interfaces/connector.ts | 7 ++- packages/core/src/server.ts | 4 +- packages/core/src/servers/http-server.ts | 48 +++++++++---------- packages/core/src/servers/ws-server.ts | 36 ++++++++++---- .../src/components/transaction-manager.ts | 3 +- packages/ethereum/src/index.ts | 19 ++++---- packages/tezos/src/index.ts | 3 +- 7 files changed, 73 insertions(+), 47 deletions(-) diff --git a/packages/core/src/interfaces/connector.ts b/packages/core/src/interfaces/connector.ts index a25e79d4e2..b294d3a7e6 100644 --- a/packages/core/src/interfaces/connector.ts +++ b/packages/core/src/interfaces/connector.ts @@ -1,8 +1,9 @@ import {Provider} from "./provider"; -import {RecognizedString} from "uWebSockets.js"; +import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; import Api from "./api"; import Emittery from "emittery"; import {RequestType} from "../types"; +import PromiEvent from "../things/promievent"; export default interface Connector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> { @@ -18,7 +19,9 @@ export default interface Connector; + handle: + | ((payload: RequestFormat, connection: HttpRequest) => Promise) + | ((payload: RequestFormat, connection: WebSocket) => PromiEvent); /** * Formats the response (from handle) diff --git a/packages/core/src/server.ts b/packages/core/src/server.ts index 5b97069ca5..952de427e6 100644 --- a/packages/core/src/server.ts +++ b/packages/core/src/server.ts @@ -2,7 +2,7 @@ import ServerOptions, {getDefault as getDefaultServerOptions} from "./options/se import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; import Connector from "./connector"; -import WebsocketServer from "./servers/ws-server"; +import WebsocketServer, { WebSocketCapableFlavor } from "./servers/ws-server"; import HttpServer from "./servers/http-server"; import {Flavors} from "./options/provider-options"; @@ -62,7 +62,7 @@ export default class Server { const _app = (this.#app = uWS.App()); if (this.#options.ws) { - this.#websocketServer = new WebsocketServer(_app, connector, opts); + this.#websocketServer = new WebsocketServer(_app, connector as WebSocketCapableFlavor, opts); } this.#httpServer = new HttpServer(_app, connector); } diff --git a/packages/core/src/servers/http-server.ts b/packages/core/src/servers/http-server.ts index 4625516d12..d5faef694f 100644 --- a/packages/core/src/servers/http-server.ts +++ b/packages/core/src/servers/http-server.ts @@ -1,9 +1,7 @@ import {TemplatedApp, HttpResponse, HttpRequest, RecognizedString} from "uWebSockets.js"; import ContentTypes from "./utils/content-types"; -import JsonRpc from "./utils/jsonrpc"; import HttpResponseCodes from "./utils/http-response-codes"; -import Connector from "../interfaces/connector"; -import {Apis} from "../options/server-options"; +import {Flavors} from "../options/server-options"; const noop = () => {}; @@ -80,8 +78,8 @@ function sendResponse( } export default class HttpServer { - #connector: Connector; - constructor(app: TemplatedApp, connector: Connector) { + #connector: Flavors; + constructor(app: TemplatedApp, connector: Flavors) { this.#connector = connector; // JSON-RPC routes... @@ -135,25 +133,27 @@ export default class HttpServer { return; } - connector.handle(payload, "http").then(result => { - if (aborted) { - // if the request has been aborted don't try sending (it'll - // cause an `Unhandled promise rejection` if we try) - return; - } - const data = connector.format(result, payload); - sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); - }).catch(error => { - sendResponse( - response, - HttpResponseCodes.BAD_REQUEST, - ContentTypes.JSON, - // TODO: handle "real" Error objects by properly serializing them. - // JSON.stringify can't do this on its own. - JSON.stringify(error), - writeHeaders - ); - }) + connector + .handle(payload, request) + .then((result: any) => { + if (aborted) { + // if the request has been aborted don't try sending (it'll + // cause an `Unhandled promise rejection` if we try) + return; + } + const data = connector.format(result, payload); + sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); + }).catch((error: any) => { + sendResponse( + response, + HttpResponseCodes.BAD_REQUEST, + ContentTypes.JSON, + // TODO: handle "real" Error objects by properly serializing them. + // JSON.stringify can't do this on its own. + JSON.stringify(error), + writeHeaders + ); + }); } else { if (buffer) { buffer = Buffer.concat([buffer, chunk]); diff --git a/packages/core/src/servers/ws-server.ts b/packages/core/src/servers/ws-server.ts index 716c01aafa..ac7b993778 100644 --- a/packages/core/src/servers/ws-server.ts +++ b/packages/core/src/servers/ws-server.ts @@ -1,10 +1,17 @@ import uWS, {TemplatedApp, WebSocket} from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; -import Connector from "../interfaces/connector"; +import { FlavorMap } from "../options/server-options"; + +type WebSocketCapableFlavorMap = { + [k in keyof FlavorMap]: FlavorMap[k]["handle"] extends ((payload: any, connection: WebSocket) => any) ? FlavorMap[k] : never; +}; +export type WebSocketCapableFlavor = { + [k in keyof WebSocketCapableFlavorMap]: WebSocketCapableFlavorMap[k]; +}[keyof WebSocketCapableFlavorMap]; export default class WebsocketServer { #connections = new Set(); - constructor(app: TemplatedApp, connector: Connector, options: any) { + constructor(app: TemplatedApp, connector: WebSocketCapableFlavor, options: any) { app.ws("/", { /* WS Options */ compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression @@ -23,13 +30,24 @@ export default class WebsocketServer { ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); return; } - const result = await connector.handle(payload, "ws"); - // The socket may have closed while we were waiting for the response - // Don't bother trying to send to it if it was. - if (!ws.closed) { - const message = connector.format(result, payload); - ws.send(message, isBinary, true); - } + + const resultEmitter = connector.handle(payload, ws); + resultEmitter.then((result: any) => { + // The socket may have closed while we were waiting for the response + // Don't bother trying to send to it if it was. + if (!ws.closed) { + const message = connector.format(result, payload); + ws.send(message, isBinary, true); + } + }); + resultEmitter.on("result", (result: any) => { + // The socket may have closed while we were waiting for the response + // Don't bother trying to send to it if it was. + if (!ws.closed) { + const message = connector.format(result, payload); + ws.send(message, isBinary, true); + } + }); }, drain: (ws: WebSocket) => { // This is there so tests can detect if a small amount of backpressure is happening and that things will still diff --git a/packages/ethereum/src/components/transaction-manager.ts b/packages/ethereum/src/components/transaction-manager.ts index dfc9c4ec37..9bb69d92df 100644 --- a/packages/ethereum/src/components/transaction-manager.ts +++ b/packages/ethereum/src/components/transaction-manager.ts @@ -3,6 +3,7 @@ import Manager from "./manager"; import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; import levelup from "levelup"; import Blockchain from "../blockchain"; +import Heap from "@ganache/core/src/utils/heap"; export type TransactionManagerOptions = TransactionPoolOptions; @@ -13,7 +14,7 @@ export default class TransactionManager extends Manager { super(blockchain, base, Transaction); this.transactionPool = new TransactionPool(blockchain, options); - this.transactionPool.on("drain", (transactions: Transaction[]) => { + this.transactionPool.on("drain", (transactions: Map>) => { // TODO: create pending block? }); } diff --git a/packages/ethereum/src/index.ts b/packages/ethereum/src/index.ts index 0583c606a6..8e52bbc675 100644 --- a/packages/ethereum/src/index.ts +++ b/packages/ethereum/src/index.ts @@ -5,7 +5,8 @@ import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; import Connector from "@ganache/core/src/interfaces/connector"; import {RequestType} from "@ganache/core/src/types"; import EthereumProvider from "./provider"; -import {RecognizedString} from "uWebSockets.js"; +import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; +import PromiEvent from "@ganache/core/src/things/promievent"; export default class EthereumConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements Connector> { @@ -24,13 +25,15 @@ export default class EthereumConnector extends Emittery.Typed<{request: RequestT return JSON.parse(message as any) as JsonRpc.Request; } - handle(payload: JsonRpc.Request, protocol: "http" | "ws"): Promise { - const method = payload.method; - if (protocol === "http" && method === "eth_subscribe" || method == "eth_unsubscribe") { - const error = JsonRpc.Error(payload.id, "-32000", "notifications not supported"); - return Promise.reject(error); - } - return this.#provider.request(method, payload.params); + handle(payload: JsonRpc.Request, connection: HttpRequest | WebSocket): PromiEvent { + return new PromiEvent((resolve, reject) => { + const method = payload.method; + if (connection.constructor.name === "uWS.HttpRequest" && (method === "eth_subscribe" || method == "eth_unsubscribe")) { + const error = JsonRpc.Error(payload.id, "-32000", "notifications not supported"); + return void reject(error); + } + this.#provider.request(method, payload.params).then(resolve); + }); } format(result: any, payload: JsonRpc.Request): RecognizedString { diff --git a/packages/tezos/src/index.ts b/packages/tezos/src/index.ts index 21e77ec615..77aa10af71 100644 --- a/packages/tezos/src/index.ts +++ b/packages/tezos/src/index.ts @@ -5,6 +5,7 @@ import TezosProvider from "./provider"; import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; import ProviderOptions from "@ganache/core/src/options/provider-options"; import TezosApi from "./api"; +import { HttpRequest } from "uWebSockets.js"; export default class TezosConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements Connector { @@ -26,7 +27,7 @@ export default class TezosConnector extends Emittery.Typed<{request: RequestType return JsonRpc.Request(JSON.parse(message as any)); }; - handle (payload: any, _protocol: "http" | "ws"): Promise { + handle (payload: any, _connection: HttpRequest): Promise { return this.emit("request", {api: this.#api, method: payload.method, params: payload.params}).then(([result]) => { return result; }); From face4cf655fe4e87c4ca4307f2b262d430583445 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 8 May 2020 15:55:11 -0400 Subject: [PATCH 205/691] TYpe the `provider` in tests --- packages/core/__tests__/helpers/getProvider.ts | 3 ++- packages/core/__tests__/ledger.ts | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/core/__tests__/helpers/getProvider.ts b/packages/core/__tests__/helpers/getProvider.ts index d1fdd3b7e0..15954c5e71 100644 --- a/packages/core/__tests__/helpers/getProvider.ts +++ b/packages/core/__tests__/helpers/getProvider.ts @@ -1,9 +1,10 @@ import Ganache from "../../src/"; import ProviderOptions from "../../src/options/provider-options"; +import EthereumProvider from "@ganache/ethereum/src/provider"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; const GetProvider = (options: ProviderOptions = {flavor: "ethereum", mnemonic}) => { - return Ganache.provider(options); + return Ganache.provider(options) as EthereumProvider; }; export default GetProvider; diff --git a/packages/core/__tests__/ledger.ts b/packages/core/__tests__/ledger.ts index bd73ce70a7..442bb58469 100644 --- a/packages/core/__tests__/ledger.ts +++ b/packages/core/__tests__/ledger.ts @@ -1,9 +1,10 @@ import assert from "assert"; import GetProvider from "./helpers/getProvider"; import sleep from "./helpers/sleep"; +import EthereumProvider from "@ganache/ethereum/src/provider"; describe("ledger", () => { - let provider: any; + let provider: EthereumProvider; let accounts: string[]; beforeEach(async () => { @@ -11,8 +12,9 @@ describe("ledger", () => { accounts = await provider.request("eth_accounts"); }) - it("eth_blockNumber", async () => { + it.only("eth_blockNumber", async () => { const blockNumber = parseInt(await provider.request("eth_blockNumber"), 10); + await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -21,10 +23,14 @@ describe("ledger", () => { } ]); // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + await new Promise((resolve) => { + provider.on("message", () => { + resolve(); + }); + }); const nextBlockNumber = await provider.request("eth_blockNumber"); assert.equal(blockNumber, nextBlockNumber - 1); - }).timeout(4000); + }).timeout(400000); it("eth_getBlockByNumber", async () => { await provider.request("eth_sendTransaction", [ From 20f4eba829ba31ab2bacd8c8af943db6450f005f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 8 May 2020 16:31:48 -0400 Subject: [PATCH 206/691] Fix emittery type --- patches/emittery+0.6.0.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/emittery+0.6.0.patch b/patches/emittery+0.6.0.patch index 70739a4c3e..5c16ca78c7 100644 --- a/patches/emittery+0.6.0.patch +++ b/patches/emittery+0.6.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/emittery/index.d.ts b/node_modules/emittery/index.d.ts -index d386ddb..4373fbb 100644 +index d386ddb..f76ed70 100644 --- a/node_modules/emittery/index.d.ts +++ b/node_modules/emittery/index.d.ts @@ -77,6 +77,8 @@ declare class Emittery { @@ -40,8 +40,8 @@ index d386ddb..4373fbb 100644 - once>(eventName: Name): Promise; - once(eventName: Name): Promise; -+ once>(eventName: Name, listener: (eventData: Parameters[0]) => ReturnType): Emittery.UnsubscribeFn; -+ once(eventName: Name, listener: () => void): Emittery.UnsubscribeFn; ++ once>(eventName: Name): Promise>; ++ once(eventName: Name): Promise>; - off>(eventName: Name, listener: (eventData: EventDataMap[Name]) => void): void; + off>(eventName: Name, listener: (eventData: Parameters[0]) => ReturnType): void; From f7cf38a6aabf83732daf1a74bc918b88fc4eccf0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 8 May 2020 22:13:40 -0400 Subject: [PATCH 207/691] Support a subscription paradigm --- packages/core/__tests__/helpers/sleep.ts | 3 - packages/core/__tests__/interface.ts | 2 +- packages/core/__tests__/ledger.ts | 63 +++++----- packages/core/__tests__/provider.ts | 34 +++-- packages/core/__tests__/server.ts | 33 +++-- packages/core/__tests__/temp-tests.ts | 48 ++++---- packages/core/src/connector.ts | 33 +++-- packages/core/src/interfaces/api.ts | 6 - packages/core/src/interfaces/connector.ts | 13 +- packages/core/src/interfaces/provider.ts | 7 +- packages/core/src/server.ts | 5 +- packages/core/src/servers/ws-server.ts | 5 +- packages/core/src/utils/executor.ts | 20 +-- .../core/src/utils/request-coordinator.ts | 42 +++++-- packages/ethereum/src/api.ts | 116 ++++++++++++++++-- packages/ethereum/src/blockchain.ts | 1 + packages/ethereum/src/database.ts | 2 +- packages/ethereum/src/index.ts | 35 ++++-- packages/ethereum/src/provider.ts | 58 +++++---- packages/tezos/src/index.ts | 10 +- packages/tezos/src/provider.ts | 5 +- scripts/create.ts | 5 +- 22 files changed, 336 insertions(+), 210 deletions(-) delete mode 100644 packages/core/__tests__/helpers/sleep.ts diff --git a/packages/core/__tests__/helpers/sleep.ts b/packages/core/__tests__/helpers/sleep.ts deleted file mode 100644 index aead12e8a5..0000000000 --- a/packages/core/__tests__/helpers/sleep.ts +++ /dev/null @@ -1,3 +0,0 @@ -const sleep = (time: number = 500) => new Promise(resolve => setTimeout(resolve, time)); - -export default sleep; diff --git a/packages/core/__tests__/interface.ts b/packages/core/__tests__/interface.ts index 6fe3cad29b..eb3c0098da 100644 --- a/packages/core/__tests__/interface.ts +++ b/packages/core/__tests__/interface.ts @@ -1,4 +1,4 @@ -import Ganache from "../src/"; +import Ganache from "../src"; import * as assert from "assert"; describe("interface", () => { diff --git a/packages/core/__tests__/ledger.ts b/packages/core/__tests__/ledger.ts index 442bb58469..9121d6ba7f 100644 --- a/packages/core/__tests__/ledger.ts +++ b/packages/core/__tests__/ledger.ts @@ -1,6 +1,5 @@ import assert from "assert"; import GetProvider from "./helpers/getProvider"; -import sleep from "./helpers/sleep"; import EthereumProvider from "@ganache/ethereum/src/provider"; describe("ledger", () => { @@ -10,29 +9,26 @@ describe("ledger", () => { beforeEach(async () => { provider = GetProvider(); accounts = await provider.request("eth_accounts"); - }) + }); - it.only("eth_blockNumber", async () => { - const blockNumber = parseInt(await provider.request("eth_blockNumber"), 10); - await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ + it("eth_blockNumber", async () => { + const blockNumber = await provider.request("eth_blockNumber"); + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + const _txHash = await provider.request("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await new Promise((resolve) => { - provider.on("message", () => { - resolve(); - }); - }); + + const _message = await provider.once("message"); const nextBlockNumber = await provider.request("eth_blockNumber"); - assert.equal(blockNumber, nextBlockNumber - 1); - }).timeout(400000); + assert.strictEqual(parseInt(blockNumber, 10), nextBlockNumber - 1); + }); it("eth_getBlockByNumber", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -40,8 +36,7 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const blocks = await Promise.all([ provider.request("eth_getBlockByNumber", ["0x1", true]), provider.request("eth_getBlockByNumber", ["0x1"]) @@ -50,6 +45,7 @@ describe("ledger", () => { }); it("eth_getBlockByHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -57,8 +53,7 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const block = await provider.request("eth_getBlockByNumber", ["0x1"]); const blocks = await Promise.all([ @@ -75,6 +70,7 @@ describe("ledger", () => { }); it("eth_getBlockTransactionCountByHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -82,8 +78,7 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const block = await provider.request("eth_getBlockByNumber", ["0x1"]); const count = await provider.request("eth_getBlockTransactionCountByHash", [block.hash]); @@ -91,6 +86,7 @@ describe("ledger", () => { }); it("eth_getBlockTransactionCountByNumber", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -98,14 +94,14 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const count = await provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]); assert(count, "1"); }); it("eth_getTransactionByBlockNumberAndIndex", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -113,8 +109,7 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const tx = await provider.request("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); assert.equal( @@ -125,6 +120,7 @@ describe("ledger", () => { }); it("eth_getTransactionByBlockHashAndIndex", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -132,8 +128,7 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const block = await provider.request("eth_getBlockByNumber", ["0x1"]); const tx = await provider.request("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); @@ -145,6 +140,7 @@ describe("ledger", () => { }); it("eth_getUncleCountByBlockHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -152,8 +148,7 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const block = await provider.request("eth_getBlockByNumber", ["0x1"]); const count = await provider.request("eth_getUncleCountByBlockHash", [block.hash]); @@ -161,6 +156,7 @@ describe("ledger", () => { }); it("eth_getUncleCountByBlockNumber", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -168,14 +164,14 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const count = await provider.request("eth_getUncleCountByBlockNumber", ["0x1"]); assert(count, "0"); }); it("eth_getTransactionReceipt", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); const hash = await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -183,14 +179,14 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const receipt = await provider.request("eth_getTransactionReceipt", [hash]); assert(receipt.transactionIndex, "0x0"); }); it("eth_getTransactionByHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); const hash = await provider.request("eth_sendTransaction", [ { from: accounts[0], @@ -198,8 +194,7 @@ describe("ledger", () => { value: 1 } ]); - // TODO: remove and replace with something that detects with the block is "mined" - await sleep(); + const _message = await provider.once("message"); const tx = await provider.request("eth_getTransactionByHash", [hash]); assert(tx.transactionIndex, "0x0"); diff --git a/packages/core/__tests__/provider.ts b/packages/core/__tests__/provider.ts index e01b50b364..90e103f675 100644 --- a/packages/core/__tests__/provider.ts +++ b/packages/core/__tests__/provider.ts @@ -1,11 +1,11 @@ -import Ganache from "../src/"; +import Ganache from "../src"; import assert from "assert"; describe("provider", () => { const networkId = "1234"; let p: any; - beforeEach("set up", () => { + beforeEach(() => { p = Ganache.provider({ network_id: networkId }); @@ -36,7 +36,7 @@ describe("provider", () => { }; await p.send("web3_sha3", ["Tim is a swell guy."]); }); - }).timeout(1000); + }); it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { const p = Ganache.provider() as any; @@ -112,6 +112,16 @@ describe("provider", () => { }); }); + // duck punch a property that shouldn't appear on the ledger. we test this + // to make sure that 3rd party ledger implementations can't shoot themselves + // in the foot on accident + it.skip("TODO: allow 'injecting' our own engine or ledger into a provider!", async () => { + (p as any)._engine._ledger.__proto__.illegalProperty = true; + await assert.rejects(p.request("illegalProperty" as any), { + message: "Invalid or unsupported method: illegalProperty" + }); + }); + it("rejects invalid rpc methods", async () => { const illegalMethodNames = [ "toString", @@ -123,21 +133,9 @@ describe("provider", () => { " ", "constructor" ]; - await Promise.all( - illegalMethodNames.map((name: any) => { - return assert.rejects(p.request(name), { - message: `Invalid or unsupported method: ${name}` - }); - }) - ); - - // duck punch a property that shouldn't appear on the ledger. we test this - // to make sure that 3rd party ledger implementations can't shoot themselves - // in the foot on accident - it.skip("TODO: allow 'injecting' our own engine or ledger into a provider!", async () => { - (p as any)._engine._ledger.__proto__.illegalProperty = true; - await assert.rejects(p.request("illegalProperty" as any), { - message: "Invalid or unsupported method: illegalProperty" + illegalMethodNames.forEach((name: any) => { + assert.throws(() => p.request(name), { + message: `Invalid or unsupported method: ${name}` }); }); diff --git a/packages/core/__tests__/server.ts b/packages/core/__tests__/server.ts index 9bd0e14bd7..059d356978 100644 --- a/packages/core/__tests__/server.ts +++ b/packages/core/__tests__/server.ts @@ -1,13 +1,13 @@ -import Ganache from "../src/"; +import Ganache from "../src"; import * as assert from "assert"; import request from "superagent"; import WebSocket from "ws"; -import Server, { Status } from "../src/server"; +import Server, {Status} from "../src/server"; import ServerOptions from "../src/options/server-options"; import http from "http"; import intoStream from "into-stream"; -const IS_WINDOWS = process.platform === "win32" +const IS_WINDOWS = process.platform === "win32"; describe("server", () => { const port = 5234; @@ -19,7 +19,7 @@ describe("server", () => { params: [] }; const logger = { - log: (_message: string) => { } + log: (_message: string) => {} }; let s: Server; async function setup( @@ -32,7 +32,7 @@ describe("server", () => { return s.listen(port); } async function teardown() { - if (s && (s.status & Status.open)) { + if (s && s.status & Status.open) { await s.close(); } } @@ -205,7 +205,7 @@ describe("server", () => { } }); - it("fails to subscribe and unsubscribe over HTTP", async () => { + it("fails to subscribe over HTTP", async () => { await setup(); const jsonRpcJson: any = { jsonrpc: "2.0", @@ -220,10 +220,6 @@ describe("server", () => { status: 400, message: "Bad Request" }); - jsonRpcJson.method = "eth_unsubscribe"; - await assert.rejects(request.post("http://localhost:" + port).send(jsonRpcJson), { - message: "Bad Request" - }); } finally { await teardown(); } @@ -246,7 +242,7 @@ describe("server", () => { try { const requests = methods.map(async method => { const result = await (request as any) - [method]("http://localhost:" + port + "/there-is-no-spoon") + [method]("http://localhost:" + port + "/there-is-no-spoon") .catch((e: any) => e); assert.strictEqual(result.status, 404); assert.strictEqual(result.message, "Not Found"); @@ -307,8 +303,7 @@ describe("server", () => { } finally { await teardown(); } - // On Windows it takes over 2 seconds for req.send to finally fail! - }).timeout(4000); + }); describe("CORS", () => { const optionsHeaders = ["Access-Control-Allow-Methods", "Access-Control-Allow-Headers", "Access-Control-Max-Age"]; @@ -395,8 +390,8 @@ describe("server", () => { }); describe("websocket", () => { - beforeEach("setup", setup); - afterEach("teardown", teardown); + beforeEach(setup); + afterEach(teardown); it("returns the net_version over a websocket", async () => { const ws = new WebSocket("ws://localhost:" + port); @@ -477,7 +472,7 @@ describe("server", () => { { // create tons of data to force websocket backpressure const huge = {} as any; - for (let i = 0; i < 1e6; i++) huge["prop_" + i] = { i, j: i }; + for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; (s.provider as any).request = async () => { return huge; }; @@ -502,8 +497,8 @@ describe("server", () => { reject( new Error( "Possible false positive: Didn't detect backpressure " + - " before receiving a message. Ensure `s.provider.send` is" + - " sending enough data." + " before receiving a message. Ensure `s.provider.send` is" + + " sending enough data." ) ); } @@ -519,6 +514,6 @@ describe("server", () => { // don't break. logger.log = oldLog; } - }).timeout(10000); + }); }); }); diff --git a/packages/core/__tests__/temp-tests.ts b/packages/core/__tests__/temp-tests.ts index 454309f7e6..6f492f1b17 100644 --- a/packages/core/__tests__/temp-tests.ts +++ b/packages/core/__tests__/temp-tests.ts @@ -1,6 +1,7 @@ import Ganache from "../src"; import assert from "assert"; import {Quantity} from "../src/things/json-rpc"; +import EthereumProvider from "@ganache/ethereum/src/provider"; const solc = require("solc"); function compileSolidity(source: string) { @@ -40,7 +41,7 @@ describe("Accounts", () => { it("should respect the BIP99 mnemonic", async () => { const options = {mnemonic}; - const p = Ganache.provider(options) as any; + const p = Ganache.provider(options) as EthereumProvider; const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts[0], expectedAddress); @@ -48,9 +49,10 @@ describe("Accounts", () => { it("eth_sendTransaction", async () => { const options = {mnemonic}; - const p = Ganache.provider(options) as any; + const p = Ganache.provider(options) as EthereumProvider; const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); + await p.send("eth_subscribe", ["newHeads"]); await p.send("eth_sendTransaction", [ { from: accounts[0], @@ -58,15 +60,14 @@ describe("Accounts", () => { value: 1 } ]); - // TODO: remove and replace with something that detects when the block is "mined" - await new Promise(resolve => setTimeout(resolve, 3000)); + await p.once("message"); const balance1_2 = await p.send("eth_getBalance", [accounts[1]]); assert.strictEqual(parseInt(balance1_1) + 1, parseInt(balance1_2)); - }).timeout(5000); + }); it("should create its own mnemonic", async () => { - const p = Ganache.provider() as any; + const p = Ganache.provider() as EthereumProvider; const options = p.getOptions(); assert.deepStrictEqual(typeof options.mnemonic, "string"); }); @@ -97,7 +98,7 @@ describe("Accounts", () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }) as any; + }) as EthereumProvider; const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts.length, 2); }); @@ -125,11 +126,11 @@ describe("Accounts", () => { const p = Ganache.provider({ locked: true, unlocked_accounts: ["0", 1] - }) as any; + }) as EthereumProvider; const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); - const badSend = () => { + const badSend = async () => { return p.send("eth_sendTransaction", [ { from: accounts[2], @@ -140,6 +141,7 @@ describe("Accounts", () => { }; await assert.rejects(badSend, "Error: signer account is locked"); + await p.send("eth_subscribe", ["newHeads"]); await p.send("eth_sendTransaction", [ { from: accounts[0], @@ -148,7 +150,7 @@ describe("Accounts", () => { } ]); - await new Promise(resolve => setTimeout(resolve, 5000)); + await p.once("message"); const balance1_2 = await p.send("eth_getBalance", [accounts[1]]); assert.strictEqual(BigInt(balance1_1) + 123n, BigInt(balance1_2)); @@ -163,11 +165,11 @@ describe("Accounts", () => { } ]); - await new Promise(resolve => setTimeout(resolve, 5000)); + await p.once("message"); const balance0_2 = await p.send("eth_getBalance", [accounts[0]]); assert.strictEqual(BigInt(balance0_1) + 123n, BigInt(balance0_2)); - }).timeout(12000); + }); it("deploys contracts", async () => { const contract = await compileSolidity( @@ -175,8 +177,9 @@ describe("Accounts", () => { ); const p = Ganache.provider({ defaultTransactionGasLimit: Quantity.from(6721975) - }) as any; + }) as EthereumProvider; const accounts = await p.send("eth_accounts"); + const _subscriptionId = await p.send("eth_subscribe", ["newHeads"]); const transactionHash = await p.send("eth_sendTransaction", [ { from: accounts[0], @@ -184,11 +187,9 @@ describe("Accounts", () => { } ]); - // TODO: we need events so badly! - let result = null; - while (!result) { - result = await p.send("eth_getTransactionReceipt", [transactionHash]); - } + await p.once("message"); + + const result = await p.send("eth_getTransactionReceipt", [transactionHash]); assert.strictEqual(result.blockNumber, "0x1"); @@ -199,10 +200,9 @@ describe("Accounts", () => { value: 1 } ]); - let result2 = null; - while (!result2) { - result2 = await p.send("eth_getTransactionReceipt", [hash]); - } + + await p.once("message"); + await p.send("eth_getTransactionReceipt", [hash]); const ret = await p.send("eth_call", [ {from: accounts[3], to: result.contractAddress, gasLimit: 6721975, data: "0xe1cb0e52"} @@ -210,7 +210,7 @@ describe("Accounts", () => { assert.strictEqual(ret, "0x000000000000000000000000000000000000000000000000000000000000007b"); - const storage = await p.send("eth_getStorageAt", [result.contractAddress, 0, "0x2"]); + const storage = await p.send("eth_getStorageAt", [result.contractAddress, 0, "0x2"] as any); assert.strictEqual(storage, "0x05"); }); @@ -218,7 +218,7 @@ describe("Accounts", () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); const p = Ganache.provider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }) as any; + }) as EthereumProvider; const accounts = await p.send("eth_accounts"); const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); assert(true); diff --git a/packages/core/src/connector.ts b/packages/core/src/connector.ts index 404f3e0bca..93125a8a8d 100644 --- a/packages/core/src/connector.ts +++ b/packages/core/src/connector.ts @@ -1,33 +1,32 @@ -import Executor from "./utils/executor"; import RequestCoordinator from "./utils/request-coordinator"; -import ProviderOptions, {FlavorMap, Apis} from "./options/provider-options"; -import {Provider} from "./interfaces/provider"; +import ProviderOptions, {FlavorMap} from "./options/provider-options"; +import Executor from "./utils/executor"; -export default class Connector { +/** + * Loads the connector specified by the given `flavor` + */ +export default { // TODO: set missing defaults automatically - public static initialize(providerOptions: ProviderOptions = {flavor: "ethereum", asyncRequestProcessing: true}) { + initialize: (providerOptions: ProviderOptions = {flavor: "ethereum", asyncRequestProcessing: true}) => { const flavor = providerOptions.flavor || "ethereum"; - const connector = new FlavorMap[flavor](providerOptions); + // Set up our request coordinator to either use FIFO or or async request processing. // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it // for that (yet), instead of "all" (0) or just 1 as we are doing here: const requestCoordinator = new RequestCoordinator(providerOptions.asyncRequestProcessing ? 0 : 1); - + // The Executor is responsible for actually executing the method on the chain/ledger. - // It performs some safety checks to ensure "safe" method execution. - const executor = new Executor(); + // It performs some safety checks to ensure "safe" method execution before passing it + // to a RequestCoordinator. + const executor = new Executor(requestCoordinator); + + const connector = new FlavorMap[flavor](providerOptions, executor); // The request coordinator is initialized in a "paused" state, when the provider is ready we unpause // this lets us accept queue requests before we've even fully initialized. - connector.provider.on("ready", requestCoordinator.resume); - - // A provider should _not_ execute its own methods, but should delegate that responsiblity here. - // Need to cast here because of https://github.com/microsoft/TypeScript/issues/7294 - (connector.provider as Provider).on("request", ({api, method, params}) => { - return requestCoordinator.queue(executor.execute, api, method, params); - }); + connector.on("ready", requestCoordinator.resume); return connector; } -} +}; diff --git a/packages/core/src/interfaces/api.ts b/packages/core/src/interfaces/api.ts index 6da2c15bc5..4d3e3992b1 100644 --- a/packages/core/src/interfaces/api.ts +++ b/packages/core/src/interfaces/api.ts @@ -1,9 +1,3 @@ -export type Emitter = { - on(eventName: string, listener: (eventData?: any) => any): any; - off(eventName: string, listener: (eventData?: any) => any): any; - emit(eventName: string, eventData?: any): any; -}; - /** * Base implementation for an API. * All properties must be `async` callable or return a `Promise` diff --git a/packages/core/src/interfaces/connector.ts b/packages/core/src/interfaces/connector.ts index b294d3a7e6..96ea38203c 100644 --- a/packages/core/src/interfaces/connector.ts +++ b/packages/core/src/interfaces/connector.ts @@ -2,11 +2,12 @@ import {Provider} from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; import Api from "./api"; import Emittery from "emittery"; -import {RequestType} from "../types"; import PromiEvent from "../things/promievent"; -export default interface Connector - extends Emittery.Typed<{request: RequestType}, "ready" | "close"> { +/** + * Connects an arbitrary public chain provider to ganache-core + */ +export default interface Connector extends Emittery.Typed { provider: Provider; /** @@ -16,7 +17,7 @@ export default interface Connector PromiEvent); /** - * Formats the response (from handle) + * Formats the response (returned from `handle`) * @param response * @param payload */ format(result: ResponseFormat, payload: RequestFormat): RecognizedString; + + close(): void; } diff --git a/packages/core/src/interfaces/provider.ts b/packages/core/src/interfaces/provider.ts index dbda6177e4..d752df161b 100644 --- a/packages/core/src/interfaces/provider.ts +++ b/packages/core/src/interfaces/provider.ts @@ -1,8 +1,5 @@ import Api from "./api"; -import Emittery from "emittery"; -import {RequestType} from "../types"; -export interface Provider - extends Emittery.Typed<{request: RequestType}, "ready" | "close"> { - close: () => Promise; +export interface Provider { + } diff --git a/packages/core/src/server.ts b/packages/core/src/server.ts index 952de427e6..e818fb43cb 100644 --- a/packages/core/src/server.ts +++ b/packages/core/src/server.ts @@ -88,7 +88,7 @@ export default class Server { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + this.#app.listen(port as any, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); }).then(listenSocket => { if (listenSocket) { this.#status = Status.open; @@ -131,7 +131,8 @@ export default class Server { // and do all http cleanup, if any this.#httpServer.close(); - await this.provider.close(); + await this.#connector.close(); this.#status = Status.closed; + this.#app = void 0; } } diff --git a/packages/core/src/servers/ws-server.ts b/packages/core/src/servers/ws-server.ts index ac7b993778..936f1e4563 100644 --- a/packages/core/src/servers/ws-server.ts +++ b/packages/core/src/servers/ws-server.ts @@ -32,7 +32,7 @@ export default class WebsocketServer { } const resultEmitter = connector.handle(payload, ws); - resultEmitter.then((result: any) => { + resultEmitter.then(result => { // The socket may have closed while we were waiting for the response // Don't bother trying to send to it if it was. if (!ws.closed) { @@ -40,7 +40,8 @@ export default class WebsocketServer { ws.send(message, isBinary, true); } }); - resultEmitter.on("result", (result: any) => { + + resultEmitter.on("message", (result: any) => { // The socket may have closed while we were waiting for the response // Don't bother trying to send to it if it was. if (!ws.closed) { diff --git a/packages/core/src/utils/executor.ts b/packages/core/src/utils/executor.ts index 9542164ac5..b21d07e3fa 100644 --- a/packages/core/src/utils/executor.ts +++ b/packages/core/src/utils/executor.ts @@ -1,12 +1,17 @@ import Api from "../interfaces/api"; +import { KnownKeys } from "../types"; +import RequestCoordinator from "./request-coordinator"; const hasOwn = ({}).hasOwnProperty.call.bind(({}).hasOwnProperty); export default class Executor { + #requestCoordinator: RequestCoordinator + /** * The Executor handles execution of methods on the given Ledger */ - constructor() { + constructor(requestCoordinator: RequestCoordinator) { + this.#requestCoordinator = requestCoordinator; } /** @@ -14,11 +19,11 @@ export default class Executor { * @param methodName The name of the JSON-RPC method to execute. * @param params The params to pass to the JSON-RPC method. */ - public async execute ( + public execute ( api: T, - methodName: M, - params: Parameters - ): Promise> { + methodName: KnownKeys, + params: Parameters]> + ): Promise<{value: ReturnType]>}> { // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { @@ -32,12 +37,13 @@ export default class Executor { // method(){} // api.__proto__.hasOwnProperty("method") === true // } if ((hasOwn(api.__proto__, methodName) && methodName !== "constructor") || hasOwn(api, methodName)) { + // cast methodName from `KnownKeys & string` back to KnownKeys so our return type isn't weird. const fn = api[methodName]; // just double check, in case a Ledger breaks the rules and adds non-fns // to their Ledger interface. if (typeof fn === "function") { - // use Reflect.apply because fn.apply can be shadowed/overwritten. - return Reflect.apply(fn, api, params || []); + // queue up this method for actual execution: + return this.#requestCoordinator.queue(fn, api, params) as Promise<{value: ReturnType}>; } } } diff --git a/packages/core/src/utils/request-coordinator.ts b/packages/core/src/utils/request-coordinator.ts index d8fd08eb84..de81f59155 100644 --- a/packages/core/src/utils/request-coordinator.ts +++ b/packages/core/src/utils/request-coordinator.ts @@ -1,3 +1,8 @@ +const noop = () => {}; + +/** + * Responsible for managing global concurrent requests. + */ export default class RequestCoordinator { /** * The number of concurrent requests. Set to null for no limit. @@ -7,7 +12,7 @@ export default class RequestCoordinator { /** * The pending requests. You can't do anything with this array. */ - public readonly pending: any[] = []; + public readonly pending: ((...args: any) => Promise)[] = []; /** * The number of tasks currently being processed. @@ -25,7 +30,6 @@ export default class RequestCoordinator { */ constructor(limit: number) { this.limit = limit; - this.#process(); } /** @@ -50,26 +54,38 @@ export default class RequestCoordinator { while (!this.paused && this.pending.length > 0 && (!this.limit || this.runningTasks < this.limit)) { const current = this.pending.shift(); this.runningTasks++; - current().finally(() => { - this.runningTasks--; - this.#process(); - }); + current() + // By now, we've resolved the fn's `value` by sending it to the parent scope. + // But over here, we're also waiting for this fn's _value_ to settle _itself_ (it might be a promise) before + // continuing through the `pending` queue. Because we wait for it again here, it could potentially throw here, + // in which case we just need to catch it and throw the result away. We could probably use + // `Promise.allSettled([current()]).finally` to do this instead of the `current().catch(noop).finally`. /shrug + .catch(noop) + .finally(() => { + this.runningTasks--; + this.#process(); + }) } }; /** * Insert a new function into the queue. */ - public queue = (fn: (...args: any[]) => Promise, ...args: any[]): Promise => { - const promise = new Promise( - (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (value?: {} | PromiseLike<{}>) => void) => { - const executor = () => { - return fn.apply(null, args).then(resolve).catch(reject); - }; + public queue = any>(fn: T, thisArgument: any, argumentsList: Parameters): Promise<{value: ReturnType}> => { + return new Promise((resolve, reject) => { + // const executor is `async` to force the return value into a Promise. + const executor = async () => { + try { + const value = Reflect.apply(fn, thisArgument, argumentsList || []) as ReturnType; + resolve({value}); + return value; + } catch(e) { + reject(e); + } + } this.pending.push(executor); this.#process(); } ); - return promise; }; } diff --git a/packages/ethereum/src/api.ts b/packages/ethereum/src/api.ts index 5439781709..7175a0429b 100644 --- a/packages/ethereum/src/api.ts +++ b/packages/ethereum/src/api.ts @@ -1,19 +1,20 @@ //#region Imports -import Api, { Emitter } from "@ganache/core/src/interfaces/api"; +import Api from "@ganache/core/src/interfaces/api"; import EthereumOptions from "./options"; import {Data, Quantity} from "@ganache/core/src/things/json-rpc"; import Blockchain from "./blockchain"; import Tag from "./things/tags"; import Address, {IndexableAddress} from "./things/address"; import Transaction from "./things/transaction"; -import {Block} from "./components/block-manager"; import Wallet from "./wallet"; -import Account from "ethereumjs-account"; import {decode as rlpDecode} from "rlp"; const createKeccakHash = require("keccak"); // Read in the current ganache version from core's package.json import {name, version} from "../../core/package.json"; +import PromiEvent from "@ganache/core/src/things/promievent"; +import { types } from "util"; +import Emittery from "emittery"; //#endregion //#region Constants @@ -30,17 +31,21 @@ const _blockchain = Symbol("blockchain"); const _isMining = Symbol("isMining"); const _options = Symbol("options"); const _wallet = Symbol("wallet"); +const _filters = Symbol("filters"); + +//#region types +type SubscriptionId = string; +//#endregion export default class EthereumApi implements Api { readonly [index: string]: (...args: any) => Promise; + private readonly [_filters] = new Map(); private readonly [_blockchain]: Blockchain; private [_isMining] = false; private readonly [_options]: EthereumOptions; private readonly [_wallet]: Wallet; - public illegalProperty: any = true; - /** * This is the Ethereum ledger that the provider interacts with. * The only methods permitted on the prototype are the supported json-rpc @@ -48,14 +53,18 @@ export default class EthereumApi implements Api { * @param options * @param ready Callback for when the ledger is fully initialized */ - constructor(options: EthereumOptions, emitter: Emitter) { + constructor(options: EthereumOptions, emitter: Emittery.Typed) { const opts = (this[_options] = options); this[_wallet] = new Wallet(opts); const blockchain = (this[_blockchain] = new Blockchain(options)); - blockchain.on("start", () => emitter.emit("ready")); - emitter.on("close", async () => await blockchain.stop()); + blockchain.on("start", () => { + emitter.emit("connect"); + }); + emitter.on("disconnect", () => { + return blockchain.stop(); + }); } //#region web3 @@ -444,11 +453,94 @@ export default class EthereumApi implements Api { return await this[_blockchain].queueTransaction(transaction); } - async eth_subscribe(): Promise{ - throw new Error("TODO: implement me"); + eth_subscribe(subscriptionName: "newHeads", options?: any): PromiEvent { + switch (subscriptionName) { + case "newHeads": + const filters = this[_filters]; + const promiEvent = new PromiEvent(resolve => { + const subscription = `0x${filters.size.toString(16)}`; + const unsubscribe = this[_blockchain].on("block", (result: any) => { + promiEvent.emit("message", { + type: "eth_subscription", + data: { + result, + subscription + } + }); + }); + filters.set(subscription, unsubscribe); + + resolve(subscription); + }); + return promiEvent; + //case "logs": + // const promiEvent = new PromiEvent(resolve => { + // this.eth_newFilter([paramsz[1]]) + // .then(hexId => { + // resolve(hexId); + // }); + // }); + // promiEvent.then(hexId => { + // this[_filters] + // .get(hexId) + // .on("block") + // .then((block: any) => { + // const blockNumber = block.number; + // return [{ + // fromBlock: blockNumber, + // toBlock: blockNumber + // }]; + // }).then(this.eth_getLogs).then((logs: any) => { + // promiEvent.emit("result", logs); + // }); + // }); + // return promiEvent; + // case 'newPendingTransactions': + // createSubscriptionFilter = self.newPendingTransactionFilter.bind(self) + // break + // case 'newHeads': + // createSubscriptionFilter = self.newBlockFilter.bind(self) + // break + // case 'syncing': + // default: + // cb(new Error('unsupported subscription type')) + // return + } } - async eth_unsubscribe(): Promise{ - throw new Error("TODO: implement me"); + + + async eth_unsubscribe([subscriptionId]: [SubscriptionId]): Promise { + const filters = this[_filters]; + const unsubscribe = filters.get(subscriptionId); + if (unsubscribe) { + filters.delete(subscriptionId); + unsubscribe(); + return true; + } else { + throw new Error(`Subscription ID ${subscriptionId} not found.`) + } + } + + async eth_newBlockFilter(): Promise{ + + } + async eth_newPendingTransactionFilter(): Promise{ + + } + async eth_newFilter(params: any[]): Promise { + + } + async eth_getFilterChanges(): Promise { + + } + async eth_uninstallFilter(): Promise { + + } + async eth_getFilterLogs(): Promise { + } + + async eth_getLogs(): Promise { + } async eth_call(transaction: any, blockNumber: Buffer | Tag = Tag.LATEST): Promise { diff --git a/packages/ethereum/src/blockchain.ts b/packages/ethereum/src/blockchain.ts index a4b150337e..42c93ee3f6 100644 --- a/packages/ethereum/src/blockchain.ts +++ b/packages/ethereum/src/blockchain.ts @@ -141,6 +141,7 @@ export default class Blockchain extends Emittery { }); block.value.transactions = blockData.blockTransactions; this.blocks.putBlock(block); + this.emit("block", block); return block; }); }); diff --git a/packages/ethereum/src/database.ts b/packages/ethereum/src/database.ts index 325521e40a..7dfe86db13 100644 --- a/packages/ethereum/src/database.ts +++ b/packages/ethereum/src/database.ts @@ -111,7 +111,7 @@ export default class Database extends Emittery { try { const ret = fn(); // PSA: don't let vscode (or yourself) rewrite this to `await` the `batch.write` call. - // The `finally` block needs to run _ebfore_ the write promise has resolved. + // The `finally` block needs to run _before_ the write promise has resolved. prom = batch.write().then(() => ret); } finally { rootDb.put = originalPut; diff --git a/packages/ethereum/src/index.ts b/packages/ethereum/src/index.ts index 8e52bbc675..caa2cc326a 100644 --- a/packages/ethereum/src/index.ts +++ b/packages/ethereum/src/index.ts @@ -3,22 +3,31 @@ import Emittery from "emittery"; import EthereumApi from "./api"; import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; import Connector from "@ganache/core/src/interfaces/connector"; -import {RequestType} from "@ganache/core/src/types"; import EthereumProvider from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; import PromiEvent from "@ganache/core/src/things/promievent"; -export default class EthereumConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> +function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest { + return connection.constructor.name === "uWS.HttpRequest" +} + +export default class EthereumConnector extends Emittery.Typed implements Connector> { + #provider: EthereumProvider; + get provider() { return this.#provider; } - constructor(providerOptions?: ProviderOptions) { + constructor(providerOptions: ProviderOptions = null, executor: any) { super(); - this.#provider = new EthereumProvider(providerOptions); + const provider = this.#provider = new EthereumProvider(providerOptions, executor); + provider.on("connect", () => { + // tell the consumer (like a `ganache-core` server) everything is ready + this.emit("ready"); + }); } parse(message: Buffer) { @@ -26,13 +35,17 @@ export default class EthereumConnector extends Emittery.Typed<{request: RequestT } handle(payload: JsonRpc.Request, connection: HttpRequest | WebSocket): PromiEvent { - return new PromiEvent((resolve, reject) => { - const method = payload.method; - if (connection.constructor.name === "uWS.HttpRequest" && (method === "eth_subscribe" || method == "eth_unsubscribe")) { + const method = payload.method; + if (method === "eth_subscribe") { + if (isHttp(connection)) { const error = JsonRpc.Error(payload.id, "-32000", "notifications not supported"); - return void reject(error); + return new PromiEvent((_, reject) => void reject(error)); + } else { + return this.#provider.request("eth_subscribe", payload.params as Parameters); } - this.#provider.request(method, payload.params).then(resolve); + } + return new PromiEvent((resolve, reject) => { + this.#provider.request(method, payload.params as any).then(resolve); }); } @@ -40,4 +53,8 @@ export default class EthereumConnector extends Emittery.Typed<{request: RequestT const json = JsonRpc.Response(payload.id, result); return JSON.stringify(json); } + + close(){ + return this.#provider.disconnect(); + } } diff --git a/packages/ethereum/src/provider.ts b/packages/ethereum/src/provider.ts index 52d1da4346..f66edb4968 100644 --- a/packages/ethereum/src/provider.ts +++ b/packages/ethereum/src/provider.ts @@ -7,12 +7,14 @@ import Account from "./things/account"; import {mnemonicToSeedSync} from "bip39"; import Address from "./things/address"; import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; +import Executor from "@ganache/core/src/utils/executor"; import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; import secp256k1 from "secp256k1"; import HDKey from "hdkey"; -import {RequestType, KnownKeys} from "@ganache/core/src/types"; +import {KnownKeys} from "@ganache/core/src/types"; import {Provider} from "@ganache/core/src/interfaces/provider"; +import PromiEvent from "@ganache/core/src/things/promievent"; const WEI = 1000000000000000000n; @@ -20,25 +22,27 @@ interface Callback { (err?: Error, response?: JsonRpc.Response): void; } -export default class EthereumProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> - implements Provider { +export default class EthereumProvider extends Emittery.Typed + implements Provider + { #options: ProviderOptions; #api: EthereumApi; #wallet: HDKey; + #executor: Executor; - constructor(providerOptions?: ProviderOptions) { + constructor(providerOptions: ProviderOptions = null, executor: Executor) { super(); const _providerOptions = (this.#options = getDefaultProviderOptions(providerOptions)); this.#wallet = HDKey.fromMasterSeed(mnemonicToSeedSync(_providerOptions.mnemonic, null)); + this.#executor = executor; const accounts = this.#initializeAccounts(); // ethereum options' `accounts` are different than the provider options' // `accounts`, fix that up here: const ethereumOptions = (_providerOptions as any) as EthereumOptions; ethereumOptions.accounts = accounts; - const emitter = this as any; - this.#api = new EthereumApi(ethereumOptions, emitter); + this.#api = new EthereumApi(ethereumOptions, this); } // TODO: this doesn't seem like a provider-level function. Maybe we should @@ -106,14 +110,14 @@ export default class EthereumProvider extends Emittery.Typed<{request: RequestTy } public send(payload: JsonRpc.Request, callback?: Callback): void; - public send(method: KnownKeys, params?: any[]): Promise; + public send(method: KnownKeys, params?: Parameters): Promise; public send(arg1: KnownKeys | JsonRpc.Request, arg2?: Callback | any[]): Promise { let method: KnownKeys; - let params: any[]; + let params: any; let response: Promise<{}>; if (typeof arg1 === "string") { method = arg1; - params = arg2 as any[]; + params = arg2 as any; response = this.request(method, params); } else if (typeof arg2 === "function") { // handle backward compatibility with callback-style ganache-core @@ -122,12 +126,14 @@ export default class EthereumProvider extends Emittery.Typed<{request: RequestTy method = payload.method as KnownKeys; params = payload.params; - this.emit("request", {api: this.#api, method, params}) - .then( - ([result]) => - void process.nextTick(callback, null, JsonRpc.Response(payload.id, JSON.parse(JSON.stringify(result)))) - ) - .catch(err => void process.nextTick(callback, err)); + this.request(method, params) + .then((result: any) => { + // execute the callback on the nextTick so errors thrown in the callback + // don't cause the error to buble up to ganache-core + process.nextTick(callback, null, JsonRpc.Response(payload.id, JSON.parse(JSON.stringify(result)))) + }).catch((err: Error) => { + process.nextTick(callback, err); + }); } else { throw new Error( "No callback provided to provider's send function. As of web3 1.0, provider.send " + @@ -154,16 +160,22 @@ export default class EthereumProvider extends Emittery.Typed<{request: RequestTy return this.send(payload, callback); } - public request(method: KnownKeys, params?: any[]): Promise { - return this.emit("request", {api: this.#api, method, params}).then(([result]) => { - // we convert to a string and then back to JSON to create a quick deep - // copy or the result values. - return JSON.parse(JSON.stringify(result)); - }); + public request = KnownKeys>(method: Parameters["length"] extends 0 ? Method : never): any; // ReturnType; + public request = KnownKeys>(method: Method, params: Parameters): any; // ReturnType; + public request = KnownKeys>(method: Method, params?: Parameters) { + return this.#executor.execute(this.#api, method, params).then(result => { + const promise = result.value as PromiseLike>; + if (promise instanceof PromiEvent) { + promise.on("message", (data) => { + this.emit("message" as never, data as never); + }); + } + return promise.then(JSON.stringify).then(JSON.parse); + }) } - public close = async () => { - await this.emit("close"); + public disconnect = async () => { + await this.emit("disconnect"); return; }; } diff --git a/packages/tezos/src/index.ts b/packages/tezos/src/index.ts index 77aa10af71..48565aee0e 100644 --- a/packages/tezos/src/index.ts +++ b/packages/tezos/src/index.ts @@ -7,12 +7,12 @@ import ProviderOptions from "@ganache/core/src/options/provider-options"; import TezosApi from "./api"; import { HttpRequest } from "uWebSockets.js"; -export default class TezosConnector extends Emittery.Typed<{request: RequestType}, "ready" | "close"> +export default class TezosConnector extends Emittery.Typed implements Connector { provider: TezosProvider; #api: TezosApi; - constructor(providerOptions: ProviderOptions) { + constructor(providerOptions: ProviderOptions, requestCoordinator: any) { super(); const api = (this.#api = new TezosApi()); @@ -28,9 +28,9 @@ export default class TezosConnector extends Emittery.Typed<{request: RequestType }; handle (payload: any, _connection: HttpRequest): Promise { - return this.emit("request", {api: this.#api, method: payload.method, params: payload.params}).then(([result]) => { - return result; - }); + + return Promise.resolve(123); + }; close() { diff --git a/packages/tezos/src/provider.ts b/packages/tezos/src/provider.ts index 012bcd721d..41201b12cd 100644 --- a/packages/tezos/src/provider.ts +++ b/packages/tezos/src/provider.ts @@ -8,6 +8,9 @@ export default class TezosProvider extends Emittery.Typed<{request: RequestType< implements Provider { constructor(providerOptions?: ProviderOptions) { super(); + this.emit("ready"); } - public async close () {}; + public async close () { + this.emit("close"); + }; } diff --git a/scripts/create.ts b/scripts/create.ts index 00e8c9bfa8..f3b49b3a21 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -40,9 +40,8 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a }, scripts: { tsc: "ts-node ../../scripts/compile", - test: "nyc npm run mocha -- --throw-deprecation --trace-warnings", - mocha: - "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" + test: "nyc npm run jest -- --throw-deprecation --trace-warnings", + jest: "jest --detectLeaks '__tests__/**.ts'" }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" From 3a3c434b076ef2e3cb49d634514f1fd6da193755 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 8 May 2020 22:25:28 -0400 Subject: [PATCH 208/691] Remove some `any` typings --- packages/core/__tests__/interface.ts | 1 + packages/core/__tests__/provider.ts | 36 +++++++++++---------- packages/core/__tests__/server.ts | 17 +++++----- packages/core/__tests__/temp-tests.ts | 4 +-- packages/core/src/server.ts | 2 +- packages/ethereum/src/api.ts | 6 ++-- packages/ethereum/src/components/manager.ts | 3 +- 7 files changed, 37 insertions(+), 32 deletions(-) diff --git a/packages/core/__tests__/interface.ts b/packages/core/__tests__/interface.ts index eb3c0098da..af0211adf2 100644 --- a/packages/core/__tests__/interface.ts +++ b/packages/core/__tests__/interface.ts @@ -5,6 +5,7 @@ describe("interface", () => { it("has an interface", () => { assert.ok(Ganache.server); assert.ok(Ganache.provider); + // in v3 these two properties were *removed* assert.strictEqual("Server" in Ganache, false); assert.strictEqual("Provider" in Ganache, false); }); diff --git a/packages/core/__tests__/provider.ts b/packages/core/__tests__/provider.ts index 90e103f675..9c49421e56 100644 --- a/packages/core/__tests__/provider.ts +++ b/packages/core/__tests__/provider.ts @@ -1,14 +1,15 @@ import Ganache from "../src"; import assert from "assert"; +import EthereumProvider from "@ganache/ethereum/src/provider"; describe("provider", () => { const networkId = "1234"; - let p: any; + let p: EthereumProvider; beforeEach(() => { p = Ganache.provider({ network_id: networkId - }); + }) as EthereumProvider; }); it("works without passing options", async () => { @@ -21,7 +22,7 @@ describe("provider", () => { assert.strictEqual(msg, " > net_version: undefined"); } }; - const p = Ganache.provider({logger, verbose: true}) as any; + const p = Ganache.provider({logger, verbose: true}) as EthereumProvider; logger.log = msg => { assert.strictEqual(msg, " > net_version: undefined", "doesn't work when no params"); @@ -39,7 +40,7 @@ describe("provider", () => { }); it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { - const p = Ganache.provider() as any; + const p = Ganache.provider() as EthereumProvider; const accounts = await p.send("eth_accounts"); // eth_accounts should always be faster than eth_getBalance; it should // return before eth_getBalance because of the `asyncRequestProcessing` flag @@ -51,7 +52,7 @@ describe("provider", () => { }); it("it processes requests in order when `asyncRequestProcessing` is false", async () => { - const p = Ganache.provider({asyncRequestProcessing: false}) as any; + const p = Ganache.provider({asyncRequestProcessing: false}) as EthereumProvider; const accounts = await p.send("eth_accounts"); // eth_accounts should always be faster than eth_getBalance, but shouldn't // return before eth_getBalance because of the `asyncRequestProcessing` flag @@ -64,7 +65,7 @@ describe("provider", () => { }); it("generates predictable accounts when given a seed", async () => { - const p = Ganache.provider({seed: "temet nosce"}) as any; + const p = Ganache.provider({seed: "temet nosce"}) as EthereumProvider; const accounts = await p.request("eth_accounts"); assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); }); @@ -88,8 +89,8 @@ describe("provider", () => { id: "1", jsonrpc: "2.0", method: "net_version" - } as any, - (_err: Error, result: any): void => { + }, + (_err: Error, result): void => { assert.strictEqual(result.result, networkId); resolve(); } @@ -102,8 +103,8 @@ describe("provider", () => { id: "1", jsonrpc: "2.0", method: "net_version" - } as any, - (_err: Error, result: any): void => { + }, + (_err: Error, result): void => { assert.strictEqual(result.result, networkId); resolve(); } @@ -144,7 +145,8 @@ describe("provider", () => { circular.circular = circular; const illegalMethodTypes = [ 123, - (Buffer.from([1]) as any) as string, + // just cast as string to make TS let me test weird stuff... + (Buffer.from([1]) as unknown) as string, null, void 0, {}, @@ -157,16 +159,16 @@ describe("provider", () => { circular ]; await Promise.all( - illegalMethodTypes.map(methodType => { + illegalMethodTypes.map(method => { return assert.rejects( new Promise((resolve, reject) => { p.send( { id: "1", jsonrpc: "2.0", - method: methodType as any - } as any, - (err: Error, result: any): void => { + method + }, + (err, result): void => { if (err) { reject(err); } else { @@ -176,7 +178,7 @@ describe("provider", () => { ); }), { - message: `Invalid or unsupported method: ${methodType}` + message: `Invalid or unsupported method: ${method}` } ); }) @@ -184,7 +186,7 @@ describe("provider", () => { // make sure we reject non-strings over the EIP-1193 send interface illegalMethodTypes.map(methodType => { - assert.throws(() => p.send(methodType as any), { + assert.throws(() => p.send(methodType), { message: "No callback provided to provider's send function. As of " + "web3 1.0, provider.send is no longer synchronous and must be " + diff --git a/packages/core/__tests__/server.ts b/packages/core/__tests__/server.ts index 059d356978..a7d10b43b7 100644 --- a/packages/core/__tests__/server.ts +++ b/packages/core/__tests__/server.ts @@ -6,6 +6,7 @@ import Server, {Status} from "../src/server"; import ServerOptions from "../src/options/server-options"; import http from "http"; import intoStream from "into-stream"; +import EthereumProvider from "@ganache/ethereum/src/provider"; const IS_WINDOWS = process.platform === "win32"; @@ -241,9 +242,7 @@ describe("server", () => { const methods = ["get", "post", "head", "options", "put", "delete", "patch", "trace"]; try { const requests = methods.map(async method => { - const result = await (request as any) - [method]("http://localhost:" + port + "/there-is-no-spoon") - .catch((e: any) => e); + const result = await request[method]("http://localhost:" + port + "/there-is-no-spoon").catch((e: any) => e); assert.strictEqual(result.status, 404); assert.strictEqual(result.message, "Not Found"); }); @@ -257,10 +256,11 @@ describe("server", () => { await setup(); try { - const oldRequest = (s.provider as any).request; + const provider = s.provider as EthereumProvider; + const oldRequest = provider.request; const req = request.post("http://localhost:" + port); const abortPromise = new Promise(resolve => { - (s.provider as any).request = () => { + provider.request = () => { // abort the request object after intercepting the request req.abort(); return new Promise(innerResolve => { @@ -282,7 +282,7 @@ describe("server", () => { // wait for the server to react to the requesrt's `abort` await abortPromise; - (s.provider as any).request = oldRequest; + provider.request = oldRequest; // now make sure we are still up and running: await simpleTest(); @@ -442,7 +442,8 @@ describe("server", () => { }); it("doesn't crash when the connection is closed while a request is in flight", async () => { - (s.provider as any).request = async () => { + const provider = s.provider as EthereumProvider; + provider.request = async () => { // close our websocket after intercepting the request await s.close(); }; @@ -473,7 +474,7 @@ describe("server", () => { // create tons of data to force websocket backpressure const huge = {} as any; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; - (s.provider as any).request = async () => { + (s.provider as EthereumProvider).request = async () => { return huge; }; } diff --git a/packages/core/__tests__/temp-tests.ts b/packages/core/__tests__/temp-tests.ts index 6f492f1b17..d1674ce2a0 100644 --- a/packages/core/__tests__/temp-tests.ts +++ b/packages/core/__tests__/temp-tests.ts @@ -83,7 +83,7 @@ describe("Accounts", () => { } ); - options.accounts = [] as any; + options.accounts = []; assert.throws( () => { Ganache.provider(options); @@ -210,7 +210,7 @@ describe("Accounts", () => { assert.strictEqual(ret, "0x000000000000000000000000000000000000000000000000000000000000007b"); - const storage = await p.send("eth_getStorageAt", [result.contractAddress, 0, "0x2"] as any); + const storage = await p.send("eth_getStorageAt", [result.contractAddress, 0, "0x2"]); assert.strictEqual(storage, "0x05"); }); diff --git a/packages/core/src/server.ts b/packages/core/src/server.ts index e818fb43cb..9e239cb6e0 100644 --- a/packages/core/src/server.ts +++ b/packages/core/src/server.ts @@ -88,7 +88,7 @@ export default class Server { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - this.#app.listen(port as any, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); }).then(listenSocket => { if (listenSocket) { this.#status = Status.open; diff --git a/packages/ethereum/src/api.ts b/packages/ethereum/src/api.ts index 7175a0429b..2703579d9c 100644 --- a/packages/ethereum/src/api.ts +++ b/packages/ethereum/src/api.ts @@ -291,8 +291,8 @@ export default class EthereumApi implements Api { */ async eth_getStorageAt( address: IndexableAddress, - position: bigint, - blockNumber: Buffer | Tag = Tag.LATEST + position: bigint | number, + blockNumber: string | Buffer | Tag = Tag.LATEST ): Promise { const blockProm = this[_blockchain].blocks.getRaw(blockNumber); @@ -307,7 +307,7 @@ export default class EthereumApi implements Api { const block = await blockProm; if (!block) return Data.from("0x"); - const blockData = (rlpDecode(block) as any) as [ + const blockData = (rlpDecode(block) as unknown) as [ [Buffer, Buffer, Buffer, Buffer /* stateRoot */] /* header */, Buffer[], Buffer[] diff --git a/packages/ethereum/src/components/manager.ts b/packages/ethereum/src/components/manager.ts index e1bc8a6fec..bcadbcb732 100644 --- a/packages/ethereum/src/components/manager.ts +++ b/packages/ethereum/src/components/manager.ts @@ -1,6 +1,7 @@ import levelup from "levelup"; import {Data} from "@ganache/core/src/things/json-rpc"; import Blockchain from "../blockchain"; +import Tag from "../things/tags"; const NOTFOUND = 404; export type Instantiable = {new (...args: any[]): T}; @@ -14,7 +15,7 @@ export default class Manager { this.blockchain = blockchain; this.base = base; } - getRaw(key: string | Buffer): Promise { + getRaw(key: string | Buffer | Tag): Promise { if (typeof key === "string") { key = Data.from(key).toBuffer(); } From 1ed396293bf051bcfd815b792169574a9128ad15 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 8 May 2020 22:31:37 -0400 Subject: [PATCH 209/691] Fix some more typings --- packages/core/__tests__/server.ts | 2 +- packages/core/src/utils/executor.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/__tests__/server.ts b/packages/core/__tests__/server.ts index a7d10b43b7..2b8d0daecd 100644 --- a/packages/core/__tests__/server.ts +++ b/packages/core/__tests__/server.ts @@ -239,7 +239,7 @@ describe("server", () => { it("returns 404 for bad routes", async () => { await setup(); - const methods = ["get", "post", "head", "options", "put", "delete", "patch", "trace"]; + const methods: ["get", "post", "head", "options", "put", "delete", "patch", "trace"] = ["get", "post", "head", "options", "put", "delete", "patch", "trace"]; try { const requests = methods.map(async method => { const result = await request[method]("http://localhost:" + port + "/there-is-no-spoon").catch((e: any) => e); diff --git a/packages/core/src/utils/executor.ts b/packages/core/src/utils/executor.ts index b21d07e3fa..561cde7c59 100644 --- a/packages/core/src/utils/executor.ts +++ b/packages/core/src/utils/executor.ts @@ -43,7 +43,7 @@ export default class Executor { // to their Ledger interface. if (typeof fn === "function") { // queue up this method for actual execution: - return this.#requestCoordinator.queue(fn, api, params) as Promise<{value: ReturnType}>; + return this.#requestCoordinator.queue(fn, api, params); } } } From 90379bea4f492d756ac88fc4b107cdd1703d70cf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 11 May 2020 19:15:29 -0400 Subject: [PATCH 210/691] Remove circular deps --- .gitignore | 2 +- lerna.json | 3 ++- packages/cli/README.md | 11 -------- packages/cli/__tests__/cli.test.ts | 7 ----- packages/cli/npm-shrinkwrap.json | 5 ---- packages/core/src/interfaces/api-options.ts | 8 ------ packages/core/tsconfig.json | 11 -------- scripts/create.ts | 20 +++++++------- {packages => src/chains}/ethereum/README.md | 0 .../chains}/ethereum/__tests__/index.test.ts | 0 .../chains}/ethereum/npm-shrinkwrap.json | 0 .../chains}/ethereum/package.json | 6 ++--- .../src/@types/ethereumjs-block/header.d.ts | 0 .../src/@types/ethereumjs-block/index.d.ts | 0 .../chains}/ethereum/src/@types/hdkey.d.ts | 0 .../ethereum/src/@types/levelup/index.d.ts | 0 .../@types/merkle-patricia-tree/baseTrie.d.ts | 0 .../@types/merkle-patricia-tree/index.d.ts | 0 .../merkle-patricia-tree/readStream.d.ts | 0 .../@types/merkle-patricia-tree/trieNode.d.ts | 0 {packages => src/chains}/ethereum/src/api.ts | 8 +++--- .../chains}/ethereum/src/blockchain.ts | 6 ++--- .../src/components/account-manager.ts | 0 .../ethereum/src/components/block-manager.ts | 2 +- .../ethereum/src/components/manager.ts | 2 +- .../src/components/transaction-manager.ts | 2 +- .../src/components/transaction-pool.ts | 4 +-- .../chains}/ethereum/src/database.ts | 0 .../chains}/ethereum/src/index.ts | 12 ++++----- .../chains}/ethereum/src/miner.ts | 6 ++--- .../chains}/ethereum/src/options.ts | 2 +- .../chains}/ethereum/src/provider.ts | 18 ++++++------- .../chains}/ethereum/src/things/account.ts | 2 +- .../chains}/ethereum/src/things/address.ts | 2 +- .../chains}/ethereum/src/things/errors.ts | 0 .../chains}/ethereum/src/things/params.ts | 0 .../chains}/ethereum/src/things/tags.ts | 0 .../src/things/transaction-receipt.ts | 2 +- .../ethereum/src/things/transaction.ts | 5 ++-- .../chains}/ethereum/src/wallet.ts | 2 +- .../cli => src/chains/ethereum}/tsconfig.json | 2 +- {packages => src/chains}/tezos/README.md | 0 .../chains}/tezos/__tests__/index.test.ts | 0 .../chains}/tezos/npm-shrinkwrap.json | 0 {packages => src/chains}/tezos/package.json | 7 +++-- {packages => src/chains}/tezos/src/api.ts | 2 +- {packages => src/chains}/tezos/src/index.ts | 10 +++---- .../chains}/tezos/src/provider.ts | 6 ++--- {packages => src/chains}/tezos/tsconfig.json | 2 +- {packages => src/packages}/core/README.md | 0 .../core/__tests__/contracts/helloWorld.sol | 0 .../core/__tests__/helpers/getProvider.ts | 2 +- .../packages}/core/__tests__/interface.ts | 0 .../packages}/core/__tests__/ledger.ts | 0 .../packages}/core/__tests__/provider.ts | 6 ++--- .../packages}/core/__tests__/server.ts | 2 +- .../packages}/core/__tests__/temp-tests.ts | 5 ++-- ...a4012219db100ef0a340307869393f9df55ebd470c | 0 ...3d12ccdd1938364fb8e72dcdda25d6baa70992b80f | 0 ...a730bb0282bbaaadd8ac1b94510b69a499527c3505 | 0 ...243a1661770198770b14029eed74f0eb473c79cd83 | 0 .../packages}/core/npm-shrinkwrap.json | 0 {packages => src/packages}/core/package.json | 4 ++- .../packages}/core/src/@types/superagent.d.ts | 0 .../core/src/@types/uWebsockets.js.ts | 0 .../packages}/core/src/connector.ts | 7 ++--- {packages => src/packages}/core/src/index.ts | 2 +- .../core/src/options/server-options.ts | 4 +-- {packages => src/packages}/core/src/server.ts | 6 +++-- .../packages}/core/src/servers/http-server.ts | 0 .../core/src/servers/utils/content-types.ts | 0 .../src/servers/utils/http-response-codes.ts | 0 .../servers/utils/websocket-close-codes.ts | 0 .../views/components/accounts/accounts.marko | 0 .../components/accounts/components/info.marko | 0 .../views/components/app-tabs/index.marko | 0 .../views/components/app-tabs/marko-tag.json | 0 .../src/servers/views/components/blocks.marko | 0 .../src/servers/views/components/events.marko | 0 .../src/servers/views/components/logs.marko | 0 .../views/components/status-bar/index.marko | 0 .../views/components/transactions.marko | 0 .../core/src/servers/views/index.marko | 0 .../packages}/core/src/servers/ws-server.ts | 0 .../utils => src/packages/core}/tsconfig.json | 2 +- src/packages/flavors/README.md | 3 +++ src/packages/flavors/__tests__/index.test.ts | 6 +++++ src/packages/flavors/npm-shrinkwrap.json | 1 + .../cli => src/packages/flavors}/package.json | 7 ++--- src/packages/flavors/src/index.ts | 19 +++++++++++++ src/packages/flavors/tsconfig.json | 9 +++++++ src/packages/options/README.md | 3 +++ src/packages/options/npm-shrinkwrap.json | 1 + src/packages/options/package.json | 27 +++++++++++++++++++ .../packages/options/src}/options.ts | 4 +-- .../packages/options/src}/provider-options.ts | 23 ++-------------- src/packages/options/tsconfig.json | 9 +++++++ {packages => src/packages}/utils/README.md | 0 .../packages}/utils/__tests__/utils.test.ts | 0 .../packages}/utils/npm-shrinkwrap.json | 0 {packages => src/packages}/utils/package.json | 7 +---- .../packages/utils}/src/interfaces/api.ts | 0 .../utils}/src/interfaces/connector.ts | 0 .../utils}/src/interfaces/provider.ts | 0 .../utils}/src/things/json-rpc/index.ts | 0 .../things/json-rpc/json-rpc-base-types.ts | 4 ++- .../src/things/json-rpc/json-rpc-data.ts | 0 .../src/things/json-rpc/json-rpc-quantity.ts | 0 .../packages/utils/src/things}/jsonrpc.ts | 4 +-- .../packages/utils}/src/things/promievent.ts | 0 .../packages/utils}/src/types/index.ts | 0 {packages => src/packages}/utils/src/utils.ts | 0 .../utils}/src/utils/bigint-to-buffer.ts | 0 .../packages/utils}/src/utils/executor.ts | 0 .../packages/utils}/src/utils/heap.ts | 0 .../utils}/src/utils/request-coordinator.ts | 0 .../packages/utils}/tsconfig.json | 2 +- 117 files changed, 182 insertions(+), 164 deletions(-) delete mode 100644 packages/cli/README.md delete mode 100644 packages/cli/__tests__/cli.test.ts delete mode 100644 packages/cli/npm-shrinkwrap.json delete mode 100644 packages/core/src/interfaces/api-options.ts delete mode 100644 packages/core/tsconfig.json rename {packages => src/chains}/ethereum/README.md (100%) rename {packages => src/chains}/ethereum/__tests__/index.test.ts (100%) rename {packages => src/chains}/ethereum/npm-shrinkwrap.json (100%) rename {packages => src/chains}/ethereum/package.json (85%) rename {packages => src/chains}/ethereum/src/@types/ethereumjs-block/header.d.ts (100%) rename {packages => src/chains}/ethereum/src/@types/ethereumjs-block/index.d.ts (100%) rename {packages => src/chains}/ethereum/src/@types/hdkey.d.ts (100%) rename {packages => src/chains}/ethereum/src/@types/levelup/index.d.ts (100%) rename {packages => src/chains}/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts (100%) rename {packages => src/chains}/ethereum/src/@types/merkle-patricia-tree/index.d.ts (100%) rename {packages => src/chains}/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts (100%) rename {packages => src/chains}/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts (100%) rename {packages => src/chains}/ethereum/src/api.ts (98%) rename {packages => src/chains}/ethereum/src/blockchain.ts (98%) rename {packages => src/chains}/ethereum/src/components/account-manager.ts (100%) rename {packages => src/chains}/ethereum/src/components/block-manager.ts (98%) rename {packages => src/chains}/ethereum/src/components/manager.ts (94%) rename {packages => src/chains}/ethereum/src/components/transaction-manager.ts (94%) rename {packages => src/chains}/ethereum/src/components/transaction-pool.ts (98%) rename {packages => src/chains}/ethereum/src/database.ts (100%) rename {packages => src/chains}/ethereum/src/index.ts (82%) rename {packages => src/chains}/ethereum/src/miner.ts (98%) rename {packages => src/chains}/ethereum/src/options.ts (84%) rename {packages => src/chains}/ethereum/src/provider.ts (92%) rename {packages => src/chains}/ethereum/src/things/account.ts (93%) rename {packages => src/chains}/ethereum/src/things/address.ts (64%) rename {packages => src/chains}/ethereum/src/things/errors.ts (100%) rename {packages => src/chains}/ethereum/src/things/params.ts (100%) rename {packages => src/chains}/ethereum/src/things/tags.ts (100%) rename {packages => src/chains}/ethereum/src/things/transaction-receipt.ts (96%) rename {packages => src/chains}/ethereum/src/things/transaction.ts (98%) rename {packages => src/chains}/ethereum/src/wallet.ts (98%) rename {packages/cli => src/chains/ethereum}/tsconfig.json (65%) rename {packages => src/chains}/tezos/README.md (100%) rename {packages => src/chains}/tezos/__tests__/index.test.ts (100%) rename {packages => src/chains}/tezos/npm-shrinkwrap.json (100%) rename {packages => src/chains}/tezos/package.json (82%) rename {packages => src/chains}/tezos/src/api.ts (77%) rename {packages => src/chains}/tezos/src/index.ts (66%) rename {packages => src/chains}/tezos/src/provider.ts (65%) rename {packages => src/chains}/tezos/tsconfig.json (65%) rename {packages => src/packages}/core/README.md (100%) rename {packages => src/packages}/core/__tests__/contracts/helloWorld.sol (100%) rename {packages => src/packages}/core/__tests__/helpers/getProvider.ts (84%) rename {packages => src/packages}/core/__tests__/interface.ts (100%) rename {packages => src/packages}/core/__tests__/ledger.ts (100%) rename {packages => src/packages}/core/__tests__/provider.ts (98%) rename {packages => src/packages}/core/__tests__/server.ts (99%) rename {packages => src/packages}/core/__tests__/temp-tests.ts (97%) rename {packages => src/packages}/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c (100%) rename {packages => src/packages}/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f (100%) rename {packages => src/packages}/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 (100%) rename {packages => src/packages}/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 (100%) rename {packages => src/packages}/core/npm-shrinkwrap.json (100%) rename {packages => src/packages}/core/package.json (89%) rename {packages => src/packages}/core/src/@types/superagent.d.ts (100%) rename {packages => src/packages}/core/src/@types/uWebsockets.js.ts (100%) rename {packages => src/packages}/core/src/connector.ts (83%) rename {packages => src/packages}/core/src/index.ts (80%) rename {packages => src/packages}/core/src/options/server-options.ts (90%) rename {packages => src/packages}/core/src/server.ts (95%) rename {packages => src/packages}/core/src/servers/http-server.ts (100%) rename {packages => src/packages}/core/src/servers/utils/content-types.ts (100%) rename {packages => src/packages}/core/src/servers/utils/http-response-codes.ts (100%) rename {packages => src/packages}/core/src/servers/utils/websocket-close-codes.ts (100%) rename {packages => src/packages}/core/src/servers/views/components/accounts/accounts.marko (100%) rename {packages => src/packages}/core/src/servers/views/components/accounts/components/info.marko (100%) rename {packages => src/packages}/core/src/servers/views/components/app-tabs/index.marko (100%) rename {packages => src/packages}/core/src/servers/views/components/app-tabs/marko-tag.json (100%) rename {packages => src/packages}/core/src/servers/views/components/blocks.marko (100%) rename {packages => src/packages}/core/src/servers/views/components/events.marko (100%) rename {packages => src/packages}/core/src/servers/views/components/logs.marko (100%) rename {packages => src/packages}/core/src/servers/views/components/status-bar/index.marko (100%) rename {packages => src/packages}/core/src/servers/views/components/transactions.marko (100%) rename {packages => src/packages}/core/src/servers/views/index.marko (100%) rename {packages => src/packages}/core/src/servers/ws-server.ts (100%) rename {packages/utils => src/packages/core}/tsconfig.json (65%) create mode 100644 src/packages/flavors/README.md create mode 100644 src/packages/flavors/__tests__/index.test.ts create mode 100644 src/packages/flavors/npm-shrinkwrap.json rename {packages/cli => src/packages/flavors}/package.json (76%) create mode 100644 src/packages/flavors/src/index.ts create mode 100644 src/packages/flavors/tsconfig.json create mode 100644 src/packages/options/README.md create mode 100644 src/packages/options/npm-shrinkwrap.json create mode 100644 src/packages/options/package.json rename {packages/core/src/options => src/packages/options/src}/options.ts (98%) rename {packages/core/src/options => src/packages/options/src}/provider-options.ts (75%) create mode 100644 src/packages/options/tsconfig.json rename {packages => src/packages}/utils/README.md (100%) rename {packages => src/packages}/utils/__tests__/utils.test.ts (100%) rename {packages => src/packages}/utils/npm-shrinkwrap.json (100%) rename {packages => src/packages}/utils/package.json (79%) rename {packages/core => src/packages/utils}/src/interfaces/api.ts (100%) rename {packages/core => src/packages/utils}/src/interfaces/connector.ts (100%) rename {packages/core => src/packages/utils}/src/interfaces/provider.ts (100%) rename {packages/core => src/packages/utils}/src/things/json-rpc/index.ts (100%) rename {packages/core => src/packages/utils}/src/things/json-rpc/json-rpc-base-types.ts (98%) rename {packages/core => src/packages/utils}/src/things/json-rpc/json-rpc-data.ts (100%) rename {packages/core => src/packages/utils}/src/things/json-rpc/json-rpc-quantity.ts (100%) rename {packages/core/src/servers/utils => src/packages/utils/src/things}/jsonrpc.ts (92%) rename {packages/core => src/packages/utils}/src/things/promievent.ts (100%) rename {packages/core => src/packages/utils}/src/types/index.ts (100%) rename {packages => src/packages}/utils/src/utils.ts (100%) rename {packages/core => src/packages/utils}/src/utils/bigint-to-buffer.ts (100%) rename {packages/core => src/packages/utils}/src/utils/executor.ts (100%) rename {packages/core => src/packages/utils}/src/utils/heap.ts (100%) rename {packages/core => src/packages/utils}/src/utils/request-coordinator.ts (100%) rename {packages/ethereum => src/packages/utils}/tsconfig.json (65%) diff --git a/.gitignore b/.gitignore index 80163b1382..4fa8d4091b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,4 @@ test/testdb/* **/*.marko.js lerna-debug.log npm-debug.log -packages/*/lib +src/**/*/lib diff --git a/lerna.json b/lerna.json index af954df769..e9e2fef347 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,7 @@ { "packages": [ - "packages/*" + "src/packages/*", + "src/chains/*" ], "version": "2.2.1" } diff --git a/packages/cli/README.md b/packages/cli/README.md deleted file mode 100644 index 5ed7bd3c9e..0000000000 --- a/packages/cli/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# `cli` - -> TODO: description - -## Usage - -``` -const cli = require('cli'); - -// TODO: DEMONSTRATE API -``` diff --git a/packages/cli/__tests__/cli.test.ts b/packages/cli/__tests__/cli.test.ts deleted file mode 100644 index 79a6562a9d..0000000000 --- a/packages/cli/__tests__/cli.test.ts +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const cli = require('..'); - -describe('cli', () => { - it('needs tests'); -}); diff --git a/packages/cli/npm-shrinkwrap.json b/packages/cli/npm-shrinkwrap.json deleted file mode 100644 index 84cc6599df..0000000000 --- a/packages/cli/npm-shrinkwrap.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "cli", - "version": "2.2.1", - "lockfileVersion": 1 -} diff --git a/packages/core/src/interfaces/api-options.ts b/packages/core/src/interfaces/api-options.ts deleted file mode 100644 index c6e05288de..0000000000 --- a/packages/core/src/interfaces/api-options.ts +++ /dev/null @@ -1,8 +0,0 @@ -import Account from "@ganache/ethereum/src/things/account"; - -/** - * Options that ledger implementations must implement - */ -export default interface ApiOptions { - accounts?: Account[]; -} diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json deleted file mode 100644 index 5d133e0c3a..0000000000 --- a/packages/core/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "lib" - }, - "include": [ - "src", - "../ethereum/src/@types/merkle-patricia-tree", - "../ethereum/src/@types/levelup", "../ethereum/src/@types/ethereumjs-block", "../ethereum/src/@types/hdkey.d.ts", "../ethereum/src/things/account.ts" - ] -} diff --git a/scripts/create.ts b/scripts/create.ts index f3b49b3a21..e3b0f0ccb5 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -22,8 +22,10 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a const prettierConfig = await prettier.resolveConfig(process.cwd()); name = npa(argv.name as string).name; + const packageName = `@ganache/${name}`; + const pkg = { - name: name, + name: packageName, version: version, homepage: "https://github.com/trufflesuite/ganache-core#readme", license: "MIT", @@ -39,9 +41,9 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a url: "git+https://github.com/trufflesuite/ganache-core.git" }, scripts: { - tsc: "ts-node ../../scripts/compile", - test: "nyc npm run jest -- --throw-deprecation --trace-warnings", - jest: "jest --detectLeaks '__tests__/**.ts'" + tsc: "ts-node ../../../scripts/compile", + test: "nyc npm run mocha -- --throw-deprecation --trace-warnings", + mocha: "mocha --detectLeaks '__tests__/**.ts'" }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" @@ -49,7 +51,7 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a }; const tsConfig = { - extends: "../../tsconfig.json", + extends: "../../../tsconfig.json", compilerOptions: { outDir: "lib" }, @@ -57,7 +59,7 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a }; const shrinkwrap = { - name: name, + name: packageName, version: version, lockfileVersion: 1 }; @@ -65,7 +67,7 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a const testFile = `import assert from "assert"; import ${camelCase(name)} from "../src/"; -describe("@ganache/${name}", () => { +describe("${packageName}", () => { it("needs tests"); })`; @@ -74,7 +76,7 @@ describe("@ganache/${name}", () => { } `; - const dir = join("./packages", name); + const dir = join("./src/packages", name); const tests = join(dir, "__tests__"); const src = join(dir, "src"); @@ -106,7 +108,7 @@ describe("@ganache/${name}", () => { ), writeFile( join(dir, "README.md"), - prettier.format(`# ${name}\n> TODO: description`, {...prettierConfig, parser: "markdown"}) + prettier.format(`# ${packageName}\n> TODO: description`, {...prettierConfig, parser: "markdown"}) ), writeFile(pkgPath, pkgStr), writeFile(join(dir, "npm-shrinkwrap.json"), JSON.stringify(shrinkwrap) + "\n") diff --git a/packages/ethereum/README.md b/src/chains/ethereum/README.md similarity index 100% rename from packages/ethereum/README.md rename to src/chains/ethereum/README.md diff --git a/packages/ethereum/__tests__/index.test.ts b/src/chains/ethereum/__tests__/index.test.ts similarity index 100% rename from packages/ethereum/__tests__/index.test.ts rename to src/chains/ethereum/__tests__/index.test.ts diff --git a/packages/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json similarity index 100% rename from packages/ethereum/npm-shrinkwrap.json rename to src/chains/ethereum/npm-shrinkwrap.json diff --git a/packages/ethereum/package.json b/src/chains/ethereum/package.json similarity index 85% rename from packages/ethereum/package.json rename to src/chains/ethereum/package.json index fe1acf607f..114b257e87 100644 --- a/packages/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -22,13 +22,13 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../scripts/compile" + "tsc": "ts-node ../../../scripts/compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, "dependencies": { - "@ganache/core": "^2.2.1", - "@ganache/utils": "^2.2.1" + "@ganache/utils": "^2.2.1", + "@ganache/options": "^2.2.1" } } diff --git a/packages/ethereum/src/@types/ethereumjs-block/header.d.ts b/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts similarity index 100% rename from packages/ethereum/src/@types/ethereumjs-block/header.d.ts rename to src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts diff --git a/packages/ethereum/src/@types/ethereumjs-block/index.d.ts b/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts similarity index 100% rename from packages/ethereum/src/@types/ethereumjs-block/index.d.ts rename to src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts diff --git a/packages/ethereum/src/@types/hdkey.d.ts b/src/chains/ethereum/src/@types/hdkey.d.ts similarity index 100% rename from packages/ethereum/src/@types/hdkey.d.ts rename to src/chains/ethereum/src/@types/hdkey.d.ts diff --git a/packages/ethereum/src/@types/levelup/index.d.ts b/src/chains/ethereum/src/@types/levelup/index.d.ts similarity index 100% rename from packages/ethereum/src/@types/levelup/index.d.ts rename to src/chains/ethereum/src/@types/levelup/index.d.ts diff --git a/packages/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts similarity index 100% rename from packages/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts rename to src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts diff --git a/packages/ethereum/src/@types/merkle-patricia-tree/index.d.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from packages/ethereum/src/@types/merkle-patricia-tree/index.d.ts rename to src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts diff --git a/packages/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts similarity index 100% rename from packages/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts rename to src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts diff --git a/packages/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts similarity index 100% rename from packages/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts rename to src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts diff --git a/packages/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts similarity index 98% rename from packages/ethereum/src/api.ts rename to src/chains/ethereum/src/api.ts index 2703579d9c..ae30389c12 100644 --- a/packages/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,7 +1,7 @@ //#region Imports -import Api from "@ganache/core/src/interfaces/api"; +import Api from "@ganache/utils/src/interfaces/api"; import EthereumOptions from "./options"; -import {Data, Quantity} from "@ganache/core/src/things/json-rpc"; +import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; import Blockchain from "./blockchain"; import Tag from "./things/tags"; import Address, {IndexableAddress} from "./things/address"; @@ -11,8 +11,8 @@ import {decode as rlpDecode} from "rlp"; const createKeccakHash = require("keccak"); // Read in the current ganache version from core's package.json -import {name, version} from "../../core/package.json"; -import PromiEvent from "@ganache/core/src/things/promievent"; +import {name, version} from "../../../packages/core/package.json"; +import PromiEvent from "@ganache/utils/src/things/promievent"; import { types } from "util"; import Emittery from "emittery"; //#endregion diff --git a/packages/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts similarity index 98% rename from packages/ethereum/src/blockchain.ts rename to src/chains/ethereum/src/blockchain.ts index 42c93ee3f6..389263a6bb 100644 --- a/packages/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -7,10 +7,10 @@ import Trie from "merkle-patricia-tree"; import {BN} from "ethereumjs-util"; import Account from "./things/account"; import {promisify} from "util"; -import {Quantity, Data} from "@ganache/core/src/things/json-rpc"; +import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; -import Heap from "@ganache/core/src/utils/heap"; +import Heap from "@ganache/utils/src/utils/heap"; import Transaction from "./things/transaction"; import Manager from "./components/manager"; import TransactionReceipt from "./things/transaction-receipt"; @@ -202,7 +202,7 @@ export default class Blockchain extends Emittery { // create the genesis block const genesis = this.blocks.next({ // If we were given a timestamp, use it instead of the `_currentTime` - timestamp: ((timestamp as any) / 1000) | 0 || this.#currentTime(), + timestamp: (+timestamp / 1000) | 0 || this.#currentTime(), gasLimit: blockGasLimit.toBuffer(), stateRoot: this.trie.root, number: "0x0" diff --git a/packages/ethereum/src/components/account-manager.ts b/src/chains/ethereum/src/components/account-manager.ts similarity index 100% rename from packages/ethereum/src/components/account-manager.ts rename to src/chains/ethereum/src/components/account-manager.ts diff --git a/packages/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts similarity index 98% rename from packages/ethereum/src/components/block-manager.ts rename to src/chains/ethereum/src/components/block-manager.ts index 62afb28bb4..334614e29e 100644 --- a/packages/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -3,7 +3,7 @@ import Manager from "./manager"; import Tag from "../things/tags"; import levelup from "levelup"; import Blockchain from "../blockchain"; -import {Quantity, Data} from "@ganache/core/src/things/json-rpc"; +import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; import Transaction from "../things/transaction"; import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; diff --git a/packages/ethereum/src/components/manager.ts b/src/chains/ethereum/src/components/manager.ts similarity index 94% rename from packages/ethereum/src/components/manager.ts rename to src/chains/ethereum/src/components/manager.ts index bcadbcb732..5dc853f10d 100644 --- a/packages/ethereum/src/components/manager.ts +++ b/src/chains/ethereum/src/components/manager.ts @@ -1,5 +1,5 @@ import levelup from "levelup"; -import {Data} from "@ganache/core/src/things/json-rpc"; +import {Data} from "@ganache/utils/src/things/json-rpc"; import Blockchain from "../blockchain"; import Tag from "../things/tags"; const NOTFOUND = 404; diff --git a/packages/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts similarity index 94% rename from packages/ethereum/src/components/transaction-manager.ts rename to src/chains/ethereum/src/components/transaction-manager.ts index 9bb69d92df..872c900341 100644 --- a/packages/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -3,7 +3,7 @@ import Manager from "./manager"; import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; import levelup from "levelup"; import Blockchain from "../blockchain"; -import Heap from "@ganache/core/src/utils/heap"; +import Heap from "@ganache/utils/src/utils/heap"; export type TransactionManagerOptions = TransactionPoolOptions; diff --git a/packages/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts similarity index 98% rename from packages/ethereum/src/components/transaction-pool.ts rename to src/chains/ethereum/src/components/transaction-pool.ts index 16304cb0b0..8c49bb6a33 100644 --- a/packages/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -1,8 +1,8 @@ import Emittery from "emittery"; import Blockchain from "../blockchain"; -import Heap from "@ganache/core/src/utils/heap"; +import Heap from "@ganache/utils/src/utils/heap"; import Transaction from "../things/transaction"; -import {Data, Quantity} from "@ganache/core/src/things/json-rpc"; +import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; export type TransactionPoolOptions = { /** diff --git a/packages/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts similarity index 100% rename from packages/ethereum/src/database.ts rename to src/chains/ethereum/src/database.ts diff --git a/packages/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts similarity index 82% rename from packages/ethereum/src/index.ts rename to src/chains/ethereum/src/index.ts index caa2cc326a..0c954cdee9 100644 --- a/packages/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -1,11 +1,11 @@ -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/core/src/options/provider-options"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/flavors/src/provider-options"; import Emittery from "emittery"; import EthereumApi from "./api"; -import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; -import Connector from "@ganache/core/src/interfaces/connector"; +import JsonRpc from "@ganache/utils/src/things/jsonrpc"; +import Connector from "@ganache/utils/src/interfaces/connector"; import EthereumProvider from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; -import PromiEvent from "@ganache/core/src/things/promievent"; +import PromiEvent from "@ganache/utils/src/things/promievent"; function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest { return connection.constructor.name === "uWS.HttpRequest" @@ -44,8 +44,8 @@ export default class EthereumConnector extends Emittery.Typed); } } - return new PromiEvent((resolve, reject) => { - this.#provider.request(method, payload.params as any).then(resolve); + return new PromiEvent((resolve) => { + this.#provider.request(method, payload.params as Parameters).then(resolve); }); } diff --git a/packages/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts similarity index 98% rename from packages/ethereum/src/miner.ts rename to src/chains/ethereum/src/miner.ts index bc60a9d71b..884d330755 100644 --- a/packages/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -1,7 +1,7 @@ import params from "./things/params"; -import Heap from "@ganache/core/src/utils/heap"; +import Heap from "@ganache/utils/src/utils/heap"; import Transaction from "./things/transaction"; -import {Quantity, Data} from "@ganache/core/src/things/json-rpc"; +import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; import {promisify} from "util"; import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; @@ -229,7 +229,7 @@ export default class Miner extends Emittery { timestamp: block.header.timestamp, difficulty: block.header.difficulty, gasLimit: block.header.gasLimit - } as any); + }); this.mine(this.#pending, nextBlock); this.#pending = null; } diff --git a/packages/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts similarity index 84% rename from packages/ethereum/src/options.ts rename to src/chains/ethereum/src/options.ts index 1bd73835ca..46f3620358 100644 --- a/packages/ethereum/src/options.ts +++ b/src/chains/ethereum/src/options.ts @@ -1,4 +1,4 @@ -import Options from "@ganache/core/src/options/provider-options"; +import Options from "@ganache/options/src/provider-options"; import Account from "./things/account"; type EthereumOptions = Pick< diff --git a/packages/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts similarity index 92% rename from packages/ethereum/src/provider.ts rename to src/chains/ethereum/src/provider.ts index f66edb4968..2de2ca2463 100644 --- a/packages/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -1,20 +1,20 @@ -import {Quantity, Data} from "@ganache/core/src/things/json-rpc"; -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/core/src/options/provider-options"; +import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/options/src/provider-options"; import Emittery from "emittery"; import EthereumApi from "./api"; import {publicToAddress, privateToAddress} from "ethereumjs-util"; import Account from "./things/account"; import {mnemonicToSeedSync} from "bip39"; import Address from "./things/address"; -import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; -import Executor from "@ganache/core/src/utils/executor"; +import JsonRpc from "@ganache/utils/src/things/jsonrpc"; +import Executor from "@ganache/utils/src/utils/executor"; import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; import secp256k1 from "secp256k1"; import HDKey from "hdkey"; -import {KnownKeys} from "@ganache/core/src/types"; -import {Provider} from "@ganache/core/src/interfaces/provider"; -import PromiEvent from "@ganache/core/src/things/promievent"; +import {KnownKeys} from "@ganache/utils/src/types"; +import {Provider} from "@ganache/utils/src/interfaces/provider"; +import PromiEvent from "@ganache/utils/src/things/promievent"; const WEI = 1000000000000000000n; @@ -40,7 +40,7 @@ export default class EthereumProvider extends Emittery.Typed; if (typeof arg1 === "string") { method = arg1; - params = arg2 as any; + params = arg2 as Parameters; response = this.request(method, params); } else if (typeof arg2 === "function") { // handle backward compatibility with callback-style ganache-core diff --git a/packages/ethereum/src/things/account.ts b/src/chains/ethereum/src/things/account.ts similarity index 93% rename from packages/ethereum/src/things/account.ts rename to src/chains/ethereum/src/things/account.ts index 045b9f086e..681cf587f9 100644 --- a/packages/ethereum/src/things/account.ts +++ b/src/chains/ethereum/src/things/account.ts @@ -1,4 +1,4 @@ -import {Data, Quantity} from "@ganache/core/src/things/json-rpc"; +import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; import Address from "./address"; import {rlp, KECCAK256_RLP, KECCAK256_NULL} from "ethereumjs-util"; diff --git a/packages/ethereum/src/things/address.ts b/src/chains/ethereum/src/things/address.ts similarity index 64% rename from packages/ethereum/src/things/address.ts rename to src/chains/ethereum/src/things/address.ts index fc8bc1788d..a4b61b7c20 100644 --- a/packages/ethereum/src/things/address.ts +++ b/src/chains/ethereum/src/things/address.ts @@ -1,4 +1,4 @@ -import {IndexableJsonRpcType, Data} from "@ganache/core/src/things/json-rpc"; +import {IndexableJsonRpcType, Data} from "@ganache/utils/src/things/json-rpc"; const Address = Data; diff --git a/packages/ethereum/src/things/errors.ts b/src/chains/ethereum/src/things/errors.ts similarity index 100% rename from packages/ethereum/src/things/errors.ts rename to src/chains/ethereum/src/things/errors.ts diff --git a/packages/ethereum/src/things/params.ts b/src/chains/ethereum/src/things/params.ts similarity index 100% rename from packages/ethereum/src/things/params.ts rename to src/chains/ethereum/src/things/params.ts diff --git a/packages/ethereum/src/things/tags.ts b/src/chains/ethereum/src/things/tags.ts similarity index 100% rename from packages/ethereum/src/things/tags.ts rename to src/chains/ethereum/src/things/tags.ts diff --git a/packages/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts similarity index 96% rename from packages/ethereum/src/things/transaction-receipt.ts rename to src/chains/ethereum/src/things/transaction-receipt.ts index e84a6e65d7..b262471c08 100644 --- a/packages/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -1,7 +1,7 @@ import Transaction from "./transaction"; import {Block} from "../components/block-manager"; import {encode as rlpEncode, decode as rlpDecode} from "rlp"; -import {Data, Quantity} from "@ganache/core/src/things/json-rpc"; +import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; export default class TransactionReceipt { #contractAddress: Buffer; diff --git a/packages/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts similarity index 98% rename from packages/ethereum/src/things/transaction.ts rename to src/chains/ethereum/src/things/transaction.ts index 5fa5ebebde..4d04e127e1 100644 --- a/packages/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -1,6 +1,6 @@ import Errors from "./errors"; -import {Data} from "@ganache/core/src/things/json-rpc/json-rpc-data"; -import {Quantity} from "@ganache/core/src/things/json-rpc"; +import {Data} from "@ganache/utils/src/things/json-rpc/json-rpc-data"; +import {Quantity} from "@ganache/utils/src/things/json-rpc"; import params from "./params"; import {Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction} from "ethereumjs-tx"; import * as ethUtil from "ethereumjs-util"; @@ -173,6 +173,7 @@ function initData(tx: any, data: any) { //#endregion interface Transaction extends Omit {} +// TODO fix the EthereumJsTransaction as any via some "fake" multi-inheritance: class Transaction extends (EthereumJsTransaction as any) { type: number; v: Buffer; diff --git a/packages/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts similarity index 98% rename from packages/ethereum/src/wallet.ts rename to src/chains/ethereum/src/wallet.ts index b7b7fb9fb7..3c4a9d8b30 100644 --- a/packages/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -1,4 +1,4 @@ -import {Data} from "@ganache/core/src/things/json-rpc"; +import {Data} from "@ganache/utils/src/things/json-rpc"; import Address from "./things/address"; import EthereumOptions from "./options"; import Account from "./things/account"; diff --git a/packages/cli/tsconfig.json b/src/chains/ethereum/tsconfig.json similarity index 65% rename from packages/cli/tsconfig.json rename to src/chains/ethereum/tsconfig.json index 1b551f4e9e..62676b00a1 100644 --- a/packages/cli/tsconfig.json +++ b/src/chains/ethereum/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../../tsconfig.json", "compilerOptions": { "outDir": "lib" }, diff --git a/packages/tezos/README.md b/src/chains/tezos/README.md similarity index 100% rename from packages/tezos/README.md rename to src/chains/tezos/README.md diff --git a/packages/tezos/__tests__/index.test.ts b/src/chains/tezos/__tests__/index.test.ts similarity index 100% rename from packages/tezos/__tests__/index.test.ts rename to src/chains/tezos/__tests__/index.test.ts diff --git a/packages/tezos/npm-shrinkwrap.json b/src/chains/tezos/npm-shrinkwrap.json similarity index 100% rename from packages/tezos/npm-shrinkwrap.json rename to src/chains/tezos/npm-shrinkwrap.json diff --git a/packages/tezos/package.json b/src/chains/tezos/package.json similarity index 82% rename from packages/tezos/package.json rename to src/chains/tezos/package.json index d94d9bdfc4..ac1fe163bd 100644 --- a/packages/tezos/package.json +++ b/src/chains/tezos/package.json @@ -22,14 +22,13 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../scripts/compile" + "tsc": "ts-node ../../../scripts/compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, "dependencies": { - "@ganache/core": "^2.2.1", - "@ganache/ethereum": "^2.2.1", - "@ganache/utils": "^2.2.1" + "@ganache/utils": "^2.2.1", + "@ganache/options": "^2.2.1" } } diff --git a/packages/tezos/src/api.ts b/src/chains/tezos/src/api.ts similarity index 77% rename from packages/tezos/src/api.ts rename to src/chains/tezos/src/api.ts index 4c43242b2f..a58e816946 100644 --- a/packages/tezos/src/api.ts +++ b/src/chains/tezos/src/api.ts @@ -1,4 +1,4 @@ -import Api from "@ganache/core/src/interfaces/api"; +import Api from "@ganache/utils/src/interfaces/api"; export default class TezosApi implements Api { readonly [index: string]: (...args: any) => Promise; diff --git a/packages/tezos/src/index.ts b/src/chains/tezos/src/index.ts similarity index 66% rename from packages/tezos/src/index.ts rename to src/chains/tezos/src/index.ts index 48565aee0e..4a1af8af1a 100644 --- a/packages/tezos/src/index.ts +++ b/src/chains/tezos/src/index.ts @@ -1,9 +1,7 @@ import Emittery from "emittery"; -import {RequestType} from "@ganache/core/src/types"; -import Connector from "@ganache/core/src/interfaces/connector"; +import Connector from "@ganache/utils/src/interfaces/connector"; import TezosProvider from "./provider"; -import JsonRpc from "@ganache/core/src/servers/utils/jsonrpc"; -import ProviderOptions from "@ganache/core/src/options/provider-options"; +import ProviderOptions from "@ganache/options/src/provider-options"; import TezosApi from "./api"; import { HttpRequest } from "uWebSockets.js"; @@ -20,11 +18,11 @@ export default class TezosConnector extends Emittery.Typed { diff --git a/packages/tezos/src/provider.ts b/src/chains/tezos/src/provider.ts similarity index 65% rename from packages/tezos/src/provider.ts rename to src/chains/tezos/src/provider.ts index 41201b12cd..d2546fe073 100644 --- a/packages/tezos/src/provider.ts +++ b/src/chains/tezos/src/provider.ts @@ -1,8 +1,8 @@ -import {Provider} from "@ganache/core/src/interfaces/provider"; +import {Provider} from "@ganache/utils/src/interfaces/provider"; import TezosApi from "./api"; -import {RequestType} from "@ganache/core/src/types"; +import {RequestType} from "@ganache/utils/src/types"; import Emittery from "emittery"; -import ProviderOptions from "@ganache/core/src/options/provider-options"; +import ProviderOptions from "@ganache/options/src/provider-options"; export default class TezosProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> implements Provider { diff --git a/packages/tezos/tsconfig.json b/src/chains/tezos/tsconfig.json similarity index 65% rename from packages/tezos/tsconfig.json rename to src/chains/tezos/tsconfig.json index 1b551f4e9e..62676b00a1 100644 --- a/packages/tezos/tsconfig.json +++ b/src/chains/tezos/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../../tsconfig.json", "compilerOptions": { "outDir": "lib" }, diff --git a/packages/core/README.md b/src/packages/core/README.md similarity index 100% rename from packages/core/README.md rename to src/packages/core/README.md diff --git a/packages/core/__tests__/contracts/helloWorld.sol b/src/packages/core/__tests__/contracts/helloWorld.sol similarity index 100% rename from packages/core/__tests__/contracts/helloWorld.sol rename to src/packages/core/__tests__/contracts/helloWorld.sol diff --git a/packages/core/__tests__/helpers/getProvider.ts b/src/packages/core/__tests__/helpers/getProvider.ts similarity index 84% rename from packages/core/__tests__/helpers/getProvider.ts rename to src/packages/core/__tests__/helpers/getProvider.ts index 15954c5e71..51e373b746 100644 --- a/packages/core/__tests__/helpers/getProvider.ts +++ b/src/packages/core/__tests__/helpers/getProvider.ts @@ -1,5 +1,5 @@ import Ganache from "../../src/"; -import ProviderOptions from "../../src/options/provider-options"; +import ProviderOptions from "@ganache/options/src/provider-options"; import EthereumProvider from "@ganache/ethereum/src/provider"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; diff --git a/packages/core/__tests__/interface.ts b/src/packages/core/__tests__/interface.ts similarity index 100% rename from packages/core/__tests__/interface.ts rename to src/packages/core/__tests__/interface.ts diff --git a/packages/core/__tests__/ledger.ts b/src/packages/core/__tests__/ledger.ts similarity index 100% rename from packages/core/__tests__/ledger.ts rename to src/packages/core/__tests__/ledger.ts diff --git a/packages/core/__tests__/provider.ts b/src/packages/core/__tests__/provider.ts similarity index 98% rename from packages/core/__tests__/provider.ts rename to src/packages/core/__tests__/provider.ts index 9c49421e56..48e05d6816 100644 --- a/packages/core/__tests__/provider.ts +++ b/src/packages/core/__tests__/provider.ts @@ -134,14 +134,14 @@ describe("provider", () => { " ", "constructor" ]; - illegalMethodNames.forEach((name: any) => { - assert.throws(() => p.request(name), { + illegalMethodNames.forEach(name => { + assert.throws(() => p.request(name as any), { message: `Invalid or unsupported method: ${name}` }); }); // make sure we reject non-strings over the classical send interface - const circular = {} as any; + const circular:any = {}; circular.circular = circular; const illegalMethodTypes = [ 123, diff --git a/packages/core/__tests__/server.ts b/src/packages/core/__tests__/server.ts similarity index 99% rename from packages/core/__tests__/server.ts rename to src/packages/core/__tests__/server.ts index 2b8d0daecd..36f32c445b 100644 --- a/packages/core/__tests__/server.ts +++ b/src/packages/core/__tests__/server.ts @@ -472,7 +472,7 @@ describe("server", () => { (IS_WINDOWS ? xit : it)("can handle backpressure", async () => { { // create tons of data to force websocket backpressure - const huge = {} as any; + const huge: any = {}; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; (s.provider as EthereumProvider).request = async () => { return huge; diff --git a/packages/core/__tests__/temp-tests.ts b/src/packages/core/__tests__/temp-tests.ts similarity index 97% rename from packages/core/__tests__/temp-tests.ts rename to src/packages/core/__tests__/temp-tests.ts index d1674ce2a0..3eed6e57fe 100644 --- a/packages/core/__tests__/temp-tests.ts +++ b/src/packages/core/__tests__/temp-tests.ts @@ -1,7 +1,8 @@ import Ganache from "../src"; import assert from "assert"; -import {Quantity} from "../src/things/json-rpc"; +import {Quantity} from "@ganache/utils/src/things/json-rpc"; import EthereumProvider from "@ganache/ethereum/src/provider"; +import ProviderOptions from "@ganache/options/src/provider-options"; const solc = require("solc"); function compileSolidity(source: string) { @@ -73,7 +74,7 @@ describe("Accounts", () => { }); it("shouldn't allow initialization without accounts", async () => { - const options = {total_accounts: 0} as any; + const options: ProviderOptions = {total_accounts: 0}; assert.throws( () => { Ganache.provider(options); diff --git a/packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c b/src/packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c similarity index 100% rename from packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c rename to src/packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c diff --git a/packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f b/src/packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f similarity index 100% rename from packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f rename to src/packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f diff --git a/packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 b/src/packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 similarity index 100% rename from packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 rename to src/packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 diff --git a/packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 b/src/packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 similarity index 100% rename from packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 rename to src/packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 diff --git a/packages/core/npm-shrinkwrap.json b/src/packages/core/npm-shrinkwrap.json similarity index 100% rename from packages/core/npm-shrinkwrap.json rename to src/packages/core/npm-shrinkwrap.json diff --git a/packages/core/package.json b/src/packages/core/package.json similarity index 89% rename from packages/core/package.json rename to src/packages/core/package.json index d9f680e1b2..c9af5ef670 100644 --- a/packages/core/package.json +++ b/src/packages/core/package.json @@ -22,7 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../scripts/compile", + "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" }, @@ -30,6 +30,8 @@ "url": "https://github.com/trufflesuite/ganache-core/issues" }, "dependencies": { + "@ganache/options": "^2.2.1", + "@ganache/flavors": "^2.2.1", "@ganache/ethereum": "^2.2.1", "@ganache/tezos": "^2.2.1", "@ganache/utils": "^2.2.1" diff --git a/packages/core/src/@types/superagent.d.ts b/src/packages/core/src/@types/superagent.d.ts similarity index 100% rename from packages/core/src/@types/superagent.d.ts rename to src/packages/core/src/@types/superagent.d.ts diff --git a/packages/core/src/@types/uWebsockets.js.ts b/src/packages/core/src/@types/uWebsockets.js.ts similarity index 100% rename from packages/core/src/@types/uWebsockets.js.ts rename to src/packages/core/src/@types/uWebsockets.js.ts diff --git a/packages/core/src/connector.ts b/src/packages/core/src/connector.ts similarity index 83% rename from packages/core/src/connector.ts rename to src/packages/core/src/connector.ts index 93125a8a8d..5eb93f0404 100644 --- a/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -1,6 +1,7 @@ -import RequestCoordinator from "./utils/request-coordinator"; -import ProviderOptions, {FlavorMap} from "./options/provider-options"; -import Executor from "./utils/executor"; +import RequestCoordinator from "@ganache/utils/src/utils/request-coordinator"; +import {FlavorMap} from "@ganache/flavors"; +import ProviderOptions from "@ganache/options/src/provider-options"; +import Executor from "@ganache/utils/src/utils/executor"; /** * Loads the connector specified by the given `flavor` diff --git a/packages/core/src/index.ts b/src/packages/core/src/index.ts similarity index 80% rename from packages/core/src/index.ts rename to src/packages/core/src/index.ts index d9bcd72e77..83237c4144 100644 --- a/packages/core/src/index.ts +++ b/src/packages/core/src/index.ts @@ -1,5 +1,5 @@ import Connector from "./connector"; -import ProviderOptions from "./options/provider-options"; +import ProviderOptions from "@ganache/options/src/provider-options"; import ServerOptions from "./options/server-options"; import Server from "./server"; diff --git a/packages/core/src/options/server-options.ts b/src/packages/core/src/options/server-options.ts similarity index 90% rename from packages/core/src/options/server-options.ts rename to src/packages/core/src/options/server-options.ts index 1d4f3b3e2b..44d8418938 100644 --- a/packages/core/src/options/server-options.ts +++ b/src/packages/core/src/options/server-options.ts @@ -1,5 +1,5 @@ -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "./provider-options"; -export {Apis, Flavors, FlavorMap} from "./provider-options"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/options/src/provider-options"; +export {Apis, Flavors, FlavorMap} from "@ganache/flavors"; export default interface ServerOptions extends ProviderOptions { /** diff --git a/packages/core/src/server.ts b/src/packages/core/src/server.ts similarity index 95% rename from packages/core/src/server.ts rename to src/packages/core/src/server.ts index 9e239cb6e0..165fb4a0ac 100644 --- a/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -4,7 +4,9 @@ import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; import Connector from "./connector"; import WebsocketServer, { WebSocketCapableFlavor } from "./servers/ws-server"; import HttpServer from "./servers/http-server"; -import {Flavors} from "./options/provider-options"; +import {Flavors} from "@ganache/flavors/src"; +import TezosProvider from "@ganache/tezos/src/provider"; +import EthereumProvider from "@ganache/ethereum/src/provider"; type Callback = (err: Error | null) => void @@ -47,7 +49,7 @@ export default class Server { #status = Status.closed; #websocketServer: WebsocketServer | null = null; - public get provider() { + public get provider(): TezosProvider | EthereumProvider { return this.#connector.provider; } diff --git a/packages/core/src/servers/http-server.ts b/src/packages/core/src/servers/http-server.ts similarity index 100% rename from packages/core/src/servers/http-server.ts rename to src/packages/core/src/servers/http-server.ts diff --git a/packages/core/src/servers/utils/content-types.ts b/src/packages/core/src/servers/utils/content-types.ts similarity index 100% rename from packages/core/src/servers/utils/content-types.ts rename to src/packages/core/src/servers/utils/content-types.ts diff --git a/packages/core/src/servers/utils/http-response-codes.ts b/src/packages/core/src/servers/utils/http-response-codes.ts similarity index 100% rename from packages/core/src/servers/utils/http-response-codes.ts rename to src/packages/core/src/servers/utils/http-response-codes.ts diff --git a/packages/core/src/servers/utils/websocket-close-codes.ts b/src/packages/core/src/servers/utils/websocket-close-codes.ts similarity index 100% rename from packages/core/src/servers/utils/websocket-close-codes.ts rename to src/packages/core/src/servers/utils/websocket-close-codes.ts diff --git a/packages/core/src/servers/views/components/accounts/accounts.marko b/src/packages/core/src/servers/views/components/accounts/accounts.marko similarity index 100% rename from packages/core/src/servers/views/components/accounts/accounts.marko rename to src/packages/core/src/servers/views/components/accounts/accounts.marko diff --git a/packages/core/src/servers/views/components/accounts/components/info.marko b/src/packages/core/src/servers/views/components/accounts/components/info.marko similarity index 100% rename from packages/core/src/servers/views/components/accounts/components/info.marko rename to src/packages/core/src/servers/views/components/accounts/components/info.marko diff --git a/packages/core/src/servers/views/components/app-tabs/index.marko b/src/packages/core/src/servers/views/components/app-tabs/index.marko similarity index 100% rename from packages/core/src/servers/views/components/app-tabs/index.marko rename to src/packages/core/src/servers/views/components/app-tabs/index.marko diff --git a/packages/core/src/servers/views/components/app-tabs/marko-tag.json b/src/packages/core/src/servers/views/components/app-tabs/marko-tag.json similarity index 100% rename from packages/core/src/servers/views/components/app-tabs/marko-tag.json rename to src/packages/core/src/servers/views/components/app-tabs/marko-tag.json diff --git a/packages/core/src/servers/views/components/blocks.marko b/src/packages/core/src/servers/views/components/blocks.marko similarity index 100% rename from packages/core/src/servers/views/components/blocks.marko rename to src/packages/core/src/servers/views/components/blocks.marko diff --git a/packages/core/src/servers/views/components/events.marko b/src/packages/core/src/servers/views/components/events.marko similarity index 100% rename from packages/core/src/servers/views/components/events.marko rename to src/packages/core/src/servers/views/components/events.marko diff --git a/packages/core/src/servers/views/components/logs.marko b/src/packages/core/src/servers/views/components/logs.marko similarity index 100% rename from packages/core/src/servers/views/components/logs.marko rename to src/packages/core/src/servers/views/components/logs.marko diff --git a/packages/core/src/servers/views/components/status-bar/index.marko b/src/packages/core/src/servers/views/components/status-bar/index.marko similarity index 100% rename from packages/core/src/servers/views/components/status-bar/index.marko rename to src/packages/core/src/servers/views/components/status-bar/index.marko diff --git a/packages/core/src/servers/views/components/transactions.marko b/src/packages/core/src/servers/views/components/transactions.marko similarity index 100% rename from packages/core/src/servers/views/components/transactions.marko rename to src/packages/core/src/servers/views/components/transactions.marko diff --git a/packages/core/src/servers/views/index.marko b/src/packages/core/src/servers/views/index.marko similarity index 100% rename from packages/core/src/servers/views/index.marko rename to src/packages/core/src/servers/views/index.marko diff --git a/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts similarity index 100% rename from packages/core/src/servers/ws-server.ts rename to src/packages/core/src/servers/ws-server.ts diff --git a/packages/utils/tsconfig.json b/src/packages/core/tsconfig.json similarity index 65% rename from packages/utils/tsconfig.json rename to src/packages/core/tsconfig.json index 1b551f4e9e..62676b00a1 100644 --- a/packages/utils/tsconfig.json +++ b/src/packages/core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../../tsconfig.json", "compilerOptions": { "outDir": "lib" }, diff --git a/src/packages/flavors/README.md b/src/packages/flavors/README.md new file mode 100644 index 0000000000..0a370b3a7d --- /dev/null +++ b/src/packages/flavors/README.md @@ -0,0 +1,3 @@ +# flavors + +> TODO: description diff --git a/src/packages/flavors/__tests__/index.test.ts b/src/packages/flavors/__tests__/index.test.ts new file mode 100644 index 0000000000..452320c89f --- /dev/null +++ b/src/packages/flavors/__tests__/index.test.ts @@ -0,0 +1,6 @@ +import assert from "assert"; +import flavors from "../src/"; + +describe("@ganache/flavors", () => { + it("needs tests"); +}); diff --git a/src/packages/flavors/npm-shrinkwrap.json b/src/packages/flavors/npm-shrinkwrap.json new file mode 100644 index 0000000000..4846667240 --- /dev/null +++ b/src/packages/flavors/npm-shrinkwrap.json @@ -0,0 +1 @@ +{"name":"@ganache/flavors","version":"2.2.1","lockfileVersion":1} diff --git a/packages/cli/package.json b/src/packages/flavors/package.json similarity index 76% rename from packages/cli/package.json rename to src/packages/flavors/package.json index 42b29ba3a9..185355875a 100644 --- a/packages/cli/package.json +++ b/src/packages/flavors/package.json @@ -1,8 +1,6 @@ { - "name": "cli", + "name": "@ganache/flavors", "version": "2.2.1", - "description": "> TODO: description", - "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", @@ -19,13 +17,12 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../scripts/compile" + "tsc": "ts-node ../../../scripts/compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, "dependencies": { - "@ganache/core": "^2.2.1", "@ganache/ethereum": "^2.2.1", "@ganache/tezos": "^2.2.1", "@ganache/utils": "^2.2.1" diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts new file mode 100644 index 0000000000..4d80401852 --- /dev/null +++ b/src/packages/flavors/src/index.ts @@ -0,0 +1,19 @@ +import Connector from "@ganache/utils/src/interfaces/connector"; +import TezosConnector from "@ganache/tezos"; +import EthereumConnector from "@ganache/ethereum"; + +export const FlavorMap = { + tezos: TezosConnector, + ethereum: EthereumConnector +}; + +export type FlavorMap = { + tezos: TezosConnector; + ethereum: EthereumConnector; +}; + +export type Flavors = { + [k in keyof FlavorMap]: FlavorMap[k]; +}[keyof FlavorMap]; + +export type Apis = T extends Connector ? R : never; diff --git a/src/packages/flavors/tsconfig.json b/src/packages/flavors/tsconfig.json new file mode 100644 index 0000000000..7ae8200b28 --- /dev/null +++ b/src/packages/flavors/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": [ + "src" + ] +} diff --git a/src/packages/options/README.md b/src/packages/options/README.md new file mode 100644 index 0000000000..2221a9a0a1 --- /dev/null +++ b/src/packages/options/README.md @@ -0,0 +1,3 @@ +# options + +> TODO: description diff --git a/src/packages/options/npm-shrinkwrap.json b/src/packages/options/npm-shrinkwrap.json new file mode 100644 index 0000000000..a70bfbbfd6 --- /dev/null +++ b/src/packages/options/npm-shrinkwrap.json @@ -0,0 +1 @@ +{"name":"@ganache/options","version":"2.2.1","lockfileVersion":1} diff --git a/src/packages/options/package.json b/src/packages/options/package.json new file mode 100644 index 0000000000..8289e4edcb --- /dev/null +++ b/src/packages/options/package.json @@ -0,0 +1,27 @@ +{ + "name": "@ganache/options", + "version": "2.2.1", + "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "license": "MIT", + "main": "src/index.ts", + "typings": "src/index.ts", + "directories": { + "lib": "lib" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/trufflesuite/ganache-core.git" + }, + "scripts": { + "tsc": "ts-node ../../../scripts/compile" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "dependencies": { + "@ganache/utils": "^2.2.1" + } +} diff --git a/packages/core/src/options/options.ts b/src/packages/options/src/options.ts similarity index 98% rename from packages/core/src/options/options.ts rename to src/packages/options/src/options.ts index 9051201c3f..22e34d021f 100644 --- a/packages/core/src/options/options.ts +++ b/src/packages/options/src/options.ts @@ -1,5 +1,5 @@ -import {Quantity} from "../things/json-rpc"; -import Api from "../interfaces/api"; +import {Quantity} from "@ganache/utils/src/things/json-rpc"; +import Api from "@ganache/utils/src/interfaces/api"; interface Logger { log(message?: any, ...optionalParams: any[]): void; diff --git a/packages/core/src/options/provider-options.ts b/src/packages/options/src/provider-options.ts similarity index 75% rename from packages/core/src/options/provider-options.ts rename to src/packages/options/src/provider-options.ts index 6a6b7e6474..6f1a7fd266 100644 --- a/packages/core/src/options/provider-options.ts +++ b/src/packages/options/src/provider-options.ts @@ -1,25 +1,6 @@ import Options, {getDefault as getDefaultOptions} from "./options"; -import TezosConnector from "@ganache/tezos"; -import EthereumConnector from "@ganache/ethereum"; import {entropyToMnemonic} from "bip39"; import seedrandom, {seedrandom_prng} from "seedrandom"; -import Connector from "../interfaces/connector"; - -export const FlavorMap = { - tezos: TezosConnector, - ethereum: EthereumConnector -}; - -export type FlavorMap = { - tezos: TezosConnector; - ethereum: EthereumConnector; -}; - -export type Flavors = { - [k in keyof FlavorMap]: FlavorMap[k]; -}[keyof FlavorMap]; - -export type Apis = T extends Connector ? R : never; function randomBytes(length: number, rng: () => number) { const buf = Buffer.allocUnsafe(length); @@ -48,14 +29,14 @@ export default interface ProviderOptions extends Options { */ subProviders?: any[]; - flavor?: keyof typeof FlavorMap; + flavor?: "ethereum" | "tezos"; } export const getDefault: (options?: ProviderOptions) => ProviderOptions = options => { const _options = Object.assign( { subProviders: [], - flavor: "ethereum" as keyof typeof FlavorMap + flavor: "ethereum" as "ethereum" | "tezos" }, getDefaultOptions(options) ); diff --git a/src/packages/options/tsconfig.json b/src/packages/options/tsconfig.json new file mode 100644 index 0000000000..7ae8200b28 --- /dev/null +++ b/src/packages/options/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": [ + "src" + ] +} diff --git a/packages/utils/README.md b/src/packages/utils/README.md similarity index 100% rename from packages/utils/README.md rename to src/packages/utils/README.md diff --git a/packages/utils/__tests__/utils.test.ts b/src/packages/utils/__tests__/utils.test.ts similarity index 100% rename from packages/utils/__tests__/utils.test.ts rename to src/packages/utils/__tests__/utils.test.ts diff --git a/packages/utils/npm-shrinkwrap.json b/src/packages/utils/npm-shrinkwrap.json similarity index 100% rename from packages/utils/npm-shrinkwrap.json rename to src/packages/utils/npm-shrinkwrap.json diff --git a/packages/utils/package.json b/src/packages/utils/package.json similarity index 79% rename from packages/utils/package.json rename to src/packages/utils/package.json index d9dcbe791a..f989977862 100644 --- a/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -22,14 +22,9 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../scripts/compile" + "tsc": "ts-node ../../../scripts/compile" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" - }, - "dependencies": { - "@ganache/core": "^2.2.1", - "@ganache/ethereum": "^2.2.1", - "@ganache/tezos": "^2.2.1" } } diff --git a/packages/core/src/interfaces/api.ts b/src/packages/utils/src/interfaces/api.ts similarity index 100% rename from packages/core/src/interfaces/api.ts rename to src/packages/utils/src/interfaces/api.ts diff --git a/packages/core/src/interfaces/connector.ts b/src/packages/utils/src/interfaces/connector.ts similarity index 100% rename from packages/core/src/interfaces/connector.ts rename to src/packages/utils/src/interfaces/connector.ts diff --git a/packages/core/src/interfaces/provider.ts b/src/packages/utils/src/interfaces/provider.ts similarity index 100% rename from packages/core/src/interfaces/provider.ts rename to src/packages/utils/src/interfaces/provider.ts diff --git a/packages/core/src/things/json-rpc/index.ts b/src/packages/utils/src/things/json-rpc/index.ts similarity index 100% rename from packages/core/src/things/json-rpc/index.ts rename to src/packages/utils/src/things/json-rpc/index.ts diff --git a/packages/core/src/things/json-rpc/json-rpc-base-types.ts b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts similarity index 98% rename from packages/core/src/things/json-rpc/json-rpc-base-types.ts rename to src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts index 47d57c7d60..a7593609bd 100644 --- a/packages/core/src/things/json-rpc/json-rpc-base-types.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts @@ -17,13 +17,15 @@ export const toBuffers = new WeakMap(); const inspect = Symbol.for("nodejs.util.inspect.custom"); export class BaseJsonRpcType { + public [Symbol.toStringTag]: string; + protected value: T; // used to make console.log debugging a little easier private [inspect](_depth: number, _options: any): T { return this.value; } constructor(value: T) { - const self = this as any; + const self = this; if (Buffer.isBuffer(value)) { toStrings.set(this, () => value.toString("hex")); bufCache.set(this, value); diff --git a/packages/core/src/things/json-rpc/json-rpc-data.ts b/src/packages/utils/src/things/json-rpc/json-rpc-data.ts similarity index 100% rename from packages/core/src/things/json-rpc/json-rpc-data.ts rename to src/packages/utils/src/things/json-rpc/json-rpc-data.ts diff --git a/packages/core/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts similarity index 100% rename from packages/core/src/things/json-rpc/json-rpc-quantity.ts rename to src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts diff --git a/packages/core/src/servers/utils/jsonrpc.ts b/src/packages/utils/src/things/jsonrpc.ts similarity index 92% rename from packages/core/src/servers/utils/jsonrpc.ts rename to src/packages/utils/src/things/jsonrpc.ts index 5794bf7976..1a5e290104 100644 --- a/packages/core/src/servers/utils/jsonrpc.ts +++ b/src/packages/utils/src/things/jsonrpc.ts @@ -1,5 +1,5 @@ -import Api from "../../interfaces/api"; -import { KnownKeys } from "../../types"; +import Api from "../interfaces/api"; +import { KnownKeys } from "../types"; namespace JsonRpc { const jsonrpc = "2.0"; diff --git a/packages/core/src/things/promievent.ts b/src/packages/utils/src/things/promievent.ts similarity index 100% rename from packages/core/src/things/promievent.ts rename to src/packages/utils/src/things/promievent.ts diff --git a/packages/core/src/types/index.ts b/src/packages/utils/src/types/index.ts similarity index 100% rename from packages/core/src/types/index.ts rename to src/packages/utils/src/types/index.ts diff --git a/packages/utils/src/utils.ts b/src/packages/utils/src/utils.ts similarity index 100% rename from packages/utils/src/utils.ts rename to src/packages/utils/src/utils.ts diff --git a/packages/core/src/utils/bigint-to-buffer.ts b/src/packages/utils/src/utils/bigint-to-buffer.ts similarity index 100% rename from packages/core/src/utils/bigint-to-buffer.ts rename to src/packages/utils/src/utils/bigint-to-buffer.ts diff --git a/packages/core/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts similarity index 100% rename from packages/core/src/utils/executor.ts rename to src/packages/utils/src/utils/executor.ts diff --git a/packages/core/src/utils/heap.ts b/src/packages/utils/src/utils/heap.ts similarity index 100% rename from packages/core/src/utils/heap.ts rename to src/packages/utils/src/utils/heap.ts diff --git a/packages/core/src/utils/request-coordinator.ts b/src/packages/utils/src/utils/request-coordinator.ts similarity index 100% rename from packages/core/src/utils/request-coordinator.ts rename to src/packages/utils/src/utils/request-coordinator.ts diff --git a/packages/ethereum/tsconfig.json b/src/packages/utils/tsconfig.json similarity index 65% rename from packages/ethereum/tsconfig.json rename to src/packages/utils/tsconfig.json index 1b551f4e9e..62676b00a1 100644 --- a/packages/ethereum/tsconfig.json +++ b/src/packages/utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../../tsconfig.json", "compilerOptions": { "outDir": "lib" }, From 38b0febe3f5af55c2e86e265bf250a02d1f9d085 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 11 May 2020 20:49:09 -0400 Subject: [PATCH 211/691] Type JSON.parse so it takes Buffers --- src/chains/ethereum/src/index.ts | 2 +- src/chains/tezos/src/index.ts | 8 +++----- src/packages/utils/src/types/index.ts | 6 ++++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 0c954cdee9..ebae40fe8d 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -31,7 +31,7 @@ export default class EthereumConnector extends Emittery.Typed; + return JSON.parse(message) as JsonRpc.Request; } handle(payload: JsonRpc.Request, connection: HttpRequest | WebSocket): PromiEvent { diff --git a/src/chains/tezos/src/index.ts b/src/chains/tezos/src/index.ts index 4a1af8af1a..7bbabff1f6 100644 --- a/src/chains/tezos/src/index.ts +++ b/src/chains/tezos/src/index.ts @@ -21,14 +21,12 @@ export default class TezosConnector extends Emittery.Typed { - - return Promise.resolve(123); - + return Promise.resolve(123); }; close() { diff --git a/src/packages/utils/src/types/index.ts b/src/packages/utils/src/types/index.ts index 33c41ef469..c43a771b0d 100644 --- a/src/packages/utils/src/types/index.ts +++ b/src/packages/utils/src/types/index.ts @@ -11,3 +11,9 @@ export type RequestType = (eventDetails: { method: KnownKeys; params?: Parameters; }) => ReturnType; + +declare global { + interface JSON { + parse(text: Buffer, reviver?: (key: any, value: any) => any): any; + } +} \ No newline at end of file From 0db45518393dc90f39286167bb4358e22d736c2b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 12 May 2020 13:40:21 -0400 Subject: [PATCH 212/691] Try to get tests working in CI again --- scripts/create.ts | 2 +- src/chains/ethereum/package.json | 2 +- src/chains/tezos/package.json | 2 +- src/packages/core/package.json | 2 +- src/packages/flavors/package.json | 2 +- src/packages/utils/package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/create.ts b/scripts/create.ts index e3b0f0ccb5..4d9937718b 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -29,7 +29,7 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a version: version, homepage: "https://github.com/trufflesuite/ganache-core#readme", license: "MIT", - main: "lib/index.js", + main: "src/index.ts", typings: "src/index.ts", directories: { lib: "lib", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 114b257e87..a7ed9c8e01 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -5,7 +5,7 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "lib/index.js", + "main": "src/index.ts", "typings": "src/index.ts", "directories": { "lib": "lib", diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index ac1fe163bd..2ad17f47b2 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -5,7 +5,7 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "lib/index.js", + "main": "src/index.ts", "typings": "src/index.ts", "directories": { "lib": "lib", diff --git a/src/packages/core/package.json b/src/packages/core/package.json index c9af5ef670..d04869d79a 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -5,7 +5,7 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "lib/index.js", + "main": "src/index.ts", "typings": "src/index.ts", "directories": { "lib": "lib", diff --git a/src/packages/flavors/package.json b/src/packages/flavors/package.json index 185355875a..17d58e3b65 100644 --- a/src/packages/flavors/package.json +++ b/src/packages/flavors/package.json @@ -3,7 +3,7 @@ "version": "2.2.1", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "lib/index.js", + "main": "src/index.ts", "typings": "src/index.ts", "directories": { "lib": "lib", diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index f989977862..f2d19abb18 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -5,7 +5,7 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "lib/index.js", + "main": "src/index.ts", "typings": "src/index.ts", "directories": { "lib": "lib", From a902030cb690ae073cafba87c71c762428c00836 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 12 May 2020 14:03:30 -0400 Subject: [PATCH 213/691] I don't understand anything --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 574eb20d0c..9d41b39c4b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "tsc": "lerna exec -- npm run tsc", "test": "lerna exec -- npm run test", "create": "ts-node ./scripts/create", - "postinstall": "patch-package" + "postinstall": "patch-package && lerna bootstrap" }, "dependencies": { "@types/lodash.clonedeep": "4.5.6", From 26f06bad70feb0480f456a51b5bf62348df0c96d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 12 May 2020 15:22:45 -0400 Subject: [PATCH 214/691] Move types to top level --- npm-shrinkwrap.json | 2794 ++++++++++------- src/chains/ethereum/src/api.ts | 1 - src/chains/ethereum/src/blockchain.ts | 8 +- src/chains/ethereum/src/index.ts | 2 +- src/packages/core/__tests__/server.ts | 2 +- src/packages/core/tsconfig.json | 2 +- tsconfig.json | 4 +- .../ethereumjs-block/header.d.ts | 0 .../ethereumjs-block/index.d.ts | 0 .../hdkey.d.ts => typings/hdkey/index.d.ts | 0 .../src/@types => typings}/levelup/index.d.ts | 0 .../merkle-patricia-tree/baseTrie.ts | 0 .../merkle-patricia-tree/index.d.ts | 7 +- .../merkle-patricia-tree/readStream.ts | 0 .../merkle-patricia-tree/trieNode.ts | 0 15 files changed, 1635 insertions(+), 1185 deletions(-) rename {src/chains/ethereum/src/@types => typings}/ethereumjs-block/header.d.ts (100%) rename {src/chains/ethereum/src/@types => typings}/ethereumjs-block/index.d.ts (100%) rename src/chains/ethereum/src/@types/hdkey.d.ts => typings/hdkey/index.d.ts (100%) rename {src/chains/ethereum/src/@types => typings}/levelup/index.d.ts (100%) rename src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts => typings/merkle-patricia-tree/baseTrie.ts (100%) rename {src/chains/ethereum/src/@types => typings}/merkle-patricia-tree/index.d.ts (80%) rename src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts => typings/merkle-patricia-tree/readStream.ts (100%) rename src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts => typings/merkle-patricia-tree/trieNode.ts (100%) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 1eb45cc3f3..6a12bf8a0f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -178,28 +178,6 @@ "@babel/helper-validator-identifier": "^7.9.0", "chalk": "^2.0.0", "js-tokens": "^4.0.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@babel/parser": { @@ -520,6 +498,12 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true } } }, @@ -576,12 +560,6 @@ } } }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -641,12 +619,6 @@ } } }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -687,28 +659,6 @@ "chalk": "^2.3.1", "execa": "^1.0.0", "strong-log-transformer": "^2.0.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@lerna/clean": { @@ -725,14 +675,6 @@ "p-map": "^2.1.0", "p-map-series": "^1.0.0", "p-waterfall": "^1.0.0" - }, - "dependencies": { - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - } } }, "@lerna/cli": { @@ -753,6 +695,12 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -791,24 +739,6 @@ "y18n": "^4.0.0", "yargs-parser": "^15.0.1" } - }, - "yargs-parser": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", - "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } - } } } }, @@ -822,28 +752,6 @@ "chalk": "^2.3.1", "figgy-pudding": "^3.5.1", "npmlog": "^4.1.2" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@lerna/collect-updates": { @@ -941,6 +849,12 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1021,6 +935,12 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1054,6 +974,12 @@ "requires": { "graceful-fs": "^4.1.6" } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1092,14 +1018,6 @@ "@lerna/run-topologically": "3.18.5", "@lerna/validation-error": "3.13.0", "p-map": "^2.1.0" - }, - "dependencies": { - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - } } }, "@lerna/filter-options": { @@ -1165,6 +1083,12 @@ "requires": { "graceful-fs": "^4.1.6" } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1251,6 +1175,12 @@ "requires": { "graceful-fs": "^4.1.6" } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1298,10 +1228,10 @@ "graceful-fs": "^4.1.6" } }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true } } @@ -1317,14 +1247,6 @@ "@lerna/symlink-dependencies": "3.17.0", "p-map": "^2.1.0", "slash": "^2.0.0" - }, - "dependencies": { - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - } } }, "@lerna/list": { @@ -1348,28 +1270,6 @@ "@lerna/query-graph": "3.18.5", "chalk": "^2.3.1", "columnify": "^1.5.4" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "@lerna/log-packed": { @@ -1479,6 +1379,12 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1536,6 +1442,12 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1705,6 +1617,12 @@ "requires": { "graceful-fs": "^4.1.6" } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1726,20 +1644,6 @@ "p-map": "^2.1.0", "resolve-from": "^4.0.0", "write-json-file": "^3.2.0" - }, - "dependencies": { - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - } } }, "@lerna/prompt": { @@ -1830,17 +1734,17 @@ } } }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1893,6 +1797,12 @@ "requires": { "graceful-fs": "^4.1.6" } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -1923,14 +1833,6 @@ "@lerna/timer": "3.13.0", "@lerna/validation-error": "3.13.0", "p-map": "^2.1.0" - }, - "dependencies": { - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - } } }, "@lerna/run-lifecycle": { @@ -1988,10 +1890,10 @@ "graceful-fs": "^4.1.6" } }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true } } @@ -2031,10 +1933,10 @@ "graceful-fs": "^4.1.6" } }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true } } @@ -2088,37 +1990,11 @@ "write-json-file": "^3.2.0" }, "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, @@ -2130,19 +2006,6 @@ "requires": { "npmlog": "^4.1.2", "write-file-atomic": "^2.3.0" - }, - "dependencies": { - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - } } }, "@mrmlnc/readdir-enhanced": { @@ -2355,9 +2218,9 @@ } }, "@octokit/types": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.12.2.tgz", - "integrity": "sha512-1GHLI/Jll3j6F0GbYyZPFTcHZMGjAiRfkTEoRUyaVVk2IWbDdwEiClAJvXzfXCDayuGSNCqAUH8lpjZtqW9GDw==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.0.tgz", + "integrity": "sha512-hA06ZYqkAVxvwFVu7yqRNVBGfG9MZvLMbqfgfm6F79g5xWspxsbL/2/rHcFP/z1YBN3zbcNQYuUHiBml4b24MA==", "dev": true, "requires": { "@types/node": ">= 8" @@ -2401,6 +2264,15 @@ "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "fast-glob": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", @@ -2415,6 +2287,15 @@ "picomatch": "^2.2.1" } }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -2426,6 +2307,12 @@ "universalify": "^0.1.0" } }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -2457,6 +2344,21 @@ "arrify": "^2.0.1", "minimatch": "^3.0.4" } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -2466,6 +2368,13 @@ "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", "requires": { "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "13.13.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz", + "integrity": "sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==" + } } }, "@types/color-name": { @@ -2525,6 +2434,12 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", "dev": true }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "dev": true + }, "@types/mocha": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", @@ -2534,7 +2449,14 @@ "@types/node": { "version": "13.13.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", - "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==" + "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true }, "@types/npm-package-arg": { "version": "6.1.0", @@ -2701,9 +2623,9 @@ "dev": true }, "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-styles": { @@ -2760,6 +2682,44 @@ "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "arg": { @@ -3077,24 +3037,44 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "fill-range": "^7.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true }, "browserify-aes": { "version": "1.2.0", @@ -3273,6 +3253,35 @@ "make-dir": "^3.0.0", "package-hash": "^4.0.0", "write-file-atomic": "^3.0.0" + }, + "dependencies": { + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + } } }, "call-me-maybe": { @@ -3312,20 +3321,20 @@ "dev": true }, "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", "dev": true, "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" }, "dependencies": { "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true } } @@ -3336,6 +3345,17 @@ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", @@ -3364,6 +3384,41 @@ "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.2.0" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } } }, "chownr": { @@ -3448,6 +3503,12 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -3532,23 +3593,6 @@ "requires": { "strip-ansi": "^3.0.0", "wcwidth": "^1.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } } }, "combined-stream": { @@ -3567,9 +3611,9 @@ "dev": true }, "commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "commondir": { @@ -3620,6 +3664,44 @@ "inherits": "^2.0.3", "readable-stream": "^2.2.2", "typedarray": "^0.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "config-chain": { @@ -3639,9 +3721,9 @@ "dev": true }, "conventional-changelog-angular": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.6.tgz", - "integrity": "sha512-QDEmLa+7qdhVIv8sFZfVxU1VSyVvnXPsxq8Vam49mKUcO1Z8VTLEJk9uI21uiJUsnmm0I4Hrsdc9TgkOQo9WSA==", + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.10.tgz", + "integrity": "sha512-k7RPPRs0vp8+BtPsM9uDxRl6KcgqtCJmzRD1wRtgqmhQ96g8ifBGo9O/TZBG23jqlXS/rg8BKRDELxfnQQGiaA==", "dev": true, "requires": { "compare-func": "^1.3.1", @@ -3681,24 +3763,24 @@ } }, "conventional-changelog-preset-loader": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.0.tgz", - "integrity": "sha512-/rHb32J2EJnEXeK4NpDgMaAVTFZS3o1ExmjKMtYVgIC4MQn0vkNSbYpdGRotkfGGRWiqk3Ri3FBkiZGbAfIfOQ==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", "dev": true }, "conventional-changelog-writer": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.11.tgz", - "integrity": "sha512-g81GQOR392I+57Cw3IyP1f+f42ME6aEkbR+L7v1FBBWolB0xkjKTeCWVguzRrp6UiT1O6gBpJbEy2eq7AnV1rw==", + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.16.tgz", + "integrity": "sha512-jmU1sDJDZpm/dkuFxBeRXvyNcJQeKhGtVcFFkwTphUAzyYWcwz2j36Wcv+Mv2hU3tpvLMkysOPXJTLO55AUrYQ==", "dev": true, "requires": { "compare-func": "^1.3.1", - "conventional-commits-filter": "^2.0.2", + "conventional-commits-filter": "^2.0.6", "dateformat": "^3.0.0", - "handlebars": "^4.4.0", + "handlebars": "^4.7.6", "json-stringify-safe": "^5.0.1", "lodash": "^4.17.15", - "meow": "^5.0.0", + "meow": "^7.0.0", "semver": "^6.0.0", "split": "^1.0.0", "through2": "^3.0.0" @@ -3722,9 +3804,9 @@ } }, "conventional-commits-filter": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.2.tgz", - "integrity": "sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz", + "integrity": "sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==", "dev": true, "requires": { "lodash.ismatch": "^4.4.0", @@ -3732,15 +3814,15 @@ } }, "conventional-commits-parser": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.0.8.tgz", - "integrity": "sha512-YcBSGkZbYp7d+Cr3NWUeXbPDFUN6g3SaSIzOybi8bjHL5IJ5225OSCxJJ4LgziyEJ7AaJtE9L2/EU6H7Nt/DDQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz", + "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", "dev": true, "requires": { "JSONStream": "^1.0.4", "is-text-path": "^1.0.1", "lodash": "^4.17.15", - "meow": "^5.0.0", + "meow": "^7.0.0", "split2": "^2.0.0", "through2": "^3.0.0", "trim-off-newlines": "^1.0.0" @@ -3773,6 +3855,23 @@ "q": "^1.5.1" }, "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, "concat-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", @@ -3785,6 +3884,18 @@ "typedarray": "^0.0.6" } }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, "meow": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", @@ -3802,25 +3913,43 @@ "trim-newlines": "^2.0.0" } }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", "dev": true, "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", "dev": true, "requires": { - "safe-buffer": "~5.2.0" + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" } + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true } } }, @@ -3974,12 +4103,20 @@ "dev": true }, "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "debuglog": { @@ -4031,6 +4168,14 @@ "dev": true, "requires": { "strip-bom": "^4.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + } } }, "defaults": { @@ -4205,6 +4350,44 @@ "inherits": "^2.0.1", "readable-stream": "^2.0.0", "stream-shift": "^1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "ecc-jsbn": { @@ -4481,6 +4664,11 @@ "secp256k1": "^3.0.1" } }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, "keccak": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", @@ -4527,6 +4715,42 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" } } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } } } }, @@ -4660,6 +4884,11 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, "keccak": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", @@ -4720,6 +4949,42 @@ } } } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } } } }, @@ -4775,12 +5040,6 @@ "which": "^1.2.9" } }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -5053,9 +5312,9 @@ "dev": true }, "fastq": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", - "integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", + "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -5082,12 +5341,26 @@ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "find-cache-dir": { @@ -5099,6 +5372,66 @@ "commondir": "^1.0.1", "make-dir": "^3.0.2", "pkg-dir": "^4.1.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "find-up": { @@ -5139,6 +5472,12 @@ "requires": { "graceful-fs": "^4.1.6" } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true } } }, @@ -5149,6 +5488,14 @@ "dev": true, "requires": { "is-buffer": "~2.0.3" + }, + "dependencies": { + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true + } } }, "flow-stoplight": { @@ -5164,6 +5511,44 @@ "requires": { "inherits": "^2.0.3", "readable-stream": "^2.3.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "for-in": { @@ -5189,13 +5574,13 @@ "dev": true }, "form-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", - "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" } }, @@ -5222,6 +5607,44 @@ "requires": { "inherits": "^2.0.1", "readable-stream": "^2.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "fromentries": { @@ -5240,14 +5663,6 @@ "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^1.0.0" - }, - "dependencies": { - "universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", - "dev": true - } } }, "fs-minipass": { @@ -5269,6 +5684,44 @@ "iferr": "^0.1.5", "imurmurhash": "^0.1.4", "readable-stream": "1 || 2" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "fs.realpath": { @@ -5307,43 +5760,6 @@ "string-width": "^1.0.1", "strip-ansi": "^3.0.1", "wide-align": "^1.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } } }, "genfun": { @@ -5590,6 +6006,35 @@ "through2": "^2.0.0" }, "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, "meow": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", @@ -5606,11 +6051,49 @@ "redent": "^2.0.0", "trim-newlines": "^2.0.0" } - } - } - }, - "git-remote-origin-url": { - "version": "2.0.0", + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + } + } + }, + "git-remote-origin-url": { + "version": "2.0.0", "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", "dev": true, @@ -5637,6 +6120,35 @@ "semver": "^6.0.0" }, "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, "meow": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", @@ -5654,11 +6166,49 @@ "trim-newlines": "^2.0.0" } }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true } } }, @@ -5741,9 +6291,9 @@ } }, "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, "growl": { @@ -5789,6 +6339,12 @@ "har-schema": "^2.0.0" } }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -5835,32 +6391,6 @@ "kind-of": "^4.0.0" }, "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", @@ -5873,12 +6403,13 @@ } }, "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" } }, "hash.js": { @@ -5898,6 +6429,20 @@ "requires": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" + }, + "dependencies": { + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } } }, "hdkey": { @@ -5952,23 +6497,6 @@ "requires": { "agent-base": "4", "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } } }, "http-signature": { @@ -6067,17 +6595,6 @@ "requires": { "pkg-dir": "^3.0.0", "resolve-cwd": "^2.0.0" - }, - "dependencies": { - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - } } }, "imurmurhash": { @@ -6178,20 +6695,36 @@ }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, "strip-ansi": { @@ -6201,15 +6734,14 @@ "dev": true, "requires": { "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } } } } @@ -6249,12 +6781,6 @@ "kind-of": "^3.0.2" }, "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -6282,9 +6808,9 @@ } }, "is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-callable": { @@ -6310,12 +6836,6 @@ "kind-of": "^3.0.2" }, "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -6376,10 +6896,13 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } }, "is-glob": { "version": "4.0.1", @@ -6402,10 +6925,24 @@ "dev": true }, "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } }, "is-obj": { "version": "1.0.1", @@ -6455,9 +6992,9 @@ } }, "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, "is-symbol": { @@ -6543,15 +7080,12 @@ } }, "istanbul-lib-instrument": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.1.tgz", - "integrity": "sha512-imIchxnodll7pvQBYOqUu88EufLCU56LMeFPZZM/fJZ1irYcYdqroaV+ACK1Ila8ls09iEYArp+nqyC6lW1Vfg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "requires": { "@babel/core": "^7.7.5", - "@babel/parser": "^7.7.5", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", "@istanbuljs/schema": "^0.1.2", "istanbul-lib-coverage": "^3.0.0", "semver": "^6.3.0" @@ -6580,6 +7114,24 @@ "uuid": "^3.3.3" }, "dependencies": { + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -6588,6 +7140,12 @@ "requires": { "glob": "^7.1.3" } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true } } }, @@ -6608,6 +7166,21 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, "supports-color": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", @@ -6731,14 +7304,6 @@ "requires": { "graceful-fs": "^4.1.6", "universalify": "^1.0.0" - }, - "dependencies": { - "universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", - "dev": true - } } }, "jsonparse": { @@ -6866,6 +7431,11 @@ "isarray": "0.0.1", "string_decoder": "~0.10.x" } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" } } }, @@ -6940,6 +7510,11 @@ "inherits": "^2.0.3" } }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, "level-errors": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", @@ -6968,6 +7543,33 @@ "level-iterator-stream": "~3.0.0", "xtend": "~4.0.0" } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } } } }, @@ -6999,6 +7601,11 @@ "string_decoder": "~0.10.x" } }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, "xtend": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", @@ -7088,27 +7695,15 @@ "readable-stream": "^3.4.0", "xtend": "^4.0.2" } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } } } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, "load-json-file": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", @@ -7120,20 +7715,6 @@ "pify": "^4.0.1", "strip-bom": "^3.0.0", "type-fest": "^0.3.0" - }, - "dependencies": { - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", - "dev": true - } } }, "locate-path": { @@ -7224,28 +7805,6 @@ "dev": true, "requires": { "chalk": "^2.4.2" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "loud-rejection": { @@ -7278,18 +7837,18 @@ "dev": true }, "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { - "semver": "^6.0.0" + "pify": "^3.0.0" }, "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true } } @@ -7337,9 +7896,9 @@ "dev": true }, "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", "dev": true }, "map-visit": { @@ -7388,35 +7947,139 @@ "dev": true }, "meow": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", - "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.0.1.tgz", + "integrity": "sha512-tBKIQqVrAHqwit0vfuFPY3LlzJYkEOFyKa3bPgxzNl6q/RtN8KQ+ALYEASYuFayzSAsjlhXj/JZ10rH85Q6TUw==", "dev": true, "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0", - "yargs-parser": "^10.0.0" + "@types/minimist": "^1.2.0", + "arrify": "^2.0.1", + "camelcase": "^6.0.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" }, "dependencies": { - "camelcase": { + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "find-up": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "dev": true }, "yargs-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", - "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { - "camelcase": "^4.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } } } } @@ -7507,16 +8170,6 @@ } } }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -7559,96 +8212,6 @@ "regex-not": "^1.0.0", "snapdragon": "^0.8.1", "to-regex": "^3.0.2" - }, - "dependencies": { - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "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=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } } }, "miller-rabin": { @@ -7668,24 +8231,24 @@ } }, "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz", + "integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w==", "dev": true }, "mime-db": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { - "version": "2.1.26", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", - "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { - "mime-db": "1.43.0" + "mime-db": "1.44.0" } }, "mimic-fn": { @@ -7694,6 +8257,12 @@ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, + "min-indent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz", + "integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY=", + "dev": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -7719,9 +8288,9 @@ "dev": true }, "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.0.2.tgz", + "integrity": "sha512-seq4hpWkYSUh1y7NXxzucwAN9yVlBc3Upgdjz8vLCP97jG8kaOmzYrVH/m7tQ1NYD1wdtZbSLfdy4zFmRWuc/w==", "dev": true, "requires": { "arrify": "^1.0.1", @@ -7787,9 +8356,9 @@ } }, "mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { "minimist": "^1.2.5" @@ -7842,6 +8411,21 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", @@ -7856,6 +8440,27 @@ "path-is-absolute": "^1.0.0" } }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "mkdirp": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", + "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -7876,6 +8481,15 @@ "ansi-regex": "^4.1.0" } }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -7902,6 +8516,16 @@ "y18n": "^4.0.0", "yargs-parser": "^13.1.2" } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, @@ -7926,9 +8550,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "multimatch": { @@ -8078,9 +8702,9 @@ } }, "node-gyp-build": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.1.tgz", - "integrity": "sha512-XyCKXsqZfLqHep1hhsMncoXuUNt/cXCjg1+8CLbu69V1TKuPiOeSGbL9n+k/ByKH8UT0p4rdIX8XkTRZV0i7Sw==" + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.2.tgz", + "integrity": "sha512-Lqh7mrByWCM8Cf9UPqpeoVBBo5Ugx+RKu885GAzmLBVYjeywScxHXPGLa4JfYNZmcNGwzR0Glu5/9GaQZMFqyA==" }, "node-preload": { "version": "0.2.1", @@ -8150,12 +8774,6 @@ "which": "^1.3.1" }, "dependencies": { - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -8323,54 +8941,6 @@ "yargs": "^15.0.2" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -8381,12 +8951,6 @@ "path-exists": "^4.0.0" } }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -8396,6 +8960,15 @@ "p-locate": "^4.1.0" } }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, "p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", @@ -8405,12 +8978,27 @@ "p-limit": "^2.2.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -8420,73 +9008,11 @@ "glob": "^7.1.3" } }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "yargs": { - "version": "15.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", - "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.1" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } - } + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true } } }, @@ -8522,12 +9048,6 @@ "is-descriptor": "^0.1.0" } }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -8680,13 +9200,10 @@ } }, "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true }, "p-map-series": { "version": "1.0.0", @@ -8754,6 +9271,44 @@ "cyclist": "^1.0.1", "inherits": "^2.0.3", "readable-stream": "^2.1.5" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "parse-github-repo-url": { @@ -8820,17 +9375,6 @@ "tmp": "^0.0.33" }, "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -8891,15 +9435,6 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -8909,6 +9444,12 @@ "os-tmpdir": "~1.0.2" } }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -8988,72 +9529,36 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - } + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" } }, "posix-character-classes": { @@ -9190,15 +9695,15 @@ "dev": true }, "qs": { - "version": "6.9.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", - "integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true }, "randombytes": { @@ -9284,12 +9789,6 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true } } }, @@ -9349,37 +9848,13 @@ } }, "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "readdir-scoped-modules": { @@ -9404,21 +9879,13 @@ } }, "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "dev": true, "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - }, - "dependencies": { - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - } + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" } }, "regex-not": { @@ -9487,25 +9954,6 @@ "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" - }, - "dependencies": { - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - } } }, "require-directory": { @@ -9553,9 +10001,9 @@ } }, "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "resolve-url": { @@ -9660,9 +10108,9 @@ } }, "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "safe-regex": { "version": "1.1.0", @@ -9928,12 +10376,6 @@ "kind-of": "^3.2.0" }, "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -9992,6 +10434,12 @@ "tmp": "0.0.33" }, "dependencies": { + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true + }, "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", @@ -10103,6 +10551,15 @@ "which": "^2.0.1" }, "dependencies": { + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -10111,6 +10568,12 @@ "requires": { "glob": "^7.1.3" } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true } } }, @@ -10243,13 +10706,14 @@ "dev": true }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string.prototype.trimend": { @@ -10291,23 +10755,26 @@ } }, "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^2.0.0" } }, "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, "strip-eof": { @@ -10325,10 +10792,13 @@ } }, "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } }, "strip-json-comments": { "version": "2.0.1", @@ -10426,38 +10896,35 @@ "ms": "^2.1.1" } }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", "dev": true, "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" } }, + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "dev": true + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } } } }, "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -10498,21 +10965,6 @@ "uuid": "^3.0.1" }, "dependencies": { - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", @@ -10570,6 +11022,44 @@ "requires": { "readable-stream": "~2.3.6", "xtend": "~4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, "tmp": { @@ -10603,12 +11093,6 @@ "kind-of": "^3.0.2" }, "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -10633,12 +11117,13 @@ } }, "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { - "is-number": "^7.0.0" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, "tough-cookie": { @@ -10661,9 +11146,9 @@ } }, "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", "dev": true }, "trim-off-newlines": { @@ -10705,9 +11190,9 @@ } }, "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.12.0.tgz", + "integrity": "sha512-5rxCQkP0kytf4H1T4xz1imjxaUUPMvc5aWp0rJ/VMIN7ClRiH1FwFvBt8wOeMasp/epeUnmSW6CixSIePtiLqA==", "dev": true }, "tslint": { @@ -10731,37 +11216,11 @@ "tsutils": "^2.29.0" }, "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, @@ -10790,9 +11249,9 @@ "dev": true }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", "dev": true }, "typedarray": { @@ -10821,22 +11280,13 @@ "from": "github:uNetworking/uWebSockets.js#v17.4.0" }, "uglify-js": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz", - "integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==", + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.2.tgz", + "integrity": "sha512-zGVwKslUAD/EeqOrD1nQaBmXIHl1Vw371we8cvS8I6mYK9rmgX5tv8AAeJdfsQ3Kk5mGax2SVV/AizxdNGhl7Q==", "dev": true, "optional": true, "requires": { "commander": "~2.20.3" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "optional": true - } } }, "uid-number": { @@ -10897,9 +11347,9 @@ } }, "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", "dev": true }, "unset-value": { @@ -11135,6 +11585,12 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -11163,15 +11619,14 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", "dev": true, "requires": { + "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "signal-exit": "^3.0.2" } }, "write-json-file": { @@ -11203,17 +11658,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true - }, - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } } } }, @@ -11227,32 +11671,12 @@ "write-json-file": "^2.2.0" }, "dependencies": { - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, "write-json-file": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", @@ -11326,6 +11750,12 @@ "color-convert": "^2.0.1" } }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -11437,22 +11867,14 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } } } } }, "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -11484,6 +11906,18 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", @@ -11521,6 +11955,16 @@ "y18n": "^4.0.0", "yargs-parser": "^13.1.2" } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index ae30389c12..9bdad5f1c5 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -13,7 +13,6 @@ const createKeccakHash = require("keccak"); // Read in the current ganache version from core's package.json import {name, version} from "../../../packages/core/package.json"; import PromiEvent from "@ganache/utils/src/things/promievent"; -import { types } from "util"; import Emittery from "emittery"; //#endregion diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 389263a6bb..9b2b69c8f1 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -3,7 +3,7 @@ import Database from "./database"; import Emittery from "emittery"; import BlockManager, {Block} from "./components/block-manager"; import TransactionManager from "./components/transaction-manager"; -import Trie from "merkle-patricia-tree"; +import CheckpointTrie from "merkle-patricia-tree"; import {BN} from "ethereumjs-util"; import Account from "./things/account"; import {promisify} from "util"; @@ -44,7 +44,7 @@ export default class Blockchain extends Emittery { public transactionReceipts: Manager; public accounts: AccountManager; public vm: any; - public trie: Trie; + public trie: CheckpointTrie; readonly #database: Database; /** @@ -65,7 +65,7 @@ export default class Blockchain extends Emittery { // if we have a latest block, `root` will be that block's header.stateRoot // and we will skip creating the genesis block alltogether const root: Buffer = null; - this.trie = new Trie(database.trie, root); + this.trie = new CheckpointTrie(database.trie, root); this.blocks = new BlockManager(this, database.blocks); this.vm = this.createVmFromStateTrie(this.trie, options.hardfork, options.allowUnlimitedContractSize); @@ -152,7 +152,7 @@ export default class Blockchain extends Emittery { }); } - createVmFromStateTrie = (stateTrie: Trie, hardfork: string, allowUnlimitedContractSize: boolean): any => { + createVmFromStateTrie = (stateTrie: CheckpointTrie, hardfork: string, allowUnlimitedContractSize: boolean): any => { const common = Common.forCustomChain( "mainnet", // TODO needs to match chain id { diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index ebae40fe8d..81725fe571 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -1,4 +1,4 @@ -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/flavors/src/provider-options"; +import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/options/src/provider-options"; import Emittery from "emittery"; import EthereumApi from "./api"; import JsonRpc from "@ganache/utils/src/things/jsonrpc"; diff --git a/src/packages/core/__tests__/server.ts b/src/packages/core/__tests__/server.ts index 36f32c445b..adfd083b0a 100644 --- a/src/packages/core/__tests__/server.ts +++ b/src/packages/core/__tests__/server.ts @@ -515,6 +515,6 @@ describe("server", () => { // don't break. logger.log = oldLog; } - }); + }).timeout(5000); }); }); diff --git a/src/packages/core/tsconfig.json b/src/packages/core/tsconfig.json index 62676b00a1..09ab4f3659 100644 --- a/src/packages/core/tsconfig.json +++ b/src/packages/core/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["src"], } diff --git a/tsconfig.json b/tsconfig.json index f76560a318..97d59eebe9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,9 @@ "resolveJsonModule": true, "strict": true, "strictNullChecks": false, + "noImplicitAny": false, "newLine": "lf", - "lib": ["ES2020"] + "lib": ["ES2020"], + "typeRoots": ["./node_modules/@types", "./typings"] } } diff --git a/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts b/typings/ethereumjs-block/header.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts rename to typings/ethereumjs-block/header.d.ts diff --git a/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts b/typings/ethereumjs-block/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts rename to typings/ethereumjs-block/index.d.ts diff --git a/src/chains/ethereum/src/@types/hdkey.d.ts b/typings/hdkey/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/hdkey.d.ts rename to typings/hdkey/index.d.ts diff --git a/src/chains/ethereum/src/@types/levelup/index.d.ts b/typings/levelup/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/levelup/index.d.ts rename to typings/levelup/index.d.ts diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts b/typings/merkle-patricia-tree/baseTrie.ts similarity index 100% rename from src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.d.ts rename to typings/merkle-patricia-tree/baseTrie.ts diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts b/typings/merkle-patricia-tree/index.d.ts similarity index 80% rename from src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts rename to typings/merkle-patricia-tree/index.d.ts index eb6e3dc527..1de14ec272 100644 --- a/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts +++ b/typings/merkle-patricia-tree/index.d.ts @@ -16,6 +16,12 @@ declare module "merkle-patricia-tree" { export class CheckpointTrie extends Trie { readonly isCheckpoint: boolean; + root: Buffer; + constructor(db: Database, root: Buffer); + get(key: LargeNumber, cb: Callback): void; + put(key: LargeNumber, value: LargeNumber, cb: Callback): void; + copy(): Trie; + checkpoint(): void; commit(cb: Callback): void; revert(cb: Callback): void; @@ -23,6 +29,5 @@ declare module "merkle-patricia-tree" { static prove(trie: Trie, key: LargeNumber, cb: Callback): void; static verifyProof(rootHash: LargeNumber, key: LargeNumber, proof: MerkleProof, cb: Callback): void; } - export default CheckpointTrie; } diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts b/typings/merkle-patricia-tree/readStream.ts similarity index 100% rename from src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.d.ts rename to typings/merkle-patricia-tree/readStream.ts diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts b/typings/merkle-patricia-tree/trieNode.ts similarity index 100% rename from src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.d.ts rename to typings/merkle-patricia-tree/trieNode.ts From 132b4ae332ed76cf9d6d16014fb5fe37da9b0c2e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 12 May 2020 15:33:20 -0400 Subject: [PATCH 215/691] Emit block after it is saved. --- src/chains/ethereum/src/blockchain.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 9b2b69c8f1..d7007a7fb8 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -141,9 +141,13 @@ export default class Blockchain extends Emittery { }); block.value.transactions = blockData.blockTransactions; this.blocks.putBlock(block); - this.emit("block", block); return block; }); + + lastBlock.then(block => { + // emit the block once everything has been fully saved to the database + this.emit("block", block); + }); }); this.blocks.earliest = this.blocks.latest = await lastBlock; From 0634a1d42c0cb175e6c24c1a62d214c5d8faa8ff Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 12 May 2020 17:23:05 -0400 Subject: [PATCH 216/691] Make Options more neatly imported --- src/chains/ethereum/src/index.ts | 2 +- src/chains/ethereum/src/options.ts | 4 ++-- src/chains/ethereum/src/provider.ts | 4 ++-- src/chains/tezos/src/index.ts | 2 +- src/chains/tezos/src/provider.ts | 2 +- src/packages/core/__tests__/helpers/getProvider.ts | 2 +- src/packages/core/__tests__/temp-tests.ts | 2 +- src/packages/core/src/connector.ts | 2 +- src/packages/core/src/index.ts | 2 +- src/packages/core/src/options/server-options.ts | 4 ++-- src/packages/options/src/index.ts | 2 ++ src/packages/options/src/options.ts | 10 +++++++--- src/packages/options/src/provider-options.ts | 13 +++++++++---- 13 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 src/packages/options/src/index.ts diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 81725fe571..24b2f7e66c 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -1,4 +1,4 @@ -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/options/src/provider-options"; +import {ProviderOptions} from "@ganache/options"; import Emittery from "emittery"; import EthereumApi from "./api"; import JsonRpc from "@ganache/utils/src/things/jsonrpc"; diff --git a/src/chains/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts index 46f3620358..1a121ee2a4 100644 --- a/src/chains/ethereum/src/options.ts +++ b/src/chains/ethereum/src/options.ts @@ -1,8 +1,8 @@ -import Options from "@ganache/options/src/provider-options"; +import {ProviderOptions} from "@ganache/options"; import Account from "./things/account"; type EthereumOptions = Pick< - Options, + ProviderOptions, | "defaultTransactionGasLimit" | "chainId" | "networkId" diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 2de2ca2463..ca4dd1d25f 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -1,5 +1,5 @@ import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/options/src/provider-options"; +import {ProviderOptions} from "@ganache/options"; import Emittery from "emittery"; import EthereumApi from "./api"; import {publicToAddress, privateToAddress} from "ethereumjs-util"; @@ -32,7 +32,7 @@ export default class EthereumProvider extends Emittery.Typed}, "ready" | "close"> implements Provider { diff --git a/src/packages/core/__tests__/helpers/getProvider.ts b/src/packages/core/__tests__/helpers/getProvider.ts index 51e373b746..94c2fdcc58 100644 --- a/src/packages/core/__tests__/helpers/getProvider.ts +++ b/src/packages/core/__tests__/helpers/getProvider.ts @@ -1,5 +1,5 @@ import Ganache from "../../src/"; -import ProviderOptions from "@ganache/options/src/provider-options"; +import {ProviderOptions} from "@ganache/options"; import EthereumProvider from "@ganache/ethereum/src/provider"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; diff --git a/src/packages/core/__tests__/temp-tests.ts b/src/packages/core/__tests__/temp-tests.ts index 3eed6e57fe..e6bd96da61 100644 --- a/src/packages/core/__tests__/temp-tests.ts +++ b/src/packages/core/__tests__/temp-tests.ts @@ -2,7 +2,7 @@ import Ganache from "../src"; import assert from "assert"; import {Quantity} from "@ganache/utils/src/things/json-rpc"; import EthereumProvider from "@ganache/ethereum/src/provider"; -import ProviderOptions from "@ganache/options/src/provider-options"; +import {ProviderOptions} from "@ganache/options"; const solc = require("solc"); function compileSolidity(source: string) { diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index 5eb93f0404..e28be147ab 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -1,6 +1,6 @@ import RequestCoordinator from "@ganache/utils/src/utils/request-coordinator"; import {FlavorMap} from "@ganache/flavors"; -import ProviderOptions from "@ganache/options/src/provider-options"; +import {ProviderOptions} from "@ganache/options"; import Executor from "@ganache/utils/src/utils/executor"; /** diff --git a/src/packages/core/src/index.ts b/src/packages/core/src/index.ts index 83237c4144..99058bea0f 100644 --- a/src/packages/core/src/index.ts +++ b/src/packages/core/src/index.ts @@ -1,5 +1,5 @@ import Connector from "./connector"; -import ProviderOptions from "@ganache/options/src/provider-options"; +import {ProviderOptions} from "@ganache/options"; import ServerOptions from "./options/server-options"; import Server from "./server"; diff --git a/src/packages/core/src/options/server-options.ts b/src/packages/core/src/options/server-options.ts index 44d8418938..7b281c46cd 100644 --- a/src/packages/core/src/options/server-options.ts +++ b/src/packages/core/src/options/server-options.ts @@ -1,4 +1,4 @@ -import ProviderOptions, {getDefault as getDefaultProviderOptions} from "@ganache/options/src/provider-options"; +import {ProviderOptions} from "@ganache/options"; export {Apis, Flavors, FlavorMap} from "@ganache/flavors"; export default interface ServerOptions extends ProviderOptions { @@ -30,6 +30,6 @@ export const getDefault: (options?: ServerOptions) => ServerOptions = options => port: 8545, ws: true }, - getDefaultProviderOptions(options as ProviderOptions) + ProviderOptions.getDefault(options as ProviderOptions) ) as ServerOptions; }; diff --git a/src/packages/options/src/index.ts b/src/packages/options/src/index.ts new file mode 100644 index 0000000000..5be496dacc --- /dev/null +++ b/src/packages/options/src/index.ts @@ -0,0 +1,2 @@ +export * from "./options"; +export * from "./provider-options"; diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index 22e34d021f..e835c5bb6a 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -10,7 +10,7 @@ interface Logger { // instead of `[Address, PrivateKey]`, flip flopping like this "fixes" it. type Account = {balance: string; secretKey?: string}; -export default interface Options { +export interface Options { api?: Api; /** * Array of Accounts. Each object should have a balance key with a hexadecimal @@ -167,9 +167,9 @@ export default interface Options { asyncRequestProcessing?: boolean; hardfork?: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier"; -} +}; -export const getDefault: (options?: Options) => Options = options => { +const getDefault: (options?: Options) => Options = options => { // TODO: convert to null propagation operator after updating TS to a version that supports it const networkId = (options ? options.networkId || options.netVersion || options.network_id || options.net_version || Date.now() @@ -198,4 +198,8 @@ export const getDefault: (options?: Options) => Options = options => { }, options ); +} + +export const Options = { + getDefault }; diff --git a/src/packages/options/src/provider-options.ts b/src/packages/options/src/provider-options.ts index 6f1a7fd266..6d2b3f9cd3 100644 --- a/src/packages/options/src/provider-options.ts +++ b/src/packages/options/src/provider-options.ts @@ -1,4 +1,4 @@ -import Options, {getDefault as getDefaultOptions} from "./options"; +import {Options} from "./options"; import {entropyToMnemonic} from "bip39"; import seedrandom, {seedrandom_prng} from "seedrandom"; @@ -23,7 +23,7 @@ const randomAlphaNumericString = (() => { }; })(); -export default interface ProviderOptions extends Options { +export interface ProviderOptions extends Options { /** * Array of strings to installed subproviders */ @@ -32,13 +32,13 @@ export default interface ProviderOptions extends Options { flavor?: "ethereum" | "tezos"; } -export const getDefault: (options?: ProviderOptions) => ProviderOptions = options => { +const getDefault: (options?: ProviderOptions) => ProviderOptions = options => { const _options = Object.assign( { subProviders: [], flavor: "ethereum" as "ethereum" | "tezos" }, - getDefaultOptions(options) + Options.getDefault(options) ); if (!_options.mnemonic) { @@ -60,3 +60,8 @@ export const getDefault: (options?: ProviderOptions) => ProviderOptions = option } return _options; }; + + +export const ProviderOptions = { + getDefault +}; From 82489cccc7610e00831c7646527370e874b9b9a0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 12 May 2020 18:01:00 -0400 Subject: [PATCH 217/691] Make utils a little more neatly imported --- src/chains/ethereum/src/api.ts | 4 ++-- src/chains/ethereum/src/blockchain.ts | 6 ++--- .../src/components/transaction-manager.ts | 4 ++-- .../src/components/transaction-pool.ts | 16 ++++++------- src/chains/ethereum/src/index.ts | 6 ++--- src/chains/ethereum/src/miner.ts | 18 +++++++------- src/chains/ethereum/src/provider.ts | 24 +++++++++---------- src/chains/tezos/src/api.ts | 4 ++-- src/chains/tezos/src/index.ts | 6 ++--- src/chains/tezos/src/provider.ts | 7 +++--- src/packages/core/src/connector.ts | 7 +++--- src/packages/flavors/src/index.ts | 4 ++-- src/packages/options/src/options.ts | 4 ++-- src/packages/utils/src/index.ts | 2 ++ .../things/json-rpc/json-rpc-base-types.ts | 4 ++-- src/packages/utils/src/things/jsonrpc.ts | 3 +-- .../utils/src/{interfaces => types}/api.ts | 2 +- .../src/{interfaces => types}/connector.ts | 4 ++-- src/packages/utils/src/types/index.ts | 8 +++++-- .../src/{interfaces => types}/provider.ts | 2 +- src/packages/utils/src/utils.ts | 3 --- .../utils/src/utils/bigint-to-buffer.ts | 8 +++---- src/packages/utils/src/utils/executor.ts | 7 +++--- src/packages/utils/src/utils/heap.ts | 3 +-- src/packages/utils/src/utils/index.ts | 4 ++++ .../utils/src/utils/request-coordinator.ts | 2 +- typings/index.d.ts | 0 27 files changed, 81 insertions(+), 81 deletions(-) create mode 100644 src/packages/utils/src/index.ts rename src/packages/utils/src/{interfaces => types}/api.ts (86%) rename src/packages/utils/src/{interfaces => types}/connector.ts (82%) rename src/packages/utils/src/{interfaces => types}/provider.ts (69%) delete mode 100644 src/packages/utils/src/utils.ts create mode 100644 src/packages/utils/src/utils/index.ts create mode 100644 typings/index.d.ts diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 9bdad5f1c5..0a13cb71c4 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,5 +1,5 @@ //#region Imports -import Api from "@ganache/utils/src/interfaces/api"; +import {types} from "@ganache/utils"; import EthereumOptions from "./options"; import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; import Blockchain from "./blockchain"; @@ -36,7 +36,7 @@ const _filters = Symbol("filters"); type SubscriptionId = string; //#endregion -export default class EthereumApi implements Api { +export default class EthereumApi implements types.Api { readonly [index: string]: (...args: any) => Promise; private readonly [_filters] = new Map(); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index d7007a7fb8..6549e08177 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -10,7 +10,7 @@ import {promisify} from "util"; import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; -import Heap from "@ganache/utils/src/utils/heap"; +import {utils} from "@ganache/utils"; import Transaction from "./things/transaction"; import Manager from "./components/manager"; import TransactionReceipt from "./things/transaction-receipt"; @@ -94,14 +94,14 @@ export default class Blockchain extends Emittery { }; const instamining = true; if (instamining) { - this.transactions.transactionPool.on("drain", async (pending: Map>) => { + this.transactions.transactionPool.on("drain", async (pending: Map>) => { const block = await readyNextBlock(); await miner.mine(pending, block.value); }); } else { // TODO: the interval needs to be from the `options` const minerInterval = 3 * 1000; - const mine = async (pending: Map>) => { + const mine = async (pending: Map>) => { const block = await readyNextBlock(); await miner.mine(pending, block.value); setTimeout(mine, minerInterval, pending); diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts index 872c900341..cb6dcfe6ca 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -3,7 +3,7 @@ import Manager from "./manager"; import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; import levelup from "levelup"; import Blockchain from "../blockchain"; -import Heap from "@ganache/utils/src/utils/heap"; +import {utils} from "@ganache/utils"; export type TransactionManagerOptions = TransactionPoolOptions; @@ -14,7 +14,7 @@ export default class TransactionManager extends Manager { super(blockchain, base, Transaction); this.transactionPool = new TransactionPool(blockchain, options); - this.transactionPool.on("drain", (transactions: Map>) => { + this.transactionPool.on("drain", (transactions: Map>) => { // TODO: create pending block? }); } diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index 8c49bb6a33..741dc82b5c 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -1,6 +1,6 @@ import Emittery from "emittery"; import Blockchain from "../blockchain"; -import Heap from "@ganache/utils/src/utils/heap"; +import {utils} from "@ganache/utils"; import Transaction from "../things/transaction"; import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; @@ -20,7 +20,7 @@ function byNonce(values: Transaction[], a: number, b: number) { return (Quantity.from(values[b].nonce).toBigInt() || 0n) > (Quantity.from(values[a].nonce).toBigInt() || 0n); } -export default class TransactionPool extends Emittery.Typed<{drain: (transactions: Map>) => void}> { +export default class TransactionPool extends Emittery.Typed<{drain: (transactions: Map>) => void}> { #options: TransactionPoolOptions; /** @@ -34,8 +34,8 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction this.#blockchain = blockchain; this.#options = options; } - public executables: Map> = new Map(); - #origins: Map> = new Map(); + public executables: Map> = new Map(); + #origins: Map> = new Map(); public async insert(transaction: Transaction) { let err: Error; @@ -125,7 +125,7 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction executableOriginTransactions.push(transaction); } else { // if we don't yet have a executables queue for this origin make one now - executableOriginTransactions = Heap.from(transaction, byNonce); + executableOriginTransactions = utils.Heap.from(transaction, byNonce); executables.set(origin, executableOriginTransactions); } @@ -133,15 +133,15 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction } else if (queuedOriginTransactions) { queuedOriginTransactions.push(transaction); } else { - queuedOriginTransactions = Heap.from(transaction, byNonce); + queuedOriginTransactions = utils.Heap.from(transaction, byNonce); origins.set(origin, queuedOriginTransactions); } } #drainQueued = ( origin: string, - queuedOriginTransactions: Heap, - executableOriginTransactions: Heap, + queuedOriginTransactions: utils.Heap, + executableOriginTransactions: utils.Heap, transactionNonce: bigint ) => { // Now we need to drain any queued transacions that were previously diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 24b2f7e66c..a25105b102 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -2,7 +2,7 @@ import {ProviderOptions} from "@ganache/options"; import Emittery from "emittery"; import EthereumApi from "./api"; import JsonRpc from "@ganache/utils/src/things/jsonrpc"; -import Connector from "@ganache/utils/src/interfaces/connector"; +import {types, utils} from "@ganache/utils"; import EthereumProvider from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; import PromiEvent from "@ganache/utils/src/things/promievent"; @@ -12,7 +12,7 @@ function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest } export default class EthereumConnector extends Emittery.Typed - implements Connector> { + implements types.Connector> { #provider: EthereumProvider; @@ -20,7 +20,7 @@ export default class EthereumConnector extends Emittery.Typed promisify(trie.put.bind(trie))(key, val); function replaceFromHeap( - priced: Heap, - source: Heap, - pending: Map>, + priced: utils.Heap, + source: utils.Heap, + pending: Map>, key: string ) { // get the next best for this account, removing from the source Heap: @@ -41,7 +41,7 @@ function byPrice(values: Transaction[], a: number, b: number) { export default class Miner extends Emittery { #currentlyExecutingPrice = 0n; #origins = new Set(); - #pending: Map>; + #pending: Map>; #isMining: boolean = false; readonly #options: MinerOptions; readonly #vm: VM; @@ -50,7 +50,7 @@ export default class Miner extends Emittery { readonly #revert: () => Promise; // initialize a Heap that sorts by gasPrice - readonly #priced = new Heap(byPrice); + readonly #priced = new utils.Heap(byPrice); constructor(vm: VM, options: MinerOptions) { super(); this.#vm = vm; @@ -73,7 +73,7 @@ export default class Miner extends Emittery { * transactions within a single block. The remaining items will be left in * the pending pool to be eligible for mining in the future. */ - public async mine(pending: Map>, block: Block) { + public async mine(pending: Map>, block: Block) { // only allow mining a single block at a time (per miner) if (this.#isMining) { // if we are currently mining a block, set the `pending` property @@ -242,7 +242,7 @@ export default class Miner extends Emittery { this.#currentlyExecutingPrice = 0n; }; - #setPricedHeap = (pending: Map>) => { + #setPricedHeap = (pending: Map>) => { const origins = this.#origins; const priced = this.#priced; @@ -257,7 +257,7 @@ export default class Miner extends Emittery { } }; - #updatePricedHeap = (pending: Map>) => { + #updatePricedHeap = (pending: Map>) => { const origins = this.#origins; const priced = this.#priced; // Note: the `pending` Map passed here is "live", meaning it is constantly diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index ca4dd1d25f..b74d08830e 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -7,13 +7,11 @@ import Account from "./things/account"; import {mnemonicToSeedSync} from "bip39"; import Address from "./things/address"; import JsonRpc from "@ganache/utils/src/things/jsonrpc"; -import Executor from "@ganache/utils/src/utils/executor"; import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; import secp256k1 from "secp256k1"; import HDKey from "hdkey"; -import {KnownKeys} from "@ganache/utils/src/types"; -import {Provider} from "@ganache/utils/src/interfaces/provider"; +import {types, utils} from "@ganache/utils"; import PromiEvent from "@ganache/utils/src/things/promievent"; const WEI = 1000000000000000000n; @@ -23,14 +21,14 @@ interface Callback { } export default class EthereumProvider extends Emittery.Typed - implements Provider + implements types.Provider { #options: ProviderOptions; #api: EthereumApi; #wallet: HDKey; - #executor: Executor; + #executor: utils.Executor; - constructor(providerOptions: ProviderOptions = null, executor: Executor) { + constructor(providerOptions: ProviderOptions = null, executor: utils.Executor) { super(); const _providerOptions = (this.#options = ProviderOptions.getDefault(providerOptions)); @@ -110,9 +108,9 @@ export default class EthereumProvider extends Emittery.Typed, callback?: Callback): void; - public send(method: KnownKeys, params?: Parameters): Promise; - public send(arg1: KnownKeys | JsonRpc.Request, arg2?: Callback | any[]): Promise { - let method: KnownKeys; + public send(method: types.KnownKeys, params?: Parameters): Promise; + public send(arg1: types.KnownKeys | JsonRpc.Request, arg2?: Callback | any[]): Promise { + let method: types.KnownKeys; let params: any; let response: Promise<{}>; if (typeof arg1 === "string") { @@ -123,7 +121,7 @@ export default class EthereumProvider extends Emittery.Typed; + method = payload.method as types.KnownKeys; params = payload.params; this.request(method, params) @@ -160,9 +158,9 @@ export default class EthereumProvider extends Emittery.Typed = KnownKeys>(method: Parameters["length"] extends 0 ? Method : never): any; // ReturnType; - public request = KnownKeys>(method: Method, params: Parameters): any; // ReturnType; - public request = KnownKeys>(method: Method, params?: Parameters) { + public request = types.KnownKeys>(method: Parameters["length"] extends 0 ? Method : never): any; // ReturnType; + public request = types.KnownKeys>(method: Method, params: Parameters): any; // ReturnType; + public request = types.KnownKeys>(method: Method, params?: Parameters) { return this.#executor.execute(this.#api, method, params).then(result => { const promise = result.value as PromiseLike>; if (promise instanceof PromiEvent) { diff --git a/src/chains/tezos/src/api.ts b/src/chains/tezos/src/api.ts index a58e816946..af4f0bff58 100644 --- a/src/chains/tezos/src/api.ts +++ b/src/chains/tezos/src/api.ts @@ -1,6 +1,6 @@ -import Api from "@ganache/utils/src/interfaces/api"; +import {types} from "@ganache/utils"; -export default class TezosApi implements Api { +export default class TezosApi implements types.Api { readonly [index: string]: (...args: any) => Promise; async version(): Promise { diff --git a/src/chains/tezos/src/index.ts b/src/chains/tezos/src/index.ts index e2904a3774..5c3f190bf2 100644 --- a/src/chains/tezos/src/index.ts +++ b/src/chains/tezos/src/index.ts @@ -1,16 +1,16 @@ import Emittery from "emittery"; -import Connector from "@ganache/utils/src/interfaces/connector"; +import {utils, types} from "@ganache/utils"; import TezosProvider from "./provider"; import {ProviderOptions} from "@ganache/options"; import TezosApi from "./api"; import { HttpRequest } from "uWebSockets.js"; export default class TezosConnector extends Emittery.Typed - implements Connector { + implements types.Connector { provider: TezosProvider; #api: TezosApi; - constructor(providerOptions: ProviderOptions, requestCoordinator: any) { + constructor(providerOptions: ProviderOptions, requestCoordinator: utils.Executor) { super(); const api = (this.#api = new TezosApi()); diff --git a/src/chains/tezos/src/provider.ts b/src/chains/tezos/src/provider.ts index 87ab98b66b..cb27fbe9bf 100644 --- a/src/chains/tezos/src/provider.ts +++ b/src/chains/tezos/src/provider.ts @@ -1,11 +1,10 @@ -import {Provider} from "@ganache/utils/src/interfaces/provider"; +import {types} from "@ganache/utils"; import TezosApi from "./api"; -import {RequestType} from "@ganache/utils/src/types"; import Emittery from "emittery"; import {ProviderOptions} from "@ganache/options"; -export default class TezosProvider extends Emittery.Typed<{request: RequestType}, "ready" | "close"> - implements Provider { +export default class TezosProvider extends Emittery.Typed<{request: types.RequestType}, "ready" | "close"> + implements types.Provider { constructor(providerOptions?: ProviderOptions) { super(); this.emit("ready"); diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index e28be147ab..2db7b4458a 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -1,7 +1,6 @@ -import RequestCoordinator from "@ganache/utils/src/utils/request-coordinator"; +import {utils} from "@ganache/utils"; import {FlavorMap} from "@ganache/flavors"; import {ProviderOptions} from "@ganache/options"; -import Executor from "@ganache/utils/src/utils/executor"; /** * Loads the connector specified by the given `flavor` @@ -15,12 +14,12 @@ export default { // Set up our request coordinator to either use FIFO or or async request processing. // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it // for that (yet), instead of "all" (0) or just 1 as we are doing here: - const requestCoordinator = new RequestCoordinator(providerOptions.asyncRequestProcessing ? 0 : 1); + const requestCoordinator = new utils.RequestCoordinator(providerOptions.asyncRequestProcessing ? 0 : 1); // The Executor is responsible for actually executing the method on the chain/ledger. // It performs some safety checks to ensure "safe" method execution before passing it // to a RequestCoordinator. - const executor = new Executor(requestCoordinator); + const executor = new utils.Executor(requestCoordinator); const connector = new FlavorMap[flavor](providerOptions, executor); diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts index 4d80401852..596619ecc3 100644 --- a/src/packages/flavors/src/index.ts +++ b/src/packages/flavors/src/index.ts @@ -1,4 +1,4 @@ -import Connector from "@ganache/utils/src/interfaces/connector"; +import {types} from "@ganache/utils"; import TezosConnector from "@ganache/tezos"; import EthereumConnector from "@ganache/ethereum"; @@ -16,4 +16,4 @@ export type Flavors = { [k in keyof FlavorMap]: FlavorMap[k]; }[keyof FlavorMap]; -export type Apis = T extends Connector ? R : never; +export type Apis = T extends types.Connector ? R : never; diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index e835c5bb6a..706ef169f9 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -1,5 +1,5 @@ import {Quantity} from "@ganache/utils/src/things/json-rpc"; -import Api from "@ganache/utils/src/interfaces/api"; +import {types} from "@ganache/utils"; interface Logger { log(message?: any, ...optionalParams: any[]): void; @@ -11,7 +11,7 @@ interface Logger { type Account = {balance: string; secretKey?: string}; export interface Options { - api?: Api; + api?: types.Api; /** * Array of Accounts. Each object should have a balance key with a hexadecimal * value. The key secretKey can also be specified, which represents the diff --git a/src/packages/utils/src/index.ts b/src/packages/utils/src/index.ts new file mode 100644 index 0000000000..583a52797a --- /dev/null +++ b/src/packages/utils/src/index.ts @@ -0,0 +1,2 @@ +export * as types from "./types"; +export * as utils from "./utils"; diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts index a7593609bd..48c6b88f4d 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts @@ -1,4 +1,4 @@ -import bigintToBuffer from "../../utils/bigint-to-buffer"; +import {bigIntToBuffer} from "../../utils"; export type IndexableJsonRpcType< T extends number | bigint | string | Buffer = number | bigint | string | Buffer @@ -45,7 +45,7 @@ export class BaseJsonRpcType (value as bigint).toString(16)); toBuffers.set(this, () => { - return bigintToBuffer(value as bigint); + return bigIntToBuffer(value as bigint); //onst value = (2n**64n); var max = 2n ** 64n - 1n; diff --git a/src/packages/utils/src/things/jsonrpc.ts b/src/packages/utils/src/things/jsonrpc.ts index 1a5e290104..9ef9b66070 100644 --- a/src/packages/utils/src/things/jsonrpc.ts +++ b/src/packages/utils/src/things/jsonrpc.ts @@ -1,5 +1,4 @@ -import Api from "../interfaces/api"; -import { KnownKeys } from "../types"; +import { Api, KnownKeys } from "../types"; namespace JsonRpc { const jsonrpc = "2.0"; diff --git a/src/packages/utils/src/interfaces/api.ts b/src/packages/utils/src/types/api.ts similarity index 86% rename from src/packages/utils/src/interfaces/api.ts rename to src/packages/utils/src/types/api.ts index 4d3e3992b1..88f9a4cfa0 100644 --- a/src/packages/utils/src/interfaces/api.ts +++ b/src/packages/utils/src/types/api.ts @@ -10,4 +10,4 @@ class ApiBase { * Defines the interface for a API. * All properties must be `async` callable or return a `Promise` */ -export default interface Api extends ApiBase {} +export interface Api extends ApiBase {} diff --git a/src/packages/utils/src/interfaces/connector.ts b/src/packages/utils/src/types/connector.ts similarity index 82% rename from src/packages/utils/src/interfaces/connector.ts rename to src/packages/utils/src/types/connector.ts index 96ea38203c..121ea3807d 100644 --- a/src/packages/utils/src/interfaces/connector.ts +++ b/src/packages/utils/src/types/connector.ts @@ -1,13 +1,13 @@ import {Provider} from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; -import Api from "./api"; +import { Api } from "./api"; import Emittery from "emittery"; import PromiEvent from "../things/promievent"; /** * Connects an arbitrary public chain provider to ganache-core */ -export default interface Connector extends Emittery.Typed { +export interface Connector extends Emittery.Typed { provider: Provider; /** diff --git a/src/packages/utils/src/types/index.ts b/src/packages/utils/src/types/index.ts index c43a771b0d..1069eb798d 100644 --- a/src/packages/utils/src/types/index.ts +++ b/src/packages/utils/src/types/index.ts @@ -1,4 +1,8 @@ -import Api from "../interfaces/api"; +export * from "./connector"; +export * from "./provider"; +export * from "./api"; + +import { Api } from "./api"; export type KnownKeys = { [K in keyof T]: string extends K ? never : number extends K ? never : K; @@ -16,4 +20,4 @@ declare global { interface JSON { parse(text: Buffer, reviver?: (key: any, value: any) => any): any; } -} \ No newline at end of file +} diff --git a/src/packages/utils/src/interfaces/provider.ts b/src/packages/utils/src/types/provider.ts similarity index 69% rename from src/packages/utils/src/interfaces/provider.ts rename to src/packages/utils/src/types/provider.ts index d752df161b..5fda7bd3b5 100644 --- a/src/packages/utils/src/interfaces/provider.ts +++ b/src/packages/utils/src/types/provider.ts @@ -1,4 +1,4 @@ -import Api from "./api"; +import { Api } from "./api"; export interface Provider { diff --git a/src/packages/utils/src/utils.ts b/src/packages/utils/src/utils.ts deleted file mode 100644 index d98008d704..0000000000 --- a/src/packages/utils/src/utils.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default function utils() { - // TODO -} diff --git a/src/packages/utils/src/utils/bigint-to-buffer.ts b/src/packages/utils/src/utils/bigint-to-buffer.ts index c40d6b2db4..bc73603392 100644 --- a/src/packages/utils/src/utils/bigint-to-buffer.ts +++ b/src/packages/utils/src/utils/bigint-to-buffer.ts @@ -1,15 +1,15 @@ -let intToBuffer: (val: bigint) => Buffer; +let _bigIntToBuffer: (val: bigint) => Buffer; try { const toBufferBE = require("bigint-buffer").toBufferBE; - intToBuffer = (val: bigint) => { + _bigIntToBuffer = (val: bigint) => { const buffer = toBufferBE(val, 128); for (let i = 0; i < buffer.length - 1; i++) if (buffer[i]) return buffer.slice(i); return buffer.slice(buffer.length - 1); }; } catch (e) { - intToBuffer = (val: bigint): Buffer => { + _bigIntToBuffer = (val: bigint): Buffer => { const hex = val.toString(16); return Buffer.from(hex.length % 2 ? hex : `0${hex}`); }; } -export default intToBuffer; +export const bigIntToBuffer = _bigIntToBuffer; diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index 561cde7c59..ee89060bc2 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -1,10 +1,9 @@ -import Api from "../interfaces/api"; -import { KnownKeys } from "../types"; -import RequestCoordinator from "./request-coordinator"; +import { KnownKeys, Api } from "../types"; +import {RequestCoordinator} from "./request-coordinator"; const hasOwn = ({}).hasOwnProperty.call.bind(({}).hasOwnProperty); -export default class Executor { +export class Executor { #requestCoordinator: RequestCoordinator /** diff --git a/src/packages/utils/src/utils/heap.ts b/src/packages/utils/src/utils/heap.ts index 271cf19d47..1118add291 100644 --- a/src/packages/utils/src/utils/heap.ts +++ b/src/packages/utils/src/utils/heap.ts @@ -1,6 +1,6 @@ type Comparator = (values: T[], a: number, b: number) => boolean; -class Heap { +export class Heap { public length: number = 0; public array: T[] = []; protected readonly less: Comparator; @@ -209,4 +209,3 @@ class Heap { } } -export default Heap; diff --git a/src/packages/utils/src/utils/index.ts b/src/packages/utils/src/utils/index.ts new file mode 100644 index 0000000000..fe8688df58 --- /dev/null +++ b/src/packages/utils/src/utils/index.ts @@ -0,0 +1,4 @@ +export * from "./bigint-to-buffer"; +export * from "./executor"; +export * from "./heap"; +export * from "./request-coordinator"; \ No newline at end of file diff --git a/src/packages/utils/src/utils/request-coordinator.ts b/src/packages/utils/src/utils/request-coordinator.ts index de81f59155..871c161b38 100644 --- a/src/packages/utils/src/utils/request-coordinator.ts +++ b/src/packages/utils/src/utils/request-coordinator.ts @@ -3,7 +3,7 @@ const noop = () => {}; /** * Responsible for managing global concurrent requests. */ -export default class RequestCoordinator { +export class RequestCoordinator { /** * The number of concurrent requests. Set to null for no limit. */ diff --git a/typings/index.d.ts b/typings/index.d.ts new file mode 100644 index 0000000000..e69de29bb2 From 390820831979f2daf139215434c8c73429ce3940 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 12 May 2020 19:00:10 -0400 Subject: [PATCH 218/691] Improve server and ws-server test coverage --- src/packages/core/__tests__/server.ts | 131 ++++++++++++++++++++++++++ src/packages/core/src/server.ts | 2 +- 2 files changed, 132 insertions(+), 1 deletion(-) diff --git a/src/packages/core/__tests__/server.ts b/src/packages/core/__tests__/server.ts index adfd083b0a..bc86273874 100644 --- a/src/packages/core/__tests__/server.ts +++ b/src/packages/core/__tests__/server.ts @@ -7,6 +7,7 @@ import ServerOptions from "../src/options/server-options"; import http from "http"; import intoStream from "into-stream"; import EthereumProvider from "@ganache/ethereum/src/provider"; +import PromiEvent from "@ganache/utils/src/things/promievent"; const IS_WINDOWS = process.platform === "win32"; @@ -121,6 +122,30 @@ describe("server", () => { } }); + it("fails to `.close()` if server is closed", async () => { + await setup(); + try { + await s.close(); + assert.rejects(s.close(), { + message: "Server is already closed or closing." + }); + } finally { + await teardown(); + } + }); + + it("fails to `.close()` if server is closed", async () => { + await setup(); + try { + s.close(); + assert.rejects(s.close(), { + message: "Server is already closed or closing." + }); + } finally { + await teardown(); + } + }); + it("fails to listen if the socket is already in use by 3rd party", async () => { const server = http.createServer(); server.listen(port); @@ -155,6 +180,31 @@ describe("server", () => { } }); + it("rejects if listen called while server is closing", async () => { + await setup(); + try { + const closer = s.close(); + await assert.rejects(s.listen(4444), { + message: "Cannot start server while it is closing." + }); + await closer; + } finally { + await teardown(); + } + }); + + it("rejects if close is called while opening", async () => { + const pendingSetup = setup(); + try { + await assert.rejects(s.close(), { + message: "Cannot close server while it is opening." + }); + } finally { + await pendingSetup; + await teardown(); + } + }) + it("does not start a websocket server when `ws` is false", async () => { await setup({ ws: false @@ -467,6 +517,87 @@ describe("server", () => { }); }); + it("handles PromiEvent messages", async () => { + const provider = s.provider as EthereumProvider; + const message = "I hope you get this message"; + provider.request = () => { + const promiEvent = new PromiEvent((resolve => { + resolve("0xsubscriptionId"); + setImmediate(()=>promiEvent.emit("message", message)); + })); + return promiEvent; + }; + + const ws = new WebSocket("ws://localhost:" + port); + const result = await new Promise(resolve => { + ws.on("open", () => { + // If we get a message that means things didn't get closed as they + // should have OR they are closing too late for some reason and + // this test isn't testing anything. + ws.on("message", (data) => { + const {result} = JSON.parse(data.toString()); + // ignore the initial response + if (result === "0xsubscriptionId") return; + + resolve(result); + }); + + const subscribeJson: any = { + jsonrpc: "2.0", + id: "1", + method: "eth_subscribe", + params: [] + }; + ws.send(JSON.stringify(subscribeJson)); + }); + }); + + assert.strictEqual(result, message); + }); + + it("doesn't crash when the connection is closed while a subscription is in flight", async () => { + const provider = s.provider as EthereumProvider; + let promiEvent: PromiEvent; + provider.request = () => { + promiEvent = new PromiEvent((resolve => { + resolve("0xsubscriptionId"); + })); + return promiEvent; + }; + + const ws = new WebSocket("ws://localhost:" + port); + return new Promise((resolve, reject) => { + ws.on("open", () => { + // If we get a message that means things didn't get closed as they + // should have OR they are closing too late for some reason and + // this test isn't testing anything. + ws.on("message", (data) => { + if (JSON.parse(data.toString()).result === "0xsubscriptionId") { + // close our websocket after intercepting the request + s.close(); + // then attempt to send a message back right after closing: + promiEvent.emit("message", "I hope you don't get this message"); + return; + } + // the above message should never be received + reject("Got a subscription message when we shouldn't have!"); + }); + + // make sure we leave enough time for things to crash if it does end + // up crashing. + ws.on("close", () => setImmediate(resolve)); + + const subscribeJson: any = { + jsonrpc: "2.0", + id: "1", + method: "eth_subscribe", + params: [] + }; + ws.send(JSON.stringify(subscribeJson)); + }); + }); + }); + // I can't get backpressure working on Windows. It's not super important because we // don't actually handle backpressure anyway. (IS_WINDOWS ? xit : it)("can handle backpressure", async () => { diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index 165fb4a0ac..be329ed6ef 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -111,7 +111,7 @@ export default class Server { public async close() { if (this.#status === Status.opening) { - // if closed or closing + // if opening throw new Error(`Cannot close server while it is opening.`); } else if (this.#status & Status.closed) { // if closed or closing From 97e93f0f1eef1b6796eddacbd9383c023eb88277 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 12 May 2020 20:38:38 -0400 Subject: [PATCH 219/691] Additional test coverage --- src/packages/core/__tests__/server.ts | 42 +++++++++++++++++++++++---- src/packages/core/src/server.ts | 8 ++--- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/packages/core/__tests__/server.ts b/src/packages/core/__tests__/server.ts index bc86273874..881498d393 100644 --- a/src/packages/core/__tests__/server.ts +++ b/src/packages/core/__tests__/server.ts @@ -8,6 +8,7 @@ import http from "http"; import intoStream from "into-stream"; import EthereumProvider from "@ganache/ethereum/src/provider"; import PromiEvent from "@ganache/utils/src/things/promievent"; +import {promisify} from "util"; const IS_WINDOWS = process.platform === "win32"; @@ -109,13 +110,14 @@ describe("server", () => { } }); - it("fails to `.listen()` twice, callback", async () => { + it("fails to `.listen()` twice, Callback", async () => { await setup(); try { // the call to `setup()` above calls `listen()` already. if we call it // again it should fail. - s.listen(port, err => { - assert.strict(err!.message, `Server is already listening on port: ${port}.`); + const listen = promisify(s.listen.bind(s)); + await assert.rejects(listen(port), { + message: `Server is already open on port: ${port}.` }); } finally { await teardown(); @@ -146,7 +148,7 @@ describe("server", () => { } }); - it("fails to listen if the socket is already in use by 3rd party", async () => { + it("fails to listen if the socket is already in use by 3rd party, Promise", async () => { const server = http.createServer(); server.listen(port); @@ -160,6 +162,22 @@ describe("server", () => { } }); + it("fails to listen if the socket is already in use by 3rd party, Callback", async () => { + const server = http.createServer(); + server.listen(port); + + try { + const s = Ganache.server(); + const listen = promisify(s.listen.bind(s)); + await assert.rejects(listen(port), { + message: `Failed to listen on port: ${port}.` + }); + } finally { + await teardown(); + server.close(); + } + }); + // skip on Windows until https://github.com/uNetworking/uSockets/pull/101 is merged (IS_WINDOWS ? xit : it)("fails to listen if the socket is already in use by Ganache", async () => { await setup(); @@ -180,7 +198,7 @@ describe("server", () => { } }); - it("rejects if listen called while server is closing", async () => { + it("rejects if listen called while server is closing, Promise", async () => { await setup(); try { const closer = s.close(); @@ -193,6 +211,20 @@ describe("server", () => { } }); + it("rejects if listen called while server is closing, Callback", async () => { + await setup(); + try { + const closer = s.close(); + const listen = promisify(s.listen.bind(s)); + await assert.rejects(listen(4444), { + message: "Cannot start server while it is closing." + }); + await closer; + } finally { + await teardown(); + } + }); + it("rejects if close is called while opening", async () => { const pendingSetup = setup(); try { diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index be329ed6ef..65ea50ebe3 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -120,11 +120,9 @@ export default class Server { const _listenSocket = this.#listenSocket; this.#status = Status.closing; - if (_listenSocket) { - this.#listenSocket = void 0; - // close the socket to prevent any more connections - uWS.us_listen_socket_close(_listenSocket); - } + this.#listenSocket = void 0; + // close the socket to prevent any more connections + uWS.us_listen_socket_close(_listenSocket); // close all the connected websockets: const ws = this.#websocketServer; if (ws) { From 575c1119e006802198fc1acde6f2736d6cdfe63f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 12 May 2020 20:53:46 -0400 Subject: [PATCH 220/691] Udpate create script --- scripts/create.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create.ts b/scripts/create.ts index 4d9937718b..7f57abbbf8 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -43,7 +43,7 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a scripts: { tsc: "ts-node ../../../scripts/compile", test: "nyc npm run mocha -- --throw-deprecation --trace-warnings", - mocha: "mocha --detectLeaks '__tests__/**.ts'" + mocha: "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" From bdcce36bf26164b1e9cd4cf825ba710a1ed78977 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 13 May 2020 12:13:09 -0400 Subject: [PATCH 221/691] Update dependencies --- npm-shrinkwrap.json | 636 +++++++++++++++++++++++++++----------------- package.json | 27 +- 2 files changed, 399 insertions(+), 264 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6a12bf8a0f..50675dc530 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -523,14 +523,14 @@ "dev": true }, "@lerna/add": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/add/-/add-3.20.0.tgz", - "integrity": "sha512-AnH1oRIEEg/VDa3SjYq4x1/UglEAvrZuV0WssHUMN81RTZgQk3we+Mv3qZNddrZ/fBcZu2IAdN/EQ3+ie2JxKQ==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/add/-/add-3.21.0.tgz", + "integrity": "sha512-vhUXXF6SpufBE1EkNEXwz1VLW03f177G9uMOFMQkp6OJ30/PWg4Ekifuz9/3YfgB2/GH8Tu4Lk3O51P2Hskg/A==", "dev": true, "requires": { "@evocateur/pacote": "^9.6.3", - "@lerna/bootstrap": "3.20.0", - "@lerna/command": "3.18.5", + "@lerna/bootstrap": "3.21.0", + "@lerna/command": "3.21.0", "@lerna/filter-options": "3.20.0", "@lerna/npm-conf": "3.16.0", "@lerna/validation-error": "3.13.0", @@ -569,12 +569,12 @@ } }, "@lerna/bootstrap": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.20.0.tgz", - "integrity": "sha512-Wylullx3uthKE7r4izo09qeRGL20Y5yONlQEjPCfnbxCC2Elu+QcPu4RC6kqKQ7b+g7pdC3OOgcHZjngrwr5XQ==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.21.0.tgz", + "integrity": "sha512-mtNHlXpmvJn6JTu0KcuTTPl2jLsDNud0QacV/h++qsaKbhAaJr/FElNZ5s7MwZFUM3XaDmvWzHKaszeBMHIbBw==", "dev": true, "requires": { - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/filter-options": "3.20.0", "@lerna/has-npm-version": "3.16.5", "@lerna/npm-install": "3.16.5", @@ -628,13 +628,13 @@ } }, "@lerna/changed": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-3.20.0.tgz", - "integrity": "sha512-+hzMFSldbRPulZ0vbKk6RD9f36gaH3Osjx34wrrZ62VB4pKmjyuS/rxVYkCA3viPLHoiIw2F8zHM5BdYoDSbjw==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-3.21.0.tgz", + "integrity": "sha512-hzqoyf8MSHVjZp0gfJ7G8jaz+++mgXYiNs9iViQGA8JlN/dnWLI5sWDptEH3/B30Izo+fdVz0S0s7ydVE3pWIw==", "dev": true, "requires": { "@lerna/collect-updates": "3.20.0", - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/listable": "3.18.5", "@lerna/output": "3.13.0" } @@ -662,12 +662,12 @@ } }, "@lerna/clean": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-3.20.0.tgz", - "integrity": "sha512-9ZdYrrjQvR5wNXmHfDsfjWjp0foOkCwKe3hrckTzkAeQA1ibyz5llGwz5e1AeFrV12e2/OLajVqYfe+qdkZUgg==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-3.21.0.tgz", + "integrity": "sha512-b/L9l+MDgE/7oGbrav6rG8RTQvRiZLO1zTcG17zgJAAuhlsPxJExMlh2DFwJEVi2les70vMhHfST3Ue1IMMjpg==", "dev": true, "requires": { - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/filter-options": "3.20.0", "@lerna/prompt": "3.18.5", "@lerna/pulse-till-done": "3.13.0", @@ -768,14 +768,14 @@ } }, "@lerna/command": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/command/-/command-3.18.5.tgz", - "integrity": "sha512-36EnqR59yaTU4HrR1C9XDFti2jRx0BgpIUBeWn129LZZB8kAB3ov1/dJNa1KcNRKp91DncoKHLY99FZ6zTNpMQ==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/command/-/command-3.21.0.tgz", + "integrity": "sha512-T2bu6R8R3KkH5YoCKdutKv123iUgUbW8efVjdGCDnCMthAQzoentOJfDeodBwn0P2OqCl3ohsiNVtSn9h78fyQ==", "dev": true, "requires": { "@lerna/child-process": "3.16.5", "@lerna/package-graph": "3.18.5", - "@lerna/project": "3.18.0", + "@lerna/project": "3.21.0", "@lerna/validation-error": "3.13.0", "@lerna/write-log-file": "3.13.0", "clone-deep": "^4.0.1", @@ -859,14 +859,14 @@ } }, "@lerna/create": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.18.5.tgz", - "integrity": "sha512-cHpjocbpKmLopCuZFI7cKEM3E/QY8y+yC7VtZ4FQRSaLU8D8i2xXtXmYaP1GOlVNavji0iwoXjuNpnRMInIr2g==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.21.0.tgz", + "integrity": "sha512-cRIopzKzE2vXJPmsiwCDMWo4Ct+KTmX3nvvkQLDoQNrrRK7w+3KQT3iiorbj1koD95RsVQA7mS2haWok9SIv0g==", "dev": true, "requires": { "@evocateur/pacote": "^9.6.3", "@lerna/child-process": "3.16.5", - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/npm-conf": "3.16.0", "@lerna/validation-error": "3.13.0", "camelcase": "^5.0.0", @@ -994,25 +994,25 @@ } }, "@lerna/diff": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-3.18.5.tgz", - "integrity": "sha512-u90lGs+B8DRA9Z/2xX4YaS3h9X6GbypmGV6ITzx9+1Ga12UWGTVlKaCXBgONMBjzJDzAQOK8qPTwLA57SeBLgA==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-3.21.0.tgz", + "integrity": "sha512-5viTR33QV3S7O+bjruo1SaR40m7F2aUHJaDAC7fL9Ca6xji+aw1KFkpCtVlISS0G8vikUREGMJh+c/VMSc8Usw==", "dev": true, "requires": { "@lerna/child-process": "3.16.5", - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/validation-error": "3.13.0", "npmlog": "^4.1.2" } }, "@lerna/exec": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-3.20.0.tgz", - "integrity": "sha512-pS1mmC7kzV668rHLWuv31ClngqeXjeHC8kJuM+W2D6IpUVMGQHLcCTYLudFgQsuKGVpl0DGNYG+sjLhAPiiu6A==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-3.21.0.tgz", + "integrity": "sha512-iLvDBrIE6rpdd4GIKTY9mkXyhwsJ2RvQdB9ZU+/NhR3okXfqKc6py/24tV111jqpXTtZUW6HNydT4dMao2hi1Q==", "dev": true, "requires": { "@lerna/child-process": "3.16.5", - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/filter-options": "3.20.0", "@lerna/profiler": "3.20.0", "@lerna/run-topologically": "3.18.5", @@ -1141,13 +1141,13 @@ } }, "@lerna/import": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.18.5.tgz", - "integrity": "sha512-PH0WVLEgp+ORyNKbGGwUcrueW89K3Iuk/DDCz8mFyG2IG09l/jOF0vzckEyGyz6PO5CMcz4TI1al/qnp3FrahQ==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.21.0.tgz", + "integrity": "sha512-aISkL4XD0Dqf5asDaOZWu65jgj8fWUhuQseZWuQe3UfHxav69fTS2YLIngUfencaOSZVOcVCom28YCzp61YDxw==", "dev": true, "requires": { "@lerna/child-process": "3.16.5", - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/prompt": "3.18.5", "@lerna/pulse-till-done": "3.13.0", "@lerna/validation-error": "3.13.0", @@ -1185,24 +1185,24 @@ } }, "@lerna/info": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/info/-/info-3.20.0.tgz", - "integrity": "sha512-Rsz+KQF9mczbGUbPTrtOed1N0C+cA08Qz0eX/oI+NNjvsryZIju/o7uedG4I3P55MBiAioNrJI88fHH3eTgYug==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/info/-/info-3.21.0.tgz", + "integrity": "sha512-0XDqGYVBgWxUquFaIptW2bYSIu6jOs1BtkvRTWDDhw4zyEdp6q4eaMvqdSap1CG+7wM5jeLCi6z94wS0AuiuwA==", "dev": true, "requires": { - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/output": "3.13.0", "envinfo": "^7.3.1" } }, "@lerna/init": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/init/-/init-3.18.5.tgz", - "integrity": "sha512-oCwipWrha98EcJAHm8AGd2YFFLNI7AW9AWi0/LbClj1+XY9ah+uifXIgYGfTk63LbgophDd8936ZEpHMxBsbAg==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/init/-/init-3.21.0.tgz", + "integrity": "sha512-6CM0z+EFUkFfurwdJCR+LQQF6MqHbYDCBPyhu/d086LRf58GtYZYj49J8mKG9ktayp/TOIxL/pKKjgLD8QBPOg==", "dev": true, "requires": { "@lerna/child-process": "3.16.5", - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "fs-extra": "^8.1.0", "p-map": "^2.1.0", "write-json-file": "^3.2.0" @@ -1237,12 +1237,12 @@ } }, "@lerna/link": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/link/-/link-3.18.5.tgz", - "integrity": "sha512-xTN3vktJpkT7Nqc3QkZRtHO4bT5NvuLMtKNIBDkks0HpGxC9PRyyqwOoCoh1yOGbrWIuDezhfMg3Qow+6I69IQ==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/link/-/link-3.21.0.tgz", + "integrity": "sha512-tGu9GxrX7Ivs+Wl3w1+jrLi1nQ36kNI32dcOssij6bg0oZ2M2MDEFI9UF2gmoypTaN9uO5TSsjCFS7aR79HbdQ==", "dev": true, "requires": { - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/package-graph": "3.18.5", "@lerna/symlink-dependencies": "3.17.0", "p-map": "^2.1.0", @@ -1250,12 +1250,12 @@ } }, "@lerna/list": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/list/-/list-3.20.0.tgz", - "integrity": "sha512-fXTicPrfioVnRzknyPawmYIVkzDRBaQqk9spejS1S3O1DOidkihK0xxNkr8HCVC0L22w6f92g83qWDp2BYRUbg==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/list/-/list-3.21.0.tgz", + "integrity": "sha512-KehRjE83B1VaAbRRkRy6jLX1Cin8ltsrQ7FHf2bhwhRHK0S54YuA6LOoBnY/NtA8bHDX/Z+G5sMY78X30NS9tg==", "dev": true, "requires": { - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/filter-options": "3.20.0", "@lerna/listable": "3.18.5", "@lerna/output": "3.13.0" @@ -1627,9 +1627,9 @@ } }, "@lerna/project": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/@lerna/project/-/project-3.18.0.tgz", - "integrity": "sha512-+LDwvdAp0BurOAWmeHE3uuticsq9hNxBI0+FMHiIai8jrygpJGahaQrBYWpwbshbQyVLeQgx3+YJdW2TbEdFWA==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/project/-/project-3.21.0.tgz", + "integrity": "sha512-xT1mrpET2BF11CY32uypV2GPtPVm6Hgtha7D81GQP9iAitk9EccrdNjYGt5UBYASl4CIDXBRxwmTTVGfrCx82A==", "dev": true, "requires": { "@lerna/package": "3.16.0", @@ -1657,9 +1657,9 @@ } }, "@lerna/publish": { - "version": "3.20.2", - "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.20.2.tgz", - "integrity": "sha512-N7Y6PdhJ+tYQPdI1tZum8W25cDlTp4D6brvRacKZusweWexxaopbV8RprBaKexkEX/KIbncuADq7qjDBdQHzaA==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.21.0.tgz", + "integrity": "sha512-JZ+ehZB9UCQ9nqH8Ld/Yqc/If++aK/7XIubkrB9sQ5hf2GeIbmI/BrJpMgLW/e9T5bKrUBZPUvoUN3daVipA5A==", "dev": true, "requires": { "@evocateur/libnpmaccess": "^3.1.2", @@ -1668,7 +1668,7 @@ "@lerna/check-working-tree": "3.16.5", "@lerna/child-process": "3.16.5", "@lerna/collect-updates": "3.20.0", - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/describe-ref": "3.16.5", "@lerna/log-packed": "3.16.0", "@lerna/npm-conf": "3.16.0", @@ -1683,7 +1683,7 @@ "@lerna/run-lifecycle": "3.16.2", "@lerna/run-topologically": "3.18.5", "@lerna/validation-error": "3.13.0", - "@lerna/version": "3.20.2", + "@lerna/version": "3.21.0", "figgy-pudding": "^3.5.1", "fs-extra": "^8.1.0", "npm-package-arg": "^6.1.0", @@ -1819,12 +1819,12 @@ } }, "@lerna/run": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/run/-/run-3.20.0.tgz", - "integrity": "sha512-9U3AqeaCeB7KsGS9oyKNp62s9vYoULg/B4cqXTKZkc+OKL6QOEjYHYVSBcMK9lUXrMjCjDIuDSX3PnTCPxQ2Dw==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/run/-/run-3.21.0.tgz", + "integrity": "sha512-fJF68rT3veh+hkToFsBmUJ9MHc9yGXA7LSDvhziAojzOb0AI/jBDp6cEcDQyJ7dbnplba2Lj02IH61QUf9oW0Q==", "dev": true, "requires": { - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/filter-options": "3.20.0", "@lerna/npm-run-script": "3.16.5", "@lerna/output": "3.13.0", @@ -1957,15 +1957,15 @@ } }, "@lerna/version": { - "version": "3.20.2", - "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.20.2.tgz", - "integrity": "sha512-ckBJMaBWc+xJen0cMyCE7W67QXLLrc0ELvigPIn8p609qkfNM0L0CF803MKxjVOldJAjw84b8ucNWZLvJagP/Q==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.21.0.tgz", + "integrity": "sha512-nIT3u43fCNj6uSMN1dRxFnF4GhmIiOEqSTkGSjrMU+8kHKwzOqS/6X6TOzklBmCyEZOpF/fLlGqH3BZHnwLDzQ==", "dev": true, "requires": { "@lerna/check-working-tree": "3.16.5", "@lerna/child-process": "3.16.5", "@lerna/collect-updates": "3.20.0", - "@lerna/command": "3.18.5", + "@lerna/command": "3.21.0", "@lerna/conventional-commits": "3.18.5", "@lerna/github-client": "3.16.5", "@lerna/gitlab-client": "3.15.0", @@ -2218,9 +2218,9 @@ } }, "@octokit/types": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.0.tgz", - "integrity": "sha512-hA06ZYqkAVxvwFVu7yqRNVBGfG9MZvLMbqfgfm6F79g5xWspxsbL/2/rHcFP/z1YBN3zbcNQYuUHiBml4b24MA==", + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", "dev": true, "requires": { "@types/node": ">= 8" @@ -2354,6 +2354,12 @@ "is-number": "^7.0.0" } }, + "typescript": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "dev": true + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -2368,13 +2374,6 @@ "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", "requires": { "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "13.13.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz", - "integrity": "sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==" - } } }, "@types/color-name": { @@ -2447,10 +2446,9 @@ "dev": true }, "@types/node": { - "version": "13.13.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.2.tgz", - "integrity": "sha512-LB2R1Oyhpg8gu4SON/mfforE525+Hi/M1ineICEDftqNVTyFg1aRIeGuTvXAoWHc4nbrFncWtJgMmoyRvuGh7A==", - "dev": true + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz", + "integrity": "sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -2471,9 +2469,9 @@ "dev": true }, "@types/secp256k1": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-3.5.0.tgz", - "integrity": "sha512-ZE39QhkIaNK6xbKIp1VLN5O36r97LuslLmRnjAcT0sVDxcfvrk3zqp/VnIfmGza7J6jDxR8dIai3hsCxPYglPA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", "dev": true, "requires": { "@types/node": "*" @@ -3159,12 +3157,6 @@ } } }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, "builtins": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", @@ -3614,7 +3606,8 @@ "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "dev": true, + "optional": true }, "commondir": { "version": "1.0.1", @@ -4620,6 +4613,21 @@ "rlp": "^2.0.0", "secp256k1": "^3.0.1" } + }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } } } }, @@ -4631,6 +4639,53 @@ "ethereumjs-util": "^6.0.0", "rlp": "^2.2.1", "safe-buffer": "^5.1.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "ethereumjs-util": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^2.0.0", + "rlp": "^2.2.3", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", + "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", + "requires": { + "bindings": "^1.5.0", + "inherits": "^2.0.4", + "nan": "^2.14.0", + "safe-buffer": "^5.2.0" + } + }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } + } } }, "ethereumjs-block": { @@ -4662,6 +4717,23 @@ "rlp": "^2.0.0", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" + }, + "dependencies": { + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } + } } }, "isarray": { @@ -4808,6 +4880,21 @@ "requires": { "yallist": "^3.0.2" } + }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } } } }, @@ -4823,20 +4910,6 @@ "requires": { "ethereumjs-common": "^1.5.0", "ethereumjs-util": "^6.0.0" - } - }, - "ethereumjs-util": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", - "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^2.0.0", - "rlp": "^2.2.3", - "secp256k1": "^3.0.1" }, "dependencies": { "bn.js": { @@ -4844,6 +4917,20 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, + "ethereumjs-util": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^2.0.0", + "rlp": "^2.2.3", + "secp256k1": "^3.0.1" + } + }, "keccak": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", @@ -4854,13 +4941,42 @@ "nan": "^2.14.0", "safe-buffer": "^5.2.0" } + }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } } } }, + "ethereumjs-util": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.0.tgz", + "integrity": "sha512-y4FqiypxmUVdmCqNPRdB2rvyP1pr8ZBO+RVlxGLF12OoTXVPvgJ3omT2AoYLGCXjgbYDwskbbbROklerm2FNcA==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^5.1.1", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^3.0.0", + "rlp": "^2.2.4", + "secp256k1": "^4.0.1" + } + }, "ethereumjs-vm": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.1.3.tgz", - "integrity": "sha512-RTrD0y7My4O6Qr1P2ZIsMfD6RzL6kU/RhBZ0a5XrPzAeR61crBS7or66ohDrvxDI/rDBxMi+6SnsELih6fzalw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz", + "integrity": "sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==", "requires": { "async": "^2.1.2", "async-eventemitter": "^0.2.2", @@ -4884,20 +5000,34 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, + "ethereumjs-util": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^2.0.0", + "rlp": "^2.2.3", + "secp256k1": "^3.0.1" + } + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", + "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" + "bindings": "^1.5.0", + "inherits": "^2.0.4", + "nan": "^2.14.0", + "safe-buffer": "^5.2.0" } }, "levelup": { @@ -4947,6 +5077,17 @@ "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } } } }, @@ -4971,6 +5112,21 @@ } } }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -5164,17 +5320,6 @@ "chardet": "^0.7.0", "iconv-lite": "^0.4.24", "tmp": "^0.0.33" - }, - "dependencies": { - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - } } }, "extglob": { @@ -6453,6 +6598,28 @@ "bs58check": "^2.1.2", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } + } } }, "he": { @@ -7367,27 +7534,27 @@ } }, "lerna": { - "version": "3.20.2", - "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.20.2.tgz", - "integrity": "sha512-bjdL7hPLpU3Y8CBnw/1ys3ynQMUjiK6l9iDWnEGwFtDy48Xh5JboR9ZJwmKGCz9A/sarVVIGwf1tlRNKUG9etA==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.21.0.tgz", + "integrity": "sha512-ux8yOwQEgIXOZVUfq+T8nVzPymL19vlIoPbysOP3YA4hcjKlqQIlsjI/1ugBe6b4MF7W4iV5vS3gH9cGqBBc1A==", "dev": true, "requires": { - "@lerna/add": "3.20.0", - "@lerna/bootstrap": "3.20.0", - "@lerna/changed": "3.20.0", - "@lerna/clean": "3.20.0", + "@lerna/add": "3.21.0", + "@lerna/bootstrap": "3.21.0", + "@lerna/changed": "3.21.0", + "@lerna/clean": "3.21.0", "@lerna/cli": "3.18.5", - "@lerna/create": "3.18.5", - "@lerna/diff": "3.18.5", - "@lerna/exec": "3.20.0", - "@lerna/import": "3.18.5", - "@lerna/info": "3.20.0", - "@lerna/init": "3.18.5", - "@lerna/link": "3.18.5", - "@lerna/list": "3.20.0", - "@lerna/publish": "3.20.2", - "@lerna/run": "3.20.0", - "@lerna/version": "3.20.2", + "@lerna/create": "3.21.0", + "@lerna/diff": "3.21.0", + "@lerna/exec": "3.21.0", + "@lerna/import": "3.21.0", + "@lerna/info": "3.21.0", + "@lerna/init": "3.21.0", + "@lerna/link": "3.21.0", + "@lerna/list": "3.21.0", + "@lerna/publish": "3.21.0", + "@lerna/run": "3.21.0", + "@lerna/version": "3.21.0", "import-local": "^2.0.0", "npmlog": "^4.1.2" } @@ -8121,6 +8288,23 @@ "rlp": "^2.0.0", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" + }, + "dependencies": { + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } + } } }, "isarray": { @@ -8374,9 +8558,9 @@ } }, "mocha": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.1.tgz", - "integrity": "sha512-3qQsu3ijNS3GkWcccT5Zw0hf/rWvu1fTN9sPvEd81hlwsr30GX2GcDSSoBxo24IR8FelmrAydGC6/1J5QQP4WA==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.2.tgz", + "integrity": "sha512-o96kdRKMKI3E8U0bjnfqW4QMk12MwZ4mhdBTf+B5a1q9+aq2HRnj+3ZdJu0B/ZhJeK78MgYuv6L8d/rA5AeBJA==", "dev": true, "requires": { "ansi-colors": "3.2.3", @@ -8392,7 +8576,7 @@ "js-yaml": "3.13.1", "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.3", + "mkdirp": "0.5.5", "ms": "2.1.1", "node-environment-flags": "1.0.6", "object.assign": "4.1.0", @@ -8446,15 +8630,6 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", @@ -10044,6 +10219,7 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, "requires": { "glob": "^7.1.3" } @@ -10128,25 +10304,13 @@ "dev": true }, "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-iGRjbGAKfXMqhtdkkuNxsgJQfJO8Oo78Rm7DAvsG3XKngq+nJIOGqrCSXcQqIVsmCj0wFanE5uTKFxV3T9j2wg==", + "requires": { "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" } }, "seedrandom": { @@ -10419,9 +10583,9 @@ } }, "solc": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.6.tgz", - "integrity": "sha512-p0IO/1fRaHWKN+qR+mUivpwnBpFYD8EoFAzT8VL4lmllNwsyEO7TJJAc2QK0XUeWOYOT92NWKhDNNNLTVbHShA==", + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.7.tgz", + "integrity": "sha512-a3iocjS1yGzw3Wy7jkqSLX3Vg1lMDCyoKZoVfpOagRGWkh37f11BrcUDO8f73rjdpw2WUBSLJtTQ26i52/0JOg==", "dev": true, "requires": { "command-exists": "^1.2.8", @@ -10473,15 +10637,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } } } }, @@ -10514,9 +10669,9 @@ } }, "source-map-support": { - "version": "0.5.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.18.tgz", - "integrity": "sha512-9luZr/BZ2QeU6tO2uG8N2aZpVSli4TSAOAqFOyTO51AJcD9P99c0K1h6dD6r6qo5dyT44BR5exweOaLLeldTkQ==", + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -11063,19 +11218,38 @@ } }, "tmp": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", - "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, "requires": { - "rimraf": "^2.6.3" + "os-tmpdir": "~1.0.2" } }, "tmp-promise": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-2.0.2.tgz", - "integrity": "sha512-zl71nFWjPKW2KXs+73gEk8RmqvtAeXPxhWDkTUoa3MSMkjq3I+9OeknjF178MQoMYsdqL730hfzvNfEkePxq9Q==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.2.tgz", + "integrity": "sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA==", "requires": { - "tmp": "0.1.0" + "tmp": "^0.2.0" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "requires": { + "rimraf": "^3.0.0" + } + } } }, "to-fast-properties": { @@ -11169,9 +11343,9 @@ } }, "ts-node": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.9.0.tgz", - "integrity": "sha512-rwkXfOs9zmoHrV8xE++dmNd6ZIS+nmHHCxcV53ekGJrxFLMbp+pizpPS07ARvhwneCIECPppOwbZHvw9sQtU4w==", + "version": "8.10.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.1.tgz", + "integrity": "sha512-bdNz1L4ekHiJul6SHtZWs1ujEKERJnHs4HxN7rjTyyVOFf3HaJ6sLqe6aPG62XTzAB/63pKRh5jTSWL0D7bsvw==", "dev": true, "requires": { "arg": "^4.1.0", @@ -11195,44 +11369,6 @@ "integrity": "sha512-5rxCQkP0kytf4H1T4xz1imjxaUUPMvc5aWp0rJ/VMIN7ClRiH1FwFvBt8wOeMasp/epeUnmSW6CixSIePtiLqA==", "dev": true }, - "tslint": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.1.tgz", - "integrity": "sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.10.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - } - } - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -11270,9 +11406,9 @@ } }, "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz", + "integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==", "dev": true }, "uWebSockets.js": { @@ -11280,9 +11416,9 @@ "from": "github:uNetworking/uWebSockets.js#v17.4.0" }, "uglify-js": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.2.tgz", - "integrity": "sha512-zGVwKslUAD/EeqOrD1nQaBmXIHl1Vw371we8cvS8I6mYK9rmgX5tv8AAeJdfsQ3Kk5mGax2SVV/AizxdNGhl7Q==", + "version": "3.9.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.3.tgz", + "integrity": "sha512-r5ImcL6QyzQGVimQoov3aL2ZScywrOgBXGndbWrdehKoSvGe/RmiE5Jpw/v+GvxODt6l2tpBXwA7n+qZVlHBMA==", "dev": true, "optional": true, "requires": { @@ -11694,9 +11830,9 @@ } }, "ws": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.3.tgz", - "integrity": "sha512-HTDl9G9hbkNDk98naoR/cHDws7+EyYMOdL1BmjsZXRUjf7d+MficC4B7HLUPlSiho0vg+CWKrGIt/VJBd1xunQ==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz", + "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", "dev": true }, "xtend": { diff --git a/package.json b/package.json index 9d41b39c4b..d8088e53d0 100644 --- a/package.json +++ b/package.json @@ -21,28 +21,28 @@ "ethereumjs-block": "2.2.2", "ethereumjs-common": "1.5.0", "ethereumjs-tx": "2.1.2", - "ethereumjs-util": "6.2.0", - "ethereumjs-vm": "4.1.3", + "ethereumjs-util": "7.0.0", + "ethereumjs-vm": "4.2.0", "hdkey": "1.1.2", "keccak": "3.0.0", "leveldown": "5.6.0", "levelup": "4.4.0", "lodash.clonedeep": "4.5.0", "merkle-patricia-tree": "3.0.0", - "secp256k1": "3.8.0", + "secp256k1": "4.0.1", "seedrandom": "3.0.5", "subleveldown": "5.0.0", - "tmp-promise": "2.0.2", + "tmp-promise": "3.0.2", "uWebSockets.js": "github:uNetworking/uWebSockets.js#v17.4.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "1.0.1", "@types/fs-extra": "8.1.0", "@types/mocha": "7.0.2", - "@types/node": "13.13.2", + "@types/node": "14.0.1", "@types/npm-package-arg": "6.1.0", "@types/prettier": "2.0.0", - "@types/secp256k1": "3.5.0", + "@types/secp256k1": "4.0.1", "@types/seedrandom": "2.4.28", "@types/superagent": "4.1.7", "@types/uws": "0.13.2", @@ -53,21 +53,20 @@ "cross-env": "7.0.2", "fs-extra": "9.0.0", "into-stream": "5.1.1", - "lerna": "3.20.2", - "mocha": "7.1.1", + "lerna": "3.21.0", + "mocha": "7.1.2", "npm-package-arg": "8.0.1", "nyc": "15.0.1", "patch-package": "6.2.2", "prettier": "2.0.5", - "solc": "0.6.6", - "source-map-support": "0.5.18", + "solc": "0.6.7", + "source-map-support": "0.5.19", "superagent": "5.2.2", "ts-morph": "7.0.3", - "ts-node": "8.9.0", - "tslint": "6.1.1", - "typescript": "3.8.3", + "ts-node": "8.10.1", + "typescript": "3.9.2", "utf-8-validate": "5.0.2", - "ws": "7.2.3", + "ws": "7.3.0", "yargs": "15.3.1" }, "optionalDependencies": { From 2c340b409bd8bc2d106461148a7129d0c8dcfff2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 13 May 2020 13:18:06 -0400 Subject: [PATCH 222/691] Update dependencies --- .../ethereumjs-block/header.d.ts | 0 .../ethereumjs-block/index.d.ts | 0 @types/ethereumjs-util/index.d.ts | 5 +++ {typings => @types}/hdkey/index.d.ts | 2 +- {typings => @types}/levelup/index.d.ts | 0 .../merkle-patricia-tree/baseTrie.ts | 0 .../merkle-patricia-tree/index.d.ts | 0 .../merkle-patricia-tree/readStream.ts | 0 .../merkle-patricia-tree/trieNode.ts | 0 npm-shrinkwrap.json | 43 ++----------------- package.json | 4 +- src/chains/ethereum/src/blockchain.ts | 4 +- src/chains/ethereum/src/options.ts | 2 +- src/chains/ethereum/src/provider.ts | 20 ++++++--- tsconfig.json | 2 +- typings/index.d.ts | 0 16 files changed, 27 insertions(+), 55 deletions(-) rename {typings => @types}/ethereumjs-block/header.d.ts (100%) rename {typings => @types}/ethereumjs-block/index.d.ts (100%) create mode 100644 @types/ethereumjs-util/index.d.ts rename {typings => @types}/hdkey/index.d.ts (97%) rename {typings => @types}/levelup/index.d.ts (100%) rename {typings => @types}/merkle-patricia-tree/baseTrie.ts (100%) rename {typings => @types}/merkle-patricia-tree/index.d.ts (100%) rename {typings => @types}/merkle-patricia-tree/readStream.ts (100%) rename {typings => @types}/merkle-patricia-tree/trieNode.ts (100%) delete mode 100644 typings/index.d.ts diff --git a/typings/ethereumjs-block/header.d.ts b/@types/ethereumjs-block/header.d.ts similarity index 100% rename from typings/ethereumjs-block/header.d.ts rename to @types/ethereumjs-block/header.d.ts diff --git a/typings/ethereumjs-block/index.d.ts b/@types/ethereumjs-block/index.d.ts similarity index 100% rename from typings/ethereumjs-block/index.d.ts rename to @types/ethereumjs-block/index.d.ts diff --git a/@types/ethereumjs-util/index.d.ts b/@types/ethereumjs-util/index.d.ts new file mode 100644 index 0000000000..988c2050c9 --- /dev/null +++ b/@types/ethereumjs-util/index.d.ts @@ -0,0 +1,5 @@ +import "ethereumjs-util" + +declare module "ethereumjs-util" { + export declare const publicToAddress: (pubKey: Buffer, sanitize?: boolean) => Buffer; +} \ No newline at end of file diff --git a/typings/hdkey/index.d.ts b/@types/hdkey/index.d.ts similarity index 97% rename from typings/hdkey/index.d.ts rename to @types/hdkey/index.d.ts index 8c11d6840f..9989759de2 100644 --- a/typings/hdkey/index.d.ts +++ b/@types/hdkey/index.d.ts @@ -13,7 +13,7 @@ declare module "hdkey" { public readonly identifier?: Uint8Array; public readonly pubKeyHash?: Uint8Array; public readonly privateKey?: Buffer; - public publicKey?: Uint8Array; + public publicKey?: Buffer; public readonly privateExtendedKey?: string; public readonly publicExtendedKey: string; public readonly chainCode?: Buffer; diff --git a/typings/levelup/index.d.ts b/@types/levelup/index.d.ts similarity index 100% rename from typings/levelup/index.d.ts rename to @types/levelup/index.d.ts diff --git a/typings/merkle-patricia-tree/baseTrie.ts b/@types/merkle-patricia-tree/baseTrie.ts similarity index 100% rename from typings/merkle-patricia-tree/baseTrie.ts rename to @types/merkle-patricia-tree/baseTrie.ts diff --git a/typings/merkle-patricia-tree/index.d.ts b/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from typings/merkle-patricia-tree/index.d.ts rename to @types/merkle-patricia-tree/index.d.ts diff --git a/typings/merkle-patricia-tree/readStream.ts b/@types/merkle-patricia-tree/readStream.ts similarity index 100% rename from typings/merkle-patricia-tree/readStream.ts rename to @types/merkle-patricia-tree/readStream.ts diff --git a/typings/merkle-patricia-tree/trieNode.ts b/@types/merkle-patricia-tree/trieNode.ts similarity index 100% rename from typings/merkle-patricia-tree/trieNode.ts rename to @types/merkle-patricia-tree/trieNode.ts diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 50675dc530..4f3c43647d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2417,12 +2417,14 @@ "@types/lodash": { "version": "4.14.150", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.150.tgz", - "integrity": "sha512-kMNLM5JBcasgYscD9x/Gvr6lTAv2NVgsKtet/hm93qMyf/D1pt+7jeEZklKJKxMVmXjxbRVQQGfqDSfipYCO6w==" + "integrity": "sha512-kMNLM5JBcasgYscD9x/Gvr6lTAv2NVgsKtet/hm93qMyf/D1pt+7jeEZklKJKxMVmXjxbRVQQGfqDSfipYCO6w==", + "dev": true }, "@types/lodash.clonedeep": { "version": "4.5.6", "resolved": "https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz", "integrity": "sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==", + "dev": true, "requires": { "@types/lodash": "*" } @@ -3140,23 +3142,6 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, - "bufferutil": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz", - "integrity": "sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==", - "dev": true, - "requires": { - "node-gyp-build": "~3.7.0" - }, - "dependencies": { - "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", - "dev": true - } - } - }, "builtins": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", @@ -3226,15 +3211,6 @@ "unset-value": "^1.0.0" } }, - "cachedown": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cachedown/-/cachedown-1.0.0.tgz", - "integrity": "sha1-1D8DbkUQaWsxJG19sx6/D3rDLRU=", - "requires": { - "abstract-leveldown": "^2.4.1", - "lru-cache": "^3.2.0" - } - }, "caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", @@ -7984,14 +7960,6 @@ "signal-exit": "^3.0.0" } }, - "lru-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", - "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", - "requires": { - "pseudomap": "^1.0.1" - } - }, "ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", @@ -9813,11 +9781,6 @@ "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", diff --git a/package.json b/package.json index d8088e53d0..96f7e72ac8 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,8 @@ "postinstall": "patch-package && lerna bootstrap" }, "dependencies": { - "@types/lodash.clonedeep": "4.5.6", "bip39": "3.0.2", "bn.js": "5.1.1", - "cachedown": "1.0.0", "emittery": "0.6.0", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.2", @@ -38,6 +36,7 @@ "devDependencies": { "@istanbuljs/nyc-config-typescript": "1.0.1", "@types/fs-extra": "8.1.0", + "@types/lodash.clonedeep": "4.5.6", "@types/mocha": "7.0.2", "@types/node": "14.0.1", "@types/npm-package-arg": "6.1.0", @@ -48,7 +47,6 @@ "@types/uws": "0.13.2", "@types/ws": "7.2.4", "@types/yargs": "15.0.4", - "bufferutil": "4.0.1", "camelcase": "6.0.0", "cross-env": "7.0.2", "fs-extra": "9.0.0", diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 6549e08177..ee908f5f84 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -34,7 +34,7 @@ type BlockchainOptions = { hardfork?: string; allowUnlimitedContractSize?: boolean; gasLimit?: Quantity; - timestamp?: Date; + time?: Date; }; export default class Blockchain extends Emittery { @@ -79,7 +79,7 @@ export default class Blockchain extends Emittery { this.accounts = new AccountManager(this, database.trie); await this.#initializeAccounts(options.accounts); - let lastBlock = this.#initializeGenesisBlock(options.timestamp, options.gasLimit); + let lastBlock = this.#initializeGenesisBlock(options.time, options.gasLimit); const readyNextBlock = async () => { const previousBlock = await lastBlock; diff --git a/src/chains/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts index 1a121ee2a4..497000dec6 100644 --- a/src/chains/ethereum/src/options.ts +++ b/src/chains/ethereum/src/options.ts @@ -14,8 +14,8 @@ type EthereumOptions = Pick< | "db" | "db_path" | "secure" + | "time" > & { - timestamp: Date; accounts: Account[]; }; diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index b74d08830e..c2d95b2047 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -2,7 +2,7 @@ import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; import {ProviderOptions} from "@ganache/options"; import Emittery from "emittery"; import EthereumApi from "./api"; -import {publicToAddress, privateToAddress} from "ethereumjs-util"; +import {privateToAddress} from "ethereumjs-util"; import Account from "./things/account"; import {mnemonicToSeedSync} from "bip39"; import Address from "./things/address"; @@ -13,6 +13,14 @@ import secp256k1 from "secp256k1"; import HDKey from "hdkey"; import {types, utils} from "@ganache/utils"; import PromiEvent from "@ganache/utils/src/things/promievent"; +const createKeccakHash = require("keccak"); + +const uncompressedPublicKeyToAddress = (uncompressedPublicKey: Buffer) => { + const compresedPublicKey = secp256k1.publicKeyConvert(uncompressedPublicKey, false).slice(1); + const hasher = createKeccakHash("keccak256"); + hasher._state.absorb(compresedPublicKey); + return Address.from(hasher.digest().slice(-20)); +} const WEI = 1000000000000000000n; @@ -38,9 +46,9 @@ export default class EthereumProvider extends Emittery.Typed Date: Wed, 13 May 2020 13:49:38 -0400 Subject: [PATCH 223/691] Move some tests over to the ethereum package --- .../ethereum/__tests__/helpers/getProvider.ts | 19 +++++++++++++++++++ src/chains/ethereum/__tests__/index.test.ts | 5 ----- .../ethereum/__tests__/provider.test.ts} | 6 +++--- src/chains/ethereum/package.json | 5 ++++- .../core/__tests__/helpers/getProvider.ts | 4 ++-- 5 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 src/chains/ethereum/__tests__/helpers/getProvider.ts delete mode 100644 src/chains/ethereum/__tests__/index.test.ts rename src/{packages/core/__tests__/ledger.ts => chains/ethereum/__tests__/provider.test.ts} (97%) diff --git a/src/chains/ethereum/__tests__/helpers/getProvider.ts b/src/chains/ethereum/__tests__/helpers/getProvider.ts new file mode 100644 index 0000000000..190530e964 --- /dev/null +++ b/src/chains/ethereum/__tests__/helpers/getProvider.ts @@ -0,0 +1,19 @@ +import { RequestCoordinator, Executor } from "@ganache/utils/src/utils"; +import EthereumProvider from "../../src/provider"; +import {ProviderOptions} from "@ganache/options"; + +const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; +const getProvider = async (options: ProviderOptions = {mnemonic}) => { + const requestCoordinator = new RequestCoordinator(options.asyncRequestProcessing ? 0 : 1); + const executor = new Executor(requestCoordinator); + const provider = new EthereumProvider(options, executor); + await new Promise(resolve => { + provider.on("connect", () => { + requestCoordinator.resume(); + resolve(); + }) + }); + return provider; +} + +export default getProvider; diff --git a/src/chains/ethereum/__tests__/index.test.ts b/src/chains/ethereum/__tests__/index.test.ts deleted file mode 100644 index 9bb6ff417e..0000000000 --- a/src/chains/ethereum/__tests__/index.test.ts +++ /dev/null @@ -1,5 +0,0 @@ -import ethereum from "../src/"; - -describe("@ganache/ethereum", () => { - it("needs tests"); -}); diff --git a/src/packages/core/__tests__/ledger.ts b/src/chains/ethereum/__tests__/provider.test.ts similarity index 97% rename from src/packages/core/__tests__/ledger.ts rename to src/chains/ethereum/__tests__/provider.test.ts index 9121d6ba7f..2bef07a634 100644 --- a/src/packages/core/__tests__/ledger.ts +++ b/src/chains/ethereum/__tests__/provider.test.ts @@ -1,13 +1,13 @@ import assert from "assert"; -import GetProvider from "./helpers/getProvider"; -import EthereumProvider from "@ganache/ethereum/src/provider"; +import EthereumProvider from "../src/provider"; +import getProvider from "./helpers/getProvider"; describe("ledger", () => { let provider: EthereumProvider; let accounts: string[]; beforeEach(async () => { - provider = GetProvider(); + provider = await getProvider(); accounts = await provider.request("eth_accounts"); }); diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index a7ed9c8e01..32f4318b08 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -22,7 +22,10 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "tsc": "ts-node ../../../scripts/compile" + "tsc": "ts-node ../../../scripts/compile", + "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" + }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/core/__tests__/helpers/getProvider.ts b/src/packages/core/__tests__/helpers/getProvider.ts index 94c2fdcc58..55b2cedb26 100644 --- a/src/packages/core/__tests__/helpers/getProvider.ts +++ b/src/packages/core/__tests__/helpers/getProvider.ts @@ -3,8 +3,8 @@ import {ProviderOptions} from "@ganache/options"; import EthereumProvider from "@ganache/ethereum/src/provider"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; -const GetProvider = (options: ProviderOptions = {flavor: "ethereum", mnemonic}) => { +const getProvider = (options: ProviderOptions = {flavor: "ethereum", mnemonic}) => { return Ganache.provider(options) as EthereumProvider; }; -export default GetProvider; +export default getProvider; From 15a58cd11af5ca3f5b70b2470331956ff9d15022 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 13 May 2020 17:46:49 -0400 Subject: [PATCH 224/691] More more tests over to Ethereum --- .gitignore | 1 - .../@types}/ethereumjs-block/header.d.ts | 0 .../@types}/ethereumjs-block/index.d.ts | 0 .../@types}/ethereumjs-util/index.d.ts | 0 {@types => src/@types}/hdkey/index.d.ts | 0 {@types => src/@types}/levelup/index.d.ts | 0 .../@types}/merkle-patricia-tree/baseTrie.ts | 0 .../@types}/merkle-patricia-tree/index.d.ts | 0 .../merkle-patricia-tree/readStream.ts | 0 .../@types}/merkle-patricia-tree/trieNode.ts | 0 src/chains/ethereum/__tests__/api.test.ts | 209 +++++++++++++++ .../ethereum/__tests__/provider.test.ts | 240 ++++-------------- .../ethereum/__tests__/temp-tests.test.ts} | 71 +++--- src/chains/ethereum/src/index.ts | 2 +- src/chains/ethereum/src/miner.ts | 2 +- src/chains/ethereum/src/provider.ts | 3 + src/chains/ethereum/src/things/transaction.ts | 2 +- .../__tests__/{provider.ts => connector.ts} | 100 ++------ src/packages/core/__tests__/interface.ts | 6 +- src/packages/core/__tests__/server.ts | 44 ++-- .../views/components/accounts/accounts.marko | 28 -- .../components/accounts/components/info.marko | 10 - .../views/components/app-tabs/index.marko | 11 - .../views/components/app-tabs/marko-tag.json | 6 - .../src/servers/views/components/blocks.marko | 5 - .../src/servers/views/components/events.marko | 5 - .../src/servers/views/components/logs.marko | 5 - .../views/components/status-bar/index.marko | 34 --- .../views/components/transactions.marko | 5 - .../core/src/servers/views/index.marko | 169 ------------ tsconfig.json | 2 +- 31 files changed, 344 insertions(+), 616 deletions(-) rename {@types => src/@types}/ethereumjs-block/header.d.ts (100%) rename {@types => src/@types}/ethereumjs-block/index.d.ts (100%) rename {@types => src/@types}/ethereumjs-util/index.d.ts (100%) rename {@types => src/@types}/hdkey/index.d.ts (100%) rename {@types => src/@types}/levelup/index.d.ts (100%) rename {@types => src/@types}/merkle-patricia-tree/baseTrie.ts (100%) rename {@types => src/@types}/merkle-patricia-tree/index.d.ts (100%) rename {@types => src/@types}/merkle-patricia-tree/readStream.ts (100%) rename {@types => src/@types}/merkle-patricia-tree/trieNode.ts (100%) create mode 100644 src/chains/ethereum/__tests__/api.test.ts rename src/{packages/core/__tests__/temp-tests.ts => chains/ethereum/__tests__/temp-tests.test.ts} (81%) rename src/packages/core/__tests__/{provider.ts => connector.ts} (60%) delete mode 100644 src/packages/core/src/servers/views/components/accounts/accounts.marko delete mode 100644 src/packages/core/src/servers/views/components/accounts/components/info.marko delete mode 100644 src/packages/core/src/servers/views/components/app-tabs/index.marko delete mode 100644 src/packages/core/src/servers/views/components/app-tabs/marko-tag.json delete mode 100644 src/packages/core/src/servers/views/components/blocks.marko delete mode 100644 src/packages/core/src/servers/views/components/events.marko delete mode 100644 src/packages/core/src/servers/views/components/logs.marko delete mode 100644 src/packages/core/src/servers/views/components/status-bar/index.marko delete mode 100644 src/packages/core/src/servers/views/components/transactions.marko delete mode 100644 src/packages/core/src/servers/views/index.marko diff --git a/.gitignore b/.gitignore index 4fa8d4091b..72e589c302 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ build dist .nyc_output test/testdb/* -**/*.marko.js lerna-debug.log npm-debug.log src/**/*/lib diff --git a/@types/ethereumjs-block/header.d.ts b/src/@types/ethereumjs-block/header.d.ts similarity index 100% rename from @types/ethereumjs-block/header.d.ts rename to src/@types/ethereumjs-block/header.d.ts diff --git a/@types/ethereumjs-block/index.d.ts b/src/@types/ethereumjs-block/index.d.ts similarity index 100% rename from @types/ethereumjs-block/index.d.ts rename to src/@types/ethereumjs-block/index.d.ts diff --git a/@types/ethereumjs-util/index.d.ts b/src/@types/ethereumjs-util/index.d.ts similarity index 100% rename from @types/ethereumjs-util/index.d.ts rename to src/@types/ethereumjs-util/index.d.ts diff --git a/@types/hdkey/index.d.ts b/src/@types/hdkey/index.d.ts similarity index 100% rename from @types/hdkey/index.d.ts rename to src/@types/hdkey/index.d.ts diff --git a/@types/levelup/index.d.ts b/src/@types/levelup/index.d.ts similarity index 100% rename from @types/levelup/index.d.ts rename to src/@types/levelup/index.d.ts diff --git a/@types/merkle-patricia-tree/baseTrie.ts b/src/@types/merkle-patricia-tree/baseTrie.ts similarity index 100% rename from @types/merkle-patricia-tree/baseTrie.ts rename to src/@types/merkle-patricia-tree/baseTrie.ts diff --git a/@types/merkle-patricia-tree/index.d.ts b/src/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from @types/merkle-patricia-tree/index.d.ts rename to src/@types/merkle-patricia-tree/index.d.ts diff --git a/@types/merkle-patricia-tree/readStream.ts b/src/@types/merkle-patricia-tree/readStream.ts similarity index 100% rename from @types/merkle-patricia-tree/readStream.ts rename to src/@types/merkle-patricia-tree/readStream.ts diff --git a/@types/merkle-patricia-tree/trieNode.ts b/src/@types/merkle-patricia-tree/trieNode.ts similarity index 100% rename from @types/merkle-patricia-tree/trieNode.ts rename to src/@types/merkle-patricia-tree/trieNode.ts diff --git a/src/chains/ethereum/__tests__/api.test.ts b/src/chains/ethereum/__tests__/api.test.ts new file mode 100644 index 0000000000..b35754eb22 --- /dev/null +++ b/src/chains/ethereum/__tests__/api.test.ts @@ -0,0 +1,209 @@ +import assert from "assert"; +import EthereumProvider from "../src/provider"; +import getProvider from "./helpers/getProvider"; + +describe("api", () => { + let provider: EthereumProvider; + let accounts: string[]; + + beforeEach(async () => { + provider = await getProvider(); + accounts = await provider.request("eth_accounts"); + }); + + it("gets balance", async () => { + const accounts = await provider.request("eth_accounts"); + const balance = await provider.request("eth_getBalance", [accounts[0]]); + // TODO: this value is actually wrong! + assert.strictEqual(balance, "0x56bc75e2d63100000", "Heyo!"); + }); + + it("eth_blockNumber", async () => { + const blockNumber = await provider.request("eth_blockNumber"); + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + const _txHash = await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + + const _message = await provider.once("message"); + const nextBlockNumber = await provider.request("eth_blockNumber"); + assert.strictEqual(parseInt(blockNumber, 10), nextBlockNumber - 1); + }); + + it("eth_getBlockByNumber", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const blocks = await Promise.all([ + provider.request("eth_getBlockByNumber", ["0x1", true]), + provider.request("eth_getBlockByNumber", ["0x1"]) + ]); + assert(blocks[0].hash, blocks[1].hash); + }); + + it("eth_getBlockByHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + + const blocks = await Promise.all([ + provider.request("eth_getBlockByHash", [block.hash, true]), + provider.request("eth_getBlockByHash", [block.hash]) + ]); + assert(blocks[0].hash, blocks[1].hash); + const counts = await Promise.all([ + provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]), + provider.request("eth_getBlockTransactionCountByHash", [blocks[0].hash]) + ]); + + assert(true); + }); + + it("eth_getBlockTransactionCountByHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + + const count = await provider.request("eth_getBlockTransactionCountByHash", [block.hash]); + assert(count, "1"); + }); + + it("eth_getBlockTransactionCountByNumber", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const count = await provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]); + assert(count, "1"); + }); + + it("eth_getTransactionByBlockNumberAndIndex", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const tx = await provider.request("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); + assert.equal( + tx.hash, + "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", + "Unexpected transaction hash." + ); + }); + + it("eth_getTransactionByBlockHashAndIndex", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + + const tx = await provider.request("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); + assert.equal( + tx.hash, + "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", + "Unexpected transaction hash." + ); + }); + + it("eth_getUncleCountByBlockHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + + const count = await provider.request("eth_getUncleCountByBlockHash", [block.hash]); + assert(count, "0"); + }); + + it("eth_getUncleCountByBlockNumber", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const count = await provider.request("eth_getUncleCountByBlockNumber", ["0x1"]); + assert(count, "0"); + }); + + it("eth_getTransactionReceipt", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + const hash = await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const receipt = await provider.request("eth_getTransactionReceipt", [hash]); + assert(receipt.transactionIndex, "0x0"); + }); + + it("eth_getTransactionByHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + const hash = await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const tx = await provider.request("eth_getTransactionByHash", [hash]); + assert(tx.transactionIndex, "0x0"); + }); +}); diff --git a/src/chains/ethereum/__tests__/provider.test.ts b/src/chains/ethereum/__tests__/provider.test.ts index 2bef07a634..68d99516dc 100644 --- a/src/chains/ethereum/__tests__/provider.test.ts +++ b/src/chains/ethereum/__tests__/provider.test.ts @@ -1,202 +1,48 @@ import assert from "assert"; import EthereumProvider from "../src/provider"; import getProvider from "./helpers/getProvider"; - -describe("ledger", () => { - let provider: EthereumProvider; - let accounts: string[]; - - beforeEach(async () => { - provider = await getProvider(); - accounts = await provider.request("eth_accounts"); - }); - - it("eth_blockNumber", async () => { - const blockNumber = await provider.request("eth_blockNumber"); - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - const _txHash = await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - - const _message = await provider.once("message"); - const nextBlockNumber = await provider.request("eth_blockNumber"); - assert.strictEqual(parseInt(blockNumber, 10), nextBlockNumber - 1); - }); - - it("eth_getBlockByNumber", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const blocks = await Promise.all([ - provider.request("eth_getBlockByNumber", ["0x1", true]), - provider.request("eth_getBlockByNumber", ["0x1"]) - ]); - assert(blocks[0].hash, blocks[1].hash); - }); - - it("eth_getBlockByHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - - const blocks = await Promise.all([ - provider.request("eth_getBlockByHash", [block.hash, true]), - provider.request("eth_getBlockByHash", [block.hash]) - ]); - assert(blocks[0].hash, blocks[1].hash); - const counts = await Promise.all([ - provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]), - provider.request("eth_getBlockTransactionCountByHash", [blocks[0].hash]) - ]); - - assert(true); - }); - - it("eth_getBlockTransactionCountByHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - - const count = await provider.request("eth_getBlockTransactionCountByHash", [block.hash]); - assert(count, "1"); - }); - - it("eth_getBlockTransactionCountByNumber", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const count = await provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]); - assert(count, "1"); - }); - - it("eth_getTransactionByBlockNumberAndIndex", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const tx = await provider.request("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); - assert.equal( - tx.hash, - "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", - "Unexpected transaction hash." - ); - }); - - it("eth_getTransactionByBlockHashAndIndex", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - - const tx = await provider.request("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); - assert.equal( - tx.hash, - "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", - "Unexpected transaction hash." - ); - }); - - it("eth_getUncleCountByBlockHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - - const count = await provider.request("eth_getUncleCountByBlockHash", [block.hash]); - assert(count, "0"); - }); - - it("eth_getUncleCountByBlockNumber", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const count = await provider.request("eth_getUncleCountByBlockNumber", ["0x1"]); - assert(count, "0"); - }); - - it("eth_getTransactionReceipt", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - const hash = await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const receipt = await provider.request("eth_getTransactionReceipt", [hash]); - assert(receipt.transactionIndex, "0x0"); - }); - - it("eth_getTransactionByHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - const hash = await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const tx = await provider.request("eth_getTransactionByHash", [hash]); - assert(tx.transactionIndex, "0x0"); +import JsonRpc from "@ganache/utils/src/things/jsonrpc"; +import EthereumApi from "../src/api"; + +describe("provider", () => { + describe("options", () => { + it("generates predictable accounts when given a seed", async () => { + const provider = await getProvider({seed: "temet nosce"}); + const accounts = await provider.request("eth_accounts"); + assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); + }); + }); + + describe("interface", () => { + const network_id = "1234"; + let provider: EthereumProvider; + + beforeEach(async () => { + provider = await getProvider({network_id}); + }); + + it("returns things via EIP-1193", async () => { + assert.strictEqual(await provider.request("net_version"), network_id); + }); + + it("returns things via legacy", async () => { + const jsonRpcRequest: JsonRpc.Request = { + id: "1", + jsonrpc: "2.0", + method: "net_version" + }; + const methods = ["send", "sendAsync"] as const; + return Promise.all(methods.map(method => { + return new Promise((resolve, reject) => { + provider[method](jsonRpcRequest, (err: Error, {result}): void => { + if(err) return reject(err); + assert.strictEqual(result, network_id); + resolve(); + }); + }); + }).map(async prom => { + assert.strictEqual(await prom, void 0); + })); + }); }); }); diff --git a/src/packages/core/__tests__/temp-tests.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts similarity index 81% rename from src/packages/core/__tests__/temp-tests.ts rename to src/chains/ethereum/__tests__/temp-tests.test.ts index e6bd96da61..a57c65a16a 100644 --- a/src/packages/core/__tests__/temp-tests.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -1,8 +1,8 @@ -import Ganache from "../src"; import assert from "assert"; import {Quantity} from "@ganache/utils/src/things/json-rpc"; -import EthereumProvider from "@ganache/ethereum/src/provider"; import {ProviderOptions} from "@ganache/options"; +import getProvider from "./helpers/getProvider"; + const solc = require("solc"); function compileSolidity(source: string) { @@ -36,13 +36,13 @@ function compileSolidity(source: string) { * ganache-core but have yet been properly ported over yet. */ -describe("Accounts", () => { +describe("Random tests that are temporary!", () => { const expectedAddress = "0x604a95C9165Bc95aE016a5299dd7d400dDDBEa9A"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; it("should respect the BIP99 mnemonic", async () => { const options = {mnemonic}; - const p = Ganache.provider(options) as EthereumProvider; + const p = await getProvider(options); const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts[0], expectedAddress); @@ -50,7 +50,7 @@ describe("Accounts", () => { it("eth_sendTransaction", async () => { const options = {mnemonic}; - const p = Ganache.provider(options) as EthereumProvider; + const p = await getProvider(options); const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); await p.send("eth_subscribe", ["newHeads"]); @@ -68,66 +68,55 @@ describe("Accounts", () => { }); it("should create its own mnemonic", async () => { - const p = Ganache.provider() as EthereumProvider; + const p = await getProvider(); const options = p.getOptions(); assert.deepStrictEqual(typeof options.mnemonic, "string"); }); it("shouldn't allow initialization without accounts", async () => { const options: ProviderOptions = {total_accounts: 0}; - assert.throws( - () => { - Ganache.provider(options); - }, - { - message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" - } - ); + await assert.rejects(getProvider(options), { + message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" + }); options.accounts = []; - assert.throws( - () => { - Ganache.provider(options); - }, - { - message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" - } - ); + await assert.rejects(getProvider(options), { + message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" + }); }); it("sets up accounts", async () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); - const p = Ganache.provider({ + const p = await getProvider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }) as EthereumProvider; + }); const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts.length, 2); }); it("sets errors when unlocked_accounts index is too high", async () => { - const ganacheInitFn = Ganache.provider.bind(Ganache, { - unlocked_accounts: [99] - }); - assert.throws(ganacheInitFn, { + await assert.rejects(getProvider({unlocked_accounts: [99]}), { message: "Account at index 99 not found. Max index available is 9." }); }); it("sets errors when unlocked_accounts index is a (big) bigint", async () => { const bigNumber = BigInt(Number.MAX_SAFE_INTEGER) + 1n; - const ganacheInitFn = Ganache.provider.bind(Ganache, { - unlocked_accounts: [bigNumber.toString()] - }); - assert.throws(ganacheInitFn, { - message: `Invalid value in unlocked_accounts: ${bigNumber}` - }); + await assert.rejects( + getProvider({ + unlocked_accounts: [bigNumber.toString()] + }), + { + message: `Invalid value in unlocked_accounts: ${bigNumber}` + } + ); }); it("unlocks accounts via unlock_accounts (both string and numbered numbers)", async () => { - const p = Ganache.provider({ + const p = await getProvider({ locked: true, unlocked_accounts: ["0", 1] - }) as EthereumProvider; + }); const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); @@ -176,11 +165,11 @@ describe("Accounts", () => { const contract = await compileSolidity( "pragma solidity ^0.6.1; contract Example { uint public value; event Event(); constructor() public { value = 5; emit Event(); } function getVal() public pure returns (uint8) { return 123; } }" ); - const p = Ganache.provider({ + const p = await getProvider({ defaultTransactionGasLimit: Quantity.from(6721975) - }) as EthereumProvider; + }); const accounts = await p.send("eth_accounts"); - const _subscriptionId = await p.send("eth_subscribe", ["newHeads"]); + await p.send("eth_subscribe", ["newHeads"]); const transactionHash = await p.send("eth_sendTransaction", [ { from: accounts[0], @@ -217,9 +206,9 @@ describe("Accounts", () => { it("runs eth_call", async () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); - const p = Ganache.provider({ + const p = await getProvider({ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }) as EthereumProvider; + }); const accounts = await p.send("eth_accounts"); const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); assert(true); diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index a25105b102..c55e73e55c 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -25,7 +25,7 @@ export default class EthereumConnector extends Emittery.Typed { - // tell the consumer (like a `ganache-core` server) everything is ready + // tell the consumer (like a `ganache-core` server/connector) everything is ready this.emit("ready"); }); } diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index da6ff58e9a..cc7d5ac3ff 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -218,7 +218,7 @@ export default class Miner extends Emittery { if (this.#pending) { // TODO: hm... tricky... we know we need to mine a new block - // but at what timestamp. We need to get the timestamp from `blockchain`, but so far, + // but at what timestamp? We need to get the timestamp from `blockchain`, but so far, // we don't require the miner to know about the blockchain. // also, what if the previous block was mined with a timestamp, do we need to mine two blocks with that // same timestamp? uh, I think not. diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index c2d95b2047..c9d9ca82ce 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -109,6 +109,9 @@ export default class EthereumProvider extends Emittery.Typed configZeroableField(tx, fieldName, 32)); // Ethereumjs-tx doesn't set the _chainId value whenever the v value is set, diff --git a/src/packages/core/__tests__/provider.ts b/src/packages/core/__tests__/connector.ts similarity index 60% rename from src/packages/core/__tests__/provider.ts rename to src/packages/core/__tests__/connector.ts index 48e05d6816..c26c38fa85 100644 --- a/src/packages/core/__tests__/provider.ts +++ b/src/packages/core/__tests__/connector.ts @@ -1,27 +1,14 @@ -import Ganache from "../src"; import assert from "assert"; +import Ganache from "../"; import EthereumProvider from "@ganache/ethereum/src/provider"; -describe("provider", () => { - const networkId = "1234"; - let p: EthereumProvider; - - beforeEach(() => { - p = Ganache.provider({ - network_id: networkId - }) as EthereumProvider; - }); - +describe("connector", () => { it("works without passing options", async () => { assert.doesNotThrow(() => Ganache.provider()); }); it("it logs when `options.verbose` is `true`", async () => { - const logger = { - log: (msg: string) => { - assert.strictEqual(msg, " > net_version: undefined"); - } - }; + const logger = {log: (_msg: string) => {}}; const p = Ganache.provider({logger, verbose: true}) as EthereumProvider; logger.log = msg => { @@ -42,8 +29,9 @@ describe("provider", () => { it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { const p = Ganache.provider() as EthereumProvider; const accounts = await p.send("eth_accounts"); - // eth_accounts should always be faster than eth_getBalance; it should - // return before eth_getBalance because of the `asyncRequestProcessing` flag + // eth_accounts should always be faster than eth_getBalance; eth_accounts + // shouldreturn before eth_getBalance because of the + // `asyncRequestProcessing` flag. const calA = p.send("eth_getBalance", [accounts[0]]); const callB = p.send("eth_accounts"); const result = await Promise.race([calA, callB]); @@ -51,72 +39,26 @@ describe("provider", () => { assert.strictEqual(result.length, 10); }); - it("it processes requests in order when `asyncRequestProcessing` is false", async () => { + it("it processes requests syncronously when `asyncRequestProcessing` is `false`", async () => { const p = Ganache.provider({asyncRequestProcessing: false}) as EthereumProvider; const accounts = await p.send("eth_accounts"); - // eth_accounts should always be faster than eth_getBalance, but shouldn't - // return before eth_getBalance because of the `asyncRequestProcessing` flag - const callA = p.send("eth_getBalance", [accounts[0]]); + // eth_getBalance should return first even though eth_accounts is faster; + // eth_getBalance should return before eth_accounts because of the + // `asyncRequestProcessing` flag. + const calA = p.send("eth_getBalance", [accounts[0]]); const callB = p.send("eth_accounts"); - const result = await Promise.race([callA, callB]); - assert.strictEqual(typeof result, "string"); - // TODO: this value is wrong: + const result = await Promise.race([calA, callB]); assert.strictEqual(result, "0x56bc75e2d63100000"); }); - it("generates predictable accounts when given a seed", async () => { - const p = Ganache.provider({seed: "temet nosce"}) as EthereumProvider; - const accounts = await p.request("eth_accounts"); - assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); - }); - - it("gets balance", async () => { - const accounts = await p.request("eth_accounts"); - const balance = await p.request("eth_getBalance", [accounts[0]]); - // TODO: this value is actually wrong! - assert.strictEqual(balance, "0x56bc75e2d63100000", "Heyo!"); - }); - - it("returns things via EIP-1193", async () => { - const version = await p.request("net_version"); - assert.strictEqual(version, networkId); - }); - - it("returns things via legacy", async () => { - await new Promise(resolve => { - const ret = p.send( - { - id: "1", - jsonrpc: "2.0", - method: "net_version" - }, - (_err: Error, result): void => { - assert.strictEqual(result.result, networkId); - resolve(); - } - ); - assert.strictEqual(ret, void 0); - }); - return new Promise(resolve => { - const ret = p.sendAsync( - { - id: "1", - jsonrpc: "2.0", - method: "net_version" - }, - (_err: Error, result): void => { - assert.strictEqual(result.result, networkId); - resolve(); - } - ); - assert.strictEqual(ret, undefined); - }); - }); - // duck punch a property that shouldn't appear on the ledger. we test this // to make sure that 3rd party ledger implementations can't shoot themselves // in the foot on accident it.skip("TODO: allow 'injecting' our own engine or ledger into a provider!", async () => { + const p = Ganache.provider() as EthereumProvider; + // this won't work becase ganache uses _real_ private properties that can't + // be duck punched. This test is supposed to ensure that _real_ non-function + // own properties (and __proto__ properties) can't be executed. (p as any)._engine._ledger.__proto__.illegalProperty = true; await assert.rejects(p.request("illegalProperty" as any), { message: "Invalid or unsupported method: illegalProperty" @@ -124,6 +66,8 @@ describe("provider", () => { }); it("rejects invalid rpc methods", async () => { + const p = Ganache.provider() as EthereumProvider; + const illegalMethodNames = [ "toString", "toValue", @@ -133,7 +77,7 @@ describe("provider", () => { "", " ", "constructor" - ]; + ] as const; illegalMethodNames.forEach(name => { assert.throws(() => p.request(name as any), { message: `Invalid or unsupported method: ${name}` @@ -141,7 +85,7 @@ describe("provider", () => { }); // make sure we reject non-strings over the classical send interface - const circular:any = {}; + const circular: any = {}; circular.circular = circular; const illegalMethodTypes = [ 123, @@ -157,7 +101,7 @@ describe("provider", () => { Infinity, NaN, circular - ]; + ] as const; await Promise.all( illegalMethodTypes.map(method => { return assert.rejects( @@ -184,7 +128,7 @@ describe("provider", () => { }) ); - // make sure we reject non-strings over the EIP-1193 send interface + // make sure we reject non-strings over the legacy send interface illegalMethodTypes.map(methodType => { assert.throws(() => p.send(methodType), { message: diff --git a/src/packages/core/__tests__/interface.ts b/src/packages/core/__tests__/interface.ts index af0211adf2..7ce9616857 100644 --- a/src/packages/core/__tests__/interface.ts +++ b/src/packages/core/__tests__/interface.ts @@ -5,7 +5,11 @@ describe("interface", () => { it("has an interface", () => { assert.ok(Ganache.server); assert.ok(Ganache.provider); - // in v3 these two properties were *removed* + assert.strictEqual(Object.keys(Ganache).length, 2); + + // in v3 these two properties were *removed* because it was confusing. + // these tests are kinda unncessary, but I just want to intent to be + // explicit. assert.strictEqual("Server" in Ganache, false); assert.strictEqual("Provider" in Ganache, false); }); diff --git a/src/packages/core/__tests__/server.ts b/src/packages/core/__tests__/server.ts index 881498d393..5e0eb90b89 100644 --- a/src/packages/core/__tests__/server.ts +++ b/src/packages/core/__tests__/server.ts @@ -25,6 +25,7 @@ describe("server", () => { log: (_message: string) => {} }; let s: Server; + async function setup( options = { network_id, @@ -34,11 +35,14 @@ describe("server", () => { s = Ganache.server(options); return s.listen(port); } + async function teardown() { + // if the server is open or opening, try to close it. if (s && s.status & Status.open) { await s.close(); } } + describe("http", () => { async function simpleTest() { const response = await request.post("http://localhost:" + port).send(jsonRpcJson); @@ -235,7 +239,7 @@ describe("server", () => { await pendingSetup; await teardown(); } - }) + }); it("does not start a websocket server when `ws` is false", async () => { await setup({ @@ -308,7 +312,7 @@ describe("server", () => { } }); - it("returns a teapot", async () => { + it("returns a teapot (easter egg)", async () => { await setup(); try { const result = await request.get("http://localhost:" + port + "/418").catch(e => e); @@ -321,7 +325,16 @@ describe("server", () => { it("returns 404 for bad routes", async () => { await setup(); - const methods: ["get", "post", "head", "options", "put", "delete", "patch", "trace"] = ["get", "post", "head", "options", "put", "delete", "patch", "trace"]; + const methods = [ + "get", + "post", + "head", + "options", + "put", + "delete", + "patch", + "trace" + ] as const; try { const requests = methods.map(async method => { const result = await request[method]("http://localhost:" + port + "/there-is-no-spoon").catch((e: any) => e); @@ -388,9 +401,9 @@ describe("server", () => { }); describe("CORS", () => { - const optionsHeaders = ["Access-Control-Allow-Methods", "Access-Control-Allow-Headers", "Access-Control-Max-Age"]; - const baseHeaders = ["Access-Control-Allow-Credentials", "Access-Control-Allow-Origin"]; - const allCorsHeaders = optionsHeaders.concat(baseHeaders); + const optionsHeaders = ["Access-Control-Allow-Methods", "Access-Control-Allow-Headers", "Access-Control-Max-Age"] as const; + const baseHeaders = ["Access-Control-Allow-Credentials", "Access-Control-Allow-Origin"] as const; + const allCorsHeaders = [...optionsHeaders, ...baseHeaders] as const; it("does not return CORS headers for non-CORS requests", async () => { await setup(); @@ -445,7 +458,6 @@ describe("server", () => { assert.strictEqual(resp.header["access-control-max-age"], "600"); assert.strictEqual(resp.header["content-length"], "0"); assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); - assert.strictEqual(resp.header["access-control-allow-origin"], origin); } finally { await teardown(); } @@ -553,10 +565,10 @@ describe("server", () => { const provider = s.provider as EthereumProvider; const message = "I hope you get this message"; provider.request = () => { - const promiEvent = new PromiEvent((resolve => { + const promiEvent = new PromiEvent(resolve => { resolve("0xsubscriptionId"); - setImmediate(()=>promiEvent.emit("message", message)); - })); + setImmediate(() => promiEvent.emit("message", message)); + }); return promiEvent; }; @@ -566,7 +578,7 @@ describe("server", () => { // If we get a message that means things didn't get closed as they // should have OR they are closing too late for some reason and // this test isn't testing anything. - ws.on("message", (data) => { + ws.on("message", data => { const {result} = JSON.parse(data.toString()); // ignore the initial response if (result === "0xsubscriptionId") return; @@ -583,7 +595,7 @@ describe("server", () => { ws.send(JSON.stringify(subscribeJson)); }); }); - + assert.strictEqual(result, message); }); @@ -591,9 +603,9 @@ describe("server", () => { const provider = s.provider as EthereumProvider; let promiEvent: PromiEvent; provider.request = () => { - promiEvent = new PromiEvent((resolve => { + promiEvent = new PromiEvent(resolve => { resolve("0xsubscriptionId"); - })); + }); return promiEvent; }; @@ -603,7 +615,7 @@ describe("server", () => { // If we get a message that means things didn't get closed as they // should have OR they are closing too late for some reason and // this test isn't testing anything. - ws.on("message", (data) => { + ws.on("message", data => { if (JSON.parse(data.toString()).result === "0xsubscriptionId") { // close our websocket after intercepting the request s.close(); @@ -678,6 +690,6 @@ describe("server", () => { // don't break. logger.log = oldLog; } - }).timeout(5000); + }).timeout(10000); }); }); diff --git a/src/packages/core/src/servers/views/components/accounts/accounts.marko b/src/packages/core/src/servers/views/components/accounts/accounts.marko deleted file mode 100644 index c4c2aab6c5..0000000000 --- a/src/packages/core/src/servers/views/components/accounts/accounts.marko +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - -
- - ${item.address} -
- - ${parseInt(item.balance)} ETH -
- - 0 -
- - ${i} -
- -
\ No newline at end of file diff --git a/src/packages/core/src/servers/views/components/accounts/components/info.marko b/src/packages/core/src/servers/views/components/accounts/components/info.marko deleted file mode 100644 index 929a807d47..0000000000 --- a/src/packages/core/src/servers/views/components/accounts/components/info.marko +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/src/packages/core/src/servers/views/components/app-tabs/index.marko b/src/packages/core/src/servers/views/components/app-tabs/index.marko deleted file mode 100644 index 360f3ca878..0000000000 --- a/src/packages/core/src/servers/views/components/app-tabs/index.marko +++ /dev/null @@ -1,11 +0,0 @@ - \ No newline at end of file diff --git a/src/packages/core/src/servers/views/components/app-tabs/marko-tag.json b/src/packages/core/src/servers/views/components/app-tabs/marko-tag.json deleted file mode 100644 index 974cf52e6c..0000000000 --- a/src/packages/core/src/servers/views/components/app-tabs/marko-tag.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "@tabs []": { - "@label": "string", - "@active": "bool" - } -} diff --git a/src/packages/core/src/servers/views/components/blocks.marko b/src/packages/core/src/servers/views/components/blocks.marko deleted file mode 100644 index 19ba6e62c6..0000000000 --- a/src/packages/core/src/servers/views/components/blocks.marko +++ /dev/null @@ -1,5 +0,0 @@ -
    - -
  • ${item.toString()}
  • - -
\ No newline at end of file diff --git a/src/packages/core/src/servers/views/components/events.marko b/src/packages/core/src/servers/views/components/events.marko deleted file mode 100644 index 9f95aff8ae..0000000000 --- a/src/packages/core/src/servers/views/components/events.marko +++ /dev/null @@ -1,5 +0,0 @@ -
    - -
  • ${item.toString()}
  • - -
\ No newline at end of file diff --git a/src/packages/core/src/servers/views/components/logs.marko b/src/packages/core/src/servers/views/components/logs.marko deleted file mode 100644 index 1d27b921b3..0000000000 --- a/src/packages/core/src/servers/views/components/logs.marko +++ /dev/null @@ -1,5 +0,0 @@ -
    - -
  • ${item.toString()}
  • - -
\ No newline at end of file diff --git a/src/packages/core/src/servers/views/components/status-bar/index.marko b/src/packages/core/src/servers/views/components/status-bar/index.marko deleted file mode 100644 index e65d624d69..0000000000 --- a/src/packages/core/src/servers/views/components/status-bar/index.marko +++ /dev/null @@ -1,34 +0,0 @@ -
    -
  • -

    Current Block

    - 0 -
  • -
  • -

    Gas Price

    - 200000000 -
  • -
  • -

    GAS LIMIT

    - 6721975 -
  • -
  • -

    HARDFORK

    - PETERSBURG -
  • -
  • -

    NETWORK ID

    - 5777 -
  • -
  • -

    RPC SERVER

    - HTTP://127.0.0.1:7545 -
  • -
  • -

    MINING STATUS

    - AUTOMINING -
  • -
  • -

    WORKSPACE

    - CAPABLE-OATMEAL -
  • -
\ No newline at end of file diff --git a/src/packages/core/src/servers/views/components/transactions.marko b/src/packages/core/src/servers/views/components/transactions.marko deleted file mode 100644 index 1c147e91c5..0000000000 --- a/src/packages/core/src/servers/views/components/transactions.marko +++ /dev/null @@ -1,5 +0,0 @@ -
    - -
  • ${item.toString()}
  • - -
\ No newline at end of file diff --git a/src/packages/core/src/servers/views/index.marko b/src/packages/core/src/servers/views/index.marko deleted file mode 100644 index d8c364fd38..0000000000 --- a/src/packages/core/src/servers/views/index.marko +++ /dev/null @@ -1,169 +0,0 @@ -$ const mediumBrown = "#403d3a"; -$ const appBarNavText = "rgba(151, 151, 151, 1)"; -$ const darkBrown = "rgb(51, 48, 46)"; -$ const primaryColor = "rgb(235, 182, 126)"; -$ const appCardLabel = "rgb(96, 92, 89)"; -$ const appCardDefaultBackground = "rgba(251, 249, 246, 1.000)" -$ const textColor = "rgba(54, 65, 83, 1.000)"; - - - - - Ganache - Accounts - - - - - - - - - - <@tab label="Accounts" active=true>Accounts - <@tab label="Blocks">Blocks - <@tab label="Transactions">Transactions - <@tab label="Events">Events - <@tab label="Logs">Logs - - - - - \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 1e60527d02..f0bbfd7332 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,6 @@ "noImplicitAny": false, "newLine": "lf", "lib": ["ES2020"], - "typeRoots": ["./node_modules/@types", "@types"] + "typeRoots": ["./node_modules/@types", "src/@types"] } } From 6196d72b546c610b06f9d13950eda54b5899421d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 13 May 2020 21:35:04 -0400 Subject: [PATCH 225/691] Test contract writes --- .../__tests__/contracts/helloWorld.sol | 8 +- .../ethereum/__tests__/temp-tests.test.ts | 92 ++++++++++++++----- src/chains/ethereum/src/api.ts | 2 +- .../src/components/transaction-pool.ts | 4 +- 4 files changed, 77 insertions(+), 29 deletions(-) rename src/{packages/core => chains/ethereum}/__tests__/contracts/helloWorld.sol (60%) diff --git a/src/packages/core/__tests__/contracts/helloWorld.sol b/src/chains/ethereum/__tests__/contracts/helloWorld.sol similarity index 60% rename from src/packages/core/__tests__/contracts/helloWorld.sol rename to src/chains/ethereum/__tests__/contracts/helloWorld.sol index beaf3e649e..c6fd50bc2f 100644 --- a/src/packages/core/__tests__/contracts/helloWorld.sol +++ b/src/chains/ethereum/__tests__/contracts/helloWorld.sol @@ -1,6 +1,6 @@ -pragma solidity ^0.5.0; +pragma solidity ^0.6.1; -contract Example { +contract HelloWorld { uint public value; event ValueSet(uint); @@ -13,4 +13,8 @@ contract Example { value = val; emit ValueSet(val); } + + function getConstVal() public pure returns (uint8) { + return 123; + } } diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index a57c65a16a..26b724e08e 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -2,16 +2,18 @@ import assert from "assert"; import {Quantity} from "@ganache/utils/src/things/json-rpc"; import {ProviderOptions} from "@ganache/options"; import getProvider from "./helpers/getProvider"; +import { readFileSync } from "fs-extra"; +import { join } from "path"; const solc = require("solc"); -function compileSolidity(source: string) { +function compileSolidity(source: string, name: string) { let result = JSON.parse( solc.compile( JSON.stringify({ language: "Solidity", sources: { - "Contract.sol": { + [name]: { content: source } }, @@ -26,8 +28,10 @@ function compileSolidity(source: string) { ) ); + const contract = result.contracts[name][name.replace(/\.sol$/i, "")] return Promise.resolve({ - code: "0x" + result.contracts["Contract.sol"].Example.evm.bytecode.object + code: "0x" + contract.evm.bytecode.object, + contract }); } @@ -162,46 +166,86 @@ describe("Random tests that are temporary!", () => { }); it("deploys contracts", async () => { - const contract = await compileSolidity( - "pragma solidity ^0.6.1; contract Example { uint public value; event Event(); constructor() public { value = 5; emit Event(); } function getVal() public pure returns (uint8) { return 123; } }" - ); + const fileData = readFileSync(join(__dirname, "./contracts/helloWorld.sol"), {encoding: "utf8"}); + const contract = await compileSolidity(fileData, "HelloWorld.sol"); const p = await getProvider({ defaultTransactionGasLimit: Quantity.from(6721975) }); - const accounts = await p.send("eth_accounts"); - await p.send("eth_subscribe", ["newHeads"]); - const transactionHash = await p.send("eth_sendTransaction", [ + const accounts = await p.request("eth_accounts"); + const from = accounts[3]; + await p.request("eth_subscribe", ["newHeads"]); + const transactionHash = await p.request("eth_sendTransaction", [ { - from: accounts[0], + from, data: contract.code } ]); await p.once("message"); - const result = await p.send("eth_getTransactionReceipt", [transactionHash]); - + const result = await p.request("eth_getTransactionReceipt", [transactionHash]); assert.strictEqual(result.blockNumber, "0x1"); - const hash = await p.send("eth_sendTransaction", [ - { - from: accounts[1], - to: accounts[2], - value: 1 - } + const to = result.contractAddress; + const methods = contract.contract.evm.methodIdentifiers; + + const value = await p.request("eth_call", [ + {from, to, data: "0x" + methods["value()"]} ]); - await p.once("message"); - await p.send("eth_getTransactionReceipt", [hash]); + const x5 = "0x0000000000000000000000000000000000000000000000000000000000000005"; + assert.strictEqual(value, x5); - const ret = await p.send("eth_call", [ - {from: accounts[3], to: result.contractAddress, gasLimit: 6721975, data: "0xe1cb0e52"} + const constVal = await p.request("eth_call", [ + {from, to, data: "0x" + methods["getConstVal()"]} ]); - assert.strictEqual(ret, "0x000000000000000000000000000000000000000000000000000000000000007b"); + const x123 = "0x000000000000000000000000000000000000000000000000000000000000007b"; + assert.strictEqual(constVal, x123); - const storage = await p.send("eth_getStorageAt", [result.contractAddress, 0, "0x2"]); + const storage = await p.send("eth_getStorageAt", [result.contractAddress, 0, result.blockNumber]); assert.strictEqual(storage, "0x05"); + + const raw25 = "0000000000000000000000000000000000000000000000000000000000000019"; + const x25 = "0x" + raw25; + const hash = await p.request("eth_sendTransaction", [ + {from, to, data: "0x" + methods["setValue(uint256)"] + raw25} + ]); + await p.once("message"); + const receipt = await p.send("eth_getTransactionReceipt", [hash]); + assert.strictEqual(receipt.blockNumber, "0x2"); + + const getValueAgain = await p.request("eth_call", [ + {from, to, data: "0x" + methods["value()"]} + ]); + + assert.strictEqual(getValueAgain, x25); + + const storage2 = await p.send("eth_getStorageAt", [result.contractAddress, 0, receipt.blockNumber]); + assert.strictEqual(storage2, "0x19"); + }); + + it("transfers value", async () => { + const p = await getProvider({gasPrice: Quantity.from(0)}); + const accounts = await p.send("eth_accounts"); + const ONE_ETHER = 1000000000000000000n; + const startingBalance = 100n * ONE_ETHER; + await p.send("eth_subscribe", ["newHeads"]); + await p.send("eth_sendTransaction", [ + { + from: accounts[1], + to: accounts[2], + value: ONE_ETHER + } + ]); + await p.once("message"); + + const balances = (await Promise.all([ + p.send("eth_getBalance", [accounts[1]]), + p.send("eth_getBalance", [accounts[2]]) + ])).map(BigInt); + assert.strictEqual(balances[0], startingBalance - ONE_ETHER); + assert.strictEqual(balances[1], startingBalance + ONE_ETHER); }); it("runs eth_call", async () => { diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 0a13cb71c4..35704c834e 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -542,7 +542,7 @@ export default class EthereumApi implements types.Api { } - async eth_call(transaction: any, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + async eth_call(transaction: any, blockNumber: Buffer | Tag | string = Tag.LATEST): Promise { const blocks = this[_blockchain].blocks; const parentBlock = await blocks.get(blockNumber); const parentHeader = parentBlock.value.header; diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index 741dc82b5c..06867acef5 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -192,7 +192,7 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction // Should supply enough intrinsic gas const gas = transaction.calculateIntrinsicGas(); - if (Quantity.from(transaction.gasPrice).toBigInt() < gas) { + if (Quantity.from(transaction.gasLimit).toBigInt() < gas) { return new Error("intrisic gas too low"); } @@ -211,7 +211,7 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction transactorNonce = -1n; } const transactionNonce = Quantity.from(transaction.nonce).toBigInt() || 0n; - if (transactorNonce >= transactionNonce) { + if (transactorNonce > transactionNonce) { return new Error("Transaction nonce is too low"); } return null; From 47babba11aa4a0ef360011538ec785b9b3e78c8c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 4 Jun 2020 16:23:30 -0400 Subject: [PATCH 226/691] Don't publish the scripts directory to npm --- .npmignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmignore b/.npmignore index d6fb74ccab..706a8bde7b 100644 --- a/.npmignore +++ b/.npmignore @@ -11,3 +11,4 @@ ISSUE_TEMPLATE.md build/ webpack/ perf/ +scripts/ From 870e741aa970e93083dc30e9a0febcf5fb1cb631 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 4 Jun 2020 16:24:00 -0400 Subject: [PATCH 227/691] fIx typo in comment --- src/packages/utils/src/utils/heap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/utils/src/utils/heap.ts b/src/packages/utils/src/utils/heap.ts index 1118add291..f6c35e0cef 100644 --- a/src/packages/utils/src/utils/heap.ts +++ b/src/packages/utils/src/utils/heap.ts @@ -40,7 +40,7 @@ export class Heap { } /** - * Return the current best element. Do not remove it + * Return the current best element. Does not remove it */ public peek(): T { return this.array[0]; From 675d0d6e710522e98536a7a180cb79a214318be8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 4 Jun 2020 16:24:14 -0400 Subject: [PATCH 228/691] Document blockTime parameter --- src/packages/options/src/options.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index 706ef169f9..21f82c47b6 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -26,6 +26,14 @@ export interface Options { */ debug?: boolean; + /** + * Specify blockTime in seconds for automatic mining. If you don't specify + * this flag, ganache will instantly mine a new block for every transaction. + * Using the blockTime option is discouraged unless you have tests which + * require a specific mining interval. + */ + blockTime?: number; + /** * An object, like console, that implements a log() function. */ From 6de914e5eafef94894ae46cc4e26fb40deca61d9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 4 Jun 2020 16:26:52 -0400 Subject: [PATCH 229/691] add blockTime option to Ethereum options --- src/chains/ethereum/src/options.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chains/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts index 497000dec6..4650d6c57a 100644 --- a/src/chains/ethereum/src/options.ts +++ b/src/chains/ethereum/src/options.ts @@ -15,6 +15,7 @@ type EthereumOptions = Pick< | "db_path" | "secure" | "time" + | "blockTime" > & { accounts: Account[]; }; From ea535d47045a6a8e7422a98d71e847092ae37aca Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 4 Jun 2020 16:27:32 -0400 Subject: [PATCH 230/691] add TODO for `net_listening` --- src/chains/ethereum/src/api.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 35704c834e..9624543bdb 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -100,6 +100,8 @@ export default class EthereumApi implements types.Api { * @returns true when listening, otherwise false. */ async net_listening(): Promise { + // TODO: this should return false when ganache isn't used with a server, or + // or while the server is still initializing. return true; } From f7c2aa608357f34f6ccc36188f39ffb513a128fb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 4 Jun 2020 16:28:09 -0400 Subject: [PATCH 231/691] add blockTime to etehreum blockchain options --- src/chains/ethereum/src/blockchain.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index ee908f5f84..0a913f239b 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -35,6 +35,7 @@ type BlockchainOptions = { allowUnlimitedContractSize?: boolean; gasLimit?: Quantity; time?: Date; + blockTime?: number; }; export default class Blockchain extends Emittery { From 27cbbadebc59c216c943215cb3a02ac356c3453a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 4 Jun 2020 18:57:23 -0400 Subject: [PATCH 232/691] update typescript to v3.9.5 --- npm-shrinkwrap.json | 12 ++++++------ package.json | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4f3c43647d..7c510eec43 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -11306,9 +11306,9 @@ } }, "ts-node": { - "version": "8.10.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.1.tgz", - "integrity": "sha512-bdNz1L4ekHiJul6SHtZWs1ujEKERJnHs4HxN7rjTyyVOFf3HaJ6sLqe6aPG62XTzAB/63pKRh5jTSWL0D7bsvw==", + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", + "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", "dev": true, "requires": { "arg": "^4.1.0", @@ -11369,9 +11369,9 @@ } }, "typescript": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.2.tgz", - "integrity": "sha512-q2ktq4n/uLuNNShyayit+DTobV2ApPEo/6so68JaD5ojvc/6GClBipedB9zNWYxRSAlZXAe405Rlijzl6qDiSw==", + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", + "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", "dev": true }, "uWebSockets.js": { diff --git a/package.json b/package.json index 96f7e72ac8..29e4162773 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,8 @@ "source-map-support": "0.5.19", "superagent": "5.2.2", "ts-morph": "7.0.3", - "ts-node": "8.10.1", - "typescript": "3.9.2", + "ts-node": "8.10.2", + "typescript": "3.9.5", "utf-8-validate": "5.0.2", "ws": "7.3.0", "yargs": "15.3.1" From 94815b4b31ac12b38621bd5cf8e7a982cc1f95bc Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 6 Jun 2020 13:42:32 -0400 Subject: [PATCH 233/691] Some pending tx stuff --- src/chains/ethereum/__tests__/api.test.ts | 209 --- .../ethereum/__tests__/api/eth/eth.test.ts | 254 ++++ .../ethereum/__tests__/api/net/net.test.ts | 26 + src/chains/ethereum/npm-shrinkwrap.json | 1331 ++++++++++++++++- src/chains/ethereum/package.json | 7 +- src/chains/ethereum/src/api.ts | 9 +- src/chains/ethereum/src/blockchain.ts | 28 +- .../src/components/transaction-manager.ts | 5 +- .../src/components/transaction-pool.ts | 136 +- src/chains/ethereum/src/miner.ts | 333 +++-- src/chains/ethereum/src/things/transaction.ts | 2 + 11 files changed, 1924 insertions(+), 416 deletions(-) delete mode 100644 src/chains/ethereum/__tests__/api.test.ts create mode 100644 src/chains/ethereum/__tests__/api/eth/eth.test.ts create mode 100644 src/chains/ethereum/__tests__/api/net/net.test.ts diff --git a/src/chains/ethereum/__tests__/api.test.ts b/src/chains/ethereum/__tests__/api.test.ts deleted file mode 100644 index b35754eb22..0000000000 --- a/src/chains/ethereum/__tests__/api.test.ts +++ /dev/null @@ -1,209 +0,0 @@ -import assert from "assert"; -import EthereumProvider from "../src/provider"; -import getProvider from "./helpers/getProvider"; - -describe("api", () => { - let provider: EthereumProvider; - let accounts: string[]; - - beforeEach(async () => { - provider = await getProvider(); - accounts = await provider.request("eth_accounts"); - }); - - it("gets balance", async () => { - const accounts = await provider.request("eth_accounts"); - const balance = await provider.request("eth_getBalance", [accounts[0]]); - // TODO: this value is actually wrong! - assert.strictEqual(balance, "0x56bc75e2d63100000", "Heyo!"); - }); - - it("eth_blockNumber", async () => { - const blockNumber = await provider.request("eth_blockNumber"); - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - const _txHash = await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - - const _message = await provider.once("message"); - const nextBlockNumber = await provider.request("eth_blockNumber"); - assert.strictEqual(parseInt(blockNumber, 10), nextBlockNumber - 1); - }); - - it("eth_getBlockByNumber", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const blocks = await Promise.all([ - provider.request("eth_getBlockByNumber", ["0x1", true]), - provider.request("eth_getBlockByNumber", ["0x1"]) - ]); - assert(blocks[0].hash, blocks[1].hash); - }); - - it("eth_getBlockByHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - - const blocks = await Promise.all([ - provider.request("eth_getBlockByHash", [block.hash, true]), - provider.request("eth_getBlockByHash", [block.hash]) - ]); - assert(blocks[0].hash, blocks[1].hash); - const counts = await Promise.all([ - provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]), - provider.request("eth_getBlockTransactionCountByHash", [blocks[0].hash]) - ]); - - assert(true); - }); - - it("eth_getBlockTransactionCountByHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - - const count = await provider.request("eth_getBlockTransactionCountByHash", [block.hash]); - assert(count, "1"); - }); - - it("eth_getBlockTransactionCountByNumber", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const count = await provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]); - assert(count, "1"); - }); - - it("eth_getTransactionByBlockNumberAndIndex", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const tx = await provider.request("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); - assert.equal( - tx.hash, - "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", - "Unexpected transaction hash." - ); - }); - - it("eth_getTransactionByBlockHashAndIndex", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - - const tx = await provider.request("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); - assert.equal( - tx.hash, - "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", - "Unexpected transaction hash." - ); - }); - - it("eth_getUncleCountByBlockHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); - - const count = await provider.request("eth_getUncleCountByBlockHash", [block.hash]); - assert(count, "0"); - }); - - it("eth_getUncleCountByBlockNumber", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const count = await provider.request("eth_getUncleCountByBlockNumber", ["0x1"]); - assert(count, "0"); - }); - - it("eth_getTransactionReceipt", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - const hash = await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const receipt = await provider.request("eth_getTransactionReceipt", [hash]); - assert(receipt.transactionIndex, "0x0"); - }); - - it("eth_getTransactionByHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - const hash = await provider.request("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const tx = await provider.request("eth_getTransactionByHash", [hash]); - assert(tx.transactionIndex, "0x0"); - }); -}); diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts new file mode 100644 index 0000000000..cfa78af362 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -0,0 +1,254 @@ +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +import getProvider from "../../helpers/getProvider"; + +describe("api", () => { + describe("eth", () => { + let provider: EthereumProvider; + let accounts: string[]; + + beforeEach(async () => { + provider = await getProvider(); + accounts = await provider.request("eth_accounts"); + }); + + describe("eth_getBalance", () => { + it("should return initial balance", async() => { + const balance = await provider.request("eth_getBalance", [accounts[0]]); + assert.strictEqual(balance, "0x56bc75e2d63100000"); + }); + + it("should return 0 for non-existent account", async() => { + const balance = await provider.request("eth_getBalance", ["0x1234567890123456789012345678901234567890"]); + assert.strictEqual(balance, "0x0"); + }); + }); + + describe("eth_blockNumber", async () => { + it("should return initial block number of zero", async function() { + const blockNumber = await provider.request("eth_blockNumber"); + assert.strictEqual(parseInt(blockNumber, 10), 0); + }); + + it("should increment the block number after a transaction", async function() { + const tx = { + from: accounts[0], + to: accounts[1], + value: 1 + } + const blockNumber = await provider.request("eth_blockNumber"); + await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [{...tx}]); + await provider.once("message"); + const blockx1 = await provider.request("eth_blockNumber"); + assert.strictEqual(parseInt(blockNumber, 10), blockx1 - 1); + + const awaitFor = (count) => new Promise(resolve => { + let counter = 0; + const off = provider.on("message", ((_block: any) => { + counter++; + if (counter === count) { + off(); + resolve(); + } + }) as any); + }); + + let wait = awaitFor(4); + await Promise.all([ + provider.request("eth_sendTransaction", [{...tx}]), + provider.request("eth_sendTransaction", [{...tx}]), + provider.request("eth_sendTransaction", [{...tx}]), + provider.request("eth_sendTransaction", [{...tx}]) + ]); + + await Promise.all([ + provider.request("eth_sendTransaction", [{...tx}]), + provider.request("eth_sendTransaction", [{...tx}]), + provider.request("eth_sendTransaction", [{...tx}]), + provider.request("eth_sendTransaction", [{...tx}]) + ]); + await wait; + wait = awaitFor(4); + const blockx5 = await provider.request("eth_blockNumber"); + assert.strictEqual(parseInt(blockNumber, 10), blockx5 - 5); + await wait; + const blockx9 = await provider.request("eth_blockNumber"); + assert.strictEqual(parseInt(blockNumber, 10), blockx9 - 9); + }); + }); + + it("eth_getBlockByNumber", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const blocks = await Promise.all([ + provider.request("eth_getBlockByNumber", ["0x1", true]), + provider.request("eth_getBlockByNumber", ["0x1"]) + ]); + assert(blocks[0].hash, blocks[1].hash); + }); + + it("eth_getBlockByHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + + const blocks = await Promise.all([ + provider.request("eth_getBlockByHash", [block.hash, true]), + provider.request("eth_getBlockByHash", [block.hash]) + ]); + assert(blocks[0].hash, blocks[1].hash); + const counts = await Promise.all([ + provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]), + provider.request("eth_getBlockTransactionCountByHash", [blocks[0].hash]) + ]); + + assert(true); + }); + + it("eth_getBlockTransactionCountByHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + + const count = await provider.request("eth_getBlockTransactionCountByHash", [block.hash]); + assert(count, "1"); + }); + + it("eth_getBlockTransactionCountByNumber", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const count = await provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]); + assert(count, "1"); + }); + + it("eth_getTransactionByBlockNumberAndIndex", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const tx = await provider.request("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); + assert.equal( + tx.hash, + "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", + "Unexpected transaction hash." + ); + }); + + it("eth_getTransactionByBlockHashAndIndex", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + + const tx = await provider.request("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); + assert.equal( + tx.hash, + "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", + "Unexpected transaction hash." + ); + }); + + it("eth_getUncleCountByBlockHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + + const count = await provider.request("eth_getUncleCountByBlockHash", [block.hash]); + assert(count, "0"); + }); + + it("eth_getUncleCountByBlockNumber", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const count = await provider.request("eth_getUncleCountByBlockNumber", ["0x1"]); + assert(count, "0"); + }); + + it("eth_getTransactionReceipt", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + const hash = await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const receipt = await provider.request("eth_getTransactionReceipt", [hash]); + assert(receipt.transactionIndex, "0x0"); + }); + + it("eth_getTransactionByHash", async () => { + const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); + const hash = await provider.request("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const _message = await provider.once("message"); + + const tx = await provider.request("eth_getTransactionByHash", [hash]); + assert(tx.transactionIndex, "0x0"); + }); + }); +}); diff --git a/src/chains/ethereum/__tests__/api/net/net.test.ts b/src/chains/ethereum/__tests__/api/net/net.test.ts new file mode 100644 index 0000000000..9877370734 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/net/net.test.ts @@ -0,0 +1,26 @@ +import assert from "assert"; +import getProvider from "../../helpers/getProvider"; + +describe("api", () => { + describe("net", () => {; + it("net_version", async () => { + const roundedTo5Seconds = (num: number) => Math.round(num / 5000) * 5000; + const nowIsh = roundedTo5Seconds(Date.now()); + const provider = await getProvider(); + const netVersion = await provider.request("net_version"); + assert.strictEqual(roundedTo5Seconds(netVersion), nowIsh); + }); + + it("net_listening", async () => { + const provider = await getProvider(); + const netListening = await provider.request("net_listening"); + assert.strictEqual(netListening, true); + }); + + it("net_peerCount", async () => { + const provider = await getProvider(); + const peerCount = await provider.request("net_peerCount"); + assert.strictEqual(peerCount, "0x0"); + }); + }); +}); diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 5a73f495fd..77d71b84fd 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -1,5 +1,1334 @@ { "name": "@ganache/ethereum", "version": "2.2.1", - "lockfileVersion": 1 + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.0.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.11.tgz", + "integrity": "sha512-lCvvI24L21ZVeIiyIUHZ5Oflv1hhHQ5E1S25IRlKIXaRkVgmXpJMI3wUJkmym2bTbCe+WoIibQnMVAU3FguaOg==" + }, + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "requires": { + "async": "^2.4.0" + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-sha3": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.4.tgz", + "integrity": "sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY=", + "requires": { + "js-sha3": "^0.6.1", + "safe-buffer": "^5.1.1" + } + }, + "buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "checkpoint-store": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", + "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", + "requires": { + "functional-red-black-tree": "^1.0.1" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "core-js-pure": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" + }, + "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=" + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "drbg.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", + "requires": { + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" + } + }, + "elliptic": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "encoding-down": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", + "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", + "requires": { + "abstract-leveldown": "^5.0.0", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0", + "xtend": "^4.0.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "level-codec": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", + "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "requires": { + "prr": "~1.0.1" + } + }, + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "ethashjs": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.7.tgz", + "integrity": "sha1-ML/kGWcmaQoMWdO4Jy5w1NDDS64=", + "requires": { + "async": "^1.4.2", + "buffer-xor": "^1.0.3", + "ethereumjs-util": "^4.0.1", + "miller-rabin": "^4.0.0" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", + "integrity": "sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=", + "requires": { + "bn.js": "^4.8.0", + "create-hash": "^1.1.2", + "keccakjs": "^0.2.0", + "rlp": "^2.0.0", + "secp256k1": "^3.0.1" + } + } + } + }, + "ethereumjs-account": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", + "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", + "requires": { + "ethereumjs-util": "^6.0.0", + "rlp": "^2.2.1", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-block": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "requires": { + "async": "^2.0.1", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + } + } + }, + "ethereumjs-blockchain": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.3.tgz", + "integrity": "sha512-0nJWbyA+Gu0ZKZr/cywMtB/77aS/4lOVsIKbgUN2sFQYscXO5rPbUfrEe7G2Zhjp86/a0VqLllemDSTHvx3vZA==", + "requires": { + "async": "^2.6.1", + "ethashjs": "~0.0.7", + "ethereumjs-block": "~2.2.2", + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "~6.1.0", + "flow-stoplight": "^1.0.0", + "level-mem": "^3.0.1", + "lru-cache": "^5.1.1", + "rlp": "^2.2.2", + "semaphore": "^1.1.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + } + } + }, + "ethereumjs-common": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", + "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", + "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^2.0.0", + "rlp": "^2.2.3", + "secp256k1": "^3.0.1" + } + }, + "ethereumjs-vm": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz", + "integrity": "sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==", + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "core-js-pure": "^3.0.1", + "ethereumjs-account": "^3.0.0", + "ethereumjs-block": "^2.2.2", + "ethereumjs-blockchain": "^4.0.3", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^6.2.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.3.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1", + "util.promisify": "^1.0.0" + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "fake-merkle-patricia-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", + "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", + "requires": { + "checkpoint-store": "^1.1.0" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "flow-stoplight": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", + "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-callable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==" + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + }, + "is-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "js-sha3": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", + "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" + }, + "keccak": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", + "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", + "requires": { + "bindings": "^1.5.0", + "inherits": "^2.0.4", + "nan": "^2.14.0", + "safe-buffer": "^5.2.0" + } + }, + "keccakjs": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.3.tgz", + "integrity": "sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg==", + "requires": { + "browserify-sha3": "^0.0.4", + "sha3": "^1.2.2" + } + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + }, + "level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-mem": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", + "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", + "requires": { + "level-packager": "~4.0.0", + "memdown": "~3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "memdown": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", + "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", + "requires": { + "abstract-leveldown": "~5.0.0", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-packager": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", + "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", + "requires": { + "encoding-down": "~5.0.0", + "levelup": "^3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", + "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", + "requires": { + "abstract-leveldown": "~5.0.0", + "inherits": "^2.0.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", + "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "xtend": "^4.0.0" + } + }, + "levelup": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", + "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", + "requires": { + "deferred-leveldown": "~4.0.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~3.0.0", + "xtend": "~4.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "requires": { + "xtend": "^4.0.2" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "requires": { + "deferred-leveldown": "~5.3.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "requires": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "~4.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "nan": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.5.tgz", + "integrity": "sha512-y1QxTQOp0OZnjn19FxBmped4p+BSKPHwGndaqrESseyd2xXZtcgR3yuTIosh8CaMaOii9SKIYerBXnV/CpJ3qw==", + "requires": { + "bn.js": "^4.11.1" + } + }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } + }, + "semaphore": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", + "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "sha3": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.6.tgz", + "integrity": "sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ==", + "requires": { + "nan": "2.13.2" + }, + "dependencies": { + "nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" + } + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + } + } } diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 32f4318b08..d05fb6bf0c 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -24,14 +24,15 @@ "scripts": { "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" - + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, "dependencies": { + "@ganache/options": "^2.2.1", "@ganache/utils": "^2.2.1", - "@ganache/options": "^2.2.1" + "ethereumjs-vm": "4.2.0", + "levelup": "4.4.0" } } diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 9624543bdb..edec0dc0f1 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -277,7 +277,7 @@ export default class EthereumApi implements types.Api { * @param blockNumber integer block number, or the string "latest", "earliest" * or "pending", see the default block parameter */ - async eth_getBalance(address: IndexableAddress, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + async eth_getBalance(address: string | IndexableAddress, blockNumber: Buffer | Tag = Tag.LATEST): Promise { const chain = this[_blockchain]; const account = await chain.accounts.get(Address.from(address), blockNumber); return account.balance; @@ -433,13 +433,8 @@ export default class EthereumApi implements types.Api { } if (isKnownAccount) { - if (tx.nonce.length === 0) { - // TODO: check pending transactions and get the nonce from there - const account = await this[_blockchain].accounts.get(from); - tx.nonce = account.nonce.toBuffer(); - } const secretKey = this[_wallet].knownAccounts.get(fromString); - tx.sign(secretKey.toBuffer()); + return this[_blockchain].queueTransaction(tx, secretKey); } return this[_blockchain].queueTransaction(tx); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 0a913f239b..fcd2b67dc1 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -70,7 +70,10 @@ export default class Blockchain extends Emittery { this.blocks = new BlockManager(this, database.blocks); this.vm = this.createVmFromStateTrie(this.trie, options.hardfork, options.allowUnlimitedContractSize); - const miner = new Miner(this.vm, options); + const gasLimit = options.gasLimit; + const instamine = !options.blockTime || options.blockTime <= 0; + const miner = new Miner(this.vm, {instamine, gasLimit}); + this.transactions = new TransactionManager(this, database.transactions, options); this.transactionReceipts = new Manager( this, @@ -80,7 +83,7 @@ export default class Blockchain extends Emittery { this.accounts = new AccountManager(this, database.trie); await this.#initializeAccounts(options.accounts); - let lastBlock = this.#initializeGenesisBlock(options.time, options.gasLimit); + let lastBlock = this.#initializeGenesisBlock(options.time, gasLimit); const readyNextBlock = async () => { const previousBlock = await lastBlock; @@ -88,26 +91,25 @@ export default class Blockchain extends Emittery { const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; return this.blocks.createBlock({ number: Quantity.from(previousNumber + 1n).toBuffer(), - gasLimit: options.gasLimit.toBuffer(), + gasLimit: gasLimit.toBuffer(), timestamp: this.#currentTime(), parentHash: previousHeader.hash() }); }; - const instamining = true; - if (instamining) { + + if (instamine) { this.transactions.transactionPool.on("drain", async (pending: Map>) => { const block = await readyNextBlock(); - await miner.mine(pending, block.value); + await miner.mine(pending, block.value, 1); }); } else { - // TODO: the interval needs to be from the `options` - const minerInterval = 3 * 1000; + const minerInterval = options.blockTime * 1000; const mine = async (pending: Map>) => { const block = await readyNextBlock(); - await miner.mine(pending, block.value); - setTimeout(mine, minerInterval, pending); + await miner.mine(pending, block.value, 0); + setTimeout(mine, minerInterval, pending, 0); }; - setTimeout(mine, minerInterval, this.transactions.transactionPool.executables); + setTimeout(mine, minerInterval, this.transactions.transactionPool.executables, 0); } miner.on("block", async (blockData: any) => { @@ -230,8 +232,8 @@ export default class Blockchain extends Emittery { return number.toString() as any; }; - public async queueTransaction(transaction: any): Promise { - await this.transactions.push(transaction); + public async queueTransaction(transaction: any, secretKey?: Data): Promise { + await this.transactions.push(transaction, secretKey); return Data.from(transaction.hash()); } diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts index cb6dcfe6ca..ad1f06bed0 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -4,6 +4,7 @@ import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; import levelup from "levelup"; import Blockchain from "../blockchain"; import {utils} from "@ganache/utils"; +import { Data } from "@ganache/utils/src/things/json-rpc"; export type TransactionManagerOptions = TransactionPoolOptions; @@ -19,7 +20,7 @@ export default class TransactionManager extends Manager { }); } - public push(transaction: Transaction): Promise { - return this.transactionPool.insert(transaction); + public push(transaction: Transaction, secretKey?: Data): Promise { + return this.transactionPool.insert(transaction, secretKey); } } diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index 06867acef5..b428dac490 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -1,3 +1,4 @@ +import Account from "../things/account"; import Emittery from "emittery"; import Blockchain from "../blockchain"; import {utils} from "@ganache/utils"; @@ -35,9 +36,13 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction this.#options = options; } public executables: Map> = new Map(); - #origins: Map> = new Map(); + #origins: Map, + nonce: bigint + }> = new Map(); + #accountPromises = new Map>(); - public async insert(transaction: Transaction) { + public async insert(transaction: Transaction, secretKey?: Data) { let err: Error; err = this.validateTransaction(transaction); @@ -47,17 +52,31 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction } const from = Data.from(transaction.from); - const transactionNonce = Quantity.from(transaction.nonce).toBigInt() || 0n; + let transactionNonce: bigint; + if (secretKey === null || transaction.nonce.length !== 0) { + transactionNonce = Quantity.from(transaction.nonce).toBigInt() || 0n;; + if (transactionNonce < 0n) { + throw new Error("Transaction nonce cannot be negative."); + } + } const origin = from.toString(); const origins = this.#origins; - let queuedOriginTransactions = origins.get(origin); + let queuedOrigin = origins.get(origin); + let highestNonce = 0n; + let queuedOriginTransactions: utils.Heap; + if (queuedOrigin) { + highestNonce = queuedOrigin.nonce; + queuedOriginTransactions = queuedOrigin.transactions; + } let isExecutableTransaction = false; const executables = this.executables; let executableOriginTransactions = executables.get(origin); + let transactor: Account; - if (executableOriginTransactions) { + let length: number; + if (executableOriginTransactions && (length = executableOriginTransactions.length)) { // check if a transaction with the same nonce is in the origin's // executables queue already. Replace the matching transaction or throw this // new transaction away as neccessary. @@ -66,8 +85,6 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction const newGasPrice = Quantity.from(transaction.gasPrice).toBigInt(); // Notice: we're iterating over the raw heap array, which isn't // neccessarily sorted - let highestNonce = 0n; - const length = executableOriginTransactions.length; for (let i = 0; i < length; i++) { const currentPendingTx = pendingArray[i]; const thisNonce = Quantity.from(currentPendingTx.nonce).toBigInt(); @@ -77,46 +94,71 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction // TODO: how do we surface these transaction failures to the caller?! - // if our new price is `thisPrice * priceBumpPercent` better than our + // if our new price is `gasPrice * priceBumpPercent` better than our // oldPrice, throw out the old now. - if (newGasPrice > thisPricePremium) { + if (!currentPendingTx.locked && newGasPrice > thisPricePremium) { isExecutableTransaction = true; // do an in-place replace without triggering a resort because we // already known where this tranassction should go in this byNonce // heap. - executableOriginTransactions.array[i] = transaction; + pendingArray[i] = transaction; throw new Error("That old transaction sucked, yo!"); } else { throw new Error("That new transaction sucked, yo!"); } - break; - } else if (thisNonce > highestNonce) { + } + if (thisNonce > highestNonce) { highestNonce = thisNonce; } } - // if our transaction's nonce is 1 higher than the last transaction in the - // origin's heap we are executable. - if (transactionNonce === highestNonce + 1n) { + if (secretKey && transactionNonce === void 0) { + // if we aren't signed and don't have a transactionNonce yet set it now + transactionNonce = highestNonce + 1n; + transaction.nonce = Quantity.from(transactionNonce).toBuffer(); + isExecutableTransaction = true; + highestNonce = transactionNonce; + } else if (transactionNonce === highestNonce + 1n) { + // if our transaction's nonce is 1 higher than the last transaction in the + // origin's heap we are executable. isExecutableTransaction = true; + highestNonce = transactionNonce; + } + } else { + // since we don't have any pending transactions for this account + // verify the transaction's nonce is valid against the persisted account + // Note: we need to lock on this async request to ensure we always process + // incoming requests in the order they were received! It is possible for + // the file IO performed by `accounts.get` to vary. + let transactorPromise = this.#accountPromises.get(origin); + if (!transactorPromise) { + transactorPromise = this.#blockchain.accounts.get(from) + this.#accountPromises.set(origin, transactorPromise); + transactorPromise.then(() => { + this.#accountPromises.delete(origin); + }); + } + transactor = await transactorPromise; + + const transactorNonce = transactor.nonce.toBigInt(); + if (secretKey && transactionNonce === void 0) { + // if we don't have a transactionNonce, just use the account's next + // nonce and mark as executable + transactionNonce = transactorNonce ? transactorNonce : 0n; + highestNonce = transactionNonce; + isExecutableTransaction = true; + transaction.nonce = Quantity.from(transactionNonce).toBuffer(); + } else if (transactionNonce <= transactorNonce) { + // it's an error if the transaction's nonce is <= the persisted nonce + throw new Error("Transaction nonce is too low"); } } - // TODO: since this is the only async code in this `insert` fn, maybe we can - // put this into the miner? The VM itself does check for everything this - // validation function checks for. - const transactor = await this.#blockchain.accounts.get(from); - err = await this.#validateTransactor(transaction, transactor); - if (err != null) { - // TODO: how do we surface these transaction failures to the caller?! - throw err; - } + // this.#assertValidTransactorBalance(transaction, transactor); - if (!isExecutableTransaction) { - // If the transaction wasn't found in our origin's executables queue, - // check if it is at the correct `nonce` by looking up the origin's - // current nonce - const transactorNextNonce = transactor.nonce.toBigInt() || 0n; - isExecutableTransaction = transactorNextNonce === transactionNonce; + // now that we know we have a transaction nonce we can sign the transaction + // (if we have the secret key) + if (secretKey) { + transaction.sign(secretKey.toBuffer()); } // if it is executable add it to the executables queue @@ -128,13 +170,25 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction executableOriginTransactions = utils.Heap.from(transaction, byNonce); executables.set(origin, executableOriginTransactions); } + if (queuedOrigin) { + queuedOrigin.nonce = highestNonce; + } else { + origins.set(origin, { + nonce: highestNonce, + // note: queuedOriginTransactions might be undefined here, and that's okay. + transactions: queuedOriginTransactions + }); + } this.#drainQueued(origin, queuedOriginTransactions, executableOriginTransactions, transactionNonce); } else if (queuedOriginTransactions) { queuedOriginTransactions.push(transaction); } else { queuedOriginTransactions = utils.Heap.from(transaction, byNonce); - origins.set(origin, queuedOriginTransactions); + origins.set(origin, { + nonce: highestNonce, + transactions: queuedOriginTransactions + }); } } @@ -149,7 +203,7 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction if (queuedOriginTransactions) { const origins = this.#origins; - let nextExpectedNonce: bigint = transactionNonce + 1n; + let nextExpectedNonce = transactionNonce + 1n; while (true) { const nextTx = queuedOriginTransactions.peek(); const nextTxNonce = Quantity.from(nextTx.nonce).toBigInt() || 0n; @@ -163,7 +217,7 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction // And then remove this transaction from its origin's queue if (!queuedOriginTransactions.removeBest()) { // removeBest() returns `false` when there are no more items after - // the remove item. Let's do some cleanup when that happens + // the removed item. Let's do some cleanup when that happens. origins.delete(origin); break; } @@ -172,7 +226,7 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction } } - // notify listeners (the miner, probably) that we have executables + // notify listeners (the miner, probably) that we have executable // transactions ready for it this.emit("drain", this.executables); }; @@ -199,21 +253,11 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction return null; }; - #validateTransactor = async (transaction: Transaction, transactor: any): Promise => { + #assertValidTransactorBalance = (transaction: Transaction, transactor: any): Error | null => { // Transactor should have enough funds to cover the costs if (transactor.balance.toBigInt() < transaction.cost()) { return new Error("Account does not have enough funds to complete transaction"); } - - // check that the nonce isn't too low - let transactorNonce = transactor.nonce.toBigInt(); - if (transactorNonce == null) { - transactorNonce = -1n; - } - const transactionNonce = Quantity.from(transaction.nonce).toBigInt() || 0n; - if (transactorNonce > transactionNonce) { - return new Error("Transaction nonce is too low"); - } return null; - }; + } } diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index cc7d5ac3ff..d01c02eca1 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -7,23 +7,21 @@ import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; import Block from "ethereumjs-block"; import VM from "ethereumjs-vm"; -import {RunTxResult} from "ethereumjs-vm/dist/runTx"; import {encode as rlpEncode} from "rlp"; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); function replaceFromHeap( priced: utils.Heap, - source: utils.Heap, - pending: Map>, - key: string + source: utils.Heap ) { // get the next best for this account, removing from the source Heap: - const next = source.shift(); + const next = source.peek(); if (next) { // remove the current best priced transaction from this account and replace // replace it with the account's next lowest nonce transaction: priced.replaceBest(next); + next.locked = true; } else { // since we don't have a next, just remove this item from priced priced.removeBest(); @@ -32,6 +30,7 @@ function replaceFromHeap( type MinerOptions = { gasLimit?: Quantity; + instamine: boolean }; function byPrice(values: Transaction[], a: number, b: number) { @@ -72,166 +71,229 @@ export default class Miner extends Emittery { * It is possible the miner will not empty the Map if it can't fit all * transactions within a single block. The remaining items will be left in * the pending pool to be eligible for mining in the future. + * + * @param maxTransactions: number maximum number of transactions per block. If `0`, unlimited. */ - public async mine(pending: Map>, block: Block) { + public async mine(pending: Map>, block: Block, maxTransactions: number) { // only allow mining a single block at a time (per miner) if (this.#isMining) { // if we are currently mining a block, set the `pending` property // so the miner knows it should immediately mine another block once it is - // done with its current work. + // done with its current work. this.#pending = pending; this.#updatePricedHeap(pending); return; } else { this.#setPricedHeap(pending); } - this.#isMining = true; - const blockTransactions: Transaction[] = []; + const lastBlock = await this.#mineTxs(pending, block, maxTransactions); - let blockGasLeft = this.#options.gasLimit.toBigInt(); + if (this.#pending) { + const nextBlock = this.#createNextBlock(lastBlock); + const pending = this.#pending; + this.#pending = null; + this.mine(pending, nextBlock, this.#options.instamine ? 1 : 0); + } + } - let counter = 0; - const transactionsTrie = new Trie(null, null); - const receiptTrie = new Trie(null, null); - const promises: Promise[] = []; + #createNextBlock = (parentBlock: Block) => { + return new Block({ + parentHash: parentBlock.header.hash, + number: Quantity.from(Quantity.from(parentBlock.header.number).toBigInt() + 1n).toBuffer(), + coinbase: parentBlock.header.coinbase, - await this.#checkpoint(); + // TODO: hm... tricky... we know we need to mine a new block + // but at what timestamp? We need to get the timestamp from `blockchain`, but so far, + // we don't require the miner to know about the blockchain. + // I think what we need to do is just put the time mechanics here in the miner, and blockchain can + // update them when needed. + // also, what if the previous block was mined with a timestamp, do we need to mine two blocks with that + // same timestamp? uh, I think not. + timestamp: parentBlock.header.timestamp, + difficulty: parentBlock.header.difficulty, + gasLimit: parentBlock.header.gasLimit + }); + } + #mineTxs = async (pending: Map>, block: Block, maxTransactions: number) => { + let keepMining = true; const priced = this.#priced; - const rejectedTransactions: Transaction[] = []; - const blockData = { - blockTransactions, - transactionsTrie, - receiptTrie, - gasUsed: 0n - }; - - // Run until we run out of items, or until the inner loop stops us. - // we don't call `shift()` here because we will will probably need to - // `replace` this top transaction with the next top transaction from the same - // origin. - let best: Transaction; - while ((best = priced.peek())) { - // if the current best transaction can't possibly fit in this block - // go ahead and run the next best transaction, ignoring all other - // pending transactions from this account for this block. - if (best.calculateIntrinsicGas() > blockGasLeft) { - priced.removeBest(); - rejectedTransactions.push(best); - continue; - } + let o = ""; + while (keepMining) { + this.#isMining = true; + let numTransactions = 0; - // TODO: get a real block - const blockHeader = block.header; - const blockBloom = blockHeader.bloom; + const blockTransactions: Transaction[] = []; - const origin = Data.from(best.from).toString(); - const pendingFromOrigin = pending.get(origin); + let blockGasLeft = this.#options.gasLimit.toBigInt(); - this.#currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); + const transactionsTrie = new Trie(null, null); + const receiptTrie = new Trie(null, null); + const promises: Promise[] = []; - const runArgs = { - tx: best as any, - block - }; + // Set a block-level checkpoint so our unsaved trie doesn't update the + // vm's "live" trie. await this.#checkpoint(); - let result: RunTxResult; - try { - result = await this.#vm.runTx(runArgs); - } catch (err) { - await this.#revert(); - const errorMessage = err.message; - if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { - // a race condition between the pool and the miner could potentially - // cause this issue. - // We do NOT want to re-run this transaction. - // Update the `priced` heap with the next best transaction from this - // account - replaceFromHeap(priced, pendingFromOrigin, pending, origin); - - // TODO: how do we surface this error to the caller? - throw err; - } else { - // TODO: handle all other errors! - // TODO: how do we surface this error to the caller? - throw err; - } - } - const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); - if (blockGasLeft >= gasUsed) { - await this.#commit(); - - blockGasLeft -= gasUsed; - blockData.gasUsed += gasUsed; - - // calculate receipts and tries - const rawReceipt = best.initializeReceipt(result); - const txKey = rlpEncode(counter); - promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); - promises.push(putInTrie(receiptTrie, txKey, rawReceipt)); + const blockData = { + blockTransactions, + transactionsTrie, + receiptTrie, + gasUsed: 0n + }; - // update the block's bloom - const bloom = result.bloom.bitvector; - for (let i = 0; i < 256; i++) { - blockBloom[i] |= bloom[i]; + // TODO: get a real block? + const blockBloom = block.header.bloom; + + // Run until we run out of items, or until the inner loop stops us. + // we don't call `shift()` here because we will may need to `replace` + // this `best` transaction with the next best transaction from the same + // origin later. + let best: Transaction; + while ((best = priced.peek())) { + if (best.calculateIntrinsicGas() > blockGasLeft) { + // if the current best transaction can't possibly fit in this block + // go ahead and run the next best transaction, ignoring all other + // pending transactions from this account for this block. + // * We don't replace this "best" tranasction with another from the + // same account. + // * We do "unlock" this transaction in the transaction pool's `pending` + // queue so it can be replaced, if needed. + priced.removeBest(); + best.locked = false; + continue; } - blockTransactions[counter] = best; + const origin = Data.from(best.from).toString(); + o = origin; + + this.#currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); + + const runArgs = { + tx: best as any, + block, + skipNonce: true + }; + // Set a transaction-level checkpoint so we can undo state changes in + // the case where the transaction is rejected by the VM. + await this.#checkpoint(); + + const result = await this.#runTx(runArgs, origin, pending); + const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); + if (blockGasLeft >= gasUsed) { + // if the transaction will fit in the block, commit it! + await this.#commit(); + blockTransactions[numTransactions] = best; + + blockGasLeft -= gasUsed; + blockData.gasUsed += gasUsed; + + // calculate receipt and tx tries + const rawReceipt = best.initializeReceipt(result); + const txKey = rlpEncode(numTransactions); + promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); + promises.push(putInTrie(receiptTrie, txKey, rawReceipt)); + + // update the block's bloom + const bloom = result.bloom.bitvector; + for (let i = 0; i < 256; i++) { + blockBloom[i] |= bloom[i]; + } + + numTransactions++; + + const pendingOrigin = pending.get(origin); + // since this transaction was successful, remove it from the "pending" + // transaction pool. + const accountHasMoreTransactions = pendingOrigin.removeBest(); + + // if we: + // * don't have enough gas left for even the smallest of transactions + // * Or if we've mined enough transactions + // we're done with this block! + if (blockGasLeft <= params.TRANSACTION_GAS || numTransactions === maxTransactions) { + if (accountHasMoreTransactions) { + // remove the newest (`best`) tx from this account's pending queue + // as we know we can fit another transaction in the block. Stick + // this tx into our `priced` heap. + replaceFromHeap(priced, pendingOrigin); + } else { + priced.removeBest(); + } + break; + } + + if (accountHasMoreTransactions) { + // remove the newest (`best`) tx from this account's pending queue + // as we know we can fit another transaction in the block. Stick + // this tx into our `priced` heap. + replaceFromHeap(priced, pendingOrigin); + } else { + // since we don't have any more txs from this account, just get the + // next bext transaction sorted in our `priced` heap. + priced.removeBest(); + } + } else { + await this.#revert(); - counter++; + // unlock the transaction so the transaction pool can reconsider this + // transaction + best.locked = false; - // if we don't have enough gas left for even the smallest of - // transactions we're done - if (blockGasLeft <= params.TRANSACTION_GAS) { - break; + // didn't fit. remove it from the priced transactions without replacing + // it with another from the account. This transaction will have to be + // run again in another block. + priced.removeBest(); } - - // remove the current (`best`) item from the live pending queue as we - // now know it will fit in the block. - // update `priced` with the next best for this account: - replaceFromHeap(priced, pendingFromOrigin, pending, origin); - } else { - await this.#revert(); - - // didn't fit. remove it from the priced transactions without replacing - // it with another from the account. This transaction will have to be - // run again in the next block. - priced.removeBest(); - rejectedTransactions.push(best); } - } - await Promise.all(promises); - await this.#commit(); - // TODO: put the rejected transactions back in their original origin heaps - rejectedTransactions.forEach(transaction => { - // TODO: this transaction should probably be validated again...? - console.log(transaction); - }); + // if we mined anything, keep mining. + keepMining = numTransactions !== 0; + if (keepMining) { + await Promise.all(promises); + await this.#commit(); - this.emit("block", blockData); + this.emit("block", blockData); - // reset the miner (this sets _isMining back to false) - this.#reset(); + maxTransactions = this.#options.instamine ? 1 : 0; + block = this.#createNextBlock(block); + this.#currentlyExecutingPrice = 0n; + } else { + // don't save an empty block + // TODO: should we allow save an empty block?! I think we should + // sometimes save an empty block, but not always? Hmmmmm. Interesting. + // Probably a breaking change here? AAaAaaAaah. + this.#revert(); + + // reset the miner + this.#reset(); + } + } + return block; + } - if (this.#pending) { - // TODO: hm... tricky... we know we need to mine a new block - // but at what timestamp? We need to get the timestamp from `blockchain`, but so far, - // we don't require the miner to know about the blockchain. - // also, what if the previous block was mined with a timestamp, do we need to mine two blocks with that - // same timestamp? uh, I think not. - const nextBlock = new Block({ - parentHash: block.header.hash, - number: Quantity.from(Quantity.from(block.header.number).toBigInt() + 1n).toBuffer(), - coinbase: block.header.coinbase, - timestamp: block.header.timestamp, - difficulty: block.header.difficulty, - gasLimit: block.header.gasLimit - }); - this.mine(this.#pending, nextBlock); - this.#pending = null; + #runTx = async (runArgs: any, origin: string, pending: Map>) => { + try { + return await this.#vm.runTx(runArgs); + } catch (err) { + await this.#revert(); + const errorMessage = err.message; + if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { + // a race condition between the pool and the miner could potentially + // cause this issue. + // We do NOT want to re-run this transaction. + // Update the `priced` heap with the next best transaction from this + // account + replaceFromHeap(this.#priced, pending.get(origin)); + + // TODO: how do we surface this error to the caller? + throw err; + } else { + // TODO: handle all other errors! + // TODO: how do we surface this error to the caller? + throw err; + } } } @@ -248,11 +310,12 @@ export default class Miner extends Emittery { for (let mapping of pending) { const heap = mapping[1]; - const next = heap.shift(); - if (next) { + const next = heap.peek(); + if (next && !next.locked) { const origin = Data.from(next.from).toString(); origins.add(origin); priced.push(next); + next.locked = true; } } }; @@ -268,7 +331,7 @@ export default class Miner extends Emittery { for (let mapping of pending) { const heap = mapping[1]; const next = heap.peek(); - if (next) { + if (next && !next.locked) { const price = Quantity.from(next.gasPrice).toBigInt(); if (this.#currentlyExecutingPrice < price) { // don't insert a transaction into the miner's `priced` heap @@ -283,7 +346,7 @@ export default class Miner extends Emittery { } origins.add(origin); priced.push(next); - heap.removeBest(); + next.locked = true; } } }; diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 51ef853ec2..4d6adcc96d 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -175,6 +175,7 @@ function initData(tx: any, data: any) { interface Transaction extends Omit {} // TODO fix the EthereumJsTransaction as any via some "fake" multi-inheritance: class Transaction extends (EthereumJsTransaction as any) { + public locked: boolean = false; type: number; v: Buffer; r: Buffer; @@ -287,6 +288,7 @@ class Transaction extends (EthereumJsTransaction as any) { const tx = new Transaction(options, type); tx._hash = json.hash ? Data.from(json.hash).toBuffer() : null; + tx._from = json.from ? Data.from(json.from).toBuffer() : null; return tx; } From c23ebdb2fd08ebac0e7657a31a321995d14ddc8f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Jun 2020 16:08:00 -0400 Subject: [PATCH 234/691] Add eth_sign --- src/chains/ethereum/src/api.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index edec0dc0f1..9236e49431 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,5 +1,6 @@ //#region Imports import {types} from "@ganache/utils"; +import {toRpcSig, ecsign, hashPersonalMessage} from "ethereumjs-util"; import EthereumOptions from "./options"; import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; import Blockchain from "./blockchain"; @@ -449,6 +450,36 @@ export default class EthereumApi implements types.Api { return await this[_blockchain].queueTransaction(transaction); } + /** + * The sign method calculates an Ethereum specific signature with: + * `sign(keccak256("\x19Ethereum Signed Message:\n" + message.length + message)))`. + * + * By adding a prefix to the message makes the calculated signature + * recognisable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim. + * + * Note the address to sign with must be unlocked. + * + * @param account address + * @param data message to sign + * @returns Signature + */ + eth_sign(account: string | Buffer, message: string | Buffer) { + const address = Address.from(account).toString().toLowerCase(); + const wallet =this[_wallet]; + const isUnlocked = wallet.unlockedAccounts[address]; + let privateKey: Buffer; + if (isUnlocked) { + privateKey = wallet.knownAccounts.get[address]; + } + if (!privateKey) { + throw new Error("cannot sign data; no private key"); + } + + const messageHash = hashPersonalMessage(Data.from(message).toBuffer()); + const signature = ecsign(messageHash, privateKey); + return Promise.resolve(toRpcSig(signature.v, signature.r, signature.s, +this[_options].chainId)); + } + eth_subscribe(subscriptionName: "newHeads", options?: any): PromiEvent { switch (subscriptionName) { case "newHeads": From 35b2a3b2d6f9bbcd86f1e3b61a02d99ad82a4a0c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Jun 2020 16:09:43 -0400 Subject: [PATCH 235/691] return block header on newHeads subscription --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 9236e49431..051a37771f 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -490,7 +490,7 @@ export default class EthereumApi implements types.Api { promiEvent.emit("message", { type: "eth_subscription", data: { - result, + result: result.value.header.toJSON(true), subscription } }); From ab33c68a5bcfa68b5a5cd115e68fba86ec6fb853 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Jun 2020 16:10:22 -0400 Subject: [PATCH 236/691] support legacy provider subscription --- src/chains/ethereum/src/provider.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index c9d9ca82ce..adcbc01125 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -174,7 +174,14 @@ export default class EthereumProvider extends Emittery.Typed>; if (promise instanceof PromiEvent) { promise.on("message", (data) => { + // EIP-1193 this.emit("message" as never, data as never); + // legacy + this.emit("data" as never, { + jsonrpc:"2.0", + method: "eth_subscription", + params: (data as any).data + } as never); }); } return promise.then(JSON.stringify).then(JSON.parse); From e8d2a12c7c0f478731a11c8046dedf61de144081 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Jun 2020 16:10:46 -0400 Subject: [PATCH 237/691] add eth_getTransactionCount --- src/chains/ethereum/src/api.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 051a37771f..86765b644c 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -570,6 +570,19 @@ export default class EthereumApi implements types.Api { } + /** + * Returns the number of transactions sent from an address. + * + * @param address + * @param blockNumber integer block number, or the string "latest", "earliest" + * or "pending", see the default block parameter + * @returns integer of the number of transactions sent from this address. + */ + async eth_getTransactionCount(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { + const account = await this[_blockchain].accounts.get(Address.from(address), blockNumber); + return account.nonce; + } + async eth_call(transaction: any, blockNumber: Buffer | Tag | string = Tag.LATEST): Promise { const blocks = this[_blockchain].blocks; const parentBlock = await blocks.get(blockNumber); From 6188d5ca8e6efd258998bacb26308e38e72ca557 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Jun 2020 16:11:10 -0400 Subject: [PATCH 238/691] add ganache_setAccountNonce --- src/chains/ethereum/src/api.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 86765b644c..14c9d32b14 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -67,6 +67,30 @@ export default class EthereumApi implements types.Api { }); } + //#region ganache + /** + * Fast forwards an account's nonce to the specified value. + * + * @param address + */ + async ganache_setAccountNonce(address: string, nonce: number | BigInt) { + return new Promise((resolve, reject) => { + const buffer = Address.from(address).toBuffer(); + this[_blockchain].vm.stateManager.getAccount(buffer, (err, account) => { + if (err) { + return void reject(err) + } + account.nonce = nonce; + this[_blockchain].vm.stateManager.putAccount(buffer, account, (err) => { + if (err) { + return void reject(err) + } + resolve(null); + }); + }); + }); + } + //#endregion ganache //#region web3 /** * Returns the current client version. From 4e7447a650336300520afad422ba1b32a4714522 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Jun 2020 16:12:08 -0400 Subject: [PATCH 239/691] Support fractional amounts od `default_balance_ether` --- src/chains/ethereum/src/provider.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index adcbc01125..8cee1e52b2 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -55,7 +55,14 @@ export default class EthereumProvider extends Emittery.Typed { const _providerOptions = this.#options; - const etherInWei = Quantity.from(Quantity.from(_providerOptions.default_balance_ether).toBigInt() * WEI); + // convert a potentially fractional balance of Ether to WEI + const balanceParts = _providerOptions.default_balance_ether.toString().split(".", 2); + const significand = BigInt(balanceParts[0]); + const fractionalStr = balanceParts[1] || "0"; + const fractional = BigInt(fractionalStr); + const magnitude = 10n ** BigInt(fractionalStr.length); + const defaultBalanceInWei = (WEI * significand) + (fractional * (WEI/magnitude)); + const etherInWei = Quantity.from(defaultBalanceInWei); let accounts: Account[]; let givenAccounts = _providerOptions.accounts; From b09489405c871d5815f48add874f74f2a4203baf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Jun 2020 16:13:59 -0400 Subject: [PATCH 240/691] support gasPrice option as Quantity or string/number --- src/chains/ethereum/src/api.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 14c9d32b14..338d117399 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -446,7 +446,12 @@ export default class EthereumApi implements types.Api { } if (tx.gasPrice.length === 0) { - tx.gasPrice = this[_options].gasPrice.toBuffer(); + const gasPrice = this[_options].gasPrice; + if (gasPrice instanceof Quantity) { + tx.gasPrice = gasPrice.toBuffer(); + } else { + tx.gasPrice = Quantity.from(gasPrice as any).toBuffer(); + } } if (tx.value.length === 0) { From 10fb243e775ad6b1ade08cbcdfcbdb00c21c8dee Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 9 Jun 2020 17:53:11 -0400 Subject: [PATCH 241/691] handle evm_mine miner_start/_stop rpcs --- src/chains/ethereum/src/api.ts | 21 ++++++ src/chains/ethereum/src/blockchain.ts | 74 ++++++++++++++----- .../src/components/transaction-manager.ts | 2 +- .../src/components/transaction-pool.ts | 36 +++++---- src/chains/ethereum/src/miner.ts | 13 ++-- .../src/things/transaction-receipt.ts | 6 +- 6 files changed, 111 insertions(+), 41 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 338d117399..66421aad38 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -91,6 +91,27 @@ export default class EthereumApi implements types.Api { }); } //#endregion ganache + + //#region evm + async evm_mine(timestamp?: number) { + await this[_blockchain].transactions.transactionPool.drain(0, timestamp); + // TODO: why did ganache-core send "0x0" back? Is this what geth does? + return Promise.resolve("0x0"); + } + //#endregion evm + + //#region miner + miner_start(threads: number = 1) { + this[_blockchain].resume(threads); + return Promise.resolve(true); + } + + async miner_stop() { + this[_blockchain].pause(); + return Promise.resolve(true); + } + //#endregion + //#region web3 /** * Returns the current client version. diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index fcd2b67dc1..5175542e5b 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -17,14 +17,24 @@ import TransactionReceipt from "./things/transaction-receipt"; import {encode as rlpEncode} from "rlp"; import Common from "ethereumjs-common"; -const VM = require("ethereumjs-vm").default; +import VM from "ethereumjs-vm"; + +function unref (timer: NodeJS.Timeout | number): timer is NodeJS.Timeout { + if (typeof timer === "object" && typeof timer.unref === "function") { + timer.unref(); + return true; + } else { + return false; + } +} export enum Status { // Flags - started = 1, - starting = 3, - stopped = 4, - stopping = 12 + started = 1, // 0000 0001 + starting = 2, // 0000 0010 + stopped = 4, // 0000 0100 + stopping = 8, // 0000 1000 + paused = 16 // 0001 0000 } type BlockchainOptions = { @@ -44,7 +54,7 @@ export default class Blockchain extends Emittery { public transactions: TransactionManager; public transactionReceipts: Manager; public accounts: AccountManager; - public vm: any; + public vm: VM; public trie: CheckpointTrie; readonly #database: Database; @@ -85,31 +95,41 @@ export default class Blockchain extends Emittery { await this.#initializeAccounts(options.accounts); let lastBlock = this.#initializeGenesisBlock(options.time, gasLimit); - const readyNextBlock = async () => { + const readyNextBlock = async (timestamp?: number) => { const previousBlock = await lastBlock; const previousHeader = previousBlock.value.header; const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; return this.blocks.createBlock({ number: Quantity.from(previousNumber + 1n).toBuffer(), gasLimit: gasLimit.toBuffer(), - timestamp: this.#currentTime(), + timestamp: timestamp || this.#currentTime(), parentHash: previousHeader.hash() }); }; if (instamine) { - this.transactions.transactionPool.on("drain", async (pending: Map>) => { - const block = await readyNextBlock(); - await miner.mine(pending, block.value, 1); + this.transactions.transactionPool.on("drain", async ({executables, timestamp, maxTransactions}: {maxTransactions: number ,executables: Map>, timestamp?: number}) => { + if (maxTransactions !== 0 && this.#isPaused()) return; + const block = await readyNextBlock(timestamp); + return miner.mine(executables, block.value, maxTransactions == null ? 1 : 0); }); } else { const minerInterval = options.blockTime * 1000; - const mine = async (pending: Map>) => { - const block = await readyNextBlock(); - await miner.mine(pending, block.value, 0); - setTimeout(mine, minerInterval, pending, 0); + const mine = (pending: Map>) => { + let promise: Promise; + if (!this.#isPaused()) { + promise = readyNextBlock().then(block => { + miner.mine(pending, block.value); + }); + } else { + promise = this.once("resume"); + } + promise.then(() => { + unref(setTimeout(mine, minerInterval, pending)); + }); + return void 0; }; - setTimeout(mine, minerInterval, this.transactions.transactionPool.executables, 0); + unref(setTimeout(mine, minerInterval, this.transactions.transactionPool.executables)); } miner.on("block", async (blockData: any) => { @@ -159,6 +179,24 @@ export default class Blockchain extends Emittery { }); } + #isPaused = () => { + return (this.#state & Status.paused) !== 0; + } + pause() { + this.#state |= Status.paused; + this.emit("pause"); + } + + resume(threads: number = 1) { + if (!this.#isPaused()) { + console.log("Warning: startMining called when miner was already started"); + return; + } + // toggles the `paused` bit + this.#state ^= Status.paused; + this.emit("resume"); + } + createVmFromStateTrie = (stateTrie: CheckpointTrie, hardfork: string, allowUnlimitedContractSize: boolean): any => { const common = Common.forCustomChain( "mainnet", // TODO needs to match chain id @@ -181,7 +219,7 @@ export default class Blockchain extends Emittery { const hash = await this.#blockNumberToHash(number); done(this.blocks.get(hash)); } - } + } as any }); vm.on("step", this.emit.bind(this, "step")); return vm; @@ -202,7 +240,7 @@ export default class Blockchain extends Emittery { pendingAccounts[i] = putAccount(account.address.toBuffer(), ethereumJsAccount); } await Promise.all(pendingAccounts); - return commit(); + await commit(); }; #initializeGenesisBlock = async (timestamp: Date, blockGasLimit: Quantity): Promise => { diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts index ad1f06bed0..b424fc9ad4 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -15,7 +15,7 @@ export default class TransactionManager extends Manager { super(blockchain, base, Transaction); this.transactionPool = new TransactionPool(blockchain, options); - this.transactionPool.on("drain", (transactions: Map>) => { + this.transactionPool.on("drain", (transactions) => { // TODO: create pending block? }); } diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index b428dac490..5b301e0dcf 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -21,7 +21,7 @@ function byNonce(values: Transaction[], a: number, b: number) { return (Quantity.from(values[b].nonce).toBigInt() || 0n) > (Quantity.from(values[a].nonce).toBigInt() || 0n); } -export default class TransactionPool extends Emittery.Typed<{drain: (transactions: Map>) => void}> { +export default class TransactionPool extends Emittery.Typed<{drain: (transactions: {executables: Map>, timestamp?: number, maxTransactions: number}) => void}> { #options: TransactionPoolOptions; /** @@ -53,8 +53,8 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction const from = Data.from(transaction.from); let transactionNonce: bigint; - if (secretKey === null || transaction.nonce.length !== 0) { - transactionNonce = Quantity.from(transaction.nonce).toBigInt() || 0n;; + if (secretKey == null || transaction.nonce.length !== 0) { + transactionNonce = Quantity.from(transaction.nonce).toBigInt() || 0n; if (transactionNonce < 0n) { throw new Error("Transaction nonce cannot be negative."); } @@ -63,6 +63,15 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction const origin = from.toString(); const origins = this.#origins; let queuedOrigin = origins.get(origin); + + // since we don't have any pending transactions for this account + // verify the transaction's nonce is valid against the persisted account + // Note: we need to lock on this async request to ensure we always process + // incoming requests in the order they were received! It is possible for + // the file IO performed by `accounts.get` to vary. + let transactorPromise = this.#accountPromises.get(origin); + transactorPromise && await transactorPromise; + let highestNonce = 0n; let queuedOriginTransactions: utils.Heap; if (queuedOrigin) { @@ -73,7 +82,6 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction let isExecutableTransaction = false; const executables = this.executables; let executableOriginTransactions = executables.get(origin); - let transactor: Account; let length: number; if (executableOriginTransactions && (length = executableOriginTransactions.length)) { @@ -124,12 +132,6 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction highestNonce = transactionNonce; } } else { - // since we don't have any pending transactions for this account - // verify the transaction's nonce is valid against the persisted account - // Note: we need to lock on this async request to ensure we always process - // incoming requests in the order they were received! It is possible for - // the file IO performed by `accounts.get` to vary. - let transactorPromise = this.#accountPromises.get(origin); if (!transactorPromise) { transactorPromise = this.#blockchain.accounts.get(from) this.#accountPromises.set(origin, transactorPromise); @@ -137,9 +139,9 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction this.#accountPromises.delete(origin); }); } - transactor = await transactorPromise; + const transactor = await transactorPromise; - const transactorNonce = transactor.nonce.toBigInt(); + const transactorNonce = transactor.nonce.toBigInt() || 0n; if (secretKey && transactionNonce === void 0) { // if we don't have a transactionNonce, just use the account's next // nonce and mark as executable @@ -147,9 +149,11 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction highestNonce = transactionNonce; isExecutableTransaction = true; transaction.nonce = Quantity.from(transactionNonce).toBuffer(); - } else if (transactionNonce <= transactorNonce) { + } else if (transactionNonce < transactorNonce) { // it's an error if the transaction's nonce is <= the persisted nonce throw new Error("Transaction nonce is too low"); + } else if (transactionNonce === transactorNonce) { + isExecutableTransaction = true; } } @@ -228,9 +232,13 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction // notify listeners (the miner, probably) that we have executable // transactions ready for it - this.emit("drain", this.executables); + this.drain(); }; + drain(maxTransactions?: number, timestamp?: number) { + return this.emit("drain", {executables: this.executables, timestamp, maxTransactions}); + } + validateTransaction = (transaction: Transaction): Error => { // Check the transaction doesn't exceed the current block limit gas. if (this.#options.gasLimit < Quantity.from(transaction.gasLimit)) { diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index d01c02eca1..b5dfe4c3d1 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -74,7 +74,7 @@ export default class Miner extends Emittery { * * @param maxTransactions: number maximum number of transactions per block. If `0`, unlimited. */ - public async mine(pending: Map>, block: Block, maxTransactions: number) { + public async mine(pending: Map>, block: Block, maxTransactions: number = 0) { // only allow mining a single block at a time (per miner) if (this.#isMining) { // if we are currently mining a block, set the `pending` property @@ -172,8 +172,7 @@ export default class Miner extends Emittery { const runArgs = { tx: best as any, - block, - skipNonce: true + block }; // Set a transaction-level checkpoint so we can undo state changes in // the case where the transaction is rejected by the VM. @@ -260,11 +259,13 @@ export default class Miner extends Emittery { block = this.#createNextBlock(block); this.#currentlyExecutingPrice = 0n; } else { - // don't save an empty block // TODO: should we allow save an empty block?! I think we should // sometimes save an empty block, but not always? Hmmmmm. Interesting. - // Probably a breaking change here? AAaAaaAaah. - this.#revert(); + + // Save this empty block + await this.#commit(); + + this.emit("block", blockData); // reset the miner this.#reset(); diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index b262471c08..e4c68b4a25 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -27,6 +27,7 @@ export default class TransactionReceipt { } public toJSON(block: Block, transaction: Transaction) { const raw = this.#raw; + const contractAddress = Data.from(this.#contractAddress).toJSON() return { transactionHash: Data.from(transaction.hash()), transactionIndex: Quantity.from((transaction as any)._index), @@ -34,10 +35,11 @@ export default class TransactionReceipt { blockHash: Data.from(block.value.hash()), cumulativeGasUsed: Quantity.from(block.value.header.gasUsed), gasUsed: Quantity.from(raw[1]), - contractAddress: Data.from(this.#contractAddress), + contractAddress: contractAddress === "0x" ? null : contractAddress, logs: raw[3], // TODO: figure this out logsBloom: Data.from(raw[2], 256), - status: Quantity.from(raw[0]) + // flips a `1` to a `0` and a `0` to a `1` using Bitwise XOR for funsies. + status: 1 ^ raw[0][0] }; } } From dfa6442c04eb2c236ee150e02c48b29bd30ee3b9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 11 Jun 2020 17:04:32 -0400 Subject: [PATCH 242/691] improve var name of web3_sha3 rpc --- src/chains/ethereum/src/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 66421aad38..9d74498530 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -123,11 +123,11 @@ export default class EthereumApi implements types.Api { /** * Returns Keccak-256 (not the standardized SHA3-256) of the given data. - * @param {string} the data to convert into a SHA3 hash. + * @param {data} the data to convert into a SHA3 hash. * @returns The SHA3 result of the given string. */ - async web3_sha3(string: string): Promise { - return Data.from(createKeccakHash("keccak256").update(string).digest()); + async web3_sha3(data: string): Promise { + return Data.from(createKeccakHash("keccak256").update(data).digest()); } //#endregion From 90ee437405fdfd216d29b7ce32b28622ab7bd44e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 11 Jun 2020 18:16:47 -0400 Subject: [PATCH 243/691] Don't mind an empty block after a successful one --- src/chains/ethereum/src/miner.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index b5dfe4c3d1..b735d2e36f 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -22,9 +22,10 @@ function replaceFromHeap( // replace it with the account's next lowest nonce transaction: priced.replaceBest(next); next.locked = true; + return true; } else { // since we don't have a next, just remove this item from priced - priced.removeBest(); + return priced.removeBest(); } } @@ -205,33 +206,33 @@ export default class Miner extends Emittery { const pendingOrigin = pending.get(origin); // since this transaction was successful, remove it from the "pending" // transaction pool. - const accountHasMoreTransactions = pendingOrigin.removeBest(); + keepMining = pendingOrigin.removeBest(); // if we: // * don't have enough gas left for even the smallest of transactions // * Or if we've mined enough transactions // we're done with this block! if (blockGasLeft <= params.TRANSACTION_GAS || numTransactions === maxTransactions) { - if (accountHasMoreTransactions) { + if (keepMining) { // remove the newest (`best`) tx from this account's pending queue // as we know we can fit another transaction in the block. Stick // this tx into our `priced` heap. - replaceFromHeap(priced, pendingOrigin); + keepMining = replaceFromHeap(priced, pendingOrigin); } else { - priced.removeBest(); + keepMining = priced.removeBest(); } break; } - if (accountHasMoreTransactions) { + if (keepMining) { // remove the newest (`best`) tx from this account's pending queue // as we know we can fit another transaction in the block. Stick // this tx into our `priced` heap. - replaceFromHeap(priced, pendingOrigin); + keepMining = replaceFromHeap(priced, pendingOrigin); } else { // since we don't have any more txs from this account, just get the // next bext transaction sorted in our `priced` heap. - priced.removeBest(); + keepMining = priced.removeBest(); } } else { await this.#revert(); @@ -243,12 +244,12 @@ export default class Miner extends Emittery { // didn't fit. remove it from the priced transactions without replacing // it with another from the account. This transaction will have to be // run again in another block. - priced.removeBest(); + keepMining = priced.removeBest(); } } // if we mined anything, keep mining. - keepMining = numTransactions !== 0; + keepMining = keepMining && numTransactions !== 0; if (keepMining) { await Promise.all(promises); await this.#commit(); From 81c0222237bbb1c94c081c13789436171b16dd31 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 11 Jun 2020 20:28:18 -0400 Subject: [PATCH 244/691] fix typo in comment --- src/packages/core/__tests__/connector.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/core/__tests__/connector.ts b/src/packages/core/__tests__/connector.ts index c26c38fa85..8f65b8aa2f 100644 --- a/src/packages/core/__tests__/connector.ts +++ b/src/packages/core/__tests__/connector.ts @@ -29,8 +29,8 @@ describe("connector", () => { it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { const p = Ganache.provider() as EthereumProvider; const accounts = await p.send("eth_accounts"); - // eth_accounts should always be faster than eth_getBalance; eth_accounts - // shouldreturn before eth_getBalance because of the + // `eth_accounts` should always be faster than eth_getBalance; eth_accounts + // should return before eth_getBalance because of the // `asyncRequestProcessing` flag. const calA = p.send("eth_getBalance", [accounts[0]]); const callB = p.send("eth_accounts"); From da7e7ea8905d4c2af50aab317240b1bd517e4bf0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 12 Jun 2020 11:23:38 -0400 Subject: [PATCH 245/691] update lerna and mocha --- npm-shrinkwrap.json | 1878 +++++++++++++++++++++++-------------------- package.json | 6 +- 2 files changed, 1000 insertions(+), 884 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7c510eec43..72122f6fe6 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4,28 +4,28 @@ "lockfileVersion": 1, "dependencies": { "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", "dev": true, "requires": { - "@babel/highlight": "^7.8.3" + "@babel/highlight": "^7.10.1" } }, "@babel/core": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.6.tgz", - "integrity": "sha512-nD3deLvbsApbHAHttzIssYqgb883yU/d9roe4RZymBCDaZryMJDbptVpEpeQuRh4BJ+SYI8le9YGxKvFEvl1Wg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.6", - "@babel/parser": "^7.9.6", - "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.2.tgz", + "integrity": "sha512-KQmV9yguEjQsXqyOUGKjS4+3K8/DlOCE2pZcq4augdQmtTy5iv5EHtmMSJ7V4c1BIPjuwtZYqYLCq9Ga+hGBRQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.2", + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helpers": "^7.10.1", + "@babel/parser": "^7.10.2", + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.2", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -34,204 +34,182 @@ "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } } }, "@babel/generator": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", - "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz", + "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==", "dev": true, "requires": { - "@babel/types": "^7.9.6", + "@babel/types": "^7.10.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, "@babel/helper-function-name": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", - "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.1.tgz", + "integrity": "sha512-fcpumwhs3YyZ/ttd5Rz0xn0TpIwVkN7X0V38B9TWNfVF42KEkhkAAuPCQ3oXmtTRtiPJrmZ0TrfS0GKF0eMaRQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.9.5" + "@babel/helper-get-function-arity": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.1.tgz", + "integrity": "sha512-F5qdXkYGOQUb0hpRaPoetF9AnsXknKjWMZ+wmsIRsp5ge5sFh4c3h1eH2pRTTuy9KKAA2+TTYomGXAtEL2fQEw==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.1.tgz", + "integrity": "sha512-u7XLXeM2n50gb6PWJ9hoO5oO7JFPaZtrh35t8RqKLT1jFKj9IWeD1zrcrYp1q1qiZTdEarfDWfTIP8nGsu0h5g==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.1.tgz", + "integrity": "sha512-SFxgwYmZ3HZPyZwJRiVNLRHWuW2OgE5k2nrVs6D9Iv4PPnXVffuEHy83Sfx/l4SqF+5kyJXjAyUmrG7tNm+qVg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-module-transforms": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", - "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.1.tgz", + "integrity": "sha512-RLHRCAzyJe7Q7sF4oy2cB+kRnU4wDZY/H2xJFGof+M+SJEGhZsb+GFj5j1AD8NiSaVBJ+Pf0/WObiXu/zxWpFg==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.6", - "@babel/types": "^7.9.0", + "@babel/helper-module-imports": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1", + "@babel/helper-simple-access": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1", "lodash": "^4.17.13" } }, "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.1.tgz", + "integrity": "sha512-a0DjNS1prnBsoKx83dP2falChcs7p3i8VMzdrSbfLhuQra/2ENC4sbri34dz/rWmDADsmF1q5GbfaXydh0Jbjg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-replace-supers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.9.6.tgz", - "integrity": "sha512-qX+chbxkbArLyCImk3bWV+jB5gTNU/rsze+JlcF6Nf8tVTigPJSI1o1oBow/9Resa1yehUO9lIipsmu9oG4RzA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.1.tgz", + "integrity": "sha512-SOwJzEfpuQwInzzQJGjGaiG578UYmyi2Xw668klPWV5n07B73S0a9btjLk/52Mlcxa+5AdIYqws1KyXRfMoB7A==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" + "@babel/helper-member-expression-to-functions": "^7.10.1", + "@babel/helper-optimise-call-expression": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.1.tgz", + "integrity": "sha512-VSWpWzRzn9VtgMJBIWTZ+GP107kZdQ4YplJlCmIrjoLVSi/0upixezHCDG8kpPVTBJpKfxTH01wDhh+jS2zKbw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz", + "integrity": "sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", "dev": true }, "@babel/helpers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.6.tgz", - "integrity": "sha512-tI4bUbldloLcHWoRUMAj4g1bF313M/o6fBKhIsb3QnGVPwRm9JsNf/gqMkQ7zjqReABiffPV6RWj7hEglID5Iw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.1.tgz", + "integrity": "sha512-muQNHF+IdU6wGgkaJyhhEmI54MOZBKsFfsXFhboz1ybwJ1Kl7IHlbm2a++4jwrmY5UYsgitt5lfqo1wMFcHmyw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.1", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", - "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz", + "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ==", "dev": true }, "@babel/template": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", - "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6" + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/traverse": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", - "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.1.tgz", + "integrity": "sha512-C/cTuXeKt85K+p08jN6vMDz8vSV0vZcI0wmQ36o6mjbuo++kPMdpOYw23W2XH04dbRt9/nMEfA4W3eR21CD+TQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.6", - "@babel/types": "^7.9.6", + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.1", + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } } }, "@babel/types": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", - "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz", + "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.5", + "@babel/helper-validator-identifier": "^7.10.1", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -265,6 +243,12 @@ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -308,6 +292,12 @@ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -343,14 +333,11 @@ "safe-buffer": "^5.1.2" }, "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true }, "npm-package-arg": { "version": "6.1.1", @@ -409,14 +396,11 @@ "which": "^1.3.1" }, "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true }, "npm-package-arg": { "version": "6.1.1", @@ -448,13 +432,14 @@ } }, "@istanbuljs/load-nyc-config": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", - "integrity": "sha512-ZR0rq/f/E4f4XcgnDvtMWXCUJpi8eO0rssVhmztsZqLIEFA9UUP9zmpE0VxlM+kv/E1ul2I876Fwil2ayptDVg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "requires": { "camelcase": "^5.3.1", "find-up": "^4.1.0", + "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" }, @@ -540,6 +525,12 @@ "semver": "^6.2.0" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -599,6 +590,45 @@ "semver": "^6.2.0" }, "dependencies": { + "array-differ": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", + "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "multimatch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", + "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", + "dev": true, + "requires": { + "array-differ": "^2.0.3", + "array-union": "^1.0.2", + "arrify": "^1.0.1", + "minimatch": "^3.0.4" + } + }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -786,9 +816,9 @@ } }, "@lerna/conventional-commits": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-3.18.5.tgz", - "integrity": "sha512-qcvXIEJ3qSgalxXnQ7Yxp5H9Ta5TVyai6vEor6AAEHc20WiO7UIdbLDCxBtiiHMdGdpH85dTYlsoYUwsCJu3HQ==", + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-3.22.0.tgz", + "integrity": "sha512-z4ZZk1e8Mhz7+IS8NxHr64wyklHctCJyWpJKEZZPJiLFJ8yKto/x38O80R10pIzC0rr8Sy/OsjSH4bl0TbbgqA==", "dev": true, "requires": { "@lerna/validation-error": "3.13.0", @@ -815,6 +845,12 @@ "universalify": "^0.1.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -859,9 +895,9 @@ } }, "@lerna/create": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.21.0.tgz", - "integrity": "sha512-cRIopzKzE2vXJPmsiwCDMWo4Ct+KTmX3nvvkQLDoQNrrRK7w+3KQT3iiorbj1koD95RsVQA7mS2haWok9SIv0g==", + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.22.0.tgz", + "integrity": "sha512-MdiQQzCcB4E9fBF1TyMOaAEz9lUjIHp1Ju9H7f3lXze5JK6Fl5NYkouAvsLgY6YSIhXMY8AHW2zzXeBDY4yWkw==", "dev": true, "requires": { "@evocateur/pacote": "^9.6.3", @@ -901,6 +937,12 @@ "universalify": "^0.1.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1042,6 +1084,41 @@ "@lerna/validation-error": "3.13.0", "multimatch": "^3.0.0", "npmlog": "^4.1.2" + }, + "dependencies": { + "array-differ": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", + "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "multimatch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", + "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", + "dev": true, + "requires": { + "array-differ": "^2.0.3", + "array-union": "^1.0.2", + "arrify": "^1.0.1", + "minimatch": "^3.0.4" + } + } } }, "@lerna/get-npm-exec-opts": { @@ -1093,13 +1170,13 @@ } }, "@lerna/github-client": { - "version": "3.16.5", - "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-3.16.5.tgz", - "integrity": "sha512-rHQdn8Dv/CJrO3VouOP66zAcJzrHsm+wFuZ4uGAai2At2NkgKH+tpNhQy2H1PSC0Ezj9LxvdaHYrUzULqVK5Hw==", + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-3.22.0.tgz", + "integrity": "sha512-O/GwPW+Gzr3Eb5bk+nTzTJ3uv+jh5jGho9BOqKlajXaOkMYGBELEAqV5+uARNGWZFvYAiF4PgqHb6aCUu7XdXg==", "dev": true, "requires": { "@lerna/child-process": "3.16.5", - "@octokit/plugin-enterprise-rest": "^3.6.1", + "@octokit/plugin-enterprise-rest": "^6.0.1", "@octokit/rest": "^16.28.4", "git-url-parse": "^11.1.2", "npmlog": "^4.1.2" @@ -1141,9 +1218,9 @@ } }, "@lerna/import": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.21.0.tgz", - "integrity": "sha512-aISkL4XD0Dqf5asDaOZWu65jgj8fWUhuQseZWuQe3UfHxav69fTS2YLIngUfencaOSZVOcVCom28YCzp61YDxw==", + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.22.0.tgz", + "integrity": "sha512-uWOlexasM5XR6tXi4YehODtH9Y3OZrFht3mGUFFT3OIl2s+V85xIGFfqFGMTipMPAGb2oF1UBLL48kR43hRsOg==", "dev": true, "requires": { "@lerna/child-process": "3.16.5", @@ -1307,6 +1384,12 @@ "npmlog": "^4.1.2" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -1353,6 +1436,12 @@ "universalify": "^0.1.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1416,6 +1505,12 @@ "universalify": "^0.1.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1508,6 +1603,12 @@ "write-pkg": "^3.1.0" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -1541,6 +1642,12 @@ "semver": "^6.2.0" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -1657,9 +1764,9 @@ } }, "@lerna/publish": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.21.0.tgz", - "integrity": "sha512-JZ+ehZB9UCQ9nqH8Ld/Yqc/If++aK/7XIubkrB9sQ5hf2GeIbmI/BrJpMgLW/e9T5bKrUBZPUvoUN3daVipA5A==", + "version": "3.22.1", + "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.22.1.tgz", + "integrity": "sha512-PG9CM9HUYDreb1FbJwFg90TCBQooGjj+n/pb3gw/eH5mEDq0p8wKdLFe0qkiqUkm/Ub5C8DbVFertIo0Vd0zcw==", "dev": true, "requires": { "@evocateur/libnpmaccess": "^3.1.2", @@ -1683,7 +1790,7 @@ "@lerna/run-lifecycle": "3.16.2", "@lerna/run-topologically": "3.18.5", "@lerna/validation-error": "3.13.0", - "@lerna/version": "3.21.0", + "@lerna/version": "3.22.1", "figgy-pudding": "^3.5.1", "fs-extra": "^8.1.0", "npm-package-arg": "^6.1.0", @@ -1705,6 +1812,12 @@ "universalify": "^0.1.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1957,17 +2070,17 @@ } }, "@lerna/version": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.21.0.tgz", - "integrity": "sha512-nIT3u43fCNj6uSMN1dRxFnF4GhmIiOEqSTkGSjrMU+8kHKwzOqS/6X6TOzklBmCyEZOpF/fLlGqH3BZHnwLDzQ==", + "version": "3.22.1", + "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.22.1.tgz", + "integrity": "sha512-PSGt/K1hVqreAFoi3zjD0VEDupQ2WZVlVIwesrE5GbrL2BjXowjCsTDPqblahDUPy0hp6h7E2kG855yLTp62+g==", "dev": true, "requires": { "@lerna/check-working-tree": "3.16.5", "@lerna/child-process": "3.16.5", "@lerna/collect-updates": "3.20.0", "@lerna/command": "3.21.0", - "@lerna/conventional-commits": "3.18.5", - "@lerna/github-client": "3.16.5", + "@lerna/conventional-commits": "3.22.0", + "@lerna/github-client": "3.22.0", "@lerna/gitlab-client": "3.15.0", "@lerna/output": "3.13.0", "@lerna/prerelease-id-from-version": "3.16.0", @@ -2026,20 +2139,12 @@ "requires": { "@nodelib/fs.stat": "2.0.3", "run-parallel": "^1.1.9" - }, - "dependencies": { - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true - } } }, "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", "dev": true }, "@nodelib/fs.walk": { @@ -2053,21 +2158,21 @@ } }, "@octokit/auth-token": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.0.tgz", - "integrity": "sha512-eoOVMjILna7FVQf96iWc3+ZtE/ZT6y8ob8ZzcqKY1ibSQCnu4O/B7pJvzMx5cyZ/RjAff6DAdEb0O0Cjcxidkg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", + "integrity": "sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==", "dev": true, "requires": { - "@octokit/types": "^2.0.0" + "@octokit/types": "^5.0.0" } }, "@octokit/endpoint": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.1.tgz", - "integrity": "sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.3.tgz", + "integrity": "sha512-Y900+r0gIz+cWp6ytnkibbD95ucEzDSKzlEnaWS52hbCDNcCJYO5mRmWW7HRAnDc7am+N/5Lnd8MppSaTYx1Yg==", "dev": true, "requires": { - "@octokit/types": "^2.11.1", + "@octokit/types": "^5.0.0", "is-plain-object": "^3.0.0", "universal-user-agent": "^5.0.0" }, @@ -2099,9 +2204,9 @@ } }, "@octokit/plugin-enterprise-rest": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-3.6.2.tgz", - "integrity": "sha512-3wF5eueS5OHQYuAEudkpN+xVeUsg8vYEMMenEzLphUZ7PRZ8OJtDcsreL3ad9zxXmBbaFWzLmFcdob5CLyZftA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz", + "integrity": "sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw==", "dev": true }, "@octokit/plugin-paginate-rest": { @@ -2111,6 +2216,17 @@ "dev": true, "requires": { "@octokit/types": "^2.0.1" + }, + "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } } }, "@octokit/plugin-request-log": { @@ -2127,17 +2243,28 @@ "requires": { "@octokit/types": "^2.0.1", "deprecation": "^2.3.1" + }, + "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } } }, "@octokit/request": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz", - "integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.5.tgz", + "integrity": "sha512-atAs5GAGbZedvJXXdjtKljin+e2SltEs48B3naJjqWupYl2IUBbB/CJisyjbNHcKpHzb3E+OYEZ46G8eakXgQg==", "dev": true, "requires": { "@octokit/endpoint": "^6.0.1", "@octokit/request-error": "^2.0.0", - "@octokit/types": "^2.11.1", + "@octokit/types": "^5.0.0", "deprecation": "^2.0.0", "is-plain-object": "^3.0.0", "node-fetch": "^2.3.0", @@ -2146,14 +2273,25 @@ }, "dependencies": { "@octokit/request-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz", - "integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.1.tgz", + "integrity": "sha512-5lqBDJ9/TOehK82VvomQ6zFiZjPeSom8fLkFVLuYL3sKiIb5RB8iN/lenLkY7oBmyQcGP7FBMGiIZTO8jufaRQ==", "dev": true, "requires": { - "@octokit/types": "^2.0.0", + "@octokit/types": "^4.0.1", "deprecation": "^2.0.0", "once": "^1.4.0" + }, + "dependencies": { + "@octokit/types": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-4.1.10.tgz", + "integrity": "sha512-/wbFy1cUIE5eICcg0wTKGXMlKSbaAxEr00qaBXzscLXpqhcwgXeS6P8O0pkysBhRfyjkKjJaYrvR1ExMO5eOXQ==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } } }, "is-plain-object": { @@ -2191,6 +2329,17 @@ "@octokit/types": "^2.0.0", "deprecation": "^2.0.0", "once": "^1.4.0" + }, + "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } } }, "@octokit/rest": { @@ -2218,9 +2367,9 @@ } }, "@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.0.0.tgz", + "integrity": "sha512-3LVS+MbeqwSd5G4KS8123cZz+hWomsiGeMnQ/QJIBFDwL/YHX8kkr0FZXrgWEMO7Fgi2/VOrhbiFnk9sZ+s4qA==", "dev": true, "requires": { "@types/node": ">= 8" @@ -2240,62 +2389,6 @@ "typescript": "~3.8.2" }, "dependencies": { - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true - }, - "array-differ": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", - "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fast-glob": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", - "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -2307,12 +2400,6 @@ "universalify": "^0.1.0" } }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -2322,38 +2409,6 @@ "graceful-fs": "^4.1.6" } }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "multimatch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", - "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", - "dev": true, - "requires": { - "@types/minimatch": "^3.0.3", - "array-differ": "^3.0.0", - "array-union": "^2.1.0", - "arrify": "^2.0.1", - "minimatch": "^3.0.4" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "typescript": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", @@ -2404,12 +2459,11 @@ } }, "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-VgNIkxK+j7Nz5P7jvUZlRvhuPSmsEfS03b0alKcq5V/STUKAa3Plemsn5mrQUO7am6OErJ4rhGEGJbACclrtRA==", "dev": true, "requires": { - "@types/events": "*", "@types/minimatch": "*", "@types/node": "*" } @@ -2529,12 +2583,6 @@ "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", "dev": true }, - "@yarnpkg/lockfile": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", - "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", - "dev": true - }, "@zkochan/cmd-shim": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", @@ -2611,9 +2659,9 @@ } }, "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-escapes": { @@ -2756,9 +2804,9 @@ "dev": true }, "array-differ": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", - "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", "dev": true }, "array-find-index": { @@ -2774,13 +2822,10 @@ "dev": true }, "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true }, "array-uniq": { "version": "1.0.3", @@ -2794,10 +2839,22 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, + "array.prototype.map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", + "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.4" + } + }, "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true }, "asap": { @@ -2874,9 +2931,9 @@ "dev": true }, "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", + "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", "dev": true }, "balanced-match": { @@ -3037,32 +3094,12 @@ } }, "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "fill-range": "^7.0.1" } }, "brorand": { @@ -3181,17 +3218,6 @@ "ssri": "^6.0.1", "unique-filename": "^1.1.1", "y18n": "^4.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - } } }, "cache-base": { @@ -3339,54 +3365,19 @@ } }, "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", "dev": true, "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.1", + "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } + "readdirp": "~3.3.0" } }, "chownr": { @@ -3579,11 +3570,10 @@ "dev": true }, "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "optional": true + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true }, "commondir": { "version": "1.0.1", @@ -3592,9 +3582,9 @@ "dev": true }, "compare-func": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz", - "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", + "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", "dev": true, "requires": { "array-ify": "^1.0.0", @@ -3824,6 +3814,12 @@ "q": "^1.5.1" }, "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -4022,9 +4018,9 @@ } }, "cross-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", - "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -4072,20 +4068,12 @@ "dev": true }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "ms": "^2.1.1" } }, "debuglog": { @@ -4270,9 +4258,9 @@ } }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "dir-glob": { @@ -4514,6 +4502,35 @@ } } }, + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", + "dev": true + }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "dev": true, + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -4849,14 +4866,6 @@ "safe-buffer": "^5.1.0" } }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" - } - }, "secp256k1": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", @@ -5378,46 +5387,23 @@ } }, "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", "dev": true, "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - }, - "dependencies": { - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - } + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" } }, "fast-json-stable-stringify": { @@ -5462,26 +5448,12 @@ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "to-regex-range": "^5.0.1" } }, "find-cache-dir": { @@ -5564,44 +5536,6 @@ "locate-path": "^3.0.0" } }, - "find-yarn-workspace-root": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz", - "integrity": "sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==", - "dev": true, - "requires": { - "fs-extra": "^4.0.3", - "micromatch": "^3.1.4" - }, - "dependencies": { - "fs-extra": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", - "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, "flat": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", @@ -5695,13 +5629,13 @@ "dev": true }, "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, @@ -5901,6 +5835,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "get-pkg-repo": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", @@ -5940,6 +5880,12 @@ "pinkie-promise": "^2.0.0" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "indent-string": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", @@ -6127,6 +6073,12 @@ "through2": "^2.0.0" }, "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -6241,6 +6193,12 @@ "semver": "^6.0.0" }, "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -6409,6 +6367,161 @@ "ignore": "^4.0.3", "pify": "^4.0.1", "slash": "^2.0.0" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "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" + } + }, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } } }, "graceful-fs": { @@ -6512,6 +6625,26 @@ "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=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", @@ -6615,10 +6748,13 @@ } }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.4.tgz", + "integrity": "sha512-4oT62d2jwSDBbLLFLZE+1vPuQ1h8p9wjrJ8Mqx5TjsyWmBMV5B13eJqn8pvluqubLf3cJPTfiYCIwNwDNmzScQ==", + "dev": true, + "requires": { + "lru-cache": "^5.1.1" + } }, "html-escaper": { "version": "2.0.2", @@ -6640,6 +6776,23 @@ "requires": { "agent-base": "4", "debug": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "http-signature": { @@ -6661,6 +6814,17 @@ "requires": { "agent-base": "^4.3.0", "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } } }, "humanize-ms": { @@ -6794,6 +6958,12 @@ "validate-npm-package-name": "^3.0.0" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -6935,6 +7105,12 @@ } } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -7061,6 +7237,12 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", + "dev": true + }, "is-negated-glob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", @@ -7068,24 +7250,10 @@ "dev": true }, "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-obj": { "version": "1.0.1", @@ -7125,6 +7293,12 @@ "is-unc-path": "^1.0.0" } }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", + "dev": true + }, "is-ssh": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.1.tgz", @@ -7140,6 +7314,12 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -7346,15 +7526,6 @@ "source-map": "^0.6.1" }, "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -7373,6 +7544,22 @@ "istanbul-lib-report": "^3.0.0" } }, + "iterate-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", + "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==", + "dev": true + }, + "iterate-value": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", + "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", + "dev": true, + "requires": { + "es-get-iterator": "^1.0.2", + "iterate-iterator": "^1.0.1" + } + }, "js-sha3": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", @@ -7385,9 +7572,9 @@ "dev": true }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -7500,19 +7687,10 @@ "graceful-fs": "^4.1.9" } }, - "klaw-sync": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", - "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11" - } - }, "lerna": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.21.0.tgz", - "integrity": "sha512-ux8yOwQEgIXOZVUfq+T8nVzPymL19vlIoPbysOP3YA4hcjKlqQIlsjI/1ugBe6b4MF7W4iV5vS3gH9cGqBBc1A==", + "version": "3.22.1", + "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.22.1.tgz", + "integrity": "sha512-vk1lfVRFm+UuEFA7wkLKeSF7Iz13W+N/vFd48aW2yuS7Kv0RbNm2/qcDPV863056LMfkRlsEe+QYOw3palj5Lg==", "dev": true, "requires": { "@lerna/add": "3.21.0", @@ -7520,17 +7698,17 @@ "@lerna/changed": "3.21.0", "@lerna/clean": "3.21.0", "@lerna/cli": "3.18.5", - "@lerna/create": "3.21.0", + "@lerna/create": "3.22.0", "@lerna/diff": "3.21.0", "@lerna/exec": "3.21.0", - "@lerna/import": "3.21.0", + "@lerna/import": "3.22.0", "@lerna/info": "3.21.0", "@lerna/init": "3.21.0", "@lerna/link": "3.21.0", "@lerna/list": "3.21.0", - "@lerna/publish": "3.21.0", + "@lerna/publish": "3.22.1", "@lerna/run": "3.21.0", - "@lerna/version": "3.21.0", + "@lerna/version": "3.22.1", "import-local": "^2.0.0", "npmlog": "^4.1.2" } @@ -7960,6 +8138,14 @@ "signal-exit": "^3.0.0" } }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, "ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", @@ -8011,17 +8197,6 @@ "promise-retry": "^1.1.1", "socks-proxy-agent": "^4.0.0", "ssri": "^6.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - } } }, "map-cache": { @@ -8102,12 +8277,6 @@ "yargs-parser": "^18.1.3" }, "dependencies": { - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true - }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -8346,24 +8515,13 @@ "dev": true }, "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", "dev": true, "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" + "braces": "^3.0.1", + "picomatch": "^2.0.5" } }, "miller-rabin": { @@ -8410,9 +8568,9 @@ "dev": true }, "min-indent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz", - "integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true }, "minimalistic-assert": { @@ -8440,13 +8598,22 @@ "dev": true }, "minimist-options": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.0.2.tgz", - "integrity": "sha512-seq4hpWkYSUh1y7NXxzucwAN9yVlBc3Upgdjz8vLCP97jG8kaOmzYrVH/m7tQ1NYD1wdtZbSLfdy4zFmRWuc/w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", "dev": true, "requires": { "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "dependencies": { + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + } } }, "minipass": { @@ -8526,32 +8693,33 @@ } }, "mocha": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.2.tgz", - "integrity": "sha512-o96kdRKMKI3E8U0bjnfqW4QMk12MwZ4mhdBTf+B5a1q9+aq2HRnj+3ZdJu0B/ZhJeK78MgYuv6L8d/rA5AeBJA==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", + "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", "dev": true, "requires": { - "ansi-colors": "3.2.3", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.0", + "chokidar": "3.3.1", "debug": "3.2.6", - "diff": "3.5.0", + "diff": "4.0.2", "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "find-up": "4.1.0", + "glob": "7.1.6", "growl": "1.10.5", "he": "1.2.0", "js-yaml": "3.13.1", "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.5", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", + "ms": "2.1.2", "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", + "promise.allsettled": "1.0.2", + "serialize-javascript": "3.0.0", + "strip-json-comments": "3.0.1", + "supports-color": "7.1.0", + "which": "2.0.2", "wide-align": "1.1.3", + "workerpool": "6.0.0", "yargs": "13.3.2", "yargs-parser": "13.1.2", "yargs-unparser": "1.6.0" @@ -8569,39 +8737,69 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { - "ms": "^2.1.1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "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" + "p-locate": "^4.1.0" } }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "string-width": { @@ -8625,21 +8823,12 @@ } }, "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "isexe": "^2.0.0" + "has-flag": "^4.0.0" } }, "yargs": { @@ -8658,6 +8847,42 @@ "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^13.1.2" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } } }, "yargs-parser": { @@ -8699,14 +8924,15 @@ "dev": true }, "multimatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", - "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", "dev": true, "requires": { - "array-differ": "^2.0.3", - "array-union": "^1.0.2", - "arrify": "^1.0.1", + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", "minimatch": "^3.0.4" } }, @@ -8773,24 +8999,6 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.0.tgz", "integrity": "sha512-ASCL5U13as7HhOExbT6OlWJJUV/lLzL2voOSP1UVehpRD8FbSrSDjfScK/KwAvVTI5AS6r4VwbOMlIqtvRidnA==" }, - "node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", @@ -8809,9 +9017,9 @@ } }, "node-gyp": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.0.tgz", - "integrity": "sha512-OUTryc5bt/P8zVgNUmC6xdXiDJxLMAW8cF5tLQOT9E5sOQj+UeQxnnPy74K3CLCa/SOjjBlbuzDLR8ANwA+wmw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz", + "integrity": "sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw==", "dev": true, "requires": { "env-paths": "^2.2.0", @@ -8878,6 +9086,14 @@ "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + } } }, "normalize-path": { @@ -8945,24 +9161,6 @@ "validate-npm-package-name": "^3.0.0" }, "dependencies": { - "hosted-git-info": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.4.tgz", - "integrity": "sha512-4oT62d2jwSDBbLLFLZE+1vPuQ1h8p9wjrJ8Mqx5TjsyWmBMV5B13eJqn8pvluqubLf3cJPTfiYCIwNwDNmzScQ==", - "dev": true, - "requires": { - "lru-cache": "^5.1.1" - } - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", @@ -8993,6 +9191,12 @@ "semver": "^5.4.1" }, "dependencies": { + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -9498,112 +9702,6 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, - "patch-package": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.2.2.tgz", - "integrity": "sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg==", - "dev": true, - "requires": { - "@yarnpkg/lockfile": "^1.1.0", - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "find-yarn-workspace-root": "^1.2.1", - "fs-extra": "^7.0.1", - "is-ci": "^2.0.0", - "klaw-sync": "^6.0.0", - "minimist": "^1.2.0", - "rimraf": "^2.6.3", - "semver": "^5.6.0", - "slash": "^2.0.0", - "tmp": "^0.0.33" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -9746,6 +9844,19 @@ "retry": "^0.10.0" } }, + "promise.allsettled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", + "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", + "dev": true, + "requires": { + "array.prototype.map": "^1.0.1", + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "iterate-value": "^1.0.0" + } + }, "promzard": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", @@ -9833,9 +9944,9 @@ "dev": true }, "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", "dev": true }, "quick-lru": { @@ -10008,12 +10119,12 @@ } }, "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", "dev": true, "requires": { - "picomatch": "^2.0.4" + "picomatch": "^2.0.7" } }, "redent": { @@ -10092,6 +10203,25 @@ "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" + }, + "dependencies": { + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + } } }, "require-directory": { @@ -10291,6 +10421,12 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, + "serialize-javascript": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", + "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==", + "dev": true + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -10561,12 +10697,6 @@ "tmp": "0.0.33" }, "dependencies": { - "commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "dev": true - }, "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", @@ -10696,9 +10826,9 @@ } }, "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -10712,9 +10842,9 @@ "dev": true }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -10919,9 +11049,9 @@ } }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", "dev": true }, "strong-log-transformer": { @@ -11005,32 +11135,6 @@ "semver": "^6.3.0" }, "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "form-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", - "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", - "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", - "dev": true - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -11254,13 +11358,12 @@ } }, "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=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "^7.0.0" } }, "tough-cookie": { @@ -11327,9 +11430,9 @@ } }, "tslib": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.12.0.tgz", - "integrity": "sha512-5rxCQkP0kytf4H1T4xz1imjxaUUPMvc5aWp0rJ/VMIN7ClRiH1FwFvBt8wOeMasp/epeUnmSW6CixSIePtiLqA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, "tunnel-agent": { @@ -11379,13 +11482,22 @@ "from": "github:uNetworking/uWebSockets.js#v17.4.0" }, "uglify-js": { - "version": "3.9.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.3.tgz", - "integrity": "sha512-r5ImcL6QyzQGVimQoov3aL2ZScywrOgBXGndbWrdehKoSvGe/RmiE5Jpw/v+GvxODt6l2tpBXwA7n+qZVlHBMA==", + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.4.tgz", + "integrity": "sha512-8RZBJq5smLOa7KslsNsVcSH+KOXf1uDU8yqLeNuVKwmT0T3FA0ZoXlinQfRad7SDcbZZRZE4ov+2v71EnxNyCA==", "dev": true, "optional": true, "requires": { "commander": "~2.20.3" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + } } }, "uid-number": { @@ -11653,9 +11765,9 @@ } }, "windows-release": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz", - "integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.1.tgz", + "integrity": "sha512-Pngk/RDCaI/DkuHPlGTdIkDiTAnAkyMjoQMZqRsxydNl1qGXNIoZrB7RK8g53F2tEgQBMqQJHQdYZuQEEAu54A==", "dev": true, "requires": { "execa": "^1.0.0" @@ -11667,6 +11779,12 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "workerpool": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", + "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==", + "dev": true + }, "wrap-ansi": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", diff --git a/package.json b/package.json index 29e4162773..2254ed8380 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "hdkey": "1.1.2", "keccak": "3.0.0", "leveldown": "5.6.0", - "levelup": "4.4.0", "lodash.clonedeep": "4.5.0", "merkle-patricia-tree": "3.0.0", "secp256k1": "4.0.1", @@ -51,11 +50,10 @@ "cross-env": "7.0.2", "fs-extra": "9.0.0", "into-stream": "5.1.1", - "lerna": "3.21.0", - "mocha": "7.1.2", + "lerna": "3.22.1", + "mocha": "8.0.1", "npm-package-arg": "8.0.1", "nyc": "15.0.1", - "patch-package": "6.2.2", "prettier": "2.0.5", "solc": "0.6.7", "source-map-support": "0.5.19", From 5bd0716f10734b4258ec963f9cd2fa2fea9ed6d0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 12 Jun 2020 11:23:49 -0400 Subject: [PATCH 246/691] organize npm scripts --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2254ed8380..a8cab79005 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,11 @@ "npm": ">=6.1.0" }, "scripts": { - "tsc": "lerna exec -- npm run tsc", - "test": "lerna exec -- npm run test", + "clean": "npx shx rm -rf node_modules && lerna clean -y", "create": "ts-node ./scripts/create", - "postinstall": "patch-package && lerna bootstrap" + "postinstall": "npx patch-package && lerna bootstrap", + "tsc": "npx lerna exec -- npm run tsc", + "test": "npx lerna exec -- npm test" }, "dependencies": { "bip39": "3.0.2", From 6388e945ff5454610bf9b6fb3f3aa9c95266d50f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Jun 2020 17:04:35 -0400 Subject: [PATCH 247/691] Allow mining empty transactions --- src/chains/ethereum/src/miner.ts | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index b735d2e36f..af1fedd167 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -120,8 +120,8 @@ export default class Miner extends Emittery { #mineTxs = async (pending: Map>, block: Block, maxTransactions: number) => { let keepMining = true; const priced = this.#priced; - let o = ""; - while (keepMining) { + do { + keepMining = false; this.#isMining = true; let numTransactions = 0; @@ -167,7 +167,6 @@ export default class Miner extends Emittery { } const origin = Data.from(best.from).toString(); - o = origin; this.#currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); @@ -248,30 +247,21 @@ export default class Miner extends Emittery { } } - // if we mined anything, keep mining. - keepMining = keepMining && numTransactions !== 0; - if (keepMining) { - await Promise.all(promises); - await this.#commit(); - - this.emit("block", blockData); + await Promise.all(promises); + await this.#commit(); + this.emit("block", blockData); + if (priced.length !== 0) { maxTransactions = this.#options.instamine ? 1 : 0; block = this.#createNextBlock(block); this.#currentlyExecutingPrice = 0n; } else { - // TODO: should we allow save an empty block?! I think we should - // sometimes save an empty block, but not always? Hmmmmm. Interesting. - - // Save this empty block - await this.#commit(); - - this.emit("block", blockData); - // reset the miner this.#reset(); } } + while (keepMining); + return block; } From 4521e7817c54367064584205a8cd94c3986b061c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Jun 2020 17:27:55 -0400 Subject: [PATCH 248/691] Fix multi-tx test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index cfa78af362..9829fdb8db 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -36,12 +36,13 @@ describe("api", () => { to: accounts[1], value: 1 } - const blockNumber = await provider.request("eth_blockNumber"); + + const startingBlockNumber = parseInt(await provider.request("eth_blockNumber")); await provider.request("eth_subscribe", ["newHeads"]); await provider.request("eth_sendTransaction", [{...tx}]); await provider.once("message"); const blockx1 = await provider.request("eth_blockNumber"); - assert.strictEqual(parseInt(blockNumber, 10), blockx1 - 1); + assert.strictEqual(+blockx1, startingBlockNumber + 1); const awaitFor = (count) => new Promise(resolve => { let counter = 0; @@ -71,10 +72,10 @@ describe("api", () => { await wait; wait = awaitFor(4); const blockx5 = await provider.request("eth_blockNumber"); - assert.strictEqual(parseInt(blockNumber, 10), blockx5 - 5); + assert.strictEqual(+blockx5, startingBlockNumber + 5); await wait; const blockx9 = await provider.request("eth_blockNumber"); - assert.strictEqual(parseInt(blockNumber, 10), blockx9 - 9); + assert.strictEqual(+blockx9, startingBlockNumber + 9); }); }); From 99639bb5e5911dad5cf3b3682f7bd4e56b16d73a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Jun 2020 17:28:19 -0400 Subject: [PATCH 249/691] Refactor `getDefault` server-options function --- src/packages/core/src/options/server-options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/core/src/options/server-options.ts b/src/packages/core/src/options/server-options.ts index 7b281c46cd..ef9c7a19d2 100644 --- a/src/packages/core/src/options/server-options.ts +++ b/src/packages/core/src/options/server-options.ts @@ -23,7 +23,7 @@ export default interface ServerOptions extends ProviderOptions { ws: boolean; } -export const getDefault: (options?: ServerOptions) => ServerOptions = options => { +export const getDefault = (options?: ServerOptions) => { return Object.assign( { keepAliveTimeout: 5000, From 247187f5f7b31db96908ce27efdbcc80b5f12806 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 26 Jun 2020 21:17:53 -0400 Subject: [PATCH 250/691] add evm_setTime and evm_increaseTime --- .../ethereum/__tests__/api/evm/evm.test.ts | 35 ++++++++++++++ src/chains/ethereum/src/api.ts | 48 +++++++++++++++---- src/chains/ethereum/src/blockchain.ts | 29 +++++++++-- 3 files changed, 98 insertions(+), 14 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/evm/evm.test.ts diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts new file mode 100644 index 0000000000..383742a537 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -0,0 +1,35 @@ +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; + +function between(x: number, min: number, max: number) { + return x >= min && x <= max; +} + +describe("api", () => { + describe("evm", () => { + it("should set the time correctly when difference is greater than 2**31", async () => { + // this test is here to prevent a dev from "optimizing" rounding to use + // bitwise tricks since those won't work on numbers greater than 2**31. + + const provider = await getProvider(); + // Multiple by 1000 because ganache keeps track of time in seconds + const bin32 = (2**31) * 1000; + const now = Date.now(); + // fast forward time by bin32, plus 2 seconds, in case testing is slow + const newTime = bin32 + now + 2; + + const timeAdjustment = await provider.send("evm_setTime", [newTime]); + + // it should return `newTime - now`, floored to the nearest second + const baseLineOffset = Math.floor((newTime - now) / 1000); + assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); + }); + + it("should return the `timeAdjustment` value via `evm_increaseTime`", async () => { + const provider = await getProvider(); + const seconds = 10; + const timeAdjustment = await provider.send("evm_increaseTime", [seconds]); + assert.strictEqual(timeAdjustment, seconds); + }); + }); +}); \ No newline at end of file diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 9d74498530..30ff01d462 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -67,13 +67,28 @@ export default class EthereumApi implements types.Api { }); } - //#region ganache + //#region evm + /** + * Force a block to be mined. + * + * Mines a block independent of whether or not mining is started or stopped. + * + * @param timestamp? the timestamp a block should setup as the mining time. + */ + async evm_mine(timestamp?: number) { + await this[_blockchain].transactions.transactionPool.drain(0, timestamp); + return Promise.resolve("0x0"); + } + /** - * Fast forwards an account's nonce to the specified value. + * Sets the given account's nonce to the specified value. + * + * Warning: this may result in an invalid state. * * @param address + * @param nonce */ - async ganache_setAccountNonce(address: string, nonce: number | BigInt) { + async evm_setAccountNonce(address: string, nonce: number | BigInt) { return new Promise((resolve, reject) => { const buffer = Address.from(address).toBuffer(); this[_blockchain].vm.stateManager.getAccount(buffer, (err, account) => { @@ -90,13 +105,28 @@ export default class EthereumApi implements types.Api { }); }); } - //#endregion ganache - //#region evm - async evm_mine(timestamp?: number) { - await this[_blockchain].transactions.transactionPool.drain(0, timestamp); - // TODO: why did ganache-core send "0x0" back? Is this what geth does? - return Promise.resolve("0x0"); + /** + * Jump forward in time by the given amount of time, in seconds. + * @param seconds Must be greater than or equal to `0` + * @returns Returns the total time adjustment, in seconds. + */ + async evm_increaseTime(seconds: number) { + return this[_blockchain].increaseTime(seconds); + } + + /** + * Sets the internal clock time to the given timestamp. + * + * Warning: This will allow you to move *backwards* in time, which may cause + * new blocks to appear to be mined before old blocks. This is will result in + * an invalid state. + * + * @param timestamp JavaScript timestamp (millisecond precision) + * @returns The amount of *seconds* between the given timestamp and now. + */ + async evm_setTime(time?: Date | number) { + return this[_blockchain].setTime(+time); } //#endregion evm diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 5175542e5b..af26dd834c 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -93,7 +93,14 @@ export default class Blockchain extends Emittery { this.accounts = new AccountManager(this, database.trie); await this.#initializeAccounts(options.accounts); - let lastBlock = this.#initializeGenesisBlock(options.time, gasLimit); + let firstBlockTime: number; + if (options.time != null) { + firstBlockTime = +options.time + this.setTime(firstBlockTime); + } else { + firstBlockTime = this.#currentTime(); + } + let lastBlock = this.#initializeGenesisBlock(firstBlockTime, gasLimit); const readyNextBlock = async (timestamp?: number) => { const previousBlock = await lastBlock; @@ -243,11 +250,11 @@ export default class Blockchain extends Emittery { await commit(); }; - #initializeGenesisBlock = async (timestamp: Date, blockGasLimit: Quantity): Promise => { + #initializeGenesisBlock = async (timestamp: number, blockGasLimit: Quantity): Promise => { // create the genesis block const genesis = this.blocks.next({ // If we were given a timestamp, use it instead of the `_currentTime` - timestamp: (+timestamp / 1000) | 0 || this.#currentTime(), + timestamp, gasLimit: blockGasLimit.toBuffer(), stateRoot: this.trie.root, number: "0x0" @@ -257,11 +264,23 @@ export default class Blockchain extends Emittery { return this.blocks.putBlock(genesis); }; + #timeAdjustment: number = 0; + #currentTime = () => { - // Take the floor of the current time - return (Date.now() / 1000) | 0; + return Math.floor(Date.now() / 1000) + this.#timeAdjustment; }; + public increaseTime(seconds: number) { + if (seconds < 0) { + seconds = 0; + } + return this.#timeAdjustment += seconds; + } + + public setTime(timestamp: number) { + return this.#timeAdjustment = Math.floor((timestamp - Date.now()) / 1000); + } + /** * Given a block number, find its hash in the database * @param number From e6d097aa2cc8baeed5d729ea645405de82c59605 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 1 Jul 2020 18:36:01 -0400 Subject: [PATCH 251/691] Improve initial installation experience --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a8cab79005..8565607c6b 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ "npm": ">=6.1.0" }, "scripts": { - "clean": "npx shx rm -rf node_modules && lerna clean -y", + "clean": "npx shx rm -rf node_modules && npx lerna clean -y", "create": "ts-node ./scripts/create", "postinstall": "npx patch-package && lerna bootstrap", - "tsc": "npx lerna exec -- npm run tsc", - "test": "npx lerna exec -- npm test" + "tsc": "lerna exec -- npm run tsc", + "test": "lerna exec -- npm test" }, "dependencies": { "bip39": "3.0.2", From 55cb6dc71bb7509293089a36584ae67b0cae23a4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 2 Jul 2020 15:18:03 -0400 Subject: [PATCH 252/691] update dependencies --- docs/README.md | 2 +- npm-shrinkwrap.json | 126 +-------- package.json | 12 +- .../@types/ethereumjs-block/header.d.ts | 0 .../@types/ethereumjs-block/index.d.ts | 0 .../@types/ethereumjs-util/index.d.ts | 0 .../ethereum}/@types/hdkey/index.d.ts | 0 .../ethereum}/@types/levelup/index.d.ts | 0 .../@types/merkle-patricia-tree/baseTrie.ts | 0 .../@types/merkle-patricia-tree/index.d.ts | 0 .../@types/merkle-patricia-tree/readStream.ts | 0 .../@types/merkle-patricia-tree/trieNode.ts | 0 src/chains/ethereum/npm-shrinkwrap.json | 259 +++++++++++++++--- src/chains/ethereum/package.json | 3 +- .../ethereum/src/components/block-manager.ts | 6 +- src/chains/ethereum/src/components/manager.ts | 10 +- .../src/components/transaction-manager.ts | 5 +- src/chains/ethereum/src/database.ts | 16 +- src/packages/flavors/__tests__/index.test.ts | 2 +- 19 files changed, 254 insertions(+), 187 deletions(-) rename src/{ => chains/ethereum}/@types/ethereumjs-block/header.d.ts (100%) rename src/{ => chains/ethereum}/@types/ethereumjs-block/index.d.ts (100%) rename src/{ => chains/ethereum}/@types/ethereumjs-util/index.d.ts (100%) rename src/{ => chains/ethereum}/@types/hdkey/index.d.ts (100%) rename src/{ => chains/ethereum}/@types/levelup/index.d.ts (100%) rename src/{ => chains/ethereum}/@types/merkle-patricia-tree/baseTrie.ts (100%) rename src/{ => chains/ethereum}/@types/merkle-patricia-tree/index.d.ts (100%) rename src/{ => chains/ethereum}/@types/merkle-patricia-tree/readStream.ts (100%) rename src/{ => chains/ethereum}/@types/merkle-patricia-tree/trieNode.ts (100%) diff --git a/docs/README.md b/docs/README.md index 9b81efd234..5fe237d4fb 100644 --- a/docs/README.md +++ b/docs/README.md @@ -31,7 +31,7 @@ This will create a new package with Ganache defaults at `packages/`. ## To add a module to a package: -* `lerna add [@version] [--dev] [--peer] --scope=` +* `npx lerna add [@version] [--dev] [--peer] --scope=` Where `` is the npm-module you want to add and `` is where you want to add it. See [@lerna/add documentation](https://github.com/lerna/lerna/tree/master/commands/add) for more details. diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 72122f6fe6..0783422107 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2502,9 +2502,9 @@ "dev": true }, "@types/node": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz", - "integrity": "sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA==" + "version": "14.0.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.14.tgz", + "integrity": "sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -8394,120 +8394,6 @@ "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", "dev": true }, - "merkle-patricia-tree": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", - "integrity": "sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==", - "requires": { - "async": "^2.6.1", - "ethereumjs-util": "^5.2.0", - "level-mem": "^3.0.1", - "level-ws": "^1.0.0", - "readable-stream": "^3.0.6", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - }, - "dependencies": { - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - } - } - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "level-ws": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", - "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.2.8", - "xtend": "^4.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - } - } - }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -11472,9 +11358,9 @@ } }, "typescript": { - "version": "3.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", - "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", + "version": "4.0.0-beta", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.0-beta.tgz", + "integrity": "sha512-d3s/CogGtB2uPZ2Z8ts6eoUxxyB9PH3R27/UrzvpthuOvpCg4FWWnBbBiqJ0K4eu6eTlgmLiqQkh2dquReJweA==", "dev": true }, "uWebSockets.js": { diff --git a/package.json b/package.json index 8565607c6b..01a9ea499a 100644 --- a/package.json +++ b/package.json @@ -2,15 +2,16 @@ "name": "root", "private": true, "engines": { - "node": ">=10.7.0 <=14.0.0", + "node": ">=10.7.0 <=14.5.0", "npm": ">=6.1.0" }, "scripts": { "clean": "npx shx rm -rf node_modules && npx lerna clean -y", "create": "ts-node ./scripts/create", "postinstall": "npx patch-package && lerna bootstrap", - "tsc": "lerna exec -- npm run tsc", - "test": "lerna exec -- npm test" + "reinstall": "npm run clean && npm install", + "test": "lerna exec -- npm test", + "tsc": "lerna exec -- npm run tsc" }, "dependencies": { "bip39": "3.0.2", @@ -26,7 +27,6 @@ "keccak": "3.0.0", "leveldown": "5.6.0", "lodash.clonedeep": "4.5.0", - "merkle-patricia-tree": "3.0.0", "secp256k1": "4.0.1", "seedrandom": "3.0.5", "subleveldown": "5.0.0", @@ -38,7 +38,7 @@ "@types/fs-extra": "8.1.0", "@types/lodash.clonedeep": "4.5.6", "@types/mocha": "7.0.2", - "@types/node": "14.0.1", + "@types/node": "14.0.14", "@types/npm-package-arg": "6.1.0", "@types/prettier": "2.0.0", "@types/secp256k1": "4.0.1", @@ -61,7 +61,7 @@ "superagent": "5.2.2", "ts-morph": "7.0.3", "ts-node": "8.10.2", - "typescript": "3.9.5", + "typescript": "4.0.0-beta", "utf-8-validate": "5.0.2", "ws": "7.3.0", "yargs": "15.3.1" diff --git a/src/@types/ethereumjs-block/header.d.ts b/src/chains/ethereum/@types/ethereumjs-block/header.d.ts similarity index 100% rename from src/@types/ethereumjs-block/header.d.ts rename to src/chains/ethereum/@types/ethereumjs-block/header.d.ts diff --git a/src/@types/ethereumjs-block/index.d.ts b/src/chains/ethereum/@types/ethereumjs-block/index.d.ts similarity index 100% rename from src/@types/ethereumjs-block/index.d.ts rename to src/chains/ethereum/@types/ethereumjs-block/index.d.ts diff --git a/src/@types/ethereumjs-util/index.d.ts b/src/chains/ethereum/@types/ethereumjs-util/index.d.ts similarity index 100% rename from src/@types/ethereumjs-util/index.d.ts rename to src/chains/ethereum/@types/ethereumjs-util/index.d.ts diff --git a/src/@types/hdkey/index.d.ts b/src/chains/ethereum/@types/hdkey/index.d.ts similarity index 100% rename from src/@types/hdkey/index.d.ts rename to src/chains/ethereum/@types/hdkey/index.d.ts diff --git a/src/@types/levelup/index.d.ts b/src/chains/ethereum/@types/levelup/index.d.ts similarity index 100% rename from src/@types/levelup/index.d.ts rename to src/chains/ethereum/@types/levelup/index.d.ts diff --git a/src/@types/merkle-patricia-tree/baseTrie.ts b/src/chains/ethereum/@types/merkle-patricia-tree/baseTrie.ts similarity index 100% rename from src/@types/merkle-patricia-tree/baseTrie.ts rename to src/chains/ethereum/@types/merkle-patricia-tree/baseTrie.ts diff --git a/src/@types/merkle-patricia-tree/index.d.ts b/src/chains/ethereum/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from src/@types/merkle-patricia-tree/index.d.ts rename to src/chains/ethereum/@types/merkle-patricia-tree/index.d.ts diff --git a/src/@types/merkle-patricia-tree/readStream.ts b/src/chains/ethereum/@types/merkle-patricia-tree/readStream.ts similarity index 100% rename from src/@types/merkle-patricia-tree/readStream.ts rename to src/chains/ethereum/@types/merkle-patricia-tree/readStream.ts diff --git a/src/@types/merkle-patricia-tree/trieNode.ts b/src/chains/ethereum/@types/merkle-patricia-tree/trieNode.ts similarity index 100% rename from src/@types/merkle-patricia-tree/trieNode.ts rename to src/chains/ethereum/@types/merkle-patricia-tree/trieNode.ts diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 77d71b84fd..afa9b77304 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -363,6 +363,11 @@ "secp256k1": "^3.0.1" } }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, "keccak": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", @@ -373,6 +378,83 @@ "nan": "^2.2.1", "safe-buffer": "^5.1.0" } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -468,6 +550,115 @@ "rustbn.js": "~0.2.0", "safe-buffer": "^5.1.1", "util.promisify": "^1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", + "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "^0.1.3", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } } }, "ethjs-util": { @@ -984,25 +1175,19 @@ } }, "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", + "integrity": "sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==", "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", + "async": "^2.6.1", + "ethereumjs-util": "^5.2.0", + "level-mem": "^3.0.1", + "level-ws": "^1.0.0", + "readable-stream": "^3.0.6", "rlp": "^2.0.0", "semaphore": ">=1.0.1" }, "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, "ethereumjs-util": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", @@ -1033,34 +1218,30 @@ "safe-buffer": "^5.1.0" } }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "level-ws": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", + "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "readable-stream": "^2.2.8", + "xtend": "^4.0.1" }, "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index d05fb6bf0c..d1b559bef8 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -33,6 +33,7 @@ "@ganache/options": "^2.2.1", "@ganache/utils": "^2.2.1", "ethereumjs-vm": "4.2.0", - "levelup": "4.4.0" + "levelup": "4.4.0", + "merkle-patricia-tree": "3.0.0" } } diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index 334614e29e..9d13172446 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -1,7 +1,7 @@ import EthereumJsBlock from "ethereumjs-block"; import Manager from "./manager"; import Tag from "../things/tags"; -import levelup from "levelup"; +import { LevelUp } from "levelup"; import Blockchain from "../blockchain"; import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; import Transaction from "../things/transaction"; @@ -24,7 +24,7 @@ export default class BlockManager extends Manager { */ public pending: Block; - constructor(blockchain: Blockchain, base: levelup.LevelUp) { + constructor(blockchain: Blockchain, base: LevelUp) { super(blockchain, base, Block); blockchain.on("open", () => { @@ -56,7 +56,7 @@ export default class BlockManager extends Manager { } async getNumberFromHash(hash: string | Buffer | Tag): Promise { - return this.base.get(Data.from(hash).toBuffer()); + return this.base.get(Data.from(hash).toBuffer()) as Promise; } async getByHash(hash: string | Buffer | Tag): Promise { diff --git a/src/chains/ethereum/src/components/manager.ts b/src/chains/ethereum/src/components/manager.ts index 5dc853f10d..12d76d8473 100644 --- a/src/chains/ethereum/src/components/manager.ts +++ b/src/chains/ethereum/src/components/manager.ts @@ -1,4 +1,4 @@ -import levelup from "levelup"; +import {LevelUp} from "levelup"; import {Data} from "@ganache/utils/src/things/json-rpc"; import Blockchain from "../blockchain"; import Tag from "../things/tags"; @@ -9,8 +9,8 @@ export type Instantiable = {new (...args: any[]): T}; export default class Manager { protected blockchain: Blockchain; #Type: Instantiable; - protected base: levelup.LevelUp; - constructor(blockchain: Blockchain, base: levelup.LevelUp, type: Instantiable) { + protected base: LevelUp; + constructor(blockchain: Blockchain, base: LevelUp, type: Instantiable) { this.#Type = type; this.blockchain = blockchain; this.base = base; @@ -23,14 +23,14 @@ export default class Manager { return this.base.get(key).catch(e => { if (e.status === NOTFOUND) return null; throw e; - }); + }) as Promise; } async get(key: string | Buffer) { const raw = await this.getRaw(key); if (!raw) return null; return new this.#Type(raw); } - set(key: Buffer, value: Buffer): Promise { + set(key: Buffer, value: Buffer): Promise { return this.base.put(key, value); } } diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts index b424fc9ad4..e4d43503e3 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -1,9 +1,8 @@ import Transaction from "../things/transaction"; import Manager from "./manager"; import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; -import levelup from "levelup"; +import { LevelUp } from "levelup"; import Blockchain from "../blockchain"; -import {utils} from "@ganache/utils"; import { Data } from "@ganache/utils/src/things/json-rpc"; export type TransactionManagerOptions = TransactionPoolOptions; @@ -11,7 +10,7 @@ export type TransactionManagerOptions = TransactionPoolOptions; export default class TransactionManager extends Manager { public transactionPool: TransactionPool; - constructor(blockchain: Blockchain, base: levelup.LevelUp, options: TransactionManagerOptions) { + constructor(blockchain: Blockchain, base: LevelUp, options: TransactionManagerOptions) { super(blockchain, base, Transaction); this.transactionPool = new TransactionPool(blockchain, options); diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index 7dfe86db13..9e2d04ebf2 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -1,7 +1,7 @@ import {AbstractLevelDOWN} from "abstract-leveldown"; import Emittery from "emittery"; import {dir, setGracefulCleanup} from "tmp-promise"; -import levelup from "levelup"; +import levelup, { LevelUp } from "levelup"; import Blockchain from "./blockchain"; const leveldown = require("leveldown"); const sub = require("subleveldown"); @@ -19,13 +19,13 @@ export default class Database extends Emittery { #cleanupDirectory = noop; #closed = false; public directory: string = null; - public db: levelup.LevelUp = null; - public blocks: levelup.LevelUp; - public blockLogs: levelup.LevelUp; - public blockHashes: levelup.LevelUp; - public transactions: levelup.LevelUp; - public transactionReceipts: levelup.LevelUp; - public trie: levelup.LevelUp; + public db: LevelUp = null; + public blocks: LevelUp; + public blockLogs: LevelUp; + public blockHashes: LevelUp; + public transactions: LevelUp; + public transactionReceipts: LevelUp; + public trie: LevelUp; public readonly initialized: boolean; #rootStore: AbstractLevelDOWN; diff --git a/src/packages/flavors/__tests__/index.test.ts b/src/packages/flavors/__tests__/index.test.ts index 452320c89f..a69df8b078 100644 --- a/src/packages/flavors/__tests__/index.test.ts +++ b/src/packages/flavors/__tests__/index.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import flavors from "../src/"; +import { Flavors } from "../src/"; describe("@ganache/flavors", () => { it("needs tests"); From bbc60bbcb04bb130de36f91afe3eb0bf965299fa Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 2 Jul 2020 15:18:32 -0400 Subject: [PATCH 253/691] Update dependencies --- npm-shrinkwrap.json | 504 ++++++++++++++++++++++++++------------------ package.json | 30 +-- 2 files changed, 312 insertions(+), 222 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0783422107..bda5887fc2 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -13,19 +13,19 @@ } }, "@babel/core": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.2.tgz", - "integrity": "sha512-KQmV9yguEjQsXqyOUGKjS4+3K8/DlOCE2pZcq4augdQmtTy5iv5EHtmMSJ7V4c1BIPjuwtZYqYLCq9Ga+hGBRQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.1", - "@babel/generator": "^7.10.2", - "@babel/helper-module-transforms": "^7.10.1", - "@babel/helpers": "^7.10.1", - "@babel/parser": "^7.10.2", - "@babel/template": "^7.10.1", - "@babel/traverse": "^7.10.1", - "@babel/types": "^7.10.2", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.4.tgz", + "integrity": "sha512-3A0tS0HWpy4XujGc7QtOIHTeNwUgWaZc/WuS5YQrfhU67jnVmsD6OGPc1AKHH0LJHQICGncy3+YUjIhVlfDdcA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.4", + "@babel/helper-module-transforms": "^7.10.4", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -34,111 +34,139 @@ "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + } } }, "@babel/generator": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz", - "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.4.tgz", + "integrity": "sha512-toLIHUIAgcQygFZRAQcsLQV3CBuX6yOIru1kJk/qqqvcRmZrYe6WavZTSG+bB8MxhnL9YPf+pKQfuiP161q7ng==", "dev": true, "requires": { - "@babel/types": "^7.10.2", + "@babel/types": "^7.10.4", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" } }, "@babel/helper-function-name": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.1.tgz", - "integrity": "sha512-fcpumwhs3YyZ/ttd5Rz0xn0TpIwVkN7X0V38B9TWNfVF42KEkhkAAuPCQ3oXmtTRtiPJrmZ0TrfS0GKF0eMaRQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.10.1", - "@babel/template": "^7.10.1", - "@babel/types": "^7.10.1" + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-get-function-arity": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.1.tgz", - "integrity": "sha512-F5qdXkYGOQUb0hpRaPoetF9AnsXknKjWMZ+wmsIRsp5ge5sFh4c3h1eH2pRTTuy9KKAA2+TTYomGXAtEL2fQEw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", "dev": true, "requires": { - "@babel/types": "^7.10.1" + "@babel/types": "^7.10.4" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.1.tgz", - "integrity": "sha512-u7XLXeM2n50gb6PWJ9hoO5oO7JFPaZtrh35t8RqKLT1jFKj9IWeD1zrcrYp1q1qiZTdEarfDWfTIP8nGsu0h5g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.4.tgz", + "integrity": "sha512-m5j85pK/KZhuSdM/8cHUABQTAslV47OjfIB9Cc7P+PvlAoBzdb79BGNfw8RhT5Mq3p+xGd0ZfAKixbrUZx0C7A==", "dev": true, "requires": { - "@babel/types": "^7.10.1" + "@babel/types": "^7.10.4" } }, "@babel/helper-module-imports": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.1.tgz", - "integrity": "sha512-SFxgwYmZ3HZPyZwJRiVNLRHWuW2OgE5k2nrVs6D9Iv4PPnXVffuEHy83Sfx/l4SqF+5kyJXjAyUmrG7tNm+qVg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", "dev": true, "requires": { - "@babel/types": "^7.10.1" + "@babel/types": "^7.10.4" } }, "@babel/helper-module-transforms": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.1.tgz", - "integrity": "sha512-RLHRCAzyJe7Q7sF4oy2cB+kRnU4wDZY/H2xJFGof+M+SJEGhZsb+GFj5j1AD8NiSaVBJ+Pf0/WObiXu/zxWpFg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.4.tgz", + "integrity": "sha512-Er2FQX0oa3nV7eM1o0tNCTx7izmQtwAQsIiaLRWtavAAEcskb0XJ5OjJbVrYXWOTr8om921Scabn4/tzlx7j1Q==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.10.1", - "@babel/helper-replace-supers": "^7.10.1", - "@babel/helper-simple-access": "^7.10.1", - "@babel/helper-split-export-declaration": "^7.10.1", - "@babel/template": "^7.10.1", - "@babel/types": "^7.10.1", + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4", "lodash": "^4.17.13" } }, "@babel/helper-optimise-call-expression": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.1.tgz", - "integrity": "sha512-a0DjNS1prnBsoKx83dP2falChcs7p3i8VMzdrSbfLhuQra/2ENC4sbri34dz/rWmDADsmF1q5GbfaXydh0Jbjg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", "dev": true, "requires": { - "@babel/types": "^7.10.1" + "@babel/types": "^7.10.4" } }, "@babel/helper-replace-supers": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.1.tgz", - "integrity": "sha512-SOwJzEfpuQwInzzQJGjGaiG578UYmyi2Xw668klPWV5n07B73S0a9btjLk/52Mlcxa+5AdIYqws1KyXRfMoB7A==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.10.1", - "@babel/helper-optimise-call-expression": "^7.10.1", - "@babel/traverse": "^7.10.1", - "@babel/types": "^7.10.1" + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-simple-access": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.1.tgz", - "integrity": "sha512-VSWpWzRzn9VtgMJBIWTZ+GP107kZdQ4YplJlCmIrjoLVSi/0upixezHCDG8kpPVTBJpKfxTH01wDhh+jS2zKbw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", "dev": true, "requires": { - "@babel/template": "^7.10.1", - "@babel/types": "^7.10.1" + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz", - "integrity": "sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", + "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", "dev": true, "requires": { - "@babel/types": "^7.10.1" + "@babel/types": "^7.10.4" } }, "@babel/helper-validator-identifier": { @@ -148,14 +176,14 @@ "dev": true }, "@babel/helpers": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.1.tgz", - "integrity": "sha512-muQNHF+IdU6wGgkaJyhhEmI54MOZBKsFfsXFhboz1ybwJ1Kl7IHlbm2a++4jwrmY5UYsgitt5lfqo1wMFcHmyw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", "dev": true, "requires": { - "@babel/template": "^7.10.1", - "@babel/traverse": "^7.10.1", - "@babel/types": "^7.10.1" + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" } }, "@babel/highlight": { @@ -170,48 +198,122 @@ } }, "@babel/parser": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz", - "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.4.tgz", + "integrity": "sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA==", "dev": true }, + "@babel/runtime-corejs3": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.4.tgz", + "integrity": "sha512-BFlgP2SoLO9HJX9WBwN67gHWMBhDX/eDz64Jajd6mR/UAUzqrNMm99d4qHnVaKscAElZoFiPv+JpR/Siud5lXw==", + "dev": true, + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.4" + } + }, "@babel/template": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", - "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", "dev": true, "requires": { - "@babel/code-frame": "^7.10.1", - "@babel/parser": "^7.10.1", - "@babel/types": "^7.10.1" + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + } } }, "@babel/traverse": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.1.tgz", - "integrity": "sha512-C/cTuXeKt85K+p08jN6vMDz8vSV0vZcI0wmQ36o6mjbuo++kPMdpOYw23W2XH04dbRt9/nMEfA4W3eR21CD+TQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.4.tgz", + "integrity": "sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q==", "dev": true, "requires": { - "@babel/code-frame": "^7.10.1", - "@babel/generator": "^7.10.1", - "@babel/helper-function-name": "^7.10.1", - "@babel/helper-split-export-declaration": "^7.10.1", - "@babel/parser": "^7.10.1", - "@babel/types": "^7.10.1", + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.10.4", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + } } }, "@babel/types": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz", - "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", + "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.1", + "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + } } }, "@dsherret/to-absolute-glob": { @@ -2376,49 +2478,23 @@ } }, "@ts-morph/common": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.4.0.tgz", - "integrity": "sha512-VV5/F8k/9RnSZnNpnaOarKb7LOzYhITjHB9JIcpl1l+zlt99H1HeZH/yI2Xs6BtAV4WjPX+SjjRVybdEm6IOEQ==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.5.1.tgz", + "integrity": "sha512-0qasHorGK8VfUK20oECpIfmu/B6cwGSNTj2HoNsIKeDE1kB/uCk5jWFHkgBuoZu/3i3ysLOwO9QsFJaRAH65UA==", "dev": true, "requires": { "@dsherret/to-absolute-glob": "^2.0.2", - "fast-glob": "^3.1.1", - "fs-extra": "^8.1.0", + "fast-glob": "^3.2.2", + "fs-extra": "^9.0.0", "is-negated-glob": "^1.0.0", "multimatch": "^4.0.0", - "typescript": "~3.8.2" + "typescript": "~3.9.2" }, "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", + "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", "dev": true } } @@ -2450,9 +2526,9 @@ "dev": true }, "@types/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-UoOfVEzAUpeSPmjm7h1uk5MH6KZma2z2O7a75onTGjnNvAvMVrPzPL/vBbT65iIGHWj6rokwfmYcmxmlSf2uwg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-B42Sxuaz09MhC3DDeW5kubRcQ5by4iuVQ0cRRWM2lggLzAa/KVom0Aft/208NgMvNQQZ86s5rVcqDdn/SH0/mg==", "dev": true, "requires": { "@types/node": "*" @@ -2519,9 +2595,9 @@ "dev": true }, "@types/prettier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.0.tgz", - "integrity": "sha512-/rM+sWiuOZ5dvuVzV37sUuklsbg+JPOP8d+nNFlo2ZtfpzPiPvh1/gc8liWOLBqe+sR+ZM7guPaIcTt6UZTo7Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.1.tgz", + "integrity": "sha512-boy4xPNEtiw6N3abRhBi/e7hNvy3Tt8E9ZRAQrwAGzoCGZS/1wjo9KY7JHhnfnEsG5wSjDbymCozUM9a3ea7OQ==", "dev": true }, "@types/secp256k1": { @@ -2540,9 +2616,9 @@ "dev": true }, "@types/superagent": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.7.tgz", - "integrity": "sha512-JSwNPgRYjIC4pIeOqLwWwfGj6iP1n5NE6kNBEbGx2V8H78xCPwx7QpNp9plaI30+W3cFEzJO7BIIsXE+dbtaGg==", + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.8.tgz", + "integrity": "sha512-iol9KxQ7SLHatBJUiZ4uABrS4VS1frLjqPednxZz82eoCzo3Uy3TOH0p0ZIBbfBj8E/xqOtvizjBs9h7xi/l2g==", "dev": true, "requires": { "@types/cookiejar": "*", @@ -2560,18 +2636,18 @@ } }, "@types/ws": { - "version": "7.2.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.4.tgz", - "integrity": "sha512-9S6Ask71vujkVyeEXKxjBSUV8ZUB0mjL5la4IncBoheu04bDaYyUKErh1BQcY9+WzOUOiKqz/OnpJHYckbMfNg==", + "version": "7.2.6", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.6.tgz", + "integrity": "sha512-Q07IrQUSNpr+cXU4E4LtkSIBPie5GLZyyMC1QtQYRLWz701+XcoVygGUZgvLqElq1nU4ICldMYPnexlBsg3dqQ==", "dev": true, "requires": { "@types/node": "*" } }, "@types/yargs": { - "version": "15.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.4.tgz", - "integrity": "sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==", + "version": "15.0.5", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.5.tgz", + "integrity": "sha512-Dk/IDOPtOgubt/IaevIUbTgV7doaKkoorvOyYM2CMwuDyP89bekI7H4xLIwunNYiK9jhCkmc6pUrJk3cj2AB9w==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -3080,9 +3156,9 @@ "dev": true }, "bn.js": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.1.tgz", - "integrity": "sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA==" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", + "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==" }, "brace-expansion": { "version": "1.1.11", @@ -4884,9 +4960,9 @@ } }, "ethereumjs-common": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz", - "integrity": "sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ==" + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", + "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" }, "ethereumjs-tx": { "version": "2.1.2", @@ -4945,12 +5021,12 @@ } }, "ethereumjs-util": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.0.tgz", - "integrity": "sha512-y4FqiypxmUVdmCqNPRdB2rvyP1pr8ZBO+RVlxGLF12OoTXVPvgJ3omT2AoYLGCXjgbYDwskbbbROklerm2FNcA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.2.tgz", + "integrity": "sha512-ATAP02eJLpAlWGfiKQddNrRfZpwXiTFhRN2EM/yLXMCdBW/xjKYblNKcx8GLzzrjXg0ymotck+lam1nuV90arQ==", "requires": { "@types/bn.js": "^4.11.3", - "bn.js": "^5.1.1", + "bn.js": "^5.1.2", "create-hash": "^1.1.2", "ethjs-util": "0.1.6", "keccak": "^3.0.0", @@ -5393,9 +5469,9 @@ "dev": true }, "fast-glob": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", - "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -5709,9 +5785,9 @@ "dev": true }, "fs-extra": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", - "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", "dev": true, "requires": { "at-least-node": "^1.0.0", @@ -6700,35 +6776,13 @@ } }, "hdkey": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-1.1.2.tgz", - "integrity": "sha512-PTQ4VKu0oRnCrYfLp04iQZ7T2Cxz0UsEXYauk2j8eh6PJXCpbXuCFhOmtIFtbET0i3PMWmHN9J11gU8LEgUljQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-2.0.1.tgz", + "integrity": "sha512-c+tl9PHG9/XkGgG0tD7CJpRVaE0jfZizDNmnErUAKQ4EjQSOcOUcV3EN9ZEZS8pZ4usaeiiK0H7stzuzna8feA==", "requires": { "bs58check": "^2.1.2", "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - } - } + "secp256k1": "^4.0.0" } }, "he": { @@ -9141,9 +9195,9 @@ "dev": true }, "nyc": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.0.1.tgz", - "integrity": "sha512-n0MBXYBYRqa67IVt62qW1r/d9UH/Qtr7SF1w/nQLJ9KxvWF6b2xCHImRAixHN9tnMMYHC2P14uo6KddNGwMgGg==", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "requires": { "@istanbuljs/load-nyc-config": "^1.0.0", @@ -9154,6 +9208,7 @@ "find-cache-dir": "^3.2.0", "find-up": "^4.1.0", "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", "glob": "^7.1.6", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-hook": "^3.0.0", @@ -10023,6 +10078,12 @@ "strip-indent": "^3.0.0" } }, + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -10568,9 +10629,9 @@ } }, "solc": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.7.tgz", - "integrity": "sha512-a3iocjS1yGzw3Wy7jkqSLX3Vg1lMDCyoKZoVfpOagRGWkh37f11BrcUDO8f73rjdpw2WUBSLJtTQ26i52/0JOg==", + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.10.tgz", + "integrity": "sha512-+oHwIvNjg3bxXvL9yua/Z4ZFEdkCkgRSh7aIGGb+mf/gzoA8PRKiKGYDsjMaj0CJLH1BTBOUpNFeYhhnUFfjRg==", "dev": true, "requires": { "command-exists": "^1.2.8", @@ -10952,15 +11013,15 @@ } }, "subleveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.0.tgz", - "integrity": "sha512-DotbiAIyOWSsidM06/m+EsBHXRyP7EgPlDDD5GVn6JcoDFcVZbp+VN9bOdErNtDWwgR+lJDuKwcJ8nKqSq9Ixg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.1.tgz", + "integrity": "sha512-cVqd/URpp7si1HWu5YqQ3vqQkjuolAwHypY1B4itPlS71/lsf6TQPZ2Y0ijT22EYVkvH5ove9JFJf4u7VGPuZw==", "requires": { - "abstract-leveldown": "^6.2.3", + "abstract-leveldown": "^6.3.0", "encoding-down": "^6.2.0", "inherits": "^2.0.3", "level-option-wrap": "^1.1.0", - "levelup": "^4.3.1", + "levelup": "^4.4.0", "reachdown": "^1.1.0" }, "dependencies": { @@ -10988,9 +11049,12 @@ } }, "level-codec": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", - "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "requires": { + "buffer": "^5.6.0" + } }, "level-errors": { "version": "2.0.1", @@ -11284,13 +11348,13 @@ "dev": true }, "ts-morph": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.0.3.tgz", - "integrity": "sha512-IKvg8h5yQBubv7XQ8ku5exqgQbF7YgWm5/whaR1GV9+vaHOhn0zj7+A2/t0UNfNafH0Fxxz7m7ZK+QioYc1Dfg==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.1.2.tgz", + "integrity": "sha512-0ggF46muGv3v09Yf8Ce5ykTLiQ8I6hGvdB5ID/3+K4J11nCHo/vTaucqTvdFprJzQALpwQx+9bKi31mTxO0+tw==", "dev": true, "requires": { "@dsherret/to-absolute-glob": "^2.0.2", - "@ts-morph/common": "~0.4.0", + "@ts-morph/common": "~0.5.1", "code-block-writer": "^10.1.0" } }, @@ -11802,6 +11866,15 @@ "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", "dev": true }, + "xregexp": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", + "integrity": "sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==", + "dev": true, + "requires": { + "@babel/runtime-corejs3": "^7.8.3" + } + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -11819,13 +11892,13 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "yargs": { - "version": "15.3.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", - "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "version": "15.4.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.0.tgz", + "integrity": "sha512-D3fRFnZwLWp8jVAAhPZBsmeIHY8tTsb8ItV9KaAaopmC6wde2u6Yw29JBIZHXw14kgkRnYmDgmQU4FVMDlIsWw==", "dev": true, "requires": { "cliui": "^6.0.0", - "decamelize": "^1.2.0", + "decamelize": "^3.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", @@ -11834,7 +11907,7 @@ "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^18.1.1" + "yargs-parser": "^18.1.2" }, "dependencies": { "ansi-regex": { @@ -11885,6 +11958,15 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "decamelize": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", + "integrity": "sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==", + "dev": true, + "requires": { + "xregexp": "^4.2.4" + } + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -11970,6 +12052,14 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" + }, + "dependencies": { + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + } } } } diff --git a/package.json b/package.json index 01a9ea499a..3ea98ffbeb 100644 --- a/package.json +++ b/package.json @@ -15,56 +15,56 @@ }, "dependencies": { "bip39": "3.0.2", - "bn.js": "5.1.1", + "bn.js": "5.1.2", "emittery": "0.6.0", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.2", - "ethereumjs-common": "1.5.0", + "ethereumjs-common": "1.5.1", "ethereumjs-tx": "2.1.2", - "ethereumjs-util": "7.0.0", + "ethereumjs-util": "7.0.2", "ethereumjs-vm": "4.2.0", - "hdkey": "1.1.2", + "hdkey": "2.0.1", "keccak": "3.0.0", "leveldown": "5.6.0", "lodash.clonedeep": "4.5.0", "secp256k1": "4.0.1", "seedrandom": "3.0.5", - "subleveldown": "5.0.0", + "subleveldown": "5.0.1", "tmp-promise": "3.0.2", "uWebSockets.js": "github:uNetworking/uWebSockets.js#v17.4.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "1.0.1", - "@types/fs-extra": "8.1.0", + "@types/fs-extra": "9.0.1", "@types/lodash.clonedeep": "4.5.6", "@types/mocha": "7.0.2", "@types/node": "14.0.14", "@types/npm-package-arg": "6.1.0", - "@types/prettier": "2.0.0", + "@types/prettier": "2.0.1", "@types/secp256k1": "4.0.1", "@types/seedrandom": "2.4.28", - "@types/superagent": "4.1.7", + "@types/superagent": "4.1.8", "@types/uws": "0.13.2", - "@types/ws": "7.2.4", - "@types/yargs": "15.0.4", + "@types/ws": "7.2.6", + "@types/yargs": "15.0.5", "camelcase": "6.0.0", "cross-env": "7.0.2", - "fs-extra": "9.0.0", + "fs-extra": "9.0.1", "into-stream": "5.1.1", "lerna": "3.22.1", "mocha": "8.0.1", "npm-package-arg": "8.0.1", - "nyc": "15.0.1", + "nyc": "15.1.0", "prettier": "2.0.5", - "solc": "0.6.7", + "solc": "0.6.10", "source-map-support": "0.5.19", "superagent": "5.2.2", - "ts-morph": "7.0.3", + "ts-morph": "7.1.2", "ts-node": "8.10.2", "typescript": "4.0.0-beta", "utf-8-validate": "5.0.2", "ws": "7.3.0", - "yargs": "15.3.1" + "yargs": "15.4.0" }, "optionalDependencies": { "bigint-buffer": "1.1.5" From dae3d655c122d18dc7466ecbb3b5e02b84b658ee Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 2 Jul 2020 15:47:06 -0400 Subject: [PATCH 254/691] Remove source-map-support from tests as it causes problems in node 14.5.0 --- package.json | 1 - scripts/create.ts | 2 +- src/chains/ethereum/package.json | 2 +- src/packages/core/package.json | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3ea98ffbeb..bb94f9c31a 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,6 @@ "nyc": "15.1.0", "prettier": "2.0.5", "solc": "0.6.10", - "source-map-support": "0.5.19", "superagent": "5.2.2", "ts-morph": "7.1.2", "ts-node": "8.10.2", diff --git a/scripts/create.ts b/scripts/create.ts index 7f57abbbf8..bcde421a98 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -43,7 +43,7 @@ const argv = yargs.command("$0 ", "Package Name").demandCommand().help().a scripts: { tsc: "ts-node ../../../scripts/compile", test: "nyc npm run mocha -- --throw-deprecation --trace-warnings", - mocha: "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" + mocha: "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index d1b559bef8..0af3c6af76 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -24,7 +24,7 @@ "scripts": { "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/core/package.json b/src/packages/core/package.json index d04869d79a..d5e6a63f68 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -24,7 +24,7 @@ "scripts": { "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**.ts'" + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" From f36ea2ccff17fcabea1bb898f35b0c9b274b5939 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 15:56:49 -0400 Subject: [PATCH 255/691] Update developer contributor installation instructions --- docs/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index 5fe237d4fb..9c044d6930 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,9 +3,13 @@ ## Getting set up * Use node v10.7.0 (or whatever the lowest engine is in the root package.json) - * `git clone git@github.com:trufflesuite/ganache-core.git && cd ganache-core` - * `npm install lerna -g` - * `lerna bootstrap` + * `git clone git@github.com:trufflesuite/ganache-core.git` + * `cd ganache-core` + * `npm install` + +## Clean install + * `npm run clean` + * `npm install` ## VSCode On Windows (10) From ef4ccfdd6998d39476c1645aa16d38ab7c29dfe1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 15:57:02 -0400 Subject: [PATCH 256/691] whitespace fix in compile.ts --- scripts/compile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/compile.ts b/scripts/compile.ts index f25da7245f..d67149027a 100644 --- a/scripts/compile.ts +++ b/scripts/compile.ts @@ -94,7 +94,7 @@ sources.forEach(sourceFile => { let jsonPath: string; if (ts.isImportDeclaration(node) && (jsonPath = resolveJsonImportFromNode(node, sourceFile)) && node.importClause) { const namedBindings = node.importClause.namedBindings; - if (namedBindings && "elements" in namedBindings){ + if (namedBindings && "elements" in namedBindings) { const jsonFile = require(jsonPath); const json = namedBindings.elements.map(element => { const name = element.name.text; From 9c065bc20d878d23de29fa2db03a68ee07a2d99d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:07:59 -0400 Subject: [PATCH 257/691] Update to match EIP1193 --- .../ethereum/__tests__/api/eth/eth.test.ts | 112 +++++++++--------- .../ethereum/__tests__/api/net/net.test.ts | 6 +- .../ethereum/__tests__/provider.test.ts | 4 +- .../ethereum/__tests__/temp-tests.test.ts | 31 ++--- src/chains/ethereum/src/index.ts | 6 +- src/chains/ethereum/src/provider.ts | 18 +-- src/packages/core/__tests__/connector.ts | 4 +- 7 files changed, 94 insertions(+), 87 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 9829fdb8db..f3e909e296 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -9,24 +9,24 @@ describe("api", () => { beforeEach(async () => { provider = await getProvider(); - accounts = await provider.request("eth_accounts"); + accounts = await provider.send("eth_accounts"); }); describe("eth_getBalance", () => { it("should return initial balance", async() => { - const balance = await provider.request("eth_getBalance", [accounts[0]]); + const balance = await provider.send("eth_getBalance", [accounts[0]]); assert.strictEqual(balance, "0x56bc75e2d63100000"); }); it("should return 0 for non-existent account", async() => { - const balance = await provider.request("eth_getBalance", ["0x1234567890123456789012345678901234567890"]); + const balance = await provider.send("eth_getBalance", ["0x1234567890123456789012345678901234567890"]); assert.strictEqual(balance, "0x0"); }); }); describe("eth_blockNumber", async () => { it("should return initial block number of zero", async function() { - const blockNumber = await provider.request("eth_blockNumber"); + const blockNumber = await provider.send("eth_blockNumber"); assert.strictEqual(parseInt(blockNumber, 10), 0); }); @@ -37,11 +37,11 @@ describe("api", () => { value: 1 } - const startingBlockNumber = parseInt(await provider.request("eth_blockNumber")); - await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [{...tx}]); + const startingBlockNumber = parseInt(await provider.send("eth_blockNumber")); + await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [{...tx}]); await provider.once("message"); - const blockx1 = await provider.request("eth_blockNumber"); + const blockx1 = await provider.send("eth_blockNumber"); assert.strictEqual(+blockx1, startingBlockNumber + 1); const awaitFor = (count) => new Promise(resolve => { @@ -57,31 +57,31 @@ describe("api", () => { let wait = awaitFor(4); await Promise.all([ - provider.request("eth_sendTransaction", [{...tx}]), - provider.request("eth_sendTransaction", [{...tx}]), - provider.request("eth_sendTransaction", [{...tx}]), - provider.request("eth_sendTransaction", [{...tx}]) + provider.send("eth_sendTransaction", [{...tx}]), + provider.send("eth_sendTransaction", [{...tx}]), + provider.send("eth_sendTransaction", [{...tx}]), + provider.send("eth_sendTransaction", [{...tx}]) ]); await Promise.all([ - provider.request("eth_sendTransaction", [{...tx}]), - provider.request("eth_sendTransaction", [{...tx}]), - provider.request("eth_sendTransaction", [{...tx}]), - provider.request("eth_sendTransaction", [{...tx}]) + provider.send("eth_sendTransaction", [{...tx}]), + provider.send("eth_sendTransaction", [{...tx}]), + provider.send("eth_sendTransaction", [{...tx}]), + provider.send("eth_sendTransaction", [{...tx}]) ]); await wait; wait = awaitFor(4); - const blockx5 = await provider.request("eth_blockNumber"); + const blockx5 = await provider.send("eth_blockNumber"); assert.strictEqual(+blockx5, startingBlockNumber + 5); await wait; - const blockx9 = await provider.request("eth_blockNumber"); + const blockx9 = await provider.send("eth_blockNumber"); assert.strictEqual(+blockx9, startingBlockNumber + 9); }); }); it("eth_getBlockByNumber", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -90,15 +90,15 @@ describe("api", () => { ]); const _message = await provider.once("message"); const blocks = await Promise.all([ - provider.request("eth_getBlockByNumber", ["0x1", true]), - provider.request("eth_getBlockByNumber", ["0x1"]) + provider.send("eth_getBlockByNumber", ["0x1", true]), + provider.send("eth_getBlockByNumber", ["0x1"]) ]); assert(blocks[0].hash, blocks[1].hash); }); it("eth_getBlockByHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -106,24 +106,24 @@ describe("api", () => { } ]); const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); const blocks = await Promise.all([ - provider.request("eth_getBlockByHash", [block.hash, true]), - provider.request("eth_getBlockByHash", [block.hash]) + provider.send("eth_getBlockByHash", [block.hash, true]), + provider.send("eth_getBlockByHash", [block.hash]) ]); assert(blocks[0].hash, blocks[1].hash); const counts = await Promise.all([ - provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]), - provider.request("eth_getBlockTransactionCountByHash", [blocks[0].hash]) + provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]), + provider.send("eth_getBlockTransactionCountByHash", [blocks[0].hash]) ]); assert(true); }); it("eth_getBlockTransactionCountByHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -131,15 +131,15 @@ describe("api", () => { } ]); const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - const count = await provider.request("eth_getBlockTransactionCountByHash", [block.hash]); + const count = await provider.send("eth_getBlockTransactionCountByHash", [block.hash]); assert(count, "1"); }); it("eth_getBlockTransactionCountByNumber", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -148,13 +148,13 @@ describe("api", () => { ]); const _message = await provider.once("message"); - const count = await provider.request("eth_getBlockTransactionCountByNumber", ["0x1"]); + const count = await provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]); assert(count, "1"); }); it("eth_getTransactionByBlockNumberAndIndex", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -163,7 +163,7 @@ describe("api", () => { ]); const _message = await provider.once("message"); - const tx = await provider.request("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); + const tx = await provider.send("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); assert.equal( tx.hash, "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", @@ -172,8 +172,8 @@ describe("api", () => { }); it("eth_getTransactionByBlockHashAndIndex", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -181,9 +181,9 @@ describe("api", () => { } ]); const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - const tx = await provider.request("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); + const tx = await provider.send("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); assert.equal( tx.hash, "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", @@ -192,8 +192,8 @@ describe("api", () => { }); it("eth_getUncleCountByBlockHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -201,15 +201,15 @@ describe("api", () => { } ]); const _message = await provider.once("message"); - const block = await provider.request("eth_getBlockByNumber", ["0x1"]); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - const count = await provider.request("eth_getUncleCountByBlockHash", [block.hash]); + const count = await provider.send("eth_getUncleCountByBlockHash", [block.hash]); assert(count, "0"); }); it("eth_getUncleCountByBlockNumber", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -218,13 +218,13 @@ describe("api", () => { ]); const _message = await provider.once("message"); - const count = await provider.request("eth_getUncleCountByBlockNumber", ["0x1"]); + const count = await provider.send("eth_getUncleCountByBlockNumber", ["0x1"]); assert(count, "0"); }); it("eth_getTransactionReceipt", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - const hash = await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + const hash = await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -233,13 +233,13 @@ describe("api", () => { ]); const _message = await provider.once("message"); - const receipt = await provider.request("eth_getTransactionReceipt", [hash]); + const receipt = await provider.send("eth_getTransactionReceipt", [hash]); assert(receipt.transactionIndex, "0x0"); }); it("eth_getTransactionByHash", async () => { - const _subscriptionId = await provider.request("eth_subscribe", ["newHeads"]); - const hash = await provider.request("eth_sendTransaction", [ + const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + const hash = await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -248,7 +248,7 @@ describe("api", () => { ]); const _message = await provider.once("message"); - const tx = await provider.request("eth_getTransactionByHash", [hash]); + const tx = await provider.send("eth_getTransactionByHash", [hash]); assert(tx.transactionIndex, "0x0"); }); }); diff --git a/src/chains/ethereum/__tests__/api/net/net.test.ts b/src/chains/ethereum/__tests__/api/net/net.test.ts index 9877370734..8ffdd04961 100644 --- a/src/chains/ethereum/__tests__/api/net/net.test.ts +++ b/src/chains/ethereum/__tests__/api/net/net.test.ts @@ -7,19 +7,19 @@ describe("api", () => { const roundedTo5Seconds = (num: number) => Math.round(num / 5000) * 5000; const nowIsh = roundedTo5Seconds(Date.now()); const provider = await getProvider(); - const netVersion = await provider.request("net_version"); + const netVersion = await provider.send("net_version"); assert.strictEqual(roundedTo5Seconds(netVersion), nowIsh); }); it("net_listening", async () => { const provider = await getProvider(); - const netListening = await provider.request("net_listening"); + const netListening = await provider.send("net_listening"); assert.strictEqual(netListening, true); }); it("net_peerCount", async () => { const provider = await getProvider(); - const peerCount = await provider.request("net_peerCount"); + const peerCount = await provider.send("net_peerCount"); assert.strictEqual(peerCount, "0x0"); }); }); diff --git a/src/chains/ethereum/__tests__/provider.test.ts b/src/chains/ethereum/__tests__/provider.test.ts index 68d99516dc..9d703d7ec7 100644 --- a/src/chains/ethereum/__tests__/provider.test.ts +++ b/src/chains/ethereum/__tests__/provider.test.ts @@ -8,7 +8,7 @@ describe("provider", () => { describe("options", () => { it("generates predictable accounts when given a seed", async () => { const provider = await getProvider({seed: "temet nosce"}); - const accounts = await provider.request("eth_accounts"); + const accounts = await provider.send("eth_accounts"); assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); }); }); @@ -22,7 +22,7 @@ describe("provider", () => { }); it("returns things via EIP-1193", async () => { - assert.strictEqual(await provider.request("net_version"), network_id); + assert.strictEqual(await provider.send("net_version"), network_id); }); it("returns things via legacy", async () => { diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index 26b724e08e..ea9767eaf7 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -168,13 +168,16 @@ describe("Random tests that are temporary!", () => { it("deploys contracts", async () => { const fileData = readFileSync(join(__dirname, "./contracts/helloWorld.sol"), {encoding: "utf8"}); const contract = await compileSolidity(fileData, "HelloWorld.sol"); + const p = await getProvider({ defaultTransactionGasLimit: Quantity.from(6721975) }); - const accounts = await p.request("eth_accounts"); + const accounts = await p.send("eth_accounts"); const from = accounts[3]; - await p.request("eth_subscribe", ["newHeads"]); - const transactionHash = await p.request("eth_sendTransaction", [ + + await p.send("eth_subscribe", ["newHeads"]); + + const transactionHash = await p.send("eth_sendTransaction", [ { from, data: contract.code @@ -183,45 +186,45 @@ describe("Random tests that are temporary!", () => { await p.once("message"); - const result = await p.request("eth_getTransactionReceipt", [transactionHash]); - assert.strictEqual(result.blockNumber, "0x1"); + const receipt = await p.send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(receipt.blockNumber, "0x1"); - const to = result.contractAddress; + const to = receipt.contractAddress; const methods = contract.contract.evm.methodIdentifiers; - const value = await p.request("eth_call", [ + const value = await p.send("eth_call", [ {from, to, data: "0x" + methods["value()"]} ]); const x5 = "0x0000000000000000000000000000000000000000000000000000000000000005"; assert.strictEqual(value, x5); - const constVal = await p.request("eth_call", [ + const constVal = await p.send("eth_call", [ {from, to, data: "0x" + methods["getConstVal()"]} ]); const x123 = "0x000000000000000000000000000000000000000000000000000000000000007b"; assert.strictEqual(constVal, x123); - const storage = await p.send("eth_getStorageAt", [result.contractAddress, 0, result.blockNumber]); + const storage = await p.send("eth_getStorageAt", [receipt.contractAddress, 0, receipt.blockNumber]); assert.strictEqual(storage, "0x05"); const raw25 = "0000000000000000000000000000000000000000000000000000000000000019"; const x25 = "0x" + raw25; - const hash = await p.request("eth_sendTransaction", [ + const hash = await p.send("eth_sendTransaction", [ {from, to, data: "0x" + methods["setValue(uint256)"] + raw25} ]); await p.once("message"); - const receipt = await p.send("eth_getTransactionReceipt", [hash]); - assert.strictEqual(receipt.blockNumber, "0x2"); + const txReceipt = await p.send("eth_getTransactionReceipt", [hash]); + assert.strictEqual(txReceipt.blockNumber, "0x2"); - const getValueAgain = await p.request("eth_call", [ + const getValueAgain = await p.send("eth_call", [ {from, to, data: "0x" + methods["value()"]} ]); assert.strictEqual(getValueAgain, x25); - const storage2 = await p.send("eth_getStorageAt", [result.contractAddress, 0, receipt.blockNumber]); + const storage2 = await p.send("eth_getStorageAt", [receipt.contractAddress, 0, receipt.blockNumber]); assert.strictEqual(storage2, "0x19"); }); diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index c55e73e55c..b74b619010 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -34,18 +34,18 @@ export default class EthereumConnector extends Emittery.Typed; } - handle(payload: JsonRpc.Request, connection: HttpRequest | WebSocket): PromiEvent { + handle(payload: JsonRpc.Request, connection: HttpRequest | WebSocket) { const method = payload.method; if (method === "eth_subscribe") { if (isHttp(connection)) { const error = JsonRpc.Error(payload.id, "-32000", "notifications not supported"); return new PromiEvent((_, reject) => void reject(error)); } else { - return this.#provider.request("eth_subscribe", payload.params as Parameters); + return this.#provider.send("eth_subscribe", payload.params as Parameters); } } return new PromiEvent((resolve) => { - this.#provider.request(method, payload.params as Parameters).then(resolve); + this.#provider.send(method, payload.params as Parameters).then(resolve); }); } diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 8cee1e52b2..f140001fae 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -28,6 +28,10 @@ interface Callback { (err?: Error, response?: JsonRpc.Response): void; } +type RequestParams> = { + readonly method: Method, readonly params: Parameters | undefined +}; + export default class EthereumProvider extends Emittery.Typed implements types.Provider { @@ -132,7 +136,7 @@ export default class EthereumProvider extends Emittery.Typed; - response = this.request(method, params); + response = this.request({method, params}); } else if (typeof arg2 === "function") { // handle backward compatibility with callback-style ganache-core const payload = arg1; @@ -140,10 +144,10 @@ export default class EthereumProvider extends Emittery.Typed; params = payload.params; - this.request(method, params) + this.request({method, params}) .then((result: any) => { // execute the callback on the nextTick so errors thrown in the callback - // don't cause the error to buble up to ganache-core + // don't cause the error to bubble up to ganache-core process.nextTick(callback, null, JsonRpc.Response(payload.id, JSON.parse(JSON.stringify(result)))) }).catch((err: Error) => { process.nextTick(callback, err); @@ -174,9 +178,9 @@ export default class EthereumProvider extends Emittery.Typed = types.KnownKeys>(method: Parameters["length"] extends 0 ? Method : never): any; // ReturnType; - public request = types.KnownKeys>(method: Method, params: Parameters): any; // ReturnType; - public request = types.KnownKeys>(method: Method, params?: Parameters) { + public request = types.KnownKeys>(request : Parameters["length"] extends 0 ? {method: Method} : never): any; // ReturnType; + public request = types.KnownKeys>(request: RequestParams): any; // ReturnType; + public request = types.KnownKeys>({method, params}: RequestParams) { return this.#executor.execute(this.#api, method, params).then(result => { const promise = result.value as PromiseLike>; if (promise instanceof PromiEvent) { @@ -185,7 +189,7 @@ export default class EthereumProvider extends Emittery.Typed { // be duck punched. This test is supposed to ensure that _real_ non-function // own properties (and __proto__ properties) can't be executed. (p as any)._engine._ledger.__proto__.illegalProperty = true; - await assert.rejects(p.request("illegalProperty" as any), { + await assert.rejects(p.send("illegalProperty" as any, []), { message: "Invalid or unsupported method: illegalProperty" }); }); @@ -79,7 +79,7 @@ describe("connector", () => { "constructor" ] as const; illegalMethodNames.forEach(name => { - assert.throws(() => p.request(name as any), { + assert.throws(() => p.send(name as any), { message: `Invalid or unsupported method: ${name}` }); }); From a06b1591a6775818f4f6b38935372b0083ef441e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:12:47 -0400 Subject: [PATCH 258/691] vscode has a hard time with detecting the target when extending from another tsconfig. This helps it. --- src/packages/utils/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packages/utils/tsconfig.json b/src/packages/utils/tsconfig.json index 62676b00a1..94c51b7a57 100644 --- a/src/packages/utils/tsconfig.json +++ b/src/packages/utils/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../../tsconfig.json", "compilerOptions": { - "outDir": "lib" + "outDir": "lib", + "target": "ES2020" }, "include": ["src"] } From e08c30f9b7efe6d0be418daa6ffb48d1fb2cf3d9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:13:24 -0400 Subject: [PATCH 259/691] Explain what unref is for --- src/chains/ethereum/src/blockchain.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index af26dd834c..f105fc1f44 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -19,6 +19,14 @@ import Common from "ethereumjs-common"; import VM from "ethereumjs-vm"; +/** + * In node, calling `unref(timer)` on a running timer ensures that the timer + * does not require that the Node.js event remain active. If there is no other + * activity keeping the event loop running, the process may exit before the + * timer's callback is invoked. + * @param timer + * @returns `true` if the timer could be `unref`ed, otherwise returns `false` + */ function unref (timer: NodeJS.Timeout | number): timer is NodeJS.Timeout { if (typeof timer === "object" && typeof timer.unref === "function") { timer.unref(); From e80f5c6e6447af04fbfeb3b0370f92f87b735605 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:13:41 -0400 Subject: [PATCH 260/691] Wrap code comment in database.ts --- src/chains/ethereum/src/database.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index 9e2d04ebf2..e0b2262ec7 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -110,8 +110,9 @@ export default class Database extends Emittery { let prom; try { const ret = fn(); - // PSA: don't let vscode (or yourself) rewrite this to `await` the `batch.write` call. - // The `finally` block needs to run _before_ the write promise has resolved. + // PSA: don't let vscode (or yourself) rewrite this to `await` the + // `batch.write` call. The `finally` block needs to run _before_ the + // write promise has resolved. prom = batch.write().then(() => ret); } finally { rootDb.put = originalPut; From d12fc7b9c1a561213d390e19a60ec1d3b56f08e3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:14:18 -0400 Subject: [PATCH 261/691] Fix comparison of bigint to a number --- src/chains/ethereum/src/components/transaction-pool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index 5b301e0dcf..99cf0bba81 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -248,7 +248,7 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction // Transactions can't be negative. This may never happen using RLP // decoded transactions but may occur if you create a transaction using // the RPC for example. - if (Quantity.from(transaction.value).toBigInt() < 0) { + if (Quantity.from(transaction.value).toBigInt() < 0n) { return new Error("Transaction value cannot be negative"); } From 23394861f9e15849e43ec3deea229576bc08401c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:14:58 -0400 Subject: [PATCH 262/691] Update code to use TS 4.0.0-beta features --- src/chains/ethereum/src/provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index f140001fae..4f1557338e 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -111,7 +111,7 @@ export default class EthereumProvider extends Emittery.Typed Date: Fri, 10 Jul 2020 16:15:15 -0400 Subject: [PATCH 263/691] Wrap code comment in miner.ts --- src/chains/ethereum/src/miner.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index af1fedd167..015b2bfd45 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -73,7 +73,8 @@ export default class Miner extends Emittery { * transactions within a single block. The remaining items will be left in * the pending pool to be eligible for mining in the future. * - * @param maxTransactions: number maximum number of transactions per block. If `0`, unlimited. + * @param maxTransactions: number maximum number of transactions per block. + * If `0`, unlimited. */ public async mine(pending: Map>, block: Block, maxTransactions: number = 0) { // only allow mining a single block at a time (per miner) From a0a5d64cb95edc452d54d7d8194ca62259bb8b9b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:15:41 -0400 Subject: [PATCH 264/691] reformat some code in blockchain.ts --- src/chains/ethereum/src/blockchain.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index f105fc1f44..9c68197272 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -139,9 +139,7 @@ export default class Blockchain extends Emittery { } else { promise = this.once("resume"); } - promise.then(() => { - unref(setTimeout(mine, minerInterval, pending)); - }); + promise.then(() => unref(setTimeout(mine, minerInterval, pending))); return void 0; }; unref(setTimeout(mine, minerInterval, this.transactions.transactionPool.executables)); From 587f8b6199fe1c0029f17bc46a922d179128902c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:16:14 -0400 Subject: [PATCH 265/691] Ensure consistent fn spacing in blockchain.ts --- src/chains/ethereum/src/blockchain.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 9c68197272..eb4fd6f4fe 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -195,6 +195,7 @@ export default class Blockchain extends Emittery { #isPaused = () => { return (this.#state & Status.paused) !== 0; } + pause() { this.#state |= Status.paused; this.emit("pause"); From 715fe96803592af54d0b8cd232aeaabfca85ac4c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:16:57 -0400 Subject: [PATCH 266/691] Fallback to block's `coinbase` when eth_call doesn't have a `from` --- src/chains/ethereum/src/blockchain.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index eb4fd6f4fe..522d6f85a5 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -309,7 +309,7 @@ export default class Blockchain extends Emittery { parentBlock.value.header.stateRoot ); transaction.block = block.value; - transaction.caller = transaction.from; + transaction.caller = transaction.from || block.value.header.coinbase; await settingStateRootProm; const result = await vm.runCall(transaction); return Data.from(result.execResult.returnValue || "0x"); From c9d365d7cbc78d48f67aa816eb7e91325725d3e1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:18:53 -0400 Subject: [PATCH 267/691] Add `callGasLimit` option to Ethereum --- src/chains/ethereum/src/api.ts | 15 ++++++++++++++- src/chains/ethereum/src/options.ts | 1 + src/packages/options/src/options.ts | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 30ff01d462..afa27b19bf 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -667,10 +667,23 @@ export default class EthereumApi implements types.Api { const blocks = this[_blockchain].blocks; const parentBlock = await blocks.get(blockNumber); const parentHeader = parentBlock.value.header; + + if (!transaction.gasLimit) { + if (!transaction.gas) { + // eth_call isn't subject to regular transaction gas limits + transaction.gas = this[_options].callGasLimit.toString(); + } else { + transaction.gasLimit = transaction.gas; + } + } else { + transaction.gas = transaction.gasLimit; + } + const newBlock = blocks.createBlock({ number: parentHeader.number, timestamp: parentHeader.timestamp, - parentHash: parentHeader.parentHash + // gas estimates and eth_calls aren't subject to regular block gas limits + gasLimit: transaction.gas }); return this[_blockchain].simulateTransaction(transaction, parentBlock, newBlock); } diff --git a/src/chains/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts index 4650d6c57a..2dbc86dd98 100644 --- a/src/chains/ethereum/src/options.ts +++ b/src/chains/ethereum/src/options.ts @@ -16,6 +16,7 @@ type EthereumOptions = Pick< | "secure" | "time" | "blockTime" + | "callGasLimit" > & { accounts: Account[]; }; diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index 21f82c47b6..fca3278cf8 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -164,6 +164,11 @@ export interface Options { defaultTransactionGasLimit?: Quantity; + /** + * Sets the transaction gas limit for `eth_call` and `eth_estimateGas` calls. Must be specified as a `hex` string. Defaults to `"0x1fffffffffffff"` (`Number.MAX_SAFE_INTEGER`) + */ + callGasLimit?: Quantity + /** * */ @@ -199,6 +204,7 @@ const getDefault: (options?: Options) => Options = options => { gasPrice: new Quantity(2000000000), gasLimit: new Quantity(6721975), defaultTransactionGasLimit: new Quantity(90000), + callGasLimit: new Quantity(Number.MAX_SAFE_INTEGER), verbose: false, asyncRequestProcessing: true, hardfork: "muirGlacier", From 152627e3893933761393403912b4ad1686ec5b4c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:19:19 -0400 Subject: [PATCH 268/691] Stub out `eth_estimateGas` --- src/chains/ethereum/src/api.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index afa27b19bf..7ede05fc99 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -190,6 +190,20 @@ export default class EthereumApi implements types.Api { } //#endregion + /** + * Generates and returns an estimate of how much gas is necessary to allow the + * transaction to complete. The transaction will not be added to the + * blockchain. Note that the estimate may be significantly more than the + * amount of gas actually used by the transaction, for a variety of reasons + * including EVM mechanics and node performance. + * + * @returns the amount of gas used. + */ + async eth_estimateGas(): Promise { + // TODO: do this for real + return Quantity.from(6721975); + } + /** * Returns the current ethereum protocol version. * @returns The current ethereum protocol version. From 7f598f0e0e0cbae1698f487d28e5e576534bd417 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:20:42 -0400 Subject: [PATCH 269/691] Add coinbase to eth_call's block --- src/chains/ethereum/src/api.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 7ede05fc99..f5c2f742c8 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -696,6 +696,8 @@ export default class EthereumApi implements types.Api { const newBlock = blocks.createBlock({ number: parentHeader.number, timestamp: parentHeader.timestamp, + parentHash: parentHeader.parentHash, + coinbase: this[_wallet].coinbase.address.toBuffer(), // gas estimates and eth_calls aren't subject to regular block gas limits gasLimit: transaction.gas }); From e3c86a8c4a3b87352b4edfe802aaa391bb2c1ae9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:42:23 -0400 Subject: [PATCH 270/691] Add example for adding a module to a package --- docs/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/README.md b/docs/README.md index 9c044d6930..37af2d7fcd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -40,6 +40,14 @@ This will create a new package with Ganache defaults at `packages/`. Where `` is the npm-module you want to add and `` is where you want to add it. See [@lerna/add documentation](https://github.com/lerna/lerna/tree/master/commands/add) for more details. +Example: + +``` +npx lerna add @ganache/options --scope=@ganache/filecoin +``` + +will add our local `@ganache/options` package to the `@ganache/filecoin` package. + ## To remove a module from another package: `cd` to the package and then run `npm uninstall ` From b4a218a606af75174d66f8144515bdb96bfae012 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 16:56:43 -0400 Subject: [PATCH 271/691] FIx contract test broken by recent var rename --- src/chains/ethereum/__tests__/temp-tests.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index ea9767eaf7..cb4d307e9c 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -224,7 +224,7 @@ describe("Random tests that are temporary!", () => { assert.strictEqual(getValueAgain, x25); - const storage2 = await p.send("eth_getStorageAt", [receipt.contractAddress, 0, receipt.blockNumber]); + const storage2 = await p.send("eth_getStorageAt", [receipt.contractAddress, 0, txReceipt.blockNumber]); assert.strictEqual(storage2, "0x19"); }); From 7785fe7e27a44ddde1da29db9cc346cccc21783e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 20:36:37 -0400 Subject: [PATCH 272/691] Additional EIP-1193 changes --- src/chains/ethereum/src/provider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 4f1557338e..67cd41129b 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -178,8 +178,8 @@ export default class EthereumProvider extends Emittery.Typed = types.KnownKeys>(request : Parameters["length"] extends 0 ? {method: Method} : never): any; // ReturnType; - public request = types.KnownKeys>(request: RequestParams): any; // ReturnType; + public request = types.KnownKeys>(request: Parameters["length"] extends 0 ? {method: Method} : never): any; // ReturnType; + public request = types.KnownKeys>(request: {method: RequestParams}): any; // ReturnType; public request = types.KnownKeys>({method, params}: RequestParams) { return this.#executor.execute(this.#api, method, params).then(result => { const promise = result.value as PromiseLike>; From 9f661506b72f4eaad3b42973616237171dd9a0ef Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 20:38:10 -0400 Subject: [PATCH 273/691] Refactor `putBlock` --- src/chains/ethereum/src/components/block-manager.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index 9d13172446..64c8ad5546 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -8,6 +8,8 @@ import Transaction from "../things/transaction"; import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; +const EMPTY_BUFFER = Buffer.from([]); + export default class BlockManager extends Manager { /** * The earliest block @@ -94,12 +96,15 @@ export default class BlockManager extends Manager { * @param block */ async putBlock(block: Block) { - let key = block.value.header.number; - if (Buffer.isBuffer(key) && key.equals(Buffer.from([]))) { + const blockValue = block.value; + const header = blockValue.header; + let key = header.number; + // ensure we can store Block #0 as key "00", not "" + if (EMPTY_BUFFER.equals(key)) { key = Buffer.from([0]); } - const secondaryKey = block.value.header.hash(); - const value = block.value.serialize(true); + const secondaryKey = header.hash(); + const value = blockValue.serialize(true); await Promise.all([super.set(secondaryKey, key), super.set(key, value)]); return block; } From 2dbb85027fbe0e882bce41ee77b693905b95201a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 20:44:24 -0400 Subject: [PATCH 274/691] Undo that last one :-) --- src/chains/ethereum/src/provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 67cd41129b..1833691ae9 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -179,7 +179,7 @@ export default class EthereumProvider extends Emittery.Typed = types.KnownKeys>(request: Parameters["length"] extends 0 ? {method: Method} : never): any; // ReturnType; - public request = types.KnownKeys>(request: {method: RequestParams}): any; // ReturnType; + public request = types.KnownKeys>(request: RequestParams): any; // ReturnType; public request = types.KnownKeys>({method, params}: RequestParams) { return this.#executor.execute(this.#api, method, params).then(result => { const promise = result.value as PromiseLike>; From 89298d1958b0d00977139857d8d4307ca61f71a8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 20:45:49 -0400 Subject: [PATCH 275/691] Add snapshot/revert --- .../ethereum/__tests__/api/evm/snapshot.sol | 9 + .../__tests__/api/evm/snapshot.test.ts | 216 ++++++++++++++++++ src/chains/ethereum/src/api.ts | 83 +++++++ src/chains/ethereum/src/blockchain.ts | 118 +++++++++- src/chains/ethereum/src/components/manager.ts | 3 + .../things/json-rpc/json-rpc-base-types.ts | 3 + .../src/things/json-rpc/json-rpc-quantity.ts | 26 ++- 7 files changed, 441 insertions(+), 17 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/evm/snapshot.sol create mode 100644 src/chains/ethereum/__tests__/api/evm/snapshot.test.ts diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.sol b/src/chains/ethereum/__tests__/api/evm/snapshot.sol new file mode 100644 index 0000000000..e5383ace5f --- /dev/null +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.sol @@ -0,0 +1,9 @@ +pragma solidity ^0.6.1; + +contract snapshot { + uint public n = 42; + + function inc() public { + n += 1; + } +} diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts new file mode 100644 index 0000000000..554fb4b107 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -0,0 +1,216 @@ +const assert = require("assert"); +import { readFileSync } from "fs-extra"; +import { join } from "path"; +import getProvider from "../../helpers/getProvider"; +import {Quantity} from "@ganache/utils/src/things/json-rpc"; + +const eth = "0x" + (1000000000000000000n).toString(16); + +function compileSolidity(source: string, name: string) { + const solc = require("solc"); + + let result = JSON.parse( + solc.compile( + JSON.stringify({ + language: "Solidity", + sources: { + [name]: { + content: source + } + }, + settings: { + outputSelection: { + "*": { + "*": ["*"] + } + } + } + }) + ) + ); + + const contract = result.contracts[name][name.replace(/\.sol$/i, "")] + return Promise.resolve({ + code: "0x" + contract.evm.bytecode.object, + contract + }); +} + +describe("snapshot / revert", function() { + let context = {} as any; + let startingBalance; + let snapshotId; + + before("Set up provider and deploy a contract", async function() { + const fileData = readFileSync(join(__dirname, "./snapshot.sol"), {encoding: "utf8"}); + const contract = await compileSolidity(fileData, "snapshot.sol"); + + const p = await getProvider({ + defaultTransactionGasLimit: Quantity.from(6721975) + }); + const accounts = await p.send("eth_accounts"); + const from = accounts[3]; + + await p.send("eth_subscribe", ["newHeads"]); + + const transactionHash = await p.send("eth_sendTransaction", [ + { + from, + data: contract.code + } + ]); + + await p.once("message"); + + const receipt = await p.send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(receipt.blockNumber, "0x1"); + + const to = receipt.contractAddress; + const methods = contract.contract.evm.methodIdentifiers; + + const value = await p.send("eth_call", [ + {from, to, data: "0x" + methods["n()"]} + ]); + + context.send = p.send.bind(p); + context.accounts = accounts; + context.provider = p; + context.instance = { + n: () => { + const tx = { + to, + data: "0x" + methods["n()"] + } + return p.send("eth_call", [tx]); + }, + inc: async (tx: any) => { + tx.from ||= accounts[0]; + tx.to = to + tx.data = "0x" + methods["inc()"]; + const hash = await p.send("eth_sendTransaction", [tx]); + await p.once("message"); + return await p.send("eth_getTransactionByHash", [hash]); + } + } + }); + + before("send a transaction then make a checkpoint", async function() { + const { accounts, send, provider } = context + + await send("eth_sendTransaction",[{ + from: accounts[0], + to: accounts[1], + value: eth, + gas: 90000 + }]); + + await provider.once("message"); + + // Since transactions happen immediately, we can assert the balance. + let balance = await send("eth_getBalance", [accounts[0]]); + balance = parseInt(balance); + + // Assert the starting balance is where we think it is, including tx costs. + // TODO: + // assert(balance > 98.9 && balance < 99); + startingBalance = balance; + + // Now checkpoint. + snapshotId = await send("evm_snapshot"); + }); + + it("rolls back successfully", async() => { + const { accounts, send, provider } = context; + + // Send another transaction, check the balance, then roll it back to the old one and check the balance again. + const transactionHash = await send("eth_sendTransaction",[{ + from: accounts[0], + to: accounts[1], + value: eth, + gas: 90000 + }]); + + await provider.once("message"); + + let balance = await send("eth_getBalance", [accounts[0]]); + balance = parseInt(balance); + + // Assert the starting balance is where we think it is, including tx costs. + // TODO: + // assert(balance > 97.9 && balance < 98); + + const status = await send("evm_revert", [snapshotId]); + + assert(status, "Snapshot should have returned true"); + + let revertedBalance = await send("eth_getBalance", [accounts[0]]); + revertedBalance = parseInt(revertedBalance); + + assert(revertedBalance === startingBalance, "Should have reverted back to the starting balance"); + + const oldReceipt = await send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(oldReceipt, null, "Receipt should be null as it should have been removed"); + }); + + it("returns false when reverting a snapshot that doesn't exist", async() => { + const { send } = context; + + const snapShotId1 = await send("evm_snapshot"); + const snapShotId2 = await send("evm_snapshot"); + const response1 = await send("evm_revert", [snapShotId1]); + assert.strictEqual(response1, true, "Reverting a snapshot that exists does not work"); + const response2 = await send("evm_revert", [snapShotId2]); + assert.strictEqual(response2, false, "Reverting a snapshot that no longer exists does not work"); + const response3 = await send("evm_revert", [snapShotId1]); + assert.strictEqual(response3, false, "Reverting a snapshot that hasn't already been reverted does not work"); + const response4 = await send("evm_revert", [999]); + assert.strictEqual(response4, false, "Reverting a snapshot that has never existed does not work"); + }); + + it("checkpoints and reverts without persisting contract storage", async() => { + const { accounts, instance, send } = context; + + const snapShotId = await send("evm_snapshot"); + const n1 = await instance.n(); + assert.strictEqual(parseInt(n1), 42, "Initial n is not 42"); + + await instance.inc({ from: accounts[0] }); + const n2 = await instance.n(); + assert.strictEqual(parseInt(n2), 43, "n is not 43 after first call to `inc`"); + + await send("evm_revert", [snapShotId]); + const n3 = await instance.n(); + assert.strictEqual(parseInt(n3), 42, "n is not 42 after reverting snapshot"); + + // this is the real test. what happened was that the vm's contract storage + // trie cache wasn't cleared when the vm's stateManager cache was cleared. + await instance.inc({ from: accounts[0] }); + const n4 = await instance.n(); + assert.strictEqual(parseInt(n4), 43, "n is not 43 after calling `inc` again"); + }); + + it("evm_revert rejects invalid subscriptionId types without crashing", async() => { + const { send } = context; + const ids = [{ foo: "bar" }, true, false, 0.5, Infinity, -Infinity]; + await Promise.all( + ids.map((id) => assert.rejects(send("evm_revert", [id]), /Cannot wrap a .+? as a json-rpc type/, "evm_revert did not reject as expected")) + ); + }); + + it("evm_revert rejects null/undefined subscriptionId values", async() => { + const { send } = context; + const ids = [null, undefined]; + await Promise.all( + ids.map((id) => + assert.rejects(send("evm_revert", [id]), /invalid snapshotId/, "evm_revert did not reject as expected") + ) + ); + }); + + it("evm_revert returns false for out-of-range subscriptionId values", async() => { + const { send } = context; + const ids = [-1, Buffer.from([0])]; + const promises = ids.map((id) => send("evm_revert", [id]).then(result => assert.strictEqual(result, false))); + await Promise.all(promises); + }); +}); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index f5c2f742c8..266c5faffc 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -128,6 +128,89 @@ export default class EthereumApi implements types.Api { async evm_setTime(time?: Date | number) { return this[_blockchain].setTime(+time); } + + /** + * Revert the state of the blockchain to a previous snapshot. Takes a single + * parameter, which is the snapshot id to revert to. This deletes the given + * snapshot, as well as any snapshots taken after (Ex: reverting to id 0x1 + * will delete snapshots with ids 0x1, 0x2, etc... If no snapshot id is + * passed it will revert to the latest snapshot. + * + * @param snapshotId the snapshot id to revert + * @returns `true` if a snapshot was reverted, otherwise `false` + * + * @example Basic example + * const snapshotId = await provider.send("evm_snapshot"); + * const isReverted = await provider.send("evm_revert", [snapshotId]); + * + * @example Complete example + * const provider = ganache.provider(); + * const [from, to] = await provider.send("eth_accounts"); + * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); + * + * // take a snapshot + * const snapshotId = await provider.send("evm_snapshot"); + * + * // send value to another account (over-simplified example) + * await provider.send("eth_subscribe", ["newHeads"]); + * await provider.send("eth_sendTransaction", [{from, to, value: "0xffff"}]); + * await provider.once("message"); // Note: `await provider.once` is non-standard + * + * // ensure balance has updated + * const newBalance = await provider.send("eth_getBalance", [from]); + * assert(BigInt(newBalance) < startingBalance); + * + * // revert the snapshot + * const isReverted = await provider.send("evm_revert", [snapshotId]); + * assert(isReverted); + * + * const endingBalance = await provider.send("eth_getBalance", [from]); + * assert.strictEqual(BigInt(endingBalance), startingBalance); + */ + async evm_revert(snapshotId: string | number) { + return this[_blockchain].revert(Quantity.from(snapshotId)); + } + + /** + * Snapshot the state of the blockchain at the current block. Takes no + * parameters. Returns the id of the snapshot that was created. A snapshot can + * only be reverted once. After a successful `evm_revert`, the same snapshot + * id cannot be used again. Consider creating a new snapshot after each + * `evm_revert` if you need to revert to the same point multiple times. + * + * @returns The hex-encoded identifier for this snapshot + * + * @example Basic example + * const snapshotId = await provider.send("evm_snapshot"); + * + * @example Complete example + * const provider = ganache.provider(); + * const [from, to] = await provider.send("eth_accounts"); + * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); + * + * // take a snapshot + * const snapshotId = await provider.send("evm_snapshot"); + * + * // send value to another account (over-simplified example) + * await provider.send("eth_subscribe", ["newHeads"]); + * await provider.send("eth_sendTransaction", [{from, to, value: "0xffff"}]); + * await provider.once("message"); // Note: `await provider.once` is non-standard + * + * // ensure balance has updated + * const newBalance = await provider.send("eth_getBalance", [from]); + * assert(BigInt(newBalance) < startingBalance); + * + * // revert the snapshot + * const isReverted = await provider.send("evm_revert", [snapshotId]); + * assert(isReverted); + * + * const endingBalance = await provider.send("eth_getBalance", [from]); + * assert.strictEqual(BigInt(endingBalance), startingBalance); + */ + async evm_snapshot() { + return Quantity.from(this[_blockchain].snapshot()); + } + //#endregion evm //#region miner diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 522d6f85a5..24b7f9fd5d 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -111,7 +111,8 @@ export default class Blockchain extends Emittery { let lastBlock = this.#initializeGenesisBlock(firstBlockTime, gasLimit); const readyNextBlock = async (timestamp?: number) => { - const previousBlock = await lastBlock; + await lastBlock; + const previousBlock = this.blocks.latest; const previousHeader = previousBlock.value.header; const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; return this.blocks.createBlock({ @@ -146,7 +147,8 @@ export default class Blockchain extends Emittery { } miner.on("block", async (blockData: any) => { - const previousBlock = await lastBlock; + await lastBlock; + const previousBlock = this.blocks.latest; const previousHeader = previousBlock.value.header; const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; const block = this.blocks.createBlock({ @@ -181,6 +183,7 @@ export default class Blockchain extends Emittery { }); lastBlock.then(block => { + this.blocks.latest = block; // emit the block once everything has been fully saved to the database this.emit("block", block); }); @@ -229,9 +232,8 @@ export default class Blockchain extends Emittery { common, allowUnlimitedContractSize, blockchain: { - getBlock: async (number: BN, done: any) => { - const hash = await this.#blockNumberToHash(number); - done(this.blocks.get(hash)); + getBlock: (number: BN, done: any) => { + this.blocks.get(number.toBuffer()).then((block) => done(block.value)); } } as any }); @@ -288,13 +290,105 @@ export default class Blockchain extends Emittery { return this.#timeAdjustment = Math.floor((timestamp - Date.now()) / 1000); } - /** - * Given a block number, find its hash in the database - * @param number - */ - #blockNumberToHash = (number: BN): Promise => { - return number.toString() as any; - }; + // TODO: this.#snapshots is a potential unbound memory suck. Caller could call `evm_snapshot` over and over + // to grow the snapshot stack indefinitely + #snapshots: any[] = []; + public snapshot() { + const currentBlockHeader = this.blocks.latest.value.header; + const hash = currentBlockHeader.hash(); + const stateRoot = currentBlockHeader.stateRoot; + + // TODO: logger.log... + // self.logger.log("Saved snapshot #" + self.snapshots.length); + + return this.#snapshots.push({ + hash, + stateRoot, + timeAdjustment: this.#timeAdjustment + }); + } + + #deleteBlockData = (block: Block) => { + const blocks = this.blocks; + return this.#database.batch(() => { + blocks.del(block.value.header.number); + blocks.del(block.value.header.hash()); + block.value.transactions.forEach(tx => { + const txHash = tx.hash(); + this.transactions.del(txHash); + this.transactionReceipts.del(txHash); + }); + }); + } + public async revert(snapshotId: Quantity) { + + const rawValue = snapshotId.valueOf(); + if (rawValue === null || rawValue === undefined) { + throw new Error("invalid snapshotId"); + } + + // TODO: logger.log... + // this.logger.log("Reverting to snapshot #" + snapshotId); + + const snapshotNumber = rawValue - 1n; + if (snapshotNumber < 0n) { + return false; + } + + const snapshotsToRemove = this.#snapshots.splice(Number(snapshotNumber)); + const snapshot = snapshotsToRemove.shift(); + + if (!snapshot) { + return false; + } + + const blocks = this.blocks; + const currentBlock = blocks.latest; + const currentHash = currentBlock.value.header.hash(); + const snapshotHash = snapshot.hash; + + // if nothing was added since we snapshotted just return immediately. + if (currentHash.equals(snapshotHash)) { + return true; + } else { + const stateManager = this.vm.stateManager; + // TODO: we may need to ensure nothing can be written to the blockchain + // whilst setting the state root, otherwise we could get into weird states. + // Additionally, if something has created a vm checkpoint `setStateRoot` + // will fail anyway. + const settingStateRootProm = promisify(stateManager.setStateRoot.bind(stateManager))( + snapshot.stateRoot + ); + const getBlockProm = this.blocks.getByHash(snapshotHash); + + // TODO: lazily clean up the database. Get all blocks created since our reverted + // snapshot was created, and delete them, and their transaction data. + // TODO: look into optimizing this to delete from all reverted snapshots. + // the current approach looks at each block, finds its parent, then + // finds its parent, and so on until we reach our target block. Whenever + // we revert a snapshot, we may also throwing away several others, and + // there may be an optimization here by querying for those other + // snapshots' blocks simultaneously. + let nextBlock = currentBlock; + const promises = [getBlockProm, settingStateRootProm] as [Promise, ...Promise[]]; + do { + promises.push(this.#deleteBlockData(nextBlock)); + const header = nextBlock.value.header + if (header.parentHash.equals(snapshotHash)) { + break; + } else { + nextBlock = await blocks.get(header.number); + } + } while(nextBlock); + + const [latest] = await Promise.all(promises); + this.blocks.latest = latest as Block; + // put our time back! + this.#timeAdjustment = snapshot.timeAdjustment; + // update our cached "latest" block + return true; + } + } public async queueTransaction(transaction: any, secretKey?: Data): Promise { await this.transactions.push(transaction, secretKey); diff --git a/src/chains/ethereum/src/components/manager.ts b/src/chains/ethereum/src/components/manager.ts index 12d76d8473..cda0b362bb 100644 --- a/src/chains/ethereum/src/components/manager.ts +++ b/src/chains/ethereum/src/components/manager.ts @@ -33,4 +33,7 @@ export default class Manager { set(key: Buffer, value: Buffer): Promise { return this.base.put(key, value); } + del(key: Buffer) { + return this.base.del(key); + } } diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts index 48c6b88f4d..576b550b5e 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts @@ -34,6 +34,9 @@ export class BaseJsonRpcType (value as number).toString(16)); toBuffers.set(this, () => { const arr = new ArrayBuffer(4); diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index 6013bdfb69..669cb199fb 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -62,28 +62,44 @@ class Quantity extends BaseJsonRpcType { } return view.getBigUint64(0) as bigint; } else { - return BigInt(this.value); + return BigInt(value); } } - valueOf(): bigint | null { - return this.toBigInt(); + public toNumber() { + // TODO: convert directly to a number if it is beneficial to do so + return Number(this.toBigInt()); + } + valueOf(): bigint { + const value = this.value; + if(value === null) { + return value as null; + } else if (value === undefined){ + return value as undefined; + } + else { + return this.toBigInt(); + } } } -type $ = { +type $ = { _nullable: boolean; new (value: T, nullable?: boolean): _Quantity & JsonRpcType; from(value: T, nullable?: boolean): _Quantity & JsonRpcType; toBigInt(): bigint; + toNumber(): number; toBuffer(): Buffer; + valueOf(): bigint; }; const _Quantity = Quantity as $; -interface _Quantity { +interface _Quantity { _nullable: boolean; constructor(value: T, nullable?: boolean): _Quantity; from(): _Quantity; toBigInt(): bigint; + toNumber(): number; toBuffer(): Buffer; + valueOf(): bigint; } export default _Quantity; From 9050cabec6575822633321ac288eee0b7753dfb2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 10 Jul 2020 21:00:06 -0400 Subject: [PATCH 276/691] Use EIP-1193 style calls in the EthereumConnector --- src/chains/ethereum/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index b74b619010..83334446d6 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -34,14 +34,14 @@ export default class EthereumConnector extends Emittery.Typed; } - handle(payload: JsonRpc.Request, connection: HttpRequest | WebSocket) { + handle(payload: JsonRpc.Request, connection: HttpRequest | WebSocket): PromiEvent { const method = payload.method; if (method === "eth_subscribe") { if (isHttp(connection)) { const error = JsonRpc.Error(payload.id, "-32000", "notifications not supported"); return new PromiEvent((_, reject) => void reject(error)); } else { - return this.#provider.send("eth_subscribe", payload.params as Parameters); + return this.#provider.request({method: "eth_subscribe", params: payload.params as Parameters}); } } return new PromiEvent((resolve) => { From 088d5bddd79bd31f3fa153bd75fc0faa0021db89 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 16 Jul 2020 18:18:40 -0400 Subject: [PATCH 277/691] Update comment after renaming class --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 266c5faffc..3294090a27 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -25,7 +25,7 @@ const PROTOCOL_VERSION = Data.from("0x3f"); const RPCQUANTITY_ZERO = Quantity.from("0x0"); //#endregion -// We use symbols for private properties because BaseLedger +// We use symbols for private properties because types.Api // only allows index types of index type '(...args: any) => Promise' const _blockchain = Symbol("blockchain"); const _isMining = Symbol("isMining"); From 6dcbf200bfe5906a1db498265e98375d6ece8780 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 17 Jul 2020 10:41:07 -0400 Subject: [PATCH 278/691] organize tests --- .../__tests__/api/evm/snapshot.test.ts | 346 +++++++++--------- 1 file changed, 175 insertions(+), 171 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 554fb4b107..ac43ae9000 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -36,181 +36,185 @@ function compileSolidity(source: string, name: string) { }); } -describe("snapshot / revert", function() { - let context = {} as any; - let startingBalance; - let snapshotId; - - before("Set up provider and deploy a contract", async function() { - const fileData = readFileSync(join(__dirname, "./snapshot.sol"), {encoding: "utf8"}); - const contract = await compileSolidity(fileData, "snapshot.sol"); - - const p = await getProvider({ - defaultTransactionGasLimit: Quantity.from(6721975) - }); - const accounts = await p.send("eth_accounts"); - const from = accounts[3]; - - await p.send("eth_subscribe", ["newHeads"]); - - const transactionHash = await p.send("eth_sendTransaction", [ - { - from, - data: contract.code - } - ]); - - await p.once("message"); - - const receipt = await p.send("eth_getTransactionReceipt", [transactionHash]); - assert.strictEqual(receipt.blockNumber, "0x1"); - - const to = receipt.contractAddress; - const methods = contract.contract.evm.methodIdentifiers; - - const value = await p.send("eth_call", [ - {from, to, data: "0x" + methods["n()"]} - ]); - - context.send = p.send.bind(p); - context.accounts = accounts; - context.provider = p; - context.instance = { - n: () => { - const tx = { - to, - data: "0x" + methods["n()"] - } - return p.send("eth_call", [tx]); - }, - inc: async (tx: any) => { - tx.from ||= accounts[0]; - tx.to = to - tx.data = "0x" + methods["inc()"]; - const hash = await p.send("eth_sendTransaction", [tx]); +describe("api", function() { + describe("evm", function() { + describe("snapshot / revert", function() { + let context = {} as any; + let startingBalance; + let snapshotId; + + before("Set up provider and deploy a contract", async function() { + const fileData = readFileSync(join(__dirname, "./snapshot.sol"), {encoding: "utf8"}); + const contract = await compileSolidity(fileData, "snapshot.sol"); + + const p = await getProvider({ + defaultTransactionGasLimit: Quantity.from(6721975) + }); + const accounts = await p.send("eth_accounts"); + const from = accounts[3]; + + await p.send("eth_subscribe", ["newHeads"]); + + const transactionHash = await p.send("eth_sendTransaction", [ + { + from, + data: contract.code + } + ]); + await p.once("message"); - return await p.send("eth_getTransactionByHash", [hash]); - } - } - }); - - before("send a transaction then make a checkpoint", async function() { - const { accounts, send, provider } = context - - await send("eth_sendTransaction",[{ - from: accounts[0], - to: accounts[1], - value: eth, - gas: 90000 - }]); - - await provider.once("message"); - - // Since transactions happen immediately, we can assert the balance. - let balance = await send("eth_getBalance", [accounts[0]]); - balance = parseInt(balance); - - // Assert the starting balance is where we think it is, including tx costs. - // TODO: - // assert(balance > 98.9 && balance < 99); - startingBalance = balance; - - // Now checkpoint. - snapshotId = await send("evm_snapshot"); - }); - - it("rolls back successfully", async() => { - const { accounts, send, provider } = context; - - // Send another transaction, check the balance, then roll it back to the old one and check the balance again. - const transactionHash = await send("eth_sendTransaction",[{ - from: accounts[0], - to: accounts[1], - value: eth, - gas: 90000 - }]); - - await provider.once("message"); - - let balance = await send("eth_getBalance", [accounts[0]]); - balance = parseInt(balance); - // Assert the starting balance is where we think it is, including tx costs. - // TODO: - // assert(balance > 97.9 && balance < 98); + const receipt = await p.send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(receipt.blockNumber, "0x1"); - const status = await send("evm_revert", [snapshotId]); + const to = receipt.contractAddress; + const methods = contract.contract.evm.methodIdentifiers; - assert(status, "Snapshot should have returned true"); + const value = await p.send("eth_call", [ + {from, to, data: "0x" + methods["n()"]} + ]); - let revertedBalance = await send("eth_getBalance", [accounts[0]]); - revertedBalance = parseInt(revertedBalance); - - assert(revertedBalance === startingBalance, "Should have reverted back to the starting balance"); - - const oldReceipt = await send("eth_getTransactionReceipt", [transactionHash]); - assert.strictEqual(oldReceipt, null, "Receipt should be null as it should have been removed"); - }); - - it("returns false when reverting a snapshot that doesn't exist", async() => { - const { send } = context; - - const snapShotId1 = await send("evm_snapshot"); - const snapShotId2 = await send("evm_snapshot"); - const response1 = await send("evm_revert", [snapShotId1]); - assert.strictEqual(response1, true, "Reverting a snapshot that exists does not work"); - const response2 = await send("evm_revert", [snapShotId2]); - assert.strictEqual(response2, false, "Reverting a snapshot that no longer exists does not work"); - const response3 = await send("evm_revert", [snapShotId1]); - assert.strictEqual(response3, false, "Reverting a snapshot that hasn't already been reverted does not work"); - const response4 = await send("evm_revert", [999]); - assert.strictEqual(response4, false, "Reverting a snapshot that has never existed does not work"); - }); - - it("checkpoints and reverts without persisting contract storage", async() => { - const { accounts, instance, send } = context; - - const snapShotId = await send("evm_snapshot"); - const n1 = await instance.n(); - assert.strictEqual(parseInt(n1), 42, "Initial n is not 42"); - - await instance.inc({ from: accounts[0] }); - const n2 = await instance.n(); - assert.strictEqual(parseInt(n2), 43, "n is not 43 after first call to `inc`"); - - await send("evm_revert", [snapShotId]); - const n3 = await instance.n(); - assert.strictEqual(parseInt(n3), 42, "n is not 42 after reverting snapshot"); - - // this is the real test. what happened was that the vm's contract storage - // trie cache wasn't cleared when the vm's stateManager cache was cleared. - await instance.inc({ from: accounts[0] }); - const n4 = await instance.n(); - assert.strictEqual(parseInt(n4), 43, "n is not 43 after calling `inc` again"); - }); - - it("evm_revert rejects invalid subscriptionId types without crashing", async() => { - const { send } = context; - const ids = [{ foo: "bar" }, true, false, 0.5, Infinity, -Infinity]; - await Promise.all( - ids.map((id) => assert.rejects(send("evm_revert", [id]), /Cannot wrap a .+? as a json-rpc type/, "evm_revert did not reject as expected")) - ); - }); - - it("evm_revert rejects null/undefined subscriptionId values", async() => { - const { send } = context; - const ids = [null, undefined]; - await Promise.all( - ids.map((id) => - assert.rejects(send("evm_revert", [id]), /invalid snapshotId/, "evm_revert did not reject as expected") - ) - ); - }); - - it("evm_revert returns false for out-of-range subscriptionId values", async() => { - const { send } = context; - const ids = [-1, Buffer.from([0])]; - const promises = ids.map((id) => send("evm_revert", [id]).then(result => assert.strictEqual(result, false))); - await Promise.all(promises); + context.send = p.send.bind(p); + context.accounts = accounts; + context.provider = p; + context.instance = { + n: () => { + const tx = { + to, + data: "0x" + methods["n()"] + } + return p.send("eth_call", [tx]); + }, + inc: async (tx: any) => { + tx.from ||= accounts[0]; + tx.to = to + tx.data = "0x" + methods["inc()"]; + const hash = await p.send("eth_sendTransaction", [tx]); + await p.once("message"); + return await p.send("eth_getTransactionByHash", [hash]); + } + } + }); + + before("send a transaction then make a checkpoint", async function() { + const { accounts, send, provider } = context + + await send("eth_sendTransaction",[{ + from: accounts[0], + to: accounts[1], + value: eth, + gas: 90000 + }]); + + await provider.once("message"); + + // Since transactions happen immediately, we can assert the balance. + let balance = await send("eth_getBalance", [accounts[0]]); + balance = parseInt(balance); + + // Assert the starting balance is where we think it is, including tx costs. + // TODO: + // assert(balance > 98.9 && balance < 99); + startingBalance = balance; + + // Now checkpoint. + snapshotId = await send("evm_snapshot"); + }); + + it("rolls back successfully", async() => { + const { accounts, send, provider } = context; + + // Send another transaction, check the balance, then roll it back to the old one and check the balance again. + const transactionHash = await send("eth_sendTransaction",[{ + from: accounts[0], + to: accounts[1], + value: eth, + gas: 90000 + }]); + + await provider.once("message"); + + let balance = await send("eth_getBalance", [accounts[0]]); + balance = parseInt(balance); + + // Assert the starting balance is where we think it is, including tx costs. + // TODO: + // assert(balance > 97.9 && balance < 98); + + const status = await send("evm_revert", [snapshotId]); + + assert(status, "Snapshot should have returned true"); + + let revertedBalance = await send("eth_getBalance", [accounts[0]]); + revertedBalance = parseInt(revertedBalance); + + assert(revertedBalance === startingBalance, "Should have reverted back to the starting balance"); + + const oldReceipt = await send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(oldReceipt, null, "Receipt should be null as it should have been removed"); + }); + + it("returns false when reverting a snapshot that doesn't exist", async() => { + const { send } = context; + + const snapShotId1 = await send("evm_snapshot"); + const snapShotId2 = await send("evm_snapshot"); + const response1 = await send("evm_revert", [snapShotId1]); + assert.strictEqual(response1, true, "Reverting a snapshot that exists does not work"); + const response2 = await send("evm_revert", [snapShotId2]); + assert.strictEqual(response2, false, "Reverting a snapshot that no longer exists does not work"); + const response3 = await send("evm_revert", [snapShotId1]); + assert.strictEqual(response3, false, "Reverting a snapshot that hasn't already been reverted does not work"); + const response4 = await send("evm_revert", [999]); + assert.strictEqual(response4, false, "Reverting a snapshot that has never existed does not work"); + }); + + it("checkpoints and reverts without persisting contract storage", async() => { + const { accounts, instance, send } = context; + + const snapShotId = await send("evm_snapshot"); + const n1 = await instance.n(); + assert.strictEqual(parseInt(n1), 42, "Initial n is not 42"); + + await instance.inc({ from: accounts[0] }); + const n2 = await instance.n(); + assert.strictEqual(parseInt(n2), 43, "n is not 43 after first call to `inc`"); + + await send("evm_revert", [snapShotId]); + const n3 = await instance.n(); + assert.strictEqual(parseInt(n3), 42, "n is not 42 after reverting snapshot"); + + // this is the real test. what happened was that the vm's contract storage + // trie cache wasn't cleared when the vm's stateManager cache was cleared. + await instance.inc({ from: accounts[0] }); + const n4 = await instance.n(); + assert.strictEqual(parseInt(n4), 43, "n is not 43 after calling `inc` again"); + }); + + it("evm_revert rejects invalid subscriptionId types without crashing", async() => { + const { send } = context; + const ids = [{ foo: "bar" }, true, false, 0.5, Infinity, -Infinity]; + await Promise.all( + ids.map((id) => assert.rejects(send("evm_revert", [id]), /Cannot wrap a .+? as a json-rpc type/, "evm_revert did not reject as expected")) + ); + }); + + it("evm_revert rejects null/undefined subscriptionId values", async() => { + const { send } = context; + const ids = [null, undefined]; + await Promise.all( + ids.map((id) => + assert.rejects(send("evm_revert", [id]), /invalid snapshotId/, "evm_revert did not reject as expected") + ) + ); + }); + + it("evm_revert returns false for out-of-range subscriptionId values", async() => { + const { send } = context; + const ids = [-1, Buffer.from([0])]; + const promises = ids.map((id) => send("evm_revert", [id]).then(result => assert.strictEqual(result, false))); + await Promise.all(promises); + }); + }); }); }); From a85a3fb72b0252597e7bc4aa6c77d925d8a7e0e0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 17 Jul 2020 10:41:25 -0400 Subject: [PATCH 279/691] Add miner start/stop docs --- src/chains/ethereum/src/api.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 3294090a27..686da99e18 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -214,11 +214,21 @@ export default class EthereumApi implements types.Api { //#endregion evm //#region miner + /** + * Resume the CPU mining process with the given number of threads. + * + * Note: `threads` is ignored. + * @param threads + * @returns true + */ miner_start(threads: number = 1) { this[_blockchain].resume(threads); return Promise.resolve(true); } + /** + * Stop the CPU mining operation. + */ async miner_stop() { this[_blockchain].pause(); return Promise.resolve(true); From 0aa2df99a09f7689299700ff48c7737597888f68 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 17 Jul 2020 10:41:42 -0400 Subject: [PATCH 280/691] Add miner_setGasPrice --- src/chains/ethereum/src/api.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 686da99e18..173dbaa754 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -233,6 +233,17 @@ export default class EthereumApi implements types.Api { this[_blockchain].pause(); return Promise.resolve(true); } + + /** + * + * @param number Sets the minimal accepted gas price when mining transactions. + * Any transactions that are below this limit are excluded from the mining + * process. + */ + async miner_setGasPrice(number) { + this[_options].gasPrice = number; + return true; + } //#endregion //#region web3 From f132ba25263b5ec1e2523464fe2f0be351718c14 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 17 Jul 2020 10:51:33 -0400 Subject: [PATCH 281/691] Add miner_setEtherbase --- src/chains/ethereum/src/api.ts | 17 ++++++++++++++--- src/chains/ethereum/src/blockchain.ts | 3 ++- src/chains/ethereum/src/options.ts | 1 + src/chains/ethereum/src/provider.ts | 3 ++- src/chains/ethereum/src/wallet.ts | 2 -- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 173dbaa754..0560c7cb1a 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -15,6 +15,7 @@ const createKeccakHash = require("keccak"); import {name, version} from "../../../packages/core/package.json"; import PromiEvent from "@ganache/utils/src/things/promievent"; import Emittery from "emittery"; +import Account from "./things/account"; //#endregion //#region Constants @@ -244,6 +245,15 @@ export default class EthereumApi implements types.Api { this[_options].gasPrice = number; return true; } + + /** + * Sets the etherbase, where mining rewards will go. + * @param address + */ + async miner_setEtherbase(address: Address) { + this[_options].coinbase = new Account(address); + return true; + } //#endregion //#region web3 @@ -333,7 +343,7 @@ export default class EthereumApi implements types.Api { * @returns 20 bytes - the current coinbase address. */ async eth_coinbase(): Promise
{ - return this[_wallet].coinbase.address; + return this[_options].coinbase.address; } /** @@ -785,11 +795,12 @@ export default class EthereumApi implements types.Api { const blocks = this[_blockchain].blocks; const parentBlock = await blocks.get(blockNumber); const parentHeader = parentBlock.value.header; + const options = this[_options]; if (!transaction.gasLimit) { if (!transaction.gas) { // eth_call isn't subject to regular transaction gas limits - transaction.gas = this[_options].callGasLimit.toString(); + transaction.gas = options.callGasLimit.toString(); } else { transaction.gasLimit = transaction.gas; } @@ -801,7 +812,7 @@ export default class EthereumApi implements types.Api { number: parentHeader.number, timestamp: parentHeader.timestamp, parentHash: parentHeader.parentHash, - coinbase: this[_wallet].coinbase.address.toBuffer(), + coinbase: options.coinbase.address.toBuffer(), // gas estimates and eth_calls aren't subject to regular block gas limits gasLimit: transaction.gas }); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 24b7f9fd5d..a7c6e36d98 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -54,6 +54,7 @@ type BlockchainOptions = { gasLimit?: Quantity; time?: Date; blockTime?: number; + coinbase: Account; }; export default class Blockchain extends Emittery { @@ -154,7 +155,7 @@ export default class Blockchain extends Emittery { const block = this.blocks.createBlock({ parentHash: previousHeader.hash(), number: Quantity.from(previousNumber + 1n).toBuffer(), - // coinbase: + coinbase: options.coinbase.address, timestamp: this.#currentTime(), // difficulty: gasLimit: options.gasLimit.toBuffer(), diff --git a/src/chains/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts index 2dbc86dd98..5f14af6a37 100644 --- a/src/chains/ethereum/src/options.ts +++ b/src/chains/ethereum/src/options.ts @@ -19,6 +19,7 @@ type EthereumOptions = Pick< | "callGasLimit" > & { accounts: Account[]; + coinbase: Account }; export default EthereumOptions; diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 1833691ae9..aed76e6ba1 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -50,8 +50,9 @@ export default class EthereumProvider extends Emittery.Typed(); readonly unlockedAccounts = new Set(); - readonly coinbase: Account; constructor(opts: EthereumOptions) { const accounts = opts.accounts; @@ -16,7 +15,6 @@ export default class Wallet { const unlockedAccounts = this.unlockedAccounts; //#region Configure Known and Unlocked Accounts - this.coinbase = accounts[0]; const l = accounts.length; const accountsCache = (this.accounts = Array(l)); for (let i = 0; i < l; i++) { From b76379999c4219358c5eb610ded77d872082f58f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 17 Jul 2020 10:51:47 -0400 Subject: [PATCH 282/691] Add param type for miner_setGasPrice --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 0560c7cb1a..d759537dd0 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -241,7 +241,7 @@ export default class EthereumApi implements types.Api { * Any transactions that are below this limit are excluded from the mining * process. */ - async miner_setGasPrice(number) { + async miner_setGasPrice(number: Quantity) { this[_options].gasPrice = number; return true; } From eb040e462e7cad9cdfd46d0c3c22867410d4da2a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 17 Jul 2020 11:15:20 -0400 Subject: [PATCH 283/691] Correct type passed to createBock --- src/chains/ethereum/src/blockchain.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index a7c6e36d98..10695045be 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -155,7 +155,7 @@ export default class Blockchain extends Emittery { const block = this.blocks.createBlock({ parentHash: previousHeader.hash(), number: Quantity.from(previousNumber + 1n).toBuffer(), - coinbase: options.coinbase.address, + coinbase: options.coinbase.address.toBuffer(), timestamp: this.#currentTime(), // difficulty: gasLimit: options.gasLimit.toBuffer(), From 3674ca0916469ef8910bf89cf4d658d5624647aa Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 17 Jul 2020 13:21:02 -0400 Subject: [PATCH 284/691] Add eth_getCode --- src/chains/ethereum/@types/solc/index.d.ts | 156 ++++++++++++++++++ .../__tests__/api/eth/contracts/GetCode.sol | 3 + .../__tests__/api/eth/getCode.test.ts | 76 +++++++++ .../__tests__/api/evm/snapshot.test.ts | 35 +--- .../{helloWorld.sol => HelloWorld.sol} | 0 .../ethereum/__tests__/helpers/compile.ts | 37 +++++ .../ethereum/__tests__/temp-tests.test.ts | 34 +--- src/chains/ethereum/src/api.ts | 51 +++++- 8 files changed, 324 insertions(+), 68 deletions(-) create mode 100644 src/chains/ethereum/@types/solc/index.d.ts create mode 100644 src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol create mode 100644 src/chains/ethereum/__tests__/api/eth/getCode.test.ts rename src/chains/ethereum/__tests__/contracts/{helloWorld.sol => HelloWorld.sol} (100%) create mode 100644 src/chains/ethereum/__tests__/helpers/compile.ts diff --git a/src/chains/ethereum/@types/solc/index.d.ts b/src/chains/ethereum/@types/solc/index.d.ts new file mode 100644 index 0000000000..4534dc9881 --- /dev/null +++ b/src/chains/ethereum/@types/solc/index.d.ts @@ -0,0 +1,156 @@ +declare module "solc" { + export type Primitive = + 'bool' | + 'string' | + 'address' | + 'uint8' | + 'uint16' | + 'uint32' | + 'uint64' | + 'uint128' | + 'uint256' | + 'int8' | + 'int16' | + 'int32' | + 'int64' | + 'int128' | + 'int256' | + 'bytes' | + 'bytes20' | + 'bytes32' | + 'bool[]' | + 'string[]' | + 'address[]' | + 'uint8[]' | + 'uint16[]' | + 'uint32[]' | + 'uint64[]' | + 'uint128[]' | + 'uint256[]' | + 'int8[]' | + 'int16[]' | + 'int32[]' | + 'int64[]' | + 'int128[]' | + 'int256[]' | + 'bytes[]' | + 'bytes20[]' | + 'bytes32[]'; + + export interface AbiParameter { + name: string, + type: Primitive, + } + + export interface AbiEventParameter extends AbiParameter { + indexed: boolean, + } + + export interface AbiFunction { + name: string, + type: 'function' | 'constructor' | 'fallback', + stateMutability: 'pure' | 'view' | 'payable' | 'nonpayable', + constant: boolean, + payable: boolean, + inputs: Array, + outputs: Array, + } + + export interface AbiEvent { + name: string, + type: 'event', + inputs: Array, + anonymous: boolean, + } + + export type Abi = Array; + + interface CompilerInputSourceFile { + keccak256?: string; + urls: string[]; + } + interface CompilerInputSourceCode { + keccak256?: string; + content: string; + } + interface CompilerInput { + language: "Solidity" | "serpent" | "lll" | "assembly"; + settings?: any, + sources: { + [globalName: string]: CompilerInputSourceFile | CompilerInputSourceCode, + }; + } + interface CompilerOutputError { + sourceLocation?: { + file: string; + start: number; + end: number; + }; + type: "TypeError" | "InternalCompilerError" | "Exception"; + component: "general" | "ewasm"; + severity: "error" | "warning"; + message: string; + formattedMessage?: string; + } + interface CompilerOutputEvmBytecode { + object?: string; + opcodes?: string; + sourceMap?: string; + linkReferences?: {} | { + [globalName: string]: { + [name: string]: { start: number, length: number }[]; + }; + }; + } + interface CompilerOutputSources { + [globalName: string]: { + id: number; + ast?: any; + legacyAST?: any; + }, + } + interface CompilerOutputContracts { + [globalName: string]: { + [contractName: string]: { + abi?: Abi; + metadata?: string; + userdoc?: any; + devdoc?: any; + ir?: string; + evm?: { + assembly?: string; + legacyAssembly?: any; + bytecode: CompilerOutputEvmBytecode; + deployedBytecode?: CompilerOutputEvmBytecode; + methodIdentifiers?: { + [methodName: string]: string; + }; + gasEstimates?: { + creation: { + codeDepositCost: string; + executionCost: string; + totalCost: string; + }; + external: { + [functionSignature: string]: string; + }; + internal: { + [functionSignature: string]: string; + }; + }; + }; + ewasm: { + wast?: string; + wasm?: string; + } + } + }; + } + interface CompilerOutput { + errors: CompilerOutputError[]; + sources: CompilerOutputSources; + contracts: CompilerOutputContracts; + } + type ReadCallback = (path: string) => { contents?: string, error?: string }; + function compile(input: string): string; +} diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol b/src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol new file mode 100644 index 0000000000..b804e1dfab --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol @@ -0,0 +1,3 @@ +pragma solidity ^0.6.1; + +contract GetCode {} diff --git a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts new file mode 100644 index 0000000000..48a9e8de39 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts @@ -0,0 +1,76 @@ +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +import getProvider from "../../helpers/getProvider"; +import compile from "../../helpers/compile"; +import { join } from "path"; +import { Quantity } from "@ganache/utils/src/things/json-rpc"; + +describe("api", () => { + describe("eth", () => { + describe("getCode", () => { + describe("null checks", () => { + let provider: EthereumProvider; + + before(async () => { + provider = await getProvider(); + }); + + after(async () => { + provider && await provider.disconnect(); + }); + + it("should return 0x for null address", async () => { + const code = await provider.send("eth_getCode", ["0x0000000000000000000000000000000000000000"]); + assert.strictEqual(code, "0x"); + }); + + it("should return 0x for un-initialized address", async () => { + const code = await provider.send("eth_getCode", ["0xabcdefg012345678abcdefg012345678abcdefg0"]); + assert.strictEqual(code, "0x"); + }); + + it("should return 0x for existing non-contract address", async () => { + const accounts = await provider.send("eth_accounts"); + const code = await provider.send("eth_getCode", [accounts[0]]); + assert.strictEqual(code, "0x"); + }); + }); + + describe("code checks", () => { + let provider: EthereumProvider; + let accounts: string[]; + let contractAddress: string; + let blockNumber: Quantity; + let contract: ReturnType; + + before(async () => { + contract = compile(join(__dirname, "./contracts/GetCode.sol")); + provider = await getProvider(); + accounts = await provider.send("eth_accounts"); + await provider.send("eth_subscribe", ["newHeads"]); + const transactionHash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + data: contract.code, + gas: 3141592 + }]); + await provider.once("message"); + const transactionReceipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + contractAddress = transactionReceipt.contractAddress; + assert(contractAddress !== null, "Contract wasn't deployed as expected"); + + blockNumber = Quantity.from(transactionReceipt.blockNumber); + }); + + it("should return the code at the deployed block number", async function() { + const code = await provider.send("eth_getCode", [contractAddress, blockNumber.toString()]); + assert.strictEqual(code, `0x${contract.contract.evm.deployedBytecode.object}`); + }); + + it("should return the no code at the previous block number", async function() { + const code = await provider.send("eth_getCode", [contractAddress, Quantity.from((blockNumber as any) - 1n).toString()]); + assert.strictEqual(code, "0x"); + }); + }); + }); + }); +}); diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index ac43ae9000..b72165cb2e 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -1,41 +1,11 @@ const assert = require("assert"); -import { readFileSync } from "fs-extra"; import { join } from "path"; import getProvider from "../../helpers/getProvider"; +import compile from "../../helpers/compile"; import {Quantity} from "@ganache/utils/src/things/json-rpc"; const eth = "0x" + (1000000000000000000n).toString(16); -function compileSolidity(source: string, name: string) { - const solc = require("solc"); - - let result = JSON.parse( - solc.compile( - JSON.stringify({ - language: "Solidity", - sources: { - [name]: { - content: source - } - }, - settings: { - outputSelection: { - "*": { - "*": ["*"] - } - } - } - }) - ) - ); - - const contract = result.contracts[name][name.replace(/\.sol$/i, "")] - return Promise.resolve({ - code: "0x" + contract.evm.bytecode.object, - contract - }); -} - describe("api", function() { describe("evm", function() { describe("snapshot / revert", function() { @@ -44,8 +14,7 @@ describe("api", function() { let snapshotId; before("Set up provider and deploy a contract", async function() { - const fileData = readFileSync(join(__dirname, "./snapshot.sol"), {encoding: "utf8"}); - const contract = await compileSolidity(fileData, "snapshot.sol"); + const contract = compile(join(__dirname, "./snapshot.sol")); const p = await getProvider({ defaultTransactionGasLimit: Quantity.from(6721975) diff --git a/src/chains/ethereum/__tests__/contracts/helloWorld.sol b/src/chains/ethereum/__tests__/contracts/HelloWorld.sol similarity index 100% rename from src/chains/ethereum/__tests__/contracts/helloWorld.sol rename to src/chains/ethereum/__tests__/contracts/HelloWorld.sol diff --git a/src/chains/ethereum/__tests__/helpers/compile.ts b/src/chains/ethereum/__tests__/helpers/compile.ts new file mode 100644 index 0000000000..484edf0106 --- /dev/null +++ b/src/chains/ethereum/__tests__/helpers/compile.ts @@ -0,0 +1,37 @@ + +import solc from "solc"; +import { readFileSync } from "fs-extra"; +import { parse } from "path"; + +export default function compile(contractPath: string, contractName?: string) { + const parsedPath = parse(contractPath); + const content = readFileSync(contractPath, {encoding: "utf8"}); + const globalName = parsedPath.base; + contractName ||= parsedPath.name; + + let result = JSON.parse( + solc.compile( + JSON.stringify({ + language: "Solidity", + sources: { + [globalName]: { + content + } + }, + settings: { + outputSelection: { + "*": { + "*": ["*"] + } + } + } + } as solc.CompilerInput) + ) + ) as solc.CompilerOutput; + + const contract = result.contracts[globalName][contractName]; + return { + code: "0x" + contract.evm.bytecode.object, + contract + }; +} \ No newline at end of file diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index cb4d307e9c..c5aef42efe 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -2,39 +2,10 @@ import assert from "assert"; import {Quantity} from "@ganache/utils/src/things/json-rpc"; import {ProviderOptions} from "@ganache/options"; import getProvider from "./helpers/getProvider"; +import compile from "./helpers/compile"; import { readFileSync } from "fs-extra"; import { join } from "path"; -const solc = require("solc"); - -function compileSolidity(source: string, name: string) { - let result = JSON.parse( - solc.compile( - JSON.stringify({ - language: "Solidity", - sources: { - [name]: { - content: source - } - }, - settings: { - outputSelection: { - "*": { - "*": ["*"] - } - } - } - }) - ) - ); - - const contract = result.contracts[name][name.replace(/\.sol$/i, "")] - return Promise.resolve({ - code: "0x" + contract.evm.bytecode.object, - contract - }); -} - /** * test in here are playground tests or just tests that are in the original * ganache-core but have yet been properly ported over yet. @@ -166,8 +137,7 @@ describe("Random tests that are temporary!", () => { }); it("deploys contracts", async () => { - const fileData = readFileSync(join(__dirname, "./contracts/helloWorld.sol"), {encoding: "utf8"}); - const contract = await compileSolidity(fileData, "HelloWorld.sol"); + const contract = compile(join(__dirname, "./contracts/HelloWorld.sol")); const p = await getProvider({ defaultTransactionGasLimit: Quantity.from(6721975) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index d759537dd0..570f434b3d 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,6 +1,6 @@ //#region Imports import {types} from "@ganache/utils"; -import {toRpcSig, ecsign, hashPersonalMessage} from "ethereumjs-util"; +import {toRpcSig, KECCAK256_NULL, ecsign, hashPersonalMessage} from "ethereumjs-util"; import EthereumOptions from "./options"; import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; import Blockchain from "./blockchain"; @@ -43,7 +43,6 @@ export default class EthereumApi implements types.Api { private readonly [_filters] = new Map(); private readonly [_blockchain]: Blockchain; - private [_isMining] = false; private readonly [_options]: EthereumOptions; private readonly [_wallet]: Wallet; @@ -487,6 +486,52 @@ export default class EthereumApi implements types.Api { return account.balance; } + async eth_getCode(address: Buffer | IndexableAddress, blockNumber: Buffer | Tag = Tag.LATEST) { + const blockchain = this[_blockchain]; + const blockProm = blockchain.blocks.getRaw(blockNumber); + + const trie = blockchain.trie.copy(); + const getFromTrie = (address: Buffer): Promise => + new Promise((resolve, reject) => { + trie.get(address, (err, data) => { + if (err) return void reject(err); + resolve(data); + }); + }); + const block = await blockProm; + if (!block) return Data.from("0x"); + + const blockData = (rlpDecode(block) as unknown) as [ + [Buffer, Buffer, Buffer, Buffer /* stateRoot */] /* header */, + Buffer[], + Buffer[] + ]; + const headerData = blockData[0]; + const blockStateRoot = headerData[3]; + trie.root = blockStateRoot; + + const addressDataPromise = getFromTrie(Address.from(address).toBuffer()); + + const addressData = await addressDataPromise; + // An address's codeHash is stored in the 4th rlp entry + const codeHash = ((rlpDecode(addressData) as any) as [ + Buffer /*nonce*/, + Buffer /*amount*/, + Buffer /*stateRoot*/, + Buffer /*codeHash*/ + ])[3]; + // if this address isn't a contract, return 0x + if (!codeHash || KECCAK256_NULL.equals(codeHash)) { + return Data.from("0x"); + } + return new Promise((resolve, reject) => { + trie.getRaw(codeHash, (err, data) => { + if (err) return void reject(err); + resolve(Data.from(data)); + }); + }) + } + /** * Returns the value from a storage position at a given address. * @param data 20 Bytes - address of the storage. @@ -505,7 +550,7 @@ export default class EthereumApi implements types.Api { const getFromTrie = (address: Buffer): Promise => new Promise((resolve, reject) => { trie.get(address, (err, data) => { - if (err) return reject(err); + if (err) return void reject(err); resolve(data); }); }); From fe731dc4c54753485e4364e1d8e75ad487cf8608 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 17 Jul 2020 13:21:16 -0400 Subject: [PATCH 285/691] Add actual mining status --- src/chains/ethereum/src/api.ts | 2 +- src/chains/ethereum/src/blockchain.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 570f434b3d..c4655d3bd4 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -429,7 +429,7 @@ export default class EthereumApi implements types.Api { * @returns returns true of the client is mining, otherwise false. */ async eth_mining(): Promise { - return this[_isMining]; + return this[_blockchain].isMining(); } /** diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 10695045be..e80f754432 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -196,6 +196,10 @@ export default class Blockchain extends Emittery { }); } + isMining = () => { + return this.#state === Status.started; + } + #isPaused = () => { return (this.#state & Status.paused) !== 0; } From e109d3c80d1e011982199d3fd7900c937501004f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 14:42:20 -0400 Subject: [PATCH 286/691] Document that "exact" modules versions should be installed --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 37af2d7fcd..54224c9635 100644 --- a/docs/README.md +++ b/docs/README.md @@ -35,7 +35,7 @@ This will create a new package with Ganache defaults at `packages/`. ## To add a module to a package: -* `npx lerna add [@version] [--dev] [--peer] --scope=` +* `npx lerna add [@version] -E [--dev] [--peer] --scope=` Where `` is the npm-module you want to add and `` is where you want to add it. See [@lerna/add documentation](https://github.com/lerna/lerna/tree/master/commands/add) for more details. From b079df228bd72c555f4f6421f090764fc4d3e6ae Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 14:47:39 -0400 Subject: [PATCH 287/691] Move some deps to the ethereum package --- package.json | 1 - src/chains/ethereum/npm-shrinkwrap.json | 3125 ++++++++++++----------- src/chains/ethereum/package.json | 3 + 3 files changed, 1615 insertions(+), 1514 deletions(-) diff --git a/package.json b/package.json index bb94f9c31a..2aef6b91f4 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "ethereumjs-util": "7.0.2", "ethereumjs-vm": "4.2.0", "hdkey": "2.0.1", - "keccak": "3.0.0", "leveldown": "5.6.0", "lodash.clonedeep": "4.5.0", "secp256k1": "4.0.1", diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index afa9b77304..4ef26ac8ad 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -1,1515 +1,1614 @@ { - "name": "@ganache/ethereum", - "version": "2.2.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "14.0.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.11.tgz", - "integrity": "sha512-lCvvI24L21ZVeIiyIUHZ5Oflv1hhHQ5E1S25IRlKIXaRkVgmXpJMI3wUJkmym2bTbCe+WoIibQnMVAU3FguaOg==" - }, - "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", - "requires": { - "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "requires": { - "lodash": "^4.17.14" - } - }, - "async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "requires": { - "async": "^2.4.0" - } - }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-sha3": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.4.tgz", - "integrity": "sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY=", - "requires": { - "js-sha3": "^0.6.1", - "safe-buffer": "^5.1.1" - } - }, - "buffer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", - "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" - }, - "checkpoint-store": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", - "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", - "requires": { - "functional-red-black-tree": "^1.0.1" - } - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "core-js-pure": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", - "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" - }, - "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=" - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", - "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } - } - }, - "drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", - "requires": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - } - }, - "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "encoding-down": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", - "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", - "requires": { - "abstract-leveldown": "^5.0.0", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "xtend": "^4.0.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "level-codec": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", - "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "requires": { - "prr": "~1.0.1" - } - }, - "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "ethashjs": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.7.tgz", - "integrity": "sha1-ML/kGWcmaQoMWdO4Jy5w1NDDS64=", - "requires": { - "async": "^1.4.2", - "buffer-xor": "^1.0.3", - "ethereumjs-util": "^4.0.1", - "miller-rabin": "^4.0.0" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "ethereumjs-util": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", - "integrity": "sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=", - "requires": { - "bn.js": "^4.8.0", - "create-hash": "^1.1.2", - "keccakjs": "^0.2.0", - "rlp": "^2.0.0", - "secp256k1": "^3.0.1" - } - } - } - }, - "ethereumjs-account": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", - "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", - "requires": { - "ethereumjs-util": "^6.0.0", - "rlp": "^2.2.1", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-block": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", - "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", - "requires": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "ethereumjs-blockchain": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.3.tgz", - "integrity": "sha512-0nJWbyA+Gu0ZKZr/cywMtB/77aS/4lOVsIKbgUN2sFQYscXO5rPbUfrEe7G2Zhjp86/a0VqLllemDSTHvx3vZA==", - "requires": { - "async": "^2.6.1", - "ethashjs": "~0.0.7", - "ethereumjs-block": "~2.2.2", - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "~6.1.0", - "flow-stoplight": "^1.0.0", - "level-mem": "^3.0.1", - "lru-cache": "^5.1.1", - "rlp": "^2.2.2", - "semaphore": "^1.1.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", - "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - } - } - }, - "ethereumjs-common": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", - "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" - }, - "ethereumjs-tx": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", - "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "ethereumjs-util": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", - "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^2.0.0", - "rlp": "^2.2.3", - "secp256k1": "^3.0.1" - } - }, - "ethereumjs-vm": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz", - "integrity": "sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==", - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "core-js-pure": "^3.0.1", - "ethereumjs-account": "^3.0.0", - "ethereumjs-block": "^2.2.2", - "ethereumjs-blockchain": "^4.0.3", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.2", - "ethereumjs-util": "^6.2.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1", - "util.promisify": "^1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "ethjs-util": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "requires": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - } - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "fake-merkle-patricia-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", - "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", - "requires": { - "checkpoint-store": "^1.1.0" - } - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, - "flow-stoplight": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", - "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" - }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "is-callable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", - "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==" - }, - "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" - }, - "is-hex-prefixed": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" - }, - "is-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", - "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "requires": { - "has-symbols": "^1.0.1" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "js-sha3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", - "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" - }, - "keccak": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", - "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", - "requires": { - "bindings": "^1.5.0", - "inherits": "^2.0.4", - "nan": "^2.14.0", - "safe-buffer": "^5.2.0" - } - }, - "keccakjs": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.3.tgz", - "integrity": "sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg==", - "requires": { - "browserify-sha3": "^0.0.4", - "sha3": "^1.2.2" - } - }, - "level-codec": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", - "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" - }, - "level-concat-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" - }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-mem": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", - "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", - "requires": { - "level-packager": "~4.0.0", - "memdown": "~3.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "memdown": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", - "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", - "requires": { - "abstract-leveldown": "~5.0.0", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-packager": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", - "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", - "requires": { - "encoding-down": "~5.0.0", - "levelup": "^3.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", - "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", - "requires": { - "abstract-leveldown": "~5.0.0", - "inherits": "^2.0.3" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", - "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "xtend": "^4.0.0" - } - }, - "levelup": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", - "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", - "requires": { - "deferred-leveldown": "~4.0.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~3.0.0", - "xtend": "~4.0.0" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-supports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", - "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", - "requires": { - "xtend": "^4.0.2" - }, - "dependencies": { - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-ws": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", - "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } - } - }, - "levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", - "requires": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" - } - }, - "ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "memdown": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", - "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "requires": { - "xtend": "~4.0.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "merkle-patricia-tree": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", - "integrity": "sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==", - "requires": { - "async": "^2.6.1", - "ethereumjs-util": "^5.2.0", - "level-mem": "^3.0.1", - "level-ws": "^1.0.0", - "readable-stream": "^3.0.6", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "level-ws": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", - "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.2.8", - "xtend": "^4.0.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, - "nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" - }, - "object-inspect": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", - "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } - } - }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rlp": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.5.tgz", - "integrity": "sha512-y1QxTQOp0OZnjn19FxBmped4p+BSKPHwGndaqrESseyd2xXZtcgR3yuTIosh8CaMaOii9SKIYerBXnV/CpJ3qw==", - "requires": { - "bn.js": "^4.11.1" - } - }, - "rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - } - }, - "semaphore": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", - "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" - }, - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "sha3": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.6.tgz", - "integrity": "sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ==", - "requires": { - "nan": "2.13.2" - }, - "dependencies": { - "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" - } - } - }, - "string.prototype.trimend": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", - "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string.prototype.trimleft": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", - "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimstart": "^1.0.0" - } - }, - "string.prototype.trimright": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", - "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimend": "^1.0.0" - } - }, - "string.prototype.trimstart": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", - "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "strip-hex-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", - "requires": { - "is-hex-prefixed": "1.0.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "util.promisify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", - "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.2", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.0" - } - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - } - } + "name": "@ganache/ethereum", + "version": "2.2.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "requires": { + "@types/node": "*" + } + }, + "@types/keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-/MxAVmtyyeOvZ6dGf3ciLwFRuV5M8DRIyYNFGHYI6UyBW4/XqyO0LZw+JFMvaeY3cHItQAkELclBU1x5ank6mg==", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.0.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.23.tgz", + "integrity": "sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==" + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/secp256k1": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "requires": { + "@types/node": "*" + } + }, + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "requires": { + "async": "^2.4.0" + } + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" + }, + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "checkpoint-store": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", + "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", + "requires": { + "functional-red-black-tree": "^1.0.1" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "core-js-pure": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" + }, + "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=" + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "drbg.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", + "requires": { + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" + } + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "encoding-down": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", + "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", + "requires": { + "abstract-leveldown": "^5.0.0", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0", + "xtend": "^4.0.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "requires": { + "buffer": "^5.6.0" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "requires": { + "prr": "~1.0.1" + } + }, + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "eth-sig-util": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.5.3.tgz", + "integrity": "sha512-KpXbCKmmBUNUTGh9MRKmNkIPietfhzBqqYqysDavLseIiMUGl95k6UcPEkALAZlj41e9E6yioYXc1PC333RKqw==", + "requires": { + "buffer": "^5.2.1", + "elliptic": "^6.4.0", + "ethereumjs-abi": "0.6.5", + "ethereumjs-util": "^5.1.1", + "tweetnacl": "^1.0.0", + "tweetnacl-util": "^0.15.0" + } + }, + "ethashjs": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz", + "integrity": "sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==", + "requires": { + "async": "^2.1.2", + "buffer-xor": "^2.0.1", + "ethereumjs-util": "^7.0.2", + "miller-rabin": "^4.0.0" + }, + "dependencies": { + "bn.js": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", + "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==" + }, + "buffer-xor": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "requires": { + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-util": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.3.tgz", + "integrity": "sha512-uLQsGPOwsRxe50WV1Dybh5N8zXDz4ev7wP49LKX9kr28I5TmcDILPgpKK/BFe5zYSfRGEeo+hPT7W3tjghYLuA==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.4" + } + } + } + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "ethereumjs-abi": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz", + "integrity": "sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE=", + "requires": { + "bn.js": "^4.10.0", + "ethereumjs-util": "^4.3.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz", + "integrity": "sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w==", + "requires": { + "bn.js": "^4.8.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.0.0" + } + } + } + }, + "ethereumjs-account": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", + "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", + "requires": { + "ethereumjs-util": "^6.0.0", + "rlp": "^2.2.1", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-block": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "requires": { + "async": "^2.0.1", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "ethereumjs-blockchain": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.3.tgz", + "integrity": "sha512-0nJWbyA+Gu0ZKZr/cywMtB/77aS/4lOVsIKbgUN2sFQYscXO5rPbUfrEe7G2Zhjp86/a0VqLllemDSTHvx3vZA==", + "requires": { + "async": "^2.6.1", + "ethashjs": "~0.0.7", + "ethereumjs-block": "~2.2.2", + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "~6.1.0", + "flow-stoplight": "^1.0.0", + "level-mem": "^3.0.1", + "lru-cache": "^5.1.1", + "rlp": "^2.2.2", + "semaphore": "^1.1.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "ethjs-util": "0.1.6", + "keccak": "^1.0.2", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1", + "secp256k1": "^3.0.1" + } + }, + "keccak": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "requires": { + "bindings": "^1.2.1", + "inherits": "^2.0.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } + } + } + }, + "ethereumjs-common": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", + "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "ethereumjs-vm": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz", + "integrity": "sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==", + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "core-js-pure": "^3.0.1", + "ethereumjs-account": "^3.0.0", + "ethereumjs-block": "^2.2.2", + "ethereumjs-blockchain": "^4.0.3", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^6.2.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.3.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1", + "util.promisify": "^1.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "fake-merkle-patricia-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", + "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", + "requires": { + "checkpoint-store": "^1.1.0" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "flow-stoplight": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", + "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + }, + "immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-callable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==" + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + }, + "is-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "keccak": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", + "integrity": "sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==", + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + }, + "level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-mem": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", + "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", + "requires": { + "level-packager": "~4.0.0", + "memdown": "~3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, + "memdown": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", + "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", + "requires": { + "abstract-leveldown": "~5.0.0", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-packager": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", + "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", + "requires": { + "encoding-down": "~5.0.0", + "levelup": "^3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", + "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", + "requires": { + "abstract-leveldown": "~5.0.0", + "inherits": "^2.0.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", + "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "xtend": "^4.0.0" + } + }, + "levelup": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", + "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", + "requires": { + "deferred-leveldown": "~4.0.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~3.0.0", + "xtend": "~4.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "requires": { + "xtend": "^4.0.2" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "requires": { + "deferred-leveldown": "~5.3.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "requires": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "~4.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "merkle-patricia-tree": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", + "integrity": "sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ==", + "requires": { + "async": "^2.6.1", + "ethereumjs-util": "^5.2.0", + "level-mem": "^3.0.1", + "level-ws": "^1.0.0", + "readable-stream": "^3.0.6", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "level-ws": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-1.0.0.tgz", + "integrity": "sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q==", + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.2.8", + "xtend": "^4.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "nan": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" + }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "requires": { + "bn.js": "^4.11.1" + } + }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "semaphore": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", + "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + } + } } diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 0af3c6af76..85aec0e770 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -32,7 +32,10 @@ "dependencies": { "@ganache/options": "^2.2.1", "@ganache/utils": "^2.2.1", + "@types/keccak": "3.0.1", + "eth-sig-util": "^2.5.3", "ethereumjs-vm": "4.2.0", + "keccak": "3.0.0", "levelup": "4.4.0", "merkle-patricia-tree": "3.0.0" } From 619e42b9aea0dba141d0d61d0d185b2a84ff84a8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:03:34 -0400 Subject: [PATCH 288/691] Add eth_signTypedData --- .../__tests__/api/eth/signTypedData.test.ts | 121 ++++++++++++++++++ src/chains/ethereum/src/api.ts | 62 ++++++++- 2 files changed, 180 insertions(+), 3 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts b/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts new file mode 100644 index 0000000000..a69cb588a7 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts @@ -0,0 +1,121 @@ +import assert from "assert"; +const createKeccakHash = require("keccak"); +import getProvider from "../../helpers/getProvider"; + +describe("api", () => { + describe("eth", () => { + describe("signTypedData", function () { + let accounts; + let provider; + + // Load account. + before(async function () { + // Account based on https://github.com/ethereum/EIPs/blob/master/assets/eip-712/Example.js + const acc = { + balance: "0x0", + secretKey: createKeccakHash("keccak256").update("cow").digest() + }; + provider = await getProvider({ + accounts: [acc] + }) + accounts = await provider.send("eth_accounts"); + }); + + it("should produce a signature whose signer can be recovered", async function () { + const typedData = { + types: { + EIP712Domain: [ + { name: "name", type: "string" }, + { name: "version", type: "string" }, + { name: "chainId", type: "uint256" }, + { name: "verifyingContract", type: "address" } + ], + Person: [ + { name: "name", type: "string" }, + { name: "wallet", type: "address" } + ], + Mail: [ + { name: "from", type: "Person" }, + { name: "to", type: "Person" }, + { name: "contents", type: "string" } + ] + }, + primaryType: "Mail", + domain: { + name: "Ether Mail", + version: "1", + chainId: 1, + verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" + }, + message: { + from: { name: "Cow", wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826" }, + to: { name: "Bob", wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB" }, + contents: "Hello, Bob!" + } + }; + + const result = await provider.send("eth_signTypedData", [accounts[0], typedData]); + assert.strictEqual( + result, + "0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c" + ); + }); + + it("should produce a signature whose signer can be recovered (for arrays)", async function () { + const typedData = { + types: { + EIP712Domain: [ + { name: "name", type: "string" }, + { name: "version", type: "string" }, + { name: "chainId", type: "uint256" }, + { name: "verifyingContract", type: "address" } + ], + Person: [ + { name: "name", type: "string" }, + { name: "wallets", type: "address[]" } + ], + Mail: [ + { name: "from", type: "Person" }, + { name: "to", type: "Person[]" }, + { name: "contents", type: "string" } + ], + Group: [ + { name: "name", type: "string" }, + { name: "members", type: "Person[]" } + ] + }, + domain: { + name: "Ether Mail", + version: "1", + chainId: 1, + verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" + }, + primaryType: "Mail", + message: { + from: { + name: "Cow", + wallets: ["0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", "0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF"] + }, + to: [ + { + name: "Bob", + wallets: [ + "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB", + "0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57", + "0xB0B0b0b0b0b0B000000000000000000000000000" + ] + } + ], + contents: "Hello, Bob!" + } + }; + + const result = await provider.send("eth_signTypedData", [accounts[0], typedData]); + assert.strictEqual( + result, + "0x65cbd956f2fae28a601bebc9b906cea0191744bd4c4247bcd27cd08f8eb6b71c78efdf7a31dc9abee78f492292721f362d296cf86b4538e07b51303b67f749061b" + ); + }); + }); + }); +}); \ No newline at end of file diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index c4655d3bd4..f91772e854 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,6 +1,6 @@ //#region Imports -import {types} from "@ganache/utils"; -import {toRpcSig, KECCAK256_NULL, ecsign, hashPersonalMessage} from "ethereumjs-util"; +import { types } from "@ganache/utils"; +import { TypedData as NotTypedData, signTypedData_v4 } from "eth-sig-util"; import EthereumOptions from "./options"; import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; import Blockchain from "./blockchain"; @@ -10,6 +10,8 @@ import Transaction from "./things/transaction"; import Wallet from "./wallet"; import {decode as rlpDecode} from "rlp"; +type TypedData = Exclude[1]["data"], NotTypedData>; + const createKeccakHash = require("keccak"); // Read in the current ganache version from core's package.json import {name, version} from "../../../packages/core/package.json"; @@ -730,7 +732,61 @@ export default class EthereumApi implements types.Api { const messageHash = hashPersonalMessage(Data.from(message).toBuffer()); const signature = ecsign(messageHash, privateKey); - return Promise.resolve(toRpcSig(signature.v, signature.r, signature.s, +this[_options].chainId)); + } + + /** + * + * @param address Address of the account that will sign the messages. + * @param typedData Typed structured data to be signed. + * @returns Signature. As in `eth_sign`, it is a hex encoded 129 byte array + * starting with `0x`. It encodes the `r`, `s`, and `v` parameters from + * appendix F of the [yellow paper](https://ethereum.github.io/yellowpaper/paper.pdf) + * in big-endian format. Bytes 0...64 contain the `r` parameter, bytes + * 64...128 the `s` parameter, and the last byte the `v` parameter. Note + * that the `v` parameter includes the chain id as specified in [EIP-155](https://eips.ethereum.org/EIPS/eip-155). + * @EIP [712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md) + */ + async eth_signTypedData(address: string | Buffer, typedData: TypedData) { + const account = Address.from(address).toString().toLowerCase(); + const wallet = this[_wallet]; + const isUnlocked = wallet.unlockedAccounts.has(account); + let privateKey: Buffer; + if (isUnlocked) { + const knownAccount = wallet.knownAccounts.get(account); + if (knownAccount) { + privateKey = knownAccount.toBuffer(); + } else { + throw new Error("cannot sign data; no private key"); + } + } else { + throw new Error("cannot sign data; account is locked"); + } + + if (!account) { + throw new Error("cannot sign data; no private key"); + } + + if (!typedData.types) { + throw new Error("cannot sign data; types missing"); + } + + if (!typedData.types.EIP712Domain) { + throw new Error("cannot sign data; EIP712Domain definition missing"); + } + + if (!typedData.domain) { + throw new Error("cannot sign data; domain missing"); + } + + if (!typedData.primaryType) { + throw new Error("cannot sign data; primaryType missing"); + } + + if (!typedData.message) { + throw new Error("cannot sign data; message missing"); + } + + return signTypedData_v4(privateKey, { data: typedData }); } eth_subscribe(subscriptionName: "newHeads", options?: any): PromiEvent { From 6b441fb89ebc229fe773613978b6243247a41a52 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:05:16 -0400 Subject: [PATCH 289/691] Whitespace changes --- src/chains/ethereum/src/api.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index f91772e854..81d8198a36 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -2,19 +2,19 @@ import { types } from "@ganache/utils"; import { TypedData as NotTypedData, signTypedData_v4 } from "eth-sig-util"; import EthereumOptions from "./options"; -import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; -import Blockchain from "./blockchain"; +import { Data, Quantity } from "@ganache/utils/src/things/json-rpc"; +import Blockchain, { BlockchainOptions } from "./blockchain"; import Tag from "./things/tags"; -import Address, {IndexableAddress} from "./things/address"; +import Address, { IndexableAddress } from "./things/address"; import Transaction from "./things/transaction"; import Wallet from "./wallet"; -import {decode as rlpDecode} from "rlp"; +import { decode as rlpDecode } from "rlp"; type TypedData = Exclude[1]["data"], NotTypedData>; const createKeccakHash = require("keccak"); // Read in the current ganache version from core's package.json -import {name, version} from "../../../packages/core/package.json"; +import { name, version } from "../../../packages/core/package.json"; import PromiEvent from "@ganache/utils/src/things/promievent"; import Emittery from "emittery"; import Account from "./things/account"; From 80168f20f0083f28c211aa7bf4277ea7a511feeb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:06:25 -0400 Subject: [PATCH 290/691] Refactor eth_sign --- src/chains/ethereum/src/api.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 81d8198a36..024a9497fb 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -718,20 +718,25 @@ export default class EthereumApi implements types.Api { * @param data message to sign * @returns Signature */ - eth_sign(account: string | Buffer, message: string | Buffer) { - const address = Address.from(account).toString().toLowerCase(); - const wallet =this[_wallet]; - const isUnlocked = wallet.unlockedAccounts[address]; + async eth_sign(address: string | Buffer, message: string | Buffer) { + const account = Address.from(address).toString().toLowerCase(); + const wallet = this[_wallet]; + const isUnlocked = wallet.unlockedAccounts.has(account); let privateKey: Buffer; if (isUnlocked) { - privateKey = wallet.knownAccounts.get[address]; + const knownAccount = wallet.knownAccounts.get(account); + if (knownAccount) { + privateKey = knownAccount.toBuffer(); + } else { + throw new Error("cannot sign data; no private key"); } - if (!privateKey) { - throw new Error("cannot sign data; no private key"); + } else { + throw new Error("cannot sign data; account is locked"); } const messageHash = hashPersonalMessage(Data.from(message).toBuffer()); const signature = ecsign(messageHash, privateKey); + return toRpcSig(signature.v, signature.r, signature.s, +this[_options].chainId); } /** From 371f615812b49a75b42777aebc62d20ca8c3b164 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:06:43 -0400 Subject: [PATCH 291/691] Refactor eth_sign --- src/chains/ethereum/src/api.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 024a9497fb..53cffc7bfa 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,5 +1,6 @@ //#region Imports import { types } from "@ganache/utils"; +import { toRpcSig, KECCAK256_NULL, ecsign, hashPersonalMessage } from "ethereumjs-util"; import { TypedData as NotTypedData, signTypedData_v4 } from "eth-sig-util"; import EthereumOptions from "./options"; import { Data, Quantity } from "@ganache/utils/src/things/json-rpc"; From 99b00c0590d60841fb4c60a20c8453d96bd39eec Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:06:53 -0400 Subject: [PATCH 292/691] Remove dead code --- src/chains/ethereum/src/api.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 53cffc7bfa..0d3ef4e516 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -18,7 +18,6 @@ const createKeccakHash = require("keccak"); import { name, version } from "../../../packages/core/package.json"; import PromiEvent from "@ganache/utils/src/things/promievent"; import Emittery from "emittery"; -import Account from "./things/account"; //#endregion //#region Constants From 2c9f7d5f8ea64bcba1810176b7df433c050d5b05 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:07:16 -0400 Subject: [PATCH 293/691] Add rpc_modules --- src/chains/ethereum/src/api.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 0d3ef4e516..f36b85d458 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -26,6 +26,7 @@ const BUFFER_ZERO = Buffer.from([0]); const CLIENT_VERSION = `EthereumJS${name}/v${version}/ethereum-js`; const PROTOCOL_VERSION = Data.from("0x3f"); const RPCQUANTITY_ZERO = Quantity.from("0x0"); +const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; //#endregion // We use symbols for private properties because types.Api @@ -924,4 +925,10 @@ export default class EthereumApi implements types.Api { }); return this[_blockchain].simulateTransaction(transaction, parentBlock, newBlock); } + + //#region rpc + async rpc_modules() { + return RPC_MODULES; + } + //endregion } From 564000bc884423dc9c85448ff4a54c0794eb22c8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:07:36 -0400 Subject: [PATCH 294/691] Add ssh stubs --- src/chains/ethereum/src/api.ts | 113 +++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index f36b85d458..c861fb6fc4 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -931,4 +931,117 @@ export default class EthereumApi implements types.Api { return RPC_MODULES; } //endregion + + //#region shh + + /** + * Creates new whisper identity in the client. + * + * @callback callback + * @param {error} err - Error Object + * @param {DATA, 60 Bytes} result - the address of the new identiy. + */ + async shh_newIdentity() { + return "0x00"; + }; + + /** + * Checks if the client hold the private keys for a given identity. + * + * @param {DATA, 60 Bytes} address - The identity address to check. + * @callback callback + * @param {error} err - Error Object + * @param {Boolean} result - returns true if the client holds the privatekey for that identity, otherwise false. + */ + async shh_hasIdentity(address: string) { + return false; + }; + + /** + * Creates a new group. + * + * @callback callback + * @param {error} err - Error Object + * @param {DATA, 60 Bytes} result - the address of the new group. + */ + async shh_newGroup() { + return "0x00"; + }; + + /** + * Adds a whisper identity to the group + * + * @param {DATA, 60 Bytes} - The identity address to add to a group. + * @callback callback + * @param {error} err - Error Object + * @param {Boolean} result - returns true if the identity was successfully added to the group, otherwise false. + */ + async shh_addToGroup(address: string) { + return false; + }; + + /** + * Creates filter to notify, when client receives whisper message matching the filter options. + * + * @param {DATA, 60 Bytes} to - + * ^(optional) Identity of the receiver. When present it will try to decrypt any incoming message + * if the client holds the private key to this identity. + * @param {Array of DATA} topics - Array of DATA topics which the incoming message's topics should match. + * @returns returns true if the identity was successfully added to the group, otherwise false. + */ + async shh_newFilter(to: string, topics: any[]) { + return false; + }; + + /** + * Uninstalls a filter with given id. Should always be called when watch is no longer needed. + * Additonally Filters timeout when they aren't requested with shh_getFilterChanges for a period of time. + * + * @param {QUANTITY} id - The filter id. Ex: "0x7" + * @returns true if the filter was successfully uninstalled, otherwise false. + */ + async shh_uninstallFilter(id: string) { + return false; + }; + + /** + * Polling method for whisper filters. Returns new messages since the last call of this method. + * + * @param {QUANTITY} id - The filter id. Ex: "0x7" + * @returns More Info: https://github.com/ethereum/wiki/wiki/JSON-RPC#shh_getfilterchanges + */ + async shh_getFilterChanges(id: string) { + return []; + }; + + /** + * Get all messages matching a filter. Unlike shh_getFilterChanges this returns all messages. + * + * @param {QUANTITY} id - The filter id. Ex: "0x7" + * @returns See: shh_getFilterChanges + */ + async shh_getMessages(id: string) { + return false; + }; + /** + * Sends a whisper message. + * + * @param {DATA, 60 Bytes} from - (optional) The identity of the sender. + * @param {DATA, 60 Bytes} to - + * ^(optional) The identity of the receiver. When present whisper will encrypt the message so that + * only the receiver can decrypt it. + * @param {Array of DATA} topics - Array of DATA topics, for the receiver to identify messages. + * @param {DATA} payload - The payload of the message. + * @param {QUANTITY} priority - The integer of the priority in a range from ... (?). + * @param {QUANTITY} ttl - integer of the time to live in seconds. + * @returns returns true if the message was sent, otherwise false. + */ + async shh_post(from: string, to: string, topics: any[], payload: string, priority: string, ttl: string) { + return false; + } + + async shh_version() { + return 2; + } + //#endregion } From 04247075cbfb3cba1cfe5753d2c30b66252c8e9f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:07:57 -0400 Subject: [PATCH 295/691] Whitespace changes --- src/chains/ethereum/src/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index c861fb6fc4..599deb168e 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -863,10 +863,10 @@ export default class EthereumApi implements types.Api { } } - async eth_newBlockFilter(): Promise{ + async eth_newBlockFilter(): Promise { } - async eth_newPendingTransactionFilter(): Promise{ + async eth_newPendingTransactionFilter(): Promise { } async eth_newFilter(params: any[]): Promise { From 70c1ce404f59e5d6319b268418ed12373fb9a5ce Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:08:20 -0400 Subject: [PATCH 296/691] Add EIP doctype comment to `eth_chainId` --- src/chains/ethereum/src/api.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 599deb168e..0511a0d4bc 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -472,6 +472,7 @@ export default class EthereumApi implements types.Api { * Returns the currently configured chain id, a value used in * replay-protected transaction signing as introduced by EIP-155. * @returns The chain id as a string. + * @EIP [155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) */ async eth_chainId(): Promise { return this[_options].chainId.toString(); From 05eadefc6e4b204b5d355ecdfe1a08783341b82e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:08:59 -0400 Subject: [PATCH 297/691] Add bzz stubs --- src/chains/ethereum/src/api.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 0511a0d4bc..099fc830a7 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -70,6 +70,16 @@ export default class EthereumApi implements types.Api { }); } + //#region bzz + async bzz_hive() { + return []; + } + + async bzz_info() { + return []; + } + //#endregion + //#region evm /** * Force a block to be mined. From a1f0d12cdad9847094385d436f92970747aabbd9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:09:10 -0400 Subject: [PATCH 298/691] Add db_ stubs --- src/chains/ethereum/src/api.ts | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 099fc830a7..8c34d9a451 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -70,6 +70,54 @@ export default class EthereumApi implements types.Api { }); } + //#region db + /** + * Stores a string in the local database. + * + * @param {String} dbName - Database name. + * @param {String} key - Key name. + * @param {String} value - String to store. + * @returns returns true if the value was stored, otherwise false. + */ + async db_putString(dbName, key, value) { + return false; + }; + + /** + * Returns string from the local database + * + * @param {String} dbName - Database name. + * @param {String} key - Key name. + * @returns The previously stored string. + */ + async db_getString(dbName, key) { + return ""; + }; + + /** + * Stores binary data in the local database. + * + * @param {String} dbName - Database name. + * @param {String} key - Key name. + * @param {DATA} data - Data to store. + * @returns true if the value was stored, otherwise false. + */ + async db_putHex(dbName, key, data) { + return false; + }; + + /** + * Returns binary data from the local database + * + * @param {String} dbName - Database name. + * @param {String} key - Key name. + * @returns The previously stored data. + */ + async db_getHex(dbName, key) { + return "0x00"; + }; + //#endregion + //#region bzz async bzz_hive() { return []; From 1e802ebf3e2f5e27a21581c55dbfa0ae5b6e1e0e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:10:03 -0400 Subject: [PATCH 299/691] Add #region comment for eth_ --- src/chains/ethereum/src/api.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 8c34d9a451..0c51053c58 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -364,6 +364,8 @@ export default class EthereumApi implements types.Api { } //#endregion + //#region eth + /** * Generates and returns an estimate of how much gas is necessary to allow the * transaction to complete. The transaction will not be added to the @@ -984,6 +986,8 @@ export default class EthereumApi implements types.Api { }); return this[_blockchain].simulateTransaction(transaction, parentBlock, newBlock); } + //#endregion + //#region rpc async rpc_modules() { From 238e12c283dfaa4f01fcedd6c697b7ca60b9a89e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:10:28 -0400 Subject: [PATCH 300/691] Refactor eth_sendTransaction --- src/chains/ethereum/src/api.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 0c51053c58..7b2b7a0f30 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -715,8 +715,9 @@ export default class EthereumApi implements types.Api { throw new Error("Invalid to address"); } - const isKnownAccount = this[_wallet].knownAccounts.has(fromString); - const isUnlockedAccount = this[_wallet].unlockedAccounts.has(fromString); + const wallet = this[_wallet]; + const isKnownAccount = wallet.knownAccounts.has(fromString); + const isUnlockedAccount = wallet.unlockedAccounts.has(fromString); if (!isUnlockedAccount) { const msg = isKnownAccount ? "signer account is locked" : "sender account not recognized"; @@ -751,7 +752,7 @@ export default class EthereumApi implements types.Api { } if (isKnownAccount) { - const secretKey = this[_wallet].knownAccounts.get(fromString); + const secretKey = wallet.knownAccounts.get(fromString); return this[_blockchain].queueTransaction(tx, secretKey); } From 9c353e818223b1b24deae8c43e53113845a928b8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:10:42 -0400 Subject: [PATCH 301/691] Add documentation to eth_getCode --- src/chains/ethereum/src/api.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 7b2b7a0f30..a564410053 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -550,6 +550,13 @@ export default class EthereumApi implements types.Api { return account.balance; } + /** + * Returns code at a given address. + * + * @param address 20 Bytes - address + * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter + * @returns the code from the given address. + */ async eth_getCode(address: Buffer | IndexableAddress, blockNumber: Buffer | Tag = Tag.LATEST) { const blockchain = this[_blockchain]; const blockProm = blockchain.blocks.getRaw(blockNumber); From 08c9d56ae585b2a4a5c3df7762097b455f998a96 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:11:05 -0400 Subject: [PATCH 302/691] Add eth_submitHashrate --- src/chains/ethereum/src/api.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index a564410053..13db5bc12d 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -487,6 +487,17 @@ export default class EthereumApi implements types.Api { return block.uncles.length.toString(); } + /** + * Used for submitting mining hashrate. + * + * @param {String} hashRate - a hexadecimal string representation (32 bytes) of the hash rate + * @param {String} clientID - A random hexadecimal(32 bytes) ID identifying the client + * @returns `true` if submitting went through succesfully and `false` otherwise. + */ + async eth_submitHashrate(hashRate: string, clientID: string) { + return false; + }; + /** * Returns true if client is actively mining new blocks. * @returns returns true of the client is mining, otherwise false. From 0ff55ab9df465b33d19520a85cb1548d769f24f5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:11:18 -0400 Subject: [PATCH 303/691] Add eth_submitWork --- src/chains/ethereum/src/api.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 13db5bc12d..f8b91485f8 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -487,6 +487,18 @@ export default class EthereumApi implements types.Api { return block.uncles.length.toString(); } + /** + * Used for submitting a proof-of-work solution + * + * @param {DATA, 8 Bytes} nonce - The nonce found (64 bits) + * @param {DATA, 32 Bytes} powHash - The header's pow-hash (256 bits) + * @param {DATA, 32 Bytes} digest - The mix digest (256 bits) + * @returns `true` if the provided solution is valid, otherwise `false`. + */ + async eth_submitWork(nonce: Data, powHash: Data, digest: Data) { + return false; + }; + /** * Used for submitting mining hashrate. * From 01bd11d080cc866664590e02a204933c0605ce23 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:11:27 -0400 Subject: [PATCH 304/691] Add eth_getWork --- src/chains/ethereum/src/api.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index f8b91485f8..e7b1148e83 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -487,6 +487,19 @@ export default class EthereumApi implements types.Api { return block.uncles.length.toString(); } + /** + * Returns: An Array with the following elements + * 1: DATA, 32 Bytes - current block header pow-hash + * 2: DATA, 32 Bytes - the seed hash used for the DAG. + * 3: DATA, 32 Bytes - the boundary condition ("target"), 2^256 / difficulty. + * + * @param {QUANTITY} filterId - A filter id + * @returns the hash of the current block, the seedHash, and the boundary condition to be met ("target"). + */ + async eth_getWork(filterId: Quantity) { + return []; + }; + /** * Used for submitting a proof-of-work solution * From b5c8a5c464e93954f180a9dbec41cfdda097d6cb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:11:40 -0400 Subject: [PATCH 305/691] Add eth_getUncleByBlockNumberAndIndex --- src/chains/ethereum/src/api.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index e7b1148e83..29030a4d2e 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -487,6 +487,16 @@ export default class EthereumApi implements types.Api { return block.uncles.length.toString(); } + /** + * Returns information about a uncle of a block by hash and uncle index position. + * + * @param blockNumber - a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. + * @param uncleIndex - the uncle's index position. + */ + async eth_getUncleByBlockNumberAndIndex(blockNumber: Buffer | Tag = Tag.LATEST, uncleIndex: Quantity) { + return {}; + } + /** * Returns: An Array with the following elements * 1: DATA, 32 Bytes - current block header pow-hash From 6d060e33b6b7ee2ad0d26148cae791d2c63df7ad Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:11:54 -0400 Subject: [PATCH 306/691] Add eth_getUncleByBlockHashAndIndex --- src/chains/ethereum/src/api.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 29030a4d2e..970d948497 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -487,6 +487,16 @@ export default class EthereumApi implements types.Api { return block.uncles.length.toString(); } + /** + * Returns information about a uncle of a block by hash and uncle index position. + * + * @param hash - hash of a block + * @param index - the uncle's index position. + */ + async eth_getUncleByBlockHashAndIndex(hash: Data, index: Quantity) { + return {}; + } + /** * Returns information about a uncle of a block by hash and uncle index position. * From af28c53c4a1b947b4af410122b85ff31359d6470 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:12:04 -0400 Subject: [PATCH 307/691] Add eth_getCompilers --- src/chains/ethereum/src/api.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 970d948497..ad1457aa29 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -449,6 +449,10 @@ export default class EthereumApi implements types.Api { return this.eth_getBlockTransactionCountByNumber(number); } + async eth_getCompilers() { + return []; + } + /** * Returns information about a transaction by block hash and transaction index position. * @param hash DATA, 32 Bytes - hash of a block. From efa458c2292a1925b365c6328b4e2d9ad231c17b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:13:28 -0400 Subject: [PATCH 308/691] Add personal_ methods --- .../__tests__/api/personal/personal.test.ts | 158 +++++++++++++++ src/chains/ethereum/src/api.ts | 172 +++++++++++++---- src/chains/ethereum/src/blockchain.ts | 35 ++-- src/chains/ethereum/src/options.ts | 9 +- src/chains/ethereum/src/provider.ts | 93 +-------- src/chains/ethereum/src/wallet.ts | 181 +++++++++++++++++- src/packages/utils/src/utils/index.ts | 3 +- src/packages/utils/src/utils/unref.ts | 17 ++ 8 files changed, 505 insertions(+), 163 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/personal/personal.test.ts create mode 100644 src/packages/utils/src/utils/unref.ts diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/__tests__/api/personal/personal.test.ts new file mode 100644 index 0000000000..d12bbe317e --- /dev/null +++ b/src/chains/ethereum/__tests__/api/personal/personal.test.ts @@ -0,0 +1,158 @@ +import assert from "assert"; +import getProvider from "../../helpers/getProvider"; +import { Quantity } from "@ganache/utils/src/things/json-rpc"; + +describe("api", () => { + describe("personal", () => { + describe("listAccounts", () => { + it("matches eth_accounts", async () => { + const provider = await getProvider({ seed: "temet nosce" }); + const accounts = await provider.send("eth_accounts"); + const personalAccounts = await provider.send("personal_listAccounts"); + assert.deepStrictEqual(personalAccounts, accounts); + }); + }); + describe("newAccount", () => { + it("generates deterministic accounts", async () => { + const controlProvider = await getProvider(); + const provider = await getProvider(); + const newAccount = await provider.send("personal_newAccount"); + const controlAccount = await controlProvider.send("personal_newAccount"); + assert.strictEqual(newAccount, controlAccount); + }); + + it("generates different accounts based on the `seed` option", async () => { + const controlProvider = await getProvider(); + const provider = await getProvider({ seed: "temet nosce" }); + const newAccount = await provider.send("personal_newAccount"); + const controlAccount = await controlProvider.send("personal_newAccount"); + assert.notStrictEqual(newAccount, controlAccount); + }); + + it("generates different accounts based on the `mnemonic` option", async () => { + const controlProvider = await getProvider(); + const provider = await getProvider({ mnemonic: "sweet treat" }); + const newAccount = await provider.send("personal_newAccount"); + const controlAccount = await controlProvider.send("personal_newAccount"); + assert.notStrictEqual(newAccount, controlAccount); + }); + + it("generates different accounts on successive calls", async () => { + const provider = await getProvider(); + const firstNewAccount = await provider.send("personal_newAccount"); + const secondNewAccount = await provider.send("personal_newAccount"); + assert.notStrictEqual(firstNewAccount, secondNewAccount); + }); + + it("generates different accounts on successive calls based on the seed", async () => { + const controlProvider = await getProvider(); + const provider = await getProvider({ seed: "temet nosce" }); + const firstNewAccount = await provider.send("personal_newAccount"); + const secondNewAccount = await provider.send("personal_newAccount"); + + await provider.send("personal_newAccount"); + const controlSecondNewAccount = await controlProvider.send("personal_newAccount"); + + assert.notStrictEqual(firstNewAccount, secondNewAccount, "First and second generated accounts are the same when they shouldn't be"); + assert.notStrictEqual(secondNewAccount, controlSecondNewAccount, "Second account is identical to control's second account when it shouldn't be"); + }); + + describe("personal_unlockAccount ➡ eth_sendTransaction ➡ personal_lockAccount", () => { + it("generates locked accounts with passphrase", async () => { + const provider = await getProvider({gasPrice: Quantity.from(0x0)}); + const passphrase = "this is my passphrase"; + // generate an account + const newAccount = await provider.send("personal_newAccount", [passphrase]); + + const transaction = { + from: newAccount, + to: newAccount, + gasLimit: 21000, + gasPrice: 0, + value: 0, + nonce: 0 + }; + + // make sure we can't use the account via eth_sendTransaction + await assert.rejects(provider.send("eth_sendTransaction", [transaction]), { + message: "signer account is locked" + }, "eth_sendTransaction should have rejected due to locked from account without its passphrase"); + + // unlock the account indefinitely + const unlocked = await provider.send("personal_unlockAccount", [newAccount, passphrase, 0]); + assert.strictEqual(unlocked, true); + + await provider.send("eth_subscribe", ["newHeads"]); + + // send a normal transaction + const transactionHash = await provider.send("eth_sendTransaction", [transaction]); + await provider.once("message"); + + // ensure sure it worked + const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(receipt.status, 1, "Transaction failed when it should have succeeded"); + + // lock the account + const accountLocked = await provider.send("personal_lockAccount", [newAccount]); + assert.strictEqual(accountLocked, true); + + // make sure it is locked + await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { + message: "signer account is locked" + }, "personal_lockAccount didn't work"); + }); + }); + + describe("personal_sendTransaction", () => { + it("generates locked accounts with passphrase", async () => { + const provider = await getProvider({gasPrice: Quantity.from(0x0)}); + const passphrase = "this is my passphrase"; + // generate an account + const newAccount = await provider.send("personal_newAccount", [passphrase]); + + const transaction = { + from: newAccount, + to: newAccount, + gasLimit: 21000, + gasPrice: 0, + value: 0, + nonce: 0 + }; + + // make sure we can't use the account via personal_sendTransaction and no passphrase + await assert.rejects(provider.send("personal_sendTransaction", [transaction]), { + message: "Invalid password" + }, "personal_sendTransaction should have rejected due to locked from account without its passphrase"); + + // make sure we can't use the account with bad passphrases + const invalidPassphrases = ["this is not my passphrase", null, undefined, Buffer.allocUnsafe(0), 1, 0, Infinity, NaN]; + await Promise.all(invalidPassphrases.map(invalidPassphrase => { + return assert.rejects(provider.send("personal_sendTransaction", [transaction, invalidPassphrase]), { + message: "Invalid password" + }, "Transaction should have rejected due to locked from account with wrong passphrase") + })); + + // use personal_sendTransaction with the valid passphrase + await provider.send("eth_subscribe", ["newHeads"]); + const transactionHashPromise = provider.send("personal_sendTransaction", [transaction, passphrase]); + const msgPromise = transactionHashPromise.then(() => provider.once("message")); + + await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { + message: "signer account is locked" + }, "personal_sendTransaction should not unlock the while transaction is bring processed"); + + const transactionHash = await transactionHashPromise + await msgPromise; + + const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(receipt.status, 1, "Transaction failed when it should have succeeded"); + + // ensure the account is still locked + await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { + message: "signer account is locked" + }, "personal_sendTransaction should still be locked the after the transaction is processed"); + }); + }); + }); + }); +}); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index ad1457aa29..1aad432b2d 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -32,7 +32,6 @@ const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0 // We use symbols for private properties because types.Api // only allows index types of index type '(...args: any) => Promise' const _blockchain = Symbol("blockchain"); -const _isMining = Symbol("isMining"); const _options = Symbol("options"); const _wallet = Symbol("wallet"); const _filters = Symbol("filters"); @@ -59,9 +58,12 @@ export default class EthereumApi implements types.Api { constructor(options: EthereumOptions, emitter: Emittery.Typed) { const opts = (this[_options] = options); - this[_wallet] = new Wallet(opts); + const {initialAccounts} = this[_wallet] = new Wallet(opts); - const blockchain = (this[_blockchain] = new Blockchain(options)); + const blockchainOptions = options as unknown as BlockchainOptions; + blockchainOptions.initialAccounts = initialAccounts; + blockchainOptions.coinbase = initialAccounts[0]; + const blockchain = (this[_blockchain] = new Blockchain(blockchainOptions)); blockchain.on("start", () => { emitter.emit("connect"); }); @@ -161,7 +163,7 @@ export default class EthereumApi implements types.Api { if (err) { return void reject(err) } - resolve(null); + resolve(null); }); }); }); @@ -311,7 +313,7 @@ export default class EthereumApi implements types.Api { * @param address */ async miner_setEtherbase(address: Address) { - this[_options].coinbase = new Account(address); + this[_blockchain].coinbase = address; return true; } //#endregion @@ -405,7 +407,7 @@ export default class EthereumApi implements types.Api { * @returns 20 bytes - the current coinbase address. */ async eth_coinbase(): Promise
{ - return this[_options].coinbase.address; + return this[_blockchain].coinbase; } /** @@ -576,7 +578,7 @@ export default class EthereumApi implements types.Api { * @returns Array of 20 Bytes - addresses owned by the client. */ async eth_accounts(): Promise { - return this[_wallet].accounts; + return this[_wallet].addresses; } /** @@ -859,7 +861,7 @@ export default class EthereumApi implements types.Api { privateKey = knownAccount.toBuffer(); } else { throw new Error("cannot sign data; no private key"); - } + } } else { throw new Error("cannot sign data; account is locked"); } @@ -945,27 +947,27 @@ export default class EthereumApi implements types.Api { }); return promiEvent; //case "logs": - // const promiEvent = new PromiEvent(resolve => { - // this.eth_newFilter([paramsz[1]]) - // .then(hexId => { - // resolve(hexId); - // }); - // }); - // promiEvent.then(hexId => { - // this[_filters] - // .get(hexId) - // .on("block") - // .then((block: any) => { - // const blockNumber = block.number; - // return [{ - // fromBlock: blockNumber, - // toBlock: blockNumber - // }]; - // }).then(this.eth_getLogs).then((logs: any) => { - // promiEvent.emit("result", logs); - // }); - // }); - // return promiEvent; + // const promiEvent = new PromiEvent(resolve => { + // this.eth_newFilter([paramsz[1]]) + // .then(hexId => { + // resolve(hexId); + // }); + // }); + // promiEvent.then(hexId => { + // this[_filters] + // .get(hexId) + // .on("block") + // .then((block: any) => { + // const blockNumber = block.number; + // return [{ + // fromBlock: blockNumber, + // toBlock: blockNumber + // }]; + // }).then(this.eth_getLogs).then((logs: any) => { + // promiEvent.emit("result", logs); + // }); + // }); + // return promiEvent; // case 'newPendingTransactions': // createSubscriptionFilter = self.newPendingTransactionFilter.bind(self) // break @@ -999,7 +1001,7 @@ export default class EthereumApi implements types.Api { } async eth_newFilter(params: any[]): Promise { - + } async eth_getFilterChanges(): Promise { @@ -1032,7 +1034,7 @@ export default class EthereumApi implements types.Api { const parentBlock = await blocks.get(blockNumber); const parentHeader = parentBlock.value.header; const options = this[_options]; - + if (!transaction.gasLimit) { if (!transaction.gas) { // eth_call isn't subject to regular transaction gas limits @@ -1048,7 +1050,7 @@ export default class EthereumApi implements types.Api { number: parentHeader.number, timestamp: parentHeader.timestamp, parentHash: parentHeader.parentHash, - coinbase: options.coinbase.address.toBuffer(), + coinbase: this[_blockchain].coinbase.toBuffer(), // gas estimates and eth_calls aren't subject to regular block gas limits gasLimit: transaction.gas }); @@ -1056,6 +1058,112 @@ export default class EthereumApi implements types.Api { } //#endregion + //#region personal + /** + * Returns all the Ethereum account addresses of all keys that have been + * added. + * @returns the Ethereum account addresses of all keys that have been added. + */ + async personal_listAccounts() { + return this[_wallet].addresses; + }; + + /** + * Generates a new accoutn with private key. Returns the address of the new + * account. + * @param passphrase + * @returns The new account's address + */ + async personal_newAccount(passphrase: string) { + const wallet = this[_wallet]; + const newAccount = wallet.createRandomAccount(this[_options].mnemonic); + const address = newAccount.address; + const strAddress = address.toString(); + wallet.addresses.push(address); + wallet.passphrases.set(strAddress, passphrase); + wallet.knownAccounts.set(strAddress, newAccount.privateKey) + return newAccount.address; + }; + + /** + * Imports the given unencrypted private key (hex string) into the key store, encrypting it with the passphrase. + * + * @param rawKey + * @param passphrase + * @returnsReturns the address of the new account. + */ + async personal_importRawKey(rawKey: string, passphrase: string) { + const wallet = this[_wallet]; + const newAccount = Wallet.createAccountFromPrivateKey(Data.from(rawKey)); + const address = newAccount.address; + const strAddress = address.toString(); + wallet.addresses.push(address); + wallet.passphrases.set(strAddress, passphrase); + wallet.knownAccounts.set(strAddress, newAccount.privateKey) + return newAccount.address; + }; + + /** + * Locks the account. The account can no longer be used to send transactions. + * @param address + */ + async personal_lockAccount(address: string) { + return this[_wallet].lockAccount(address.toLowerCase()); + }; + + /** + * Unlocks the account for use. + * + * The unencrypted key will be held in memory until the unlock duration + * expires. The unlock duration defaults to 300 seconds. An explicit duration + * of zero seconds unlocks the key until geth exits. + * + * The account can be used with eth_sign and eth_sendTransaction while it is + * unlocked. + * @param address 20 Bytes - The address of the account to unlock. + * @param passphrase Passphrase to unlock the account. + * @param duration (default: 300) Duration in seconds how long the account + * should remain unlocked for. + * @returns true if it worked. Throws an error if it did not. + */ + async personal_unlockAccount(address: string, passphrase: string, duration: number = 300) { + return this[_wallet].unlockAccount(address.toLowerCase(), passphrase, duration); + }; + + /** + * Validate the given passphrase and submit transaction. + * + * The transaction is the same argument as for eth_sendTransaction and + * contains the from address. If the passphrase can be used to decrypt the + * private key belogging to tx.from the transaction is verified, signed and + * send onto the network. The account is not unlocked globally in the node + * and cannot be used in other RPC calls. + * + * @param txData + * @param passphrase + */ + async personal_sendTransaction(transaction: any, passphrase: string) { + let fromString = transaction.from; + let from: Address; + if (fromString) { + from = Address.from(transaction.from); + fromString = from.toString().toLowerCase(); + } + + if (fromString == null) { + throw new Error("from not found; is required"); + } + + const wallet = this[_wallet]; + wallet.assertValidPassphrase(fromString, passphrase); + + const tx = new Transaction(transaction); + const secretKey = wallet.knownAccounts.get(fromString); + tx.sign(secretKey.toBuffer()); + + return this[_blockchain].queueTransaction(tx); + }; + //#endregion //#region rpc async rpc_modules() { diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index e80f754432..459a339b08 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -18,23 +18,8 @@ import {encode as rlpEncode} from "rlp"; import Common from "ethereumjs-common"; import VM from "ethereumjs-vm"; +import Address from "./things/address"; -/** - * In node, calling `unref(timer)` on a running timer ensures that the timer - * does not require that the Node.js event remain active. If there is no other - * activity keeping the event loop running, the process may exit before the - * timer's callback is invoked. - * @param timer - * @returns `true` if the timer could be `unref`ed, otherwise returns `false` - */ -function unref (timer: NodeJS.Timeout | number): timer is NodeJS.Timeout { - if (typeof timer === "object" && typeof timer.unref === "function") { - timer.unref(); - return true; - } else { - return false; - } -} export enum Status { // Flags @@ -45,10 +30,10 @@ export enum Status { paused = 16 // 0001 0000 } -type BlockchainOptions = { +export type BlockchainOptions = { db?: string | object; db_path?: string; - accounts?: Account[]; + initialAccounts?: Account[]; hardfork?: string; allowUnlimitedContractSize?: boolean; gasLimit?: Quantity; @@ -100,8 +85,10 @@ export default class Blockchain extends Emittery { TransactionReceipt ); this.accounts = new AccountManager(this, database.trie); + this.coinbase = options.coinbase.address; + + await this.#commitAccounts(options.initialAccounts); - await this.#initializeAccounts(options.accounts); let firstBlockTime: number; if (options.time != null) { firstBlockTime = +options.time @@ -141,10 +128,10 @@ export default class Blockchain extends Emittery { } else { promise = this.once("resume"); } - promise.then(() => unref(setTimeout(mine, minerInterval, pending))); + promise.then(() => utils.unref(setTimeout(mine, minerInterval, pending))); return void 0; }; - unref(setTimeout(mine, minerInterval, this.transactions.transactionPool.executables)); + utils.unref(setTimeout(mine, minerInterval, this.transactions.transactionPool.executables)); } miner.on("block", async (blockData: any) => { @@ -155,7 +142,7 @@ export default class Blockchain extends Emittery { const block = this.blocks.createBlock({ parentHash: previousHeader.hash(), number: Quantity.from(previousNumber + 1n).toBuffer(), - coinbase: options.coinbase.address.toBuffer(), + coinbase: this.coinbase.toBuffer(), timestamp: this.#currentTime(), // difficulty: gasLimit: options.gasLimit.toBuffer(), @@ -196,6 +183,8 @@ export default class Blockchain extends Emittery { }); } + coinbase: Address; + isMining = () => { return this.#state === Status.started; } @@ -246,7 +235,7 @@ export default class Blockchain extends Emittery { return vm; }; - #initializeAccounts = async (accounts: Account[]): Promise => { + #commitAccounts = async (accounts: Account[]): Promise => { const stateManager = this.vm.stateManager; const putAccount = promisify(stateManager.putAccount.bind(stateManager)); const checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); diff --git a/src/chains/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts index 5f14af6a37..113a6cd33d 100644 --- a/src/chains/ethereum/src/options.ts +++ b/src/chains/ethereum/src/options.ts @@ -1,5 +1,4 @@ import {ProviderOptions} from "@ganache/options"; -import Account from "./things/account"; type EthereumOptions = Pick< ProviderOptions, @@ -17,9 +16,9 @@ type EthereumOptions = Pick< | "time" | "blockTime" | "callGasLimit" -> & { - accounts: Account[]; - coinbase: Account -}; + | "accounts" + | "default_balance_ether" + | "mnemonic" +>; export default EthereumOptions; diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index aed76e6ba1..59197c5d15 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -1,28 +1,11 @@ -import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; import {ProviderOptions} from "@ganache/options"; import Emittery from "emittery"; import EthereumApi from "./api"; -import {privateToAddress} from "ethereumjs-util"; -import Account from "./things/account"; -import {mnemonicToSeedSync} from "bip39"; -import Address from "./things/address"; import JsonRpc from "@ganache/utils/src/things/jsonrpc"; import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; -import secp256k1 from "secp256k1"; -import HDKey from "hdkey"; import {types, utils} from "@ganache/utils"; import PromiEvent from "@ganache/utils/src/things/promievent"; -const createKeccakHash = require("keccak"); - -const uncompressedPublicKeyToAddress = (uncompressedPublicKey: Buffer) => { - const compresedPublicKey = secp256k1.publicKeyConvert(uncompressedPublicKey, false).slice(1); - const hasher = createKeccakHash("keccak256"); - hasher._state.absorb(compresedPublicKey); - return Address.from(hasher.digest().slice(-20)); -} - -const WEI = 1000000000000000000n; interface Callback { (err?: Error, response?: JsonRpc.Response): void; @@ -37,88 +20,14 @@ export default class EthereumProvider extends Emittery.Typed { - const _providerOptions = this.#options; - // convert a potentially fractional balance of Ether to WEI - const balanceParts = _providerOptions.default_balance_ether.toString().split(".", 2); - const significand = BigInt(balanceParts[0]); - const fractionalStr = balanceParts[1] || "0"; - const fractional = BigInt(fractionalStr); - const magnitude = 10n ** BigInt(fractionalStr.length); - const defaultBalanceInWei = (WEI * significand) + (fractional * (WEI/magnitude)); - const etherInWei = Quantity.from(defaultBalanceInWei); - let accounts: Account[]; - - let givenAccounts = _providerOptions.accounts; - let accountsLength; - if (givenAccounts && (accountsLength = givenAccounts.length) !== 0) { - const wallet = this.#wallet; - const hdPath = this.#options.hdPath; - accounts = Array(accountsLength); - for (let i = 0; i < accountsLength; i++) { - const account = givenAccounts[i]; - const secretKey = account.secretKey; - let privateKey; - let address: Address; - if (!secretKey) { - const acct = wallet.derive(hdPath + i); - address = uncompressedPublicKeyToAddress(acct.publicKey); - privateKey = Data.from(acct.privateKey); - } else { - privateKey = Data.from(secretKey); - } - accounts[i] = EthereumProvider.createAccount(Quantity.from(account.balance), privateKey, address); - } - } else { - const numerOfAccounts = _providerOptions.total_accounts; - if (numerOfAccounts) { - accounts = Array(numerOfAccounts); - const hdPath = this.#options.hdPath; - const wallet = this.#wallet; - - for (let index = 0; index < numerOfAccounts; index++) { - const acct = wallet.derive(hdPath + index); - const address = uncompressedPublicKeyToAddress(acct.publicKey); - const privateKey = Data.from(acct.privateKey); - accounts[index] = EthereumProvider.createAccount(etherInWei, privateKey, address); - } - } else { - throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); - } - } - return accounts; - }; - - // TODO: this should probable be moved as well (see `initializeAccounts` above) - static createAccount(balance: Quantity, privateKey: Data, address?: Address) { - address ||= Address.from(privateToAddress(privateKey.toBuffer())); - - const account = new Account(address); - account.privateKey = privateKey; - account.balance = balance; - - return account; + this.#api = new EthereumApi(_providerOptions as EthereumOptions, this); } /** diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 4da8c72c36..64f537d323 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -1,31 +1,58 @@ -import {Data} from "@ganache/utils/src/things/json-rpc"; +import { utils } from "@ganache/utils"; +import { Data, Quantity } from "@ganache/utils/src/things/json-rpc"; import Address from "./things/address"; import EthereumOptions from "./options"; +import { privateToAddress, toChecksumAddress } from "ethereumjs-util"; import Account from "./things/account"; -import {toChecksumAddress} from "ethereumjs-util"; +import secp256k1 from "secp256k1"; +import { ProviderOptions } from "@ganache/options"; +import { mnemonicToSeedSync } from "bip39"; +import HDKey from "hdkey"; +import { alea as rng } from "seedrandom"; + +import createKeccakHash from "keccak"; + +const WEI = 1000000000000000000n; +const RPCQUANTITY_ZERO = Quantity.from("0x0"); + +const uncompressedPublicKeyToAddress = (uncompressedPublicKey: Buffer) => { + const compresedPublicKey = secp256k1.publicKeyConvert(uncompressedPublicKey, false).slice(1); + const hasher = createKeccakHash("keccak256"); + (hasher as any)._state.absorb(compresedPublicKey); + return Address.from(hasher.digest().slice(-20)); +} + export default class Wallet { - readonly accounts: Address[]; + readonly addresses: Address[]; + readonly initialAccounts: Account[]; readonly knownAccounts = new Map(); + readonly passphrases = new Map(); readonly unlockedAccounts = new Set(); + readonly lockTimers = new Map(); + + #hdKey: HDKey; constructor(opts: EthereumOptions) { - const accounts = opts.accounts; + this.#hdKey = HDKey.fromMasterSeed(mnemonicToSeedSync(opts.mnemonic, null)); + + const initialAccounts = this.initialAccounts = this.#initializeAccounts(opts); + const knownAccounts = this.knownAccounts; const unlockedAccounts = this.unlockedAccounts; //#region Configure Known and Unlocked Accounts - const l = accounts.length; - const accountsCache = (this.accounts = Array(l)); + const l = initialAccounts.length; + const accountsCache = (this.addresses = Array(l)); for (let i = 0; i < l; i++) { - const account = accounts[i]; + const account = initialAccounts[i]; const address = account.address; const strAddress = address.toString(); accountsCache[i] = toChecksumAddress(strAddress); knownAccounts.set(strAddress, account.privateKey); // if the `secure` option has been set do NOT add these accounts to the - // _unlockedAccounts + // unlockedAccounts if (opts.secure) continue; unlockedAccounts.add(strAddress); @@ -38,7 +65,7 @@ export default class Wallet { const ul = givenUnlockedUaccounts.length; for (let i = 0; i < ul; i++) { let arg = givenUnlockedUaccounts[i]; - let address; + let address: string; switch (typeof arg) { case "string": // `toLowerCase` so we handle uppercase `0X` formats @@ -64,7 +91,7 @@ export default class Wallet { // break; // no break, please. } case "number": - const account = accounts[arg]; + const account = initialAccounts[arg]; if (account == null) { throw new Error(`Account at index ${arg} not found. Max index available is ${l - 1}.`); } @@ -78,4 +105,138 @@ export default class Wallet { } //#endregion } + + #seedCounter = 0n; + + #randomBytes = (length: number) => { + // Since this is a mock RPC library, the rng doesn't need to be + // cryptographically secure, and determinism is desired. + const buf = Buffer.allocUnsafe(length); + const seed = (this.#seedCounter += 1n); + const rand = rng(seed.toString()); + for (let i = 0; i < length; i++) { + buf[i] = (rand() * 255) | 0; + } + return buf; + } + + #initializeAccounts = (opts: ProviderOptions): Account[] => { + // convert a potentially fractional balance of Ether to WEI + const balanceParts = opts.default_balance_ether.toString().split(".", 2); + const significand = BigInt(balanceParts[0]); + const fractionalStr = balanceParts[1] || "0"; + const fractional = BigInt(fractionalStr); + const magnitude = 10n ** BigInt(fractionalStr.length); + const defaultBalanceInWei = (WEI * significand) + (fractional * (WEI/magnitude)); + const etherInWei = Quantity.from(defaultBalanceInWei); + let accounts: Account[]; + + let givenAccounts = opts.accounts; + let accountsLength: number; + if (givenAccounts && (accountsLength = givenAccounts.length) !== 0) { + const hdKey = this.#hdKey; + const hdPath = opts.hdPath; + accounts = Array(accountsLength); + for (let i = 0; i < accountsLength; i++) { + const account = givenAccounts[i]; + const secretKey = account.secretKey; + let privateKey: Data; + let address: Address; + if (!secretKey) { + const acct = hdKey.derive(hdPath + i); + address = uncompressedPublicKeyToAddress(acct.publicKey); + privateKey = Data.from(acct.privateKey); + accounts[i] = Wallet.createAccount(Quantity.from(account.balance), privateKey, address); + } else { + privateKey = Data.from(secretKey); + const a = accounts[i] = Wallet.createAccountFromPrivateKey(privateKey); + a.balance = Quantity.from(account.balance); + } + } + } else { + const numerOfAccounts = opts.total_accounts; + if (numerOfAccounts) { + accounts = Array(numerOfAccounts); + const hdPath = opts.hdPath; + const hdKey = this.#hdKey; + + for (let index = 0; index < numerOfAccounts; index++) { + const acct = hdKey.derive(hdPath + index); + const address = uncompressedPublicKeyToAddress(acct.publicKey); + const privateKey = Data.from(acct.privateKey); + accounts[index] = Wallet.createAccount(etherInWei, privateKey, address); + } + } else { + throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); + } + } + return accounts; + }; + + public static createAccount(balance: Quantity, privateKey: Data, address: Address) { + const account = new Account(address); + account.privateKey = privateKey; + account.balance = balance; + return account; + } + + public static createAccountFromPrivateKey(privateKey: Data) { + const address = Address.from(privateToAddress(privateKey.toBuffer())); + const account = new Account(address); + account.privateKey = privateKey; + return account; + } + + public createRandomAccount(startingSeed: string) { + // create some seeded deterministic psuedo-randomness based on the chain's + // initial starting conditions (`startingSeed`) + const seed = Buffer.concat([Buffer.from(startingSeed), this.#randomBytes(64)]); + const acct = HDKey.fromMasterSeed(seed); + const address = uncompressedPublicKeyToAddress(acct.publicKey); + const privateKey = Data.from(acct.privateKey); + return Wallet.createAccount(RPCQUANTITY_ZERO, privateKey, address); + } + + public assertValidPassphrase(lowerAddress: string, passphrase: string) { + const storedPassphrase = this.passphrases.get(lowerAddress); + if (storedPassphrase === undefined) { + throw new Error("Account not found"); + } + + if (passphrase !== storedPassphrase) { + throw new Error("Invalid password"); + } + + return true; + } + + public unlockAccount(lowerAddress: string, passphrase: string, duration: number) { + this.assertValidPassphrase(lowerAddress, passphrase); + + const existingTimer = this.lockTimers.get(lowerAddress); + if (existingTimer) { + clearTimeout(existingTimer as number); + } + + // a duration <= 0 will remain unlocked + const durationMs = (duration * 1000) | 0; + if (durationMs > 0) { + const timeout = setTimeout(this.#lockAccount, durationMs, lowerAddress); + utils.unref(timeout); + this.lockTimers.set(lowerAddress, timeout); + } + this.unlockedAccounts.add(lowerAddress); + return true; + } + + #lockAccount = (lowerAddress: string) => { + this.lockTimers.delete(lowerAddress); + this.unlockedAccounts.delete(lowerAddress); + return true; + } + + public lockAccount(lowerAddress: string) { + clearTimeout(this.lockTimers.get(lowerAddress) as number); + return this.#lockAccount(lowerAddress); + } } diff --git a/src/packages/utils/src/utils/index.ts b/src/packages/utils/src/utils/index.ts index fe8688df58..b98c54e4ad 100644 --- a/src/packages/utils/src/utils/index.ts +++ b/src/packages/utils/src/utils/index.ts @@ -1,4 +1,5 @@ export * from "./bigint-to-buffer"; export * from "./executor"; export * from "./heap"; -export * from "./request-coordinator"; \ No newline at end of file +export * from "./request-coordinator"; +export * from "./unref"; \ No newline at end of file diff --git a/src/packages/utils/src/utils/unref.ts b/src/packages/utils/src/utils/unref.ts new file mode 100644 index 0000000000..2baab8ef21 --- /dev/null +++ b/src/packages/utils/src/utils/unref.ts @@ -0,0 +1,17 @@ + +/** + * In node, calling `unref(timer)` on a running timer ensures that the timer + * does not require that the Node.js event remain active. If there is no other + * activity keeping the event loop running, the process may exit before the + * timer's callback is invoked. + * @param timer + * @returns `true` if the timer could be `unref`ed, otherwise returns `false` + */ +export function unref(timer: NodeJS.Timeout | number): timer is NodeJS.Timeout { + if (typeof timer === "object" && typeof timer.unref === "function") { + timer.unref(); + return true; + } else { + return false; + } +} \ No newline at end of file From 6a801aefc8727e4c62a9cef45db09ea0d1e4638d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 15:16:18 -0400 Subject: [PATCH 309/691] Move ethereum's @types to its src dir so they work --- .../ethereum/{ => src/@types}/@types/ethereumjs-block/header.d.ts | 0 .../ethereum/{ => src/@types}/@types/ethereumjs-block/index.d.ts | 0 .../ethereum/{ => src/@types}/@types/ethereumjs-util/index.d.ts | 0 src/chains/ethereum/{ => src/@types}/@types/hdkey/index.d.ts | 0 src/chains/ethereum/{ => src/@types}/@types/levelup/index.d.ts | 0 .../{ => src/@types}/@types/merkle-patricia-tree/baseTrie.ts | 0 .../{ => src/@types}/@types/merkle-patricia-tree/index.d.ts | 0 .../{ => src/@types}/@types/merkle-patricia-tree/readStream.ts | 0 .../{ => src/@types}/@types/merkle-patricia-tree/trieNode.ts | 0 src/chains/ethereum/{ => src/@types}/@types/solc/index.d.ts | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename src/chains/ethereum/{ => src/@types}/@types/ethereumjs-block/header.d.ts (100%) rename src/chains/ethereum/{ => src/@types}/@types/ethereumjs-block/index.d.ts (100%) rename src/chains/ethereum/{ => src/@types}/@types/ethereumjs-util/index.d.ts (100%) rename src/chains/ethereum/{ => src/@types}/@types/hdkey/index.d.ts (100%) rename src/chains/ethereum/{ => src/@types}/@types/levelup/index.d.ts (100%) rename src/chains/ethereum/{ => src/@types}/@types/merkle-patricia-tree/baseTrie.ts (100%) rename src/chains/ethereum/{ => src/@types}/@types/merkle-patricia-tree/index.d.ts (100%) rename src/chains/ethereum/{ => src/@types}/@types/merkle-patricia-tree/readStream.ts (100%) rename src/chains/ethereum/{ => src/@types}/@types/merkle-patricia-tree/trieNode.ts (100%) rename src/chains/ethereum/{ => src/@types}/@types/solc/index.d.ts (100%) diff --git a/src/chains/ethereum/@types/ethereumjs-block/header.d.ts b/src/chains/ethereum/src/@types/@types/ethereumjs-block/header.d.ts similarity index 100% rename from src/chains/ethereum/@types/ethereumjs-block/header.d.ts rename to src/chains/ethereum/src/@types/@types/ethereumjs-block/header.d.ts diff --git a/src/chains/ethereum/@types/ethereumjs-block/index.d.ts b/src/chains/ethereum/src/@types/@types/ethereumjs-block/index.d.ts similarity index 100% rename from src/chains/ethereum/@types/ethereumjs-block/index.d.ts rename to src/chains/ethereum/src/@types/@types/ethereumjs-block/index.d.ts diff --git a/src/chains/ethereum/@types/ethereumjs-util/index.d.ts b/src/chains/ethereum/src/@types/@types/ethereumjs-util/index.d.ts similarity index 100% rename from src/chains/ethereum/@types/ethereumjs-util/index.d.ts rename to src/chains/ethereum/src/@types/@types/ethereumjs-util/index.d.ts diff --git a/src/chains/ethereum/@types/hdkey/index.d.ts b/src/chains/ethereum/src/@types/@types/hdkey/index.d.ts similarity index 100% rename from src/chains/ethereum/@types/hdkey/index.d.ts rename to src/chains/ethereum/src/@types/@types/hdkey/index.d.ts diff --git a/src/chains/ethereum/@types/levelup/index.d.ts b/src/chains/ethereum/src/@types/@types/levelup/index.d.ts similarity index 100% rename from src/chains/ethereum/@types/levelup/index.d.ts rename to src/chains/ethereum/src/@types/@types/levelup/index.d.ts diff --git a/src/chains/ethereum/@types/merkle-patricia-tree/baseTrie.ts b/src/chains/ethereum/src/@types/@types/merkle-patricia-tree/baseTrie.ts similarity index 100% rename from src/chains/ethereum/@types/merkle-patricia-tree/baseTrie.ts rename to src/chains/ethereum/src/@types/@types/merkle-patricia-tree/baseTrie.ts diff --git a/src/chains/ethereum/@types/merkle-patricia-tree/index.d.ts b/src/chains/ethereum/src/@types/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from src/chains/ethereum/@types/merkle-patricia-tree/index.d.ts rename to src/chains/ethereum/src/@types/@types/merkle-patricia-tree/index.d.ts diff --git a/src/chains/ethereum/@types/merkle-patricia-tree/readStream.ts b/src/chains/ethereum/src/@types/@types/merkle-patricia-tree/readStream.ts similarity index 100% rename from src/chains/ethereum/@types/merkle-patricia-tree/readStream.ts rename to src/chains/ethereum/src/@types/@types/merkle-patricia-tree/readStream.ts diff --git a/src/chains/ethereum/@types/merkle-patricia-tree/trieNode.ts b/src/chains/ethereum/src/@types/@types/merkle-patricia-tree/trieNode.ts similarity index 100% rename from src/chains/ethereum/@types/merkle-patricia-tree/trieNode.ts rename to src/chains/ethereum/src/@types/@types/merkle-patricia-tree/trieNode.ts diff --git a/src/chains/ethereum/@types/solc/index.d.ts b/src/chains/ethereum/src/@types/@types/solc/index.d.ts similarity index 100% rename from src/chains/ethereum/@types/solc/index.d.ts rename to src/chains/ethereum/src/@types/@types/solc/index.d.ts From bdbb75fd1301be5f8e4657beab01b4f93e8eaf13 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 20:50:19 -0400 Subject: [PATCH 310/691] Create buffer from the preallocated buffer instead of new memory --- src/chains/ethereum/src/things/transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 4d6adcc96d..d9ec2bd22d 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -267,7 +267,7 @@ class Transaction extends (EthereumJsTransaction as any) { if (buf.equals(BUFFER_ZERO)) { // if the address is 0x0 make it 0x0{20} - toAccount = Buffer.alloc(20, 0); + toAccount = Buffer.allocUnsafe(20).fill(0); } else { toAccount = buf; } From ac458e53ee2af69dde9f3cabce88cb0814f4b510 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 20:50:37 -0400 Subject: [PATCH 311/691] Remove dead code --- src/chains/ethereum/__tests__/temp-tests.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index c5aef42efe..d7193dbad2 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -3,7 +3,6 @@ import {Quantity} from "@ganache/utils/src/things/json-rpc"; import {ProviderOptions} from "@ganache/options"; import getProvider from "./helpers/getProvider"; import compile from "./helpers/compile"; -import { readFileSync } from "fs-extra"; import { join } from "path"; /** From 57565706ddaf9650d0999a088468a009ff2c1e02 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 20:51:04 -0400 Subject: [PATCH 312/691] Add bzz stub tests --- .../ethereum/__tests__/api/bzz/bzz.test.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/chains/ethereum/__tests__/api/bzz/bzz.test.ts diff --git a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts new file mode 100644 index 0000000000..60bdba232d --- /dev/null +++ b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts @@ -0,0 +1,23 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; + +describe("api", () => { + describe("bzz", () => { + let provider: EthereumProvider; + before(async () => { + provider = await getProvider(); + }); + + it("bzz_hive stub returns value", async () => { + const result = await provider.send("bzz_hive"); + assert.deepStrictEqual(result, []); + }); + + it("bzz_info stub returns value", async () => { + const result = await provider.send("bzz_info"); + assert.deepStrictEqual(result, []); + }); + }); +}); From 107d3f49b5d6a77bb8100765a30ea83433146f52 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 20:51:15 -0400 Subject: [PATCH 313/691] Add db stub tests --- .../ethereum/__tests__/api/db/db.test.ts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/chains/ethereum/__tests__/api/db/db.test.ts diff --git a/src/chains/ethereum/__tests__/api/db/db.test.ts b/src/chains/ethereum/__tests__/api/db/db.test.ts new file mode 100644 index 0000000000..f07432c70b --- /dev/null +++ b/src/chains/ethereum/__tests__/api/db/db.test.ts @@ -0,0 +1,33 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; + +describe("api", () => { + describe("db", () => { + let provider: EthereumProvider; + beforeEach(async () => { + provider = await getProvider(); + }); + + it("db_putString", async () => { + const result = await provider.send("db_putString", ["", "", ""]); + assert.deepStrictEqual(result, false); + }); + + it("db_getString", async () => { + const result = await provider.send("db_getString", ["", ""]); + assert.deepStrictEqual(result, ""); + }); + + it("db_putHex", async () => { + const result = await provider.send("db_putHex", ["", "", ""]); + assert.deepStrictEqual(result, false); + }); + + it("db_getHex", async () => { + const result = await provider.send("db_getHex", ["", ""]); + assert.deepStrictEqual(result, "0x00"); + }); + }); +}); From f2ff7118bb8ecd8886eabbb800b5f2a3133a08a4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:13:05 -0400 Subject: [PATCH 314/691] Add web3 tests --- .../ethereum/__tests__/api/web3/web3.test.ts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/chains/ethereum/__tests__/api/web3/web3.test.ts diff --git a/src/chains/ethereum/__tests__/api/web3/web3.test.ts b/src/chains/ethereum/__tests__/api/web3/web3.test.ts new file mode 100644 index 0000000000..db673fa169 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/web3/web3.test.ts @@ -0,0 +1,26 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +import { version } from "../../../../../packages/core/package.json"; + +describe("api", () => { + describe("web3", () => { + let provider: EthereumProvider; + before(async () => { + provider = await getProvider(); + }); + + it("web3_clientVersion returns the client version", async () => { + const result = await provider.send("web3_clientVersion"); + assert.deepStrictEqual(result, "Ganache/v" + version); + }); + + it("web3_sha should hash the given input", async () => { + const input = "Tim is a swell guy."; + const result = await provider.send("web3_sha3", [input]); + + assert.strictEqual(result, "0xee80d4ac03202e2246d51a596c76a18e1a6d899bed9f05246d998fb656d9bd1f"); + }); + }); +}); From 884e201c3dc6ff329b8c261c9d207a60b62a2940 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:13:23 -0400 Subject: [PATCH 315/691] Add levelup.LevelUp type to database --- src/chains/ethereum/src/database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index e0b2262ec7..2e80096121 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -48,7 +48,7 @@ export default class Database extends Emittery { #initialize = async () => { const levelupOptions: any = {valueEncoding: "binary"}; const store = this.#options.db; - let db; + let db: levelup.LevelUp; if (store) { this.#rootStore = store as any; db = levelup(store as any, levelupOptions); From 2af253b8f64c61305f5f0327b09a40249cae9368 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:13:36 -0400 Subject: [PATCH 316/691] Handle callback style as promise --- src/chains/ethereum/src/database.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index 2e80096121..854378faa8 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -144,7 +144,10 @@ export default class Database extends Emittery { #cleanup = async () => { const db = this.db; if (db) { - await db.close(); + await new Promise((resolve, reject) => db.close((err => { + if (err) return void reject(err); + resolve(); + }))); await Promise.all([this.blocks.close(), this.transactions.close(), this.trie.close()]); } return new Promise(resolve => this.#cleanupDirectory(resolve)); From bb68ad8b3af27542d96fca39198b50d8d97149b2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:13:55 -0400 Subject: [PATCH 317/691] Implement `getRaw` for block tags --- .../ethereum/src/components/block-manager.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index 64c8ad5546..014734a3e1 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -66,6 +66,33 @@ export default class BlockManager extends Manager { return super.get(number); } + async getRaw(tagOrBlockNumber: string | Buffer | Tag) { + if (typeof tagOrBlockNumber === "string") { + const tag = Tag.normalize(tagOrBlockNumber as Tag); + switch (tag) { + case Tag.LATEST: + tagOrBlockNumber = this.latest.value.header.number; + if (tagOrBlockNumber.length === 0){ + tagOrBlockNumber = Buffer.from([0]); + } + case void 0: + case null: + // the key is probably a hex string, let nature takes its course. + break; + case Tag.PENDING: + tagOrBlockNumber = this.pending.value.header.number; + case Tag.EARLIEST: + tagOrBlockNumber = this.earliest.value.header.number; + default: + // this probably can't happen. but if someone passed something like + // `toString` in as a block tag and it got this far... maybe we'd + // get here... + throw new Error(`Invalid block Tag: ${tagOrBlockNumber}`); + } + } + return super.getRaw(tagOrBlockNumber); + } + async get(tagOrBlockNumber: string | Buffer | Tag): Promise { if (typeof tagOrBlockNumber === "string") { const tag = Tag.normalize(tagOrBlockNumber as Tag); From a0bd1d20c497b84408b891b8bf8c4161a722e6cf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:14:26 -0400 Subject: [PATCH 318/691] Align invalid method error with geth --- src/packages/core/__tests__/connector.ts | 10 +++++----- src/packages/utils/src/utils/executor.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/packages/core/__tests__/connector.ts b/src/packages/core/__tests__/connector.ts index f0fa72f596..c158e80f04 100644 --- a/src/packages/core/__tests__/connector.ts +++ b/src/packages/core/__tests__/connector.ts @@ -61,7 +61,7 @@ describe("connector", () => { // own properties (and __proto__ properties) can't be executed. (p as any)._engine._ledger.__proto__.illegalProperty = true; await assert.rejects(p.send("illegalProperty" as any, []), { - message: "Invalid or unsupported method: illegalProperty" + message: "`The method illegalProperty does not exist/is not available`" }); }); @@ -78,9 +78,9 @@ describe("connector", () => { " ", "constructor" ] as const; - illegalMethodNames.forEach(name => { - assert.throws(() => p.send(name as any), { - message: `Invalid or unsupported method: ${name}` + illegalMethodNames.forEach(methodName => { + assert.throws(() => p.send(methodName as any), { + message: `The method ${methodName} does not exist/is not available` }); }); @@ -122,7 +122,7 @@ describe("connector", () => { ); }), { - message: `Invalid or unsupported method: ${method}` + message: `The method ${method} does not exist/is not available` } ); }) diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index ee89060bc2..7909a0c163 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -47,6 +47,6 @@ export class Executor { } } - throw new Error(`Invalid or unsupported method: ${methodName}`); + throw new Error(`The method ${methodName} does not exist/is not available`); }; } From b882cb21aadf0248e7e538c6f1bc57607d32e87b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:15:01 -0400 Subject: [PATCH 319/691] Update version string to be more Ganachey --- src/chains/ethereum/src/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 1aad432b2d..6e1fe4bdbf 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -15,7 +15,7 @@ type TypedData = Exclude[1]["data"], NotType const createKeccakHash = require("keccak"); // Read in the current ganache version from core's package.json -import { name, version } from "../../../packages/core/package.json"; +import { version } from "../../../packages/core/package.json"; import PromiEvent from "@ganache/utils/src/things/promievent"; import Emittery from "emittery"; //#endregion @@ -23,7 +23,7 @@ import Emittery from "emittery"; //#region Constants const BUFFER_EMPTY = Buffer.allocUnsafe(0); const BUFFER_ZERO = Buffer.from([0]); -const CLIENT_VERSION = `EthereumJS${name}/v${version}/ethereum-js`; +const CLIENT_VERSION = `Ganache/v${version}`; const PROTOCOL_VERSION = Data.from("0x3f"); const RPCQUANTITY_ZERO = Quantity.from("0x0"); const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; From cb41708f5cfbe06b2c4b79a0a9e519772ff0413f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:15:25 -0400 Subject: [PATCH 320/691] Add an uncle test --- .../ethereum/__tests__/api/eth/uncles.test.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/chains/ethereum/__tests__/api/eth/uncles.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts new file mode 100644 index 0000000000..3e8540b811 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts @@ -0,0 +1,20 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; + +describe("api", () => { + describe("eth", () => { + describe("uncles", () => { + let provider: EthereumProvider; + beforeEach(async () => { + provider = await getProvider(); + }); + + it("eth_getUncleByBlockHashAndIndex", async () => { + const result = await provider.send("eth_getUncleByBlockHashAndIndex"); + assert.deepStrictEqual(result, {}) + }); + }); + }); +}) \ No newline at end of file From 197380b9b7d64865a5abcac8849f569da8026ada Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:16:02 -0400 Subject: [PATCH 321/691] Add storage tests --- .../api/eth/contracts/GetStorageAt.sol | 6 ++ .../__tests__/api/eth/getStorageAt.test.ts | 73 +++++++++++++++++++ src/chains/ethereum/src/api.ts | 19 ++--- 3 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol create mode 100644 src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol b/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol new file mode 100644 index 0000000000..1d500fb70f --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol @@ -0,0 +1,6 @@ +pragma solidity ^0.6.1; + +contract GetStorageAt { + uint256 public intValue1 = 123; + address public self = address(0x01); +} diff --git a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts new file mode 100644 index 0000000000..94d5ac7c33 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts @@ -0,0 +1,73 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +import compile from "../../helpers/compile"; +import { join } from "path"; +import { Quantity } from "@ganache/utils/src/things/json-rpc"; +const THIRTY_TWO_BYES = "0".repeat(64); + +describe("api", () => { + describe("eth", () => { + describe("getStorageAt", () => { + let provider: EthereumProvider; + const contract = compile(join(__dirname, "./contracts/GetStorageAt.sol")); + let contractAddress: string; + let contractMethods: any; + + beforeEach(async () => { + + provider = await getProvider({ + defaultTransactionGasLimit: Quantity.from(6721975) + }); + const accounts = await provider.send("eth_accounts"); + const from = accounts[0]; + + await provider.send("eth_subscribe", ["newHeads"]); + + const transactionHash = await provider.send("eth_sendTransaction", [ + { + from, + data: contract.code + } + ]); + + await provider.once("message"); + + const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + + contractAddress = receipt.contractAddress; + contractMethods = contract.contract.evm.methodIdentifiers; + }); + + it("returns the value at the hex position", async () => { + const result = await provider.send("eth_getStorageAt", [contractAddress, "0x0"]) + assert.strictEqual(BigInt(result), 123n); + const result2 = await provider.send("eth_getStorageAt", [contractAddress, "0x1"]) + assert.strictEqual(result2, "0x01"); + }); + + it("returns the value at the 32-byte hex position", async () => { + const result = await provider.send("eth_getStorageAt", [contractAddress, "0x" + THIRTY_TWO_BYES]) + assert.strictEqual(BigInt(result), 123n); + const result2 = await provider.send("eth_getStorageAt", [contractAddress, "0x" + THIRTY_TWO_BYES.slice(-1) + "1"]) + assert.strictEqual(result2, "0x01"); + }); + + it("returns the value even when hex positions exceeds 32-bytes", async () => { + const thirtyThreeBytePosition = "0x1" + THIRTY_TWO_BYES; + const result = await provider.send("eth_getStorageAt", [contractAddress, thirtyThreeBytePosition]); + assert.strictEqual(BigInt(result), 123n); + const thirtyThreeBytePosition2 = "0x" + THIRTY_TWO_BYES + "1"; + const result2 = await provider.send("eth_getStorageAt", [contractAddress, thirtyThreeBytePosition2]); + assert.strictEqual(result2, "0x01"); + }); + + it("rejects when the block doesn't exist", async () => { + await assert.rejects(provider.send("eth_getStorageAt", [contractAddress, "0x0", "0x2"]), { + message: "header not found" + }); + }); + }); + }); +}); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 6e1fe4bdbf..468dbc1c27 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -688,7 +688,7 @@ export default class EthereumApi implements types.Api { }); }); const block = await blockProm; - if (!block) return Data.from("0x"); + if (!block) throw new Error("header not found"); const blockData = (rlpDecode(block) as unknown) as [ [Buffer, Buffer, Buffer, Buffer /* stateRoot */] /* header */, @@ -702,18 +702,19 @@ export default class EthereumApi implements types.Api { const addressDataPromise = getFromTrie(Address.from(address).toBuffer()); const posBuff = Quantity.from(position).toBuffer(); - // if the provided `position` is > 32 bytes it's invalid. - // TODO: should we ignore or just return an RPC exception of some sort? const length = posBuff.length; - if (length > 32) return Data.from("0x"); let paddedPosBuff: Buffer; - if (length !== 32) { - // storage locations are 32 byte wide Buffers, so we need to - // expand any value given to at least 32 bytes - paddedPosBuff = Buffer.alloc(32); + if (length < 32) { + // storage locations are 32 bytes wide, so we need to expand any value + // given to 32 bytes. + paddedPosBuff = Buffer.allocUnsafe(32).fill(0); posBuff.copy(paddedPosBuff, 32 - length); - } else { + } else if (length === 32) { paddedPosBuff = posBuff; + } else { + // if the position value we're passed is > 32 bytes, truncate it. This is + // what geth does. + paddedPosBuff = posBuff.slice(-32); } const addressData = await addressDataPromise; From 66978366846b1b975a9cf778487e753eb37c1b31 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:16:28 -0400 Subject: [PATCH 322/691] Update getCode block-not-foudn behavior --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 468dbc1c27..9b5d586a29 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -632,7 +632,7 @@ export default class EthereumApi implements types.Api { }); }); const block = await blockProm; - if (!block) return Data.from("0x"); + if (!block) throw new Error("header not found"); const blockData = (rlpDecode(block) as unknown) as [ [Buffer, Buffer, Buffer, Buffer /* stateRoot */] /* header */, From b0f9e1bd878ca4f5cbf89e58df97b9238df47a07 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:16:45 -0400 Subject: [PATCH 323/691] Refactor miner_stop/start --- src/chains/ethereum/src/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 9b5d586a29..4f520d00d0 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -284,9 +284,9 @@ export default class EthereumApi implements types.Api { * @param threads * @returns true */ - miner_start(threads: number = 1) { + async miner_start(threads: number = 1) { this[_blockchain].resume(threads); - return Promise.resolve(true); + return true; } /** @@ -294,7 +294,7 @@ export default class EthereumApi implements types.Api { */ async miner_stop() { this[_blockchain].pause(); - return Promise.resolve(true); + return true; } /** From b4b3a6bfbbbfc04afbd9ab742993755b1f321853 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 20 Jul 2020 21:17:01 -0400 Subject: [PATCH 324/691] Add eth_sign tests --- .../__tests__/api/eth/eth_sign.test.ts | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/chains/ethereum/__tests__/api/eth/eth_sign.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/eth_sign.test.ts b/src/chains/ethereum/__tests__/api/eth/eth_sign.test.ts new file mode 100644 index 0000000000..8aff40dfc7 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/eth_sign.test.ts @@ -0,0 +1,67 @@ +import assert from "assert"; +import { ecrecover, pubToAddress, fromSigned, hashPersonalMessage } from "ethereumjs-util"; +import getProvider from "../../helpers/getProvider"; +import { Data } from "@ganache/utils/src/things/json-rpc"; + +describe("api", () => { + describe("eth", () => { + describe("sign", function () { + let accounts; + let provider; + + // Load account. + before(async function () { + // This account produces an edge case signature when it signs the hex-encoded buffer: + // '0x07091653daf94aafce9acf09e22dbde1ddf77f740f9844ac1f0ab790334f0627'. (See Issue #190) + const acc = { + balance: "0x0", + secretKey: "0xe6d66f02cd45a13982b99a5abf3deab1f67cf7be9fee62f0a072cb70896342e4" + }; + provider = await getProvider({ + accounts: [acc] + }) + accounts = await provider.send("eth_accounts"); + }); + + it("should produce a signature whose signer can be recovered", async function() { + const msg = Buffer.from("0xffffffffff"); + const msgHash = hashPersonalMessage(msg); + + const address = accounts[0]; + let sgn = await provider.send("eth_sign", [address, Data.from(msg).toString()]); + sgn = sgn.slice(2); + + const r = Buffer.from(sgn.slice(0, 64), "hex"); + const s = Buffer.from(sgn.slice(64, 128), "hex"); + const v = parseInt(sgn.slice(128, 130), 16) + 27; + const pub = ecrecover(msgHash, v, r, s); + const addr = fromSigned(pubToAddress(pub)); + const strAddr = "0x" + addr.toString("hex"); + assert.strictEqual(strAddr, accounts[0].toLowerCase()); + }); + + it("should work if ecsign produces 'r' or 's' components that start with 0", async function() { + // This message produces a zero prefixed 'r' component when signed by + // ecsign w/ the account set in this test's 'before' block. + const msgHex = "0x07091653daf94aafce9acf09e22dbde1ddf77f740f9844ac1f0ab790334f0627"; + const edgeCaseMsg = Data.from(msgHex).toBuffer(); + const msgHash = hashPersonalMessage(edgeCaseMsg); + + let sgn = await provider.send("eth_sign", [accounts[0], msgHex]); + sgn = sgn.slice(2); + + const r = Buffer.from(sgn.slice(0, 64), "hex"); + const s = Buffer.from(sgn.slice(64, 128), "hex"); + const v = parseInt(sgn.slice(128, 130), 16) + 27; + const pub = ecrecover(msgHash, v, r, s); + const addr = fromSigned(pubToAddress(pub)); + const strAddr = "0x" + addr.toString("hex"); + assert.deepStrictEqual(strAddr, accounts[0].toLowerCase()); + }); + + after("shutdown", async () => { + provider && await provider.disconnect(); + }); + }); + }); +}); \ No newline at end of file From 1f3393c3cf741fb3de467423b39b332b24d6e222 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 10:54:22 -0400 Subject: [PATCH 325/691] Avoid superfluous Promise in evm_mine --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 4f520d00d0..f19ded9b9b 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -140,7 +140,7 @@ export default class EthereumApi implements types.Api { */ async evm_mine(timestamp?: number) { await this[_blockchain].transactions.transactionPool.drain(0, timestamp); - return Promise.resolve("0x0"); + return "0x0"; } /** From 35f2a434484763508ea8017724a7adf9aa7ce852 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 10:54:35 -0400 Subject: [PATCH 326/691] Refactor eth_call --- src/chains/ethereum/src/api.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index f19ded9b9b..31f306b42e 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1031,7 +1031,8 @@ export default class EthereumApi implements types.Api { } async eth_call(transaction: any, blockNumber: Buffer | Tag | string = Tag.LATEST): Promise { - const blocks = this[_blockchain].blocks; + const blockchain = this[_blockchain]; + const blocks = blockchain.blocks; const parentBlock = await blocks.get(blockNumber); const parentHeader = parentBlock.value.header; const options = this[_options]; @@ -1051,11 +1052,11 @@ export default class EthereumApi implements types.Api { number: parentHeader.number, timestamp: parentHeader.timestamp, parentHash: parentHeader.parentHash, - coinbase: this[_blockchain].coinbase.toBuffer(), + coinbase: blockchain.coinbase.toBuffer(), // gas estimates and eth_calls aren't subject to regular block gas limits gasLimit: transaction.gas }); - return this[_blockchain].simulateTransaction(transaction, parentBlock, newBlock); + return blockchain.simulateTransaction(transaction, parentBlock, newBlock); } //#endregion From e2cc72c309d1c9943fdd300a52d2eced86892239 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 16:36:13 -0400 Subject: [PATCH 327/691] Update dev docs & include a `.vscode/launch.json` --- docs/README.md | 81 ++++++++++++++++++++++++++++++++---------------- docs/launch.json | 40 ++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 27 deletions(-) create mode 100644 docs/launch.json diff --git a/docs/README.md b/docs/README.md index 54224c9635..5cbb352d82 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,10 +8,11 @@ * `npm install` ## Clean install + * `npm run clean` * `npm install` - ## VSCode On Windows (10) +## VSCode On Windows (10) * Enable "Developer Mode" by going to Settings -> Developer Settings -> Then select Developer Mode. @@ -19,30 +20,30 @@ Builds all packages: -* `npm run tsc` + * `npm run tsc` ## To test Runs all tests: -* `npm test` + * `npm test` ## To create a new package -* `npm run create ` + * `npm run create ` -This will create a new package with Ganache defaults at `packages/`. +This will create a new package with Ganache defaults at `src/packages/`. ## To add a module to a package: -* `npx lerna add [@version] -E [--dev] [--peer] --scope=` + * `npx lerna add [@version] -E [--dev] [--peer] --scope=` -Where `` is the npm-module you want to add and `` is where you -want to add it. See [@lerna/add documentation](https://github.com/lerna/lerna/tree/master/commands/add) for more details. +Where `` is the npm-module you want to add and `` is where you want to add it. See +[@lerna/add documentation](https://github.com/lerna/lerna/tree/master/commands/add) for more details. Example: -``` +```bash npx lerna add @ganache/options --scope=@ganache/filecoin ``` @@ -52,28 +53,54 @@ will add our local `@ganache/options` package to the `@ganache/filecoin` package `cd` to the package and then run `npm uninstall ` +## To debug tests in VS Code + + * Copy the [`launch.json`](./launch.json) file into a folder named `.vscode` in root of the project. + * Set breakpoints by clicking the margin to the left of the line numbers (you can set conditional breakpoints or + logpoints by right-clicking instead) + * Press F5 (or select `Run` 🡺 `Start Debugging` from the menu bar) to automatically start debugging. + +To change which files are debugged update your `.vscode/launch.json` file glob to match your target files. Here is an +example to debug only test files in the ethereum package: + +```diff +diff --git a/.vscode/launch.json b/.vscode/launch.json +index 688d3d4..815e111 100644 +--- a/.vscode/launch.json ++++ b/.vscode/launch.json +@@ -28,7 +28,7 @@ + "ts", + "--recursive", + "--check-leaks", +- "**/__tests__/**/*.test.ts" ++ "**/ethereum/__tests__/**/*.test.ts" + ], + "skipFiles": [ + "/**/*.js" +``` + ## Code Conventions These are guidelines, not rules. :-) -- Use Node v10.7.0 for most local development. This is the earliest version we support. -- Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed - `Number.MAX_SAFE_INTEGER` -- Write tests. -- Do not use "Optional Chaining" (`obj?.prop`). I'd love to enable this, but TypeScript makes it hard to use bigint + * Use Node v10.7.0 for most local development. This is the earliest version we support. + * Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed + `Number.MAX_SAFE_INTEGER`. + * Write tests. + * Do not use "Optional Chaining" (`obj?.prop`). I'd love to enable this, but TypeScript makes it hard to use bigint literals and optional chaining together. -- Prefer using a single loop to functional chaining. -- Prefer performant code over your own developer experience. -- Document complex code. Explain why the code does what it does. -- Feel free to be clever, just document _why_ you're being clever. If it's hard to read, comment _what_ the code does, + * Prefer using a single loop to functional chaining. + * Prefer performant code over your own developer experience. + * Document complex code. Explain why the code does what it does. + * Feel free to be clever, just document _why_ you're being clever. If it's hard to read, comment _what_ the code does, too. -- Add JSDoc comments to public class members where it makes sense. -- Before adding an external dependency check its code for quality, its # of external dependencies, its node version + * Add JSDoc comments to public class members where it makes sense. + * Before adding an external dependency check its code for quality, its # of external dependencies, its node version support, and make sure it absolutely necessary. -- Pin all dependencies, even dev dependencies. -- Use npm; do not use yarn. -- Don't use web3, ethers, etc in ganache-core core code. (Tests are fine) -- Ensure a smooth development experience on Windows, Mac, and Linux. -- Do not use bash scripts. -- Do not use CLI commands in npm scripts or build scripts that aren't available by default on supported platforms. -- Push your code often (at least every-other day!), even broken WIP code (to your own branch, of course). + * Pin all dependencies, even dev dependencies. + * Use npm; do not use yarn. + * Don't use web3, ethers, etc in ganache-core core code. (Tests are fine) + * Ensure a smooth development experience on Windows, Mac, and Linux. + * Do not use bash scripts. + * Do not use CLI commands in npm scripts or build scripts that aren't available by default on supported platforms. + * Push your code often (at least every-other day!), even broken WIP code (to your own branch, of course). diff --git a/docs/launch.json b/docs/launch.json new file mode 100644 index 0000000000..73c80b58f3 --- /dev/null +++ b/docs/launch.json @@ -0,0 +1,40 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Typescript Mocha All", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "env": { + "TS_NODE_FILES": "true" + }, + "runtimeArgs": [ + "--throw-deprecation", + "--trace-warnings" + ], + "runtimeVersion": "10.7.0", + "args": [ + "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "--timeout", + "999999", + "--colors", + "--require", + "ts-node/register", + "--watch-extensions", + "ts", + "--recursive", + "--check-leaks", + "**/__tests__/**/*.test.ts" + ], + "skipFiles": [ + "/**/*.js" + ], + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen" + } + ] +} \ No newline at end of file From ee578afa6f6cca92484a081bf2fbd0428fb79f9a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 16:42:01 -0400 Subject: [PATCH 328/691] just a little test --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..8794813076 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +docs/launch.json linguist-language=JSON5 \ No newline at end of file From f2f7b3f8e35ad4154a4ae07dffcf432ef049ea9e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 16:42:32 -0400 Subject: [PATCH 329/691] Another test --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 8794813076..385a778843 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -docs/launch.json linguist-language=JSON5 \ No newline at end of file +*.json linguist-language=JSON5 \ No newline at end of file From 3745f40a255fe3cb064b3b8310b951f6010cae13 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 16:47:39 -0400 Subject: [PATCH 330/691] Try again... it *might* just take github a moment to update --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 385a778843..8794813076 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -*.json linguist-language=JSON5 \ No newline at end of file +docs/launch.json linguist-language=JSON5 \ No newline at end of file From c73824fd88020cf140b05ed84e53a3c89a18ce7e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 16:58:27 -0400 Subject: [PATCH 331/691] I think this fixes woes I had with patch-package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2aef6b91f4..503849ddf8 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "scripts": { "clean": "npx shx rm -rf node_modules && npx lerna clean -y", "create": "ts-node ./scripts/create", - "postinstall": "npx patch-package && lerna bootstrap", + "postinstall": "lerna bootstrap && npx patch-package", "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm test", "tsc": "lerna exec -- npm run tsc" From e62bbfa7e68a20ce2fc9cce628220f92fdb63123 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:04:05 -0400 Subject: [PATCH 332/691] Make eth_accounts return lowercased accounts --- src/chains/ethereum/__tests__/provider.test.ts | 2 +- src/chains/ethereum/src/wallet.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/chains/ethereum/__tests__/provider.test.ts b/src/chains/ethereum/__tests__/provider.test.ts index 9d703d7ec7..c5a329186c 100644 --- a/src/chains/ethereum/__tests__/provider.test.ts +++ b/src/chains/ethereum/__tests__/provider.test.ts @@ -9,7 +9,7 @@ describe("provider", () => { it("generates predictable accounts when given a seed", async () => { const provider = await getProvider({seed: "temet nosce"}); const accounts = await provider.send("eth_accounts"); - assert.strictEqual(accounts[0], "0x59eF313E6Ee26BaB6bcb1B5694e59613Debd88DA"); + assert.strictEqual(accounts[0], "0x59ef313e6ee26bab6bcb1b5694e59613debd88da"); }); }); diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 64f537d323..a14e89821b 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -2,7 +2,7 @@ import { utils } from "@ganache/utils"; import { Data, Quantity } from "@ganache/utils/src/things/json-rpc"; import Address from "./things/address"; import EthereumOptions from "./options"; -import { privateToAddress, toChecksumAddress } from "ethereumjs-util"; +import { privateToAddress } from "ethereumjs-util"; import Account from "./things/account"; import secp256k1 from "secp256k1"; import { ProviderOptions } from "@ganache/options"; @@ -24,7 +24,7 @@ const uncompressedPublicKeyToAddress = (uncompressedPublicKey: Buffer) => { export default class Wallet { - readonly addresses: Address[]; + readonly addresses: string[]; readonly initialAccounts: Account[]; readonly knownAccounts = new Map(); readonly passphrases = new Map(); @@ -48,7 +48,7 @@ export default class Wallet { const account = initialAccounts[i]; const address = account.address; const strAddress = address.toString(); - accountsCache[i] = toChecksumAddress(strAddress); + accountsCache[i] = strAddress; knownAccounts.set(strAddress, account.privateKey); // if the `secure` option has been set do NOT add these accounts to the @@ -60,11 +60,11 @@ export default class Wallet { //#endregion //#region Unlocked Accounts - const givenUnlockedUaccounts = opts.unlocked_accounts; - if (givenUnlockedUaccounts) { - const ul = givenUnlockedUaccounts.length; + const givenUnlockedAccounts = opts.unlocked_accounts; + if (givenUnlockedAccounts) { + const ul = givenUnlockedAccounts.length; for (let i = 0; i < ul; i++) { - let arg = givenUnlockedUaccounts[i]; + let arg = givenUnlockedAccounts[i]; let address: string; switch (typeof arg) { case "string": @@ -79,7 +79,7 @@ export default class Wallet { // to `123`, and there is probably an error on the user's side we'd // want to uncover. const index = (arg as any) - 0; - // if we don't have a valid number, or the number isn't an valid JS + // if we don't have a valid number, or the number isn't a valid JS // integer (no bigints or decimals, please), throw an error. if (!Number.isSafeInteger(index)) { throw new Error(`Invalid value in unlocked_accounts: ${arg}`); From e9bc8035214b11f4ebbf8916890ddfa2c1288d4d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:12:49 -0400 Subject: [PATCH 333/691] Ad tests for `personal_importRawKey` --- .../__tests__/api/personal/personal.test.ts | 196 +++++++++++------- 1 file changed, 119 insertions(+), 77 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/__tests__/api/personal/personal.test.ts index d12bbe317e..4a0ab9a550 100644 --- a/src/chains/ethereum/__tests__/api/personal/personal.test.ts +++ b/src/chains/ethereum/__tests__/api/personal/personal.test.ts @@ -1,6 +1,7 @@ import assert from "assert"; import getProvider from "../../helpers/getProvider"; import { Quantity } from "@ganache/utils/src/things/json-rpc"; +import EthereumProvider from "../../../src/provider"; describe("api", () => { describe("personal", () => { @@ -12,6 +13,90 @@ describe("api", () => { assert.deepStrictEqual(personalAccounts, accounts); }); }); + + async function testLockedAccountWithPassphraseViaEth_SendTransaction(provider: EthereumProvider, newAccount: string, passphrase: string) { + const transaction = { + from: newAccount, + to: newAccount, + gasLimit: 21000, + gasPrice: 0, + value: 0, + nonce: 0 + }; + + // make sure we can't use the account via eth_sendTransaction + await assert.rejects(provider.send("eth_sendTransaction", [transaction]), { + message: "signer account is locked" + }, "eth_sendTransaction should have rejected due to locked from account without its passphrase"); + + // unlock the account indefinitely + const unlocked = await provider.send("personal_unlockAccount", [newAccount, passphrase, 0]); + assert.strictEqual(unlocked, true); + + await provider.send("eth_subscribe", ["newHeads"]); + + // send a normal transaction + const transactionHash = await provider.send("eth_sendTransaction", [transaction]); + await provider.once("message"); + + // ensure sure it worked + const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(receipt.status, 1, "Transaction failed when it should have succeeded"); + + // lock the account + const accountLocked = await provider.send("personal_lockAccount", [newAccount]); + assert.strictEqual(accountLocked, true); + + // make sure it is locked + await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { + message: "signer account is locked" + }, "personal_lockAccount didn't work"); + } + + async function testLockedAccountWithPassphraseViaPersonal_SendTransaction(provider: EthereumProvider, newAccount: string, passphrase: string){ + const transaction = { + from: newAccount, + to: newAccount, + gasLimit: 21000, + gasPrice: 0, + value: 0, + nonce: 0 + }; + + // make sure we can't use the account via personal_sendTransaction and no passphrase + await assert.rejects(provider.send("personal_sendTransaction", [transaction]), { + message: "Invalid password" + }, "personal_sendTransaction should have rejected due to locked from account without its passphrase"); + + // make sure we can't use the account with bad passphrases + const invalidPassphrases = ["this is not my passphrase", null, undefined, Buffer.allocUnsafe(0), 1, 0, Infinity, NaN]; + await Promise.all(invalidPassphrases.map(invalidPassphrase => { + return assert.rejects(provider.send("personal_sendTransaction", [transaction, invalidPassphrase]), { + message: "Invalid password" + }, "Transaction should have rejected due to locked from account with wrong passphrase") + })); + + // use personal_sendTransaction with the valid passphrase + await provider.send("eth_subscribe", ["newHeads"]); + const transactionHashPromise = provider.send("personal_sendTransaction", [transaction, passphrase]); + const msgPromise = transactionHashPromise.then(() => provider.once("message")); + + await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { + message: "signer account is locked" + }, "personal_sendTransaction should not unlock the while transaction is bring processed"); + + const transactionHash = await transactionHashPromise + await msgPromise; + + const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(receipt.status, 1, "Transaction failed when it should have succeeded"); + + // ensure the account is still locked + await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { + message: "signer account is locked" + }, "personal_sendTransaction should still be locked the after the transaction is processed"); + } + describe("newAccount", () => { it("generates deterministic accounts", async () => { const controlProvider = await getProvider(); @@ -64,42 +149,7 @@ describe("api", () => { // generate an account const newAccount = await provider.send("personal_newAccount", [passphrase]); - const transaction = { - from: newAccount, - to: newAccount, - gasLimit: 21000, - gasPrice: 0, - value: 0, - nonce: 0 - }; - - // make sure we can't use the account via eth_sendTransaction - await assert.rejects(provider.send("eth_sendTransaction", [transaction]), { - message: "signer account is locked" - }, "eth_sendTransaction should have rejected due to locked from account without its passphrase"); - - // unlock the account indefinitely - const unlocked = await provider.send("personal_unlockAccount", [newAccount, passphrase, 0]); - assert.strictEqual(unlocked, true); - - await provider.send("eth_subscribe", ["newHeads"]); - - // send a normal transaction - const transactionHash = await provider.send("eth_sendTransaction", [transaction]); - await provider.once("message"); - - // ensure sure it worked - const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); - assert.strictEqual(receipt.status, 1, "Transaction failed when it should have succeeded"); - - // lock the account - const accountLocked = await provider.send("personal_lockAccount", [newAccount]); - assert.strictEqual(accountLocked, true); - - // make sure it is locked - await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { - message: "signer account is locked" - }, "personal_lockAccount didn't work"); + testLockedAccountWithPassphraseViaEth_SendTransaction(provider, newAccount, passphrase); }); }); @@ -110,47 +160,39 @@ describe("api", () => { // generate an account const newAccount = await provider.send("personal_newAccount", [passphrase]); - const transaction = { - from: newAccount, - to: newAccount, - gasLimit: 21000, - gasPrice: 0, - value: 0, - nonce: 0 - }; - - // make sure we can't use the account via personal_sendTransaction and no passphrase - await assert.rejects(provider.send("personal_sendTransaction", [transaction]), { - message: "Invalid password" - }, "personal_sendTransaction should have rejected due to locked from account without its passphrase"); - - // make sure we can't use the account with bad passphrases - const invalidPassphrases = ["this is not my passphrase", null, undefined, Buffer.allocUnsafe(0), 1, 0, Infinity, NaN]; - await Promise.all(invalidPassphrases.map(invalidPassphrase => { - return assert.rejects(provider.send("personal_sendTransaction", [transaction, invalidPassphrase]), { - message: "Invalid password" - }, "Transaction should have rejected due to locked from account with wrong passphrase") - })); - - // use personal_sendTransaction with the valid passphrase - await provider.send("eth_subscribe", ["newHeads"]); - const transactionHashPromise = provider.send("personal_sendTransaction", [transaction, passphrase]); - const msgPromise = transactionHashPromise.then(() => provider.once("message")); - - await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { - message: "signer account is locked" - }, "personal_sendTransaction should not unlock the while transaction is bring processed"); - - const transactionHash = await transactionHashPromise - await msgPromise; - - const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); - assert.strictEqual(receipt.status, 1, "Transaction failed when it should have succeeded"); - - // ensure the account is still locked - await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { - message: "signer account is locked" - }, "personal_sendTransaction should still be locked the after the transaction is processed"); + testLockedAccountWithPassphraseViaPersonal_SendTransaction(provider, newAccount, passphrase); + }); + }); + }); + + describe("personal_importRawKey", () => { + const secretKey = "0x0123456789012345678901234567890123456789012345678901234567890123"; + const passphrase = "this is my passphrase"; + + it("should return the known account address", async () => { + const provider = await getProvider(); + const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); + assert.strictEqual(newAccount, "0x14791697260e4c9a71f18484c9f997b308e59325", "Raw account not imported correctly"); + }); + + describe("personal_unlockAccount ➡ eth_sendTransaction ➡ personal_lockAccount", () => { + it("generates locked accounts with passphrase", async () => { + const provider = await getProvider({gasPrice: Quantity.from(0x0)}); + const passphrase = "this is my passphrase"; + // generate an account + const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); + + testLockedAccountWithPassphraseViaEth_SendTransaction(provider, newAccount, passphrase); + }); + }); + + describe("personal_sendTransaction", () => { + it("generates locked accounts with passphrase", async () => { + const provider = await getProvider({gasPrice: Quantity.from(0x0)}); + // generate an account + const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); + + testLockedAccountWithPassphraseViaPersonal_SendTransaction(provider, newAccount, passphrase); }); }); }); From b85b3af9035fd3d9fdd2badb842083f09e45c470 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:14:11 -0400 Subject: [PATCH 334/691] Add evm_mine tests --- .../ethereum/__tests__/api/evm/evm.test.ts | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 383742a537..323244d50c 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -32,4 +32,50 @@ describe("api", () => { assert.strictEqual(timeAdjustment, seconds); }); }); + + describe("evm_mine", () => { + it("should mine a block on demand", async () => { + const provider = await getProvider(); + const initialBlock = parseInt(await provider.send("eth_blockNumber")); + await provider.send("evm_mine"); + const currentBlock = parseInt(await provider.send("eth_blockNumber")); + assert.strictEqual(currentBlock, initialBlock + 1); + }); + + it("should mine a block on demand at the specified timestamp", async () => { + const startDate = new Date(2019, 3, 15); + const miningTimestamp = Math.floor((new Date(2020, 3, 15).getTime() / 1000)); + const provider = await getProvider({time: startDate}); + await provider.send("evm_mine", [miningTimestamp]); + const currentBlock = await provider.send("eth_getBlockByNumber", ["latest"]); + assert.strictEqual(parseInt(currentBlock.timestamp), miningTimestamp); + }); + + it("should mine a block even when mining is stopped", async () => { + const provider = await getProvider(); + const initialBlock = parseInt(await provider.send("eth_blockNumber")); + await provider.send("miner_stop"); + await provider.send("evm_mine"); + const currentBlock = parseInt(await provider.send("eth_blockNumber")); + assert.strictEqual(currentBlock, initialBlock + 1); + }); + + it("should mine a block when in interval mode", async () => { + const provider = await getProvider({blockTime: 1000}); + const initialBlock = parseInt(await provider.send("eth_blockNumber")); + await provider.send("evm_mine"); + const currentBlock = parseInt(await provider.send("eth_blockNumber")); + assert.strictEqual(currentBlock, initialBlock + 1); + }); + + it("should mine a block when in interval mode even when mining is stopped", async () => { + const provider = await getProvider({blockTime: 1000}); + const initialBlock = parseInt(await provider.send("eth_blockNumber")); + await provider.send("miner_stop"); + await provider.send("evm_mine"); + const currentBlock = parseInt(await provider.send("eth_blockNumber")); + assert.strictEqual(currentBlock, initialBlock + 1); + }); + }); + }); }); \ No newline at end of file From 174a7031dd8798b39e3813f1f5db793f010e8ed3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:14:25 -0400 Subject: [PATCH 335/691] Add describes to evm tests --- src/chains/ethereum/__tests__/api/evm/evm.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 323244d50c..63bd51d9d5 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -7,6 +7,7 @@ function between(x: number, min: number, max: number) { describe("api", () => { describe("evm", () => { + describe("evm_setTime", () => { it("should set the time correctly when difference is greater than 2**31", async () => { // this test is here to prevent a dev from "optimizing" rounding to use // bitwise tricks since those won't work on numbers greater than 2**31. @@ -24,7 +25,9 @@ describe("api", () => { const baseLineOffset = Math.floor((newTime - now) / 1000); assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); }); + }); + describe("evm_increaseTime", () => { it("should return the `timeAdjustment` value via `evm_increaseTime`", async () => { const provider = await getProvider(); const seconds = 10; @@ -78,4 +81,4 @@ describe("api", () => { }); }); }); -}); \ No newline at end of file +}); From d1961d0626c120c8c3674c709740fe62aef01955 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:14:48 -0400 Subject: [PATCH 336/691] No changes. git is weird --- .../ethereum/__tests__/api/evm/evm.test.ts | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 63bd51d9d5..7c4a0f111a 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -8,33 +8,33 @@ function between(x: number, min: number, max: number) { describe("api", () => { describe("evm", () => { describe("evm_setTime", () => { - it("should set the time correctly when difference is greater than 2**31", async () => { - // this test is here to prevent a dev from "optimizing" rounding to use - // bitwise tricks since those won't work on numbers greater than 2**31. + it("should set the time correctly when difference is greater than 2**31", async () => { + // this test is here to prevent a dev from "optimizing" rounding to use + // bitwise tricks since those won't work on numbers greater than 2**31. - const provider = await getProvider(); - // Multiple by 1000 because ganache keeps track of time in seconds - const bin32 = (2**31) * 1000; - const now = Date.now(); - // fast forward time by bin32, plus 2 seconds, in case testing is slow - const newTime = bin32 + now + 2; + const provider = await getProvider(); + // Multiple by 1000 because ganache keeps track of time in seconds + const bin32 = (2**31) * 1000; + const now = Date.now(); + // fast forward time by bin32, plus 2 seconds, in case testing is slow + const newTime = bin32 + now + 2; - const timeAdjustment = await provider.send("evm_setTime", [newTime]); - - // it should return `newTime - now`, floored to the nearest second - const baseLineOffset = Math.floor((newTime - now) / 1000); - assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); - }); + const timeAdjustment = await provider.send("evm_setTime", [newTime]); + + // it should return `newTime - now`, floored to the nearest second + const baseLineOffset = Math.floor((newTime - now) / 1000); + assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); + }); }); describe("evm_increaseTime", () => { - it("should return the `timeAdjustment` value via `evm_increaseTime`", async () => { - const provider = await getProvider(); - const seconds = 10; - const timeAdjustment = await provider.send("evm_increaseTime", [seconds]); - assert.strictEqual(timeAdjustment, seconds); + it("should return the `timeAdjustment` value via `evm_increaseTime`", async () => { + const provider = await getProvider(); + const seconds = 10; + const timeAdjustment = await provider.send("evm_increaseTime", [seconds]); + assert.strictEqual(timeAdjustment, seconds); + }); }); - }); describe("evm_mine", () => { it("should mine a block on demand", async () => { From 285aa11094841de1bf336e52d8e16a15fa053636 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:14:59 -0400 Subject: [PATCH 337/691] Move eth_sign tests --- .../ethereum/__tests__/api/eth/{eth_sign.test.ts => sign.test.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/chains/ethereum/__tests__/api/eth/{eth_sign.test.ts => sign.test.ts} (100%) diff --git a/src/chains/ethereum/__tests__/api/eth/eth_sign.test.ts b/src/chains/ethereum/__tests__/api/eth/sign.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/eth_sign.test.ts rename to src/chains/ethereum/__tests__/api/eth/sign.test.ts From 307f093ea19ec0e413d7eb2c7fe7633d50530cec Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:15:16 -0400 Subject: [PATCH 338/691] Add eth_coinbase test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index f3e909e296..93f50d73ca 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -12,6 +12,13 @@ describe("api", () => { accounts = await provider.send("eth_accounts"); }); + describe("eth_coinbase", function() { + it("should return correct address", async function() { + const coinbase = await provider.send("eth_coinbase"); + assert.strictEqual(coinbase, accounts[0]); + }); + }); + describe("eth_getBalance", () => { it("should return initial balance", async() => { const balance = await provider.send("eth_getBalance", [accounts[0]]); From 352dded4988227624f11757d33b89cc7634dfb84 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:15:30 -0400 Subject: [PATCH 339/691] Add eth_mining test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 93f50d73ca..d822933cf9 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -19,6 +19,13 @@ describe("api", () => { }); }); + describe("eth_mining", function() { + it("should return true", async () => { + const result = await provider.send("eth_mining"); + assert.strictEqual(result, true); + }); + }); + describe("eth_getBalance", () => { it("should return initial balance", async() => { const balance = await provider.send("eth_getBalance", [accounts[0]]); From 4b711fecacc794bc02b6a5ea00500cd4086d4713 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:15:42 -0400 Subject: [PATCH 340/691] Add eth_hashrate test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index d822933cf9..c64d6002d3 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -26,6 +26,13 @@ describe("api", () => { }); }); + describe("eth_hashrate", function() { + it("should return hashrate of zero", async function() { + const result = await provider.send("eth_hashrate"); + assert.deepStrictEqual(result, "0x0"); + }); + }); + describe("eth_getBalance", () => { it("should return initial balance", async() => { const balance = await provider.send("eth_getBalance", [accounts[0]]); From 118d16075e8a655b7de3fdab9858f459ce859bff Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:15:53 -0400 Subject: [PATCH 341/691] Add eth_protocolVersion test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index c64d6002d3..49a101951b 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -33,6 +33,13 @@ describe("api", () => { }); }); + describe("eth_protocolVersion", () => { + it("should get ethereum version", async () => { + const result = await provider.send("eth_protocolVersion"); + assert.strictEqual(result, "0x3f", "Network Version should be 63"); + }); + }); + describe("eth_getBalance", () => { it("should return initial balance", async() => { const balance = await provider.send("eth_getBalance", [accounts[0]]); From c1d9386a48e7084e8047b15f0fdeadb20121fa0b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:17:37 -0400 Subject: [PATCH 342/691] Fix test broken by lowercasing eth_accounts return values --- src/chains/ethereum/__tests__/temp-tests.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index d7193dbad2..76b4b69255 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -11,7 +11,7 @@ import { join } from "path"; */ describe("Random tests that are temporary!", () => { - const expectedAddress = "0x604a95C9165Bc95aE016a5299dd7d400dDDBEa9A"; + const expectedAddress = "0x604a95c9165bc95ae016a5299dd7d400dddbea9a"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; it("should respect the BIP99 mnemonic", async () => { From 82d04c7db3a511cd1604e510a2799d04e9bf6aaa Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:18:16 -0400 Subject: [PATCH 343/691] Fix evm_mine when interval mining --- src/chains/ethereum/src/api.ts | 8 +- src/chains/ethereum/src/blockchain.ts | 74 +++++++++++-------- .../src/components/transaction-manager.ts | 4 +- .../src/components/transaction-pool.ts | 12 +-- src/chains/ethereum/src/miner.ts | 44 ++++------- 5 files changed, 68 insertions(+), 74 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 31f306b42e..4718e18354 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -139,7 +139,7 @@ export default class EthereumApi implements types.Api { * @param timestamp? the timestamp a block should setup as the mining time. */ async evm_mine(timestamp?: number) { - await this[_blockchain].transactions.transactionPool.drain(0, timestamp); + await this[_blockchain].mine(0, timestamp); return "0x0"; } @@ -577,7 +577,7 @@ export default class EthereumApi implements types.Api { * Returns a list of addresses owned by client. * @returns Array of 20 Bytes - addresses owned by the client. */ - async eth_accounts(): Promise { + async eth_accounts() { return this[_wallet].addresses; } @@ -1081,7 +1081,7 @@ export default class EthereumApi implements types.Api { const newAccount = wallet.createRandomAccount(this[_options].mnemonic); const address = newAccount.address; const strAddress = address.toString(); - wallet.addresses.push(address); + wallet.addresses.push(strAddress.toLowerCase()); wallet.passphrases.set(strAddress, passphrase); wallet.knownAccounts.set(strAddress, newAccount.privateKey) return newAccount.address; @@ -1099,7 +1099,7 @@ export default class EthereumApi implements types.Api { const newAccount = Wallet.createAccountFromPrivateKey(Data.from(rawKey)); const address = newAccount.address; const strAddress = address.toString(); - wallet.addresses.push(address); + wallet.addresses.push(strAddress); wallet.passphrases.set(strAddress, passphrase); wallet.knownAccounts.set(strAddress, newAccount.privateKey) return newAccount.address; diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 459a339b08..9b860e35bd 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -16,6 +16,7 @@ import Manager from "./components/manager"; import TransactionReceipt from "./things/transaction-receipt"; import {encode as rlpEncode} from "rlp"; import Common from "ethereumjs-common"; +import {Block as EthereumBlock} from "ethereumjs-block"; import VM from "ethereumjs-vm"; import Address from "./things/address"; @@ -44,6 +45,8 @@ export type BlockchainOptions = { export default class Blockchain extends Emittery { #state: Status = Status.starting; + #miner: Miner; + #processingBlock: Promise; public blocks: BlockManager; public transactions: TransactionManager; public transactionReceipts: Manager; @@ -51,6 +54,7 @@ export default class Blockchain extends Emittery { public vm: VM; public trie: CheckpointTrie; readonly #database: Database; + readonly #options: BlockchainOptions /** * Initializes the underlying Database and handles synchronization between @@ -62,6 +66,7 @@ export default class Blockchain extends Emittery { */ constructor(options: BlockchainOptions) { super(); + this.#options = options; const database = (this.#database = new Database(options, this)); @@ -74,10 +79,6 @@ export default class Blockchain extends Emittery { this.blocks = new BlockManager(this, database.blocks); this.vm = this.createVmFromStateTrie(this.trie, options.hardfork, options.allowUnlimitedContractSize); - const gasLimit = options.gasLimit; - const instamine = !options.blockTime || options.blockTime <= 0; - const miner = new Miner(this.vm, {instamine, gasLimit}); - this.transactions = new TransactionManager(this, database.transactions, options); this.transactionReceipts = new Manager( this, @@ -96,46 +97,38 @@ export default class Blockchain extends Emittery { } else { firstBlockTime = this.#currentTime(); } - let lastBlock = this.#initializeGenesisBlock(firstBlockTime, gasLimit); - const readyNextBlock = async (timestamp?: number) => { - await lastBlock; - const previousBlock = this.blocks.latest; - const previousHeader = previousBlock.value.header; - const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; - return this.blocks.createBlock({ - number: Quantity.from(previousNumber + 1n).toBuffer(), - gasLimit: gasLimit.toBuffer(), - timestamp: timestamp || this.#currentTime(), - parentHash: previousHeader.hash() - }); - }; + const gasLimit = options.gasLimit; + this.#processingBlock = this.#initializeGenesisBlock(firstBlockTime, gasLimit); + + const instamine = !options.blockTime || options.blockTime <= 0; + const miner = this.#miner = new Miner(this.vm, this.#readyNextBlock, {instamine, gasLimit}); if (instamine) { - this.transactions.transactionPool.on("drain", async ({executables, timestamp, maxTransactions}: {maxTransactions: number ,executables: Map>, timestamp?: number}) => { - if (maxTransactions !== 0 && this.#isPaused()) return; - const block = await readyNextBlock(timestamp); - return miner.mine(executables, block.value, maxTransactions == null ? 1 : 0); + // whenever the transaction pool is drained mine a block + // note: the miner itself may mine more than 1 block. + // note: `maxTransactions` of `0` means unlimited (until block gas limit) + this.transactions.transactionPool.on("drain", () => { + if (this.#isPaused()) return; + return this.mine(1); }); } else { const minerInterval = options.blockTime * 1000; - const mine = (pending: Map>) => { + const intervalMine = (executables: Map>) => { let promise: Promise; if (!this.#isPaused()) { - promise = readyNextBlock().then(block => { - miner.mine(pending, block.value); - }); + promise = this.mine(0); } else { promise = this.once("resume"); } - promise.then(() => utils.unref(setTimeout(mine, minerInterval, pending))); + promise.then(() => utils.unref(setTimeout(intervalMine, minerInterval, executables))); return void 0; }; - utils.unref(setTimeout(mine, minerInterval, this.transactions.transactionPool.executables)); + utils.unref(setTimeout(intervalMine, minerInterval, this.transactions.transactionPool.executables)); } miner.on("block", async (blockData: any) => { - await lastBlock; + await this.#processingBlock; const previousBlock = this.blocks.latest; const previousHeader = previousBlock.value.header; const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; @@ -143,7 +136,7 @@ export default class Blockchain extends Emittery { parentHash: previousHeader.hash(), number: Quantity.from(previousNumber + 1n).toBuffer(), coinbase: this.coinbase.toBuffer(), - timestamp: this.#currentTime(), + timestamp: blockData.timestamp, // difficulty: gasLimit: options.gasLimit.toBuffer(), transactionsTrie: blockData.transactionsTrie.root, @@ -153,7 +146,7 @@ export default class Blockchain extends Emittery { }); this.blocks.latest = block; - lastBlock = this.#database.batch(() => { + this.#processingBlock = this.#database.batch(() => { blockData.blockTransactions.forEach((tx: Transaction, i: number) => { const hash = tx.hash(); // todo: clean up transction extra data stuffs because this is gross: @@ -170,14 +163,14 @@ export default class Blockchain extends Emittery { return block; }); - lastBlock.then(block => { + this.#processingBlock.then(block => { this.blocks.latest = block; // emit the block once everything has been fully saved to the database this.emit("block", block); }); }); - this.blocks.earliest = this.blocks.latest = await lastBlock; + this.blocks.earliest = this.blocks.latest = await this.#processingBlock; this.#state = Status.started; this.emit("start"); }); @@ -185,10 +178,27 @@ export default class Blockchain extends Emittery { coinbase: Address; + #readyNextBlock = (previousBlock: EthereumBlock, timestamp?: number) => { + const previousHeader = previousBlock.header; + const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; + return this.blocks.createBlock({ + number: Quantity.from(previousNumber + 1n).toBuffer(), + gasLimit: this.#options.gasLimit.toBuffer(), + timestamp: timestamp == null ? this.#currentTime(): timestamp, + parentHash: previousHeader.hash() + }).value; + } + isMining = () => { return this.#state === Status.started; } + mine = async (maxTransactions: number, timestamp?: number) => { + await this.#processingBlock; + const nextBlock = this.#readyNextBlock(this.blocks.latest.value, timestamp); + return this.#miner.mine(this.transactions.transactionPool.executables, nextBlock, maxTransactions); + } + #isPaused = () => { return (this.#state & Status.paused) !== 0; } diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts index e4d43503e3..96e01e788d 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -14,8 +14,8 @@ export default class TransactionManager extends Manager { super(blockchain, base, Transaction); this.transactionPool = new TransactionPool(blockchain, options); - this.transactionPool.on("drain", (transactions) => { - // TODO: create pending block? + this.transactionPool.on("drain", () => { + // TODO: create "pending" block? }); } diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index 99cf0bba81..efec3488ac 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -21,7 +21,7 @@ function byNonce(values: Transaction[], a: number, b: number) { return (Quantity.from(values[b].nonce).toBigInt() || 0n) > (Quantity.from(values[a].nonce).toBigInt() || 0n); } -export default class TransactionPool extends Emittery.Typed<{drain: (transactions: {executables: Map>, timestamp?: number, maxTransactions: number}) => void}> { +export default class TransactionPool extends Emittery.Typed<{}, "drain"> { #options: TransactionPoolOptions; /** @@ -230,15 +230,11 @@ export default class TransactionPool extends Emittery.Typed<{drain: (transaction } } - // notify listeners (the miner, probably) that we have executable - // transactions ready for it - this.drain(); + // notify listeners (the blockchain, then the miner, eventually) that we + // have executable transactions ready + this.emit("drain"); }; - drain(maxTransactions?: number, timestamp?: number) { - return this.emit("drain", {executables: this.executables, timestamp, maxTransactions}); - } - validateTransaction = (transaction: Transaction): Error => { // Check the transaction doesn't exceed the current block limit gas. if (this.#options.gasLimit < Quantity.from(transaction.gasLimit)) { diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 015b2bfd45..5087ba900b 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -48,19 +48,22 @@ export default class Miner extends Emittery { readonly #checkpoint: () => Promise; readonly #commit: () => Promise; readonly #revert: () => Promise; + readonly #createBlock: (previousBlock: Block) => Block; - // initialize a Heap that sorts by gasPrice + // create a Heap that sorts by gasPrice readonly #priced = new utils.Heap(byPrice); - constructor(vm: VM, options: MinerOptions) { + constructor(vm: VM, createBlock: (previousBlock: Block) => Block, options: MinerOptions) { super(); + const stateManager = vm.stateManager; + this.#vm = vm; this.#options = options; - const stateManager = vm.stateManager; this.#checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); this.#commit = promisify(stateManager.commit.bind(stateManager)); this.#revert = promisify(stateManager.revert.bind(stateManager)); + this.#createBlock = createBlock; - // init the heap with an empty array + // initialize the heap with an empty array this.#priced.init([]); } @@ -73,8 +76,8 @@ export default class Miner extends Emittery { * transactions within a single block. The remaining items will be left in * the pending pool to be eligible for mining in the future. * - * @param maxTransactions: number maximum number of transactions per block. - * If `0`, unlimited. + * @param maxTransactions: maximum number of transactions per block. If `0`, + * unlimited. */ public async mine(pending: Map>, block: Block, maxTransactions: number = 0) { // only allow mining a single block at a time (per miner) @@ -91,33 +94,15 @@ export default class Miner extends Emittery { const lastBlock = await this.#mineTxs(pending, block, maxTransactions); + // if there are more txs to mine, mine them! if (this.#pending) { - const nextBlock = this.#createNextBlock(lastBlock); + const nextBlock = this.#createBlock(lastBlock); const pending = this.#pending; this.#pending = null; this.mine(pending, nextBlock, this.#options.instamine ? 1 : 0); } } - #createNextBlock = (parentBlock: Block) => { - return new Block({ - parentHash: parentBlock.header.hash, - number: Quantity.from(Quantity.from(parentBlock.header.number).toBigInt() + 1n).toBuffer(), - coinbase: parentBlock.header.coinbase, - - // TODO: hm... tricky... we know we need to mine a new block - // but at what timestamp? We need to get the timestamp from `blockchain`, but so far, - // we don't require the miner to know about the blockchain. - // I think what we need to do is just put the time mechanics here in the miner, and blockchain can - // update them when needed. - // also, what if the previous block was mined with a timestamp, do we need to mine two blocks with that - // same timestamp? uh, I think not. - timestamp: parentBlock.header.timestamp, - difficulty: parentBlock.header.difficulty, - gasLimit: parentBlock.header.gasLimit - }); - } - #mineTxs = async (pending: Map>, block: Block, maxTransactions: number) => { let keepMining = true; const priced = this.#priced; @@ -142,7 +127,8 @@ export default class Miner extends Emittery { blockTransactions, transactionsTrie, receiptTrie, - gasUsed: 0n + gasUsed: 0n, + timestamp: block.header.timestamp }; // TODO: get a real block? @@ -212,6 +198,8 @@ export default class Miner extends Emittery { // * don't have enough gas left for even the smallest of transactions // * Or if we've mined enough transactions // we're done with this block! + // notice: when `maxTransactions` is `0`, `numTransactions === maxTransactions` + // will always return false. if (blockGasLeft <= params.TRANSACTION_GAS || numTransactions === maxTransactions) { if (keepMining) { // remove the newest (`best`) tx from this account's pending queue @@ -254,7 +242,7 @@ export default class Miner extends Emittery { if (priced.length !== 0) { maxTransactions = this.#options.instamine ? 1 : 0; - block = this.#createNextBlock(block); + block = this.#createBlock(block); this.#currentlyExecutingPrice = 0n; } else { // reset the miner From eeff9eadaa76d57493c02e9a3e2e207876dc9d00 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 21 Jul 2020 18:21:27 -0400 Subject: [PATCH 344/691] Add eth_syncing test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 49a101951b..baae794abe 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -26,6 +26,13 @@ describe("api", () => { }); }); + describe("eth_syncing", function() { + it("should return true", async () => { + const result = await provider.send("eth_syncing"); + assert.strictEqual(result, false); + }); + }); + describe("eth_hashrate", function() { it("should return hashrate of zero", async function() { const result = await provider.send("eth_hashrate"); From 88afa9caea88408fec37ff27fe0f3fb5116bf3eb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 17:08:06 -0400 Subject: [PATCH 345/691] add -E to lerna add example --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 5cbb352d82..3597bbcb92 100644 --- a/docs/README.md +++ b/docs/README.md @@ -44,7 +44,7 @@ Where `` is the npm-module you want to add and `` is where you Example: ```bash -npx lerna add @ganache/options --scope=@ganache/filecoin +npx lerna add @ganache/options -E --scope=@ganache/filecoin ``` will add our local `@ganache/options` package to the `@ganache/filecoin` package. From c3f9bffe2cff5afb8ad6bfce55f3af2099065dcb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 17:13:33 -0400 Subject: [PATCH 346/691] Add scrypt-js dep --- src/chains/ethereum/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 85aec0e770..4bf74c82c8 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -37,6 +37,7 @@ "ethereumjs-vm": "4.2.0", "keccak": "3.0.0", "levelup": "4.4.0", - "merkle-patricia-tree": "3.0.0" + "merkle-patricia-tree": "3.0.0", + "scrypt-js": "3.0.1" } } From 8ee86f595cccf609255ff27a9c908f318e93877d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 17:13:50 -0400 Subject: [PATCH 347/691] Add eth_getCompilers test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index baae794abe..3f36ccdcef 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -47,6 +47,13 @@ describe("api", () => { }); }); + describe("eth_getCompilers", () => { + it("should get compilers list", async () => { + const result = await provider.send("eth_getCompilers"); + assert.deepStrictEqual(result, []); + }); + }); + describe("eth_getBalance", () => { it("should return initial balance", async() => { const balance = await provider.send("eth_getBalance", [accounts[0]]); From b5aa67874579fc9e0a347077289f29892eeb5a33 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 17:30:38 -0400 Subject: [PATCH 348/691] Add miner_stop/eth_mining/miner_start tests --- .../ethereum/__tests__/api/evm/evm.test.ts | 53 +++++++++++++++++++ src/chains/ethereum/src/blockchain.ts | 14 +++-- 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 7c4a0f111a..c743bfb2f8 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -36,6 +36,59 @@ describe("api", () => { }); }); + describe("miner_stop/eth_mining/miner_start", () => { + async function testStopStartMining(provider) { + const initialBlockNumber = parseInt(await provider.send("eth_blockNumber")); + const [account] = await provider.send("eth_accounts"); + + // stop the miner + const stopped = await provider.send("miner_stop"); + assert.strictEqual(stopped, true); + + // check that eth_mining returns the correct status + let miningStatus = await provider.send("eth_mining"); + assert.strictEqual(miningStatus, false); + + // send a transaction, and make sure it does *not* get mined + await provider.send("eth_subscribe", ["newHeads"]); + const txHash = await provider.send("eth_sendTransaction", [{from: account, to: account, value: 1}]); + const fail = () => assert.fail("No message should have been received while mining was stopped"); + provider.on("message", fail); + await new Promise(resolve => setTimeout(resolve, 2000)); + provider.off("message", fail); + + // let's relaly make sure it wasn't mined by checking for a receipt + let receipt = await provider.send("eth_getTransactionReceipt", [txHash]); + assert.strictEqual(receipt, null); + + // now start the miner back up + const prom = provider.once("message"); + const started = await provider.send("miner_start"); + assert.strictEqual(started, true); + + // check that eth_mining returns the correct status + miningStatus = await provider.send("eth_mining"); + assert.strictEqual(miningStatus, true); + + // wait for the transaction to be mined + await prom; + receipt = await provider.send("eth_getTransactionReceipt", [txHash]); + + // make sure we're on the next block! + assert.strictEqual(parseInt(receipt.blockNumber), initialBlockNumber + 1); + } + + it("should stop mining, then mine when started", async () => { + const provider = await getProvider(); + await testStopStartMining(provider); + }).timeout(3000); + + it("should stop mining, then mine when started", async () => { + const provider = await getProvider({blockTime: 1}); + await testStopStartMining(provider); + }).timeout(4000); + }); + describe("evm_mine", () => { it("should mine a block on demand", async () => { const provider = await getProvider(); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 9b860e35bd..70ae6e743f 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -106,10 +106,18 @@ export default class Blockchain extends Emittery { if (instamine) { // whenever the transaction pool is drained mine a block - // note: the miner itself may mine more than 1 block. - // note: `maxTransactions` of `0` means unlimited (until block gas limit) + let waitingOnResume: Promise = null; this.transactions.transactionPool.on("drain", () => { - if (this.#isPaused()) return; + if (this.#isPaused()) { + // only wait on the resume event once. + if (waitingOnResume) return waitingOnResume; + return waitingOnResume = this.once("resume").then(() => { + waitingOnResume = null; + // when coming out of an un-paused state the miner should mine as + // many transactions in this first block as it can + return this.mine(0); + }); + } return this.mine(1); }); } else { From 5faee65b3ec2c629de2df570588bcf248ff52ed7 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 17:31:22 -0400 Subject: [PATCH 349/691] Make personal_* encrypt keys with ethereum key format --- .../__tests__/api/personal/personal.test.ts | 36 ++--- .../ethereum/__tests__/temp-tests.test.ts | 2 +- src/chains/ethereum/src/api.ts | 90 ++++++------ src/chains/ethereum/src/things/transaction.ts | 6 +- src/chains/ethereum/src/wallet.ts | 132 ++++++++++++++---- 5 files changed, 176 insertions(+), 90 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/__tests__/api/personal/personal.test.ts index 4a0ab9a550..16d8789a55 100644 --- a/src/chains/ethereum/__tests__/api/personal/personal.test.ts +++ b/src/chains/ethereum/__tests__/api/personal/personal.test.ts @@ -26,7 +26,7 @@ describe("api", () => { // make sure we can't use the account via eth_sendTransaction await assert.rejects(provider.send("eth_sendTransaction", [transaction]), { - message: "signer account is locked" + message: "authentication needed: password or unlock" }, "eth_sendTransaction should have rejected due to locked from account without its passphrase"); // unlock the account indefinitely @@ -49,7 +49,7 @@ describe("api", () => { // make sure it is locked await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { - message: "signer account is locked" + message: "authentication needed: password or unlock" }, "personal_lockAccount didn't work"); } @@ -65,14 +65,14 @@ describe("api", () => { // make sure we can't use the account via personal_sendTransaction and no passphrase await assert.rejects(provider.send("personal_sendTransaction", [transaction]), { - message: "Invalid password" + message: "could not decrypt key with given password" }, "personal_sendTransaction should have rejected due to locked from account without its passphrase"); // make sure we can't use the account with bad passphrases const invalidPassphrases = ["this is not my passphrase", null, undefined, Buffer.allocUnsafe(0), 1, 0, Infinity, NaN]; await Promise.all(invalidPassphrases.map(invalidPassphrase => { return assert.rejects(provider.send("personal_sendTransaction", [transaction, invalidPassphrase]), { - message: "Invalid password" + message: "could not decrypt key with given password" }, "Transaction should have rejected due to locked from account with wrong passphrase") })); @@ -82,7 +82,7 @@ describe("api", () => { const msgPromise = transactionHashPromise.then(() => provider.once("message")); await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { - message: "signer account is locked" + message: "authentication needed: password or unlock" }, "personal_sendTransaction should not unlock the while transaction is bring processed"); const transactionHash = await transactionHashPromise @@ -93,7 +93,7 @@ describe("api", () => { // ensure the account is still locked await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { - message: "signer account is locked" + message: "authentication needed: password or unlock" }, "personal_sendTransaction should still be locked the after the transaction is processed"); } @@ -101,42 +101,42 @@ describe("api", () => { it("generates deterministic accounts", async () => { const controlProvider = await getProvider(); const provider = await getProvider(); - const newAccount = await provider.send("personal_newAccount"); - const controlAccount = await controlProvider.send("personal_newAccount"); + const newAccount = await provider.send("personal_newAccount", [""]); + const controlAccount = await controlProvider.send("personal_newAccount", [""]); assert.strictEqual(newAccount, controlAccount); }); it("generates different accounts based on the `seed` option", async () => { const controlProvider = await getProvider(); const provider = await getProvider({ seed: "temet nosce" }); - const newAccount = await provider.send("personal_newAccount"); - const controlAccount = await controlProvider.send("personal_newAccount"); + const newAccount = await provider.send("personal_newAccount", [""]); + const controlAccount = await controlProvider.send("personal_newAccount", [""]); assert.notStrictEqual(newAccount, controlAccount); }); it("generates different accounts based on the `mnemonic` option", async () => { const controlProvider = await getProvider(); const provider = await getProvider({ mnemonic: "sweet treat" }); - const newAccount = await provider.send("personal_newAccount"); - const controlAccount = await controlProvider.send("personal_newAccount"); + const newAccount = await provider.send("personal_newAccount", [""]); + const controlAccount = await controlProvider.send("personal_newAccount", [""]); assert.notStrictEqual(newAccount, controlAccount); }); it("generates different accounts on successive calls", async () => { const provider = await getProvider(); - const firstNewAccount = await provider.send("personal_newAccount"); - const secondNewAccount = await provider.send("personal_newAccount"); + const firstNewAccount = await provider.send("personal_newAccount", [""]); + const secondNewAccount = await provider.send("personal_newAccount", [""]); assert.notStrictEqual(firstNewAccount, secondNewAccount); }); it("generates different accounts on successive calls based on the seed", async () => { const controlProvider = await getProvider(); const provider = await getProvider({ seed: "temet nosce" }); - const firstNewAccount = await provider.send("personal_newAccount"); - const secondNewAccount = await provider.send("personal_newAccount"); + const firstNewAccount = await provider.send("personal_newAccount", [""]); + const secondNewAccount = await provider.send("personal_newAccount", [""]); - await provider.send("personal_newAccount"); - const controlSecondNewAccount = await controlProvider.send("personal_newAccount"); + await provider.send("personal_newAccount", [""]); + const controlSecondNewAccount = await controlProvider.send("personal_newAccount", [""]); assert.notStrictEqual(firstNewAccount, secondNewAccount, "First and second generated accounts are the same when they shouldn't be"); assert.notStrictEqual(secondNewAccount, controlSecondNewAccount, "Second account is identical to control's second account when it shouldn't be"); diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index 76b4b69255..647819edb6 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -103,7 +103,7 @@ describe("Random tests that are temporary!", () => { } ]); }; - await assert.rejects(badSend, "Error: signer account is locked"); + await assert.rejects(badSend, "Error: authentication needed: password or unlock"); await p.send("eth_subscribe", ["newHeads"]); await p.send("eth_sendTransaction", [ diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 4718e18354..0eab26039b 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -11,6 +11,7 @@ import Transaction from "./things/transaction"; import Wallet from "./wallet"; import { decode as rlpDecode } from "rlp"; +type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; type TypedData = Exclude[1]["data"], NotTypedData>; const createKeccakHash = require("keccak"); @@ -775,14 +776,14 @@ export default class EthereumApi implements types.Api { } if (fromString == null) { - throw new Error("from not found; is required"); + throw new Error("unknown account"); } // Error checks. It's possible to JSON.stringify a Buffer to JSON. // we actually now handle this "properly" (not sure about spec), but for // legacy reasons we don't allow it. if (transaction.to && typeof transaction.to !== "string") { - throw new Error("Invalid to address"); + throw new Error("invalid to address"); } const wallet = this[_wallet]; @@ -790,13 +791,15 @@ export default class EthereumApi implements types.Api { const isUnlockedAccount = wallet.unlockedAccounts.has(fromString); if (!isUnlockedAccount) { - const msg = isKnownAccount ? "signer account is locked" : "sender account not recognized"; + const msg = isKnownAccount ? "authentication needed: password or unlock" : "unknown account"; throw new Error(msg); } - let type = Transaction.types.none; - if (!isKnownAccount) { - type |= Transaction.types.fake; + let type: ExtractValuesFromType; + if (isKnownAccount) { + type = Transaction.types.none; + } else { + type = Transaction.types.fake; } const tx = Transaction.fromJSON(transaction, type); @@ -821,8 +824,8 @@ export default class EthereumApi implements types.Api { tx.to = BUFFER_EMPTY; } - if (isKnownAccount) { - const secretKey = wallet.knownAccounts.get(fromString); + if (isUnlockedAccount) { + const secretKey = wallet.unlockedAccounts.get(fromString); return this[_blockchain].queueTransaction(tx, secretKey); } @@ -854,21 +857,13 @@ export default class EthereumApi implements types.Api { async eth_sign(address: string | Buffer, message: string | Buffer) { const account = Address.from(address).toString().toLowerCase(); const wallet = this[_wallet]; - const isUnlocked = wallet.unlockedAccounts.has(account); - let privateKey: Buffer; - if (isUnlocked) { - const knownAccount = wallet.knownAccounts.get(account); - if (knownAccount) { - privateKey = knownAccount.toBuffer(); - } else { - throw new Error("cannot sign data; no private key"); - } - } else { - throw new Error("cannot sign data; account is locked"); + const privateKey = wallet.unlockedAccounts.get(account); + if (privateKey == null) { + throw new Error("cannot sign data; no private key"); } const messageHash = hashPersonalMessage(Data.from(message).toBuffer()); - const signature = ecsign(messageHash, privateKey); + const signature = ecsign(messageHash, privateKey.toBuffer()); return toRpcSig(signature.v, signature.r, signature.s, +this[_options].chainId); } @@ -886,21 +881,9 @@ export default class EthereumApi implements types.Api { */ async eth_signTypedData(address: string | Buffer, typedData: TypedData) { const account = Address.from(address).toString().toLowerCase(); - const wallet = this[_wallet]; - const isUnlocked = wallet.unlockedAccounts.has(account); - let privateKey: Buffer; - if (isUnlocked) { - const knownAccount = wallet.knownAccounts.get(account); - if (knownAccount) { - privateKey = knownAccount.toBuffer(); - } else { - throw new Error("cannot sign data; no private key"); - } - } else { - throw new Error("cannot sign data; account is locked"); - } - if (!account) { + const privateKey = this[_wallet].unlockedAccounts.get(account); + if (privateKey == null) { throw new Error("cannot sign data; no private key"); } @@ -924,7 +907,7 @@ export default class EthereumApi implements types.Api { throw new Error("cannot sign data; message missing"); } - return signTypedData_v4(privateKey, { data: typedData }); + return signTypedData_v4(privateKey.toBuffer(), { data: typedData }); } eth_subscribe(subscriptionName: "newHeads", options?: any): PromiEvent { @@ -1077,13 +1060,18 @@ export default class EthereumApi implements types.Api { * @returns The new account's address */ async personal_newAccount(passphrase: string) { + if (typeof passphrase !== "string") { + throw new Error("missing value for required argument `passphrase`"); + } + const wallet = this[_wallet]; const newAccount = wallet.createRandomAccount(this[_options].mnemonic); const address = newAccount.address; const strAddress = address.toString(); - wallet.addresses.push(strAddress.toLowerCase()); - wallet.passphrases.set(strAddress, passphrase); - wallet.knownAccounts.set(strAddress, newAccount.privateKey) + const encryptedKeyFile = await wallet.encrypt(newAccount.privateKey, passphrase); + wallet.encryptedKeyFiles.set(strAddress, encryptedKeyFile); + wallet.addresses.push(strAddress); + wallet.knownAccounts.add(strAddress); return newAccount.address; }; @@ -1095,13 +1083,18 @@ export default class EthereumApi implements types.Api { * @returnsReturns the address of the new account. */ async personal_importRawKey(rawKey: string, passphrase: string) { + if (typeof passphrase !== "string") { + throw new Error("missing value for required argument `passphrase`"); + } + const wallet = this[_wallet]; const newAccount = Wallet.createAccountFromPrivateKey(Data.from(rawKey)); const address = newAccount.address; const strAddress = address.toString(); + const encryptedKeyFile = await wallet.encrypt(newAccount.privateKey, passphrase); + wallet.encryptedKeyFiles.set(strAddress, encryptedKeyFile); wallet.addresses.push(strAddress); - wallet.passphrases.set(strAddress, passphrase); - wallet.knownAccounts.set(strAddress, newAccount.privateKey) + wallet.knownAccounts.add(strAddress); return newAccount.address; }; @@ -1157,11 +1150,20 @@ export default class EthereumApi implements types.Api { } const wallet = this[_wallet]; - wallet.assertValidPassphrase(fromString, passphrase); + const encryptedKeyFile = wallet.encryptedKeyFiles.get(fromString); + if (encryptedKeyFile === undefined) { + throw new Error("no key for given address or file"); + } + let tx: Transaction; + if (encryptedKeyFile !== null) { + const secretKey = await wallet.decrypt(encryptedKeyFile, passphrase); - const tx = new Transaction(transaction); - const secretKey = wallet.knownAccounts.get(fromString); - tx.sign(secretKey.toBuffer()); + tx = new Transaction(transaction); + tx.sign(secretKey); + } else { + tx = new Transaction(transaction); + tx.type = Transaction.types.fake; + } return this[_blockchain].queueTransaction(tx); }; diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index d9ec2bd22d..4cf6f71979 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -205,9 +205,9 @@ class Transaction extends (EthereumJsTransaction as any) { static get types() { // values must be powers of 2 return { - none: 0, - signed: 1, - fake: 2 + none: 0 as const, + signed: 1 as const, + fake: 2 as const }; } diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index a14e89821b..b8e870399b 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -9,12 +9,35 @@ import { ProviderOptions } from "@ganache/options"; import { mnemonicToSeedSync } from "bip39"; import HDKey from "hdkey"; import { alea as rng } from "seedrandom"; - +import crypto from "crypto"; import createKeccakHash from "keccak"; +const SCRYPT_PARAMS = { + dklen: 32, + n: 1024, // practically nothing + p: 8, + r: 1 +} as const; +const CIPHER = "aes-128-ctr"; const WEI = 1000000000000000000n; const RPCQUANTITY_ZERO = Quantity.from("0x0"); +type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; +type LastType]> = T extends [...infer _A, infer L] ? L : never; + +type Params = Parameters; +type LastParams = Parameters>; +const scrypt = (...args: OmitLastType) => { + return new Promise((resolve: (value: LastParams[1]) => void, reject: (reason: LastParams[0]) => void) => { + crypto.scrypt.call(crypto, ...args, (err: LastParams[0], derivedKey: LastParams[1]) => { + if (err) { + return void reject(err); + } + return resolve(derivedKey); + }); + }); +}; + const uncompressedPublicKeyToAddress = (uncompressedPublicKey: Buffer) => { const compresedPublicKey = secp256k1.publicKeyConvert(uncompressedPublicKey, false).slice(1); const hasher = createKeccakHash("keccak256"); @@ -22,13 +45,19 @@ const uncompressedPublicKeyToAddress = (uncompressedPublicKey: Buffer) => { return Address.from(hasher.digest().slice(-20)); } +const asUUID = (uuid: Buffer | { length: 16 }) => { + return `${uuid.toString("hex", 0, 4)}-${uuid.toString("hex", 4, 6)}-${uuid.toString("hex", 6, 8)}-${uuid.toString("hex", 8, 10)}-${uuid.toString("hex", 10)}`; +} + +type ThenArg = T extends PromiseLike ? U : T +type EncryptType = ThenArg>; export default class Wallet { readonly addresses: string[]; readonly initialAccounts: Account[]; - readonly knownAccounts = new Map(); - readonly passphrases = new Map(); - readonly unlockedAccounts = new Set(); + readonly knownAccounts = new Set(); + readonly encryptedKeyFiles = new Map(); + readonly unlockedAccounts = new Map(); readonly lockTimers = new Map(); #hdKey: HDKey; @@ -49,13 +78,13 @@ export default class Wallet { const address = account.address; const strAddress = address.toString(); accountsCache[i] = strAddress; - knownAccounts.set(strAddress, account.privateKey); + knownAccounts.add(strAddress); // if the `secure` option has been set do NOT add these accounts to the // unlockedAccounts if (opts.secure) continue; - unlockedAccounts.add(strAddress); + unlockedAccounts.set(strAddress, account.privateKey); } //#endregion @@ -100,7 +129,9 @@ export default class Wallet { default: throw new Error(`Invalid value specified in unlocked_accounts`); } - unlockedAccounts.add(address); + if (unlockedAccounts.has(address)) continue; + // if we don't have the secretKey for an account we use `null` + unlockedAccounts.set(address, null); } } //#endregion @@ -127,7 +158,7 @@ export default class Wallet { const fractionalStr = balanceParts[1] || "0"; const fractional = BigInt(fractionalStr); const magnitude = 10n ** BigInt(fractionalStr.length); - const defaultBalanceInWei = (WEI * significand) + (fractional * (WEI/magnitude)); + const defaultBalanceInWei = (WEI * significand) + (fractional * (WEI / magnitude)); const etherInWei = Quantity.from(defaultBalanceInWei); let accounts: Account[]; @@ -173,6 +204,70 @@ export default class Wallet { return accounts; }; + public async encrypt(privateKey: Data, passphrase: string) { + const random = this.#randomBytes(32 + 16 + 16); + const salt = random.slice(0, 32); // first 32 bytes + const iv = random.slice(32, 32 + 16); // next 16 bytes + const uuid = random.slice(32 + 16); // last 16 bytes + + const derivedKey = await scrypt(passphrase, salt, SCRYPT_PARAMS.dklen, { ...SCRYPT_PARAMS, N: SCRYPT_PARAMS.n }); + const cipher = crypto.createCipheriv(CIPHER, derivedKey.slice(0, 16), iv); + const ciphertext = Buffer.concat([cipher.update(privateKey.toBuffer()), cipher.final()]); + const mac = createKeccakHash("keccak256").update(Buffer.concat([derivedKey.slice(16, 32), ciphertext])).digest(); + return { + crypto: { + cipher: CIPHER, + ciphertext: Data.from(ciphertext), + cipherparams: { + iv: Data.from(iv) + }, + kdf: "scrypt", + kdfParams: { + ...SCRYPT_PARAMS, + salt: Data.from(salt) + }, + mac: Data.from(mac) + }, + id: asUUID(uuid), + version: 3 + }; + } + + public async decrypt(keyfile: EncryptType, passphrase) { + const crypt = keyfile.crypto; + + if (crypt.cipher !== CIPHER) { + throw new Error(`keyfile cypher must be "${CIPHER}"`); + } + if (crypt.kdf !== "scrypt") { + throw new Error(`keyfile kdf must be "script"`); + } + + const kdfParams = crypt.kdfParams; + const salt = kdfParams.salt; + const mac = crypt.mac; + const ciphertext = crypt.ciphertext.toBuffer(); + + let derivedKey: Buffer; + let localMac: Buffer; + if (passphrase != null) { + try { + derivedKey = await scrypt(passphrase, salt.toBuffer(), kdfParams.dklen, { ...kdfParams, N: kdfParams.n }); + localMac = createKeccakHash("keccak256").update(Buffer.concat([derivedKey.slice(16, 32), ciphertext])).digest(); + } catch { + localMac = null; + } + } + + if (!localMac || !mac.toBuffer().equals(localMac)) { + throw new Error("could not decrypt key with given password"); + } + + const decipher = crypto.createDecipheriv(crypt.cipher, derivedKey.slice(0, 16), crypt.cipherparams.iv.toBuffer()); + const plaintext = decipher.update(ciphertext); + return plaintext; + } + public static createAccount(balance: Quantity, privateKey: Data, address: Address) { const account = new Account(address); account.privateKey = privateKey; @@ -197,21 +292,9 @@ export default class Wallet { return Wallet.createAccount(RPCQUANTITY_ZERO, privateKey, address); } - public assertValidPassphrase(lowerAddress: string, passphrase: string) { - const storedPassphrase = this.passphrases.get(lowerAddress); - if (storedPassphrase === undefined) { - throw new Error("Account not found"); - } - - if (passphrase !== storedPassphrase) { - throw new Error("Invalid password"); - } - - return true; - } - - public unlockAccount(lowerAddress: string, passphrase: string, duration: number) { - this.assertValidPassphrase(lowerAddress, passphrase); + public async unlockAccount(lowerAddress: string, passphrase: string, duration: number) { + const encryptedKeyFile = this.encryptedKeyFiles.get(lowerAddress); + const secretKey = await this.decrypt(encryptedKeyFile, passphrase); const existingTimer = this.lockTimers.get(lowerAddress); if (existingTimer) { @@ -225,7 +308,8 @@ export default class Wallet { utils.unref(timeout); this.lockTimers.set(lowerAddress, timeout); } - this.unlockedAccounts.add(lowerAddress); + + this.unlockedAccounts.set(lowerAddress, Data.from(secretKey)); return true; } From fdf841a7336198b40d8d87d8aa71872b5c8b173b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 17:58:41 -0400 Subject: [PATCH 350/691] Add miner_ tests --- .../ethereum/__tests__/api/evm/evm.test.ts | 53 --------- .../__tests__/api/miner/miner.test.ts | 104 ++++++++++++++++++ src/chains/ethereum/src/api.ts | 4 +- 3 files changed, 106 insertions(+), 55 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/miner/miner.test.ts diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index c743bfb2f8..7c4a0f111a 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -36,59 +36,6 @@ describe("api", () => { }); }); - describe("miner_stop/eth_mining/miner_start", () => { - async function testStopStartMining(provider) { - const initialBlockNumber = parseInt(await provider.send("eth_blockNumber")); - const [account] = await provider.send("eth_accounts"); - - // stop the miner - const stopped = await provider.send("miner_stop"); - assert.strictEqual(stopped, true); - - // check that eth_mining returns the correct status - let miningStatus = await provider.send("eth_mining"); - assert.strictEqual(miningStatus, false); - - // send a transaction, and make sure it does *not* get mined - await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendTransaction", [{from: account, to: account, value: 1}]); - const fail = () => assert.fail("No message should have been received while mining was stopped"); - provider.on("message", fail); - await new Promise(resolve => setTimeout(resolve, 2000)); - provider.off("message", fail); - - // let's relaly make sure it wasn't mined by checking for a receipt - let receipt = await provider.send("eth_getTransactionReceipt", [txHash]); - assert.strictEqual(receipt, null); - - // now start the miner back up - const prom = provider.once("message"); - const started = await provider.send("miner_start"); - assert.strictEqual(started, true); - - // check that eth_mining returns the correct status - miningStatus = await provider.send("eth_mining"); - assert.strictEqual(miningStatus, true); - - // wait for the transaction to be mined - await prom; - receipt = await provider.send("eth_getTransactionReceipt", [txHash]); - - // make sure we're on the next block! - assert.strictEqual(parseInt(receipt.blockNumber), initialBlockNumber + 1); - } - - it("should stop mining, then mine when started", async () => { - const provider = await getProvider(); - await testStopStartMining(provider); - }).timeout(3000); - - it("should stop mining, then mine when started", async () => { - const provider = await getProvider({blockTime: 1}); - await testStopStartMining(provider); - }).timeout(4000); - }); - describe("evm_mine", () => { it("should mine a block on demand", async () => { const provider = await getProvider(); diff --git a/src/chains/ethereum/__tests__/api/miner/miner.test.ts b/src/chains/ethereum/__tests__/api/miner/miner.test.ts new file mode 100644 index 0000000000..43c18188c1 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/miner/miner.test.ts @@ -0,0 +1,104 @@ +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +import getProvider from "../../helpers/getProvider"; + +describe("api", () => { + describe("miner", () => { + let provider: EthereumProvider; + let accounts: string[]; + + beforeEach(async () => { + provider = await getProvider(); + accounts = await provider.send("eth_accounts"); + }); + + describe("miner_stop/eth_mining/miner_start", () => { + async function testStopStartMining(provider) { + const initialBlockNumber = parseInt(await provider.send("eth_blockNumber")); + const [account] = await provider.send("eth_accounts"); + + // stop the miner + const stopped = await provider.send("miner_stop"); + assert.strictEqual(stopped, true); + + // check that eth_mining returns the correct status + let miningStatus = await provider.send("eth_mining"); + assert.strictEqual(miningStatus, false); + + // send a transaction, and make sure it does *not* get mined + await provider.send("eth_subscribe", ["newHeads"]); + const txHash = await provider.send("eth_sendTransaction", [{from: account, to: account, value: 1}]); + const fail = () => assert.fail("No message should have been received while mining was stopped"); + provider.on("message", fail); + await new Promise(resolve => setTimeout(resolve, 2000)); + provider.off("message", fail); + + // let's relaly make sure it wasn't mined by checking for a receipt + let receipt = await provider.send("eth_getTransactionReceipt", [txHash]); + assert.strictEqual(receipt, null); + + // now start the miner back up + const prom = provider.once("message"); + const started = await provider.send("miner_start"); + assert.strictEqual(started, true); + + // check that eth_mining returns the correct status + miningStatus = await provider.send("eth_mining"); + assert.strictEqual(miningStatus, true); + + // wait for the transaction to be mined + await prom; + receipt = await provider.send("eth_getTransactionReceipt", [txHash]); + + // make sure we're on the next block! + assert.strictEqual(parseInt(receipt.blockNumber), initialBlockNumber + 1); + } + + it("should stop mining, then mine when started", async () => { + const provider = await getProvider(); + await testStopStartMining(provider); + }).timeout(3000); + + it("should stop mining, then mine when started", async () => { + const provider = await getProvider({blockTime: 1}); + await testStopStartMining(provider); + }).timeout(4000); + }); + + describe("miner_setEtherbase", () => { + it("sets the etherbase", async () => { + const setState = await provider.send("miner_setEtherbase", [accounts[1]]); + assert.strictEqual(setState, true); + + const coinbase = await provider.send("eth_coinbase"); + assert.strictEqual(coinbase, accounts[1]); + + await provider.send("eth_subscribe", ["newHeads"]); + const txHash = await provider.send("eth_sendTransaction", [{from: accounts[0], to: accounts[0]}]); + await provider.once("message"); + const {status, blockNumber} = await provider.send("eth_getTransactionReceipt", [txHash]); + assert.strictEqual(status, 1); + const {miner} = await provider.send("eth_getBlockByNumber", [blockNumber]); + console.log(miner, accounts[1]); + }); + }); + + describe("miner_setGasPrice", () => { + it("sets the gasPrice and uses it as the default price in tranactions", async () => { + const newGasPrice = "0xffff" + const setState = await provider.send("miner_setGasPrice", [newGasPrice]); + assert.strictEqual(setState, true); + + const ethGasPrice = await provider.send("eth_gasPrice"); + assert.strictEqual(ethGasPrice, newGasPrice); + + await provider.send("eth_subscribe", ["newHeads"]); + const txHash = await provider.send("eth_sendTransaction", [{from: accounts[0], to: accounts[0]}]); + await provider.once("message"); + + const {gasPrice} = await provider.send("eth_getTransactionByHash", [txHash]); + assert.strictEqual(gasPrice, newGasPrice); + }); + }) + }); +}); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 0eab26039b..b3bcbe9fce 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -313,8 +313,8 @@ export default class EthereumApi implements types.Api { * Sets the etherbase, where mining rewards will go. * @param address */ - async miner_setEtherbase(address: Address) { - this[_blockchain].coinbase = address; + async miner_setEtherbase(address: string) { + this[_blockchain].coinbase = Address.from(address); return true; } //#endregion From 02d8e67c7f0b53a94d4f4b2fff71192d2d099999 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 18:50:36 -0400 Subject: [PATCH 351/691] chainId must be a number --- src/packages/options/src/options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index fca3278cf8..32d1ffc7ad 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -77,7 +77,7 @@ export interface Options { * The currently configured chain id, a value used in replay-protected * transaction signing as introduced by EIP-155. Default's to `1337` */ - chainId?: string | number; + chainId?: number; /** * Alias of `networkId`. From b9106b51939ce894c0f9040b5b59e249ca25f9dd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 18:51:35 -0400 Subject: [PATCH 352/691] Remove some superfluous return types --- src/chains/ethereum/src/api.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index b3bcbe9fce..6fdf1d1ac9 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -554,7 +554,7 @@ export default class EthereumApi implements types.Api { * Returns true if client is actively mining new blocks. * @returns returns true of the client is mining, otherwise false. */ - async eth_mining(): Promise { + async eth_mining() { return this[_blockchain].isMining(); } @@ -562,7 +562,7 @@ export default class EthereumApi implements types.Api { * Returns the number of hashes per second that the node is mining with. * @returns number of hashes per second. */ - async eth_hashrate(): Promise { + async eth_hashrate() { return RPCQUANTITY_ZERO; } @@ -570,7 +570,7 @@ export default class EthereumApi implements types.Api { * Returns the current price per gas in wei. * @returns integer of the current gas price in wei. */ - async eth_gasPrice(): Promise { + async eth_gasPrice() { return this[_options].gasPrice; } @@ -597,7 +597,7 @@ export default class EthereumApi implements types.Api { * @returns The chain id as a string. * @EIP [155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) */ - async eth_chainId(): Promise { + async eth_chainId() { return this[_options].chainId.toString(); } From a89e50470a9bacae3a191d3c441692519eaa0bb5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 18:52:06 -0400 Subject: [PATCH 353/691] Add eth_submitWork test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 3f36ccdcef..ac38f2c61e 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -2,6 +2,10 @@ import assert from "assert"; import EthereumProvider from "../../../src/provider"; import getProvider from "../../helpers/getProvider"; +function hex(length: number) { + return `0x${Buffer.allocUnsafe(length).fill(0).toString("hex")}`; +} + describe("api", () => { describe("eth", () => { let provider: EthereumProvider; @@ -54,6 +58,13 @@ describe("api", () => { }); }); + describe("eth_submitWork", () => { + it("should get compilers list", async () => { + const result = await provider.send("eth_submitWork", [hex(8), hex(32), hex(32)]); + assert.deepStrictEqual(result, false); + }); + }); + describe("eth_getBalance", () => { it("should return initial balance", async() => { const balance = await provider.send("eth_getBalance", [accounts[0]]); From 50884493b5cbe70a8afacb51edd872603897751a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 18:52:19 -0400 Subject: [PATCH 354/691] Add eth_getWork test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index ac38f2c61e..2cd718c4fd 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -65,6 +65,13 @@ describe("api", () => { }); }); + describe("eth_getWork", () => { + it("should get compilers list", async () => { + const result = await provider.send("eth_getWork", ["0x0"]); + assert.deepStrictEqual(result, []); + }); + }); + describe("eth_getBalance", () => { it("should return initial balance", async() => { const balance = await provider.send("eth_getBalance", [accounts[0]]); From 9d0f190fd019d5b6b2e7bb741d326fc2b14d9dc9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 22 Jul 2020 18:52:33 -0400 Subject: [PATCH 355/691] Add eth_submitHashrate test --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 2cd718c4fd..aa8cfb4802 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -72,6 +72,13 @@ describe("api", () => { }); }); + describe("eth_submitHashrate", () => { + it("should return the status of eth_submitHashrate", async () => { + const result = await provider.send("eth_submitHashrate", [hex(32), hex(32)]); + assert.deepStrictEqual(result, false); + }); + }); + describe("eth_getBalance", () => { it("should return initial balance", async() => { const balance = await provider.send("eth_getBalance", [accounts[0]]); From 059a092777d4bb683649f141cdcee0b9c56f030e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 23 Jul 2020 16:26:19 -0400 Subject: [PATCH 356/691] Move types again --- .../ethereum/src/@types/{@types => }/ethereumjs-block/header.d.ts | 0 .../ethereum/src/@types/{@types => }/ethereumjs-block/index.d.ts | 0 .../ethereum/src/@types/{@types => }/ethereumjs-util/index.d.ts | 0 src/chains/ethereum/src/@types/{@types => }/hdkey/index.d.ts | 0 src/chains/ethereum/src/@types/{@types => }/levelup/index.d.ts | 0 .../src/@types/{@types => }/merkle-patricia-tree/baseTrie.ts | 0 .../src/@types/{@types => }/merkle-patricia-tree/index.d.ts | 0 .../src/@types/{@types => }/merkle-patricia-tree/readStream.ts | 0 .../src/@types/{@types => }/merkle-patricia-tree/trieNode.ts | 0 src/chains/ethereum/src/@types/{@types => }/solc/index.d.ts | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename src/chains/ethereum/src/@types/{@types => }/ethereumjs-block/header.d.ts (100%) rename src/chains/ethereum/src/@types/{@types => }/ethereumjs-block/index.d.ts (100%) rename src/chains/ethereum/src/@types/{@types => }/ethereumjs-util/index.d.ts (100%) rename src/chains/ethereum/src/@types/{@types => }/hdkey/index.d.ts (100%) rename src/chains/ethereum/src/@types/{@types => }/levelup/index.d.ts (100%) rename src/chains/ethereum/src/@types/{@types => }/merkle-patricia-tree/baseTrie.ts (100%) rename src/chains/ethereum/src/@types/{@types => }/merkle-patricia-tree/index.d.ts (100%) rename src/chains/ethereum/src/@types/{@types => }/merkle-patricia-tree/readStream.ts (100%) rename src/chains/ethereum/src/@types/{@types => }/merkle-patricia-tree/trieNode.ts (100%) rename src/chains/ethereum/src/@types/{@types => }/solc/index.d.ts (100%) diff --git a/src/chains/ethereum/src/@types/@types/ethereumjs-block/header.d.ts b/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/ethereumjs-block/header.d.ts rename to src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts diff --git a/src/chains/ethereum/src/@types/@types/ethereumjs-block/index.d.ts b/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/ethereumjs-block/index.d.ts rename to src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts diff --git a/src/chains/ethereum/src/@types/@types/ethereumjs-util/index.d.ts b/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/ethereumjs-util/index.d.ts rename to src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts diff --git a/src/chains/ethereum/src/@types/@types/hdkey/index.d.ts b/src/chains/ethereum/src/@types/hdkey/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/hdkey/index.d.ts rename to src/chains/ethereum/src/@types/hdkey/index.d.ts diff --git a/src/chains/ethereum/src/@types/@types/levelup/index.d.ts b/src/chains/ethereum/src/@types/levelup/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/levelup/index.d.ts rename to src/chains/ethereum/src/@types/levelup/index.d.ts diff --git a/src/chains/ethereum/src/@types/@types/merkle-patricia-tree/baseTrie.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/merkle-patricia-tree/baseTrie.ts rename to src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts diff --git a/src/chains/ethereum/src/@types/@types/merkle-patricia-tree/index.d.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/merkle-patricia-tree/index.d.ts rename to src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts diff --git a/src/chains/ethereum/src/@types/@types/merkle-patricia-tree/readStream.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/merkle-patricia-tree/readStream.ts rename to src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.ts diff --git a/src/chains/ethereum/src/@types/@types/merkle-patricia-tree/trieNode.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/merkle-patricia-tree/trieNode.ts rename to src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.ts diff --git a/src/chains/ethereum/src/@types/@types/solc/index.d.ts b/src/chains/ethereum/src/@types/solc/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/@types/solc/index.d.ts rename to src/chains/ethereum/src/@types/solc/index.d.ts From 588e75131351b0684265b5cc8d859564e971398f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 11:55:57 -0400 Subject: [PATCH 357/691] Remove `newHeads` comment as it has been implemented --- src/chains/ethereum/src/api.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 6fdf1d1ac9..58a4c89099 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -954,10 +954,7 @@ export default class EthereumApi implements types.Api { // return promiEvent; // case 'newPendingTransactions': // createSubscriptionFilter = self.newPendingTransactionFilter.bind(self) - // break - // case 'newHeads': - // createSubscriptionFilter = self.newBlockFilter.bind(self) - // break + // break; // case 'syncing': // default: // cb(new Error('unsupported subscription type')) From 278ebaba71251398f1200df4b8f604d68b33de74 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 13:58:42 -0400 Subject: [PATCH 358/691] Add reason for using 10.7.0 as the lowest supported version. --- docs/README.md | 5 +++-- docs/launch.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index 3597bbcb92..48d690f44a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,8 @@ ## Getting set up - * Use node v10.7.0 (or whatever the lowest engine is in the root package.json) + * Use Node.js v10.7.0, this is the earliest version we support. + * Why v10.7.0? Because this is the first version that supports with BitInt literals (the `n` in `100n`). * `git clone git@github.com:trufflesuite/ganache-core.git` * `cd ganache-core` * `npm install` @@ -83,7 +84,7 @@ index 688d3d4..815e111 100644 These are guidelines, not rules. :-) - * Use Node v10.7.0 for most local development. This is the earliest version we support. + * Use Node.js v10.7.0 for most local development. * Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed `Number.MAX_SAFE_INTEGER`. * Write tests. diff --git a/docs/launch.json b/docs/launch.json index 73c80b58f3..eb53bcc398 100644 --- a/docs/launch.json +++ b/docs/launch.json @@ -16,6 +16,7 @@ "--throw-deprecation", "--trace-warnings" ], + // 10.7.0 is the earliest version of Node.js that we support, and is the first version to support BigInt literals. "runtimeVersion": "10.7.0", "args": [ "${workspaceFolder}/node_modules/mocha/bin/_mocha", From a7c715071ae27e06e39f9f0e8f9fa448127cc1c3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 14:26:17 -0400 Subject: [PATCH 359/691] Add eth_getLogs --- .../{src => __tests__}/@types/solc/index.d.ts | 0 .../__tests__/api/eth/contracts/Logs.sol | 14 ++ .../ethereum/__tests__/api/eth/eth.test.ts | 45 ++++- .../ethereum/__tests__/api/eth/logs.test.ts | 54 ++++++ .../ethereum/__tests__/api/eth/uncles.test.ts | 2 +- .../__tests__/api/evm/snapshot.test.ts | 4 - .../__tests__/api/miner/miner.test.ts | 2 +- src/chains/ethereum/__tests__/tsconfig.json | 4 + src/chains/ethereum/package.json | 4 +- src/chains/ethereum/src/api.ts | 80 ++++++-- src/chains/ethereum/src/blockchain.ts | 62 +++--- .../ethereum/src/components/block-manager.ts | 114 ++++++----- .../src/components/blocklog-manager.ts | 15 ++ src/chains/ethereum/src/components/manager.ts | 9 +- .../src/components/transaction-manager.ts | 7 +- src/chains/ethereum/src/database.ts | 1 + src/chains/ethereum/src/miner.ts | 13 +- src/chains/ethereum/src/things/address.ts | 18 +- src/chains/ethereum/src/things/blocklogs.ts | 178 ++++++++++++++++++ .../src/things/transaction-receipt.ts | 21 ++- src/chains/ethereum/src/things/transaction.ts | 38 ++-- src/chains/ethereum/tsconfig.json | 3 +- src/packages/core/src/servers/http-server.ts | 2 +- src/packages/options/src/options.ts | 3 +- .../src/things/json-rpc/json-rpc-quantity.ts | 4 +- 25 files changed, 545 insertions(+), 152 deletions(-) rename src/chains/ethereum/{src => __tests__}/@types/solc/index.d.ts (100%) create mode 100644 src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol create mode 100644 src/chains/ethereum/__tests__/api/eth/logs.test.ts create mode 100644 src/chains/ethereum/__tests__/tsconfig.json create mode 100644 src/chains/ethereum/src/components/blocklog-manager.ts create mode 100644 src/chains/ethereum/src/things/blocklogs.ts diff --git a/src/chains/ethereum/src/@types/solc/index.d.ts b/src/chains/ethereum/__tests__/@types/solc/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/solc/index.d.ts rename to src/chains/ethereum/__tests__/@types/solc/index.d.ts diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol b/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol new file mode 100644 index 0000000000..47e9a69da7 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol @@ -0,0 +1,14 @@ +pragma solidity ^0.6.1; + +contract Logs { + event Event(uint indexed first, uint indexed second); + constructor() public { + emit Event(1, 2); + } + + function logNTimes (uint8 n) public { + for (uint8 i = 0; i < n; i++){ + emit Event(i, i); + } + } +} diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index aa8cfb4802..c6c42e3f14 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -79,6 +79,27 @@ describe("api", () => { }); }); + describe("eth_chainId", () => { + it("should return the default chain id", async () => { + const result = await provider.send("eth_chainId"); + assert.deepStrictEqual(result, "1337"); + }); + + xit("should use the default chain id when signing transactions", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + const txHash = await provider.send("eth_sendTransaction", [{from: accounts[0], to: accounts[0]}]); + await provider.once("message"); + const tx = await provider.send("eth_getTransactionByHash", [txHash]); + assert.strictEqual(tx.v, "0xa96"); + }); + + it("should update the default chain id", async () => { + const provider = await getProvider({chainId: 1234}); + const result = await provider.send("eth_chainId"); + assert.deepStrictEqual(result, "1234"); + }); + }); + describe("eth_getBalance", () => { it("should return initial balance", async() => { const balance = await provider.send("eth_getBalance", [accounts[0]]); @@ -221,7 +242,7 @@ describe("api", () => { it("eth_getTransactionByBlockNumberAndIndex", async () => { const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); - await provider.send("eth_sendTransaction", [ + const txHash = await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -231,16 +252,21 @@ describe("api", () => { const _message = await provider.once("message"); const tx = await provider.send("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); - assert.equal( + assert.strictEqual( tx.hash, - "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", + "0xab338178ffd130f1b7724a687ef20afcc75d44020184f82127ab1bc59f17d7e2", "Unexpected transaction hash." ); + assert.strictEqual( + tx.hash, + txHash, + "eth_getTransactionByBlockNumberAndIndex transaction hash doesn't match tx hash" + ); }); it("eth_getTransactionByBlockHashAndIndex", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); - await provider.send("eth_sendTransaction", [ + await provider.send("eth_subscribe", ["newHeads"]); + const txHash = await provider.send("eth_sendTransaction", [ { from: accounts[0], to: accounts[1], @@ -251,11 +277,16 @@ describe("api", () => { const block = await provider.send("eth_getBlockByNumber", ["0x1"]); const tx = await provider.send("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); - assert.equal( + assert.strictEqual( tx.hash, - "0x6a530e6b86c00b7bef84fd75d570627d46a4b982f8a573ef1129780b5f92ff7e", + "0xab338178ffd130f1b7724a687ef20afcc75d44020184f82127ab1bc59f17d7e2", "Unexpected transaction hash." ); + assert.strictEqual( + tx.hash, + txHash, + "eth_getTransactionByBlockNumberAndIndex transaction hash doesn't match tx hash" + ); }); it("eth_getUncleCountByBlockHash", async () => { diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts new file mode 100644 index 0000000000..feb29d5167 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -0,0 +1,54 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +import compile from "../../helpers/compile"; +import { join } from "path"; + +describe("api", () => { + describe("eth", () => { + describe("logs", () => { + let provider: EthereumProvider; + let contract: ReturnType; + let contractAddress: string; + let accounts: string[]; + beforeEach(async () => { + contract = compile(join(__dirname, "./contracts/Logs.sol")); + provider = await getProvider(); + accounts = await provider.send("eth_accounts"); + + await provider.send("eth_subscribe", ["newHeads"]); + const transactionHash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + data: contract.code, + gas: 3141592 + }]); + await provider.once("message"); + const transactionReceipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + contractAddress = transactionReceipt.contractAddress; + }); + + it("should return a log for the constructor tranasction", async () => { + const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); + // assert.strictEqual(logs, []); + }); + + it("should return the code at the deployed block number", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + const numberOfLogs = 4; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + }]); + await provider.once("message"); + const txReceipt = await provider.send("eth_getTransactionReceipt", [txHash]); + assert.deepStrictEqual(txReceipt.logs.length, numberOfLogs); + const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); + // assert.deepStrictEqual(logs, txReceipt.logs); + }); + }); + }); +}); diff --git a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts index 3e8540b811..5eb9141e3b 100644 --- a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts @@ -17,4 +17,4 @@ describe("api", () => { }); }); }); -}) \ No newline at end of file +}); diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index b72165cb2e..0776251834 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -39,10 +39,6 @@ describe("api", function() { const to = receipt.contractAddress; const methods = contract.contract.evm.methodIdentifiers; - const value = await p.send("eth_call", [ - {from, to, data: "0x" + methods["n()"]} - ]); - context.send = p.send.bind(p); context.accounts = accounts; context.provider = p; diff --git a/src/chains/ethereum/__tests__/api/miner/miner.test.ts b/src/chains/ethereum/__tests__/api/miner/miner.test.ts index 43c18188c1..495ba0af8b 100644 --- a/src/chains/ethereum/__tests__/api/miner/miner.test.ts +++ b/src/chains/ethereum/__tests__/api/miner/miner.test.ts @@ -79,7 +79,7 @@ describe("api", () => { const {status, blockNumber} = await provider.send("eth_getTransactionReceipt", [txHash]); assert.strictEqual(status, 1); const {miner} = await provider.send("eth_getBlockByNumber", [blockNumber]); - console.log(miner, accounts[1]); + assert.strictEqual(miner, accounts[1]); }); }); diff --git a/src/chains/ethereum/__tests__/tsconfig.json b/src/chains/ethereum/__tests__/tsconfig.json new file mode 100644 index 0000000000..7f41c2548d --- /dev/null +++ b/src/chains/ethereum/__tests__/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.json", + "include": ["./"] +} diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 4bf74c82c8..95bd5be838 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -23,8 +23,8 @@ }, "scripts": { "tsc": "ts-node ../../../scripts/compile", - "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**/*.test.ts'" + "test": "nyc --reporter lcov npm run mocha -- --throw-deprecation --trace-warnings", + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 58a4c89099..a72e195e1f 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -6,7 +6,7 @@ import EthereumOptions from "./options"; import { Data, Quantity } from "@ganache/utils/src/things/json-rpc"; import Blockchain, { BlockchainOptions } from "./blockchain"; import Tag from "./things/tags"; -import Address, { IndexableAddress } from "./things/address"; +import Address from "./things/address"; import Transaction from "./things/transaction"; import Wallet from "./wallet"; import { decode as rlpDecode } from "rlp"; @@ -19,6 +19,8 @@ const createKeccakHash = require("keccak"); import { version } from "../../../packages/core/package.json"; import PromiEvent from "@ganache/utils/src/things/promievent"; import Emittery from "emittery"; +import Common from "ethereumjs-common"; +import BlockLogs from "./things/blocklogs"; //#endregion //#region Constants @@ -36,6 +38,7 @@ const _blockchain = Symbol("blockchain"); const _options = Symbol("options"); const _wallet = Symbol("wallet"); const _filters = Symbol("filters"); +const _common = Symbol("common"); //#region types type SubscriptionId = string; @@ -44,6 +47,7 @@ type SubscriptionId = string; export default class EthereumApi implements types.Api { readonly [index: string]: (...args: any) => Promise; + private readonly [_common]: Common; private readonly [_filters] = new Map(); private readonly [_blockchain]: Blockchain; private readonly [_options]: EthereumOptions; @@ -61,9 +65,20 @@ export default class EthereumApi implements types.Api { const {initialAccounts} = this[_wallet] = new Wallet(opts); - const blockchainOptions = options as unknown as BlockchainOptions; + const blockchainOptions = options as BlockchainOptions; blockchainOptions.initialAccounts = initialAccounts; blockchainOptions.coinbase = initialAccounts[0]; + this[_common] = blockchainOptions.common = Common.forCustomChain( + "mainnet", // TODO needs to match chain id + { + name: "ganache", + networkId: options.networkId, + chainId: options.chainId, + comment: "Local test network", + bootstrapNodes: [] + }, + options.hardfork + ); const blockchain = (this[_blockchain] = new Blockchain(blockchainOptions)); blockchain.on("start", () => { emitter.emit("connect"); @@ -206,7 +221,7 @@ export default class EthereumApi implements types.Api { * @example Basic example * const snapshotId = await provider.send("evm_snapshot"); * const isReverted = await provider.send("evm_revert", [snapshotId]); - * + * * @example Complete example * const provider = ganache.provider(); * const [from, to] = await provider.send("eth_accounts"); @@ -607,7 +622,7 @@ export default class EthereumApi implements types.Api { * @param blockNumber integer block number, or the string "latest", "earliest" * or "pending", see the default block parameter */ - async eth_getBalance(address: string | IndexableAddress, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + async eth_getBalance(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { const chain = this[_blockchain]; const account = await chain.accounts.get(Address.from(address), blockNumber); return account.balance; @@ -620,7 +635,7 @@ export default class EthereumApi implements types.Api { * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter * @returns the code from the given address. */ - async eth_getCode(address: Buffer | IndexableAddress, blockNumber: Buffer | Tag = Tag.LATEST) { + async eth_getCode(address: Buffer, blockNumber: Buffer | Tag = Tag.LATEST) { const blockchain = this[_blockchain]; const blockProm = blockchain.blocks.getRaw(blockNumber); @@ -674,7 +689,7 @@ export default class EthereumApi implements types.Api { * or "pending", see the default block parameter */ async eth_getStorageAt( - address: IndexableAddress, + address: string, position: bigint | number, blockNumber: string | Buffer | Tag = Tag.LATEST ): Promise { @@ -802,7 +817,7 @@ export default class EthereumApi implements types.Api { type = Transaction.types.fake; } - const tx = Transaction.fromJSON(transaction, type); + const tx = Transaction.fromJSON(transaction, this[_common], type); if (tx.gasLimit.length === 0) { tx.gasLimit = this[_options].defaultTransactionGasLimit.toBuffer(); } @@ -993,8 +1008,49 @@ export default class EthereumApi implements types.Api { async eth_getFilterLogs(): Promise { } - async eth_getLogs(): Promise { + async eth_getLogs(filter: {address: string | string[], topics: (string|string[])[], fromBlock: string | Tag, toBlock: string | Tag}): Promise { + // `filter.address` may be a single address or an array + const expectedAddresses = filter.address ? (Array.isArray(filter.address) ? filter.address : [filter.address]).map(a => Address.from(a.toLowerCase()).toBuffer()) : []; + const expectedTopics = filter.topics ? filter.topics : []; + + const blockchain = this[_blockchain]; + const fromBlock = blockchain.blocks.getEffectiveNumber(filter.fromBlock); + const pendingLogsPromises: Promise[] = []; + pendingLogsPromises.push(blockchain.blockLogs.get(fromBlock.toBuffer())); + + const latestBlockNumberBuffer = blockchain.blocks.latest.value.header.number; + const latestBlock = Quantity.from(latestBlockNumberBuffer); + const latestBlockNumber = latestBlock.toNumber(); + let toBlock = blockchain.blocks.getEffectiveNumber(filter.toBlock); + let toBlockNumber: number; + // don't search after the "latest" block, unless it's "pending", of course. + if (toBlock > latestBlock) { + toBlock = latestBlock; + toBlockNumber = latestBlockNumber; + } else { + toBlockNumber = toBlock.toNumber(); + } + + const fromBlockNumber = fromBlock.toNumber(); + // if we have a range of blocks to search, do that here: + if (fromBlockNumber !== toBlockNumber) { + // fetch all the blockLogs in-between `fromBlock` and `toBlock` (excluding + // from, because we already started fetching that one) + for (let i = fromBlockNumber + 1, l = toBlockNumber; i < l; i++) { + pendingLogsPromises.push(blockchain.blockLogs.get(Quantity.from(i))); + } + } + // now filter and compute all the blocks' blockLogs (in block order) + return await Promise.all(pendingLogsPromises).then(blockLogsRange => { + const filteredBlockLogs: ReturnType[] = []; + blockLogsRange.forEach(blockLogs => { + // TODO(perf): this loops over all expectedAddresseses for every block. + // Make it loop only once. + filteredBlockLogs.push(...blockLogs.filter(expectedAddresses, expectedTopics)); + }); + return filteredBlockLogs; + }); } /** @@ -1010,7 +1066,7 @@ export default class EthereumApi implements types.Api { return account.nonce; } - async eth_call(transaction: any, blockNumber: Buffer | Tag | string = Tag.LATEST): Promise { + async eth_call(transaction: any, blockNumber: string | Buffer | Tag = Tag.LATEST): Promise { const blockchain = this[_blockchain]; const blocks = blockchain.blocks; const parentBlock = await blocks.get(blockNumber); @@ -1152,14 +1208,14 @@ export default class EthereumApi implements types.Api { throw new Error("no key for given address or file"); } let tx: Transaction; + const options = {common: this[_common]} if (encryptedKeyFile !== null) { const secretKey = await wallet.decrypt(encryptedKeyFile, passphrase); - tx = new Transaction(transaction); + tx = new Transaction(transaction, options); tx.sign(secretKey); } else { - tx = new Transaction(transaction); - tx.type = Transaction.types.fake; + tx = new Transaction(transaction, options, Transaction.types.fake); } return this[_blockchain].queueTransaction(tx); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 70ae6e743f..275fee8ec9 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -2,6 +2,7 @@ import Miner from "./miner"; import Database from "./database"; import Emittery from "emittery"; import BlockManager, {Block} from "./components/block-manager"; +import BlockLogs, { BlockLog } from "./things/blocklogs"; import TransactionManager from "./components/transaction-manager"; import CheckpointTrie from "merkle-patricia-tree"; import {BN} from "ethereumjs-util"; @@ -17,10 +18,9 @@ import TransactionReceipt from "./things/transaction-receipt"; import {encode as rlpEncode} from "rlp"; import Common from "ethereumjs-common"; import {Block as EthereumBlock} from "ethereumjs-block"; - import VM from "ethereumjs-vm"; import Address from "./things/address"; - +import BlockLogManager from "./components/blocklog-manager"; export enum Status { // Flags @@ -41,6 +41,8 @@ export type BlockchainOptions = { time?: Date; blockTime?: number; coinbase: Account; + chainId: number; + common: Common; }; export default class Blockchain extends Emittery { @@ -48,40 +50,43 @@ export default class Blockchain extends Emittery { #miner: Miner; #processingBlock: Promise; public blocks: BlockManager; + public blockLogs: BlockLogManager; public transactions: TransactionManager; public transactionReceipts: Manager; public accounts: AccountManager; public vm: VM; public trie: CheckpointTrie; readonly #database: Database; - readonly #options: BlockchainOptions + readonly #options: BlockchainOptions; /** * Initializes the underlying Database and handles synchronization between * the ledger and the database. * - * Emits a `ready` event once the database and - * all dependencies are fully initialized. + * Emits a `ready` event once the database and all dependencies are fully + * initialized. * @param options */ constructor(options: BlockchainOptions) { super(); this.#options = options; + const common = options.common; + const database = (this.#database = new Database(options, this)); database.on("ready", async () => { // TODO: get the latest block from the database // if we have a latest block, `root` will be that block's header.stateRoot - // and we will skip creating the genesis block alltogether + // and we will skip creating the genesis block altogether const root: Buffer = null; this.trie = new CheckpointTrie(database.trie, root); - this.blocks = new BlockManager(this, database.blocks); - this.vm = this.createVmFromStateTrie(this.trie, options.hardfork, options.allowUnlimitedContractSize); + this.blocks = new BlockManager(this, database.blocks, {common}); + this.blockLogs = new BlockLogManager(database.blockLogs); + this.vm = this.createVmFromStateTrie(this.trie, options.allowUnlimitedContractSize); - this.transactions = new TransactionManager(this, database.transactions, options); + this.transactions = new TransactionManager(this, database.transactions, {common}); this.transactionReceipts = new Manager( - this, database.transactionReceipts, TransactionReceipt ); @@ -155,17 +160,29 @@ export default class Blockchain extends Emittery { this.blocks.latest = block; this.#processingBlock = this.#database.batch(() => { + const blockHash = block.value.hash(); + const blockNumber = block.value.header.number; + const blockLogs = BlockLogs.create(blockHash); blockData.blockTransactions.forEach((tx: Transaction, i: number) => { const hash = tx.hash(); - // todo: clean up transction extra data stuffs because this is gross: - const extraData = [...tx.raw, block.value.hash(), block.value.header.number, Quantity.from(i).toBuffer()]; + // TODO: clean up transaction extra data stuffs because this is gross: + const extraData = [...tx.raw, blockHash, blockNumber, Quantity.from(i).toBuffer()]; const encodedTx = rlpEncode(extraData); this.transactions.set(hash, encodedTx); const receipt = tx.getReceipt(); const encodedReceipt = receipt.serialize(true); this.transactionReceipts.set(hash, encodedReceipt); + + tx.getLogs().forEach(log => { + blockLogs.append( + Quantity.from(i).toBuffer(), + hash, + log + ); + }) }); + this.blockLogs.set(blockNumber, blockLogs.serialize()); block.value.transactions = blockData.blockTransactions; this.blocks.putBlock(block); return block; @@ -226,22 +243,11 @@ export default class Blockchain extends Emittery { this.emit("resume"); } - createVmFromStateTrie = (stateTrie: CheckpointTrie, hardfork: string, allowUnlimitedContractSize: boolean): any => { - const common = Common.forCustomChain( - "mainnet", // TODO needs to match chain id - { - name: "ganache", - networkId: 1, - chainId: 1, - comment: "Local test network", - bootstrapNodes: [] - }, - hardfork - ); + createVmFromStateTrie = (stateTrie: CheckpointTrie, allowUnlimitedContractSize: boolean): any => { const vm = new VM({ state: stateTrie, activatePrecompiles: true, - common, + common: this.#options.common, allowUnlimitedContractSize, blockchain: { getBlock: (number: BN, done: any) => { @@ -302,7 +308,7 @@ export default class Blockchain extends Emittery { return this.#timeAdjustment = Math.floor((timestamp - Date.now()) / 1000); } - // TODO: this.#snapshots is a potential unbound memory suck. Caller could call `evm_snapshot` over and over + // TODO(perf): this.#snapshots is a potential unbound memory suck. Caller could call `evm_snapshot` over and over // to grow the snapshot stack indefinitely #snapshots: any[] = []; public snapshot() { @@ -373,9 +379,9 @@ export default class Blockchain extends Emittery { ); const getBlockProm = this.blocks.getByHash(snapshotHash); - // TODO: lazily clean up the database. Get all blocks created since our reverted + // TODO(perf): lazily clean up the database. Get all blocks created since our reverted // snapshot was created, and delete them, and their transaction data. - // TODO: look into optimizing this to delete from all reverted snapshots. + // TODO(perf): look into optimizing this to delete from all reverted snapshots. // the current approach looks at each block, finds its parent, then // finds its parent, and so on until we reach our target block. Whenever // we revert a snapshot, we may also throwing away several others, and diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index 014734a3e1..1d07992da5 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -26,12 +26,16 @@ export default class BlockManager extends Manager { */ public pending: Block; - constructor(blockchain: Blockchain, base: LevelUp) { - super(blockchain, base, Block); + #options: {common: Common}; + + constructor(blockchain: Blockchain, base: LevelUp, options: {common: Common}) { + super(base, Block, options); + + this.#options = options; blockchain.on("open", () => { - // TODO: get the last key, set as "earliest" - // TODO: get the first last key, set as "latest" + // TODO: get the first key, set as "earliest" + // TODO: get the last key, set as "latest" }); } @@ -46,73 +50,71 @@ export default class BlockManager extends Manager { return this.pending; } + getBlockByTag(tag: Tag) { + switch (Tag.normalize(tag as Tag)) { + case Tag.LATEST: + return this.latest; + case void 0: + case null: + // the key is probably a hex string, let nature takes its course. + break; + case Tag.PENDING: + return this.pending; + case Tag.EARLIEST: + return this.earliest; + default: + // this probably can't happen. but if someone passed something like + // `toString` in as a block tag and it got this far... maybe we'd + // get here... + throw new Error(`Invalid block Tag: ${tag}`); + } + } + + getEffectiveNumber(tagOrBlockNumber: string | Buffer | Tag = Tag.LATEST ) { + if (typeof tagOrBlockNumber === "string") { + const block = this.getBlockByTag(tagOrBlockNumber as Tag); + if (block) { + const blockNumber = block.value.header.number;; + if (blockNumber.length === 0){ + return Quantity.from(Buffer.from([0])); + } else { + return Quantity.from(blockNumber); + } + } + } + return Quantity.from(tagOrBlockNumber); + } + /** * Creates a Block object with the specified header values * @param header */ createBlock(header: {}): Block { - const block = new Block(null, this); + const block = new Block(null, this.#options); // TODO: make better Object.assign(block.value.header, header); return block; } - async getNumberFromHash(hash: string | Buffer | Tag): Promise { + async getNumberFromHash(hash: string | Buffer | Tag) { return this.base.get(Data.from(hash).toBuffer()) as Promise; } - async getByHash(hash: string | Buffer | Tag): Promise { + async getByHash(hash: string | Buffer | Tag) { const number = await this.getNumberFromHash(hash); return super.get(number); } async getRaw(tagOrBlockNumber: string | Buffer | Tag) { - if (typeof tagOrBlockNumber === "string") { - const tag = Tag.normalize(tagOrBlockNumber as Tag); - switch (tag) { - case Tag.LATEST: - tagOrBlockNumber = this.latest.value.header.number; - if (tagOrBlockNumber.length === 0){ - tagOrBlockNumber = Buffer.from([0]); - } - case void 0: - case null: - // the key is probably a hex string, let nature takes its course. - break; - case Tag.PENDING: - tagOrBlockNumber = this.pending.value.header.number; - case Tag.EARLIEST: - tagOrBlockNumber = this.earliest.value.header.number; - default: - // this probably can't happen. but if someone passed something like - // `toString` in as a block tag and it got this far... maybe we'd - // get here... - throw new Error(`Invalid block Tag: ${tagOrBlockNumber}`); - } - } - return super.getRaw(tagOrBlockNumber); + // TODO(perf): make the block's raw fields accessible on latest/earliest/pending so + // we don't have to fetch them from the db each time a block tag is used. + return super.getRaw(this.getEffectiveNumber(tagOrBlockNumber).toBuffer()); } - async get(tagOrBlockNumber: string | Buffer | Tag): Promise { + async get(tagOrBlockNumber: string | Buffer | Tag) { if (typeof tagOrBlockNumber === "string") { - const tag = Tag.normalize(tagOrBlockNumber as Tag); - switch (tag) { - case Tag.LATEST: - return this.latest; - case void 0: - case null: - // the key is probably a hex string, let nature takes its course. - break; - case Tag.PENDING: - return this.pending; - case Tag.EARLIEST: - return this.earliest; - default: - // this probably can't happen. but if someone passed something like - // `toString` in as a block tag and it got this far... maybe we'd - // get here... - throw new Error(`Invalid block Tag: ${tagOrBlockNumber}`); - } + const block = this.getBlockByTag(tagOrBlockNumber as Tag); + if (block) return block; } return super.get(tagOrBlockNumber); @@ -138,25 +140,21 @@ export default class BlockManager extends Manager { } export class Block { - public readonly manager: BlockManager; public readonly value: EthereumJsBlock; - constructor(raw: Buffer, manager: BlockManager) { - const common = {common: new Common("mainnet", "istanbul")}; + constructor(raw: Buffer, options: {common: Common}) { if (raw) { const data = (rlpDecode(raw) as any) as [Buffer[], Buffer[], Buffer[]]; - this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, common); + this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, options); const rawTransactions = data[1]; // parse transactions so we can use our own transaction class for (let i = 0; i < rawTransactions.length; i++) { - const tx = new Transaction(rawTransactions[i]); + const tx = new Transaction(rawTransactions[i], {common: options.common}); this.value.transactions.push(tx); } } else { - this.value = new EthereumJsBlock(null, common); + this.value = new EthereumJsBlock(null, options); } - - this.manager = manager; } getTxFn = (include = false): ((tx: Transaction) => {[key: string]: string} | Data) => { diff --git a/src/chains/ethereum/src/components/blocklog-manager.ts b/src/chains/ethereum/src/components/blocklog-manager.ts new file mode 100644 index 0000000000..8cc80ba959 --- /dev/null +++ b/src/chains/ethereum/src/components/blocklog-manager.ts @@ -0,0 +1,15 @@ +import BlockLog from "../things/blocklogs"; +import { LevelUp } from "levelup"; +import Manager from "./manager"; +import { Quantity } from "@ganache/utils/src/things/json-rpc"; + +export default class BlockLogManager extends Manager { + constructor(base: LevelUp) { + super(base, BlockLog); + } + async get(key: string | Buffer) { + const log = await super.get(key); + log.setBlockNumber(key instanceof Quantity ? key : Quantity.from(key)); + return log; + } +} diff --git a/src/chains/ethereum/src/components/manager.ts b/src/chains/ethereum/src/components/manager.ts index cda0b362bb..5f6d3fc760 100644 --- a/src/chains/ethereum/src/components/manager.ts +++ b/src/chains/ethereum/src/components/manager.ts @@ -1,18 +1,17 @@ import {LevelUp} from "levelup"; import {Data} from "@ganache/utils/src/things/json-rpc"; -import Blockchain from "../blockchain"; import Tag from "../things/tags"; const NOTFOUND = 404; export type Instantiable = {new (...args: any[]): T}; export default class Manager { - protected blockchain: Blockchain; #Type: Instantiable; + #options: {}; protected base: LevelUp; - constructor(blockchain: Blockchain, base: LevelUp, type: Instantiable) { + constructor(base: LevelUp, type: Instantiable, options?: {}) { this.#Type = type; - this.blockchain = blockchain; + this.#options = options; this.base = base; } getRaw(key: string | Buffer | Tag): Promise { @@ -28,7 +27,7 @@ export default class Manager { async get(key: string | Buffer) { const raw = await this.getRaw(key); if (!raw) return null; - return new this.#Type(raw); + return new this.#Type(raw, this.#options); } set(key: Buffer, value: Buffer): Promise { return this.base.put(key, value); diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts index 96e01e788d..3bf84a27e0 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -4,14 +4,17 @@ import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; import { LevelUp } from "levelup"; import Blockchain from "../blockchain"; import { Data } from "@ganache/utils/src/things/json-rpc"; +import Common from "ethereumjs-common"; -export type TransactionManagerOptions = TransactionPoolOptions; +export type TransactionManagerOptions = TransactionPoolOptions & { + common: Common +}; export default class TransactionManager extends Manager { public transactionPool: TransactionPool; constructor(blockchain: Blockchain, base: LevelUp, options: TransactionManagerOptions) { - super(blockchain, base, Transaction); + super(base, Transaction, {common: options.common}); this.transactionPool = new TransactionPool(blockchain, options); this.transactionPool.on("drain", () => { diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index 854378faa8..ca3e6e970f 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -81,6 +81,7 @@ export default class Database extends Emittery { if (this.#closed) return this.#cleanup(); this.blocks = sub(db, "b", levelupOptions); + this.blockLogs = sub(db, "l", levelupOptions); this.transactions = sub(db, "t", levelupOptions); this.transactionReceipts = sub(db, "r", levelupOptions); diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 5087ba900b..15dff8668c 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -123,12 +123,14 @@ export default class Miner extends Emittery { // vm's "live" trie. await this.#checkpoint(); + const blockLogs = []; const blockData = { blockTransactions, transactionsTrie, receiptTrie, gasUsed: 0n, - timestamp: block.header.timestamp + timestamp: block.header.timestamp, + logs: blockLogs }; // TODO: get a real block? @@ -171,15 +173,16 @@ export default class Miner extends Emittery { // if the transaction will fit in the block, commit it! await this.#commit(); blockTransactions[numTransactions] = best; - + blockGasLeft -= gasUsed; blockData.gasUsed += gasUsed; - + // calculate receipt and tx tries - const rawReceipt = best.initializeReceipt(result); + const receipt = best.fillFromResult(result); const txKey = rlpEncode(numTransactions); promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); - promises.push(putInTrie(receiptTrie, txKey, rawReceipt)); + promises.push(putInTrie(receiptTrie, txKey, receipt)); + // update the block's bloom const bloom = result.bloom.bitvector; diff --git a/src/chains/ethereum/src/things/address.ts b/src/chains/ethereum/src/things/address.ts index a4b61b7c20..d9d34abf3b 100644 --- a/src/chains/ethereum/src/things/address.ts +++ b/src/chains/ethereum/src/things/address.ts @@ -1,7 +1,15 @@ -import {IndexableJsonRpcType, Data} from "@ganache/utils/src/things/json-rpc"; +import {Data} from "@ganache/utils/src/things/json-rpc/json-rpc-data"; -const Address = Data; +class Address extends Data { + /** + * + * @param value + * @param byteLength the exact length the value represents when encoded as + * Ethereum JSON-RPC DATA. + */ + constructor(value: string | Buffer, byteLength: number = 20) { + super(value, byteLength); + } +} -interface Address extends Data {} -export type IndexableAddress = Address & IndexableJsonRpcType; -export default Address; +export default Address diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts new file mode 100644 index 0000000000..74b137c29b --- /dev/null +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -0,0 +1,178 @@ +import { encode as rlpEncode, decode as rlpDecode } from "rlp"; +import { Data, Quantity } from "@ganache/utils/src/things/json-rpc"; +import Address from "./address"; + +const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); +export type TransactionLog = [address: Buffer, topics: Buffer[], data: Buffer[]] +export type BlockLog = [removed: Buffer, transactionIndex: Buffer, transactionHash: Buffer, address: TransactionLog[0], topics: TransactionLog[1], data: TransactionLog[2]]; + +const _raw = Symbol("raw"); + +export default class BlockLogs { + [_raw]: [blockHash: Buffer, blockLog: BlockLog[]]; + + constructor(data: Buffer) { + if (data) { + const decoded = rlpDecode(data) as unknown as [Buffer, BlockLog[]]; + this[_raw] = decoded; + } + } + + /** + * + * @param blockHash Creates an BlogLogs entity with an empty internal logs + * array. + */ + static create(blockHash: Buffer) { + const blockLog = Object.create(BlockLogs.prototype) as BlockLogs; + blockLog[_raw] = [blockHash, []]; + return blockLog; + } + + /** + * rlpEncode's the blockHash and logs array for db storage + */ + public serialize() { + return rlpEncode(this[_raw]); + } + + /** + * Appends the data to the internal logs array + * @param transactionIndex + * @param transactionHash + * @param log + */ + public append(/*removed: boolean, */transactionIndex: Buffer, transactionHash: Buffer, log: TransactionLog) { + this[_raw][1].push([ + BUFFER_ZERO, // `removed`, TODO: this is used for uncles, but we don't support them yet + transactionIndex, // transactionIndex + transactionHash, // transactionHash + log[0], // `address` + log[1], // `topics` + log[2] // `data` + ]) + } + + /** + * Returns the number of logs in the internal logs array. + */ + get length() { + return this[_raw][1].length; + } + + #blockNumber: Quantity; + + public setBlockNumber(blockNumber: Quantity) { + this.#blockNumber = blockNumber; + } + + #logs = () => { + const blockNumber = this.#blockNumber; + const raw = this[_raw]; + const logs = raw[1]; + const l = this.length; + const blockHash = Data.from(raw[0]); + return { + toJSON() { + return { + *[Symbol.iterator]() { + for (let i = 0; i < l; i++) { + yield BlockLogs.logToJSON(logs[i], Quantity.from(i), blockHash, blockNumber); + } + } + } + }, + *[Symbol.iterator]() { + for (let i = 0; i < l; i++) { + const log = logs[i]; + const address = log[3]; + const topics = log[4]; + yield { address, topics, toJSON: () => BlockLogs.logToJSON(log, Quantity.from(i), blockHash, blockNumber) }; + } + } + } + } + + /** + * + * @param log + * @param logIndex The index this log appears in the block + * @param blockHash The hash of the block + * @param blockNumber The block number + */ + protected static logToJSON(log: BlockLog, logIndex: Quantity, blockHash: Data, blockNumber: Quantity) { + const topics = log[4]; + const data = log[5]; + + return { + address: Address.from(log[3]), + blockHash, + blockNumber, + data: Array.isArray(data) ? data.map(d => Data.from(d)) : Data.from(data), + logIndex, // this is the index in the *block* + removed: log[0].equals(BUFFER_ZERO) ? false : true, + topics: Array.isArray(topics) ? topics.map(t => Data.from(t, 32)) : Data.from(topics), + transactionHash: Data.from(log[2], 32), + transactionIndex: Quantity.from(log[1]) + }; + } + + #filterByTopic = (expectedTopics: (string | string[])[], logTopics: Buffer[]) => { + // Exclude log if its number of topics is less than the number expected + if (expectedTopics.length > logTopics.length) return false; + + // for every expectedTopic, we must much the log topic in the same position + return expectedTopics.every((expectedTopic, logPosition) => { + // a `null` topic means "anything" + if (expectedTopic === null) return true; + + let expectedTopicSet: string[]; + if (!Array.isArray(expectedTopic)) { + return logTopics[logPosition] === Data.from(expectedTopic).toBuffer(); + } + // an empty rule set means "anything" + if (expectedTopic.length === 0) return true; + expectedTopicSet = expectedTopic; + + const logTopic = logTopics[logPosition].toString(); + // "OR" logic, e.g., [[A, B]] means log topic in the first position matching either "A" OR "B": + return expectedTopicSet.some(expectedTopic => logTopic === expectedTopic); + }); + } + + /** + * Note: you must call `setBlockNumber(blockNumber)` first. + * + * Topics are order-dependent. A transaction with a log with topics [A, B] will be matched by the following topic + * filters: + * ▸ [] "anything" + * ▸ [A] "A in first position (and anything after)" + * ▸ [null, B] "anything in first position AND B in second position (and anything after)" + * ▸ [A, B] "A" in first position AND B in second position (and anything after)" + * ▸ [[A, B], [A, B]] "(A OR B) in first position AND (A OR B) in second position (and anything after)" + * @param expectedAddresses + * @param expectedTopics + * @returns JSON representation of the filtered logs + */ + * filter(expectedAddresses: Buffer[], expectedTopics: (string | string[])[]) { + const logs = this.#logs(); + if (expectedAddresses.length !== 0) { + if (expectedTopics.length === 0) { + for (const log of logs) { + if (expectedAddresses.some(address => address.equals(log.address))) yield log.toJSON(); + } + } else { + for (const log of logs) { + if (!expectedAddresses.some(address => address.equals(log.address))) continue; + if (this.#filterByTopic(expectedTopics, log.topics)) yield log.toJSON(); + } + } + } else if (expectedTopics.length !== 0) { + for (const log of logs) { + if (this.#filterByTopic(expectedTopics, log.topics)) yield log.toJSON(); + } + } else { + yield* logs.toJSON(); + } + } +} diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index e4c68b4a25..d394ed2ea4 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -3,28 +3,41 @@ import {Block} from "../components/block-manager"; import {encode as rlpEncode, decode as rlpDecode} from "rlp"; import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; +type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; +type FullRawReceipt = [status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer | null]; +type RawReceipt = OmitLastType + export default class TransactionReceipt { #contractAddress: Buffer; - #raw: [Buffer, Buffer, Buffer, Buffer[]]; + #raw: RawReceipt; constructor(data?: Buffer) { if (data) { - const decoded = (rlpDecode(data) as any) as [Buffer, Buffer, Buffer, Buffer[], Buffer]; + const decoded = (rlpDecode(data) as unknown) as FullRawReceipt; this.#init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4]); } } #init = (status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer = null) => { this.#raw = [status, gasUsed, logsBloom, logs]; this.#contractAddress = contractAddress; - }; + } + static fromValues(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer) { const receipt = new TransactionReceipt(); receipt.#init(status, gasUsed, logsBloom, logs, contractAddress); return receipt; } + public serialize(all: boolean) { - return all ? rlpEncode([...this.#raw, this.#contractAddress]) : rlpEncode(this.#raw); + if (all) { + // the database format includes the contractAddress: + return rlpEncode([...this.#raw, this.#contractAddress] as FullRawReceipt); + } else { + // receipt trie format: + return rlpEncode(this.#raw); + } } + public toJSON(block: Block, transaction: Transaction) { const raw = this.#raw; const contractAddress = Data.from(this.#contractAddress).toJSON() diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 4cf6f71979..29d1a45a26 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -9,6 +9,10 @@ import {decode as rlpDecode} from "rlp"; import {RunTxResult} from "ethereumjs-vm/dist/runTx"; import {Block} from "../components/block-manager"; import TransactionReceipt from "./transaction-receipt"; +import Common from "ethereumjs-common"; +import { TransactionLog } from "./blocklogs"; + +type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; const MAX_UINT64 = (1n << 64n) - 1n; const ZERO_BUFFER = Buffer.from([0]); @@ -184,13 +188,14 @@ class Transaction extends (EthereumJsTransaction as any) { _chainId: any; _hash: Buffer; readonly from: Buffer; - #receipt: any; + #receipt: TransactionReceipt; + #logs: TransactionLog[]; /** * @param {Object} [data] The data for this Transaction. * @param {Number} type The `Transaction.types` bit flag for this transaction * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ - constructor(data: any, type: number = Transaction.types.none, options?: any) { + constructor(data: any, options: {common: Common}, type: number = Transaction.types.none) { super(void 0, options); // EthereumJS-TX Transaction overwrites our `toJSON`, so we overwrite it back here: @@ -259,8 +264,8 @@ class Transaction extends (EthereumJsTransaction as any) { * @param {Number} type The `Transaction.types` bit flag for this transaction * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ - static fromJSON(json: any, type: any) { - let toAccount; + static fromJSON(json: any, common: Common, type: ExtractValuesFromType) { + let toAccount: Buffer; if (json.to) { // Remove all padding and make it easily comparible. const buf = Data.from(json.to).toBuffer(); @@ -286,7 +291,7 @@ class Transaction extends (EthereumJsTransaction as any) { s: Data.from(json.s).toBuffer() }; - const tx = new Transaction(options, type); + const tx = new Transaction(options, { common }, type); tx._hash = json.hash ? Data.from(json.hash).toBuffer() : null; tx._from = json.from ? Data.from(json.from).toBuffer() : null; return tx; @@ -374,21 +379,30 @@ class Transaction extends (EthereumJsTransaction as any) { }; } - initializeReceipt = (result: RunTxResult) => { + /** + * Initializes the receipt and logs + * @param result + * @returns RLP encoded data for use in a transaction trie + */ + fillFromResult (result: RunTxResult) { const vmResult = result.execResult; const status = vmResult.exceptionError ? ZERO_BUFFER : ONE_BUFFER; const gasUsed = result.gasUsed.toBuffer(); const logsBloom = result.bloom.bitvector; - const logs = vmResult.logs || []; + const logs = vmResult.logs || [] as TransactionLog[]; - this._receipt = TransactionReceipt.fromValues(status, gasUsed, logsBloom, logs, result.createdAddress); + const receipt = this.#receipt = TransactionReceipt.fromValues(status, gasUsed, logsBloom, logs, result.createdAddress); + this.#logs = logs; + + return receipt.serialize(false); + }; - // returns RLP encoded data for use in a transaction trie - return this._receipt.serialize(false); + getReceipt() { + return this.#receipt; }; - getReceipt = () => { - return this._receipt; + getLogs() { + return this.#logs; }; } diff --git a/src/chains/ethereum/tsconfig.json b/src/chains/ethereum/tsconfig.json index 62676b00a1..8c3d008ad2 100644 --- a/src/chains/ethereum/tsconfig.json +++ b/src/chains/ethereum/tsconfig.json @@ -3,5 +3,6 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["src"], + "typeRoots": ["./node_modules/@types", "./src/@types"] } diff --git a/src/packages/core/src/servers/http-server.ts b/src/packages/core/src/servers/http-server.ts index d5faef694f..0214fa7db9 100644 --- a/src/packages/core/src/servers/http-server.ts +++ b/src/packages/core/src/servers/http-server.ts @@ -108,7 +108,7 @@ export default class HttpServer { // handle JSONRPC post requests... const writeHeaders = prepareCORSResponseHeaders("POST", request); - // TODO: pre-allocate the buffer if we know the Content-Length + // TODO(perf): pre-allocate the buffer if we know the Content-Length let buffer: Buffer; let aborted = false; response.onAborted(() => { diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index 32d1ffc7ad..5c4091466d 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -93,7 +93,7 @@ export interface Options { * The id of the network returned by the RPC method `net_version`. * Defaults to the current timestamp (`Date.now()`). */ - networkId?: string | number; + networkId?: number; /** * Alias of `networkId`. @@ -183,7 +183,6 @@ export interface Options { }; const getDefault: (options?: Options) => Options = options => { - // TODO: convert to null propagation operator after updating TS to a version that supports it const networkId = (options ? options.networkId || options.netVersion || options.network_id || options.net_version || Date.now() : Date.now() diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index 669cb199fb..90e4e2546e 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -27,7 +27,7 @@ class Quantity extends BaseJsonRpcType { public toBigInt(): bigint | null { const value = this.value; - // TODO: memoize this stuff + // TODO(perf): memoize this stuff if (Buffer.isBuffer(value)) { // Parsed as BE. @@ -66,7 +66,7 @@ class Quantity extends BaseJsonRpcType { } } public toNumber() { - // TODO: convert directly to a number if it is beneficial to do so + // TODO(perf): convert directly to a number if it is beneficial to do so return Number(this.toBigInt()); } valueOf(): bigint { From 8e13a32af1120646f96fd34be5e4bf7f706982c3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 14:26:59 -0400 Subject: [PATCH 360/691] Removme coverage reporter from ethereum test script --- src/chains/ethereum/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 95bd5be838..3b593589a3 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -23,7 +23,7 @@ }, "scripts": { "tsc": "ts-node ../../../scripts/compile", - "test": "nyc --reporter lcov npm run mocha -- --throw-deprecation --trace-warnings", + "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" }, "bugs": { From 5bccd6f860ec0ee5b25020b6d73d9dc946c0a6c0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 15:25:28 -0400 Subject: [PATCH 361/691] Move uncles tests and simplify some noop code --- .../ethereum/__tests__/api/eth/eth.test.ts | 31 --------- .../ethereum/__tests__/api/eth/uncles.test.ts | 66 ++++++++++++++++++- src/chains/ethereum/src/api.ts | 17 +++-- 3 files changed, 73 insertions(+), 41 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index c6c42e3f14..4955e213f2 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -289,37 +289,6 @@ describe("api", () => { ); }); - it("eth_getUncleCountByBlockHash", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); - await provider.send("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - - const count = await provider.send("eth_getUncleCountByBlockHash", [block.hash]); - assert(count, "0"); - }); - - it("eth_getUncleCountByBlockNumber", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); - await provider.send("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - value: 1 - } - ]); - const _message = await provider.once("message"); - - const count = await provider.send("eth_getUncleCountByBlockNumber", ["0x1"]); - assert(count, "0"); - }); - it("eth_getTransactionReceipt", async () => { const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); const hash = await provider.send("eth_sendTransaction", [ diff --git a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts index 5eb9141e3b..77c7d8e309 100644 --- a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts @@ -5,15 +5,75 @@ import EthereumProvider from "../../../src/provider"; describe("api", () => { describe("eth", () => { - describe("uncles", () => { + describe("eth_getUncle*", () => { let provider: EthereumProvider; + let accounts: string[]; + beforeEach(async () => { provider = await getProvider(); + accounts = await provider.send("eth_accounts"); + }); + + it("eth_getUncleCountByBlockHash", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + await provider.once("message"); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); + + const count = await provider.send("eth_getUncleCountByBlockHash", [block.hash]); + assert.strictEqual(count, "0x0"); + }); + + it("eth_getUncleCountByBlockNumber", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + await provider.once("message"); + + const count = await provider.send("eth_getUncleCountByBlockNumber", ["0x1"]); + assert.strictEqual(count, "0x0"); }); it("eth_getUncleByBlockHashAndIndex", async () => { - const result = await provider.send("eth_getUncleByBlockHashAndIndex"); - assert.deepStrictEqual(result, {}) + await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + await provider.once("message"); + const block = await provider.send("eth_getBlockByNumber", ["0x1"]); + + const result = await provider.send("eth_getUncleByBlockHashAndIndex", [block.hash, "0x0"]); + assert.deepStrictEqual(result, null) + }); + + it("eth_getUncleByBlockNumberAndIndex", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + await provider.once("message"); + + const result = await provider.send("eth_getUncleByBlockNumberAndIndex", ["0x1", "0x0"]); + assert.deepStrictEqual(result, null) }); }); }); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index a72e195e1f..58767e0a62 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -496,8 +496,7 @@ export default class EthereumApi implements types.Api { * @param hash DATA, 32 Bytes - hash of a block. */ async eth_getUncleCountByBlockHash(hash: string | Buffer) { - const block = await this.eth_getBlockByHash(hash); - return block.uncles.length.toString(); + return RPCQUANTITY_ZERO } /** @@ -505,8 +504,7 @@ export default class EthereumApi implements types.Api { * @param hash DATA, 32 Bytes - hash of a block. */ async eth_getUncleCountByBlockNumber(number: string | Buffer) { - const block = await this.eth_getBlockByNumber(number); - return block.uncles.length.toString(); + return RPCQUANTITY_ZERO } /** @@ -516,7 +514,7 @@ export default class EthereumApi implements types.Api { * @param index - the uncle's index position. */ async eth_getUncleByBlockHashAndIndex(hash: Data, index: Quantity) { - return {}; + return null; } /** @@ -526,7 +524,7 @@ export default class EthereumApi implements types.Api { * @param uncleIndex - the uncle's index position. */ async eth_getUncleByBlockNumberAndIndex(blockNumber: Buffer | Tag = Tag.LATEST, uncleIndex: Quantity) { - return {}; + return null; } /** @@ -1336,8 +1334,13 @@ export default class EthereumApi implements types.Api { return false; } + /** + * Returns the current whisper protocol version. + * + * @returns The current whisper protocol version + */ async shh_version() { - return 2; + return "2"; } //#endregion } From 310bc149f66358a762d876a4d89dc33944ae52bd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 15:25:56 -0400 Subject: [PATCH 362/691] Fix and test eth_sendRawTransaction --- .../api/eth/sendRawTransaction.test.ts | 52 +++++++++++++++++++ src/chains/ethereum/src/api.ts | 5 +- .../src/things/json-rpc/json-rpc-quantity.ts | 2 +- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts new file mode 100644 index 0000000000..8df86b1b35 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts @@ -0,0 +1,52 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +import Transaction from "ethereumjs-tx/dist/transaction"; +import Common from "ethereumjs-common"; + +describe("api", () => { + describe("eth", () => { + describe("eth_sendRawTransaction*", () => { + let secretKey = "0x4c3fc38239e503913706205746ef2dcc54a5ea9971988bfcac136b43e3190841"; + let provider: EthereumProvider; + let accounts: string[]; + const common = Common.forCustomChain( + "mainnet", // TODO needs to match chain id + { + name: "ganache", + chainId: 1337, + comment: "Local test network", + bootstrapNodes: [] + }, + "petersburg" + ); + + beforeEach(async () => { + provider = await getProvider({ + mnemonic: "sweet treat", + accounts: [{secretKey, balance: "0xffffff"}] + }); + accounts = await provider.send("eth_accounts"); + }); + + it("processes a signed transaction", async () => { + const transaction = new Transaction({ + value: "0xff", + gasLimit: "0x33450", + to: accounts[0] + }, {common}); + + const secretKeyBuffer = Buffer.from(secretKey.substr(2), "hex"); + transaction.sign(secretKeyBuffer); + + await provider.send("eth_subscribe", ["newHeads"]); + const txHash = await provider.send("eth_sendRawTransaction", [transaction.serialize()]); + await provider.once("message"); + + const receipt = await provider.send("eth_getTransactionReceipt", [txHash]); + assert.strictEqual(receipt.transactionHash, txHash); + }) + }); + }); +}); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 58767e0a62..ac8a6749dd 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -851,7 +851,8 @@ export default class EthereumApi implements types.Api { * @returns The transaction hash */ async eth_sendRawTransaction(transaction: any): Promise { - return await this[_blockchain].queueTransaction(transaction); + const tx = new Transaction(Buffer.from(transaction), {common: this[_common]}, Transaction.types.signed); + return await this[_blockchain].queueTransaction(tx); } /** @@ -984,7 +985,7 @@ export default class EthereumApi implements types.Api { unsubscribe(); return true; } else { - throw new Error(`Subscription ID ${subscriptionId} not found.`) + return false; } } diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index 90e4e2546e..ccb39b8748 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -62,7 +62,7 @@ class Quantity extends BaseJsonRpcType { } return view.getBigUint64(0) as bigint; } else { - return BigInt(value); + return value != null ? BigInt(value) : null; } } public toNumber() { From 27ae1b3bf6eab1249fd374ecf4eea11db788200b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 18:43:30 -0400 Subject: [PATCH 363/691] Add shh_ tests --- .../ethereum/__tests__/api/shh/shh.test.ts | 63 +++++++++++++++++++ src/chains/ethereum/src/api.ts | 16 ++--- 2 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/shh/shh.test.ts diff --git a/src/chains/ethereum/__tests__/api/shh/shh.test.ts b/src/chains/ethereum/__tests__/api/shh/shh.test.ts new file mode 100644 index 0000000000..3d1658b2f1 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/shh/shh.test.ts @@ -0,0 +1,63 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; + +describe("api", () => { + describe("shh", () => { + let provider: EthereumProvider; + before(async () => { + provider = await getProvider(); + }); + + it("returns it's shh_newIdentity status", async () => { + const result = await provider.send("shh_newIdentity"); + assert.deepStrictEqual(result, "0x00"); + }); + + it("returns it's shh_hasIdentity status", async () => { + const result = await provider.send("shh_hasIdentity"); + assert.strictEqual(result, false); + }); + + it("returns false for shh_addToGroup", async () => { + const result = await provider.send("shh_addToGroup"); + assert.strictEqual(result, false); + }); + + it("returns it's shh_newGroup status", async () => { + const result = await provider.send("shh_newGroup"); + assert.deepStrictEqual(result, "0x00"); + }); + + it("returns false for shh_newFilter", async () => { + const result = await provider.send("shh_newFilter"); + assert.strictEqual(result, false); + }); + + it("returns false for shh_uninstallFilter", async () => { + const result = await provider.send("shh_uninstallFilter"); + assert.strictEqual(result, false); + }); + + it("returns []] for shh_getFilterChanges", async () => { + const result = await provider.send("shh_getFilterChanges"); + assert.deepStrictEqual(result, []); + }); + + it("returns false for shh_getMessages", async () => { + const result = await provider.send("shh_getMessages"); + assert.strictEqual(result, false); + }); + + it("returns false for shh_post", async () => { + const result = await provider.send("shh_post"); + assert.strictEqual(result, false); + }); + + it("returns 2 for shh_version", async () => { + const result = await provider.send("shh_version"); + assert.strictEqual(result, "2"); + }); + }); +}); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index ac8a6749dd..e41b81d3a7 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1232,9 +1232,7 @@ export default class EthereumApi implements types.Api { /** * Creates new whisper identity in the client. * - * @callback callback - * @param {error} err - Error Object - * @param {DATA, 60 Bytes} result - the address of the new identiy. + * @returns {DATA, 60 Bytes} result - the address of the new identiy. */ async shh_newIdentity() { return "0x00"; @@ -1244,9 +1242,7 @@ export default class EthereumApi implements types.Api { * Checks if the client hold the private keys for a given identity. * * @param {DATA, 60 Bytes} address - The identity address to check. - * @callback callback - * @param {error} err - Error Object - * @param {Boolean} result - returns true if the client holds the privatekey for that identity, otherwise false. + * @returns returns true if the client holds the privatekey for that identity, otherwise false. */ async shh_hasIdentity(address: string) { return false; @@ -1255,9 +1251,7 @@ export default class EthereumApi implements types.Api { /** * Creates a new group. * - * @callback callback - * @param {error} err - Error Object - * @param {DATA, 60 Bytes} result - the address of the new group. + * @returns the address of the new group. */ async shh_newGroup() { return "0x00"; @@ -1267,9 +1261,7 @@ export default class EthereumApi implements types.Api { * Adds a whisper identity to the group * * @param {DATA, 60 Bytes} - The identity address to add to a group. - * @callback callback - * @param {error} err - Error Object - * @param {Boolean} result - returns true if the identity was successfully added to the group, otherwise false. + * @returns true if the identity was successfully added to the group, otherwise false. */ async shh_addToGroup(address: string) { return false; From f0d8c64ae25b3ba0ffe4b6c31ea57229f8494c6c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 18:44:15 -0400 Subject: [PATCH 364/691] Change `Quantity.toBigInt` to return 0 instead of null when value is `undefined`. --- src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index ccb39b8748..e2b743b729 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -62,7 +62,7 @@ class Quantity extends BaseJsonRpcType { } return view.getBigUint64(0) as bigint; } else { - return value != null ? BigInt(value) : null; + return value != null ? BigInt(value) : 0n; } } public toNumber() { From 014f608cd430aaaddc20c38cdbb4dbc2513ccf92 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 18:45:47 -0400 Subject: [PATCH 365/691] Add test for eth_getTransactionCount --- .../ethereum/__tests__/api/eth/eth.test.ts | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 4955e213f2..a17e511565 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -112,7 +112,61 @@ describe("api", () => { }); }); - describe("eth_blockNumber", async () => { + describe("eth_getTransactionCount", () => { + it("should get the tranasction count of the block", async function() { + const tx = { + from: accounts[0], + to: accounts[1], + value: 1 + }; + + const txCount1 = await provider.send("eth_getTransactionCount", [accounts[0]]); + assert.strictEqual(txCount1, "0x0"); + const initialBlockNumber = await provider.send("eth_blockNumber"); + const txCount2 = await provider.send("eth_getTransactionCount", [accounts[0], initialBlockNumber]); + assert.strictEqual(txCount2, "0x0"); + + await provider.send("eth_subscribe", ["newHeads"]); + + // send one tx, then check the count + await provider.send("miner_stop"); + await provider.send("eth_sendTransaction", [{...tx}]); + await provider.send("miner_start"); + const message1 = await provider.once("message"); + + const txCount3 = await provider.send("eth_getTransactionCount", [accounts[0], message1.data.result.number]); + assert.strictEqual(txCount3, "0x1"); + + // send two txs, then check the count + await provider.send("miner_stop"); + await provider.send("eth_sendTransaction", [{...tx}]); + await provider.send("eth_sendTransaction", [{...tx}]); + await provider.send("miner_start"); + const message2 = await provider.once("message"); + + const txCount4 = await provider.send("eth_getTransactionCount", [accounts[0], message2.data.result.number]); + assert.strictEqual(txCount4, "0x3"); + + // the check the count at different block numbers... + + const txCount5 = await provider.send("eth_getTransactionCount", [accounts[0], message1.data.result.number]); + assert.strictEqual(txCount5, txCount3); + + const txCount6 = await provider.send("eth_getTransactionCount", [accounts[0], initialBlockNumber]); + assert.strictEqual(txCount6, "0x0"); + + const txCount7 = await provider.send("eth_getTransactionCount", [accounts[0]]); + assert.strictEqual(txCount7, txCount4); + + const txCount8 = await provider.send("eth_getTransactionCount", [accounts[0], "earliest"]); + assert.strictEqual(txCount8, "0x0"); + + const txCount9 = await provider.send("eth_getTransactionCount", [accounts[0], "latest"]); + assert.strictEqual(txCount9, txCount4); + }); + }); + + describe("eth_blockNumber", () => { it("should return initial block number of zero", async function() { const blockNumber = await provider.send("eth_blockNumber"); assert.strictEqual(parseInt(blockNumber, 10), 0); From 2983276d319e3c6c2a8ced1af6f686ccb70d95af Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 18:46:17 -0400 Subject: [PATCH 366/691] Add test for rpc_modules --- .../__tests__/api/rpc/modules.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/chains/ethereum/__tests__/api/rpc/modules.test.ts diff --git a/src/chains/ethereum/__tests__/api/rpc/modules.test.ts b/src/chains/ethereum/__tests__/api/rpc/modules.test.ts new file mode 100644 index 0000000000..8d4c32b2cd --- /dev/null +++ b/src/chains/ethereum/__tests__/api/rpc/modules.test.ts @@ -0,0 +1,19 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; + +describe("api", () => { + describe("rpc", () => { + let provider: EthereumProvider; + before(async () => { + provider = await getProvider(); + }); + + it("rpc_modules returns the modules", async () => { + const result = await provider.send("rpc_modules"); + assert.deepStrictEqual(result, RPC_MODULES); + }); + }); +}); From bbadf47b27e825e1e9cea5bc593bf9c154a00081 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 18:53:12 -0400 Subject: [PATCH 367/691] Add test for evm_setAccountNonce --- .../ethereum/__tests__/api/evm/evm.test.ts | 15 +++++++ src/chains/ethereum/src/api.ts | 22 ++++++---- src/chains/ethereum/src/blockchain.ts | 19 ++++++++- src/chains/ethereum/src/miner.ts | 41 +++++++++++-------- 4 files changed, 70 insertions(+), 27 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 7c4a0f111a..bf4a103ae9 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -1,5 +1,6 @@ import getProvider from "../../helpers/getProvider"; import assert from "assert"; +import { Quantity } from "@ganache/utils/src/things/json-rpc"; function between(x: number, min: number, max: number) { return x >= min && x <= max; @@ -80,5 +81,19 @@ describe("api", () => { assert.strictEqual(currentBlock, initialBlock + 1); }); }); + + describe("evm_setAccountNonce", () => { + it("should set the nonce forward", async () => { + const provider = await getProvider(); + const [account] = await provider.send("eth_accounts"); + const newCount = Quantity.from(1000); + const initialCount = parseInt(await provider.send("eth_getTransactionCount", [account])); + assert.strictEqual(initialCount, 0); + const status = await provider.send("evm_setAccountNonce", [account, newCount.toString()]); + assert.strictEqual(status, true); + const afterCount = parseInt(await provider.send("eth_getTransactionCount", [account])); + assert.strictEqual(afterCount, newCount.toNumber()); + }) + }); }); }); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index e41b81d3a7..53b1e9b889 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -21,6 +21,7 @@ import PromiEvent from "@ganache/utils/src/things/promievent"; import Emittery from "emittery"; import Common from "ethereumjs-common"; import BlockLogs from "./things/blocklogs"; +import EthereumAccount from "ethereumjs-account"; //#endregion //#region Constants @@ -155,31 +156,34 @@ export default class EthereumApi implements types.Api { * @param timestamp? the timestamp a block should setup as the mining time. */ async evm_mine(timestamp?: number) { - await this[_blockchain].mine(0, timestamp); + await this[_blockchain].mine(-1, timestamp); return "0x0"; } /** - * Sets the given account's nonce to the specified value. + * Sets the given account's nonce to the specified value. Mines a new block + * before returning. * - * Warning: this may result in an invalid state. + * Warning: this will result in an invalid state tree. * * @param address * @param nonce + * @returns true if it worked */ - async evm_setAccountNonce(address: string, nonce: number | BigInt) { + async evm_setAccountNonce(address: string, nonce: string) { return new Promise((resolve, reject) => { const buffer = Address.from(address).toBuffer(); - this[_blockchain].vm.stateManager.getAccount(buffer, (err, account) => { + this[_blockchain].vm.stateManager.getAccount(buffer, (err: Error, account: EthereumAccount) => { if (err) { return void reject(err) } - account.nonce = nonce; - this[_blockchain].vm.stateManager.putAccount(buffer, account, (err) => { + account.nonce = Quantity.from(nonce).toBuffer(); + this[_blockchain].vm.stateManager.putAccount(buffer, account, (err: Error) => { if (err) { - return void reject(err) + return void reject(err); } - resolve(null); + + this[_blockchain].mine(0).then(() => resolve(true), reject); }); }); }); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 275fee8ec9..330d2c9388 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -120,7 +120,7 @@ export default class Blockchain extends Emittery { waitingOnResume = null; // when coming out of an un-paused state the miner should mine as // many transactions in this first block as it can - return this.mine(0); + return this.mine(-1); }); } return this.mine(1); @@ -130,7 +130,7 @@ export default class Blockchain extends Emittery { const intervalMine = (executables: Map>) => { let promise: Promise; if (!this.#isPaused()) { - promise = this.mine(0); + promise = this.mine(-1); } else { promise = this.once("resume"); } @@ -289,6 +289,21 @@ export default class Blockchain extends Emittery { // store the genesis block in the database return this.blocks.putBlock(genesis); + // bloom:'0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + // coinbase:'0x0000000000000000000000000000000000000000' + // difficulty:'0x' + // extraData:'0x' + // gasLimit:'0x6691b7' + // gasUsed:'0x' + // mixHash:'0x0000000000000000000000000000000000000000000000000000000000000000' + // nonce:'0x0000000000000000' + // number:'0x' + // parentHash:'0x0000000000000000000000000000000000000000000000000000000000000000' + // receiptTrie:'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421' + // stateRoot:'0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3' + // timestamp:'0x0173971ee7f0' + // transactionsTrie:'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421' + // uncleHash:'0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347' }; #timeAdjustment: number = 0; diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 15dff8668c..31a50531bd 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -76,10 +76,10 @@ export default class Miner extends Emittery { * transactions within a single block. The remaining items will be left in * the pending pool to be eligible for mining in the future. * - * @param maxTransactions: maximum number of transactions per block. If `0`, + * @param maxTransactions: maximum number of transactions per block. If `-1`, * unlimited. */ - public async mine(pending: Map>, block: Block, maxTransactions: number = 0) { + public async mine(pending: Map>, block: Block, maxTransactions: number = -1) { // only allow mining a single block at a time (per miner) if (this.#isMining) { // if we are currently mining a block, set the `pending` property @@ -95,11 +95,11 @@ export default class Miner extends Emittery { const lastBlock = await this.#mineTxs(pending, block, maxTransactions); // if there are more txs to mine, mine them! - if (this.#pending) { + if (maxTransactions !== 0 && this.#pending) { const nextBlock = this.#createBlock(lastBlock); const pending = this.#pending; this.#pending = null; - this.mine(pending, nextBlock, this.#options.instamine ? 1 : 0); + this.mine(pending, nextBlock, this.#options.instamine ? 1 : -1); } } @@ -109,19 +109,10 @@ export default class Miner extends Emittery { do { keepMining = false; this.#isMining = true; - let numTransactions = 0; const blockTransactions: Transaction[] = []; - - let blockGasLeft = this.#options.gasLimit.toBigInt(); - const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); - const promises: Promise[] = []; - - // Set a block-level checkpoint so our unsaved trie doesn't update the - // vm's "live" trie. - await this.#checkpoint(); const blockLogs = []; const blockData = { @@ -133,6 +124,24 @@ export default class Miner extends Emittery { logs: blockLogs }; + // don't mine anything at all if maxTransactions is `0` + if (maxTransactions === 0) { + await this.#checkpoint(); + await this.#commit(); + this.emit("block", blockData); + this.#reset(); + return block; + } + + let numTransactions = 0; + let blockGasLeft = this.#options.gasLimit.toBigInt(); + + const promises: Promise[] = []; + + // Set a block-level checkpoint so our unsaved trie doesn't update the + // vm's "live" trie. + await this.#checkpoint(); + // TODO: get a real block? const blockBloom = block.header.bloom; @@ -201,8 +210,8 @@ export default class Miner extends Emittery { // * don't have enough gas left for even the smallest of transactions // * Or if we've mined enough transactions // we're done with this block! - // notice: when `maxTransactions` is `0`, `numTransactions === maxTransactions` - // will always return false. + // notice: when `maxTransactions` is `-1` (AKA infinite), `numTransactions === maxTransactions` + // will always return false, so this comparison works out fine. if (blockGasLeft <= params.TRANSACTION_GAS || numTransactions === maxTransactions) { if (keepMining) { // remove the newest (`best`) tx from this account's pending queue @@ -244,7 +253,7 @@ export default class Miner extends Emittery { this.emit("block", blockData); if (priced.length !== 0) { - maxTransactions = this.#options.instamine ? 1 : 0; + maxTransactions = this.#options.instamine ? 1 : -1; block = this.#createBlock(block); this.#currentlyExecutingPrice = 0n; } else { From d6350bf2a56a9a12874d556c1eebdb530579ad50 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 18:53:25 -0400 Subject: [PATCH 368/691] Fix eth_unsubscribe and add test --- .../__tests__/api/eth/subscribe.test.ts | 101 ++++++++++++++++++ src/chains/ethereum/src/api.ts | 29 ++++- src/chains/ethereum/src/blockchain.ts | 2 +- src/chains/ethereum/src/provider.ts | 2 +- 4 files changed, 128 insertions(+), 6 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/eth/subscribe.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts new file mode 100644 index 0000000000..60d299ef89 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -0,0 +1,101 @@ +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +import { Quantity } from "@ganache/utils/src/things/json-rpc"; + +describe("api", () => { + describe("eth", () => { + describe("eth_subscribe*", () => { + let provider: EthereumProvider; + let accounts: string[]; + const gasLimit = "0x6691b7"; + const now = new Date(2019, 3, 15); + + beforeEach(async () => { + provider = await getProvider({ + time: now, + gasLimit: Quantity.from(gasLimit), + mnemonic: "sweet treat" + }); + accounts = await provider.send("eth_accounts"); + }); + + it("subscribes and unsubscribes", async () => { + const timestamp = ((+now / 1000) | 0) + 1; + const startingBlockNumber = parseInt(await provider.send("eth_blockNumber")); + const subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + + assert(subscriptionId != null); + assert.notStrictEqual(subscriptionId, false); + + // subscribe again + const subscriptionId2 = await provider.send("eth_subscribe", ["newHeads"]); + + // trigger a mine, we should get two events + await provider.send("evm_mine", [timestamp]); + let counter = 0; + + const message = await new Promise((resolve) => { + let firstMessage; + provider.on("message", (message: any) => { + counter++; + if (counter === 1) { + firstMessage = message; + } + if (counter === 2){ + assert.deepStrictEqual(firstMessage.data.result, message.data.result); + resolve(firstMessage); + } + }); + }); + + assert.deepStrictEqual(message, { + type: "eth_subscription", + data: { + result: { + "difficulty": "0x0", + "extraData": "0x", + "gasLimit": gasLimit, + "gasUsed": "0x0", + "hash": "0xdc949ca8143fa0e494f9a07ddaf88c6a28f5752c9d885d075929adeca110e7d3", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "miner": accounts[0], + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000000", + "number": Quantity.from(startingBlockNumber + 1).toString(), + "parentHash": "0x03952e9b420b44ae0b35f9a0375ba91494db28d68d413f9255317ae289a8cd47", + "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "stateRoot": "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", + "timestamp": Quantity.from(timestamp).toString(), + "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + }, + subscription: subscriptionId + } + }); + + // trigger a mine... we should only get a _single_ message this time + const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); + assert.strictEqual(unsubResult, true); + await provider.send("evm_mine", [timestamp]); + await assert.doesNotReject(new Promise((resolve, reject) => { + provider.on("message", async (message: any) => { + if (subscriptionId2 === message.data.subscription) { + const blockNumber = parseInt(await provider.send("eth_blockNumber")); + assert.strictEqual(blockNumber, startingBlockNumber + 2); + + resolve(); + } else { + reject(new Error("Unsubscribe didn't work!")); + } + }); + })); + }); + + it("returns false for unsubscribe with bad id", async () => { + const unsubResult = await provider.send("eth_unsubscribe", ["0xffff"]); + assert.strictEqual(unsubResult, false) + }); + }); + }); +}); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 53b1e9b889..8d294551f6 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -22,6 +22,7 @@ import Emittery from "emittery"; import Common from "ethereumjs-common"; import BlockLogs from "./things/blocklogs"; import EthereumAccount from "ethereumjs-account"; +import { Block } from "./components/block-manager"; //#endregion //#region Constants @@ -61,7 +62,7 @@ export default class EthereumApi implements types.Api { * @param options * @param ready Callback for when the ledger is fully initialized */ - constructor(options: EthereumOptions, emitter: Emittery.Typed) { + constructor(options: EthereumOptions, emitter: Emittery.Typed<{message: any}, "connect" | "disconnect">) { const opts = (this[_options] = options); const {initialAccounts} = this[_wallet] = new Wallet(opts); @@ -934,11 +935,31 @@ export default class EthereumApi implements types.Api { const filters = this[_filters]; const promiEvent = new PromiEvent(resolve => { const subscription = `0x${filters.size.toString(16)}`; - const unsubscribe = this[_blockchain].on("block", (result: any) => { + const unsubscribe = this[_blockchain].on("block", (block: any | Block) => { + const value = block.value; + const header = value.header; + const result = { + "logsBloom": Data.from(header.bloom, 256), // TODO: pending block + "miner": Address.from(header.coinbase), + "difficulty": Quantity.from(header.difficulty), + "extraData": Data.from(header.extraData), + "gasLimit": Quantity.from(header.gasLimit), + "gasUsed": Quantity.from(header.gasUsed), + "hash": Data.from(value.hash(), 32), // TODO: pending block + "mixHash": Data.from(header.mixHash, 32), + "nonce": Data.from(header.nonce, 8), // TODO: pending block + "number": Quantity.from(header.number, true), // TODO: pending block + "parentHash": Data.from(header.parentHash, 32), + "receiptsRoot": Data.from(header.receiptTrie, 32), + "stateRoot": Data.from(header.stateRoot, 32), + "timestamp": Quantity.from(header.timestamp), + "transactionsRoot": Data.from(header.transactionsTrie, 32), + "sha3Uncles": Data.from(header.uncleHash, 32) + }; promiEvent.emit("message", { type: "eth_subscription", data: { - result: result.value.header.toJSON(true), + result: JSON.parse(JSON.stringify(result)), subscription } }); @@ -981,7 +1002,7 @@ export default class EthereumApi implements types.Api { } - async eth_unsubscribe([subscriptionId]: [SubscriptionId]): Promise { + async eth_unsubscribe(subscriptionId: SubscriptionId): Promise { const filters = this[_filters]; const unsubscribe = filters.get(subscriptionId); if (unsubscribe) { diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 330d2c9388..4f0f1e65a4 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -45,7 +45,7 @@ export type BlockchainOptions = { common: Common; }; -export default class Blockchain extends Emittery { +export default class Blockchain extends Emittery.Typed<{block: any | Block}, "start" | "resume" | "pause" | "stop" | "step"> { #state: Status = Status.starting; #miner: Miner; #processingBlock: Promise; diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 59197c5d15..23cc128270 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -15,7 +15,7 @@ type RequestParams> = { readonly method: Method, readonly params: Parameters | undefined }; -export default class EthereumProvider extends Emittery.Typed +export default class EthereumProvider extends Emittery.Typed<{message: any}, "connect" | "disconnect"> implements types.Provider { #options: ProviderOptions; From 4ce562eb6d002d25df2b97158a2dfea37cd7ff96 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 28 Jul 2020 18:57:35 -0400 Subject: [PATCH 369/691] Fix a type error --- src/chains/ethereum/src/components/block-manager.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index 1d07992da5..3518487f94 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -33,10 +33,10 @@ export default class BlockManager extends Manager { this.#options = options; - blockchain.on("open", () => { - // TODO: get the first key, set as "earliest" - // TODO: get the last key, set as "latest" - }); + // blockchain.on("open", () => { + // // TODO: get the first key, set as "earliest" + // // TODO: get the last key, set as "latest" + // }); } /** From cc841ba47073223966a4599a48af722fc48ff929 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 21:40:23 +0000 Subject: [PATCH 370/691] npx lerna add typedoc -ED --scope=@ganache/ethereum --- src/chains/ethereum/npm-shrinkwrap.json | 250 ++++++++++++++++++++++++ src/chains/ethereum/package.json | 3 + 2 files changed, 253 insertions(+) diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 4ef26ac8ad..97211d775f 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -72,6 +72,12 @@ "async": "^2.4.0" } }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, "base-x": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", @@ -111,6 +117,16 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" }, + "brace-expansion": { + "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", + "concat-map": "0.0.1" + } + }, "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", @@ -178,6 +194,12 @@ "safe-buffer": "^5.0.1" } }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, "core-js-pure": { "version": "3.6.5", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", @@ -829,6 +851,23 @@ "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -839,6 +878,39 @@ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "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" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "handlebars": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -871,6 +943,12 @@ "minimalistic-assert": "^1.0.1" } }, + "highlight.js": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.1.2.tgz", + "integrity": "sha512-Q39v/Mn5mfBlMff9r+zzA+gWxRsCRKwEMvYTiisLr/XUiFI/4puWt0Ojdko3R3JCNWGdOWaA5g/Yxqa23kC5AA==", + "dev": true + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -891,11 +969,27 @@ "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true + }, "is-callable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", @@ -932,6 +1026,15 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, "keccak": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", @@ -1252,6 +1355,18 @@ "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" }, + "lunr": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz", + "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", + "dev": true + }, + "marked": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", + "integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==", + "dev": true + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -1379,11 +1494,32 @@ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, + "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.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", @@ -1431,6 +1567,27 @@ "es-abstract": "^1.17.0-next.1" } }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "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=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, "pbkdf2": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", @@ -1448,6 +1605,12 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -1471,6 +1634,24 @@ "util-deprecate": "^1.0.1" } }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -1537,6 +1718,23 @@ "safe-buffer": "^5.0.1" } }, + "shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "string.prototype.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", @@ -1581,6 +1779,46 @@ "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" }, + "typedoc": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.17.8.tgz", + "integrity": "sha512-/OyrHCJ8jtzu+QZ+771YaxQ9s4g5Z3XsQE3Ma7q+BL392xxBn4UMvvCdVnqKC2T/dz03/VXSLVKOP3lHmDdc/w==", + "dev": true, + "requires": { + "fs-extra": "^8.1.0", + "handlebars": "^4.7.6", + "highlight.js": "^10.0.0", + "lodash": "^4.17.15", + "lunr": "^2.3.8", + "marked": "1.0.0", + "minimatch": "^3.0.0", + "progress": "^2.0.3", + "shelljs": "^0.8.4", + "typedoc-default-themes": "^0.10.2" + } + }, + "typedoc-default-themes": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.10.2.tgz", + "integrity": "sha512-zo09yRj+xwLFE3hyhJeVHWRSPuKEIAsFK5r2u47KL/HBKqpwdUSanoaz5L34IKiSATFrjG5ywmIu98hPVMfxZg==", + "dev": true, + "requires": { + "lunr": "^2.3.8" + } + }, + "uglify-js": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", + "integrity": "sha512-Esj5HG5WAyrLIdYU74Z3JdG2PxdIusvj6IWHMtlyESxc7kcDz7zYlYjpnSokn1UbpV0d/QX9fan7gkCNd/9BQA==", + "dev": true, + "optional": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -1597,6 +1835,18 @@ "object.getownpropertydescriptors": "^2.1.0" } }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, "xtend": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 3b593589a3..55b5b80e4c 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -39,5 +39,8 @@ "levelup": "4.4.0", "merkle-patricia-tree": "3.0.0", "scrypt-js": "3.0.1" + }, + "devDependencies": { + "typedoc": "0.17.8" } } From 0713ca9fff1bf0d4bf0d4ec531e51116b8bcc52f Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 21:40:55 +0000 Subject: [PATCH 371/691] npx lerna add typedoc -ED --scope=@ganache/tezos --- src/chains/tezos/npm-shrinkwrap.json | 267 ++++++++++++++++++++++++++- src/chains/tezos/package.json | 7 +- 2 files changed, 271 insertions(+), 3 deletions(-) diff --git a/src/chains/tezos/npm-shrinkwrap.json b/src/chains/tezos/npm-shrinkwrap.json index 81819558a7..ec82815c38 100644 --- a/src/chains/tezos/npm-shrinkwrap.json +++ b/src/chains/tezos/npm-shrinkwrap.json @@ -1,5 +1,270 @@ { "name": "@ganache/tezos", "version": "2.2.1", - "lockfileVersion": 1 + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "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", + "concat-map": "0.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "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" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "handlebars": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, + "highlight.js": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.1.2.tgz", + "integrity": "sha512-Q39v/Mn5mfBlMff9r+zzA+gWxRsCRKwEMvYTiisLr/XUiFI/4puWt0Ojdko3R3JCNWGdOWaA5g/Yxqa23kC5AA==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "lunr": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz", + "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", + "dev": true + }, + "marked": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", + "integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==", + "dev": true + }, + "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.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "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=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "typedoc": { + "version": "0.17.8", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.17.8.tgz", + "integrity": "sha512-/OyrHCJ8jtzu+QZ+771YaxQ9s4g5Z3XsQE3Ma7q+BL392xxBn4UMvvCdVnqKC2T/dz03/VXSLVKOP3lHmDdc/w==", + "dev": true, + "requires": { + "fs-extra": "^8.1.0", + "handlebars": "^4.7.6", + "highlight.js": "^10.0.0", + "lodash": "^4.17.15", + "lunr": "^2.3.8", + "marked": "1.0.0", + "minimatch": "^3.0.0", + "progress": "^2.0.3", + "shelljs": "^0.8.4", + "typedoc-default-themes": "^0.10.2" + } + }, + "typedoc-default-themes": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.10.2.tgz", + "integrity": "sha512-zo09yRj+xwLFE3hyhJeVHWRSPuKEIAsFK5r2u47KL/HBKqpwdUSanoaz5L34IKiSATFrjG5ywmIu98hPVMfxZg==", + "dev": true, + "requires": { + "lunr": "^2.3.8" + } + }, + "uglify-js": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", + "integrity": "sha512-Esj5HG5WAyrLIdYU74Z3JdG2PxdIusvj6IWHMtlyESxc7kcDz7zYlYjpnSokn1UbpV0d/QX9fan7gkCNd/9BQA==", + "dev": true, + "optional": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } } diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 2ad17f47b2..dd864addb0 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -28,7 +28,10 @@ "url": "https://github.com/trufflesuite/ganache-core/issues" }, "dependencies": { - "@ganache/utils": "^2.2.1", - "@ganache/options": "^2.2.1" + "@ganache/options": "^2.2.1", + "@ganache/utils": "^2.2.1" + }, + "devDependencies": { + "typedoc": "0.17.8" } } From 91cbe965aa97b3302e6a80191474a15c8e54815a Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 21:48:23 +0000 Subject: [PATCH 372/691] add build-docs script to chains/ethereum & chains/tezos --- src/chains/ethereum/package.json | 1 + src/chains/tezos/package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 55b5b80e4c..bfe0f310f8 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -22,6 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { + "build:docs": "typedoc --out docs src", "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index dd864addb0..b3a5d1a703 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -22,6 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { + "build:docs": "typedoc --out docs src", "tsc": "ts-node ../../../scripts/compile" }, "bugs": { From 3961dee1afe07da3d06ed85c0179dbc3b45f8e3c Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 22:00:58 +0000 Subject: [PATCH 373/691] add root build:docs script --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 503849ddf8..c6c4a97b8a 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "npm": ">=6.1.0" }, "scripts": { + "build:docs": "lerna exec --no-bail npm run build:docs", "clean": "npx shx rm -rf node_modules && npx lerna clean -y", "create": "ts-node ./scripts/create", "postinstall": "lerna bootstrap && npx patch-package", From 5c48cf0e26ed9997631ac655012e9d6d84e01ec5 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 16:18:56 -0700 Subject: [PATCH 374/691] npx lerna add @trufflesuite/typedoc-default-themes -ED --scope=@ganache/ethereum --- src/chains/ethereum/npm-shrinkwrap.json | 33 +++++++++++++++++++++++++ src/chains/ethereum/package.json | 1 + 2 files changed, 34 insertions(+) diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 97211d775f..bb7756c813 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -4,6 +4,18 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@trufflesuite/typedoc-default-themes": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@trufflesuite/typedoc-default-themes/-/typedoc-default-themes-0.6.1.tgz", + "integrity": "sha512-/wt3Jp+fD/DsxArEMixt94hDjHlB6R82Xa2ffjoCzlXrF8OSidzmzYkMvuxi53t1PaQvobNY5wMTXUqGnt/HXA==", + "dev": true, + "requires": { + "backbone": "^1.4.0", + "jquery": "^3.4.1", + "lunr": "^2.3.6", + "underscore": "^1.9.1" + } + }, "@types/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", @@ -72,6 +84,15 @@ "async": "^2.4.0" } }, + "backbone": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz", + "integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==", + "dev": true, + "requires": { + "underscore": ">=1.8.3" + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -1026,6 +1047,12 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" }, + "jquery": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", + "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1813,6 +1840,12 @@ "dev": true, "optional": true }, + "underscore": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", + "dev": true + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index bfe0f310f8..9f2339091d 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -42,6 +42,7 @@ "scrypt-js": "3.0.1" }, "devDependencies": { + "@trufflesuite/typedoc-default-themes": "0.6.1", "typedoc": "0.17.8" } } From e982df405919cb4942a620b612700161891715a5 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 16:19:07 -0700 Subject: [PATCH 375/691] add initial ethereum typedoc config --- src/chains/ethereum/typedoc.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/chains/ethereum/typedoc.json diff --git a/src/chains/ethereum/typedoc.json b/src/chains/ethereum/typedoc.json new file mode 100644 index 0000000000..426b583eba --- /dev/null +++ b/src/chains/ethereum/typedoc.json @@ -0,0 +1,16 @@ +{ + "name": "@ganache/ethereum", + "mode": "modules", + "module": "commonjs", + "theme": "../../../node_modules/@trufflesuite/typedoc-default-themes/bin/default/", + "includeDeclarations": false, + "ignoreCompilerErrors": true, + "preserveConstEnums": true, + "excludeExternals": true, + "categoryOrder": [ + ], + "exclude": [ + "**/test/*" + ], + "target": "ES6" +} From 91496e99286c8080bb7eea693e6279903575e708 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 16:21:33 -0700 Subject: [PATCH 376/691] rework chains/ethereum build:docs script --- src/chains/ethereum/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 9f2339091d..1b03a91301 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -22,7 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "build:docs": "typedoc --out docs src", + "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts", "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" From 6e48234b21fd735ff83db9b37ac2a44e1a814c64 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 16:29:23 -0700 Subject: [PATCH 377/691] adjust example code formatting for ethereum API --- src/chains/ethereum/src/api.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 8d294551f6..f32fc35961 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -223,11 +223,14 @@ export default class EthereumApi implements types.Api { * @param snapshotId the snapshot id to revert * @returns `true` if a snapshot was reverted, otherwise `false` * - * @example Basic example + * @example + * ```typescript * const snapshotId = await provider.send("evm_snapshot"); * const isReverted = await provider.send("evm_revert", [snapshotId]); + * ``` * - * @example Complete example + * @example + * ```typescript * const provider = ganache.provider(); * const [from, to] = await provider.send("eth_accounts"); * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); @@ -250,6 +253,7 @@ export default class EthereumApi implements types.Api { * * const endingBalance = await provider.send("eth_getBalance", [from]); * assert.strictEqual(BigInt(endingBalance), startingBalance); + * ``` */ async evm_revert(snapshotId: string | number) { return this[_blockchain].revert(Quantity.from(snapshotId)); @@ -264,10 +268,13 @@ export default class EthereumApi implements types.Api { * * @returns The hex-encoded identifier for this snapshot * - * @example Basic example + * @example + * ```typescript * const snapshotId = await provider.send("evm_snapshot"); + * ``` * - * @example Complete example + * @example + * ```typescript * const provider = ganache.provider(); * const [from, to] = await provider.send("eth_accounts"); * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); @@ -290,6 +297,7 @@ export default class EthereumApi implements types.Api { * * const endingBalance = await provider.send("eth_getBalance", [from]); * assert.strictEqual(BigInt(endingBalance), startingBalance); + * ``` */ async evm_snapshot() { return Quantity.from(this[_blockchain].snapshot()); From 150d1699510da49581ac29801cb7fca63927ad14 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 16:30:51 -0700 Subject: [PATCH 378/691] npx lerna add @trufflesuite/typedoc-default-themes -ED --scope=@ganache/tezos --- src/chains/tezos/npm-shrinkwrap.json | 33 ++++++++++++++++++++++++++++ src/chains/tezos/package.json | 1 + 2 files changed, 34 insertions(+) diff --git a/src/chains/tezos/npm-shrinkwrap.json b/src/chains/tezos/npm-shrinkwrap.json index ec82815c38..a552d01316 100644 --- a/src/chains/tezos/npm-shrinkwrap.json +++ b/src/chains/tezos/npm-shrinkwrap.json @@ -4,6 +4,27 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@trufflesuite/typedoc-default-themes": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@trufflesuite/typedoc-default-themes/-/typedoc-default-themes-0.6.1.tgz", + "integrity": "sha512-/wt3Jp+fD/DsxArEMixt94hDjHlB6R82Xa2ffjoCzlXrF8OSidzmzYkMvuxi53t1PaQvobNY5wMTXUqGnt/HXA==", + "dev": true, + "requires": { + "backbone": "^1.4.0", + "jquery": "^3.4.1", + "lunr": "^2.3.6", + "underscore": "^1.9.1" + } + }, + "backbone": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz", + "integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==", + "dev": true, + "requires": { + "underscore": ">=1.8.3" + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -104,6 +125,12 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, + "jquery": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", + "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -248,6 +275,12 @@ "dev": true, "optional": true }, + "underscore": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", + "dev": true + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index b3a5d1a703..bd176c423e 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -33,6 +33,7 @@ "@ganache/utils": "^2.2.1" }, "devDependencies": { + "@trufflesuite/typedoc-default-themes": "0.6.1", "typedoc": "0.17.8" } } From 27023b080dfa24e4161453a119260d0ef1365623 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 16:32:17 -0700 Subject: [PATCH 379/691] add initial tezos typedoc config --- src/chains/tezos/typedoc.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/chains/tezos/typedoc.json diff --git a/src/chains/tezos/typedoc.json b/src/chains/tezos/typedoc.json new file mode 100644 index 0000000000..c07aaf5144 --- /dev/null +++ b/src/chains/tezos/typedoc.json @@ -0,0 +1,16 @@ +{ + "name": "@ganache/tezos", + "mode": "modules", + "module": "commonjs", + "theme": "../../../node_modules/@trufflesuite/typedoc-default-themes/bin/default/", + "includeDeclarations": false, + "ignoreCompilerErrors": true, + "preserveConstEnums": true, + "excludeExternals": true, + "categoryOrder": [ + ], + "exclude": [ + "**/test/*" + ], + "target": "ES6" +} From 5482fe242cf3c37dc1c2b7f8fba885c51bb888c4 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 30 Jul 2020 16:32:38 -0700 Subject: [PATCH 380/691] rework chains/tezos build:docs script --- src/chains/tezos/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index bd176c423e..63a7341138 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -22,7 +22,7 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "build:docs": "typedoc --out docs src", + "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts", "tsc": "ts-node ../../../scripts/compile" }, "bugs": { From 5e4592dc57cecbcb38904b1f4ba6eb92f9f6c9c8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Jul 2020 21:30:46 -0400 Subject: [PATCH 381/691] Improve vscode debug performance --- docs/README.md | 4 ++-- docs/launch.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index 48d690f44a..7906bbd585 100644 --- a/docs/README.md +++ b/docs/README.md @@ -73,8 +73,8 @@ index 688d3d4..815e111 100644 "ts", "--recursive", "--check-leaks", -- "**/__tests__/**/*.test.ts" -+ "**/ethereum/__tests__/**/*.test.ts" +- "${workspaceFolder}/src/**/__tests__/**/*.test.ts" ++ "${workspaceFolder}/src/chains/ethereum/__tests__/**/*.test.ts" ], "skipFiles": [ "/**/*.js" diff --git a/docs/launch.json b/docs/launch.json index eb53bcc398..65b7050dfe 100644 --- a/docs/launch.json +++ b/docs/launch.json @@ -29,7 +29,7 @@ "ts", "--recursive", "--check-leaks", - "**/__tests__/**/*.test.ts" + "${workspaceFolder}/src/**/__tests__/**/*.test.ts" ], "skipFiles": [ "/**/*.js" From d8704f672f461d2381de0ea0aa71f7c1c0d7ffbf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Jul 2020 21:31:07 -0400 Subject: [PATCH 382/691] Emittery return types are used anymore --- patches/emittery+0.6.0.patch | 55 ------------------------------------ 1 file changed, 55 deletions(-) diff --git a/patches/emittery+0.6.0.patch b/patches/emittery+0.6.0.patch index 5c16ca78c7..19a174098c 100644 --- a/patches/emittery+0.6.0.patch +++ b/patches/emittery+0.6.0.patch @@ -11,61 +11,6 @@ index d386ddb..f76ed70 100644 /** Subscribe to an event. -@@ -256,12 +258,8 @@ declare namespace Emittery { - type UnsubscribeFn = () => void; - type EventNameFromDataMap = Extract; - -- /** -- Maps event names to their emitted data type. -- */ - interface Events { -- // Blocked by https://github.com/microsoft/TypeScript/issues/1863, should be -- // `[eventName: EventName]: unknown;` -+ [eventName: string]: (...args: any[]) => any; - } - - /** -@@ -296,28 +294,30 @@ declare namespace Emittery { - emitter.emit('end'); // TS compilation error - ``` - */ -- class Typed extends Emittery { -- on>(eventName: Name, listener: (eventData: EventDataMap[Name]) => void): Emittery.UnsubscribeFn; -+ class Typed { -+ on> (eventName: Name, listener: (eventData: Parameters[0]) => ReturnType): Emittery.UnsubscribeFn; - on(eventName: Name, listener: () => void): Emittery.UnsubscribeFn; - -- events>(eventName: Name): AsyncIterableIterator; -+ events>(eventName: Name): AsyncIterableIterator[0]>; - -- once>(eventName: Name): Promise; -- once(eventName: Name): Promise; -+ once>(eventName: Name): Promise>; -+ once(eventName: Name): Promise>; - -- off>(eventName: Name, listener: (eventData: EventDataMap[Name]) => void): void; -+ off>(eventName: Name, listener: (eventData: Parameters[0]) => ReturnType): void; - off(eventName: Name, listener: () => void): void; - -- onAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => void): Emittery.UnsubscribeFn; -+ onAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => ReturnType): Emittery.UnsubscribeFn; - anyEvent(): AsyncIterableIterator<[EventNameFromDataMap, EventDataMap[EventNameFromDataMap]]>; - -- offAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => void): void; -+ offAny(listener: (eventName: EventNameFromDataMap | EmptyEvents, eventData?: EventDataMap[EventNameFromDataMap]) => ReturnType): void; - -- emit>(eventName: Name, eventData: EventDataMap[Name]): Promise; -+ emit>(eventName: Name, eventData: Parameters[0]): Promise<[ReturnType]>; - emit(eventName: Name): Promise; - -- emitSerial>(eventName: Name, eventData: EventDataMap[Name]): Promise; -+ emitSerial>(eventName: Name, eventData: Parameters[0]): Promise<[ReturnType]>; - emitSerial(eventName: Name): Promise; -+ -+ clearListeners(eventName?: EventName): void; - } - } - diff --git a/node_modules/emittery/index.js b/node_modules/emittery/index.js index 5ddd3db..9a68c72 100644 --- a/node_modules/emittery/index.js From d51fa34b9720cdc6279e1ad0fea87f8e4a4a100d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 30 Jul 2020 21:35:35 -0400 Subject: [PATCH 383/691] Add filter and log functions, and some tests. Also fixes some bugs in json-rpc conversions --- .../ethereum/__tests__/api/eth/logs.test.ts | 92 +++- .../ethereum/__tests__/temp-tests.test.ts | 2 +- src/chains/ethereum/src/api.ts | 461 ++++++++++++------ src/chains/ethereum/src/blockchain.ts | 39 +- .../src/components/blocklog-manager.ts | 5 +- .../src/components/transaction-manager.ts | 2 +- .../src/components/transaction-pool.ts | 26 +- src/chains/ethereum/src/things/blocklogs.ts | 24 +- .../src/things/transaction-receipt.ts | 10 +- src/packages/core/src/connector.ts | 7 +- src/packages/flavors/src/index.ts | 4 + .../things/json-rpc/json-rpc-base-types.ts | 32 +- .../src/things/json-rpc/json-rpc-quantity.ts | 3 +- src/packages/utils/src/types/api.ts | 2 +- .../utils/src/utils/bigint-to-buffer.ts | 50 +- src/packages/utils/src/utils/index.ts | 3 +- .../utils/src/utils/uint-to-buffer.ts | 117 +++++ 17 files changed, 647 insertions(+), 232 deletions(-) create mode 100644 src/packages/utils/src/utils/uint-to-buffer.ts diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts index feb29d5167..a9877f64c3 100644 --- a/src/chains/ethereum/__tests__/api/eth/logs.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -28,9 +28,9 @@ describe("api", () => { contractAddress = transactionReceipt.contractAddress; }); - it("should return a log for the constructor tranasction", async () => { + it("should return a log for the constructor transaction", async () => { const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); - // assert.strictEqual(logs, []); + assert.strictEqual(logs.length, 1); }); it("should return the code at the deployed block number", async () => { @@ -47,7 +47,93 @@ describe("api", () => { const txReceipt = await provider.send("eth_getTransactionReceipt", [txHash]); assert.deepStrictEqual(txReceipt.logs.length, numberOfLogs); const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); - // assert.deepStrictEqual(logs, txReceipt.logs); + assert.deepStrictEqual(logs, txReceipt.logs); + }); + + it("should filter out other blocks when using `latest`", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + const numberOfLogs = 4; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + }]); + await provider.once("message"); + await provider.send("evm_mine"); + await provider.once("message"); + const logs = await provider.send("eth_getLogs", [{address: contractAddress, toBlock: "latest", fromBlock: "latest"}]); + assert.strictEqual(logs.length, 0); + }); + + it("should filter appropriately when using fromBlock and toBlock", async () => { + const genesisBlockNumber = "0x0"; + const deployBlockNumber = "0x1"; + const emptyBlockNumber = "0x2"; + await provider.send("evm_mine"); // 0x2 + + await provider.send("eth_subscribe", ["newHeads"]); + const numberOfLogs = 4; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + }]); // 0x3 + await provider.once("message"); + const {blockNumber} = await provider.send("eth_getTransactionReceipt", [txHash]); + + async function testGetLogs(fromBlock: string, toBlock: string, expected: number, address: string = contractAddress){ + const logs = await provider.send("eth_getLogs", [{address, fromBlock, toBlock}]); + assert.strictEqual(logs.length, expected, `there should be ${expected} log(s) between the ${fromBlock} block and the ${toBlock} block`); + } + + // tests ranges up to latest/blockNumber + await testGetLogs("earliest", "earliest", 0); + await testGetLogs(genesisBlockNumber, genesisBlockNumber, 0); + await testGetLogs("earliest", emptyBlockNumber, 1); + await testGetLogs(genesisBlockNumber, emptyBlockNumber, 1); + await testGetLogs("earliest", "latest", numberOfLogs + 1); + await testGetLogs("earliest", blockNumber, numberOfLogs + 1); + await testGetLogs(genesisBlockNumber, "latest", numberOfLogs + 1); + await testGetLogs(genesisBlockNumber, blockNumber, numberOfLogs + 1); + await testGetLogs(deployBlockNumber, "latest", numberOfLogs + 1); + await testGetLogs(deployBlockNumber, blockNumber, numberOfLogs + 1); + await testGetLogs(emptyBlockNumber, "latest", numberOfLogs); + await testGetLogs(emptyBlockNumber, blockNumber, numberOfLogs); + + // tests variations where latest === blockNumber + await testGetLogs(blockNumber, blockNumber, numberOfLogs); + await testGetLogs(blockNumber, "latest", numberOfLogs); + await testGetLogs("latest", blockNumber, numberOfLogs); + await testGetLogs("latest", "latest", numberOfLogs); + + // mine an extra block + await provider.send("evm_mine"); // 0x3 + const lastBlockNumber = `0x${(parseInt(blockNumber) + 1).toString(16)}`; + await provider.once("message"); + + + // test variations of `earliest` and `0x0` + await testGetLogs(genesisBlockNumber, genesisBlockNumber, 0); + await testGetLogs("earliest", "earliest", 0); + await testGetLogs("earliest", genesisBlockNumber, 0); + await testGetLogs(genesisBlockNumber, "earliest", 0); + + // test misc ranges not already tests + await testGetLogs(genesisBlockNumber, deployBlockNumber, 1); + await testGetLogs("earliest", deployBlockNumber, 1); + await testGetLogs("earliest", "latest", numberOfLogs + 1); + await testGetLogs(genesisBlockNumber, "latest", numberOfLogs + 1); + await testGetLogs(deployBlockNumber, "latest", numberOfLogs + 1); + // test variations involving the last block number + await testGetLogs(genesisBlockNumber, lastBlockNumber, numberOfLogs + 1); + await testGetLogs(deployBlockNumber, lastBlockNumber, numberOfLogs + 1); + await testGetLogs(emptyBlockNumber, lastBlockNumber, numberOfLogs); + await testGetLogs(lastBlockNumber, "latest", 0); + await testGetLogs("latest", lastBlockNumber, 0); }); }); }); diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index 647819edb6..877b3703f2 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -227,6 +227,6 @@ describe("Random tests that are temporary!", () => { }); const accounts = await p.send("eth_accounts"); const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); - assert(true); + assert(result, "0x"); }); }); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 8d294551f6..3b5053f2fc 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -13,6 +13,38 @@ import { decode as rlpDecode } from "rlp"; type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; type TypedData = Exclude[1]["data"], NotTypedData>; +enum FilterTypes { + log, + block, + pendingTransaction +}; +type Topic = string|string[]; +type FilterArgs = {address?: string | string[], topics?: Topic[], fromBlock?: string | Tag, toBlock?: string | Tag}; +function parseFilter(filter: FilterArgs, blockchain: Blockchain) { + // `filter.address` may be a single address or an array + const addresses = filter.address ? (Array.isArray(filter.address) ? filter.address : [filter.address]).map(a => Address.from(a.toLowerCase()).toBuffer()) : []; + const topics = filter.topics ? filter.topics : []; + + const fromBlock = blockchain.blocks.getEffectiveNumber(filter.fromBlock || "latest"); + const latestBlockNumberBuffer = blockchain.blocks.latest.value.header.number; + const latestBlock = Quantity.from(latestBlockNumberBuffer); + const latestBlockNumber = latestBlock.toNumber(); + const toBlock = blockchain.blocks.getEffectiveNumber(filter.toBlock || "latest"); + let toBlockNumber: number; + // don't search after the "latest" block, unless it's "pending", of course. + if (toBlock > latestBlock) { + toBlockNumber = latestBlockNumber; + } else { + toBlockNumber = toBlock.toNumber(); + } + return { + addresses, + fromBlock, + toBlock, + toBlockNumber, + topics + }; +} const createKeccakHash = require("keccak"); // Read in the current ganache version from core's package.json @@ -34,14 +66,6 @@ const RPCQUANTITY_ZERO = Quantity.from("0x0"); const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; //#endregion -// We use symbols for private properties because types.Api -// only allows index types of index type '(...args: any) => Promise' -const _blockchain = Symbol("blockchain"); -const _options = Symbol("options"); -const _wallet = Symbol("wallet"); -const _filters = Symbol("filters"); -const _common = Symbol("common"); - //#region types type SubscriptionId = string; //#endregion @@ -49,11 +73,13 @@ type SubscriptionId = string; export default class EthereumApi implements types.Api { readonly [index: string]: (...args: any) => Promise; - private readonly [_common]: Common; - private readonly [_filters] = new Map(); - private readonly [_blockchain]: Blockchain; - private readonly [_options]: EthereumOptions; - private readonly [_wallet]: Wallet; + readonly #getId = ((id) => () => Quantity.from(++id))(0); + readonly #common: Common; + readonly #filters = new Map(); + readonly #subscriptions = new Map(); + readonly #blockchain: Blockchain; + readonly #options: EthereumOptions; + readonly #wallet: Wallet; /** * This is the Ethereum ledger that the provider interacts with. @@ -63,14 +89,14 @@ export default class EthereumApi implements types.Api { * @param ready Callback for when the ledger is fully initialized */ constructor(options: EthereumOptions, emitter: Emittery.Typed<{message: any}, "connect" | "disconnect">) { - const opts = (this[_options] = options); + const opts = (this.#options = options); - const {initialAccounts} = this[_wallet] = new Wallet(opts); + const {initialAccounts} = this.#wallet = new Wallet(opts); const blockchainOptions = options as BlockchainOptions; blockchainOptions.initialAccounts = initialAccounts; blockchainOptions.coinbase = initialAccounts[0]; - this[_common] = blockchainOptions.common = Common.forCustomChain( + this.#common = blockchainOptions.common = Common.forCustomChain( "mainnet", // TODO needs to match chain id { name: "ganache", @@ -81,7 +107,7 @@ export default class EthereumApi implements types.Api { }, options.hardfork ); - const blockchain = (this[_blockchain] = new Blockchain(blockchainOptions)); + const blockchain = (this.#blockchain = new Blockchain(blockchainOptions)); blockchain.on("start", () => { emitter.emit("connect"); }); @@ -157,7 +183,7 @@ export default class EthereumApi implements types.Api { * @param timestamp? the timestamp a block should setup as the mining time. */ async evm_mine(timestamp?: number) { - await this[_blockchain].mine(-1, timestamp); + await this.#blockchain.mine(-1, timestamp); return "0x0"; } @@ -174,17 +200,17 @@ export default class EthereumApi implements types.Api { async evm_setAccountNonce(address: string, nonce: string) { return new Promise((resolve, reject) => { const buffer = Address.from(address).toBuffer(); - this[_blockchain].vm.stateManager.getAccount(buffer, (err: Error, account: EthereumAccount) => { + this.#blockchain.vm.stateManager.getAccount(buffer, (err: Error, account: EthereumAccount) => { if (err) { return void reject(err) } account.nonce = Quantity.from(nonce).toBuffer(); - this[_blockchain].vm.stateManager.putAccount(buffer, account, (err: Error) => { + this.#blockchain.vm.stateManager.putAccount(buffer, account, (err: Error) => { if (err) { return void reject(err); } - this[_blockchain].mine(0).then(() => resolve(true), reject); + this.#blockchain.mine(0).then(() => resolve(true), reject); }); }); }); @@ -196,7 +222,7 @@ export default class EthereumApi implements types.Api { * @returns Returns the total time adjustment, in seconds. */ async evm_increaseTime(seconds: number) { - return this[_blockchain].increaseTime(seconds); + return this.#blockchain.increaseTime(seconds); } /** @@ -210,7 +236,7 @@ export default class EthereumApi implements types.Api { * @returns The amount of *seconds* between the given timestamp and now. */ async evm_setTime(time?: Date | number) { - return this[_blockchain].setTime(+time); + return this.#blockchain.setTime(+time); } /** @@ -252,7 +278,7 @@ export default class EthereumApi implements types.Api { * assert.strictEqual(BigInt(endingBalance), startingBalance); */ async evm_revert(snapshotId: string | number) { - return this[_blockchain].revert(Quantity.from(snapshotId)); + return this.#blockchain.revert(Quantity.from(snapshotId)); } /** @@ -292,7 +318,7 @@ export default class EthereumApi implements types.Api { * assert.strictEqual(BigInt(endingBalance), startingBalance); */ async evm_snapshot() { - return Quantity.from(this[_blockchain].snapshot()); + return Quantity.from(this.#blockchain.snapshot()); } //#endregion evm @@ -306,7 +332,7 @@ export default class EthereumApi implements types.Api { * @returns true */ async miner_start(threads: number = 1) { - this[_blockchain].resume(threads); + this.#blockchain.resume(threads); return true; } @@ -314,7 +340,7 @@ export default class EthereumApi implements types.Api { * Stop the CPU mining operation. */ async miner_stop() { - this[_blockchain].pause(); + this.#blockchain.pause(); return true; } @@ -325,7 +351,7 @@ export default class EthereumApi implements types.Api { * process. */ async miner_setGasPrice(number: Quantity) { - this[_options].gasPrice = number; + this.#options.gasPrice = number; return true; } @@ -334,7 +360,7 @@ export default class EthereumApi implements types.Api { * @param address */ async miner_setEtherbase(address: string) { - this[_blockchain].coinbase = Address.from(address); + this.#blockchain.coinbase = Address.from(address); return true; } //#endregion @@ -365,7 +391,7 @@ export default class EthereumApi implements types.Api { * Quantity/Data encoded. */ async net_version(): Promise { - return this[_options].networkId.toString(); + return this.#options.networkId.toString(); } /** @@ -428,7 +454,7 @@ export default class EthereumApi implements types.Api { * @returns 20 bytes - the current coinbase address. */ async eth_coinbase(): Promise
{ - return this[_blockchain].coinbase; + return this.#blockchain.coinbase; } /** @@ -438,7 +464,7 @@ export default class EthereumApi implements types.Api { * @returns Block */ async eth_getBlockByNumber(number: string | Buffer, transactions = false) { - const block = await this[_blockchain].blocks.get(number); + const block = await this.#blockchain.blocks.get(number); return block.toJSON(transactions); } @@ -449,7 +475,7 @@ export default class EthereumApi implements types.Api { * @returns Block */ async eth_getBlockByHash(hash: string | Buffer, transactions = false) { - const block = await this[_blockchain].blocks.getByHash(hash); + const block = await this.#blockchain.blocks.getByHash(hash); return block.toJSON(transactions); } @@ -458,7 +484,7 @@ export default class EthereumApi implements types.Api { * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. */ async eth_getBlockTransactionCountByNumber(number: string | Buffer) { - const rawBlock = await this[_blockchain].blocks.getRaw(number); + const rawBlock = await this.#blockchain.blocks.getRaw(number); const data = rlpDecode(rawBlock); return (data[1] as any).length; } @@ -468,7 +494,7 @@ export default class EthereumApi implements types.Api { * @param hash DATA, 32 Bytes - hash of a block. */ async eth_getBlockTransactionCountByHash(hash: string | Buffer) { - const number = await this[_blockchain].blocks.getNumberFromHash(hash); + const number = await this.#blockchain.blocks.getNumberFromHash(hash); return this.eth_getBlockTransactionCountByNumber(number); } @@ -573,7 +599,7 @@ export default class EthereumApi implements types.Api { * @returns returns true of the client is mining, otherwise false. */ async eth_mining() { - return this[_blockchain].isMining(); + return this.#blockchain.isMining(); } /** @@ -589,7 +615,7 @@ export default class EthereumApi implements types.Api { * @returns integer of the current gas price in wei. */ async eth_gasPrice() { - return this[_options].gasPrice; + return this.#options.gasPrice; } /** @@ -597,7 +623,7 @@ export default class EthereumApi implements types.Api { * @returns Array of 20 Bytes - addresses owned by the client. */ async eth_accounts() { - return this[_wallet].addresses; + return this.#wallet.addresses; } /** @@ -605,7 +631,7 @@ export default class EthereumApi implements types.Api { * @returns integer of the current block number the client is on. */ async eth_blockNumber() { - const latest = await this[_blockchain].blocks.get(Tag.LATEST); + const latest = await this.#blockchain.blocks.get(Tag.LATEST); return Quantity.from(latest.value.header.number); } @@ -616,7 +642,7 @@ export default class EthereumApi implements types.Api { * @EIP [155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) */ async eth_chainId() { - return this[_options].chainId.toString(); + return this.#options.chainId.toString(); } /** @@ -626,7 +652,7 @@ export default class EthereumApi implements types.Api { * or "pending", see the default block parameter */ async eth_getBalance(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { - const chain = this[_blockchain]; + const chain = this.#blockchain; const account = await chain.accounts.get(Address.from(address), blockNumber); return account.balance; } @@ -639,7 +665,7 @@ export default class EthereumApi implements types.Api { * @returns the code from the given address. */ async eth_getCode(address: Buffer, blockNumber: Buffer | Tag = Tag.LATEST) { - const blockchain = this[_blockchain]; + const blockchain = this.#blockchain; const blockProm = blockchain.blocks.getRaw(blockNumber); const trie = blockchain.trie.copy(); @@ -696,9 +722,9 @@ export default class EthereumApi implements types.Api { position: bigint | number, blockNumber: string | Buffer | Tag = Tag.LATEST ): Promise { - const blockProm = this[_blockchain].blocks.getRaw(blockNumber); + const blockProm = this.#blockchain.blocks.getRaw(blockNumber); - const trie = this[_blockchain].trie.copy(); + const trie = this.#blockchain.trie.copy(); const getFromTrie = (address: Buffer): Promise => new Promise((resolve, reject) => { trie.get(address, (err, data) => { @@ -754,7 +780,7 @@ export default class EthereumApi implements types.Api { * @param transactionHash 32 Bytes - hash of a transaction */ async eth_getTransactionByHash(transactionHash: string): Promise { - const chain = this[_blockchain]; + const chain = this.#blockchain; const transaction = await chain.transactions.get(Data.from(transactionHash).toBuffer()); return transaction; } @@ -768,7 +794,7 @@ export default class EthereumApi implements types.Api { * @returns Returns the receipt of a transaction by transaction hash. */ async eth_getTransactionReceipt(transactionHash: string): Promise<{}> { - const blockchain = this[_blockchain]; + const blockchain = this.#blockchain; const transactionPromise = blockchain.transactions.get(transactionHash); const receiptPromise = blockchain.transactionReceipts.get(transactionHash); const blockPromise = transactionPromise.then(t => (t ? blockchain.blocks.get(t._blockNum) : null)); @@ -804,7 +830,7 @@ export default class EthereumApi implements types.Api { throw new Error("invalid to address"); } - const wallet = this[_wallet]; + const wallet = this.#wallet; const isKnownAccount = wallet.knownAccounts.has(fromString); const isUnlockedAccount = wallet.unlockedAccounts.has(fromString); @@ -820,13 +846,13 @@ export default class EthereumApi implements types.Api { type = Transaction.types.fake; } - const tx = Transaction.fromJSON(transaction, this[_common], type); + const tx = Transaction.fromJSON(transaction, this.#common, type); if (tx.gasLimit.length === 0) { - tx.gasLimit = this[_options].defaultTransactionGasLimit.toBuffer(); + tx.gasLimit = this.#options.defaultTransactionGasLimit.toBuffer(); } if (tx.gasPrice.length === 0) { - const gasPrice = this[_options].gasPrice; + const gasPrice = this.#options.gasPrice; if (gasPrice instanceof Quantity) { tx.gasPrice = gasPrice.toBuffer(); } else { @@ -844,10 +870,10 @@ export default class EthereumApi implements types.Api { if (isUnlockedAccount) { const secretKey = wallet.unlockedAccounts.get(fromString); - return this[_blockchain].queueTransaction(tx, secretKey); + return this.#blockchain.queueTransaction(tx, secretKey); } - return this[_blockchain].queueTransaction(tx); + return this.#blockchain.queueTransaction(tx); } /** @@ -856,8 +882,8 @@ export default class EthereumApi implements types.Api { * @returns The transaction hash */ async eth_sendRawTransaction(transaction: any): Promise { - const tx = new Transaction(Buffer.from(transaction), {common: this[_common]}, Transaction.types.signed); - return await this[_blockchain].queueTransaction(tx); + const tx = new Transaction(Buffer.from(transaction), {common: this.#common}, Transaction.types.signed); + return await this.#blockchain.queueTransaction(tx); } /** @@ -875,7 +901,7 @@ export default class EthereumApi implements types.Api { */ async eth_sign(address: string | Buffer, message: string | Buffer) { const account = Address.from(address).toString().toLowerCase(); - const wallet = this[_wallet]; + const wallet = this.#wallet; const privateKey = wallet.unlockedAccounts.get(account); if (privateKey == null) { throw new Error("cannot sign data; no private key"); @@ -883,7 +909,7 @@ export default class EthereumApi implements types.Api { const messageHash = hashPersonalMessage(Data.from(message).toBuffer()); const signature = ecsign(messageHash, privateKey.toBuffer()); - return toRpcSig(signature.v, signature.r, signature.s, +this[_options].chainId); + return toRpcSig(signature.v, signature.r, signature.s, +this.#options.chainId); } /** @@ -901,7 +927,7 @@ export default class EthereumApi implements types.Api { async eth_signTypedData(address: string | Buffer, typedData: TypedData) { const account = Address.from(address).toString().toLowerCase(); - const privateKey = this[_wallet].unlockedAccounts.get(account); + const privateKey = this.#wallet.unlockedAccounts.get(account); if (privateKey == null) { throw new Error("cannot sign data; no private key"); } @@ -929,13 +955,35 @@ export default class EthereumApi implements types.Api { return signTypedData_v4(privateKey.toBuffer(), { data: typedData }); } - eth_subscribe(subscriptionName: "newHeads", options?: any): PromiEvent { + /** + * Starts a subscription to a particular event. For every event that matches + * the subscription a JSON-RPC notification with event details and + * subscription ID will be sent to a client. + * + * @param subscriptionName + * @returns A subscription id. + */ + eth_subscribe(subscriptionName: "newHeads" | "newPendingTransactions" | "syncing" | "logs"): PromiEvent + /** + * Starts a subscription to a particular event. For every event that matches + * the subscription a JSON-RPC notification with event details and + * subscription ID will be sent to a client. + * + * @param subscriptionName + * @param options Filter options: + * * `address`: either an address or an array of addresses. Only logs that + * are created from these addresses are returned + * * `topics`, only logs which match the specified topics + * @returns A subscription id. + */ + eth_subscribe(subscriptionName: "logs", options: Pick): PromiEvent + eth_subscribe(subscriptionName: "newHeads" | "newPendingTransactions" | "syncing" | "logs", options?: Pick) { + const subscriptions = this.#subscriptions; switch (subscriptionName) { - case "newHeads": - const filters = this[_filters]; - const promiEvent = new PromiEvent(resolve => { - const subscription = `0x${filters.size.toString(16)}`; - const unsubscribe = this[_blockchain].on("block", (block: any | Block) => { + case "newHeads": { + const promiEvent = new PromiEvent(resolve => { + const subscription = this.#getId(); + const unsubscribe = this.#blockchain.on("block", (block: Block) => { const value = block.value; const header = value.header; const result = { @@ -956,57 +1004,90 @@ export default class EthereumApi implements types.Api { "transactionsRoot": Data.from(header.transactionsTrie, 32), "sha3Uncles": Data.from(header.uncleHash, 32) }; + + // TODO: move the JSON stringification closer to where the message + // is actually sent to the listener promiEvent.emit("message", { type: "eth_subscription", data: { result: JSON.parse(JSON.stringify(result)), - subscription + subscription: subscription.toString() } }); }); - filters.set(subscription, unsubscribe); + subscriptions.set(subscription.toString(), unsubscribe); + + resolve(subscription); + }); + return promiEvent; + } + case "logs": { + const promiEvent = new PromiEvent(resolve => { + const subscription = this.#getId(); + const blockchain = this.#blockchain; + const { addresses, topics, fromBlock, toBlock } = parseFilter(options, blockchain); + const unsubscribe = blockchain.on("blockLogs", (blockLogs: BlockLogs) => { + const blockNumber = blockLogs.getBlockNumber(); + if (fromBlock >= blockNumber && blockNumber <= toBlock) { + // TODO: move the JSON stringification closer to where the message + // is actually sent to the listener + const result = JSON.parse(JSON.stringify([...blockLogs.filter(addresses, topics)])); + promiEvent.emit("message", { + type: "eth_subscription", + data: { + result, + subscription: subscription.toString() + } + }); + } + }); + subscriptions.set(subscription.toString(), unsubscribe); resolve(subscription); }); return promiEvent; - //case "logs": - // const promiEvent = new PromiEvent(resolve => { - // this.eth_newFilter([paramsz[1]]) - // .then(hexId => { - // resolve(hexId); - // }); - // }); - // promiEvent.then(hexId => { - // this[_filters] - // .get(hexId) - // .on("block") - // .then((block: any) => { - // const blockNumber = block.number; - // return [{ - // fromBlock: blockNumber, - // toBlock: blockNumber - // }]; - // }).then(this.eth_getLogs).then((logs: any) => { - // promiEvent.emit("result", logs); - // }); - // }); - // return promiEvent; - // case 'newPendingTransactions': - // createSubscriptionFilter = self.newPendingTransactionFilter.bind(self) - // break; - // case 'syncing': - // default: - // cb(new Error('unsupported subscription type')) - // return + } + case "newPendingTransactions": { + const promiEvent = new PromiEvent(resolve => { + const subscription = this.#getId(); + const blockchain = this.#blockchain; + const unsubscribe = blockchain.on("pendingTransaction", (transaction: Transaction) => { + const result = Data.from(transaction.hash(), 32).toString(); + promiEvent.emit("message", { + type: "eth_subscription", + data: { + result, + subscription: subscription.toString() + } + }); + }); + subscriptions.set(subscription.toString(), unsubscribe); + + resolve(subscription); + }); + return promiEvent; + } + case "syncing": { + const subscriptions = this.#subscriptions; + const promiEvent = new PromiEvent(resolve => { + const subscription = this.#getId(); + subscriptions.set(subscription.toString(), () => {}); + + resolve(subscription); + }); + return promiEvent; + } + default: + throw new Error("unsupported subscription type"); } } - async eth_unsubscribe(subscriptionId: SubscriptionId): Promise { - const filters = this[_filters]; - const unsubscribe = filters.get(subscriptionId); + async eth_unsubscribe(subscriptionId: SubscriptionId) { + const subscriptions = this.#subscriptions; + const unsubscribe = subscriptions.get(subscriptionId); if (unsubscribe) { - filters.delete(subscriptionId); + subscriptions.delete(subscriptionId); unsubscribe(); return true; } else { @@ -1014,54 +1095,141 @@ export default class EthereumApi implements types.Api { } } - async eth_newBlockFilter(): Promise { - + /** + * Creates a filter in the node, to notify when a new block arrives. To check + * if the state has changed, call `eth_getFilterChanges`. + * + * @returns A filter id. + */ + async eth_newBlockFilter() { + const unsubscribe = this.#blockchain.on("block", (block: Block) => { + value.updates.push(Data.from(block.value.hash(), 32)); + }); + const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.block}; + const filterId = this.#getId(); + this.#filters.set(filterId.toString(), value); + return filterId; } - async eth_newPendingTransactionFilter(): Promise { + /** + * Creates a filter in the node, to notify when new pending transactions + * arrive. To check if the state has changed, call `eth_getFilterChanges`. + * + * @returns A filter id. + */ + async eth_newPendingTransactionFilter(): Promise { + const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { + value.updates.push(Data.from(transaction.hash(), 32)); + }); + const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.pendingTransaction}; + const filterId = this.#getId(); + this.#filters.set(filterId.toString(), value); + return filterId; } - async eth_newFilter(params: any[]): Promise { + /** + * Creates a filter object, based on filter options, to notify when the state + * changes (logs). To check if the state has changed, call + * `eth_getFilterChanges`. + * + * ### A note on specifying topic filters: + * Topics are order-dependent. A transaction with a log with topics [A, B] + * will be matched by the following topic filters: + * * `[]` “anything” + * * `[A]` “A in first position (and anything after)” + * * `[null, B]` “anything in first position AND B in second position (and + * anything after)” + * * `[A, B]` “A in first position AND B in second position (and anything + * after)” + * * `[[A, B], [A, B]]` “(A OR B) in first position AND (A OR B) in second + * position (and anything after)” + * + * @param filter The filter options + */ + async eth_newFilter(filter: FilterArgs) { + const blockchain = this.#blockchain; + const { addresses, topics, fromBlock, toBlock } = parseFilter(filter, blockchain); + const unsubscribe = blockchain.on("blockLogs", (blockLogs: BlockLogs) => { + const blockNumber = blockLogs.getBlockNumber(); + if (fromBlock >= blockNumber && blockNumber <= toBlock) { + value.updates.push(...blockLogs.filter(addresses, topics)); + } + }); + const value = {updates: [], unsubscribe, filter, type: FilterTypes.log}; + const filterId = this.#getId(); + this.#filters.set(filterId.toString(), value); + return filterId; } - async eth_getFilterChanges(): Promise { + /** + * Polling method for a filter, which returns an array of logs, block hashes, + * or transactions hashes, depending on the filter type, which occurred since + * last poll. + * + * @param filterId the filter id. + * @returns an array of logs, block hashes, + * or transactions hashes, depending on the filter type, which occurred since + * last poll. + */ + async eth_getFilterChanges(filterId: string): Promise { + const filter = this.#filters.get(filterId); + if (filter) { + const updates = filter.updates; + filter.updates = []; + return updates; + } else { + throw new Error("filter not found"); + } } - async eth_uninstallFilter(): Promise { + /** + * Uninstalls a filter with given id. Should always be called when watch is + * no longer needed. + * + * @param filterId the filter id. + * @returns `true` if the filter was successfully uninstalled, otherwise + * `false`. + */ + async eth_uninstallFilter(filterId: string): Promise { + const filter = this.#filters.get(filterId); + if (!filter) return false; + filter.unsubscribe(); + return this.#filters.delete(filterId); } - async eth_getFilterLogs(): Promise { - } - - async eth_getLogs(filter: {address: string | string[], topics: (string|string[])[], fromBlock: string | Tag, toBlock: string | Tag}): Promise { - // `filter.address` may be a single address or an array - const expectedAddresses = filter.address ? (Array.isArray(filter.address) ? filter.address : [filter.address]).map(a => Address.from(a.toLowerCase()).toBuffer()) : []; - const expectedTopics = filter.topics ? filter.topics : []; - const blockchain = this[_blockchain]; - const fromBlock = blockchain.blocks.getEffectiveNumber(filter.fromBlock); - const pendingLogsPromises: Promise[] = []; - pendingLogsPromises.push(blockchain.blockLogs.get(fromBlock.toBuffer())); - - const latestBlockNumberBuffer = blockchain.blocks.latest.value.header.number; - const latestBlock = Quantity.from(latestBlockNumberBuffer); - const latestBlockNumber = latestBlock.toNumber(); - let toBlock = blockchain.blocks.getEffectiveNumber(filter.toBlock); - let toBlockNumber: number; - // don't search after the "latest" block, unless it's "pending", of course. - if (toBlock > latestBlock) { - toBlock = latestBlock; - toBlockNumber = latestBlockNumber; + /** + * Returns an array of all logs matching filter with given id. + * + * @returns Array of log objects, or an empty array. + */ + async eth_getFilterLogs(filterId: string): Promise { + const filter = this.#filters.get(filterId); + if (filter && filter.type === FilterTypes.log) { + return this.eth_getLogs(filter.filter); } else { - toBlockNumber = toBlock.toNumber(); + throw new Error("filter not found"); } + } + + /** + * Returns an array of all logs matching a given filter object. + * + * @param filter The filter options + * @returns Array of log objects, or an empty array. + */ + async eth_getLogs(filter: FilterArgs): Promise { + const blockchain = this.#blockchain; + const {addresses, topics, fromBlock, toBlockNumber} = parseFilter(filter, blockchain); + const pendingLogsPromises: Promise[] = [blockchain.blockLogs.get(fromBlock.toBuffer())]; + const fromBlockNumber = fromBlock.toNumber(); // if we have a range of blocks to search, do that here: if (fromBlockNumber !== toBlockNumber) { // fetch all the blockLogs in-between `fromBlock` and `toBlock` (excluding // from, because we already started fetching that one) - for (let i = fromBlockNumber + 1, l = toBlockNumber; i < l; i++) { - pendingLogsPromises.push(blockchain.blockLogs.get(Quantity.from(i))); + for (let i = fromBlockNumber + 1, l = toBlockNumber + 1; i < l; i++) { + pendingLogsPromises.push(blockchain.blockLogs.get(Quantity.from(i).toBuffer())); } } @@ -1071,7 +1239,7 @@ export default class EthereumApi implements types.Api { blockLogsRange.forEach(blockLogs => { // TODO(perf): this loops over all expectedAddresseses for every block. // Make it loop only once. - filteredBlockLogs.push(...blockLogs.filter(expectedAddresses, expectedTopics)); + if (blockLogs) filteredBlockLogs.push(...blockLogs.filter(addresses, topics)); }); return filteredBlockLogs; }); @@ -1086,16 +1254,25 @@ export default class EthereumApi implements types.Api { * @returns integer of the number of transactions sent from this address. */ async eth_getTransactionCount(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { - const account = await this[_blockchain].accounts.get(Address.from(address), blockNumber); + const account = await this.#blockchain.accounts.get(Address.from(address), blockNumber); return account.nonce; } + + /** + * Executes a new message call immediately without creating a transaction on the block chain. + * + * @param transaction + * @param blockNumber + * + * @returns the return value of executed contract. + */ async eth_call(transaction: any, blockNumber: string | Buffer | Tag = Tag.LATEST): Promise { - const blockchain = this[_blockchain]; + const blockchain = this.#blockchain; const blocks = blockchain.blocks; const parentBlock = await blocks.get(blockNumber); const parentHeader = parentBlock.value.header; - const options = this[_options]; + const options = this.#options; if (!transaction.gasLimit) { if (!transaction.gas) { @@ -1127,11 +1304,11 @@ export default class EthereumApi implements types.Api { * @returns the Ethereum account addresses of all keys that have been added. */ async personal_listAccounts() { - return this[_wallet].addresses; + return this.#wallet.addresses; }; /** - * Generates a new accoutn with private key. Returns the address of the new + * Generates a new account with private key. Returns the address of the new * account. * @param passphrase * @returns The new account's address @@ -1141,8 +1318,8 @@ export default class EthereumApi implements types.Api { throw new Error("missing value for required argument `passphrase`"); } - const wallet = this[_wallet]; - const newAccount = wallet.createRandomAccount(this[_options].mnemonic); + const wallet = this.#wallet; + const newAccount = wallet.createRandomAccount(this.#options.mnemonic); const address = newAccount.address; const strAddress = address.toString(); const encryptedKeyFile = await wallet.encrypt(newAccount.privateKey, passphrase); @@ -1164,7 +1341,7 @@ export default class EthereumApi implements types.Api { throw new Error("missing value for required argument `passphrase`"); } - const wallet = this[_wallet]; + const wallet = this.#wallet; const newAccount = Wallet.createAccountFromPrivateKey(Data.from(rawKey)); const address = newAccount.address; const strAddress = address.toString(); @@ -1180,7 +1357,7 @@ export default class EthereumApi implements types.Api { * @param address */ async personal_lockAccount(address: string) { - return this[_wallet].lockAccount(address.toLowerCase()); + return this.#wallet.lockAccount(address.toLowerCase()); }; /** @@ -1199,7 +1376,7 @@ export default class EthereumApi implements types.Api { * @returns true if it worked. Throws an error if it did not. */ async personal_unlockAccount(address: string, passphrase: string, duration: number = 300) { - return this[_wallet].unlockAccount(address.toLowerCase(), passphrase, duration); + return this.#wallet.unlockAccount(address.toLowerCase(), passphrase, duration); }; /** @@ -1226,13 +1403,13 @@ export default class EthereumApi implements types.Api { throw new Error("from not found; is required"); } - const wallet = this[_wallet]; + const wallet = this.#wallet; const encryptedKeyFile = wallet.encryptedKeyFiles.get(fromString); if (encryptedKeyFile === undefined) { throw new Error("no key for given address or file"); } let tx: Transaction; - const options = {common: this[_common]} + const options = {common: this.#common} if (encryptedKeyFile !== null) { const secretKey = await wallet.decrypt(encryptedKeyFile, passphrase); @@ -1242,7 +1419,7 @@ export default class EthereumApi implements types.Api { tx = new Transaction(transaction, options, Transaction.types.fake); } - return this[_blockchain].queueTransaction(tx); + return this.#blockchain.queueTransaction(tx); }; //#endregion diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 4f0f1e65a4..e1a07b571b 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -2,7 +2,7 @@ import Miner from "./miner"; import Database from "./database"; import Emittery from "emittery"; import BlockManager, {Block} from "./components/block-manager"; -import BlockLogs, { BlockLog } from "./things/blocklogs"; +import BlockLogs from "./things/blocklogs"; import TransactionManager from "./components/transaction-manager"; import CheckpointTrie from "merkle-patricia-tree"; import {BN} from "ethereumjs-util"; @@ -45,10 +45,13 @@ export type BlockchainOptions = { common: Common; }; -export default class Blockchain extends Emittery.Typed<{block: any | Block}, "start" | "resume" | "pause" | "stop" | "step"> { +type BlockchainTypedEvents = {block: Block, blockLogs: BlockLogs, pendingTransaction: Transaction}; +type BlockchainEvents = "start" | "resume" | "pause" | "stop" | "step"; + +export default class Blockchain extends Emittery.Typed { #state: Status = Status.starting; #miner: Miner; - #processingBlock: Promise; + #processingBlock: Promise<{block: Block, blockLogs: BlockLogs}>; public blocks: BlockManager; public blockLogs: BlockLogManager; public transactions: TransactionManager; @@ -185,17 +188,18 @@ export default class Blockchain extends Emittery.Typed<{block: any | Block}, "st this.blockLogs.set(blockNumber, blockLogs.serialize()); block.value.transactions = blockData.blockTransactions; this.blocks.putBlock(block); - return block; + return {block, blockLogs}; }); - this.#processingBlock.then(block => { + this.#processingBlock.then(({block, blockLogs}) => { this.blocks.latest = block; // emit the block once everything has been fully saved to the database this.emit("block", block); + this.emit("blockLogs", blockLogs); }); }); - this.blocks.earliest = this.blocks.latest = await this.#processingBlock; + this.blocks.earliest = this.blocks.latest = await this.#processingBlock.then(({block}) => block); this.#state = Status.started; this.emit("start"); }); @@ -277,7 +281,7 @@ export default class Blockchain extends Emittery.Typed<{block: any | Block}, "st await commit(); }; - #initializeGenesisBlock = async (timestamp: number, blockGasLimit: Quantity): Promise => { + #initializeGenesisBlock = async (timestamp: number, blockGasLimit: Quantity) => { // create the genesis block const genesis = this.blocks.next({ // If we were given a timestamp, use it instead of the `_currentTime` @@ -288,22 +292,7 @@ export default class Blockchain extends Emittery.Typed<{block: any | Block}, "st }); // store the genesis block in the database - return this.blocks.putBlock(genesis); - // bloom:'0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' - // coinbase:'0x0000000000000000000000000000000000000000' - // difficulty:'0x' - // extraData:'0x' - // gasLimit:'0x6691b7' - // gasUsed:'0x' - // mixHash:'0x0000000000000000000000000000000000000000000000000000000000000000' - // nonce:'0x0000000000000000' - // number:'0x' - // parentHash:'0x0000000000000000000000000000000000000000000000000000000000000000' - // receiptTrie:'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421' - // stateRoot:'0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3' - // timestamp:'0x0173971ee7f0' - // transactionsTrie:'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421' - // uncleHash:'0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347' + return this.blocks.putBlock(genesis).then(block => ({block, blockLogs: BlockLogs.create(block.value.hash())})); }; #timeAdjustment: number = 0; @@ -424,7 +413,9 @@ export default class Blockchain extends Emittery.Typed<{block: any | Block}, "st } public async queueTransaction(transaction: any, secretKey?: Data): Promise { - await this.transactions.push(transaction, secretKey); + if(await this.transactions.push(transaction, secretKey)){ + this.emit("pendingTransaction", transaction); + } return Data.from(transaction.hash()); } diff --git a/src/chains/ethereum/src/components/blocklog-manager.ts b/src/chains/ethereum/src/components/blocklog-manager.ts index 8cc80ba959..a7cd8013fe 100644 --- a/src/chains/ethereum/src/components/blocklog-manager.ts +++ b/src/chains/ethereum/src/components/blocklog-manager.ts @@ -7,9 +7,12 @@ export default class BlockLogManager extends Manager { constructor(base: LevelUp) { super(base, BlockLog); } + async get(key: string | Buffer) { const log = await super.get(key); - log.setBlockNumber(key instanceof Quantity ? key : Quantity.from(key)); + if (log) { + log.setBlockNumber(key instanceof Quantity ? key : Quantity.from(key)); + } return log; } } diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts index 3bf84a27e0..64c2f5a204 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -22,7 +22,7 @@ export default class TransactionManager extends Manager { }); } - public push(transaction: Transaction, secretKey?: Data): Promise { + public push(transaction: Transaction, secretKey?: Data) { return this.transactionPool.insert(transaction, secretKey); } } diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index efec3488ac..d207cd433f 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -42,6 +42,14 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { }> = new Map(); #accountPromises = new Map>(); + /** + * Inserts a transaction into the pending queue, if executable, or future pool + * if not. + * + * @param transaction + * @param secretKey + * @returns `true` if the transaction is executable (pending), `false` if it is queued + */ public async insert(transaction: Transaction, secretKey?: Data) { let err: Error; @@ -185,14 +193,18 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { } this.#drainQueued(origin, queuedOriginTransactions, executableOriginTransactions, transactionNonce); - } else if (queuedOriginTransactions) { - queuedOriginTransactions.push(transaction); + return true; } else { - queuedOriginTransactions = utils.Heap.from(transaction, byNonce); - origins.set(origin, { - nonce: highestNonce, - transactions: queuedOriginTransactions - }); + if (queuedOriginTransactions) { + queuedOriginTransactions.push(transaction); + } else { + queuedOriginTransactions = utils.Heap.from(transaction, byNonce); + origins.set(origin, { + nonce: highestNonce, + transactions: queuedOriginTransactions + }); + } + return false; } } diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index 74b137c29b..659b375743 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -7,6 +7,8 @@ export type TransactionLog = [address: Buffer, topics: Buffer[], data: Buffer[]] export type BlockLog = [removed: Buffer, transactionIndex: Buffer, transactionHash: Buffer, address: TransactionLog[0], topics: TransactionLog[1], data: TransactionLog[2]]; const _raw = Symbol("raw"); +const _logs = Symbol("logs"); +const _blockNumber = Symbol("blockNumber"); export default class BlockLogs { [_raw]: [blockHash: Buffer, blockLog: BlockLog[]]; @@ -60,14 +62,22 @@ export default class BlockLogs { return this[_raw][1].length; } - #blockNumber: Quantity; + [_blockNumber]: Quantity; public setBlockNumber(blockNumber: Quantity) { - this.#blockNumber = blockNumber; + this[_blockNumber] = blockNumber; + } + + public getBlockNumber() { + return this[_blockNumber]; + } + + toJSON() { + return this[_logs]().toJSON(); } - #logs = () => { - const blockNumber = this.#blockNumber; + [_logs]() { + const blockNumber = this[_blockNumber]; const raw = this[_raw]; const logs = raw[1]; const l = this.length; @@ -108,10 +118,10 @@ export default class BlockLogs { address: Address.from(log[3]), blockHash, blockNumber, - data: Array.isArray(data) ? data.map(d => Data.from(d)) : Data.from(data), + data: Array.isArray(data) ? data.map(d => Data.from(d)) : Data.from(data, 32), logIndex, // this is the index in the *block* removed: log[0].equals(BUFFER_ZERO) ? false : true, - topics: Array.isArray(topics) ? topics.map(t => Data.from(t, 32)) : Data.from(topics), + topics: Array.isArray(topics) ? topics.map(t => Data.from(t, 32)) : Data.from(topics, 32), transactionHash: Data.from(log[2], 32), transactionIndex: Quantity.from(log[1]) }; @@ -155,7 +165,7 @@ export default class BlockLogs { * @returns JSON representation of the filtered logs */ * filter(expectedAddresses: Buffer[], expectedTopics: (string | string[])[]) { - const logs = this.#logs(); + const logs = this[_logs](); if (expectedAddresses.length !== 0) { if (expectedTopics.length === 0) { for (const log of logs) { diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index d394ed2ea4..16dbe490d8 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -2,6 +2,8 @@ import Transaction from "./transaction"; import {Block} from "../components/block-manager"; import {encode as rlpEncode, decode as rlpDecode} from "rlp"; import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; +import BlockLogs, { TransactionLog } from "./blocklogs"; +import Address from "./address"; type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; type FullRawReceipt = [status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer | null]; @@ -41,6 +43,12 @@ export default class TransactionReceipt { public toJSON(block: Block, transaction: Transaction) { const raw = this.#raw; const contractAddress = Data.from(this.#contractAddress).toJSON() + const blockLog = BlockLogs.create(block.value.hash()); + blockLog.setBlockNumber(Quantity.from(block.value.header.number)); + (raw[3] as any as TransactionLog[]).forEach(log => { + blockLog.append(transaction._index, transaction.hash(), log); + }); + const logs = [...blockLog.toJSON()]; return { transactionHash: Data.from(transaction.hash()), transactionIndex: Quantity.from((transaction as any)._index), @@ -49,7 +57,7 @@ export default class TransactionReceipt { cumulativeGasUsed: Quantity.from(block.value.header.gasUsed), gasUsed: Quantity.from(raw[1]), contractAddress: contractAddress === "0x" ? null : contractAddress, - logs: raw[3], // TODO: figure this out + logs, logsBloom: Data.from(raw[2], 256), // flips a `1` to a `0` and a `0` to a `1` using Bitwise XOR for funsies. status: 1 ^ raw[0][0] diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index 2db7b4458a..1c5af94313 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -1,5 +1,5 @@ import {utils} from "@ganache/utils"; -import {FlavorMap} from "@ganache/flavors"; +import {FlavorMap, DefaultFlavor} from "@ganache/flavors"; import {ProviderOptions} from "@ganache/options"; /** @@ -7,9 +7,8 @@ import {ProviderOptions} from "@ganache/options"; */ export default { // TODO: set missing defaults automatically - initialize: (providerOptions: ProviderOptions = {flavor: "ethereum", asyncRequestProcessing: true}) => { - const flavor = providerOptions.flavor || "ethereum"; - + initialize: (providerOptions: ProviderOptions = {flavor: DefaultFlavor, asyncRequestProcessing: true}) => { + const flavor = providerOptions.flavor || DefaultFlavor; // Set up our request coordinator to either use FIFO or or async request processing. // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts index 596619ecc3..26142a59c0 100644 --- a/src/packages/flavors/src/index.ts +++ b/src/packages/flavors/src/index.ts @@ -12,6 +12,10 @@ export type FlavorMap = { ethereum: EthereumConnector; }; +export type FlavorKeys = keyof FlavorMap; + +export const DefaultFlavor = "ethereum" as const; + export type Flavors = { [k in keyof FlavorMap]: FlavorMap[k]; }[keyof FlavorMap]; diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts index 576b550b5e..bb68d25cee 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts @@ -1,4 +1,5 @@ import {bigIntToBuffer} from "../../utils"; +import {uintToBuffer} from "../../utils"; export type IndexableJsonRpcType< T extends number | bigint | string | Buffer = number | bigint | string | Buffer @@ -38,38 +39,11 @@ export class BaseJsonRpcType (value as number).toString(16)); - toBuffers.set(this, () => { - const arr = new ArrayBuffer(4); - const view = new DataView(arr); - view.setInt32(0, value as number); - return Buffer.from(arr); - }); + toBuffers.set(this, () => uintToBuffer(value as number)); break; case "bigint": toStrings.set(this, () => (value as bigint).toString(16)); - toBuffers.set(this, () => { - return bigIntToBuffer(value as bigint); - //onst value = (2n**64n); - var max = 2n ** 64n - 1n; - - var val = value as bigint; - var size = 4; - var buff = new ArrayBuffer(size * 8); - var view = new DataView(buff); - if (val > max) { - var long = val; - var index = size - 1; - while (long > 0) { - var byte = long & max; - view.setBigUint64(index * 8, byte); - long = (long - byte) / max; - index--; - } - } else { - view.setBigUint64(0, val); - } - return Buffer.from(buff.slice((index + 1) * 8)); - }); + toBuffers.set(this, () => bigIntToBuffer(value as bigint)); break; case "string": { // handle hex-encoded string diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index e2b743b729..39867c97a7 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -66,8 +66,7 @@ class Quantity extends BaseJsonRpcType { } } public toNumber() { - // TODO(perf): convert directly to a number if it is beneficial to do so - return Number(this.toBigInt()); + return typeof this.value === "number" ? this.value : Number(this.toBigInt()); } valueOf(): bigint { const value = this.value; diff --git a/src/packages/utils/src/types/api.ts b/src/packages/utils/src/types/api.ts index 88f9a4cfa0..c4405ffc15 100644 --- a/src/packages/utils/src/types/api.ts +++ b/src/packages/utils/src/types/api.ts @@ -3,7 +3,7 @@ * All properties must be `async` callable or return a `Promise` */ class ApiBase { - readonly [index: string]: (...args: any) => Promise; + readonly [index: string]: (...args: unknown[]) => Promise; } /** diff --git a/src/packages/utils/src/utils/bigint-to-buffer.ts b/src/packages/utils/src/utils/bigint-to-buffer.ts index bc73603392..28d6b54016 100644 --- a/src/packages/utils/src/utils/bigint-to-buffer.ts +++ b/src/packages/utils/src/utils/bigint-to-buffer.ts @@ -1,15 +1,49 @@ +import { uintToBuffer } from "./uint-to-buffer"; + +const MAX_UINT32 = 0xffffffffn; +const allocUnsafe = Buffer.allocUnsafe; + let _bigIntToBuffer: (val: bigint) => Buffer; +/** + * Returns the number of bytes contained in this given `value`. + * @param value + */ +function bigIntByteLength(value: bigint){ + let length = 1; + while (value >>= 8n) length++; + return length; +} + +const MAX_SAFE_INTEGER = BigInt(Number.MAX_SAFE_INTEGER); try { const toBufferBE = require("bigint-buffer").toBufferBE; - _bigIntToBuffer = (val: bigint) => { - const buffer = toBufferBE(val, 128); - for (let i = 0; i < buffer.length - 1; i++) if (buffer[i]) return buffer.slice(i); - return buffer.slice(buffer.length - 1); - }; + _bigIntToBuffer = (value: bigint) => { + if (value <= MAX_SAFE_INTEGER) { + return uintToBuffer(Number(value)); + } else { + const size = bigIntByteLength(value); + return toBufferBE(value, size); + } + } } catch (e) { - _bigIntToBuffer = (val: bigint): Buffer => { - const hex = val.toString(16); - return Buffer.from(hex.length % 2 ? hex : `0${hex}`); + _bigIntToBuffer = (value: bigint): Buffer => { + if (value <= MAX_SAFE_INTEGER) { + // if this value can be handled as a JS number safely, convert it that way + return uintToBuffer(Number(value)); + } else { + let length = bigIntByteLength(value); + const buf = allocUnsafe(length); + do { + // process 1 byte at a time + buf[--length] = Number(value & 0xffffffffn); + value >>= 8n; + } while (length); + return buf; + } }; } + +/** + * Converts a bigint to a Buffer (Big Endian) + */ export const bigIntToBuffer = _bigIntToBuffer; diff --git a/src/packages/utils/src/utils/index.ts b/src/packages/utils/src/utils/index.ts index b98c54e4ad..14e2b4a554 100644 --- a/src/packages/utils/src/utils/index.ts +++ b/src/packages/utils/src/utils/index.ts @@ -2,4 +2,5 @@ export * from "./bigint-to-buffer"; export * from "./executor"; export * from "./heap"; export * from "./request-coordinator"; -export * from "./unref"; \ No newline at end of file +export * from "./unref"; +export * from "./uint-to-buffer" \ No newline at end of file diff --git a/src/packages/utils/src/utils/uint-to-buffer.ts b/src/packages/utils/src/utils/uint-to-buffer.ts new file mode 100644 index 0000000000..fcca47ff58 --- /dev/null +++ b/src/packages/utils/src/utils/uint-to-buffer.ts @@ -0,0 +1,117 @@ +const MAX_UINT32 = 0xffffffff; +const allocUnsafe = Buffer.allocUnsafe; + +function uint32ToBuf(value: number) { + // if value is 32 bits or fewer + let buf: Buffer; + const three = value; + if (value >>>= 8) { + const two = value; + if (value >>>= 8) { + const one = value; + if (value >>>= 8) { + buf = allocUnsafe(4); + buf[0] = value; + buf[1] = one; + buf[2] = two; + buf[3] = three; + } else { + buf = allocUnsafe(3); + buf[0] = one; + buf[1] = two; + buf[2] = three; + } + } else { + buf = allocUnsafe(2); + buf[0] = two; + buf[1] = three; + } + } else { + buf = allocUnsafe(1); + buf[0] = three; + } + return buf; +} + +/** + * Converts unsigned intergers that are wider than 32 bits but smaller than 64. + * @param value + */ +function uintWideToBuf(value: number) { + // for values larger than 32 bits, we need to convert to a BigInt to get the + // the high bits: + let hi = Number(BigInt(value) >> 32n); + const hiLsb = hi; + let buf: Buffer; + let offset = 0; + // the high bits determine the size of the Buffer, so we compute the high bits + // first + if (hi >>>= 8) { + const six = hi; + if (hi >>>= 8) { + const five = hi; + if (hi >>>= 8) { + buf = allocUnsafe(8); + buf[0] = hi; // msb + buf[1] = five; + buf[2] = six; + buf[3] = hiLsb; + offset = 7; + } else { + buf = allocUnsafe(7); + buf[0] = five; // msb + buf[1] = six; + buf[2] = hiLsb; + offset = 6; + } + } else { + buf = allocUnsafe(6); + buf[0] = six; // msb + buf[1] = hiLsb; + offset = 5; + } + } else { + buf = allocUnsafe(5); + buf[0] = hiLsb; // msb + offset = 4; + } + + // set the low bytes: + let lo = value & MAX_UINT32; + const lsb = lo; + if (lo >>>= 8) { + const two = lo; + if (lo >>>= 8) { + const one = lo; + buf[offset-3] = (lo >>>= 8); + buf[offset-2] = one; + buf[offset-1] = two; + buf[offset] = lsb; + } else { + buf[offset-3] = 0; + buf[offset-2] = 0; + buf[offset-1] = two; + buf[offset] = lsb; + } + } else { + buf[offset-3] = 0; + buf[offset-2] = 0; + buf[offset-1] = 0; + buf[offset] = lsb; + } + return buf; +} + +/** + * Converts a JavaScript number, treated as a Whole Numbers (0, 1, 2, 3, 4, ...) + * less than 64 bits wide, to a Buffer. + * + * Numbers that are negative, fractional, or greater than 64 bits wide will + * return very unexpected results. Numbers that are greater than + * `Number.MAX_SAFE_INTEGER` will return unexpected results. + * + * @param value + */ +export function uintToBuffer(value: number) { + return value > MAX_UINT32 ? uintWideToBuf(value) : uint32ToBuf(value); +} From 836fdbffd470ad0e570099b5afac50df5e309744 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Fri, 31 Jul 2020 10:37:03 -0700 Subject: [PATCH 384/691] npx lerna add open-cli -ED --scope=@ganache/ethereum --- src/chains/ethereum/npm-shrinkwrap.json | 611 ++++++++++++++++++++++++ src/chains/ethereum/package.json | 1 + 2 files changed, 612 insertions(+) diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index bb7756c813..455ccf76d1 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -4,6 +4,38 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@tokenizer/token": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.1.1.tgz", + "integrity": "sha512-XO6INPbZCxdprl+9qa/AAbFFOMzzwqYxpjPgLICrMD6C2FCw6qfJOPcBk6JqqPLSaZ/Qx87qn4rpPmPMwaAK6w==", + "dev": true + }, "@trufflesuite/typedoc-default-themes": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/@trufflesuite/typedoc-default-themes/-/typedoc-default-themes-0.6.1.tgz", @@ -24,6 +56,12 @@ "@types/node": "*" } }, + "@types/debug": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", + "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", + "dev": true + }, "@types/keccak": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/keccak/-/keccak-3.0.1.tgz", @@ -32,11 +70,23 @@ "@types/node": "*" } }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "dev": true + }, "@types/node": { "version": "14.0.23", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.23.tgz", "integrity": "sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==" }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, "@types/pbkdf2": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", @@ -68,6 +118,21 @@ } } }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "async": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", @@ -198,6 +263,34 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "checkpoint-store": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", @@ -215,6 +308,21 @@ "safe-buffer": "^5.0.1" } }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -256,6 +364,30 @@ "sha.js": "^2.4.8" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, "deferred-leveldown": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", @@ -354,6 +486,15 @@ "prr": "~1.0.1" } }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, "es-abstract": { "version": "1.17.6", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", @@ -389,6 +530,12 @@ "is-symbol": "^1.0.2" } }, + "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=", + "dev": true + }, "eth-sig-util": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.5.3.tgz", @@ -862,11 +1009,33 @@ "checkpoint-store": "^1.1.0" } }, + "file-type": { + "version": "14.6.2", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-14.6.2.tgz", + "integrity": "sha512-kSZTAJxPXBdBgJyoC7TexkBWoMI/D1Gas6aTtAn9VIRFwCehwiluGV5O8O2GwqO5zIqeEvXxEKl/xfcaAKB0Yg==", + "dev": true, + "requires": { + "readable-web-to-node-stream": "^2.0.0", + "strtok3": "^6.0.3", + "token-types": "^2.0.0", + "typedarray-to-buffer": "^3.1.5" + } + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, "flow-stoplight": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", @@ -899,6 +1068,12 @@ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, + "get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", + "dev": true + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -932,6 +1107,12 @@ "wordwrap": "^1.0.0" } }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -940,6 +1121,12 @@ "function-bind": "^1.1.1" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", @@ -980,6 +1167,12 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", @@ -990,6 +1183,12 @@ "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1011,6 +1210,12 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, "is-callable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", @@ -1021,11 +1226,23 @@ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" }, + "is-docker": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.0.0.tgz", + "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", + "dev": true + }, "is-hex-prefixed": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, "is-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", @@ -1034,6 +1251,12 @@ "has-symbols": "^1.0.1" } }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -1042,6 +1265,21 @@ "has-symbols": "^1.0.1" } }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -1053,6 +1291,18 @@ "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==", "dev": true }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1071,6 +1321,12 @@ "node-gyp-build": "^4.2.0" } }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, "level-codec": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", @@ -1364,6 +1620,21 @@ } } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, "lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", @@ -1388,6 +1659,29 @@ "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", "dev": true }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "dev": true + }, "marked": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", @@ -1437,6 +1731,25 @@ } } }, + "meow": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", + "integrity": "sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + } + }, "merkle-patricia-tree": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz", @@ -1511,6 +1824,12 @@ "brorand": "^1.0.1" } }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -1536,6 +1855,17 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + } + }, "nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", @@ -1557,6 +1887,18 @@ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", @@ -1603,6 +1945,71 @@ "wrappy": "1" } }, + "open": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-7.1.0.tgz", + "integrity": "sha512-lLPI5KgOwEYCDKXf4np7y1PBEkj7HYIyP2DY8mVDRnx0VIIu6bNrRB0R66TuO7Mack6EnTNLm4uvcl1UoklTpA==", + "dev": true, + "requires": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + } + }, + "open-cli": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/open-cli/-/open-cli-6.0.1.tgz", + "integrity": "sha512-A5h8MF3GrT1efn9TiO9LPajDnLtuEiGQT5G8TxWObBlgt1cZJF1YbQo/kNtsD1bJb7HxnT6SaSjzeLq0Rfhygw==", + "dev": true, + "requires": { + "file-type": "^14.1.4", + "get-stdin": "^7.0.0", + "meow": "^6.1.0", + "open": "^7.0.3", + "temp-write": "^4.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", + "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1627,6 +2034,12 @@ "sha.js": "^2.4.8" } }, + "peek-readable": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-3.1.0.tgz", + "integrity": "sha512-KGuODSTV6hcgdZvDrIDBUkN0utcAVj1LL7FfGbM0viKTtCHmtZcuEJ+lGqsp0fTFkGqesdtemV2yUSMeyy3ddA==", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -1643,6 +2056,12 @@ "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1651,6 +2070,45 @@ "safe-buffer": "^5.1.0" } }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -1661,6 +2119,12 @@ "util-deprecate": "^1.0.1" } }, + "readable-web-to-node-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-2.0.0.tgz", + "integrity": "sha512-+oZJurc4hXpaaqsN68GoZGQAQIA3qr09Or4fqEsargABnbe5Aau8hFn6ISVleT3cpY/0n/8drn7huyyEvTbghA==", + "dev": true + }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -1670,6 +2134,16 @@ "resolve": "^1.1.6" } }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -1762,6 +2236,38 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, "string.prototype.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", @@ -1796,6 +2302,70 @@ "is-hex-prefixed": "1.0.0" } }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "strtok3": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.0.4.tgz", + "integrity": "sha512-rqWMKwsbN9APU47bQTMEYTPcwdpKDtmf1jVhHzNW2cL1WqAxaM9iBb9t5P2fj+RV2YsErUWgQzHD5JwV0uCTEQ==", + "dev": true, + "requires": { + "@tokenizer/token": "^0.1.1", + "@types/debug": "^4.1.5", + "peek-readable": "^3.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "temp-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", + "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=", + "dev": true + }, + "temp-write": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-4.0.0.tgz", + "integrity": "sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "is-stream": "^2.0.0", + "make-dir": "^3.0.0", + "temp-dir": "^1.0.0", + "uuid": "^3.3.2" + } + }, + "token-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-2.0.0.tgz", + "integrity": "sha512-WWvu8sGK8/ZmGusekZJJ5NM6rRVTTDO7/bahz4NGiSDb/XsmdYBn6a1N/bymUHuWYTWeuLUg98wUzvE4jPdCZw==", + "dev": true, + "requires": { + "@tokenizer/token": "^0.1.0", + "ieee754": "^1.1.13" + } + }, + "trim-newlines": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "dev": true + }, "tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -1806,6 +2376,21 @@ "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, "typedoc": { "version": "0.17.8", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.17.8.tgz", @@ -1868,6 +2453,22 @@ "object.getownpropertydescriptors": "^2.1.0" } }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -1892,6 +2493,16 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } } diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 1b03a91301..31012575e5 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -43,6 +43,7 @@ }, "devDependencies": { "@trufflesuite/typedoc-default-themes": "0.6.1", + "open-cli": "6.0.1", "typedoc": "0.17.8" } } From 238b0b057104026c358e735d329e5034ec46bfa2 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Fri, 31 Jul 2020 10:37:20 -0700 Subject: [PATCH 385/691] npx lerna add open-cli -ED --scope=@ganache/tezos --- src/chains/tezos/npm-shrinkwrap.json | 623 +++++++++++++++++++++++++++ src/chains/tezos/package.json | 1 + 2 files changed, 624 insertions(+) diff --git a/src/chains/tezos/npm-shrinkwrap.json b/src/chains/tezos/npm-shrinkwrap.json index a552d01316..61425df479 100644 --- a/src/chains/tezos/npm-shrinkwrap.json +++ b/src/chains/tezos/npm-shrinkwrap.json @@ -4,6 +4,38 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@tokenizer/token": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.1.1.tgz", + "integrity": "sha512-XO6INPbZCxdprl+9qa/AAbFFOMzzwqYxpjPgLICrMD6C2FCw6qfJOPcBk6JqqPLSaZ/Qx87qn4rpPmPMwaAK6w==", + "dev": true + }, "@trufflesuite/typedoc-default-themes": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/@trufflesuite/typedoc-default-themes/-/typedoc-default-themes-0.6.1.tgz", @@ -16,6 +48,39 @@ "underscore": "^1.9.1" } }, + "@types/debug": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", + "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", + "dev": true + }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "backbone": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz", @@ -41,12 +106,116 @@ "concat-map": "0.0.1" } }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "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=", + "dev": true + }, + "file-type": { + "version": "14.6.2", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-14.6.2.tgz", + "integrity": "sha512-kSZTAJxPXBdBgJyoC7TexkBWoMI/D1Gas6aTtAn9VIRFwCehwiluGV5O8O2GwqO5zIqeEvXxEKl/xfcaAKB0Yg==", + "dev": true, + "requires": { + "readable-web-to-node-stream": "^2.0.0", + "strtok3": "^6.0.3", + "token-types": "^2.0.0", + "typedarray-to-buffer": "^3.1.5" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -64,6 +233,12 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", + "dev": true + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -97,12 +272,42 @@ "wordwrap": "^1.0.0" } }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "highlight.js": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.1.2.tgz", "integrity": "sha512-Q39v/Mn5mfBlMff9r+zzA+gWxRsCRKwEMvYTiisLr/XUiFI/4puWt0Ojdko3R3JCNWGdOWaA5g/Yxqa23kC5AA==", "dev": true }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -125,12 +330,63 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-docker": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.0.0.tgz", + "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, "jquery": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==", "dev": true }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -140,6 +396,27 @@ "graceful-fs": "^4.1.6" } }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, "lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", @@ -152,12 +429,60 @@ "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", "dev": true }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "dev": true + }, "marked": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", "integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==", "dev": true }, + "meow": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", + "integrity": "sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "^4.0.2", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + } + }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -173,12 +498,35 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + } + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -188,6 +536,71 @@ "wrappy": "1" } }, + "open": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-7.1.0.tgz", + "integrity": "sha512-lLPI5KgOwEYCDKXf4np7y1PBEkj7HYIyP2DY8mVDRnx0VIIu6bNrRB0R66TuO7Mack6EnTNLm4uvcl1UoklTpA==", + "dev": true, + "requires": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + } + }, + "open-cli": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/open-cli/-/open-cli-6.0.1.tgz", + "integrity": "sha512-A5h8MF3GrT1efn9TiO9LPajDnLtuEiGQT5G8TxWObBlgt1cZJF1YbQo/kNtsD1bJb7HxnT6SaSjzeLq0Rfhygw==", + "dev": true, + "requires": { + "file-type": "^14.1.4", + "get-stdin": "^7.0.0", + "meow": "^6.1.0", + "open": "^7.0.3", + "temp-write": "^4.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", + "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -200,12 +613,69 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "peek-readable": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-3.1.0.tgz", + "integrity": "sha512-KGuODSTV6hcgdZvDrIDBUkN0utcAVj1LL7FfGbM0viKTtCHmtZcuEJ+lGqsp0fTFkGqesdtemV2yUSMeyy3ddA==", + "dev": true + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "readable-web-to-node-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-2.0.0.tgz", + "integrity": "sha512-+oZJurc4hXpaaqsN68GoZGQAQIA3qr09Or4fqEsargABnbe5Aau8hFn6ISVleT3cpY/0n/8drn7huyyEvTbghA==", + "dev": true + }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -215,6 +685,16 @@ "resolve": "^1.1.6" } }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -224,6 +704,12 @@ "path-parse": "^1.0.6" } }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "shelljs": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", @@ -241,6 +727,117 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "strtok3": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.0.4.tgz", + "integrity": "sha512-rqWMKwsbN9APU47bQTMEYTPcwdpKDtmf1jVhHzNW2cL1WqAxaM9iBb9t5P2fj+RV2YsErUWgQzHD5JwV0uCTEQ==", + "dev": true, + "requires": { + "@tokenizer/token": "^0.1.1", + "@types/debug": "^4.1.5", + "peek-readable": "^3.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "temp-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", + "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=", + "dev": true + }, + "temp-write": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-4.0.0.tgz", + "integrity": "sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "is-stream": "^2.0.0", + "make-dir": "^3.0.0", + "temp-dir": "^1.0.0", + "uuid": "^3.3.2" + } + }, + "token-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-2.0.0.tgz", + "integrity": "sha512-WWvu8sGK8/ZmGusekZJJ5NM6rRVTTDO7/bahz4NGiSDb/XsmdYBn6a1N/bymUHuWYTWeuLUg98wUzvE4jPdCZw==", + "dev": true, + "requires": { + "@tokenizer/token": "^0.1.0", + "ieee754": "^1.1.13" + } + }, + "trim-newlines": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "dev": true + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, "typedoc": { "version": "0.17.8", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.17.8.tgz", @@ -287,6 +884,22 @@ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -298,6 +911,16 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } } diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 63a7341138..7411f6ce83 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -34,6 +34,7 @@ }, "devDependencies": { "@trufflesuite/typedoc-default-themes": "0.6.1", + "open-cli": "6.0.1", "typedoc": "0.17.8" } } From 4e34735ed4ec7e129443f356bd6c8bbb225a78a3 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Fri, 31 Jul 2020 10:38:47 -0700 Subject: [PATCH 386/691] add preview:docs script to chains/ethereum & chains/tezos --- src/chains/ethereum/package.json | 1 + src/chains/tezos/package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 31012575e5..cddfc2e44c 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -23,6 +23,7 @@ }, "scripts": { "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts", + "preview:docs": "open-cli ./lib/docs/index.html", "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 7411f6ce83..2c78662def 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -23,6 +23,7 @@ }, "scripts": { "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts", + "preview:docs": "open-cli ./lib/docs/index.html", "tsc": "ts-node ../../../scripts/compile" }, "bugs": { From 052b6b6afd056b7cd3ae2de537b80c0199e1d840 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Fri, 31 Jul 2020 10:40:14 -0700 Subject: [PATCH 387/691] add root preview:docs script --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c6c4a97b8a..8205f966a8 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "build:docs": "lerna exec --no-bail npm run build:docs", "clean": "npx shx rm -rf node_modules && npx lerna clean -y", "create": "ts-node ./scripts/create", + "preview:docs": "lerna exec --no-bail npm run preview:docs", "postinstall": "lerna bootstrap && npx patch-package", "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm test", From 7fa905cdca8041d6ff130388b92d1b25656d8097 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 31 Jul 2020 16:50:24 -0400 Subject: [PATCH 388/691] Make `npm run tsc` build runnable JS code! --- scripts/create.ts | 11 +++++ src/chains/ethereum/.npmignore | 1 + .../__tests__/api/eth/getCode.test.ts | 2 +- .../__tests__/api/eth/getStorageAt.test.ts | 2 +- .../ethereum/__tests__/api/eth/sign.test.ts | 2 +- .../__tests__/api/eth/subscribe.test.ts | 2 +- .../ethereum/__tests__/api/evm/evm.test.ts | 2 +- .../__tests__/api/evm/snapshot.test.ts | 2 +- .../__tests__/api/personal/personal.test.ts | 2 +- .../ethereum/__tests__/helpers/getProvider.ts | 3 +- .../ethereum/__tests__/provider.test.ts | 4 +- .../ethereum/__tests__/temp-tests.test.ts | 2 +- src/chains/ethereum/index.ts | 1 + src/chains/ethereum/package.json | 5 +- src/chains/ethereum/src/api.ts | 49 +++++++++---------- src/chains/ethereum/src/blockchain.ts | 6 +-- .../ethereum/src/components/block-manager.ts | 2 +- .../src/components/blocklog-manager.ts | 2 +- src/chains/ethereum/src/components/manager.ts | 2 +- .../src/components/transaction-manager.ts | 2 +- .../src/components/transaction-pool.ts | 2 +- src/chains/ethereum/src/index.ts | 24 ++++----- src/chains/ethereum/src/miner.ts | 2 +- src/chains/ethereum/src/provider.ts | 15 +++--- src/chains/ethereum/src/things/account.ts | 2 +- src/chains/ethereum/src/things/address.ts | 2 +- src/chains/ethereum/src/things/blocklogs.ts | 2 +- .../src/things/transaction-receipt.ts | 3 +- src/chains/ethereum/src/things/transaction.ts | 3 +- src/chains/ethereum/src/wallet.ts | 2 +- src/chains/tezos/.npmignore | 1 + src/chains/tezos/index.ts | 1 + src/chains/tezos/package.json | 5 +- src/chains/tezos/src/index.ts | 9 ++-- src/packages/core/.npmignore | 1 + .../{connector.ts => connector.test.ts} | 4 +- .../core/__tests__/helpers/getProvider.ts | 2 +- .../{interface.ts => interface.test.ts} | 0 .../__tests__/{server.ts => server.test.ts} | 4 +- src/packages/core/index.ts | 1 + src/packages/core/package.json | 5 +- src/packages/core/src/server.ts | 6 +-- src/packages/flavors/.npmignore | 1 + src/packages/flavors/index.ts | 1 + src/packages/flavors/package.json | 5 +- src/packages/options/.npmignore | 1 + src/packages/options/index.ts | 1 + src/packages/options/package.json | 5 +- src/packages/options/src/options.ts | 2 +- src/packages/utils/.npmignore | 1 + src/packages/utils/index.ts | 1 + src/packages/utils/package.json | 5 +- src/packages/utils/src/index.ts | 5 ++ .../utils/src/things/json-rpc/index.ts | 5 +- .../src/things/json-rpc/json-rpc-data.ts | 8 +-- .../src/things/json-rpc/json-rpc-quantity.ts | 11 +++-- .../utils/src/utils/uint-to-buffer.ts | 2 +- 57 files changed, 144 insertions(+), 110 deletions(-) create mode 100644 src/chains/ethereum/.npmignore create mode 100644 src/chains/ethereum/index.ts create mode 100644 src/chains/tezos/.npmignore create mode 100644 src/chains/tezos/index.ts create mode 100644 src/packages/core/.npmignore rename src/packages/core/__tests__/{connector.ts => connector.test.ts} (98%) rename src/packages/core/__tests__/{interface.ts => interface.test.ts} (100%) rename src/packages/core/__tests__/{server.ts => server.test.ts} (99%) create mode 100644 src/packages/core/index.ts create mode 100644 src/packages/flavors/.npmignore create mode 100644 src/packages/flavors/index.ts create mode 100644 src/packages/options/.npmignore create mode 100644 src/packages/options/index.ts create mode 100644 src/packages/utils/.npmignore create mode 100644 src/packages/utils/index.ts diff --git a/scripts/create.ts b/scripts/create.ts index bcde421a98..1572871865 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -74,6 +74,9 @@ describe("${packageName}", () => { const indexFile = `export default { // TODO } +`; + +const rootIndexFile = `export * from "./src/index"; `; const dir = join("./src/packages", name); @@ -84,6 +87,13 @@ describe("${packageName}", () => { return writeFile(join(src, "index.ts"), prettier.format(indexFile, {...prettierConfig, parser: "typescript"})); } + function initRootIndex() { + return Promise.all([ + writeFile(join(dir, ".npmignore"), "./index.ts\n"), + writeFile(join(dir, "index.ts"), prettier.format(rootIndexFile, {...prettierConfig, parser: "typescript"})), + ]); + } + function initTests() { return writeFile( join(tests, "index.test.ts"), @@ -100,6 +110,7 @@ describe("${packageName}", () => { mkdirSync(dir); await Promise.all([ + initRootIndex(), mkdir(tests).then(initTests), mkdir(src).then(initSrc), writeFile( diff --git a/src/chains/ethereum/.npmignore b/src/chains/ethereum/.npmignore new file mode 100644 index 0000000000..a8ca347bfb --- /dev/null +++ b/src/chains/ethereum/.npmignore @@ -0,0 +1 @@ +./index.ts diff --git a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts index 48a9e8de39..48e59c40b7 100644 --- a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts @@ -3,7 +3,7 @@ import EthereumProvider from "../../../src/provider"; import getProvider from "../../helpers/getProvider"; import compile from "../../helpers/compile"; import { join } from "path"; -import { Quantity } from "@ganache/utils/src/things/json-rpc"; +import { Quantity } from "@ganache/utils"; describe("api", () => { describe("eth", () => { diff --git a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts index 94d5ac7c33..9ef36bb11a 100644 --- a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts @@ -4,7 +4,7 @@ import assert from "assert"; import EthereumProvider from "../../../src/provider"; import compile from "../../helpers/compile"; import { join } from "path"; -import { Quantity } from "@ganache/utils/src/things/json-rpc"; +import { Quantity } from "@ganache/utils"; const THIRTY_TWO_BYES = "0".repeat(64); describe("api", () => { diff --git a/src/chains/ethereum/__tests__/api/eth/sign.test.ts b/src/chains/ethereum/__tests__/api/eth/sign.test.ts index 8aff40dfc7..4259a8e024 100644 --- a/src/chains/ethereum/__tests__/api/eth/sign.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sign.test.ts @@ -1,7 +1,7 @@ import assert from "assert"; import { ecrecover, pubToAddress, fromSigned, hashPersonalMessage } from "ethereumjs-util"; import getProvider from "../../helpers/getProvider"; -import { Data } from "@ganache/utils/src/things/json-rpc"; +import { Data } from "@ganache/utils"; describe("api", () => { describe("eth", () => { diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index 60d299ef89..68ac5db7a6 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -1,7 +1,7 @@ import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; -import { Quantity } from "@ganache/utils/src/things/json-rpc"; +import { Quantity } from "@ganache/utils"; describe("api", () => { describe("eth", () => { diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index bf4a103ae9..356480ceed 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -1,6 +1,6 @@ import getProvider from "../../helpers/getProvider"; import assert from "assert"; -import { Quantity } from "@ganache/utils/src/things/json-rpc"; +import { Quantity } from "@ganache/utils"; function between(x: number, min: number, max: number) { return x >= min && x <= max; diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 0776251834..7931b98a48 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -2,7 +2,7 @@ const assert = require("assert"); import { join } from "path"; import getProvider from "../../helpers/getProvider"; import compile from "../../helpers/compile"; -import {Quantity} from "@ganache/utils/src/things/json-rpc"; +import { Quantity } from "@ganache/utils"; const eth = "0x" + (1000000000000000000n).toString(16); diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/__tests__/api/personal/personal.test.ts index 16d8789a55..264740e973 100644 --- a/src/chains/ethereum/__tests__/api/personal/personal.test.ts +++ b/src/chains/ethereum/__tests__/api/personal/personal.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; import getProvider from "../../helpers/getProvider"; -import { Quantity } from "@ganache/utils/src/things/json-rpc"; +import { Quantity } from "@ganache/utils"; import EthereumProvider from "../../../src/provider"; describe("api", () => { diff --git a/src/chains/ethereum/__tests__/helpers/getProvider.ts b/src/chains/ethereum/__tests__/helpers/getProvider.ts index 190530e964..4569591380 100644 --- a/src/chains/ethereum/__tests__/helpers/getProvider.ts +++ b/src/chains/ethereum/__tests__/helpers/getProvider.ts @@ -1,6 +1,7 @@ -import { RequestCoordinator, Executor } from "@ganache/utils/src/utils"; +import { utils } from "@ganache/utils"; import EthereumProvider from "../../src/provider"; import {ProviderOptions} from "@ganache/options"; +const { RequestCoordinator, Executor } = utils; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; const getProvider = async (options: ProviderOptions = {mnemonic}) => { diff --git a/src/chains/ethereum/__tests__/provider.test.ts b/src/chains/ethereum/__tests__/provider.test.ts index c5a329186c..6cbee1039e 100644 --- a/src/chains/ethereum/__tests__/provider.test.ts +++ b/src/chains/ethereum/__tests__/provider.test.ts @@ -1,7 +1,7 @@ import assert from "assert"; import EthereumProvider from "../src/provider"; import getProvider from "./helpers/getProvider"; -import JsonRpc from "@ganache/utils/src/things/jsonrpc"; +import {JsonRpcTypes} from "@ganache/utils"; import EthereumApi from "../src/api"; describe("provider", () => { @@ -26,7 +26,7 @@ describe("provider", () => { }); it("returns things via legacy", async () => { - const jsonRpcRequest: JsonRpc.Request = { + const jsonRpcRequest: JsonRpcTypes.Request = { id: "1", jsonrpc: "2.0", method: "net_version" diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index 877b3703f2..49246be2bc 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import {Quantity} from "@ganache/utils/src/things/json-rpc"; +import {Quantity} from "@ganache/utils"; import {ProviderOptions} from "@ganache/options"; import getProvider from "./helpers/getProvider"; import compile from "./helpers/compile"; diff --git a/src/chains/ethereum/index.ts b/src/chains/ethereum/index.ts new file mode 100644 index 0000000000..e910bb060c --- /dev/null +++ b/src/chains/ethereum/index.ts @@ -0,0 +1 @@ +export * from "./src/index"; diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index cddfc2e44c..1b593ec495 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -5,8 +5,9 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "src/index.ts", - "typings": "src/index.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "source": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 559445bd18..3aa12beb86 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,9 +1,8 @@ //#region Imports -import { types } from "@ganache/utils"; import { toRpcSig, KECCAK256_NULL, ecsign, hashPersonalMessage } from "ethereumjs-util"; import { TypedData as NotTypedData, signTypedData_v4 } from "eth-sig-util"; import EthereumOptions from "./options"; -import { Data, Quantity } from "@ganache/utils/src/things/json-rpc"; +import { types, Data, Quantity } from "@ganache/utils"; import Blockchain, { BlockchainOptions } from "./blockchain"; import Tag from "./things/tags"; import Address from "./things/address"; @@ -49,7 +48,7 @@ function parseFilter(filter: FilterArgs, blockchain: Blockchain) { const createKeccakHash = require("keccak"); // Read in the current ganache version from core's package.json import { version } from "../../../packages/core/package.json"; -import PromiEvent from "@ganache/utils/src/things/promievent"; +import { PromiEvent } from "@ganache/utils"; import Emittery from "emittery"; import Common from "ethereumjs-common"; import BlockLogs from "./things/blocklogs"; @@ -378,7 +377,7 @@ export default class EthereumApi implements types.Api { * Returns the current client version. * @returns The current client version. */ - async web3_clientVersion(): Promise { + async web3_clientVersion() { return CLIENT_VERSION; } @@ -387,7 +386,7 @@ export default class EthereumApi implements types.Api { * @param {data} the data to convert into a SHA3 hash. * @returns The SHA3 result of the given string. */ - async web3_sha3(data: string): Promise { + async web3_sha3(data: string) { return Data.from(createKeccakHash("keccak256").update(data).digest()); } //#endregion @@ -395,10 +394,10 @@ export default class EthereumApi implements types.Api { //#region net /** * Returns the current network id. - * @returns {string} The current network id. This value should NOT be JSON-RPC + * @returns The current network id. This value should NOT be JSON-RPC * Quantity/Data encoded. */ - async net_version(): Promise { + async net_version() { return this.#options.networkId.toString(); } @@ -406,7 +405,7 @@ export default class EthereumApi implements types.Api { * Returns true if client is actively listening for network connections. * @returns true when listening, otherwise false. */ - async net_listening(): Promise { + async net_listening() { // TODO: this should return false when ganache isn't used with a server, or // or while the server is still initializing. return true; @@ -414,9 +413,9 @@ export default class EthereumApi implements types.Api { /** * Returns number of peers currently connected to the client. - * @returns {QUANTITY} integer of the number of connected peers. + * @returns integer of the number of connected peers. */ - async net_peerCount(): Promise { + async net_peerCount() { return RPCQUANTITY_ZERO; } //#endregion @@ -432,7 +431,7 @@ export default class EthereumApi implements types.Api { * * @returns the amount of gas used. */ - async eth_estimateGas(): Promise { + async eth_estimateGas() { // TODO: do this for real return Quantity.from(6721975); } @@ -441,7 +440,7 @@ export default class EthereumApi implements types.Api { * Returns the current ethereum protocol version. * @returns The current ethereum protocol version. */ - async eth_protocolVersion(): Promise { + async eth_protocolVersion() { return PROTOCOL_VERSION; } @@ -453,7 +452,7 @@ export default class EthereumApi implements types.Api { * currentBlock: {bigint} - The current block, same as eth_blockNumber * highestBlock: {bigint} - The estimated highest block */ - async eth_syncing(): Promise { + async eth_syncing() { return false; } @@ -461,7 +460,7 @@ export default class EthereumApi implements types.Api { * Returns the client coinbase address. * @returns 20 bytes - the current coinbase address. */ - async eth_coinbase(): Promise
{ + async eth_coinbase() { return this.#blockchain.coinbase; } @@ -729,7 +728,7 @@ export default class EthereumApi implements types.Api { address: string, position: bigint | number, blockNumber: string | Buffer | Tag = Tag.LATEST - ): Promise { + ) { const blockProm = this.#blockchain.blocks.getRaw(blockNumber); const trie = this.#blockchain.trie.copy(); @@ -787,7 +786,7 @@ export default class EthereumApi implements types.Api { * * @param transactionHash 32 Bytes - hash of a transaction */ - async eth_getTransactionByHash(transactionHash: string): Promise { + async eth_getTransactionByHash(transactionHash: string) { const chain = this.#blockchain; const transaction = await chain.transactions.get(Data.from(transactionHash).toBuffer()); return transaction; @@ -801,7 +800,7 @@ export default class EthereumApi implements types.Api { * @param transactionHash 32 Bytes - hash of a transaction * @returns Returns the receipt of a transaction by transaction hash. */ - async eth_getTransactionReceipt(transactionHash: string): Promise<{}> { + async eth_getTransactionReceipt(transactionHash: string) { const blockchain = this.#blockchain; const transactionPromise = blockchain.transactions.get(transactionHash); const receiptPromise = blockchain.transactionReceipts.get(transactionHash); @@ -819,7 +818,7 @@ export default class EthereumApi implements types.Api { * @param transaction * @returns The transaction hash */ - async eth_sendTransaction(transaction: any): Promise { + async eth_sendTransaction(transaction: any) { let fromString = transaction.from; let from: Address; if (fromString) { @@ -889,7 +888,7 @@ export default class EthereumApi implements types.Api { * @param transaction * @returns The transaction hash */ - async eth_sendRawTransaction(transaction: any): Promise { + async eth_sendRawTransaction(transaction: any) { const tx = new Transaction(Buffer.from(transaction), {common: this.#common}, Transaction.types.signed); return await this.#blockchain.queueTransaction(tx); } @@ -1125,7 +1124,7 @@ export default class EthereumApi implements types.Api { * * @returns A filter id. */ - async eth_newPendingTransactionFilter(): Promise { + async eth_newPendingTransactionFilter() { const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { value.updates.push(Data.from(transaction.hash(), 32)); }); @@ -1179,7 +1178,7 @@ export default class EthereumApi implements types.Api { * or transactions hashes, depending on the filter type, which occurred since * last poll. */ - async eth_getFilterChanges(filterId: string): Promise { + async eth_getFilterChanges(filterId: string) { const filter = this.#filters.get(filterId); if (filter) { const updates = filter.updates; @@ -1198,7 +1197,7 @@ export default class EthereumApi implements types.Api { * @returns `true` if the filter was successfully uninstalled, otherwise * `false`. */ - async eth_uninstallFilter(filterId: string): Promise { + async eth_uninstallFilter(filterId: string) { const filter = this.#filters.get(filterId); if (!filter) return false; filter.unsubscribe(); @@ -1210,7 +1209,7 @@ export default class EthereumApi implements types.Api { * * @returns Array of log objects, or an empty array. */ - async eth_getFilterLogs(filterId: string): Promise { + async eth_getFilterLogs(filterId: string) { const filter = this.#filters.get(filterId); if (filter && filter.type === FilterTypes.log) { return this.eth_getLogs(filter.filter); @@ -1225,7 +1224,7 @@ export default class EthereumApi implements types.Api { * @param filter The filter options * @returns Array of log objects, or an empty array. */ - async eth_getLogs(filter: FilterArgs): Promise { + async eth_getLogs(filter: FilterArgs) { const blockchain = this.#blockchain; const {addresses, topics, fromBlock, toBlockNumber} = parseFilter(filter, blockchain); @@ -1275,7 +1274,7 @@ export default class EthereumApi implements types.Api { * * @returns the return value of executed contract. */ - async eth_call(transaction: any, blockNumber: string | Buffer | Tag = Tag.LATEST): Promise { + async eth_call(transaction: any, blockNumber: string | Buffer | Tag = Tag.LATEST) { const blockchain = this.#blockchain; const blocks = blockchain.blocks; const parentBlock = await blocks.get(blockNumber); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index e1a07b571b..ed109ae03d 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -8,7 +8,7 @@ import CheckpointTrie from "merkle-patricia-tree"; import {BN} from "ethereumjs-util"; import Account from "./things/account"; import {promisify} from "util"; -import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; +import {Quantity, Data} from "@ganache/utils"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./components/account-manager"; import {utils} from "@ganache/utils"; @@ -412,14 +412,14 @@ export default class Blockchain extends Emittery.Typed { + public async queueTransaction(transaction: any, secretKey?: Data) { if(await this.transactions.push(transaction, secretKey)){ this.emit("pendingTransaction", transaction); } return Data.from(transaction.hash()); } - public async simulateTransaction(transaction: any, parentBlock: Block, block: Block): Promise { + public async simulateTransaction(transaction: any, parentBlock: Block, block: Block) { // TODO: this is just a prototype implementation const vm = this.vm.copy(); const stateManager = vm.stateManager; diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index 3518487f94..4f1f5e56f7 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -3,7 +3,7 @@ import Manager from "./manager"; import Tag from "../things/tags"; import { LevelUp } from "levelup"; import Blockchain from "../blockchain"; -import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; +import {Quantity, Data} from "@ganache/utils"; import Transaction from "../things/transaction"; import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; diff --git a/src/chains/ethereum/src/components/blocklog-manager.ts b/src/chains/ethereum/src/components/blocklog-manager.ts index a7cd8013fe..6f524cadf0 100644 --- a/src/chains/ethereum/src/components/blocklog-manager.ts +++ b/src/chains/ethereum/src/components/blocklog-manager.ts @@ -1,7 +1,7 @@ import BlockLog from "../things/blocklogs"; import { LevelUp } from "levelup"; import Manager from "./manager"; -import { Quantity } from "@ganache/utils/src/things/json-rpc"; +import { Quantity } from "@ganache/utils"; export default class BlockLogManager extends Manager { constructor(base: LevelUp) { diff --git a/src/chains/ethereum/src/components/manager.ts b/src/chains/ethereum/src/components/manager.ts index 5f6d3fc760..2bc9163099 100644 --- a/src/chains/ethereum/src/components/manager.ts +++ b/src/chains/ethereum/src/components/manager.ts @@ -1,5 +1,5 @@ import {LevelUp} from "levelup"; -import {Data} from "@ganache/utils/src/things/json-rpc"; +import {Data} from "@ganache/utils"; import Tag from "../things/tags"; const NOTFOUND = 404; diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts index 64c2f5a204..063ef7df58 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -3,7 +3,7 @@ import Manager from "./manager"; import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; import { LevelUp } from "levelup"; import Blockchain from "../blockchain"; -import { Data } from "@ganache/utils/src/things/json-rpc"; +import { Data } from "@ganache/utils"; import Common from "ethereumjs-common"; export type TransactionManagerOptions = TransactionPoolOptions & { diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index d207cd433f..4bcbc85ff1 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -3,7 +3,7 @@ import Emittery from "emittery"; import Blockchain from "../blockchain"; import {utils} from "@ganache/utils"; import Transaction from "../things/transaction"; -import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; +import {Data, Quantity} from "@ganache/utils"; export type TransactionPoolOptions = { /** diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 83334446d6..f6c688c167 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -1,20 +1,22 @@ import {ProviderOptions} from "@ganache/options"; import Emittery from "emittery"; import EthereumApi from "./api"; -import JsonRpc from "@ganache/utils/src/things/jsonrpc"; -import {types, utils} from "@ganache/utils"; -import EthereumProvider from "./provider"; +import {JsonRpcTypes, types, utils} from "@ganache/utils"; +import Provider from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; -import PromiEvent from "@ganache/utils/src/things/promievent"; +import { PromiEvent } from "@ganache/utils"; function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest { return connection.constructor.name === "uWS.HttpRequest" } +export type EthereumProvider = Provider; +export const EthereumProvider = Provider; + export default class EthereumConnector extends Emittery.Typed - implements types.Connector> { + implements types.Connector> { - #provider: EthereumProvider; + #provider: Provider; get provider() { return this.#provider; @@ -31,14 +33,14 @@ export default class EthereumConnector extends Emittery.Typed; + return JSON.parse(message) as JsonRpcTypes.Request; } - handle(payload: JsonRpc.Request, connection: HttpRequest | WebSocket): PromiEvent { + handle(payload: JsonRpcTypes.Request, connection: HttpRequest | WebSocket): PromiEvent { const method = payload.method; if (method === "eth_subscribe") { if (isHttp(connection)) { - const error = JsonRpc.Error(payload.id, "-32000", "notifications not supported"); + const error = JsonRpcTypes.Error(payload.id, "-32000", "notifications not supported"); return new PromiEvent((_, reject) => void reject(error)); } else { return this.#provider.request({method: "eth_subscribe", params: payload.params as Parameters}); @@ -49,8 +51,8 @@ export default class EthereumConnector extends Emittery.Typed): RecognizedString { - const json = JsonRpc.Response(payload.id, result); + format(result: any, payload: JsonRpcTypes.Request): RecognizedString { + const json = JsonRpcTypes.Response(payload.id, result); return JSON.stringify(json); } diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 31a50531bd..f1764d9e83 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -1,7 +1,7 @@ import params from "./things/params"; import {utils} from "@ganache/utils"; import Transaction from "./things/transaction"; -import {Quantity, Data} from "@ganache/utils/src/things/json-rpc"; +import {Quantity, Data} from "@ganache/utils"; import {promisify} from "util"; import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 23cc128270..d2179409c9 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -1,14 +1,13 @@ import {ProviderOptions} from "@ganache/options"; import Emittery from "emittery"; import EthereumApi from "./api"; -import JsonRpc from "@ganache/utils/src/things/jsonrpc"; +import {JsonRpcTypes} from "@ganache/utils"; import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; -import {types, utils} from "@ganache/utils"; -import PromiEvent from "@ganache/utils/src/things/promievent"; +import {PromiEvent, types, utils} from "@ganache/utils"; interface Callback { - (err?: Error, response?: JsonRpc.Response): void; + (err?: Error, response?: JsonRpcTypes.Response): void; } type RequestParams> = { @@ -37,9 +36,9 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co return cloneDeep(this.#options); } - public send(payload: JsonRpc.Request, callback?: Callback): void; + public send(payload: JsonRpcTypes.Request, callback?: Callback): void; public send(method: types.KnownKeys, params?: Parameters): Promise; - public send(arg1: types.KnownKeys | JsonRpc.Request, arg2?: Callback | any[]): Promise { + public send(arg1: types.KnownKeys | JsonRpcTypes.Request, arg2?: Callback | any[]): Promise { let method: types.KnownKeys; let params: any; let response: Promise<{}>; @@ -58,7 +57,7 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co .then((result: any) => { // execute the callback on the nextTick so errors thrown in the callback // don't cause the error to bubble up to ganache-core - process.nextTick(callback, null, JsonRpc.Response(payload.id, JSON.parse(JSON.stringify(result)))) + process.nextTick(callback, null, JsonRpcTypes.Response(payload.id, JSON.parse(JSON.stringify(result)))) }).catch((err: Error) => { process.nextTick(callback, err); }); @@ -84,7 +83,7 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co * @param payload JSON-RPC payload * @param callback callback */ - public sendAsync(payload: JsonRpc.Request, callback?: Callback): void { + public sendAsync(payload: JsonRpcTypes.Request, callback?: Callback): void { return this.send(payload, callback); } diff --git a/src/chains/ethereum/src/things/account.ts b/src/chains/ethereum/src/things/account.ts index 681cf587f9..2a77793ac8 100644 --- a/src/chains/ethereum/src/things/account.ts +++ b/src/chains/ethereum/src/things/account.ts @@ -1,4 +1,4 @@ -import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; +import {Data, Quantity} from "@ganache/utils"; import Address from "./address"; import {rlp, KECCAK256_RLP, KECCAK256_NULL} from "ethereumjs-util"; diff --git a/src/chains/ethereum/src/things/address.ts b/src/chains/ethereum/src/things/address.ts index d9d34abf3b..02eef73790 100644 --- a/src/chains/ethereum/src/things/address.ts +++ b/src/chains/ethereum/src/things/address.ts @@ -1,4 +1,4 @@ -import {Data} from "@ganache/utils/src/things/json-rpc/json-rpc-data"; +import {Data} from "@ganache/utils"; class Address extends Data { /** diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index 659b375743..dd6884394e 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -1,5 +1,5 @@ import { encode as rlpEncode, decode as rlpDecode } from "rlp"; -import { Data, Quantity } from "@ganache/utils/src/things/json-rpc"; +import { Data, Quantity } from "@ganache/utils"; import Address from "./address"; const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index 16dbe490d8..7f59bf6070 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -1,9 +1,8 @@ import Transaction from "./transaction"; import {Block} from "../components/block-manager"; import {encode as rlpEncode, decode as rlpDecode} from "rlp"; -import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; +import {Data, Quantity} from "@ganache/utils"; import BlockLogs, { TransactionLog } from "./blocklogs"; -import Address from "./address"; type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; type FullRawReceipt = [status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer | null]; diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 29d1a45a26..b408ab05a1 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -1,6 +1,5 @@ import Errors from "./errors"; -import {Data} from "@ganache/utils/src/things/json-rpc/json-rpc-data"; -import {Quantity} from "@ganache/utils/src/things/json-rpc"; +import {Data, Quantity} from "@ganache/utils"; import params from "./params"; import {Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction} from "ethereumjs-tx"; import * as ethUtil from "ethereumjs-util"; diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index b8e870399b..89e04c23b4 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -1,5 +1,5 @@ import { utils } from "@ganache/utils"; -import { Data, Quantity } from "@ganache/utils/src/things/json-rpc"; +import { Data, Quantity } from "@ganache/utils"; import Address from "./things/address"; import EthereumOptions from "./options"; import { privateToAddress } from "ethereumjs-util"; diff --git a/src/chains/tezos/.npmignore b/src/chains/tezos/.npmignore new file mode 100644 index 0000000000..a8ca347bfb --- /dev/null +++ b/src/chains/tezos/.npmignore @@ -0,0 +1 @@ +./index.ts diff --git a/src/chains/tezos/index.ts b/src/chains/tezos/index.ts new file mode 100644 index 0000000000..e910bb060c --- /dev/null +++ b/src/chains/tezos/index.ts @@ -0,0 +1 @@ +export * from "./src/index"; diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 2c78662def..859978d45a 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -5,8 +5,9 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "src/index.ts", - "typings": "src/index.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "source": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/src/chains/tezos/src/index.ts b/src/chains/tezos/src/index.ts index 5c3f190bf2..e54667a20b 100644 --- a/src/chains/tezos/src/index.ts +++ b/src/chains/tezos/src/index.ts @@ -1,20 +1,23 @@ import Emittery from "emittery"; import {utils, types} from "@ganache/utils"; -import TezosProvider from "./provider"; +import Provider from "./provider"; import {ProviderOptions} from "@ganache/options"; import TezosApi from "./api"; import { HttpRequest } from "uWebSockets.js"; +export type TezosProvider = Provider; +export const TezosProvider = Provider; + export default class TezosConnector extends Emittery.Typed implements types.Connector { - provider: TezosProvider; + provider: Provider; #api: TezosApi; constructor(providerOptions: ProviderOptions, requestCoordinator: utils.Executor) { super(); const api = (this.#api = new TezosApi()); - this.provider = new TezosProvider(providerOptions); + this.provider = new Provider(providerOptions); } format(result: any) { diff --git a/src/packages/core/.npmignore b/src/packages/core/.npmignore new file mode 100644 index 0000000000..a8ca347bfb --- /dev/null +++ b/src/packages/core/.npmignore @@ -0,0 +1 @@ +./index.ts diff --git a/src/packages/core/__tests__/connector.ts b/src/packages/core/__tests__/connector.test.ts similarity index 98% rename from src/packages/core/__tests__/connector.ts rename to src/packages/core/__tests__/connector.test.ts index c158e80f04..ee216f8f77 100644 --- a/src/packages/core/__tests__/connector.ts +++ b/src/packages/core/__tests__/connector.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; -import Ganache from "../"; -import EthereumProvider from "@ganache/ethereum/src/provider"; +import Ganache from "../src"; +import { EthereumProvider } from "@ganache/ethereum"; describe("connector", () => { it("works without passing options", async () => { diff --git a/src/packages/core/__tests__/helpers/getProvider.ts b/src/packages/core/__tests__/helpers/getProvider.ts index 55b2cedb26..4b8895d7c9 100644 --- a/src/packages/core/__tests__/helpers/getProvider.ts +++ b/src/packages/core/__tests__/helpers/getProvider.ts @@ -1,6 +1,6 @@ import Ganache from "../../src/"; import {ProviderOptions} from "@ganache/options"; -import EthereumProvider from "@ganache/ethereum/src/provider"; +import {EthereumProvider} from "@ganache/ethereum"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; const getProvider = (options: ProviderOptions = {flavor: "ethereum", mnemonic}) => { diff --git a/src/packages/core/__tests__/interface.ts b/src/packages/core/__tests__/interface.test.ts similarity index 100% rename from src/packages/core/__tests__/interface.ts rename to src/packages/core/__tests__/interface.test.ts diff --git a/src/packages/core/__tests__/server.ts b/src/packages/core/__tests__/server.test.ts similarity index 99% rename from src/packages/core/__tests__/server.ts rename to src/packages/core/__tests__/server.test.ts index 5e0eb90b89..a66e0287db 100644 --- a/src/packages/core/__tests__/server.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -6,8 +6,8 @@ import Server, {Status} from "../src/server"; import ServerOptions from "../src/options/server-options"; import http from "http"; import intoStream from "into-stream"; -import EthereumProvider from "@ganache/ethereum/src/provider"; -import PromiEvent from "@ganache/utils/src/things/promievent"; +import {EthereumProvider} from "@ganache/ethereum"; +import { PromiEvent } from "@ganache/utils"; import {promisify} from "util"; const IS_WINDOWS = process.platform === "win32"; diff --git a/src/packages/core/index.ts b/src/packages/core/index.ts new file mode 100644 index 0000000000..e910bb060c --- /dev/null +++ b/src/packages/core/index.ts @@ -0,0 +1 @@ +export * from "./src/index"; diff --git a/src/packages/core/package.json b/src/packages/core/package.json index d5e6a63f68..2b3a545ec0 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -5,8 +5,9 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "src/index.ts", - "typings": "src/index.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "source": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index 65ea50ebe3..1c23d24478 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -4,9 +4,9 @@ import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; import Connector from "./connector"; import WebsocketServer, { WebSocketCapableFlavor } from "./servers/ws-server"; import HttpServer from "./servers/http-server"; -import {Flavors} from "@ganache/flavors/src"; -import TezosProvider from "@ganache/tezos/src/provider"; -import EthereumProvider from "@ganache/ethereum/src/provider"; +import {Flavors} from "@ganache/flavors"; +import {TezosProvider} from "@ganache/tezos"; +import {EthereumProvider} from "@ganache/ethereum"; type Callback = (err: Error | null) => void diff --git a/src/packages/flavors/.npmignore b/src/packages/flavors/.npmignore new file mode 100644 index 0000000000..a8ca347bfb --- /dev/null +++ b/src/packages/flavors/.npmignore @@ -0,0 +1 @@ +./index.ts diff --git a/src/packages/flavors/index.ts b/src/packages/flavors/index.ts new file mode 100644 index 0000000000..e910bb060c --- /dev/null +++ b/src/packages/flavors/index.ts @@ -0,0 +1 @@ +export * from "./src/index"; diff --git a/src/packages/flavors/package.json b/src/packages/flavors/package.json index 17d58e3b65..96ca1c50b4 100644 --- a/src/packages/flavors/package.json +++ b/src/packages/flavors/package.json @@ -3,8 +3,9 @@ "version": "2.2.1", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "src/index.ts", - "typings": "src/index.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "source": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/src/packages/options/.npmignore b/src/packages/options/.npmignore new file mode 100644 index 0000000000..a8ca347bfb --- /dev/null +++ b/src/packages/options/.npmignore @@ -0,0 +1 @@ +./index.ts diff --git a/src/packages/options/index.ts b/src/packages/options/index.ts new file mode 100644 index 0000000000..e910bb060c --- /dev/null +++ b/src/packages/options/index.ts @@ -0,0 +1 @@ +export * from "./src/index"; diff --git a/src/packages/options/package.json b/src/packages/options/package.json index 8289e4edcb..0e2f62ab5b 100644 --- a/src/packages/options/package.json +++ b/src/packages/options/package.json @@ -3,8 +3,9 @@ "version": "2.2.1", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "src/index.ts", - "typings": "src/index.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "source": "src/index.ts", "directories": { "lib": "lib" }, diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index 5c4091466d..d14376571e 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -1,4 +1,4 @@ -import {Quantity} from "@ganache/utils/src/things/json-rpc"; +import {Quantity} from "@ganache/utils"; import {types} from "@ganache/utils"; interface Logger { diff --git a/src/packages/utils/.npmignore b/src/packages/utils/.npmignore new file mode 100644 index 0000000000..a8ca347bfb --- /dev/null +++ b/src/packages/utils/.npmignore @@ -0,0 +1 @@ +./index.ts diff --git a/src/packages/utils/index.ts b/src/packages/utils/index.ts new file mode 100644 index 0000000000..532a9d48e4 --- /dev/null +++ b/src/packages/utils/index.ts @@ -0,0 +1 @@ +export * from "./src/index"; \ No newline at end of file diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index f2d19abb18..540d125f14 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -5,8 +5,9 @@ "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "src/index.ts", - "typings": "src/index.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "source": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/src/packages/utils/src/index.ts b/src/packages/utils/src/index.ts index 583a52797a..39fd9d0cff 100644 --- a/src/packages/utils/src/index.ts +++ b/src/packages/utils/src/index.ts @@ -1,2 +1,7 @@ export * as types from "./types"; export * as utils from "./utils"; +export * as JsonRpc from "./things/json-rpc"; +export * from "./things/json-rpc/json-rpc-quantity"; +export * from "./things/json-rpc/json-rpc-data"; +export { default as JsonRpcTypes } from "./things/jsonrpc"; +export { default as PromiEvent } from "./things/promievent"; diff --git a/src/packages/utils/src/things/json-rpc/index.ts b/src/packages/utils/src/things/json-rpc/index.ts index cf961f88a7..10d266c132 100644 --- a/src/packages/utils/src/things/json-rpc/index.ts +++ b/src/packages/utils/src/things/json-rpc/index.ts @@ -1,4 +1 @@ -import {IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType} from "./json-rpc-base-types"; -import Quantity from "./json-rpc-quantity"; -import Data, {IndexableData} from "./json-rpc-data"; -export {Data, Quantity, IndexableJsonRpcType, JsonRpcType, BaseJsonRpcType, IndexableData}; +export {JsonRpcType} from "./json-rpc-base-types"; \ No newline at end of file diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-data.ts b/src/packages/utils/src/things/json-rpc/json-rpc-data.ts index ae033f5a7a..86d6ca1bc8 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-data.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-data.ts @@ -1,4 +1,4 @@ -import {BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType} from "."; +import {BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType} from "./json-rpc-base-types"; import {strCache, toStrings} from "./json-rpc-base-types"; function validateByteLength(byteLength?: number) { @@ -53,15 +53,15 @@ export class Data extends BaseJsonRpcType { return new _Data(value, byteLength); } } -type $ = { +export type $ = { new (value: T, byteLength?: number): _Data & JsonRpcType; from(value: T, byteLength?: number): _Data & JsonRpcType; toString(byteLength?: number): string; toBuffer(): Buffer; }; -const _Data = Data as $; +export const _Data = Data as $; -interface _Data { +export interface _Data { constructor(value: T, byteLength?: number): _Data; from(value: T, byteLength?: number): _Data; toString(byteLength?: number): string; diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index 39867c97a7..7832d79ce0 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -1,10 +1,11 @@ -import {BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType} from "."; +import {JsonRpcType} from "."; +import { BaseJsonRpcType } from "./json-rpc-base-types"; const toBigIntBE = require("bigint-buffer").toBigIntBE; -class Quantity extends BaseJsonRpcType { +export class Quantity extends BaseJsonRpcType { _nullable: boolean = false; public static from(value: number | bigint | string | Buffer, nullable = false) { - const q = new _Quantity(value, nullable); + const q = new _Quantity(value); q._nullable = nullable; return q; } @@ -82,7 +83,7 @@ class Quantity extends BaseJsonRpcType { } type $ = { _nullable: boolean; - new (value: T, nullable?: boolean): _Quantity & JsonRpcType; + new (value: T): _Quantity & JsonRpcType; from(value: T, nullable?: boolean): _Quantity & JsonRpcType; toBigInt(): bigint; toNumber(): number; @@ -93,7 +94,7 @@ const _Quantity = Quantity as $; interface _Quantity { _nullable: boolean; - constructor(value: T, nullable?: boolean): _Quantity; + constructor(value: T): _Quantity; from(): _Quantity; toBigInt(): bigint; toNumber(): number; diff --git a/src/packages/utils/src/utils/uint-to-buffer.ts b/src/packages/utils/src/utils/uint-to-buffer.ts index fcca47ff58..caf2b8c48e 100644 --- a/src/packages/utils/src/utils/uint-to-buffer.ts +++ b/src/packages/utils/src/utils/uint-to-buffer.ts @@ -34,7 +34,7 @@ function uint32ToBuf(value: number) { } /** - * Converts unsigned intergers that are wider than 32 bits but smaller than 64. + * Converts unsigned integers that are wider than 32 bits but smaller than 64. * @param value */ function uintWideToBuf(value: number) { From 23b2e05e17406706424b5f93c887f566ba6e28bc Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 31 Jul 2020 17:09:10 -0400 Subject: [PATCH 389/691] ensure we can test/debug w/out having to build 1st --- src/chains/ethereum/src/index.ts | 2 +- src/chains/tezos/src/index.ts | 2 +- src/packages/flavors/src/index.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index f6c688c167..24e938a38b 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -13,7 +13,7 @@ function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest export type EthereumProvider = Provider; export const EthereumProvider = Provider; -export default class EthereumConnector extends Emittery.Typed +export class EthereumConnector extends Emittery.Typed implements types.Connector> { #provider: Provider; diff --git a/src/chains/tezos/src/index.ts b/src/chains/tezos/src/index.ts index e54667a20b..2b7d814f3a 100644 --- a/src/chains/tezos/src/index.ts +++ b/src/chains/tezos/src/index.ts @@ -8,7 +8,7 @@ import { HttpRequest } from "uWebSockets.js"; export type TezosProvider = Provider; export const TezosProvider = Provider; -export default class TezosConnector extends Emittery.Typed +export class TezosConnector extends Emittery.Typed implements types.Connector { provider: Provider; #api: TezosApi; diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts index 26142a59c0..72637c807c 100644 --- a/src/packages/flavors/src/index.ts +++ b/src/packages/flavors/src/index.ts @@ -1,6 +1,6 @@ import {types} from "@ganache/utils"; -import TezosConnector from "@ganache/tezos"; -import EthereumConnector from "@ganache/ethereum"; +import {TezosConnector} from "@ganache/tezos"; +import {EthereumConnector} from "@ganache/ethereum"; export const FlavorMap = { tezos: TezosConnector, From 3b172dd8e04bdd40ec8d0d3ca2931c8e631cb274 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 31 Jul 2020 17:30:47 -0400 Subject: [PATCH 390/691] Add comment about why the index.ts file is present in each package --- scripts/create.ts | 6 +++++- src/chains/ethereum/index.ts | 5 +++++ src/chains/tezos/index.ts | 5 +++++ src/packages/core/index.ts | 5 +++++ src/packages/flavors/index.ts | 5 +++++ src/packages/options/index.ts | 5 +++++ src/packages/utils/index.ts | 7 ++++++- 7 files changed, 36 insertions(+), 2 deletions(-) diff --git a/scripts/create.ts b/scripts/create.ts index 1572871865..582dfb7af1 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -76,7 +76,11 @@ describe("${packageName}", () => { } `; -const rootIndexFile = `export * from "./src/index"; + const rootIndexFile = `// ************************************************************************* // +// This file is necessary to "trick" typescript into using our ./src/**/*.ts // +// files when developing, debugging, and running tests // +// ************************************************************************* // +export * from "./src/index"; `; const dir = join("./src/packages", name); diff --git a/src/chains/ethereum/index.ts b/src/chains/ethereum/index.ts index e910bb060c..3b05966675 100644 --- a/src/chains/ethereum/index.ts +++ b/src/chains/ethereum/index.ts @@ -1 +1,6 @@ +// ************************************************************************* // +// This file is necessary to "trick" typescript into using our ./src/**/*.ts // +// files when developing, debugging, and running tests // +// ************************************************************************* // + export * from "./src/index"; diff --git a/src/chains/tezos/index.ts b/src/chains/tezos/index.ts index e910bb060c..3b05966675 100644 --- a/src/chains/tezos/index.ts +++ b/src/chains/tezos/index.ts @@ -1 +1,6 @@ +// ************************************************************************* // +// This file is necessary to "trick" typescript into using our ./src/**/*.ts // +// files when developing, debugging, and running tests // +// ************************************************************************* // + export * from "./src/index"; diff --git a/src/packages/core/index.ts b/src/packages/core/index.ts index e910bb060c..3b05966675 100644 --- a/src/packages/core/index.ts +++ b/src/packages/core/index.ts @@ -1 +1,6 @@ +// ************************************************************************* // +// This file is necessary to "trick" typescript into using our ./src/**/*.ts // +// files when developing, debugging, and running tests // +// ************************************************************************* // + export * from "./src/index"; diff --git a/src/packages/flavors/index.ts b/src/packages/flavors/index.ts index e910bb060c..3b05966675 100644 --- a/src/packages/flavors/index.ts +++ b/src/packages/flavors/index.ts @@ -1 +1,6 @@ +// ************************************************************************* // +// This file is necessary to "trick" typescript into using our ./src/**/*.ts // +// files when developing, debugging, and running tests // +// ************************************************************************* // + export * from "./src/index"; diff --git a/src/packages/options/index.ts b/src/packages/options/index.ts index e910bb060c..3b05966675 100644 --- a/src/packages/options/index.ts +++ b/src/packages/options/index.ts @@ -1 +1,6 @@ +// ************************************************************************* // +// This file is necessary to "trick" typescript into using our ./src/**/*.ts // +// files when developing, debugging, and running tests // +// ************************************************************************* // + export * from "./src/index"; diff --git a/src/packages/utils/index.ts b/src/packages/utils/index.ts index 532a9d48e4..3b05966675 100644 --- a/src/packages/utils/index.ts +++ b/src/packages/utils/index.ts @@ -1 +1,6 @@ -export * from "./src/index"; \ No newline at end of file +// ************************************************************************* // +// This file is necessary to "trick" typescript into using our ./src/**/*.ts // +// files when developing, debugging, and running tests // +// ************************************************************************* // + +export * from "./src/index"; From 3415ce8960e954bb82d05cf8943aadde858f00df Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 31 Jul 2020 22:08:01 -0400 Subject: [PATCH 391/691] Better documentation for uint-to-buffer --- .../utils/src/utils/uint-to-buffer.ts | 123 +++++++++++++----- 1 file changed, 94 insertions(+), 29 deletions(-) diff --git a/src/packages/utils/src/utils/uint-to-buffer.ts b/src/packages/utils/src/utils/uint-to-buffer.ts index caf2b8c48e..7d555be5ca 100644 --- a/src/packages/utils/src/utils/uint-to-buffer.ts +++ b/src/packages/utils/src/utils/uint-to-buffer.ts @@ -1,49 +1,114 @@ const MAX_UINT32 = 0xffffffff; + +/** + * This is just Node's `Buffer.allocUnsafe`. I'm documenting it extra here to + * draw attention to it. It is much faster the `Buffer.alloc(size)` because it + * doesn't initialize its memory first. It's safe for us to use below because we + * guarantee that we will fill every octet ourselves. + * + * Allocates a new buffer of {size} octets, leaving memory not initialized, so + * the contents of the newly created Buffer are unknown and may contain + * sensitive data. + * + * @param {number} size count of octets to allocate + */ const allocUnsafe = Buffer.allocUnsafe; -function uint32ToBuf(value: number) { - // if value is 32 bits or fewer +/** + * Converts positive whole numbers that are 32 bits of fewer to a Buffer. Any + * more bits and who knows what will happen!?!1?! + * + * @param num A positive whole number less than 33 bits wide, i.e. a uint32. + * @returns an optimally sized buffer holding `num` in big-endian order (LSB is + * the _last_ value in the Buffer) + */ +function uint32ToBuf(num: number) { let buf: Buffer; - const three = value; - if (value >>>= 8) { - const two = value; - if (value >>>= 8) { - const one = value; - if (value >>>= 8) { + + /** `lsb` holds the Least Significant *byte* of `num`. It *technically* holds + * all of `num`'s bytes but because of how UInt8Arrays (and thus Buffers) + * work, only the least significant byte of each value gets used. */ + const lsb = num; + + // shift the first 8 least signficant bits off current num, if it's non-zero + // our value contains at least 2 bytes! + if (num >>>= 8) { + + /** `second` now holds the second most least significant byte in its + * "first" (right most) 8 bits */ + const second = num; + + // shift the next 8 least signficant bits off current num, if it's non-zero + // our value contains at least 3 bytes! + if (num >>>= 8) { + + /** `third` now holds the third most least significant byte in its + * "first" (right most) 8 bits */ + const third = num; + if (num >>>= 8) { + + // since we have all 4 bytes, create a 4 byte Buffer and fill it with + // our values! buf = allocUnsafe(4); - buf[0] = value; - buf[1] = one; - buf[2] = two; - buf[3] = three; + // `num` here is just what is left after shifting off the 3 other bytes + // like we did above + buf[0] = num; + buf[1] = third; + buf[2] = second; + buf[3] = lsb; } else { + // since we only have 3 bytes, create a 3 byte Buffer and fill it with + // our values! buf = allocUnsafe(3); - buf[0] = one; - buf[1] = two; - buf[2] = three; + buf[0] = third; + buf[1] = second; + buf[2] = lsb; } } else { + // since we only have 2 bytes, create a 2 byte Buffer and fill it with + // our values! buf = allocUnsafe(2); - buf[0] = two; - buf[1] = three; + buf[0] = second; + buf[1] = lsb; } } else { + // We only have 1 byte, create a 1 byte Buffer and fill it with our only + // value, lsb! buf = allocUnsafe(1); - buf[0] = three; + buf[0] = lsb; } + + // finally, return our optimally-sized Buffer! return buf; } /** - * Converts unsigned integers that are wider than 32 bits but smaller than 64. - * @param value + * Converts positive whole numbers less than or equal to + * `Number.MAX_SAFE_INTEGER` to a Buffer. If your value is less than 2**32 you + * should use `uint32ToBuf` instead. + * + * @param num A positive whole number <= `Number.MAX_SAFE_INTEGER` + * @returns an optimally sized buffer holding `num` in big-endian order (LSB is + * the _last_ value in the Buffer) */ -function uintWideToBuf(value: number) { - // for values larger than 32 bits, we need to convert to a BigInt to get the - // the high bits: - let hi = Number(BigInt(value) >> 32n); - const hiLsb = hi; +function uintWideToBuf(num: number) { + // This function is similar to `uint32ToBuf`, but splits the number into its + // 32 lowest bits and its 32 highest bits. We have to do this because numeric + // Bitwise operations can only operate on 32 bit-wide values. + // There are some differences, but if you first grasp `uint32ToBuf`, you can + // handle this just fine. + let buf: Buffer; + + /** If we are in this function we are probably > 32 bits wide, so we need to + * first convert this value to BigInt in order to shift off those high bits. + * Now that I'm documenting this, we could probably just subtract `2**32` from + * `num` to avoid the conversion overhead (BigInts are slower than numbers) */ + let hi = Number(BigInt(num) >> 32n); + + const hiLsb = hi; let offset = 0; + // the high bits determine the size of the Buffer, so we compute the high bits // first if (hi >>>= 8) { @@ -77,7 +142,7 @@ function uintWideToBuf(value: number) { } // set the low bytes: - let lo = value & MAX_UINT32; + let lo = num & MAX_UINT32; const lsb = lo; if (lo >>>= 8) { const two = lo; @@ -110,8 +175,8 @@ function uintWideToBuf(value: number) { * return very unexpected results. Numbers that are greater than * `Number.MAX_SAFE_INTEGER` will return unexpected results. * - * @param value + * @param num A positive whole number <= `Number.MAX_SAFE_INTEGER` */ -export function uintToBuffer(value: number) { - return value > MAX_UINT32 ? uintWideToBuf(value) : uint32ToBuf(value); +export function uintToBuffer(num: number) { + return num > MAX_UINT32 ? uintWideToBuf(num) : uint32ToBuf(num); } From ef6f1535bd31d9193ce24a427553077afaf05154 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 31 Jul 2020 22:09:45 -0400 Subject: [PATCH 392/691] Fix comment typo --- src/packages/utils/src/utils/uint-to-buffer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/utils/src/utils/uint-to-buffer.ts b/src/packages/utils/src/utils/uint-to-buffer.ts index 7d555be5ca..46619e60c1 100644 --- a/src/packages/utils/src/utils/uint-to-buffer.ts +++ b/src/packages/utils/src/utils/uint-to-buffer.ts @@ -168,7 +168,7 @@ function uintWideToBuf(num: number) { } /** - * Converts a JavaScript number, treated as a Whole Numbers (0, 1, 2, 3, 4, ...) + * Converts a JavaScript number, treated as a Whole Number (0, 1, 2, 3, 4, ...) * less than 64 bits wide, to a Buffer. * * Numbers that are negative, fractional, or greater than 64 bits wide will From cbd497997e5c273a10357dc09f0f0b9dc676560d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sun, 2 Aug 2020 15:23:54 -0400 Subject: [PATCH 393/691] Add a too for making sure we clean up websocket listeners --- src/packages/core/src/servers/ws-server.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index 936f1e4563..fe04151323 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -58,6 +58,8 @@ export default class WebsocketServer { close: (ws: WebSocket) => { this.#connections.delete(ws); ws.closed = true; + // TODO: make sure we clean up all `resultEmitter`s (we'll need to extend PromiEvents so they know when they need + // to kill their own internal listeners)! } }); } From 1d15192297447047b398c94404984caee330c764 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 3 Aug 2020 15:06:50 -0400 Subject: [PATCH 394/691] Don't leak ws listeners --- src/chains/ethereum/src/api.ts | 231 ++++++++++---------- src/chains/ethereum/src/index.ts | 8 +- src/packages/core/src/servers/ws-server.ts | 32 +-- src/packages/utils/src/things/promievent.ts | 47 +++- 4 files changed, 182 insertions(+), 136 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 3aa12beb86..a8745051c8 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -10,6 +10,29 @@ import Transaction from "./things/transaction"; import Wallet from "./wallet"; import { decode as rlpDecode } from "rlp"; +const createKeccakHash = require("keccak"); +// Read in the current ganache version from core's package.json +import { version } from "../../../packages/core/package.json"; +import { PromiEvent } from "@ganache/utils"; +import Emittery from "emittery"; +import Common from "ethereumjs-common"; +import BlockLogs from "./things/blocklogs"; +import EthereumAccount from "ethereumjs-account"; +import { Block } from "./components/block-manager"; +//#endregion + +//#region Constants +const BUFFER_EMPTY = Buffer.allocUnsafe(0); +const BUFFER_ZERO = Buffer.from([0]); +const CLIENT_VERSION = `Ganache/v${version}`; +const PROTOCOL_VERSION = Data.from("0x3f"); +const RPCQUANTITY_ZERO = Quantity.from("0x0"); +const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; +//#endregion + +//#region types +type SubscriptionId = string; + type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; type TypedData = Exclude[1]["data"], NotTypedData>; enum FilterTypes { @@ -19,6 +42,9 @@ enum FilterTypes { }; type Topic = string|string[]; type FilterArgs = {address?: string | string[], topics?: Topic[], fromBlock?: string | Tag, toBlock?: string | Tag}; +//#endregion + +//#region helpers function parseFilter(filter: FilterArgs, blockchain: Blockchain) { // `filter.address` may be a single address or an array const addresses = filter.address ? (Array.isArray(filter.address) ? filter.address : [filter.address]).map(a => Address.from(a.toLowerCase()).toBuffer()) : []; @@ -45,30 +71,6 @@ function parseFilter(filter: FilterArgs, blockchain: Blockchain) { }; } -const createKeccakHash = require("keccak"); -// Read in the current ganache version from core's package.json -import { version } from "../../../packages/core/package.json"; -import { PromiEvent } from "@ganache/utils"; -import Emittery from "emittery"; -import Common from "ethereumjs-common"; -import BlockLogs from "./things/blocklogs"; -import EthereumAccount from "ethereumjs-account"; -import { Block } from "./components/block-manager"; -//#endregion - -//#region Constants -const BUFFER_EMPTY = Buffer.allocUnsafe(0); -const BUFFER_ZERO = Buffer.from([0]); -const CLIENT_VERSION = `Ganache/v${version}`; -const PROTOCOL_VERSION = Data.from("0x3f"); -const RPCQUANTITY_ZERO = Quantity.from("0x0"); -const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; -//#endregion - -//#region types -type SubscriptionId = string; -//#endregion - export default class EthereumApi implements types.Api { readonly [index: string]: (...args: any) => Promise; @@ -199,17 +201,19 @@ export default class EthereumApi implements types.Api { async evm_setAccountNonce(address: string, nonce: string) { return new Promise((resolve, reject) => { const buffer = Address.from(address).toBuffer(); - this.#blockchain.vm.stateManager.getAccount(buffer, (err: Error, account: EthereumAccount) => { + const blockchain = this.#blockchain; + const stateManager = blockchain.vm.stateManager; + stateManager.getAccount(buffer, (err: Error, account: EthereumAccount) => { if (err) { return void reject(err) } account.nonce = Quantity.from(nonce).toBuffer(); - this.#blockchain.vm.stateManager.putAccount(buffer, account, (err: Error) => { + stateManager.putAccount(buffer, account, (err: Error) => { if (err) { return void reject(err); } - this.#blockchain.mine(0).then(() => resolve(true), reject); + blockchain.mine(0).then(() => resolve(true), reject); }); }); }); @@ -988,78 +992,56 @@ export default class EthereumApi implements types.Api { const subscriptions = this.#subscriptions; switch (subscriptionName) { case "newHeads": { - const promiEvent = new PromiEvent(resolve => { - const subscription = this.#getId(); - const unsubscribe = this.#blockchain.on("block", (block: Block) => { - const value = block.value; - const header = value.header; - const result = { - "logsBloom": Data.from(header.bloom, 256), // TODO: pending block - "miner": Address.from(header.coinbase), - "difficulty": Quantity.from(header.difficulty), - "extraData": Data.from(header.extraData), - "gasLimit": Quantity.from(header.gasLimit), - "gasUsed": Quantity.from(header.gasUsed), - "hash": Data.from(value.hash(), 32), // TODO: pending block - "mixHash": Data.from(header.mixHash, 32), - "nonce": Data.from(header.nonce, 8), // TODO: pending block - "number": Quantity.from(header.number, true), // TODO: pending block - "parentHash": Data.from(header.parentHash, 32), - "receiptsRoot": Data.from(header.receiptTrie, 32), - "stateRoot": Data.from(header.stateRoot, 32), - "timestamp": Quantity.from(header.timestamp), - "transactionsRoot": Data.from(header.transactionsTrie, 32), - "sha3Uncles": Data.from(header.uncleHash, 32) - }; - - // TODO: move the JSON stringification closer to where the message - // is actually sent to the listener - promiEvent.emit("message", { - type: "eth_subscription", - data: { - result: JSON.parse(JSON.stringify(result)), - subscription: subscription.toString() - } - }); - }); - subscriptions.set(subscription.toString(), unsubscribe); - - resolve(subscription); - }); - return promiEvent; - } - case "logs": { - const promiEvent = new PromiEvent(resolve => { - const subscription = this.#getId(); - const blockchain = this.#blockchain; - const { addresses, topics, fromBlock, toBlock } = parseFilter(options, blockchain); - const unsubscribe = blockchain.on("blockLogs", (blockLogs: BlockLogs) => { - const blockNumber = blockLogs.getBlockNumber(); - if (fromBlock >= blockNumber && blockNumber <= toBlock) { - // TODO: move the JSON stringification closer to where the message - // is actually sent to the listener - const result = JSON.parse(JSON.stringify([...blockLogs.filter(addresses, topics)])); - promiEvent.emit("message", { - type: "eth_subscription", - data: { - result, - subscription: subscription.toString() - } - }); + const subscription = this.#getId(); + const promiEvent = PromiEvent.resolve(subscription); + + const unsubscribe = this.#blockchain.on("block", (block: Block) => { + const value = block.value; + const header = value.header; + const result = { + "logsBloom": Data.from(header.bloom, 256), // TODO: pending block + "miner": Address.from(header.coinbase), + "difficulty": Quantity.from(header.difficulty), + "extraData": Data.from(header.extraData), + "gasLimit": Quantity.from(header.gasLimit), + "gasUsed": Quantity.from(header.gasUsed), + "hash": Data.from(value.hash(), 32), // TODO: pending block + "mixHash": Data.from(header.mixHash, 32), + "nonce": Data.from(header.nonce, 8), // TODO: pending block + "number": Quantity.from(header.number, true), // TODO: pending block + "parentHash": Data.from(header.parentHash, 32), + "receiptsRoot": Data.from(header.receiptTrie, 32), + "stateRoot": Data.from(header.stateRoot, 32), + "timestamp": Quantity.from(header.timestamp), + "transactionsRoot": Data.from(header.transactionsTrie, 32), + "sha3Uncles": Data.from(header.uncleHash, 32) + }; + + // TODO: move the JSON stringification closer to where the message + // is actually sent to the listener + promiEvent.emit("message", { + type: "eth_subscription", + data: { + result: JSON.parse(JSON.stringify(result)), + subscription: subscription.toString() } }); - subscriptions.set(subscription.toString(), unsubscribe); - - resolve(subscription); }); + subscriptions.set(subscription.toString(), unsubscribe); return promiEvent; } - case "newPendingTransactions": { - const promiEvent = new PromiEvent(resolve => { - const subscription = this.#getId(); - const blockchain = this.#blockchain; - const unsubscribe = blockchain.on("pendingTransaction", (transaction: Transaction) => { - const result = Data.from(transaction.hash(), 32).toString(); + case "logs": { + const subscription = this.#getId(); + const promiEvent = PromiEvent.resolve(subscription); + + const blockchain = this.#blockchain; + const { addresses, topics, fromBlock, toBlock } = parseFilter(options, blockchain); + const unsubscribe = blockchain.on("blockLogs", (blockLogs: BlockLogs) => { + const blockNumber = blockLogs.getBlockNumber(); + if (fromBlock >= blockNumber && blockNumber <= toBlock) { + // TODO: move the JSON stringification closer to where the message + // is actually sent to the listener + const result = JSON.parse(JSON.stringify([...blockLogs.filter(addresses, topics)])); promiEvent.emit("message", { type: "eth_subscription", data: { @@ -1067,21 +1049,35 @@ export default class EthereumApi implements types.Api { subscription: subscription.toString() } }); + } + }); + subscriptions.set(subscription.toString(), unsubscribe); + return promiEvent; + } + case "newPendingTransactions": { + const subscription = this.#getId(); + const promiEvent = PromiEvent.resolve(subscription); + + const blockchain = this.#blockchain; + const unsubscribe = blockchain.on("pendingTransaction", (transaction: Transaction) => { + const result = Data.from(transaction.hash(), 32).toString(); + promiEvent.emit("message", { + type: "eth_subscription", + data: { + result, + subscription: subscription.toString() + } }); - subscriptions.set(subscription.toString(), unsubscribe); - - resolve(subscription); }); + subscriptions.set(subscription.toString(), unsubscribe); return promiEvent; } case "syncing": { - const subscriptions = this.#subscriptions; - const promiEvent = new PromiEvent(resolve => { - const subscription = this.#getId(); - subscriptions.set(subscription.toString(), () => {}); - - resolve(subscription); - }); + // TODO: ? + const subscription = this.#getId(); + const promiEvent = PromiEvent.resolve(subscription); + + this.#subscriptions.set(subscription.toString(), () => {}); return promiEvent; } default: @@ -1109,10 +1105,11 @@ export default class EthereumApi implements types.Api { * @returns A filter id. */ async eth_newBlockFilter() { + const updates = []; const unsubscribe = this.#blockchain.on("block", (block: Block) => { - value.updates.push(Data.from(block.value.hash(), 32)); + updates.push(Data.from(block.value.hash(), 32)); }); - const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.block}; + const value = {updates, unsubscribe, filter: null, type: FilterTypes.block}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1125,10 +1122,11 @@ export default class EthereumApi implements types.Api { * @returns A filter id. */ async eth_newPendingTransactionFilter() { + const updates = [] const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { - value.updates.push(Data.from(transaction.hash(), 32)); + updates.push(Data.from(transaction.hash(), 32)); }); - const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.pendingTransaction}; + const value = {updates, unsubscribe, filter: null, type: FilterTypes.pendingTransaction}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1156,13 +1154,14 @@ export default class EthereumApi implements types.Api { async eth_newFilter(filter: FilterArgs) { const blockchain = this.#blockchain; const { addresses, topics, fromBlock, toBlock } = parseFilter(filter, blockchain); + const updates = []; const unsubscribe = blockchain.on("blockLogs", (blockLogs: BlockLogs) => { const blockNumber = blockLogs.getBlockNumber(); if (fromBlock >= blockNumber && blockNumber <= toBlock) { - value.updates.push(...blockLogs.filter(addresses, topics)); + updates.push(...blockLogs.filter(addresses, topics)); } }); - const value = {updates: [], unsubscribe, filter, type: FilterTypes.log}; + const value = {updates, unsubscribe, filter, type: FilterTypes.log}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1174,9 +1173,8 @@ export default class EthereumApi implements types.Api { * last poll. * * @param filterId the filter id. - * @returns an array of logs, block hashes, - * or transactions hashes, depending on the filter type, which occurred since - * last poll. + * @returns an array of logs, block hashes, or transactions hashes, depending + * on the filter type, which occurred since last poll. */ async eth_getFilterChanges(filterId: string) { const filter = this.#filters.get(filterId); @@ -1226,9 +1224,10 @@ export default class EthereumApi implements types.Api { */ async eth_getLogs(filter: FilterArgs) { const blockchain = this.#blockchain; + const blockLogs = blockchain.blockLogs; const {addresses, topics, fromBlock, toBlockNumber} = parseFilter(filter, blockchain); - const pendingLogsPromises: Promise[] = [blockchain.blockLogs.get(fromBlock.toBuffer())]; + const pendingLogsPromises: Promise[] = [blockLogs.get(fromBlock.toBuffer())]; const fromBlockNumber = fromBlock.toNumber(); // if we have a range of blocks to search, do that here: @@ -1236,12 +1235,12 @@ export default class EthereumApi implements types.Api { // fetch all the blockLogs in-between `fromBlock` and `toBlock` (excluding // from, because we already started fetching that one) for (let i = fromBlockNumber + 1, l = toBlockNumber + 1; i < l; i++) { - pendingLogsPromises.push(blockchain.blockLogs.get(Quantity.from(i).toBuffer())); + pendingLogsPromises.push(blockLogs.get(Quantity.from(i).toBuffer())); } } // now filter and compute all the blocks' blockLogs (in block order) - return await Promise.all(pendingLogsPromises).then(blockLogsRange => { + return Promise.all(pendingLogsPromises).then(blockLogsRange => { const filteredBlockLogs: ReturnType[] = []; blockLogsRange.forEach(blockLogs => { // TODO(perf): this loops over all expectedAddresseses for every block. diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 24e938a38b..347925b440 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -41,13 +41,15 @@ export class EthereumConnector extends Emittery.Typed void reject(error)); + return PromiEvent.reject(error); } else { return this.#provider.request({method: "eth_subscribe", params: payload.params as Parameters}); } } - return new PromiEvent((resolve) => { - this.#provider.send(method, payload.params as Parameters).then(resolve); + const provider = this.#provider; + const params = payload.params as Parameters; + return new PromiEvent(resolve => { + provider.send(method, params).then(resolve); }); } diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index fe04151323..5071f6fbda 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -20,6 +20,7 @@ export default class WebsocketServer { /* Handlers */ open: (ws: WebSocket) => { + ws.promiEvents = new Set(); this.#connections.add(ws); }, message: async (ws: WebSocket, message: ArrayBuffer, isBinary: boolean) => { @@ -35,35 +36,36 @@ export default class WebsocketServer { resultEmitter.then(result => { // The socket may have closed while we were waiting for the response // Don't bother trying to send to it if it was. - if (!ws.closed) { - const message = connector.format(result, payload); - ws.send(message, isBinary, true); - } + if (ws.closed) return; + + const message = connector.format(result, payload); + ws.send(message, isBinary, true); }); resultEmitter.on("message", (result: any) => { - // The socket may have closed while we were waiting for the response - // Don't bother trying to send to it if it was. - if (!ws.closed) { - const message = connector.format(result, payload); - ws.send(message, isBinary, true); - } + // note: we _don't_ need to check if `ws.closed` here because when + // `ws.closed` is set we remove this `"message"` event handler anyway. + const message = connector.format(result, payload); + ws.send(message, isBinary, true); }); + ws.promiEvents.add(resultEmitter.dispose); }, drain: (ws: WebSocket) => { - // This is there so tests can detect if a small amount of backpressure is happening and that things will still - // work if it does. We actually don't do anything to manage excessive backpressure. + // This is there so tests can detect if a small amount of backpressure + // is happening and that things will still work if it does. We actually + // don't do anything to manage excessive backpressure. options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); }, close: (ws: WebSocket) => { - this.#connections.delete(ws); ws.closed = true; - // TODO: make sure we clean up all `resultEmitter`s (we'll need to extend PromiEvents so they know when they need - // to kill their own internal listeners)! + ws.promiEvents.forEach(dispose => dispose()); + ws.promiEvents.clear(); + this.#connections.delete(ws); } }); } close() { this.#connections.forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); + this.#connections.clear(); } } diff --git a/src/packages/utils/src/things/promievent.ts b/src/packages/utils/src/things/promievent.ts index 4464509dac..cd2fbed972 100644 --- a/src/packages/utils/src/things/promievent.ts +++ b/src/packages/utils/src/things/promievent.ts @@ -1,13 +1,56 @@ import Emittery from "emittery"; -class PromiEvent extends Promise{ +// PromiEvent's `resolve and `reject` (and the other static methods -- if you +// need their types too, add them!) return a PromiEvent, but the `Promise` type +// doesn't. +declare var Promise: { + /** + * Creates a new rejected promievent for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected PromiEvent. + */ + reject(reason?: any): PromiEvent; + + /** + * Creates a new resolved promievent for the provided value. + * @param value A promise. + * @returns A promievent whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): PromiEvent; + + /** + * Creates a new resolved promievent. + * @returns A resolved promievent. + */ + resolve(): PromiEvent; +} & PromiseConstructor; + +class PromiEvent extends Promise { constructor (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) { super(executor); this.init(); } + + /** + * Used to immediately clear all event listeners on the instance and prevent + * any additional binding or emittion from the Emitter. + * + * Once disposed no listeners can be bound to this emitter. + * + * Note: `dispose` is pre-bound to the `this`, making it possible to pass the + * method around detached from it's context. + */ + public dispose = () => { + this.clearListeners(); + + // Ensure that once disposed no listeners can be bound to this emitter. + this.anyEvent = this.events = this.bindMethods = this.once = this.on = this.onAny = () => {throw new Error("PromiEvent bound after dispose");}; + } +} + +interface PromiEvent extends Promise, Emittery { } -interface PromiEvent extends Promise, Emittery {} applyMixins(PromiEvent, [Promise, Emittery]); export default PromiEvent; From 9ce53036b288bf884a96729c1496c9349bb5df6b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 3 Aug 2020 17:16:52 -0400 Subject: [PATCH 395/691] FIx logs and pendingTranasctions subscriptions, add tests --- .../ethereum/__tests__/api/eth/logs.test.ts | 244 +++++++++++------- .../__tests__/api/eth/subscribe.test.ts | 187 +++++++++----- src/chains/ethereum/src/api.ts | 41 +-- src/chains/ethereum/src/blockchain.ts | 2 +- 4 files changed, 294 insertions(+), 180 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts index a9877f64c3..2bbf983adb 100644 --- a/src/chains/ethereum/__tests__/api/eth/logs.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -4,6 +4,7 @@ import assert from "assert"; import EthereumProvider from "../../../src/provider"; import compile from "../../helpers/compile"; import { join } from "path"; +import { promises } from "fs-extra"; describe("api", () => { describe("eth", () => { @@ -12,6 +13,7 @@ describe("api", () => { let contract: ReturnType; let contractAddress: string; let accounts: string[]; + beforeEach(async () => { contract = compile(join(__dirname, "./contracts/Logs.sol")); provider = await getProvider(); @@ -28,112 +30,156 @@ describe("api", () => { contractAddress = transactionReceipt.contractAddress; }); - it("should return a log for the constructor transaction", async () => { - const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); - assert.strictEqual(logs.length, 1); - }); + describe("eth_subscribe", () => { + describe("logs", () => { + const onceMessageFor = (subId) => { + return new Promise(resolve => { + provider.on("message", (message) => { + if (message.data.subscription === subId) { + resolve(message); + } + }); + }) + } - it("should return the code at the deployed block number", async () => { - await provider.send("eth_subscribe", ["newHeads"]); - const numberOfLogs = 4; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const txHash = await provider.send("eth_sendTransaction", [{ - from: accounts[0], - to: contractAddress, - gas: 3141592, - data: data - }]); - await provider.once("message"); - const txReceipt = await provider.send("eth_getTransactionReceipt", [txHash]); - assert.deepStrictEqual(txReceipt.logs.length, numberOfLogs); - const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); - assert.deepStrictEqual(logs, txReceipt.logs); - }); + it("subscribes and unsubscribes", async () => { + const subscriptionId = await provider.send("eth_subscribe", ["logs", {fromBlock: ""}]); - it("should filter out other blocks when using `latest`", async () => { - await provider.send("eth_subscribe", ["newHeads"]); - const numberOfLogs = 4; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const txHash = await provider.send("eth_sendTransaction", [{ - from: accounts[0], - to: contractAddress, - gas: 3141592, - data: data - }]); - await provider.once("message"); - await provider.send("evm_mine"); - await provider.once("message"); - const logs = await provider.send("eth_getLogs", [{address: contractAddress, toBlock: "latest", fromBlock: "latest"}]); - assert.strictEqual(logs.length, 0); + assert(subscriptionId != null); + assert.notStrictEqual(subscriptionId, false); + + // subscribe again + const subscriptionId2 = await provider.send("eth_subscribe", ["logs"]); + + // trigger a log event, we should get two events + const numberOfLogs = 4; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const tx = {from: accounts[0], to: contractAddress, data}; + const subs = [onceMessageFor(subscriptionId), onceMessageFor(subscriptionId2)]; + const txHash = await provider.send("eth_sendTransaction", [{...tx}]); + + const [message1, message2] = await Promise.all(subs); + assert.deepStrictEqual(message1.data.result, message2.data.result); + + assert.strictEqual(message1.data.result.length, numberOfLogs); + + const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); + assert.strictEqual(unsubResult, true); + await provider.send("eth_sendTransaction", [{...tx}]); + const message = await Promise.race([onceMessageFor(subscriptionId), onceMessageFor(subscriptionId2)]); + assert.strictEqual(message.data.subscription, subscriptionId2, "unsubscribe didn't work"); + }); + }); }); - it("should filter appropriately when using fromBlock and toBlock", async () => { - const genesisBlockNumber = "0x0"; - const deployBlockNumber = "0x1"; - const emptyBlockNumber = "0x2"; - await provider.send("evm_mine"); // 0x2 + describe("getLogs", () => { + it("should return a log for the constructor transaction", async () => { + const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); + assert.strictEqual(logs.length, 1); + }); + + it("should return the code at the deployed block number", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + const numberOfLogs = 4; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + }]); + await provider.once("message"); + const txReceipt = await provider.send("eth_getTransactionReceipt", [txHash]); + assert.deepStrictEqual(txReceipt.logs.length, numberOfLogs); + const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); + assert.deepStrictEqual(logs, txReceipt.logs); + }); + + it("should filter out other blocks when using `latest`", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + const numberOfLogs = 4; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + }]); + await provider.once("message"); + await provider.send("evm_mine"); + await provider.once("message"); + const logs = await provider.send("eth_getLogs", [{address: contractAddress, toBlock: "latest", fromBlock: "latest"}]); + assert.strictEqual(logs.length, 0); + }); + + it("should filter appropriately when using fromBlock and toBlock", async () => { + const genesisBlockNumber = "0x0"; + const deployBlockNumber = "0x1"; + const emptyBlockNumber = "0x2"; + await provider.send("evm_mine"); // 0x2 + + await provider.send("eth_subscribe", ["newHeads"]); + const numberOfLogs = 4; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + }]); // 0x3 + await provider.once("message"); + const {blockNumber} = await provider.send("eth_getTransactionReceipt", [txHash]); + + async function testGetLogs(fromBlock: string, toBlock: string, expected: number, address: string = contractAddress){ + const logs = await provider.send("eth_getLogs", [{address, fromBlock, toBlock}]); + assert.strictEqual(logs.length, expected, `there should be ${expected} log(s) between the ${fromBlock} block and the ${toBlock} block`); + } + + // tests ranges up to latest/blockNumber + await testGetLogs("earliest", "earliest", 0); + await testGetLogs(genesisBlockNumber, genesisBlockNumber, 0); + await testGetLogs("earliest", emptyBlockNumber, 1); + await testGetLogs(genesisBlockNumber, emptyBlockNumber, 1); + await testGetLogs("earliest", "latest", numberOfLogs + 1); + await testGetLogs("earliest", blockNumber, numberOfLogs + 1); + await testGetLogs(genesisBlockNumber, "latest", numberOfLogs + 1); + await testGetLogs(genesisBlockNumber, blockNumber, numberOfLogs + 1); + await testGetLogs(deployBlockNumber, "latest", numberOfLogs + 1); + await testGetLogs(deployBlockNumber, blockNumber, numberOfLogs + 1); + await testGetLogs(emptyBlockNumber, "latest", numberOfLogs); + await testGetLogs(emptyBlockNumber, blockNumber, numberOfLogs); + + // tests variations where latest === blockNumber + await testGetLogs(blockNumber, blockNumber, numberOfLogs); + await testGetLogs(blockNumber, "latest", numberOfLogs); + await testGetLogs("latest", blockNumber, numberOfLogs); + await testGetLogs("latest", "latest", numberOfLogs); + + // mine an extra block + await provider.send("evm_mine"); // 0x3 + const lastBlockNumber = `0x${(parseInt(blockNumber) + 1).toString(16)}`; + await provider.once("message"); - await provider.send("eth_subscribe", ["newHeads"]); - const numberOfLogs = 4; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const txHash = await provider.send("eth_sendTransaction", [{ - from: accounts[0], - to: contractAddress, - gas: 3141592, - data: data - }]); // 0x3 - await provider.once("message"); - const {blockNumber} = await provider.send("eth_getTransactionReceipt", [txHash]); - - async function testGetLogs(fromBlock: string, toBlock: string, expected: number, address: string = contractAddress){ - const logs = await provider.send("eth_getLogs", [{address, fromBlock, toBlock}]); - assert.strictEqual(logs.length, expected, `there should be ${expected} log(s) between the ${fromBlock} block and the ${toBlock} block`); - } - - // tests ranges up to latest/blockNumber - await testGetLogs("earliest", "earliest", 0); - await testGetLogs(genesisBlockNumber, genesisBlockNumber, 0); - await testGetLogs("earliest", emptyBlockNumber, 1); - await testGetLogs(genesisBlockNumber, emptyBlockNumber, 1); - await testGetLogs("earliest", "latest", numberOfLogs + 1); - await testGetLogs("earliest", blockNumber, numberOfLogs + 1); - await testGetLogs(genesisBlockNumber, "latest", numberOfLogs + 1); - await testGetLogs(genesisBlockNumber, blockNumber, numberOfLogs + 1); - await testGetLogs(deployBlockNumber, "latest", numberOfLogs + 1); - await testGetLogs(deployBlockNumber, blockNumber, numberOfLogs + 1); - await testGetLogs(emptyBlockNumber, "latest", numberOfLogs); - await testGetLogs(emptyBlockNumber, blockNumber, numberOfLogs); - - // tests variations where latest === blockNumber - await testGetLogs(blockNumber, blockNumber, numberOfLogs); - await testGetLogs(blockNumber, "latest", numberOfLogs); - await testGetLogs("latest", blockNumber, numberOfLogs); - await testGetLogs("latest", "latest", numberOfLogs); - - // mine an extra block - await provider.send("evm_mine"); // 0x3 - const lastBlockNumber = `0x${(parseInt(blockNumber) + 1).toString(16)}`; - await provider.once("message"); + // test variations of `earliest` and `0x0` + await testGetLogs(genesisBlockNumber, genesisBlockNumber, 0); + await testGetLogs("earliest", "earliest", 0); + await testGetLogs("earliest", genesisBlockNumber, 0); + await testGetLogs(genesisBlockNumber, "earliest", 0); - // test variations of `earliest` and `0x0` - await testGetLogs(genesisBlockNumber, genesisBlockNumber, 0); - await testGetLogs("earliest", "earliest", 0); - await testGetLogs("earliest", genesisBlockNumber, 0); - await testGetLogs(genesisBlockNumber, "earliest", 0); - - // test misc ranges not already tests - await testGetLogs(genesisBlockNumber, deployBlockNumber, 1); - await testGetLogs("earliest", deployBlockNumber, 1); - await testGetLogs("earliest", "latest", numberOfLogs + 1); - await testGetLogs(genesisBlockNumber, "latest", numberOfLogs + 1); - await testGetLogs(deployBlockNumber, "latest", numberOfLogs + 1); - // test variations involving the last block number - await testGetLogs(genesisBlockNumber, lastBlockNumber, numberOfLogs + 1); - await testGetLogs(deployBlockNumber, lastBlockNumber, numberOfLogs + 1); - await testGetLogs(emptyBlockNumber, lastBlockNumber, numberOfLogs); - await testGetLogs(lastBlockNumber, "latest", 0); - await testGetLogs("latest", lastBlockNumber, 0); + // test misc ranges not already tests + await testGetLogs(genesisBlockNumber, deployBlockNumber, 1); + await testGetLogs("earliest", deployBlockNumber, 1); + await testGetLogs("earliest", "latest", numberOfLogs + 1); + await testGetLogs(genesisBlockNumber, "latest", numberOfLogs + 1); + await testGetLogs(deployBlockNumber, "latest", numberOfLogs + 1); + // test variations involving the last block number + await testGetLogs(genesisBlockNumber, lastBlockNumber, numberOfLogs + 1); + await testGetLogs(deployBlockNumber, lastBlockNumber, numberOfLogs + 1); + await testGetLogs(emptyBlockNumber, lastBlockNumber, numberOfLogs); + await testGetLogs(lastBlockNumber, "latest", 0); + await testGetLogs("latest", lastBlockNumber, 0); + }); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index 68ac5db7a6..9661358aad 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -20,76 +20,137 @@ describe("api", () => { accounts = await provider.send("eth_accounts"); }); - it("subscribes and unsubscribes", async () => { - const timestamp = ((+now / 1000) | 0) + 1; - const startingBlockNumber = parseInt(await provider.send("eth_blockNumber")); - const subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); - - assert(subscriptionId != null); - assert.notStrictEqual(subscriptionId, false); - - // subscribe again - const subscriptionId2 = await provider.send("eth_subscribe", ["newHeads"]); - - // trigger a mine, we should get two events - await provider.send("evm_mine", [timestamp]); - let counter = 0; - - const message = await new Promise((resolve) => { - let firstMessage; - provider.on("message", (message: any) => { - counter++; - if (counter === 1) { - firstMessage = message; - } - if (counter === 2){ - assert.deepStrictEqual(firstMessage.data.result, message.data.result); - resolve(firstMessage); + describe("newHeads", () => { + it("subscribes and unsubscribes", async () => { + const timestamp = ((+now / 1000) | 0) + 1; + const startingBlockNumber = parseInt(await provider.send("eth_blockNumber")); + const subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + + assert(subscriptionId != null); + assert.notStrictEqual(subscriptionId, false); + + // subscribe again + const subscriptionId2 = await provider.send("eth_subscribe", ["newHeads"]); + + // trigger a mine, we should get two events + await provider.send("evm_mine", [timestamp]); + let counter = 0; + + const message = await new Promise((resolve) => { + let firstMessage; + provider.on("message", (message: any) => { + counter++; + if (counter === 1) { + firstMessage = message; + } + if (counter === 2) { + assert.deepStrictEqual(firstMessage.data.result, message.data.result); + resolve(firstMessage); + } + }); + }); + + assert.deepStrictEqual(message, { + type: "eth_subscription", + data: { + result: { + "difficulty": "0x0", + "extraData": "0x", + "gasLimit": gasLimit, + "gasUsed": "0x0", + "hash": "0xdc949ca8143fa0e494f9a07ddaf88c6a28f5752c9d885d075929adeca110e7d3", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "miner": accounts[0], + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000000", + "number": Quantity.from(startingBlockNumber + 1).toString(), + "parentHash": "0x03952e9b420b44ae0b35f9a0375ba91494db28d68d413f9255317ae289a8cd47", + "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "stateRoot": "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", + "timestamp": Quantity.from(timestamp).toString(), + "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + }, + subscription: subscriptionId } }); - }); - assert.deepStrictEqual(message, { - type: "eth_subscription", - data: { - result: { - "difficulty": "0x0", - "extraData": "0x", - "gasLimit": gasLimit, - "gasUsed": "0x0", - "hash": "0xdc949ca8143fa0e494f9a07ddaf88c6a28f5752c9d885d075929adeca110e7d3", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "miner": accounts[0], - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x0000000000000000", - "number": Quantity.from(startingBlockNumber + 1).toString(), - "parentHash": "0x03952e9b420b44ae0b35f9a0375ba91494db28d68d413f9255317ae289a8cd47", - "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "stateRoot": "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", - "timestamp": Quantity.from(timestamp).toString(), - "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" - }, - subscription: subscriptionId - } + // trigger a mine... we should only get a _single_ message this time + const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); + assert.strictEqual(unsubResult, true); + await provider.send("evm_mine", [timestamp]); + await assert.doesNotReject(new Promise((resolve, reject) => { + provider.on("message", async (message: any) => { + if (subscriptionId2 === message.data.subscription) { + const blockNumber = parseInt(await provider.send("eth_blockNumber")); + assert.strictEqual(blockNumber, startingBlockNumber + 2); + + resolve(); + } else { + reject(new Error("Unsubscribe didn't work!")); + } + }); + })); }); + }); + + describe("newPendingTransactions", () => { + it("subscribes and unsubscribes", async () => { + const subscriptionId = await provider.send("eth_subscribe", ["newPendingTransactions"]); - // trigger a mine... we should only get a _single_ message this time - const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); - assert.strictEqual(unsubResult, true); - await provider.send("evm_mine", [timestamp]); - await assert.doesNotReject(new Promise((resolve, reject) => { - provider.on("message", async (message: any) => { - if (subscriptionId2 === message.data.subscription) { - const blockNumber = parseInt(await provider.send("eth_blockNumber")); - assert.strictEqual(blockNumber, startingBlockNumber + 2); - - resolve(); - } else { - reject(new Error("Unsubscribe didn't work!")); + assert(subscriptionId != null); + assert.notStrictEqual(subscriptionId, false); + + // subscribe again + const subscriptionId2 = await provider.send("eth_subscribe", ["newPendingTransactions"]); + + let messagePromise = new Promise((resolve) => { + let firstMessage; + provider.on("message", (message: any) => { + counter++; + if (counter === 1) { + firstMessage = message; + } + if (counter === 2) { + assert.deepStrictEqual(firstMessage.data.result, message.data.result); + resolve(firstMessage); + } + }); + }); + + // trigger a pendingTransaction, we should get two events + const tx = {from: accounts[0], to: accounts[0]}; + const txHash = await provider.send("eth_sendTransaction", [{...tx}]); + let counter = 0; + + const message = await messagePromise; + + assert.deepStrictEqual(message, { + type: "eth_subscription", + data: { + result: txHash, + subscription: subscriptionId } }); - })); + + // trigger a mine... we should only get a _single_ message this time + const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); + assert.strictEqual(unsubResult, true); + messagePromise = new Promise((resolve, reject) => { + provider.on("message", async (message: any) => { + if (subscriptionId2 === message.data.subscription) { + assert.strictEqual(message.data.result, txHash2); + + resolve(message.data.result); + } else { + reject(new Error("Unsubscribe didn't work!")); + } + }); + }); + const txHash2 = await provider.send("eth_sendTransaction", [{...tx}]); + await assert.doesNotReject(messagePromise); + + }); }); it("returns false for unsubscribe with bad id", async () => { diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index a8745051c8..a622aeeb20 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -45,11 +45,13 @@ type FilterArgs = {address?: string | string[], topics?: Topic[], fromBlock?: st //#endregion //#region helpers -function parseFilter(filter: FilterArgs, blockchain: Blockchain) { +function parseFilterDetails(filter: Pick = {address: [], topics: []}) { // `filter.address` may be a single address or an array const addresses = filter.address ? (Array.isArray(filter.address) ? filter.address : [filter.address]).map(a => Address.from(a.toLowerCase()).toBuffer()) : []; const topics = filter.topics ? filter.topics : []; - + return {addresses, topics}; +} +function parseFilterRange(filter: Pick, blockchain: Blockchain) { const fromBlock = blockchain.blocks.getEffectiveNumber(filter.fromBlock || "latest"); const latestBlockNumberBuffer = blockchain.blocks.latest.value.header.number; const latestBlock = Quantity.from(latestBlockNumberBuffer); @@ -62,6 +64,15 @@ function parseFilter(filter: FilterArgs, blockchain: Blockchain) { } else { toBlockNumber = toBlock.toNumber(); } + return { + fromBlock, + toBlock, + toBlockNumber + } +} +function parseFilter(filter: FilterArgs = {address: [], topics: []}, blockchain: Blockchain) { + const {addresses, topics} = parseFilterDetails(filter); + const {fromBlock, toBlock, toBlockNumber} = parseFilterRange(filter, blockchain); return { addresses, fromBlock, @@ -1034,22 +1045,18 @@ export default class EthereumApi implements types.Api { const subscription = this.#getId(); const promiEvent = PromiEvent.resolve(subscription); - const blockchain = this.#blockchain; - const { addresses, topics, fromBlock, toBlock } = parseFilter(options, blockchain); - const unsubscribe = blockchain.on("blockLogs", (blockLogs: BlockLogs) => { - const blockNumber = blockLogs.getBlockNumber(); - if (fromBlock >= blockNumber && blockNumber <= toBlock) { + const { addresses, topics } = parseFilterDetails(options); + const unsubscribe = this.#blockchain.on("blockLogs", (blockLogs: BlockLogs) => { // TODO: move the JSON stringification closer to where the message // is actually sent to the listener - const result = JSON.parse(JSON.stringify([...blockLogs.filter(addresses, topics)])); - promiEvent.emit("message", { - type: "eth_subscription", - data: { - result, - subscription: subscription.toString() - } - }); - } + const result = JSON.parse(JSON.stringify([...blockLogs.filter(addresses, topics)])); + promiEvent.emit("message", { + type: "eth_subscription", + data: { + result, + subscription: subscription.toString() + } + }); }); subscriptions.set(subscription.toString(), unsubscribe); return promiEvent; @@ -1122,7 +1129,7 @@ export default class EthereumApi implements types.Api { * @returns A filter id. */ async eth_newPendingTransactionFilter() { - const updates = [] + const updates = []; const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { updates.push(Data.from(transaction.hash(), 32)); }); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index ed109ae03d..b5be9f52e1 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -413,7 +413,7 @@ export default class Blockchain extends Emittery.Typed Date: Mon, 3 Aug 2020 17:17:46 -0400 Subject: [PATCH 396/691] Remove unnecessary var declaration --- src/chains/ethereum/src/api.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index a622aeeb20..05d0005bea 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1065,8 +1065,7 @@ export default class EthereumApi implements types.Api { const subscription = this.#getId(); const promiEvent = PromiEvent.resolve(subscription); - const blockchain = this.#blockchain; - const unsubscribe = blockchain.on("pendingTransaction", (transaction: Transaction) => { + const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { const result = Data.from(transaction.hash(), 32).toString(); promiEvent.emit("message", { type: "eth_subscription", From 1fe0db663850a55430eb3e7d2c64df2ce8892c3f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 3 Aug 2020 19:13:54 -0400 Subject: [PATCH 397/691] Fix eth_newFilter, add tests --- .../ethereum/__tests__/api/eth/logs.test.ts | 121 +++++++++++++++++- src/chains/ethereum/src/api.ts | 36 ++++-- src/chains/ethereum/src/blockchain.ts | 1 + 3 files changed, 142 insertions(+), 16 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts index 2bbf983adb..1c33ee0341 100644 --- a/src/chains/ethereum/__tests__/api/eth/logs.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -19,7 +19,7 @@ describe("api", () => { provider = await getProvider(); accounts = await provider.send("eth_accounts"); - await provider.send("eth_subscribe", ["newHeads"]); + const subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); const transactionHash = await provider.send("eth_sendTransaction", [{ from: accounts[0], data: contract.code, @@ -28,6 +28,7 @@ describe("api", () => { await provider.once("message"); const transactionReceipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); contractAddress = transactionReceipt.contractAddress; + await provider.send("eth_unsubscribe", [subscriptionId]); }); describe("eth_subscribe", () => { @@ -99,7 +100,7 @@ describe("api", () => { await provider.send("eth_subscribe", ["newHeads"]); const numberOfLogs = 4; const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const txHash = await provider.send("eth_sendTransaction", [{ + await provider.send("eth_sendTransaction", [{ from: accounts[0], to: contractAddress, gas: 3141592, @@ -181,6 +182,122 @@ describe("api", () => { await testGetLogs("latest", lastBlockNumber, 0); }); }); + + describe("eth_newBlockFilter", () => { + it("returns new blocks", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + async function assertNoChanges(){ + const noChanges = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(noChanges.length, 0); + } + const filterId = await provider.send("eth_newBlockFilter"); + await assertNoChanges(); + await provider.send("evm_mine"); await provider.once("message"); + const changes1 = await provider.send("eth_getFilterChanges", [filterId]); + let blockNum = await provider.send("eth_blockNumber"); + let { hash } = await provider.send("eth_getBlockByNumber", [blockNum]); + assert.strictEqual(changes1[0], hash); + await assertNoChanges(); + await provider.send("evm_mine"); await provider.once("message"); + blockNum = await provider.send("eth_blockNumber"); + let { hash: hash2 } = await provider.send("eth_getBlockByNumber", [blockNum]); + await provider.send("evm_mine"); await provider.once("message"); + blockNum = await provider.send("eth_blockNumber"); + let { hash: hash3 } = await provider.send("eth_getBlockByNumber", [blockNum]); + + const changes2 = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(changes2[0], hash2); + assert.strictEqual(changes2[1], hash3); + await assertNoChanges(); + }) + }); + + describe("eth_newPendingTransactionFilter", () => { + it("returns new pending transactions", async () => { + await provider.send("eth_subscribe", ["newPendingTransactions"]); + async function assertNoChanges(){ + const noChanges = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(noChanges.length, 0); + } + const filterId = await provider.send("eth_newPendingTransactionFilter"); + const tx = {from: accounts[0], to: accounts[0]}; + await assertNoChanges(); + provider.send("eth_sendTransaction", [{...tx}]); + let hash = await provider.once("message"); + const changes1 = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(changes1[0], hash.data.result); + await assertNoChanges(); + provider.send("eth_sendTransaction", [{...tx}]); + let hash2 = await provider.once("message"); + provider.send("eth_sendTransaction", [{...tx}]); + let hash3 = await provider.once("message"); + + const changes2 = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(changes2[0], hash2.data.result); + assert.strictEqual(changes2[1], hash3.data.result); + await assertNoChanges(); + }) + }); + + describe("eth_newFilter", () => { + it("returns new logs", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + async function assertNoChanges(){ + const noChanges = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(noChanges.length, 0); + } + const filterId = await provider.send("eth_newFilter"); + const numberOfLogs = 1; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const tx = {from: accounts[0], to: contractAddress, data}; + await assertNoChanges(); + provider.send("eth_sendTransaction", [{...tx}]); + let hash = await provider.once("message"); + const changes1 = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(changes1.length, 1); + await assertNoChanges(); + provider.send("eth_sendTransaction", [{...tx}]); + let hash2 = await provider.once("message"); + provider.send("eth_sendTransaction", [{...tx}]); + let hash3 = await provider.once("message"); + + const changes2 = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(changes2.length, 2); + await assertNoChanges(); + }) + }); + + describe("eth_newFilter", () => { + it("returns new logs", async () => { + await provider.send("eth_subscribe", ["newHeads"]); + async function assertNoChanges(){ + const noChanges = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(noChanges.length, 0); + } + const currentBlockNumber = "0x" + (parseInt(await provider.send("eth_blockNumber")) + 1).toString(16); + const filterId = await provider.send("eth_newFilter", [{fromBlock: currentBlockNumber, toBlock:"0x99"}]); + const numberOfLogs = 1; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const tx = {from: accounts[0], to: contractAddress, data}; + await assertNoChanges(); + provider.send("eth_sendTransaction", [{...tx}]); + let hash = await provider.once("message"); + const changes1 = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(changes1.length, 1); + await assertNoChanges(); + provider.send("eth_sendTransaction", [{...tx}]); + let hash2 = await provider.once("message"); + provider.send("eth_sendTransaction", [{...tx}]); + let hash3 = await provider.once("message"); + + const changes2 = await provider.send("eth_getFilterChanges", [filterId]); + assert.strictEqual(changes2.length, 2); + await assertNoChanges(); + + const allChanges = await provider.send("eth_getFilterLogs", [filterId]); + assert.deepStrictEqual(allChanges, [...changes1, ...changes2]); + }) + }); }); }); }); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 05d0005bea..9c5c842539 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -45,7 +45,7 @@ type FilterArgs = {address?: string | string[], topics?: Topic[], fromBlock?: st //#endregion //#region helpers -function parseFilterDetails(filter: Pick = {address: [], topics: []}) { +function parseFilterDetails(filter: Pick) { // `filter.address` may be a single address or an array const addresses = filter.address ? (Array.isArray(filter.address) ? filter.address : [filter.address]).map(a => Address.from(a.toLowerCase()).toBuffer()) : []; const topics = filter.topics ? filter.topics : []; @@ -73,6 +73,7 @@ function parseFilterRange(filter: Pick, blo function parseFilter(filter: FilterArgs = {address: [], topics: []}, blockchain: Blockchain) { const {addresses, topics} = parseFilterDetails(filter); const {fromBlock, toBlock, toBlockNumber} = parseFilterRange(filter, blockchain); + return { addresses, fromBlock, @@ -1045,7 +1046,7 @@ export default class EthereumApi implements types.Api { const subscription = this.#getId(); const promiEvent = PromiEvent.resolve(subscription); - const { addresses, topics } = parseFilterDetails(options); + const { addresses, topics } = options ? parseFilterDetails(options) : {addresses: [], topics: []}; const unsubscribe = this.#blockchain.on("blockLogs", (blockLogs: BlockLogs) => { // TODO: move the JSON stringification closer to where the message // is actually sent to the listener @@ -1111,11 +1112,10 @@ export default class EthereumApi implements types.Api { * @returns A filter id. */ async eth_newBlockFilter() { - const updates = []; const unsubscribe = this.#blockchain.on("block", (block: Block) => { - updates.push(Data.from(block.value.hash(), 32)); + value.updates.push(Data.from(block.value.hash(), 32)); }); - const value = {updates, unsubscribe, filter: null, type: FilterTypes.block}; + const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.block}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1128,11 +1128,10 @@ export default class EthereumApi implements types.Api { * @returns A filter id. */ async eth_newPendingTransactionFilter() { - const updates = []; const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { - updates.push(Data.from(transaction.hash(), 32)); + value.updates.push(Data.from(transaction.hash(), 32)); }); - const value = {updates, unsubscribe, filter: null, type: FilterTypes.pendingTransaction}; + const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.pendingTransaction}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1143,6 +1142,11 @@ export default class EthereumApi implements types.Api { * changes (logs). To check if the state has changed, call * `eth_getFilterChanges`. * + * If the from `fromBlock` or `toBlock` option are equal to "latest" the + * filter continually append logs for whatever block is seen as latest at the + * time the block was mined, not just for the block that was "latest" when the + * filter was created. + * * ### A note on specifying topic filters: * Topics are order-dependent. A transaction with a log with topics [A, B] * will be matched by the following topic filters: @@ -1157,17 +1161,21 @@ export default class EthereumApi implements types.Api { * * @param filter The filter options */ - async eth_newFilter(filter: FilterArgs) { + async eth_newFilter(filter: FilterArgs = {}) { const blockchain = this.#blockchain; - const { addresses, topics, fromBlock, toBlock } = parseFilter(filter, blockchain); - const updates = []; + const { addresses, topics } = parseFilterDetails(filter); const unsubscribe = blockchain.on("blockLogs", (blockLogs: BlockLogs) => { const blockNumber = blockLogs.getBlockNumber(); - if (fromBlock >= blockNumber && blockNumber <= toBlock) { - updates.push(...blockLogs.filter(addresses, topics)); + // everytime we get a blockLogs message we re-check what the filter's + // range is. We do this because "latest" isn't the latest block at the + // time the filter was set up, rather it is the actual latest *mined* + // block (that is: not pending) + const {fromBlock, toBlock} = parseFilterRange(filter, blockchain); + if (fromBlock <= blockNumber && toBlock >= blockNumber) { + value.updates.push(...blockLogs.filter(addresses, topics)); } }); - const value = {updates, unsubscribe, filter, type: FilterTypes.log}; + const value = {updates: [], unsubscribe, filter, type: FilterTypes.log}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index b5be9f52e1..2d623f7f38 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -185,6 +185,7 @@ export default class Blockchain extends Emittery.Typed Date: Tue, 4 Aug 2020 14:54:45 -0700 Subject: [PATCH 398/691] npx lerna add cheerio -ED --scope=@ganache/ethereum --- src/chains/ethereum/npm-shrinkwrap.json | 111 ++++++++++++++++++++++++ src/chains/ethereum/package.json | 1 + 2 files changed, 112 insertions(+) diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 455ccf76d1..5085dfc2cc 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -203,6 +203,12 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -299,6 +305,20 @@ "functional-red-black-tree": "^1.0.1" } }, + "cheerio": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz", + "integrity": "sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==", + "dev": true, + "requires": { + "css-select": "~1.2.0", + "dom-serializer": "~0.1.1", + "entities": "~1.1.1", + "htmlparser2": "^3.9.1", + "lodash": "^4.15.0", + "parse5": "^3.0.1" + } + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -364,6 +384,24 @@ "sha.js": "^2.4.8" } }, + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "dev": true, + "requires": { + "boolbase": "~1.0.0", + "css-what": "2.1", + "domutils": "1.5.1", + "nth-check": "~1.0.1" + } + }, + "css-what": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", + "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", + "dev": true + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -411,6 +449,41 @@ } } }, + "dom-serializer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", + "dev": true, + "requires": { + "domelementtype": "^1.3.0", + "entities": "^1.1.1" + } + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, "drbg.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", @@ -478,6 +551,12 @@ } } }, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + }, "errno": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", @@ -1173,6 +1252,20 @@ "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, + "htmlparser2": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "dev": true, + "requires": { + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" + } + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", @@ -1899,6 +1992,15 @@ "validate-npm-package-license": "^3.0.1" } }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "dev": true, + "requires": { + "boolbase": "~1.0.0" + } + }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", @@ -2004,6 +2106,15 @@ "lines-and-columns": "^1.1.6" } }, + "parse5": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", + "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 1b593ec495..fe37cc55bd 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -45,6 +45,7 @@ }, "devDependencies": { "@trufflesuite/typedoc-default-themes": "0.6.1", + "cheerio": "1.0.0-rc.3", "open-cli": "6.0.1", "typedoc": "0.17.8" } From 38f4d3c32506bfc0ec96c71a71581158b186399a Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Tue, 4 Aug 2020 14:55:26 -0700 Subject: [PATCH 399/691] npx lerna add local-web-server -ED --scope=@ganache/ethereum --- src/chains/ethereum/npm-shrinkwrap.json | 1410 ++++++++++++++++++++++- src/chains/ethereum/package.json | 1 + 2 files changed, 1392 insertions(+), 19 deletions(-) diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 5085dfc2cc..fee8d29857 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -30,12 +30,27 @@ "js-tokens": "^4.0.0" } }, + "@koa/cors": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@koa/cors/-/cors-3.1.0.tgz", + "integrity": "sha512-7ulRC1da/rBa6kj6P4g2aJfnET3z8Uf3SWu60cjbtxTA5g8lxRdX/Bd2P92EagGwwAhANeNw8T8if99rJliR6Q==", + "dev": true, + "requires": { + "vary": "^1.1.2" + } + }, "@tokenizer/token": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.1.1.tgz", "integrity": "sha512-XO6INPbZCxdprl+9qa/AAbFFOMzzwqYxpjPgLICrMD6C2FCw6qfJOPcBk6JqqPLSaZ/Qx87qn4rpPmPMwaAK6w==", "dev": true }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true + }, "@trufflesuite/typedoc-default-themes": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/@trufflesuite/typedoc-default-themes/-/typedoc-default-themes-0.6.1.tgz", @@ -103,6 +118,16 @@ "@types/node": "*" } }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, "abstract-leveldown": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", @@ -118,6 +143,51 @@ } } }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "agent-base": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz", + "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==", + "dev": true, + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "ansi-escape-sequences": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-5.1.2.tgz", + "integrity": "sha512-JcpoVp1W1bl1Qn4cVuiXEhD6+dyXKSOgCn2zlzE8inYgCJCBy1aPnUhlz6I4DFum8D4ovb9Qi/iAjUcGvG2lqw==", + "dev": true, + "requires": { + "array-back": "^4.0.0" + } + }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -127,6 +197,18 @@ "color-convert": "^1.9.0" } }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "dev": true + }, + "array-back": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz", + "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", + "dev": true + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -177,6 +259,29 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, + "basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, "bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", @@ -269,6 +374,28 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, + "byte-size": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-6.2.0.tgz", + "integrity": "sha512-6EspYUCAPMc7E2rltBgKwhG+Cmk0pDm9zDtF1Awe2dczNUL3YpZ8mTs/dueOTS1hqGWBOatqef4jYMGjln7WmA==", + "dev": true + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, + "cache-content-type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", + "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", + "dev": true, + "requires": { + "mime-types": "^2.1.18", + "ylru": "^1.2.0" + } + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -328,6 +455,24 @@ "safe-buffer": "^5.0.1" } }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "co-body": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/co-body/-/co-body-6.0.0.tgz", + "integrity": "sha512-9ZIcixguuuKIptnY8yemEOuhb71L/lLf+Rl5JfJEUiDNJk0e02MBt7BPxR2GEh5mw8dPthQYR4jPI/BnS1MQgw==", + "dev": true, + "requires": { + "inflation": "^2.0.0", + "qs": "^6.5.2", + "raw-body": "^2.3.3", + "type-is": "^1.6.16" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -343,12 +488,120 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "command-line-args": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.1.1.tgz", + "integrity": "sha512-hL/eG8lrll1Qy1ezvkant+trihbGnaKaeEjj6Scyr3DN+RC7iQ5Rz84IeLERfAWDGo0HBSNAakczwgCilDXnWg==", + "dev": true, + "requires": { + "array-back": "^3.0.1", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "dependencies": { + "array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true + }, + "typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true + } + } + }, + "command-line-usage": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.0.tgz", + "integrity": "sha512-Ew1clU4pkUeo6AFVDFxCbnN7GIZfXl48HIOQeFQnkO3oOqvpI7wdqtLRwv9iOCZ/7A+z4csVZeiDdEcj8g6Wiw==", + "dev": true, + "requires": { + "array-back": "^4.0.0", + "chalk": "^2.4.2", + "table-layout": "^1.0.0", + "typical": "^5.2.0" + }, + "dependencies": { + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true + } + } + }, + "common-log-format": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/common-log-format/-/common-log-format-1.0.0.tgz", + "integrity": "sha512-fFn/WPNbsTCGTTwdCpZfVZSa5mgqMEkA0gMTRApFSlEsYN+9B2FPfiqch5FT+jsv5IV1RHV3GeZvCa7Qg+jssw==", + "dev": true + }, + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "requires": { + "mime-db": ">= 1.43.0 < 2" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "cookies": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", + "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==", + "dev": true, + "requires": { + "depd": "~2.0.0", + "keygrip": "~1.1.0" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + } + } + }, + "copy-to": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz", + "integrity": "sha1-JoD7uAaKSNCGVrYJgJK9r8kG9KU=", + "dev": true + }, "core-js-pure": { "version": "3.6.5", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", @@ -384,6 +637,12 @@ "sha.js": "^2.4.8" } }, + "create-mixin": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/create-mixin/-/create-mixin-3.0.0.tgz", + "integrity": "sha512-LkdMqnWT9LaqBN4huqpUnMz56Yr1mVSoCduAd2xXefgH/YZP2sXCMAyztXjk4q8hTF/TlcDa+zQW2aTgGdjjKQ==", + "dev": true + }, "css-select": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", @@ -402,6 +661,15 @@ "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", "dev": true }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -426,6 +694,18 @@ } } }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, "deferred-leveldown": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", @@ -449,6 +729,24 @@ } } }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, "dom-serializer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", @@ -494,6 +792,12 @@ "create-hmac": "^1.1.4" } }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, "elliptic": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", @@ -508,6 +812,12 @@ "minimalistic-crypto-utils": "^1.0.0" } }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, "encoding-down": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", @@ -609,12 +919,24 @@ "is-symbol": "^1.0.2" } }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, "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=", "dev": true }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, "eth-sig-util": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.5.3.tgz", @@ -1105,6 +1427,23 @@ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, + "find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dev": true, + "requires": { + "array-back": "^3.0.1" + }, + "dependencies": { + "array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true + } + } + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -1120,6 +1459,12 @@ "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -1266,6 +1611,116 @@ "readable-stream": "^3.1.1" } }, + "http-assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.4.1.tgz", + "integrity": "sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw==", + "dev": true, + "requires": { + "deep-equal": "~1.0.1", + "http-errors": "~1.7.2" + }, + "dependencies": { + "http-errors": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", + "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + } + } + }, + "http-errors": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", + "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + } + } + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", @@ -1282,6 +1737,12 @@ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, + "inflation": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.0.0.tgz", + "integrity": "sha1-i0F+R8KPklpFEz2RTKH9OJEH8w8=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1325,6 +1786,12 @@ "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", "dev": true }, + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==", + "dev": true + }, "is-hex-prefixed": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", @@ -1396,6 +1863,12 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, + "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=", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1405,6 +1878,12 @@ "graceful-fs": "^4.1.6" } }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, "keccak": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", @@ -1414,36 +1893,235 @@ "node-gyp-build": "^4.2.0" } }, + "keygrip": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", + "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", + "dev": true, + "requires": { + "tsscmp": "1.0.6" + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, - "level-codec": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", - "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + "koa": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/koa/-/koa-2.13.0.tgz", + "integrity": "sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ==", + "dev": true, + "requires": { + "accepts": "^1.3.5", + "cache-content-type": "^1.0.0", + "content-disposition": "~0.5.2", + "content-type": "^1.0.4", + "cookies": "~0.8.0", + "debug": "~3.1.0", + "delegates": "^1.0.0", + "depd": "^1.1.2", + "destroy": "^1.0.4", + "encodeurl": "^1.0.2", + "escape-html": "^1.0.3", + "fresh": "~0.5.2", + "http-assert": "^1.3.0", + "http-errors": "^1.6.3", + "is-generator-function": "^1.0.7", + "koa-compose": "^4.1.0", + "koa-convert": "^1.2.0", + "on-finished": "^2.3.0", + "only": "~0.0.2", + "parseurl": "^1.3.2", + "statuses": "^1.5.0", + "type-is": "^1.6.16", + "vary": "^1.1.2" + } + }, + "koa-bodyparser": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/koa-bodyparser/-/koa-bodyparser-4.3.0.tgz", + "integrity": "sha512-uyV8G29KAGwZc4q/0WUAjH+Tsmuv9ImfBUF2oZVyZtaeo0husInagyn/JH85xMSxM0hEk/mbCII5ubLDuqW/Rw==", + "dev": true, + "requires": { + "co-body": "^6.0.0", + "copy-to": "^2.0.1" + } }, - "level-concat-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" + "koa-compose": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", + "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==", + "dev": true }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "koa-compress": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/koa-compress/-/koa-compress-3.1.0.tgz", + "integrity": "sha512-0m24/yS/GbhWI+g9FqtvStY+yJwTObwoxOvPok6itVjRen7PBWkjsJ8pre76m+99YybXLKhOJ62mJ268qyBFMQ==", + "dev": true, "requires": { - "errno": "~0.1.1" + "bytes": "^3.0.0", + "compressible": "^2.0.0", + "koa-is-json": "^1.0.0", + "statuses": "^1.0.0" } }, - "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", - "requires": { - "inherits": "^2.0.1", + "koa-conditional-get": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/koa-conditional-get/-/koa-conditional-get-2.0.0.tgz", + "integrity": "sha1-pD83I8HQFLcwo07Oit8wuTyCM/I=", + "dev": true + }, + "koa-convert": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz", + "integrity": "sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA=", + "dev": true, + "requires": { + "co": "^4.6.0", + "koa-compose": "^3.0.0" + }, + "dependencies": { + "koa-compose": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz", + "integrity": "sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec=", + "dev": true, + "requires": { + "any-promise": "^1.1.0" + } + } + } + }, + "koa-etag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/koa-etag/-/koa-etag-3.0.0.tgz", + "integrity": "sha1-nvc4Ld1agqsN6xU0FckVg293HT8=", + "dev": true, + "requires": { + "etag": "^1.3.0", + "mz": "^2.1.0" + } + }, + "koa-is-json": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/koa-is-json/-/koa-is-json-1.0.0.tgz", + "integrity": "sha1-JzwH7c3Ljfaiwat9We52SRRR7BQ=", + "dev": true + }, + "koa-json": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/koa-json/-/koa-json-2.0.2.tgz", + "integrity": "sha1-Nq8U5uofXWRtfESihXAcb4Wk/eQ=", + "dev": true, + "requires": { + "koa-is-json": "1", + "streaming-json-stringify": "3" + } + }, + "koa-morgan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/koa-morgan/-/koa-morgan-1.0.1.tgz", + "integrity": "sha1-CAUuDODYOdPEMXi5CluzQkvvH5k=", + "dev": true, + "requires": { + "morgan": "^1.6.1" + } + }, + "koa-range": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/koa-range/-/koa-range-0.3.0.tgz", + "integrity": "sha1-NYjjSWRzqDmhvSZNKkKx2FvX/qw=", + "dev": true, + "requires": { + "stream-slice": "^0.1.2" + } + }, + "koa-route": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/koa-route/-/koa-route-3.2.0.tgz", + "integrity": "sha1-dimLmaa8+p44yrb+XHmocz51i84=", + "dev": true, + "requires": { + "debug": "*", + "methods": "~1.1.0", + "path-to-regexp": "^1.2.0" + }, + "dependencies": { + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "requires": { + "isarray": "0.0.1" + } + } + } + }, + "koa-send": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz", + "integrity": "sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "http-errors": "^1.7.3", + "resolve-path": "^1.4.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "koa-static": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/koa-static/-/koa-static-5.0.0.tgz", + "integrity": "sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "koa-send": "^5.0.0" + } + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + }, + "level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "^2.0.1", "level-errors": "^1.0.3", "readable-stream": "^1.0.33", "xtend": "^4.0.0" @@ -1719,6 +2397,40 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "load-module": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/load-module/-/load-module-3.0.0.tgz", + "integrity": "sha512-ZqprfrTx4vfH5+1mgpspPh5JYsNyA193NkMUdb3GwpmVqMczOh8cUDJgZBmEZVlSR42JBGYTUxlBAX9LHIBtIA==", + "dev": true, + "requires": { + "array-back": "^4.0.1" + } + }, + "local-web-server": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/local-web-server/-/local-web-server-4.2.1.tgz", + "integrity": "sha512-v71LZool2w7uYA+tDP5HhfjzUxz5SFfcrPPB/zC98yFFawt7A6fcmAr2MR4Q9AHk/A8oyd/wrhEJBJLndwHxNQ==", + "dev": true, + "requires": { + "lws": "^3.1.0", + "lws-basic-auth": "^2.0.0", + "lws-blacklist": "^3.0.0", + "lws-body-parser": "^2.0.0", + "lws-compress": "^2.0.0", + "lws-conditional-get": "^2.0.0", + "lws-cors": "^3.0.0", + "lws-index": "^2.0.0", + "lws-json": "^2.0.0", + "lws-log": "^2.0.0", + "lws-mime": "^2.0.0", + "lws-range": "^3.0.0", + "lws-request-monitor": "^2.0.0", + "lws-rewrite": "^3.1.1", + "lws-spa": "^3.0.0", + "lws-static": "^2.0.0", + "node-version-matches": "^2.0.1" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -1733,6 +2445,24 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==" }, + "lodash.assignwith": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", + "integrity": "sha1-EnqX8CrcQXUalU0ksN4X4QDgOOs=", + "dev": true + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, + "lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=", + "dev": true + }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -1752,6 +2482,168 @@ "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", "dev": true }, + "lws": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lws/-/lws-3.1.0.tgz", + "integrity": "sha512-I8rTgZxz8OJL0hjdlDxs6WpcVG7WSyalVHPQXXK+WPNVjm3KhkT5gV0Qmsgm2FRLbRUp15tso80xmDxMsyt7zA==", + "dev": true, + "requires": { + "ansi-escape-sequences": "^5.1.2", + "array-back": "^4.0.1", + "byte-size": "^6.2.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^6.1.0", + "create-mixin": "^3.0.0", + "koa": "^2.11.0", + "load-module": "^3.0.0", + "lodash.assignwith": "^4.2.0", + "node-version-matches": "^2.0.1", + "open": "^7.0.4", + "qrcode-terminal": "^0.12.0", + "reduce-flatten": "^3.0.0", + "typical": "^6.0.0", + "walk-back": "^4.0.0" + } + }, + "lws-basic-auth": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-basic-auth/-/lws-basic-auth-2.0.0.tgz", + "integrity": "sha512-zzyoGFLQPuKaQJvHMLmmSyfT6lIvocwcDXllTVW5brD0t0YgHYopILkzja+x+MIlJX/YhNKniaTSasujniYVjw==", + "dev": true, + "requires": { + "basic-auth": "^2.0.1" + } + }, + "lws-blacklist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lws-blacklist/-/lws-blacklist-3.0.0.tgz", + "integrity": "sha512-KNXGDBmbj+UGfWMBAefe2vrfuWpEQms/9Fd7kfMScTqAKF6nrVoEs4pkxfefArG3bX0bu7jWLyB4tJGma5WC6Q==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "path-to-regexp": "^6.1.0" + } + }, + "lws-body-parser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-body-parser/-/lws-body-parser-2.0.0.tgz", + "integrity": "sha512-QFDzln3sSdKWL9fVNWy2+ZmrKy/XaYRO0/FFB0MBrDCsNnzepeCD4I7rOOfyuphLn42yR8XUpWdcJ3Ii5aauRA==", + "dev": true, + "requires": { + "koa-bodyparser": "^4.2.1" + } + }, + "lws-compress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-compress/-/lws-compress-2.0.0.tgz", + "integrity": "sha512-5qDXI9pukVYWm07WjAOfpItLXKtL8lCHvjmW4RiXULhTRJj1qqBjNcmqReyk8L7NLUKhc+8eqoDDJFKURQEp0w==", + "dev": true, + "requires": { + "koa-compress": "^3.0.0" + } + }, + "lws-conditional-get": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-conditional-get/-/lws-conditional-get-2.0.0.tgz", + "integrity": "sha512-U05yDlFJKIYa7gJZYfnc1HIEuXbKpDJztgkvNYyxCqJC28j/k9ORoNnFNOIHpBh/jlPJgV8x7uH34mIxFAryWA==", + "dev": true, + "requires": { + "koa-conditional-get": "^2.0.0", + "koa-etag": "^3.0.0" + } + }, + "lws-cors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lws-cors/-/lws-cors-3.0.0.tgz", + "integrity": "sha512-diUkoyVZyzLB8LamdtUYYAfJdPAyu/+IjE3ZUcdnNQz9koECe4O2x3SWD7LSV43pd3CKgyiwwSxWJ4hTBZFIvQ==", + "dev": true, + "requires": { + "@koa/cors": "^3.0.0" + } + }, + "lws-index": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-index/-/lws-index-2.0.0.tgz", + "integrity": "sha512-qfkeQmKYnd13LmQubzI5LtFV2N8PJQG4QvgSoefoiB3dWre9k2T4C7ajjOTKO8mgSzYpUEREduNcQcLyt62n0g==", + "dev": true, + "requires": { + "serve-index-75lb": "^2.0.1" + } + }, + "lws-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-json/-/lws-json-2.0.0.tgz", + "integrity": "sha512-vqUFrAQ5BGpkMS2Mm/ZhgvUMi6Tgia7YtESG7pKjNoiSsD+TxncG0nqp8YjUh2xrEzi/SYFc/ed+9ZOl/t0A0g==", + "dev": true, + "requires": { + "koa-json": "^2.0.2" + } + }, + "lws-log": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-log/-/lws-log-2.0.0.tgz", + "integrity": "sha512-YveoazSZ0Qb1Tljdm8G8yn9c+mAMXgvLMACZzh5aZIk7p8YJwiXf9r1S+xY7wbXEcKG629KfVO0B5G5gRFcyDQ==", + "dev": true, + "requires": { + "koa-morgan": "^1.0.1", + "stream-log-stats": "^3.0.2" + } + }, + "lws-mime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-mime/-/lws-mime-2.0.0.tgz", + "integrity": "sha512-mfrAgRQ5+hkQ7LJ6EAgwnUeymNeYxwLXZY3UQ6C2hSTr7BqMSzm9k5O0C8wWP2dzdhChzITYKwzWbUnAYVBwtA==", + "dev": true + }, + "lws-range": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lws-range/-/lws-range-3.0.0.tgz", + "integrity": "sha512-7ZhA/LqQnKjolKBo/2BFj9DyDDXcJGY3v05TwYRD0qDGrxW4vuatEjluC3SV7ZO/k4PxDLdxuk+RCgL5t3ThtQ==", + "dev": true, + "requires": { + "koa-range": "^0.3.0" + } + }, + "lws-request-monitor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-request-monitor/-/lws-request-monitor-2.0.0.tgz", + "integrity": "sha512-ZTo0/pS42qiejcYlL+wlpurSbDSS0J7pDDohqBx7jjUQkgni2Qd8cPzn/kW8QI82gXgDmdZH+ps0vheLHlgdgg==", + "dev": true, + "requires": { + "byte-size": "^6.2.0" + } + }, + "lws-rewrite": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lws-rewrite/-/lws-rewrite-3.1.1.tgz", + "integrity": "sha512-cOeaPXIlLUVLxS6BZ52QzZVzI8JjCzlWD4RWizB5Hd+0YGO0SPa3Vgk7CIghtAOsSdjtXg/wSOap2H1h+tw8BQ==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "koa-route": "^3.2.0", + "path-to-regexp": "^6.1.0" + } + }, + "lws-spa": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lws-spa/-/lws-spa-3.0.0.tgz", + "integrity": "sha512-Tz10LfuOTUsRG6z+OCJ/vBN+4LQWoAGIJ1R02CFPrDk0pY3rHezM7/cCpq6Z6dXD+ipdNE8alkVn4zL2M+eVGg==", + "dev": true, + "requires": { + "koa-send": "^5.0.0" + } + }, + "lws-static": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-static/-/lws-static-2.0.0.tgz", + "integrity": "sha512-P25A0+IXdkB6Y6gZAG7X0mnaa+FJ8aTiWLUgM5kazaWmruRO7lyhSjitsA3y5TLI3DpPCZn0mWE4SRREujUZLg==", + "dev": true, + "requires": { + "koa-static": "^5.0.0" + } + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -1791,6 +2683,12 @@ "safe-buffer": "^5.1.2" } }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, "memdown": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", @@ -1908,6 +2806,12 @@ } } }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", @@ -1917,6 +2821,21 @@ "brorand": "^1.0.1" } }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, "min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -1959,11 +2878,64 @@ "kind-of": "^6.0.3" } }, + "morgan": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "dev": true, + "requires": { + "basic-auth": "~2.0.1", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-finished": "~2.3.0", + "on-headers": "~1.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "nan": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -1980,6 +2952,23 @@ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" }, + "node-version-matches": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-version-matches/-/node-version-matches-2.0.1.tgz", + "integrity": "sha512-oqk6+05FC0dNVY5NuXuhPEMq+m1b9ZjS9SIhVE9EjwCHZspnmjSO8npbKAEieinR8GeEgbecoQcYIvI/Kwcf6Q==", + "dev": true, + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -2001,6 +2990,12 @@ "boolbase": "~1.0.0" } }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", @@ -2038,6 +3033,21 @@ "es-abstract": "^1.17.0-next.1" } }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2047,6 +3057,12 @@ "wrappy": "1" } }, + "only": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", + "integrity": "sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q=", + "dev": true + }, "open": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/open/-/open-7.1.0.tgz", @@ -2115,6 +3131,12 @@ "@types/node": "*" } }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2133,6 +3155,12 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-to-regexp": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.1.0.tgz", + "integrity": "sha512-h9DqehX3zZZDCEm+xbfU0ZmwCGFCAAraPJWMXJ4+v32NjZJilVg3k1TcKsRgIb8IQ/izZSaydDc1OhJCZvs2Dw==", + "dev": true + }, "pbkdf2": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", @@ -2167,6 +3195,18 @@ "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, + "qrcode-terminal": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz", + "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==", + "dev": true + }, + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "dev": true + }, "quick-lru": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", @@ -2181,6 +3221,33 @@ "safe-buffer": "^5.1.0" } }, + "raw-body": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz", + "integrity": "sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.3", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "dependencies": { + "http-errors": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", + "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + } + } + }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -2255,6 +3322,12 @@ "strip-indent": "^3.0.0" } }, + "reduce-flatten": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.0.tgz", + "integrity": "sha512-eczl8wAYBxJ6Egl6I1ECIF+8z6sHu+KE7BzaEDZTpPXKXfy9SUDQlVYwkRcNTjJLC3Iakxbhss50KuT/R6SYfg==", + "dev": true + }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -2264,6 +3337,42 @@ "path-parse": "^1.0.6" } }, + "resolve-path": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz", + "integrity": "sha1-xL2p9e+y/OZSR4c6s2u02DT+Fvc=", + "dev": true, + "requires": { + "http-errors": "~1.6.2", + "path-is-absolute": "1.0.1" + }, + "dependencies": { + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + } + } + }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -2291,6 +3400,12 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", @@ -2316,11 +3431,67 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, + "serve-index-75lb": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/serve-index-75lb/-/serve-index-75lb-2.0.1.tgz", + "integrity": "sha512-/d9r8bqJlFQcwy0a0nb1KnWAA+Mno+V+VaoKocdkbW5aXKRQd/+4bfnRhQRQr6uEoYwTRJ4xgztOyCJvWcpBpQ==", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.18", + "parseurl": "~1.3.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + } + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, "sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", @@ -2379,6 +3550,87 @@ "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, + "stream-log-stats": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/stream-log-stats/-/stream-log-stats-3.0.2.tgz", + "integrity": "sha512-393j7aeF9iRdHvyANqEQU82UQmpw2CTxgsT83caefh+lOxavVLbVrw8Mr4zjXeZLh2+xeHZMKfVx4T0rJ/EchA==", + "dev": true, + "requires": { + "JSONStream": "^1.3.5", + "ansi-escape-sequences": "^5.1.2", + "byte-size": "^6.2.0", + "common-log-format": "^1.0.0", + "lodash.throttle": "^4.1.1", + "stream-via": "^1.0.4", + "table-layout": "~1.0.0" + } + }, + "stream-slice": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/stream-slice/-/stream-slice-0.1.2.tgz", + "integrity": "sha1-LcT04bk2+xPz6zmi3vGTJ5jQeks=", + "dev": true + }, + "stream-via": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/stream-via/-/stream-via-1.0.4.tgz", + "integrity": "sha512-DBp0lSvX5G9KGRDTkR/R+a29H+Wk2xItOF+MpZLLNDWbEV9tGPnqLPxHEYjmiz8xGtJHRIqmI+hCjmNzqoA4nQ==", + "dev": true + }, + "streaming-json-stringify": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/streaming-json-stringify/-/streaming-json-stringify-3.1.0.tgz", + "integrity": "sha1-gCAEN6mTzDnE/gAmO3s7kDrIevU=", + "dev": true, + "requires": { + "json-stringify-safe": "5", + "readable-stream": "2" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "string.prototype.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", @@ -2442,6 +3694,26 @@ "has-flag": "^3.0.0" } }, + "table-layout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.1.tgz", + "integrity": "sha512-dEquqYNJiGwY7iPfZ3wbXDI944iqanTSchrACLL2nOB+1r+h1Nzu2eH+DuPPvWvm5Ry7iAPeFlgEtP5bIp5U7Q==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "dependencies": { + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true + } + } + }, "temp-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", @@ -2461,6 +3733,36 @@ "uuid": "^3.3.2" } }, + "thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "dev": true, + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, "token-types": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/token-types/-/token-types-2.0.0.tgz", @@ -2477,6 +3779,12 @@ "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", "dev": true }, + "tsscmp": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", + "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", + "dev": true + }, "tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -2493,6 +3801,16 @@ "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "dev": true }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -2529,6 +3847,12 @@ "lunr": "^2.3.8" } }, + "typical": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-6.0.1.tgz", + "integrity": "sha512-+g3NEp7fJLe9DPa1TArHm9QAA7YciZmWnfAqEaFrBihQ7epOv9i99rjtgb6Iz0wh3WuQDjsCTDfgRoGnmHN81A==", + "dev": true + }, "uglify-js": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", @@ -2548,6 +3872,12 @@ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -2580,12 +3910,48 @@ "spdx-expression-parse": "^3.0.0" } }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, + "walk-back": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-4.0.0.tgz", + "integrity": "sha512-kudCA8PXVQfrqv2mFTG72vDBRi8BKWxGgFLwPpzHcpZnSwZk93WMwUDVcLHWNsnm+Y0AC4Vb6MUNRgaHfyV2DQ==", + "dev": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "wordwrapjs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", + "integrity": "sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ==", + "dev": true, + "requires": { + "reduce-flatten": "^2.0.0", + "typical": "^5.0.0" + }, + "dependencies": { + "reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true + }, + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -2614,6 +3980,12 @@ "camelcase": "^5.0.0", "decamelize": "^1.2.0" } + }, + "ylru": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.2.1.tgz", + "integrity": "sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ==", + "dev": true } } } diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index fe37cc55bd..d5c5db0031 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -46,6 +46,7 @@ "devDependencies": { "@trufflesuite/typedoc-default-themes": "0.6.1", "cheerio": "1.0.0-rc.3", + "local-web-server": "4.2.1", "open-cli": "6.0.1", "typedoc": "0.17.8" } From b1d50dcb2da4e3edb210814213f6bdbf7a49291c Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Tue, 4 Aug 2020 14:56:19 -0700 Subject: [PATCH 400/691] add initial post-process-docs script for @ganache/ethereum --- src/chains/ethereum/scripts/post-process-docs.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/chains/ethereum/scripts/post-process-docs.js diff --git a/src/chains/ethereum/scripts/post-process-docs.js b/src/chains/ethereum/scripts/post-process-docs.js new file mode 100644 index 0000000000..7287c32203 --- /dev/null +++ b/src/chains/ethereum/scripts/post-process-docs.js @@ -0,0 +1,16 @@ +const cheerio = require('cheerio'); +const { readFileSync, writeFileSync } = require("fs"); +const { randomBytes } = require('crypto'); +const $ = cheerio.load(readFileSync("./lib/docs/classes/_api_.ethereumapi.html")); + +$(`.tsd-page-title`).after(``) + +$('.runkit-example').each(function() { + const sanitizedCode = $(this).text().replace(/;(\s+)/gi, ";\n").trim(); + $(this).text("") + const id = randomBytes(4).toString('hex'); + $(this).attr("id", id).html() + $(this).prepend(``) + }); + +writeFileSync("./lib/docs/classes/_api_.ethereumapi.html", $.html()) From 340045e3920d1799bbd9f4318bce83b05cc81bd5 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Tue, 4 Aug 2020 14:59:29 -0700 Subject: [PATCH 401/691] draft: rework ethereum/src/api example doc code and wrap within div class --- src/chains/ethereum/src/api.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 9c5c842539..49108d3655 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -265,13 +265,13 @@ export default class EthereumApi implements types.Api { * @returns `true` if a snapshot was reverted, otherwise `false` * * @example - * ```typescript + *
* const snapshotId = await provider.send("evm_snapshot"); * const isReverted = await provider.send("evm_revert", [snapshotId]); - * ``` + *
* * @example - * ```typescript + *
* const provider = ganache.provider(); * const [from, to] = await provider.send("eth_accounts"); * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); @@ -294,7 +294,7 @@ export default class EthereumApi implements types.Api { * * const endingBalance = await provider.send("eth_getBalance", [from]); * assert.strictEqual(BigInt(endingBalance), startingBalance); - * ``` + *
*/ async evm_revert(snapshotId: string | number) { return this.#blockchain.revert(Quantity.from(snapshotId)); @@ -310,12 +310,12 @@ export default class EthereumApi implements types.Api { * @returns The hex-encoded identifier for this snapshot * * @example - * ```typescript + *
* const snapshotId = await provider.send("evm_snapshot"); - * ``` + *
* * @example - * ```typescript + *
* const provider = ganache.provider(); * const [from, to] = await provider.send("eth_accounts"); * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); @@ -338,7 +338,7 @@ export default class EthereumApi implements types.Api { * * const endingBalance = await provider.send("eth_getBalance", [from]); * assert.strictEqual(BigInt(endingBalance), startingBalance); - * ``` + *
*/ async evm_snapshot() { return Quantity.from(this.#blockchain.snapshot()); From ef1b828acd6b762e62d760497126515a0f3cac96 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Tue, 4 Aug 2020 15:01:00 -0700 Subject: [PATCH 402/691] @ganache/ethereum: wire up post-process step to run after build:docs, serve docs using local-web-server --- src/chains/ethereum/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index d5c5db0031..598c448349 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -23,8 +23,9 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts", - "preview:docs": "open-cli ./lib/docs/index.html", + "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run post-process:docs", + "post-process:docs": "node ./scripts/post-process-docs.js", + "preview:docs": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" From c941d9a2237a778c94e597e72c3b38de7d7be866 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 6 Aug 2020 08:19:19 -0700 Subject: [PATCH 403/691] npx lerna add cheerio -ED --scope=@ganache/tezos --- src/chains/tezos/npm-shrinkwrap.json | 149 +++++++++++++++++++++++++++ src/chains/tezos/package.json | 1 + 2 files changed, 150 insertions(+) diff --git a/src/chains/tezos/npm-shrinkwrap.json b/src/chains/tezos/npm-shrinkwrap.json index 61425df479..5eb0194d20 100644 --- a/src/chains/tezos/npm-shrinkwrap.json +++ b/src/chains/tezos/npm-shrinkwrap.json @@ -60,6 +60,12 @@ "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", "dev": true }, + "@types/node": { + "version": "14.0.27", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.27.tgz", + "integrity": "sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==", + "dev": true + }, "@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -96,6 +102,12 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -134,6 +146,20 @@ "supports-color": "^5.3.0" } }, + "cheerio": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.3.tgz", + "integrity": "sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA==", + "dev": true, + "requires": { + "css-select": "~1.2.0", + "dom-serializer": "~0.1.1", + "entities": "~1.1.1", + "htmlparser2": "^3.9.1", + "lodash": "^4.15.0", + "parse5": "^3.0.1" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -155,6 +181,24 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "dev": true, + "requires": { + "boolbase": "~1.0.0", + "css-what": "2.1", + "domutils": "1.5.1", + "nth-check": "~1.0.1" + } + }, + "css-what": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", + "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", + "dev": true + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -179,6 +223,47 @@ } } }, + "dom-serializer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", + "dev": true, + "requires": { + "domelementtype": "^1.3.0", + "entities": "^1.1.1" + } + }, + "domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -296,6 +381,20 @@ "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, + "htmlparser2": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "dev": true, + "requires": { + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" + } + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", @@ -527,6 +626,15 @@ "validate-npm-package-license": "^3.0.1" } }, + "nth-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", + "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", + "dev": true, + "requires": { + "boolbase": "~1.0.0" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -595,6 +703,15 @@ "lines-and-columns": "^1.1.6" } }, + "parse5": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", + "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -670,6 +787,17 @@ } } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "readable-web-to-node-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-2.0.0.tgz", @@ -704,6 +832,12 @@ "path-parse": "^1.0.6" } }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -759,6 +893,15 @@ "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, "strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -884,6 +1027,12 @@ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 859978d45a..a3d3c5dc76 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -36,6 +36,7 @@ }, "devDependencies": { "@trufflesuite/typedoc-default-themes": "0.6.1", + "cheerio": "1.0.0-rc.3", "open-cli": "6.0.1", "typedoc": "0.17.8" } From 33b29914fb84baa3bde458d68bf59872887659f5 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 6 Aug 2020 08:23:40 -0700 Subject: [PATCH 404/691] swap out open-cli for local-web-server in @ganache/tezos --- src/chains/tezos/npm-shrinkwrap.json | 1732 +++++++++++++++++++------- src/chains/tezos/package.json | 2 +- 2 files changed, 1290 insertions(+), 444 deletions(-) diff --git a/src/chains/tezos/npm-shrinkwrap.json b/src/chains/tezos/npm-shrinkwrap.json index 5eb0194d20..94b695f171 100644 --- a/src/chains/tezos/npm-shrinkwrap.json +++ b/src/chains/tezos/npm-shrinkwrap.json @@ -4,36 +4,19 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "@koa/cors": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@koa/cors/-/cors-3.1.0.tgz", + "integrity": "sha512-7ulRC1da/rBa6kj6P4g2aJfnET3z8Uf3SWu60cjbtxTA5g8lxRdX/Bd2P92EagGwwAhANeNw8T8if99rJliR6Q==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "vary": "^1.1.2" } }, - "@tokenizer/token": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.1.1.tgz", - "integrity": "sha512-XO6INPbZCxdprl+9qa/AAbFFOMzzwqYxpjPgLICrMD6C2FCw6qfJOPcBk6JqqPLSaZ/Qx87qn4rpPmPMwaAK6w==", + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true }, "@trufflesuite/typedoc-default-themes": { @@ -48,29 +31,66 @@ "underscore": "^1.9.1" } }, - "@types/debug": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", - "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", - "dev": true - }, - "@types/minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", - "dev": true - }, "@types/node": { "version": "14.0.27", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.27.tgz", "integrity": "sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==", "dev": true }, - "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", - "dev": true + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "agent-base": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz", + "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==", + "dev": true, + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "ansi-escape-sequences": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-5.1.2.tgz", + "integrity": "sha512-JcpoVp1W1bl1Qn4cVuiXEhD6+dyXKSOgCn2zlzE8inYgCJCBy1aPnUhlz6I4DFum8D4ovb9Qi/iAjUcGvG2lqw==", + "dev": true, + "requires": { + "array-back": "^4.0.0" + } }, "ansi-styles": { "version": "3.2.1", @@ -81,10 +101,16 @@ "color-convert": "^1.9.0" } }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "dev": true + }, + "array-back": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz", + "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", "dev": true }, "backbone": { @@ -102,6 +128,29 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, "boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -118,21 +167,26 @@ "concat-map": "0.0.1" } }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "byte-size": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-6.2.0.tgz", + "integrity": "sha512-6EspYUCAPMc7E2rltBgKwhG+Cmk0pDm9zDtF1Awe2dczNUL3YpZ8mTs/dueOTS1hqGWBOatqef4jYMGjln7WmA==", + "dev": true + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", "dev": true }, - "camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "cache-content-type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", + "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", "dev": true, "requires": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" + "mime-types": "^2.1.18", + "ylru": "^1.2.0" } }, "chalk": { @@ -160,6 +214,24 @@ "parse5": "^3.0.1" } }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "co-body": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/co-body/-/co-body-6.0.0.tgz", + "integrity": "sha512-9ZIcixguuuKIptnY8yemEOuhb71L/lLf+Rl5JfJEUiDNJk0e02MBt7BPxR2GEh5mw8dPthQYR4jPI/BnS1MQgw==", + "dev": true, + "requires": { + "inflation": "^2.0.0", + "qs": "^6.5.2", + "raw-body": "^2.3.3", + "type-is": "^1.6.16" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -175,12 +247,132 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "command-line-args": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.1.1.tgz", + "integrity": "sha512-hL/eG8lrll1Qy1ezvkant+trihbGnaKaeEjj6Scyr3DN+RC7iQ5Rz84IeLERfAWDGo0HBSNAakczwgCilDXnWg==", + "dev": true, + "requires": { + "array-back": "^3.0.1", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "dependencies": { + "array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true + }, + "typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true + } + } + }, + "command-line-usage": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.0.tgz", + "integrity": "sha512-Ew1clU4pkUeo6AFVDFxCbnN7GIZfXl48HIOQeFQnkO3oOqvpI7wdqtLRwv9iOCZ/7A+z4csVZeiDdEcj8g6Wiw==", + "dev": true, + "requires": { + "array-back": "^4.0.0", + "chalk": "^2.4.2", + "table-layout": "^1.0.0", + "typical": "^5.2.0" + }, + "dependencies": { + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true + } + } + }, + "common-log-format": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/common-log-format/-/common-log-format-1.0.0.tgz", + "integrity": "sha512-fFn/WPNbsTCGTTwdCpZfVZSa5mgqMEkA0gMTRApFSlEsYN+9B2FPfiqch5FT+jsv5IV1RHV3GeZvCa7Qg+jssw==", + "dev": true + }, + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "requires": { + "mime-db": ">= 1.43.0 < 2" + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "cookies": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", + "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==", + "dev": true, + "requires": { + "depd": "~2.0.0", + "keygrip": "~1.1.0" + }, + "dependencies": { + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + } + } + }, + "copy-to": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz", + "integrity": "sha1-JoD7uAaKSNCGVrYJgJK9r8kG9KU=", + "dev": true + }, + "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=", + "dev": true + }, + "create-mixin": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/create-mixin/-/create-mixin-3.0.0.tgz", + "integrity": "sha512-LkdMqnWT9LaqBN4huqpUnMz56Yr1mVSoCduAd2xXefgH/YZP2sXCMAyztXjk4q8hTF/TlcDa+zQW2aTgGdjjKQ==", + "dev": true + }, "css-select": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", @@ -199,30 +391,45 @@ "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", "dev": true }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - } + "ms": "2.0.0" } }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, "dom-serializer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", @@ -258,20 +465,29 @@ "domelementtype": "1" } }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, "entities": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", "dev": true }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true }, "escape-string-regexp": { "version": "1.0.5", @@ -279,28 +495,35 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "file-type": { - "version": "14.6.2", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-14.6.2.tgz", - "integrity": "sha512-kSZTAJxPXBdBgJyoC7TexkBWoMI/D1Gas6aTtAn9VIRFwCehwiluGV5O8O2GwqO5zIqeEvXxEKl/xfcaAKB0Yg==", - "dev": true, - "requires": { - "readable-web-to-node-stream": "^2.0.0", - "strtok3": "^6.0.3", - "token-types": "^2.0.0", - "typedarray-to-buffer": "^3.1.5" - } + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", "dev": true, "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "array-back": "^3.0.1" + }, + "dependencies": { + "array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true + } } }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -318,12 +541,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "get-stdin": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", - "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", - "dev": true - }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -357,12 +574,6 @@ "wordwrap": "^1.0.0" } }, - "hard-rejection": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "dev": true - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -375,12 +586,6 @@ "integrity": "sha512-Q39v/Mn5mfBlMff9r+zzA+gWxRsCRKwEMvYTiisLr/XUiFI/4puWt0Ojdko3R3JCNWGdOWaA5g/Yxqa23kC5AA==", "dev": true }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "htmlparser2": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", @@ -395,16 +600,120 @@ "readable-stream": "^3.1.1" } }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true + "http-assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.4.1.tgz", + "integrity": "sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw==", + "dev": true, + "requires": { + "deep-equal": "~1.0.1", + "http-errors": "~1.7.2" + }, + "dependencies": { + "http-errors": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", + "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + } + } }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "http-errors": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz", + "integrity": "sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + } + } + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inflation": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.0.0.tgz", + "integrity": "sha1-i0F+R8KPklpFEz2RTKH9OJEH8w8=", "dev": true }, "inflight": { @@ -429,34 +738,16 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, "is-docker": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.0.0.tgz", "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", "dev": true }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==", "dev": true }, "is-wsl": { @@ -468,22 +759,22 @@ "is-docker": "^2.0.0" } }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "jquery": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz", "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==", "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "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=", "dev": true }, "jsonfile": { @@ -495,93 +786,476 @@ "graceful-fs": "^4.1.6" } }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true + "keygrip": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", + "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", + "dev": true, + "requires": { + "tsscmp": "1.0.6" + } }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "koa": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/koa/-/koa-2.13.0.tgz", + "integrity": "sha512-i/XJVOfPw7npbMv67+bOeXr3gPqOAw6uh5wFyNs3QvJ47tUx3M3V9rIE0//WytY42MKz4l/MXKyGkQ2LQTfLUQ==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "accepts": "^1.3.5", + "cache-content-type": "^1.0.0", + "content-disposition": "~0.5.2", + "content-type": "^1.0.4", + "cookies": "~0.8.0", + "debug": "~3.1.0", + "delegates": "^1.0.0", + "depd": "^1.1.2", + "destroy": "^1.0.4", + "encodeurl": "^1.0.2", + "escape-html": "^1.0.3", + "fresh": "~0.5.2", + "http-assert": "^1.3.0", + "http-errors": "^1.6.3", + "is-generator-function": "^1.0.7", + "koa-compose": "^4.1.0", + "koa-convert": "^1.2.0", + "on-finished": "^2.3.0", + "only": "~0.0.2", + "parseurl": "^1.3.2", + "statuses": "^1.5.0", + "type-is": "^1.6.16", + "vary": "^1.1.2" } }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true + "koa-bodyparser": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/koa-bodyparser/-/koa-bodyparser-4.3.0.tgz", + "integrity": "sha512-uyV8G29KAGwZc4q/0WUAjH+Tsmuv9ImfBUF2oZVyZtaeo0husInagyn/JH85xMSxM0hEk/mbCII5ubLDuqW/Rw==", + "dev": true, + "requires": { + "co-body": "^6.0.0", + "copy-to": "^2.0.1" + } }, - "lunr": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz", - "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", + "koa-compose": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", + "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==", "dev": true }, - "make-dir": { + "koa-compress": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "resolved": "https://registry.npmjs.org/koa-compress/-/koa-compress-3.1.0.tgz", + "integrity": "sha512-0m24/yS/GbhWI+g9FqtvStY+yJwTObwoxOvPok6itVjRen7PBWkjsJ8pre76m+99YybXLKhOJ62mJ268qyBFMQ==", + "dev": true, + "requires": { + "bytes": "^3.0.0", + "compressible": "^2.0.0", + "koa-is-json": "^1.0.0", + "statuses": "^1.0.0" + } + }, + "koa-conditional-get": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/koa-conditional-get/-/koa-conditional-get-2.0.0.tgz", + "integrity": "sha1-pD83I8HQFLcwo07Oit8wuTyCM/I=", + "dev": true + }, + "koa-convert": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz", + "integrity": "sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA=", "dev": true, "requires": { - "semver": "^6.0.0" + "co": "^4.6.0", + "koa-compose": "^3.0.0" }, "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "koa-compose": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz", + "integrity": "sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec=", + "dev": true, + "requires": { + "any-promise": "^1.1.0" + } } } }, - "map-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", - "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", - "dev": true + "koa-etag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/koa-etag/-/koa-etag-3.0.0.tgz", + "integrity": "sha1-nvc4Ld1agqsN6xU0FckVg293HT8=", + "dev": true, + "requires": { + "etag": "^1.3.0", + "mz": "^2.1.0" + } }, - "marked": { + "koa-is-json": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", - "integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==", + "resolved": "https://registry.npmjs.org/koa-is-json/-/koa-is-json-1.0.0.tgz", + "integrity": "sha1-JzwH7c3Ljfaiwat9We52SRRR7BQ=", "dev": true }, - "meow": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", - "integrity": "sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==", + "koa-json": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/koa-json/-/koa-json-2.0.2.tgz", + "integrity": "sha1-Nq8U5uofXWRtfESihXAcb4Wk/eQ=", "dev": true, "requires": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "^4.0.2", - "normalize-package-data": "^2.5.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.13.1", - "yargs-parser": "^18.1.3" + "koa-is-json": "1", + "streaming-json-stringify": "3" } }, - "min-indent": { + "koa-morgan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true - }, + "resolved": "https://registry.npmjs.org/koa-morgan/-/koa-morgan-1.0.1.tgz", + "integrity": "sha1-CAUuDODYOdPEMXi5CluzQkvvH5k=", + "dev": true, + "requires": { + "morgan": "^1.6.1" + } + }, + "koa-range": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/koa-range/-/koa-range-0.3.0.tgz", + "integrity": "sha1-NYjjSWRzqDmhvSZNKkKx2FvX/qw=", + "dev": true, + "requires": { + "stream-slice": "^0.1.2" + } + }, + "koa-route": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/koa-route/-/koa-route-3.2.0.tgz", + "integrity": "sha1-dimLmaa8+p44yrb+XHmocz51i84=", + "dev": true, + "requires": { + "debug": "*", + "methods": "~1.1.0", + "path-to-regexp": "^1.2.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "requires": { + "isarray": "0.0.1" + } + } + } + }, + "koa-send": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz", + "integrity": "sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "http-errors": "^1.7.3", + "resolve-path": "^1.4.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "koa-static": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/koa-static/-/koa-static-5.0.0.tgz", + "integrity": "sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "koa-send": "^5.0.0" + } + }, + "load-module": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/load-module/-/load-module-3.0.0.tgz", + "integrity": "sha512-ZqprfrTx4vfH5+1mgpspPh5JYsNyA193NkMUdb3GwpmVqMczOh8cUDJgZBmEZVlSR42JBGYTUxlBAX9LHIBtIA==", + "dev": true, + "requires": { + "array-back": "^4.0.1" + } + }, + "local-web-server": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/local-web-server/-/local-web-server-4.2.1.tgz", + "integrity": "sha512-v71LZool2w7uYA+tDP5HhfjzUxz5SFfcrPPB/zC98yFFawt7A6fcmAr2MR4Q9AHk/A8oyd/wrhEJBJLndwHxNQ==", + "dev": true, + "requires": { + "lws": "^3.1.0", + "lws-basic-auth": "^2.0.0", + "lws-blacklist": "^3.0.0", + "lws-body-parser": "^2.0.0", + "lws-compress": "^2.0.0", + "lws-conditional-get": "^2.0.0", + "lws-cors": "^3.0.0", + "lws-index": "^2.0.0", + "lws-json": "^2.0.0", + "lws-log": "^2.0.0", + "lws-mime": "^2.0.0", + "lws-range": "^3.0.0", + "lws-request-monitor": "^2.0.0", + "lws-rewrite": "^3.1.1", + "lws-spa": "^3.0.0", + "lws-static": "^2.0.0", + "node-version-matches": "^2.0.1" + } + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "lodash.assignwith": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assignwith/-/lodash.assignwith-4.2.0.tgz", + "integrity": "sha1-EnqX8CrcQXUalU0ksN4X4QDgOOs=", + "dev": true + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, + "lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=", + "dev": true + }, + "lunr": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz", + "integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==", + "dev": true + }, + "lws": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lws/-/lws-3.1.0.tgz", + "integrity": "sha512-I8rTgZxz8OJL0hjdlDxs6WpcVG7WSyalVHPQXXK+WPNVjm3KhkT5gV0Qmsgm2FRLbRUp15tso80xmDxMsyt7zA==", + "dev": true, + "requires": { + "ansi-escape-sequences": "^5.1.2", + "array-back": "^4.0.1", + "byte-size": "^6.2.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^6.1.0", + "create-mixin": "^3.0.0", + "koa": "^2.11.0", + "load-module": "^3.0.0", + "lodash.assignwith": "^4.2.0", + "node-version-matches": "^2.0.1", + "open": "^7.0.4", + "qrcode-terminal": "^0.12.0", + "reduce-flatten": "^3.0.0", + "typical": "^6.0.0", + "walk-back": "^4.0.0" + } + }, + "lws-basic-auth": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-basic-auth/-/lws-basic-auth-2.0.0.tgz", + "integrity": "sha512-zzyoGFLQPuKaQJvHMLmmSyfT6lIvocwcDXllTVW5brD0t0YgHYopILkzja+x+MIlJX/YhNKniaTSasujniYVjw==", + "dev": true, + "requires": { + "basic-auth": "^2.0.1" + } + }, + "lws-blacklist": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lws-blacklist/-/lws-blacklist-3.0.0.tgz", + "integrity": "sha512-KNXGDBmbj+UGfWMBAefe2vrfuWpEQms/9Fd7kfMScTqAKF6nrVoEs4pkxfefArG3bX0bu7jWLyB4tJGma5WC6Q==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "path-to-regexp": "^6.1.0" + } + }, + "lws-body-parser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-body-parser/-/lws-body-parser-2.0.0.tgz", + "integrity": "sha512-QFDzln3sSdKWL9fVNWy2+ZmrKy/XaYRO0/FFB0MBrDCsNnzepeCD4I7rOOfyuphLn42yR8XUpWdcJ3Ii5aauRA==", + "dev": true, + "requires": { + "koa-bodyparser": "^4.2.1" + } + }, + "lws-compress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-compress/-/lws-compress-2.0.0.tgz", + "integrity": "sha512-5qDXI9pukVYWm07WjAOfpItLXKtL8lCHvjmW4RiXULhTRJj1qqBjNcmqReyk8L7NLUKhc+8eqoDDJFKURQEp0w==", + "dev": true, + "requires": { + "koa-compress": "^3.0.0" + } + }, + "lws-conditional-get": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-conditional-get/-/lws-conditional-get-2.0.0.tgz", + "integrity": "sha512-U05yDlFJKIYa7gJZYfnc1HIEuXbKpDJztgkvNYyxCqJC28j/k9ORoNnFNOIHpBh/jlPJgV8x7uH34mIxFAryWA==", + "dev": true, + "requires": { + "koa-conditional-get": "^2.0.0", + "koa-etag": "^3.0.0" + } + }, + "lws-cors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lws-cors/-/lws-cors-3.0.0.tgz", + "integrity": "sha512-diUkoyVZyzLB8LamdtUYYAfJdPAyu/+IjE3ZUcdnNQz9koECe4O2x3SWD7LSV43pd3CKgyiwwSxWJ4hTBZFIvQ==", + "dev": true, + "requires": { + "@koa/cors": "^3.0.0" + } + }, + "lws-index": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-index/-/lws-index-2.0.0.tgz", + "integrity": "sha512-qfkeQmKYnd13LmQubzI5LtFV2N8PJQG4QvgSoefoiB3dWre9k2T4C7ajjOTKO8mgSzYpUEREduNcQcLyt62n0g==", + "dev": true, + "requires": { + "serve-index-75lb": "^2.0.1" + } + }, + "lws-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-json/-/lws-json-2.0.0.tgz", + "integrity": "sha512-vqUFrAQ5BGpkMS2Mm/ZhgvUMi6Tgia7YtESG7pKjNoiSsD+TxncG0nqp8YjUh2xrEzi/SYFc/ed+9ZOl/t0A0g==", + "dev": true, + "requires": { + "koa-json": "^2.0.2" + } + }, + "lws-log": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-log/-/lws-log-2.0.0.tgz", + "integrity": "sha512-YveoazSZ0Qb1Tljdm8G8yn9c+mAMXgvLMACZzh5aZIk7p8YJwiXf9r1S+xY7wbXEcKG629KfVO0B5G5gRFcyDQ==", + "dev": true, + "requires": { + "koa-morgan": "^1.0.1", + "stream-log-stats": "^3.0.2" + } + }, + "lws-mime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-mime/-/lws-mime-2.0.0.tgz", + "integrity": "sha512-mfrAgRQ5+hkQ7LJ6EAgwnUeymNeYxwLXZY3UQ6C2hSTr7BqMSzm9k5O0C8wWP2dzdhChzITYKwzWbUnAYVBwtA==", + "dev": true + }, + "lws-range": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lws-range/-/lws-range-3.0.0.tgz", + "integrity": "sha512-7ZhA/LqQnKjolKBo/2BFj9DyDDXcJGY3v05TwYRD0qDGrxW4vuatEjluC3SV7ZO/k4PxDLdxuk+RCgL5t3ThtQ==", + "dev": true, + "requires": { + "koa-range": "^0.3.0" + } + }, + "lws-request-monitor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-request-monitor/-/lws-request-monitor-2.0.0.tgz", + "integrity": "sha512-ZTo0/pS42qiejcYlL+wlpurSbDSS0J7pDDohqBx7jjUQkgni2Qd8cPzn/kW8QI82gXgDmdZH+ps0vheLHlgdgg==", + "dev": true, + "requires": { + "byte-size": "^6.2.0" + } + }, + "lws-rewrite": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lws-rewrite/-/lws-rewrite-3.1.1.tgz", + "integrity": "sha512-cOeaPXIlLUVLxS6BZ52QzZVzI8JjCzlWD4RWizB5Hd+0YGO0SPa3Vgk7CIghtAOsSdjtXg/wSOap2H1h+tw8BQ==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "koa-route": "^3.2.0", + "path-to-regexp": "^6.1.0" + } + }, + "lws-spa": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lws-spa/-/lws-spa-3.0.0.tgz", + "integrity": "sha512-Tz10LfuOTUsRG6z+OCJ/vBN+4LQWoAGIJ1R02CFPrDk0pY3rHezM7/cCpq6Z6dXD+ipdNE8alkVn4zL2M+eVGg==", + "dev": true, + "requires": { + "koa-send": "^5.0.0" + } + }, + "lws-static": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lws-static/-/lws-static-2.0.0.tgz", + "integrity": "sha512-P25A0+IXdkB6Y6gZAG7X0mnaa+FJ8aTiWLUgM5kazaWmruRO7lyhSjitsA3y5TLI3DpPCZn0mWE4SRREujUZLg==", + "dev": true, + "requires": { + "koa-static": "^5.0.0" + } + }, + "marked": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", + "integrity": "sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==", + "dev": true + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -597,33 +1271,72 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "morgan": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "dev": true, + "requires": { + "basic-auth": "~2.0.1", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-finished": "~2.3.0", + "on-headers": "~1.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "dev": true, "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" } }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "node-version-matches": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-version-matches/-/node-version-matches-2.0.1.tgz", + "integrity": "sha512-oqk6+05FC0dNVY5NuXuhPEMq+m1b9ZjS9SIhVE9EjwCHZspnmjSO8npbKAEieinR8GeEgbecoQcYIvI/Kwcf6Q==", "dev": true, "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "semver": "^6.3.0" } }, "nth-check": { @@ -635,6 +1348,27 @@ "boolbase": "~1.0.0" } }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -644,6 +1378,12 @@ "wrappy": "1" } }, + "only": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", + "integrity": "sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q=", + "dev": true + }, "open": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/open/-/open-7.1.0.tgz", @@ -654,55 +1394,6 @@ "is-wsl": "^2.1.1" } }, - "open-cli": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/open-cli/-/open-cli-6.0.1.tgz", - "integrity": "sha512-A5h8MF3GrT1efn9TiO9LPajDnLtuEiGQT5G8TxWObBlgt1cZJF1YbQo/kNtsD1bJb7HxnT6SaSjzeLq0Rfhygw==", - "dev": true, - "requires": { - "file-type": "^14.1.4", - "get-stdin": "^7.0.0", - "meow": "^6.1.0", - "open": "^7.0.3", - "temp-write": "^4.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "parse-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", - "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", - "lines-and-columns": "^1.1.6" - } - }, "parse5": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", @@ -712,10 +1403,10 @@ "@types/node": "*" } }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true }, "path-is-absolute": { @@ -730,10 +1421,16 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "peek-readable": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-3.1.0.tgz", - "integrity": "sha512-KGuODSTV6hcgdZvDrIDBUkN0utcAVj1LL7FfGbM0viKTtCHmtZcuEJ+lGqsp0fTFkGqesdtemV2yUSMeyy3ddA==", + "path-to-regexp": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.1.0.tgz", + "integrity": "sha512-h9DqehX3zZZDCEm+xbfU0ZmwCGFCAAraPJWMXJ4+v32NjZJilVg3k1TcKsRgIb8IQ/izZSaydDc1OhJCZvs2Dw==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "progress": { @@ -742,48 +1439,42 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "qrcode-terminal": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz", + "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==", "dev": true }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } - } + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "dev": true }, - "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "raw-body": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz", + "integrity": "sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==", "dev": true, "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" + "bytes": "3.1.0", + "http-errors": "1.7.3", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" }, "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true + "http-errors": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", + "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } } } }, @@ -798,12 +1489,6 @@ "util-deprecate": "^1.0.1" } }, - "readable-web-to-node-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-2.0.0.tgz", - "integrity": "sha512-+oZJurc4hXpaaqsN68GoZGQAQIA3qr09Or4fqEsargABnbe5Aau8hFn6ISVleT3cpY/0n/8drn7huyyEvTbghA==", - "dev": true - }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -813,15 +1498,11 @@ "resolve": "^1.1.6" } }, - "redent": { + "reduce-flatten": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "dev": true, - "requires": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - } + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.0.tgz", + "integrity": "sha512-eczl8wAYBxJ6Egl6I1ECIF+8z6sHu+KE7BzaEDZTpPXKXfy9SUDQlVYwkRcNTjJLC3Iakxbhss50KuT/R6SYfg==", + "dev": true }, "resolve": { "version": "1.17.0", @@ -832,16 +1513,114 @@ "path-parse": "^1.0.6" } }, + "resolve-path": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz", + "integrity": "sha1-xL2p9e+y/OZSR4c6s2u02DT+Fvc=", + "dev": true, + "requires": { + "http-errors": "~1.6.2", + "path-is-absolute": "1.0.1" + }, + "dependencies": { + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + } + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "serve-index-75lb": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/serve-index-75lb/-/serve-index-75lb-2.0.1.tgz", + "integrity": "sha512-/d9r8bqJlFQcwy0a0nb1KnWAA+Mno+V+VaoKocdkbW5aXKRQd/+4bfnRhQRQr6uEoYwTRJ4xgztOyCJvWcpBpQ==", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.18", + "parseurl": "~1.3.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + } + } + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, "shelljs": { @@ -861,38 +1640,81 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, + "stream-log-stats": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/stream-log-stats/-/stream-log-stats-3.0.2.tgz", + "integrity": "sha512-393j7aeF9iRdHvyANqEQU82UQmpw2CTxgsT83caefh+lOxavVLbVrw8Mr4zjXeZLh2+xeHZMKfVx4T0rJ/EchA==", "dev": true, "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "JSONStream": "^1.3.5", + "ansi-escape-sequences": "^5.1.2", + "byte-size": "^6.2.0", + "common-log-format": "^1.0.0", + "lodash.throttle": "^4.1.1", + "stream-via": "^1.0.4", + "table-layout": "~1.0.0" } }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "stream-slice": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/stream-slice/-/stream-slice-0.1.2.tgz", + "integrity": "sha1-LcT04bk2+xPz6zmi3vGTJ5jQeks=", "dev": true }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "stream-via": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/stream-via/-/stream-via-1.0.4.tgz", + "integrity": "sha512-DBp0lSvX5G9KGRDTkR/R+a29H+Wk2xItOF+MpZLLNDWbEV9tGPnqLPxHEYjmiz8xGtJHRIqmI+hCjmNzqoA4nQ==", + "dev": true + }, + "streaming-json-stringify": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/streaming-json-stringify/-/streaming-json-stringify-3.1.0.tgz", + "integrity": "sha1-gCAEN6mTzDnE/gAmO3s7kDrIevU=", "dev": true, "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "json-stringify-safe": "5", + "readable-stream": "2" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } } }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", - "dev": true - }, "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -902,26 +1724,6 @@ "safe-buffer": "~5.2.0" } }, - "strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, - "requires": { - "min-indent": "^1.0.0" - } - }, - "strtok3": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.0.4.tgz", - "integrity": "sha512-rqWMKwsbN9APU47bQTMEYTPcwdpKDtmf1jVhHzNW2cL1WqAxaM9iBb9t5P2fj+RV2YsErUWgQzHD5JwV0uCTEQ==", - "dev": true, - "requires": { - "@tokenizer/token": "^0.1.1", - "@types/debug": "^4.1.5", - "peek-readable": "^3.1.0" - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -931,54 +1733,70 @@ "has-flag": "^3.0.0" } }, - "temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", - "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=", - "dev": true + "table-layout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.1.tgz", + "integrity": "sha512-dEquqYNJiGwY7iPfZ3wbXDI944iqanTSchrACLL2nOB+1r+h1Nzu2eH+DuPPvWvm5Ry7iAPeFlgEtP5bIp5U7Q==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "dependencies": { + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true + } + } }, - "temp-write": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-4.0.0.tgz", - "integrity": "sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw==", + "thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "dev": true, "requires": { - "graceful-fs": "^4.1.15", - "is-stream": "^2.0.0", - "make-dir": "^3.0.0", - "temp-dir": "^1.0.0", - "uuid": "^3.3.2" + "any-promise": "^1.0.0" } }, - "token-types": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-2.0.0.tgz", - "integrity": "sha512-WWvu8sGK8/ZmGusekZJJ5NM6rRVTTDO7/bahz4NGiSDb/XsmdYBn6a1N/bymUHuWYTWeuLUg98wUzvE4jPdCZw==", + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", "dev": true, "requires": { - "@tokenizer/token": "^0.1.0", - "ieee754": "^1.1.13" + "thenify": ">= 3.1.0 < 4" } }, - "trim-newlines": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", - "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, - "type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "tsscmp": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", + "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", "dev": true }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, "requires": { - "is-typedarray": "^1.0.0" + "media-typer": "0.3.0", + "mime-types": "~2.1.24" } }, "typedoc": { @@ -1008,6 +1826,12 @@ "lunr": "^2.3.8" } }, + "typical": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/typical/-/typical-6.0.1.tgz", + "integrity": "sha512-+g3NEp7fJLe9DPa1TArHm9QAA7YciZmWnfAqEaFrBihQ7epOv9i99rjtgb6Iz0wh3WuQDjsCTDfgRoGnmHN81A==", + "dev": true + }, "uglify-js": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", @@ -1027,27 +1851,29 @@ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } + "walk-back": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-4.0.0.tgz", + "integrity": "sha512-kudCA8PXVQfrqv2mFTG72vDBRi8BKWxGgFLwPpzHcpZnSwZk93WMwUDVcLHWNsnm+Y0AC4Vb6MUNRgaHfyV2DQ==", + "dev": true }, "wordwrap": { "version": "1.0.0", @@ -1055,21 +1881,41 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "wordwrapjs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", + "integrity": "sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ==", + "dev": true, + "requires": { + "reduce-flatten": "^2.0.0", + "typical": "^5.0.0" + }, + "dependencies": { + "reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true + }, + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } + "ylru": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.2.1.tgz", + "integrity": "sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ==", + "dev": true } } } diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index a3d3c5dc76..908f4db505 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -37,7 +37,7 @@ "devDependencies": { "@trufflesuite/typedoc-default-themes": "0.6.1", "cheerio": "1.0.0-rc.3", - "open-cli": "6.0.1", + "local-web-server": "4.2.1", "typedoc": "0.17.8" } } From d309b26267eed5fa5b10bf6c72870f416bb52392 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 6 Aug 2020 08:45:32 -0700 Subject: [PATCH 405/691] add initial post-process-docs script for @ganache/tezos --- src/chains/tezos/scripts/post-process-docs.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/chains/tezos/scripts/post-process-docs.js diff --git a/src/chains/tezos/scripts/post-process-docs.js b/src/chains/tezos/scripts/post-process-docs.js new file mode 100644 index 0000000000..d755f158fe --- /dev/null +++ b/src/chains/tezos/scripts/post-process-docs.js @@ -0,0 +1,16 @@ +const cheerio = require('cheerio'); +const { readFileSync, writeFileSync } = require("fs"); +const { randomBytes } = require('crypto'); +const $ = cheerio.load(readFileSync("./lib/docs/classes/_api_.tezosapi.html")); + +$(`.tsd-page-title`).after(``) + +$('.runkit-example').each(function() { + const sanitizedCode = $(this).text().replace(/;(\s+)/gi, ";\n").trim(); + $(this).text("") + const id = randomBytes(4).toString('hex'); + $(this).attr("id", id).html() + $(this).prepend(``) + }); + +writeFileSync("./lib/docs/classes/_api_.tezosapi.html", $.html()) From c27c7c6255d9a991547ae9e8e49c5f2a12c5b549 Mon Sep 17 00:00:00 2001 From: CruzMolina <7537712+CruzMolina@users.noreply.github.com> Date: Thu, 6 Aug 2020 08:45:59 -0700 Subject: [PATCH 406/691] wire up post-process step to run after build:docs, serve docs using local-web-server in @ganache/tezos --- src/chains/tezos/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 908f4db505..fbcb994e25 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -23,8 +23,9 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts", - "preview:docs": "open-cli ./lib/docs/index.html", + "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run post-process:docs", + "post-process:docs": "node ./scripts/post-process-docs.js", + "preview:docs": "ws --open --port 3011 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile" }, "bugs": { From 0c163787cfe625effe0dbebad5dde8ac9f99da07 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 4 Aug 2020 14:47:51 -0400 Subject: [PATCH 407/691] Ensure secure mode with unlocked_ wallet address can sign w/ PK --- src/chains/ethereum/src/wallet.ts | 39 ++++++++++++++++--------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 89e04c23b4..b0943a5bea 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -66,28 +66,10 @@ export default class Wallet { this.#hdKey = HDKey.fromMasterSeed(mnemonicToSeedSync(opts.mnemonic, null)); const initialAccounts = this.initialAccounts = this.#initializeAccounts(opts); + const l = initialAccounts.length; const knownAccounts = this.knownAccounts; const unlockedAccounts = this.unlockedAccounts; - - //#region Configure Known and Unlocked Accounts - const l = initialAccounts.length; - const accountsCache = (this.addresses = Array(l)); - for (let i = 0; i < l; i++) { - const account = initialAccounts[i]; - const address = account.address; - const strAddress = address.toString(); - accountsCache[i] = strAddress; - knownAccounts.add(strAddress); - - // if the `secure` option has been set do NOT add these accounts to the - // unlockedAccounts - if (opts.secure) continue; - - unlockedAccounts.set(strAddress, account.privateKey); - } - //#endregion - //#region Unlocked Accounts const givenUnlockedAccounts = opts.unlocked_accounts; if (givenUnlockedAccounts) { @@ -135,6 +117,25 @@ export default class Wallet { } } //#endregion + + //#region Configure Known + Unlocked Accounts + const accountsCache = (this.addresses = Array(l)); + for (let i = 0; i < l; i++) { + const account = initialAccounts[i]; + const address = account.address; + const strAddress = address.toString(); + accountsCache[i] = strAddress; + knownAccounts.add(strAddress); + + // if the `secure` option has been set do NOT add these accounts to the + // unlockedAccounts, unless the account was already added to + // unlockedAccounts, in which case we need to add the account's private + // key. + if (opts.secure && !unlockedAccounts.has(strAddress)) continue; + + unlockedAccounts.set(strAddress, account.privateKey); + } + //#endregion } #seedCounter = 0n; From 405ecfa1d52b2745243ed67fdf8817b961450d95 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 4 Aug 2020 21:07:08 -0400 Subject: [PATCH 408/691] Refactor blockLog `blockNumber` to be just a property --- src/chains/ethereum/src/api.ts | 2 +- src/chains/ethereum/src/blockchain.ts | 2 +- .../ethereum/src/components/blocklog-manager.ts | 2 +- src/chains/ethereum/src/things/blocklogs.ts | 12 ++---------- .../ethereum/src/things/transaction-receipt.ts | 2 +- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 49108d3655..151fdc97c0 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1165,7 +1165,7 @@ export default class EthereumApi implements types.Api { const blockchain = this.#blockchain; const { addresses, topics } = parseFilterDetails(filter); const unsubscribe = blockchain.on("blockLogs", (blockLogs: BlockLogs) => { - const blockNumber = blockLogs.getBlockNumber(); + const blockNumber = blockLogs.blockNumber; // everytime we get a blockLogs message we re-check what the filter's // range is. We do this because "latest" isn't the latest block at the // time the filter was set up, rather it is the actual latest *mined* diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 2d623f7f38..bf304282c5 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -185,7 +185,7 @@ export default class Blockchain extends Emittery.Typed { async get(key: string | Buffer) { const log = await super.get(key); if (log) { - log.setBlockNumber(key instanceof Quantity ? key : Quantity.from(key)); + log.blockNumber = key instanceof Quantity ? key : Quantity.from(key); } return log; } diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index dd6884394e..32678e8116 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -62,15 +62,7 @@ export default class BlockLogs { return this[_raw][1].length; } - [_blockNumber]: Quantity; - - public setBlockNumber(blockNumber: Quantity) { - this[_blockNumber] = blockNumber; - } - - public getBlockNumber() { - return this[_blockNumber]; - } + public blockNumber: Quantity; toJSON() { return this[_logs]().toJSON(); @@ -151,7 +143,7 @@ export default class BlockLogs { } /** - * Note: you must call `setBlockNumber(blockNumber)` first. + * Note: you must set `this.blockNumber: Quantity` first! * * Topics are order-dependent. A transaction with a log with topics [A, B] will be matched by the following topic * filters: diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index 7f59bf6070..e27a4cf575 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -43,7 +43,7 @@ export default class TransactionReceipt { const raw = this.#raw; const contractAddress = Data.from(this.#contractAddress).toJSON() const blockLog = BlockLogs.create(block.value.hash()); - blockLog.setBlockNumber(Quantity.from(block.value.header.number)); + blockLog.blockNumber = Quantity.from(block.value.header.number); (raw[3] as any as TransactionLog[]).forEach(log => { blockLog.append(transaction._index, transaction.hash(), log); }); From addc06e6834515533b15666a6210aa33fb674fed Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 6 Aug 2020 17:55:56 -0400 Subject: [PATCH 409/691] update typings in database.ts --- src/chains/ethereum/src/database.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index ca3e6e970f..22ed8c827b 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -92,14 +92,14 @@ export default class Database extends Emittery { * Call `batch` to batch `put` and `del` operations within the same * event loop tick of the provided function. All db operations within the * batch _must_ be executed synchronously. - * @param fn {Function} Within this function's event loop tick, all `put` and + * @param fn Within this function's event loop tick, all `put` and * `del` database operations are applied in a single atomic operation. This * provides a single write call and if any individual put/del's fail the * entire operation fails and no modifications are made. - * @returns {Promise} returns a Promise that resolves to the return value + * @returns a Promise that resolves to the return value * of the provided function. */ - public batch(fn: () => T): Promise { + public batch(fn: () => T) { const rootDb = this.#rootStore.db; const batch = this.db.batch(); @@ -108,7 +108,7 @@ export default class Database extends Emittery { rootDb.put = batch.put.bind(batch); rootDb.del = batch.del.bind(batch); - let prom; + let prom: Promise; try { const ret = fn(); // PSA: don't let vscode (or yourself) rewrite this to `await` the From 45455709b74d2037764ca81b8688a3b45a8c96d3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 6 Aug 2020 17:56:16 -0400 Subject: [PATCH 410/691] add legacyInstamining option --- .../api/eth/legacyInstamining.test.ts | 40 ++++++++++++ src/chains/ethereum/src/blockchain.ts | 61 +++++++++++++++---- src/chains/ethereum/src/options.ts | 1 + src/packages/options/src/options.ts | 5 +- 4 files changed, 94 insertions(+), 13 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts new file mode 100644 index 0000000000..d267e06d9b --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts @@ -0,0 +1,40 @@ + +import getProvider from "../../helpers/getProvider"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; + +describe("api", () => { + describe("eth", () => { + describe("legacyInstamining", () => { + it("when not in legacy mode, does not mine before returning the tx hash", async () => { + const provider = await getProvider({legacyInstamine: false}); + const accounts = await provider.send("eth_accounts"); + + const hash = await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const receipt = await provider.send("eth_getTransactionReceipt", [hash]); + assert.strictEqual(receipt, null); + }); + + it("when in legacy mode, mines before returns in the tx hash", async () => { + const provider = await getProvider({legacyInstamine: true}); + const accounts = await provider.send("eth_accounts"); + + const hash = await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: 1 + } + ]); + const receipt = await provider.send("eth_getTransactionReceipt", [hash]); + assert.notStrictEqual(receipt, null); + }); + }); + }); +}); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index bf304282c5..a07fd201b5 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -43,6 +43,7 @@ export type BlockchainOptions = { coinbase: Account; chainId: number; common: Common; + legacyInstamine: boolean; }; type BlockchainTypedEvents = {block: Block, blockLogs: BlockLogs, pendingTransaction: Transaction}; @@ -61,6 +62,7 @@ export default class Blockchain extends Emittery.Typed { // TODO: get the latest block from the database // if we have a latest block, `root` will be that block's header.stateRoot @@ -109,7 +117,6 @@ export default class Blockchain extends Emittery.Typed>) => { + const intervalMine = () => { let promise: Promise; - if (!this.#isPaused()) { - promise = this.mine(-1); + if (this.#isPaused()) { + promise = this.once("resume") + // after resuming from a paused state, wait for all transactions + // in the pool to be processed before mining. + .then(() => this.mine(-1)); } else { - promise = this.once("resume"); + // when mining on an interval we always mine whatever executable + // transactions are currently available. + promise = this.mine(-1); } - promise.then(() => utils.unref(setTimeout(intervalMine, minerInterval, executables))); - return void 0; + // set the mining timer once the promise resolves + promise.then(() => utils.unref(setTimeout(intervalMine, minerInterval))); }; - utils.unref(setTimeout(intervalMine, minerInterval, this.transactions.transactionPool.executables)); + utils.unref(setTimeout(intervalMine, minerInterval)); } miner.on("block", async (blockData: any) => { @@ -194,9 +206,22 @@ export default class Blockchain extends Emittery.Typed { this.blocks.latest = block; - // emit the block once everything has been fully saved to the database - this.emit("block", block); - this.emit("blockLogs", blockLogs); + + if (instamine && options.legacyInstamine) { + block.value.transactions.forEach(transaction => { + this.emit("transaction:" + Data.from(transaction.hash()).toString() as any); + }); + + // in legacy instamine mode we must delay the broadcast of new blocks + process.nextTick(() => { + // emit the block once everything has been fully saved to the database + this.emit("block", block); + this.emit("blockLogs", blockLogs); + }); + } else { + this.emit("block", block); + this.emit("blockLogs", blockLogs); + } }); }); @@ -414,10 +439,22 @@ export default class Blockchain extends Emittery.Typed; export default EthereumOptions; diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index d14376571e..a50a296b9d 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -180,6 +180,8 @@ export interface Options { asyncRequestProcessing?: boolean; hardfork?: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier"; + + legacyInstamine?: boolean; }; const getDefault: (options?: Options) => Options = options => { @@ -207,7 +209,8 @@ const getDefault: (options?: Options) => Options = options => { verbose: false, asyncRequestProcessing: true, hardfork: "muirGlacier", - secure + secure, + legacyInstamine: false }, options ); From cfcf13d0707bc45eb759235047de23fc009bfce8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 7 Aug 2020 17:09:12 -0400 Subject: [PATCH 411/691] remove unsued vars --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index a17e511565..fb166cd41c 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -280,7 +280,7 @@ describe("api", () => { }); it("eth_getBlockTransactionCountByNumber", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_subscribe", ["newHeads"]); await provider.send("eth_sendTransaction", [ { from: accounts[0], @@ -288,7 +288,7 @@ describe("api", () => { value: 1 } ]); - const _message = await provider.once("message"); + await provider.once("message"); const count = await provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]); assert(count, "1"); From 676d64f732c76bca896e5375d8bd30b9f3eb20e0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 7 Aug 2020 17:09:29 -0400 Subject: [PATCH 412/691] remove unused vars --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index fb166cd41c..f290742899 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -295,7 +295,7 @@ describe("api", () => { }); it("eth_getTransactionByBlockNumberAndIndex", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_subscribe", ["newHeads"]); const txHash = await provider.send("eth_sendTransaction", [ { from: accounts[0], @@ -303,7 +303,7 @@ describe("api", () => { value: 1 } ]); - const _message = await provider.once("message"); + await provider.once("message"); const tx = await provider.send("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); assert.strictEqual( From 24b5079c043c2e4ac28aaffaee05b98c10caa9b7 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 7 Aug 2020 17:10:20 -0400 Subject: [PATCH 413/691] fix eth_getBlockTransactionCountByNumber return formatting --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 151fdc97c0..02ebc7e658 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -509,7 +509,7 @@ export default class EthereumApi implements types.Api { async eth_getBlockTransactionCountByNumber(number: string | Buffer) { const rawBlock = await this.#blockchain.blocks.getRaw(number); const data = rlpDecode(rawBlock); - return (data[1] as any).length; + return Quantity.from((data[1] as any).length); } /** From 24359800d175a5fd61c11726515fe6435516c64e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 7 Aug 2020 17:11:53 -0400 Subject: [PATCH 414/691] fix some error handling in ethereum --- .../ethereum/__tests__/api/eth/eth.test.ts | 47 +++++- .../api/eth/legacyInstamining.test.ts | 26 +++- src/chains/ethereum/src/blockchain.ts | 19 ++- .../src/components/transaction-pool.ts | 35 +++-- src/chains/ethereum/src/index.ts | 13 +- src/chains/ethereum/src/miner.ts | 140 ++++++++++-------- src/chains/ethereum/src/provider.ts | 29 +++- src/chains/tezos/src/index.ts | 4 + src/packages/core/src/servers/http-server.ts | 5 +- src/packages/utils/src/things/jsonrpc.ts | 54 ++++--- 10 files changed, 266 insertions(+), 106 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index f290742899..c49dc0a66a 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -291,7 +291,52 @@ describe("api", () => { await provider.once("message"); const count = await provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]); - assert(count, "1"); + assert.strictEqual(count, "0x1"); + }); + + it("eth_sendTransaction bad data (tiny gas limit)", async () => { + await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + gas: "0x01" + } + ]) + .catch(e => { + assert.strictEqual(e.code, -32000); + assert.strictEqual(e.message, "intrinsic gas too low"); + }) + }); + + it("eth_sendTransaction bad data (huge gas limit)", async () => { + await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + gas: "0xfffffffff" + } + ]) + .catch(e => { + assert.strictEqual(e.code, -32000); + assert.strictEqual(e.message, "exceeds block gas limit"); + }) + }); + + it("handles block gas limit errors, callback style", (done) => { + provider.send({ + jsonrpc:"2.0", + id: "1", + method: "eth_sendTransaction", + params: [{ + from: accounts[0], + to: accounts[1], + gas: "0xfffffffff" // generates an "exceeds block gas limit" error + }]}, (e, r) => { + assert.strictEqual(e.message, "exceeds block gas limit"); + assert.strictEqual((r as any).error.code, -32000); + assert.strictEqual((r as any).error.message, e.message); + done() + }); }); it("eth_getTransactionByBlockNumberAndIndex", async () => { diff --git a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts index d267e06d9b..55df24b17a 100644 --- a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts @@ -1,11 +1,10 @@ import getProvider from "../../helpers/getProvider"; import assert from "assert"; -import EthereumProvider from "../../../src/provider"; describe("api", () => { describe("eth", () => { - describe("legacyInstamining", () => { + describe("legacy", () => { it("when not in legacy mode, does not mine before returning the tx hash", async () => { const provider = await getProvider({legacyInstamine: false}); const accounts = await provider.send("eth_accounts"); @@ -35,6 +34,29 @@ describe("api", () => { const receipt = await provider.send("eth_getTransactionReceipt", [hash]); assert.notStrictEqual(receipt, null); }); + + + it("handles transaction balance errors, callback style", (done) => { + getProvider({legacyInstamine: true, vmErrorsOnRPCResponse: true}).then(async (provider) => { + const accounts = await provider.send("eth_accounts"); + + provider.send({ + jsonrpc:"2.0", + id: "1", + method: "eth_sendTransaction", + params: [{ + from: accounts[0], + to: accounts[1], + value: "0x76bc75e2d63100000" // generates an "exceeds block gas limit" error + }]}, (e, r) => { + assert(e.message.startsWith("sender doesn't have enough funds to send tx")); + assert.strictEqual(e.message, (r as any).error.message); + assert.strictEqual((r as any).error.code, -32000); + assert.strictEqual(typeof (r as any).result, "string"); + done(); + }); + }); + }); }); }); }); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index a07fd201b5..4b54114c7b 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -44,6 +44,7 @@ export type BlockchainOptions = { chainId: number; common: Common; legacyInstamine: boolean; + vmErrorsOnRPCResponse: boolean; }; type BlockchainTypedEvents = {block: Block, blockLogs: BlockLogs, pendingTransaction: Transaction}; @@ -96,7 +97,7 @@ export default class Blockchain extends Emittery.Typed( database.transactionReceipts, TransactionReceipt @@ -155,6 +156,10 @@ export default class Blockchain extends Emittery.Typed { + this.emit("transaction-failure:" + Data.from(failureData.txHash).toString() as any, failureData.err); + }); + miner.on("block", async (blockData: any) => { await this.#processingBlock; const previousBlock = this.blocks.latest; @@ -451,7 +456,17 @@ export default class Blockchain extends Emittery.Typed { transaction.nonce = Quantity.from(transactionNonce).toBuffer(); } else if (transactionNonce < transactorNonce) { // it's an error if the transaction's nonce is <= the persisted nonce - throw new Error("Transaction nonce is too low"); + throw new Error(`the tx doesn't have the correct nonce. account has nonce of: ${transactorNonce} tx has nonce of: ${transactionNonce}`); } else if (transactionNonce === transactorNonce) { isExecutableTransaction = true; } @@ -249,26 +250,38 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { validateTransaction = (transaction: Transaction): Error => { // Check the transaction doesn't exceed the current block limit gas. - if (this.#options.gasLimit < Quantity.from(transaction.gasLimit)) { - return new Error("Transaction gasLimit is too low"); - } - - // Transactions can't be negative. This may never happen using RLP - // decoded transactions but may occur if you create a transaction using - // the RPC for example. - if (Quantity.from(transaction.value).toBigInt() < 0n) { - return new Error("Transaction value cannot be negative"); + if (Quantity.from(transaction.gasLimit) > this.#options.gasLimit) { + return new Error(Errors.GAS_LIMIT); } // Should supply enough intrinsic gas const gas = transaction.calculateIntrinsicGas(); if (Quantity.from(transaction.gasLimit).toBigInt() < gas) { - return new Error("intrisic gas too low"); + return new Error(Errors.INTRINSIC_GAS_TOO_LOW); } return null; }; + // /** + // * Returns the *live* executables map once all transactions that have started + // * insertion into the pool have been fully processed. + // * + // * This is neccessary as a transaction added via `eth_sendTransaction` + // * immediately followed by an `evm_mine` may not yet be in the executables + // * pool when `evm_mine` triggers the mine operation. + // */ + // getFutureExecutablesMap(){ + // // When transactions are pushed into the transactionPool they aren't always + // // instantly added to the executables pool, due to potential file IO, so we + // // must wait for any pending file IO to finish before we can get + // return Promise.all([...this.#accountPromises.values()]).then(() => this.#executables); + // } + + // getCurrentExecutablesMap() { + // return this.#executables; + // } + #assertValidTransactorBalance = (transaction: Transaction, transactor: any): Error | null => { // Transactor should have enough funds to cover the costs if (transactor.balance.toBigInt() < transaction.cost()) { diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 347925b440..54eed55806 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -40,7 +40,8 @@ export class EthereumConnector extends Emittery.Typed}); @@ -48,8 +49,8 @@ export class EthereumConnector extends Emittery.Typed; - return new PromiEvent(resolve => { - provider.send(method, params).then(resolve); + return new PromiEvent((resolve, reject) => { + provider.request({method, params}).then(resolve).catch(reject); }); } @@ -58,6 +59,12 @@ export class EthereumConnector extends Emittery.Typed): RecognizedString { + const json = JsonRpcTypes.Error(payload.id, error); + return JSON.stringify(json); + } + + close(){ return this.#provider.disconnect(); } diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index f1764d9e83..16a3414d23 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -177,74 +177,78 @@ export default class Miner extends Emittery { await this.#checkpoint(); const result = await this.#runTx(runArgs, origin, pending); - const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); - if (blockGasLeft >= gasUsed) { - // if the transaction will fit in the block, commit it! - await this.#commit(); - blockTransactions[numTransactions] = best; - - blockGasLeft -= gasUsed; - blockData.gasUsed += gasUsed; - - // calculate receipt and tx tries - const receipt = best.fillFromResult(result); - const txKey = rlpEncode(numTransactions); - promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); - promises.push(putInTrie(receiptTrie, txKey, receipt)); - - - // update the block's bloom - const bloom = result.bloom.bitvector; - for (let i = 0; i < 256; i++) { - blockBloom[i] |= bloom[i]; - } - - numTransactions++; - - const pendingOrigin = pending.get(origin); - // since this transaction was successful, remove it from the "pending" - // transaction pool. - keepMining = pendingOrigin.removeBest(); + if (result !== null) { + const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); + if (blockGasLeft >= gasUsed) { + // if the transaction will fit in the block, commit it! + await this.#commit(); + blockTransactions[numTransactions] = best; + + blockGasLeft -= gasUsed; + blockData.gasUsed += gasUsed; + + // calculate receipt and tx tries + const receipt = best.fillFromResult(result); + const txKey = rlpEncode(numTransactions); + promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); + promises.push(putInTrie(receiptTrie, txKey, receipt)); + + + // update the block's bloom + const bloom = result.bloom.bitvector; + for (let i = 0; i < 256; i++) { + blockBloom[i] |= bloom[i]; + } - // if we: - // * don't have enough gas left for even the smallest of transactions - // * Or if we've mined enough transactions - // we're done with this block! - // notice: when `maxTransactions` is `-1` (AKA infinite), `numTransactions === maxTransactions` - // will always return false, so this comparison works out fine. - if (blockGasLeft <= params.TRANSACTION_GAS || numTransactions === maxTransactions) { + numTransactions++; + + const pendingOrigin = pending.get(origin); + // since this transaction was successful, remove it from the "pending" + // transaction pool. + keepMining = pendingOrigin.removeBest(); + + // if we: + // * don't have enough gas left for even the smallest of transactions + // * Or if we've mined enough transactions + // we're done with this block! + // notice: when `maxTransactions` is `-1` (AKA infinite), `numTransactions === maxTransactions` + // will always return false, so this comparison works out fine. + if (blockGasLeft <= params.TRANSACTION_GAS || numTransactions === maxTransactions) { + if (keepMining) { + // remove the newest (`best`) tx from this account's pending queue + // as we know we can fit another transaction in the block. Stick + // this tx into our `priced` heap. + keepMining = replaceFromHeap(priced, pendingOrigin); + } else { + keepMining = priced.removeBest(); + } + break; + } + if (keepMining) { // remove the newest (`best`) tx from this account's pending queue // as we know we can fit another transaction in the block. Stick // this tx into our `priced` heap. keepMining = replaceFromHeap(priced, pendingOrigin); } else { + // since we don't have any more txs from this account, just get the + // next bext transaction sorted in our `priced` heap. keepMining = priced.removeBest(); } - break; - } - - if (keepMining) { - // remove the newest (`best`) tx from this account's pending queue - // as we know we can fit another transaction in the block. Stick - // this tx into our `priced` heap. - keepMining = replaceFromHeap(priced, pendingOrigin); } else { - // since we don't have any more txs from this account, just get the - // next bext transaction sorted in our `priced` heap. + await this.#revert(); + + // unlock the transaction so the transaction pool can reconsider this + // transaction + best.locked = false; + + // didn't fit. remove it from the priced transactions without replacing + // it with another from the account. This transaction will have to be + // run again in another block. keepMining = priced.removeBest(); } } else { await this.#revert(); - - // unlock the transaction so the transaction pool can reconsider this - // transaction - best.locked = false; - - // didn't fit. remove it from the priced transactions without replacing - // it with another from the account. This transaction will have to be - // run again in another block. - keepMining = priced.removeBest(); } } @@ -270,7 +274,6 @@ export default class Miner extends Emittery { try { return await this.#vm.runTx(runArgs); } catch (err) { - await this.#revert(); const errorMessage = err.message; if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { // a race condition between the pool and the miner could potentially @@ -278,15 +281,28 @@ export default class Miner extends Emittery { // We do NOT want to re-run this transaction. // Update the `priced` heap with the next best transaction from this // account - replaceFromHeap(this.#priced, pending.get(origin)); - - // TODO: how do we surface this error to the caller? - throw err; + const pendingOrigin = pending.get(origin) + if (pendingOrigin.removeBest()) { + replaceFromHeap(this.#priced, pendingOrigin); + } else { + this.#priced.removeBest(); + } } else { - // TODO: handle all other errors! - // TODO: how do we surface this error to the caller? - throw err; + // TODO: handle other errors? Maybe there are some that allow this tx to + //be run again later? For now, just remove it so stuff works. + + // Update the `priced` heap with the next best transaction from this + // account + const pendingOrigin = pending.get(origin) + if (pendingOrigin.removeBest()) { + replaceFromHeap(this.#priced, pendingOrigin); + } else { + this.#priced.removeBest(); + } } + + this.emit("transaction-failure", {txHash: runArgs.tx.hash(), err}); + return null; } } diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index d2179409c9..1a346ee3bb 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -14,6 +14,8 @@ type RequestParams> = { readonly method: Method, readonly params: Parameters | undefined }; +const hasOwn = ({}).hasOwnProperty.call.bind(({}).hasOwnProperty); + export default class EthereumProvider extends Emittery.Typed<{message: any}, "connect" | "disconnect"> implements types.Provider { @@ -43,6 +45,8 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co let params: any; let response: Promise<{}>; if (typeof arg1 === "string") { + // this signature is (not) non-standard and is only a ganache thing!!! + // we should probably remove it, but I really like it so I haven't yet. method = arg1; params = arg2 as Parameters; response = this.request({method, params}); @@ -52,14 +56,22 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co const callback = arg2 as Callback; method = payload.method as types.KnownKeys; params = payload.params; - this.request({method, params}) .then((result: any) => { // execute the callback on the nextTick so errors thrown in the callback // don't cause the error to bubble up to ganache-core process.nextTick(callback, null, JsonRpcTypes.Response(payload.id, JSON.parse(JSON.stringify(result)))) - }).catch((err: Error) => { - process.nextTick(callback, err); + }) + .catch((error: Error & {code: number, result?: unknown}) => { + let result: any; + // In order to provide `vmErrorsOnRPCResponse`, the `error` might have + // a `result`, which is pretty much just a hack + if (hasOwn(error, "result")) { + result = error.result + delete error.result; + } + const errorResult = JsonRpcTypes.Error(payload.id, error, result); + process.nextTick(callback, error, errorResult); }); } else { throw new Error( @@ -105,7 +117,16 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co }); } return promise.then(JSON.stringify).then(JSON.parse); - }) + }).catch((err: Error) => { + // reformat the error to include a `code` + const e = new Error(err.message); + (e as any).code = -32000; + if (this.#options.vmErrorsOnRPCResponse && (err as any).result) { + (e as any).result = JSON.parse(JSON.stringify((err as any).result)); + } + // then rethrow + throw e; + }); } public disconnect = async () => { diff --git a/src/chains/tezos/src/index.ts b/src/chains/tezos/src/index.ts index 2b7d814f3a..2b20f4f665 100644 --- a/src/chains/tezos/src/index.ts +++ b/src/chains/tezos/src/index.ts @@ -24,6 +24,10 @@ export class TezosConnector extends Emittery.Typed return JSON.stringify(result); } + formatError(error: any) { + return JSON.stringify(error); + } + parse(message: Buffer) { return JSON.parse(message); }; diff --git a/src/packages/core/src/servers/http-server.ts b/src/packages/core/src/servers/http-server.ts index 0214fa7db9..a19695cbaa 100644 --- a/src/packages/core/src/servers/http-server.ts +++ b/src/packages/core/src/servers/http-server.ts @@ -144,13 +144,12 @@ export default class HttpServer { const data = connector.format(result, payload); sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); }).catch((error: any) => { + const data = connector.formatError(error, payload); sendResponse( response, HttpResponseCodes.BAD_REQUEST, ContentTypes.JSON, - // TODO: handle "real" Error objects by properly serializing them. - // JSON.stringify can't do this on its own. - JSON.stringify(error), + data, writeHeaders ); }); diff --git a/src/packages/utils/src/things/jsonrpc.ts b/src/packages/utils/src/things/jsonrpc.ts index 9ef9b66070..0844ec8295 100644 --- a/src/packages/utils/src/things/jsonrpc.ts +++ b/src/packages/utils/src/things/jsonrpc.ts @@ -1,26 +1,29 @@ import { Api, KnownKeys } from "../types"; +type JSError = Error namespace JsonRpc { const jsonrpc = "2.0"; type JsonRpc = { - id: string; - jsonrpc: string; + readonly id: string; + readonly jsonrpc: string; toString(): string; }; export type Request = JsonRpc & { - id: string; - jsonrpc: string; - method: KnownKeys; - params?: any[]; + readonly id: string; + readonly jsonrpc: string; + readonly method: KnownKeys; + readonly params?: any[]; }; export type Response = JsonRpc & { - result: any; + readonly result: any; }; export type Error = JsonRpc & { - error: { - code: string; - message: any; + readonly error: { + readonly [key: string]: unknown, + readonly code: number; + readonly message: any; }; + readonly result?: any }; export const Request = (json: any): Request => { return { @@ -37,15 +40,30 @@ namespace JsonRpc { result }; }; - export const Error = (id: string, code: string, message: any): Error => { - return { - id, - jsonrpc, - error: { - code, - message + export const Error = (id: string, error: T, result?: unknown): Error => { + type E = {[K in keyof T]: K extends string ? T[K] : never} + // Error objects are weird, `message`isn't included in the property names, + // so it is pulled out separately. + const details: E = {message: error.message} as any; + Object.getOwnPropertyNames(error).forEach(name => { + if (typeof name === "string") { + details[name] = error[name]; } - }; + }); + if (result !== undefined) { + return { + id, + jsonrpc, + error: details, + result + }; + } else { + return { + id, + jsonrpc, + error: details + }; + } }; } From ff69a3dc815cd9fcda9a271b0ca4f117144d64c0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 7 Aug 2020 18:53:06 -0400 Subject: [PATCH 415/691] add `from` and `to` to transaction receipt --- src/chains/ethereum/src/things/transaction-receipt.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index e27a4cf575..23203a2e9d 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -53,6 +53,8 @@ export default class TransactionReceipt { transactionIndex: Quantity.from((transaction as any)._index), blockNumber: Quantity.from(block.value.header.number), blockHash: Data.from(block.value.hash()), + from: Data.from(transaction.from), + to: contractAddress === "0x" ? Data.from(transaction.to) : null, cumulativeGasUsed: Quantity.from(block.value.header.gasUsed), gasUsed: Quantity.from(raw[1]), contractAddress: contractAddress === "0x" ? null : contractAddress, From 59f4f960acb602cdf86bfe8a4f24db7e7d02e1c6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 7 Aug 2020 19:07:15 -0400 Subject: [PATCH 416/691] ensure gasLimit is set in all ways (not sure why, really) --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 02ebc7e658..97ca76e037 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1297,7 +1297,7 @@ export default class EthereumApi implements types.Api { if (!transaction.gasLimit) { if (!transaction.gas) { // eth_call isn't subject to regular transaction gas limits - transaction.gas = options.callGasLimit.toString(); + transaction.gasLimit = transaction.gas = options.callGasLimit.toString(); } else { transaction.gasLimit = transaction.gas; } From 21305f146c01d9c02c230b14456e4a8d4cd11770 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 7 Aug 2020 19:07:39 -0400 Subject: [PATCH 417/691] block nonce is 8 bytes, not 16 --- src/chains/ethereum/src/components/block-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index 4f1f5e56f7..597df00d4b 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -172,7 +172,7 @@ export class Block { hash: Data.from(this.value.hash()), parentHash: Data.from(header.parentHash), mixHash: Data.from(header.mixHash), - nonce: Data.from(header.nonce, 16), + nonce: Data.from(header.nonce, 8), sha3Uncles: Data.from(header.uncleHash), logsBloom: Data.from(header.bloom), transactionsRoot: Data.from(header.transactionsTrie), From 165dfd0c814ba093b20fc99530b9d5afe5327070 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 7 Aug 2020 19:08:05 -0400 Subject: [PATCH 418/691] fix tx receipt status bug --- src/chains/ethereum/src/things/transaction-receipt.ts | 3 +-- src/chains/ethereum/src/things/transaction.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index 23203a2e9d..b49aece9c3 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -60,8 +60,7 @@ export default class TransactionReceipt { contractAddress: contractAddress === "0x" ? null : contractAddress, logs, logsBloom: Data.from(raw[2], 256), - // flips a `1` to a `0` and a `0` to a `1` using Bitwise XOR for funsies. - status: 1 ^ raw[0][0] + status: raw[0][0] }; } } diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index b408ab05a1..4c36d4f83b 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -15,7 +15,7 @@ type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; const MAX_UINT64 = (1n << 64n) - 1n; const ZERO_BUFFER = Buffer.from([0]); -const ONE_BUFFER = Buffer.from([0]); +const ONE_BUFFER = Buffer.from([1]); //#region helpers const sign = EthereumJsTransaction.prototype.sign; From d948f8165ee2d94bbd5180667ab5804483e8d4fe Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 10 Aug 2020 13:14:42 -0400 Subject: [PATCH 419/691] Add `node-gyp` debugging to docs --- docs/README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index 7906bbd585..c98ba34909 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,13 +3,38 @@ ## Getting set up * Use Node.js v10.7.0, this is the earliest version we support. - * Why v10.7.0? Because this is the first version that supports with BitInt literals (the `n` in `100n`). + * Why v10.7.0? Because this is the first version that supports with BigInt literals (the `n` in `100n`). * `git clone git@github.com:trufflesuite/ganache-core.git` * `cd ganache-core` * `npm install` +## Solving node-gyp issues + +I f installation fails due to a `node-gyp` issue you may need to perform some additional system configuration. + +### on Linux (Ubuntu-based) + + * Determine if you have Python 2.7 installed + * example: `which python2.7` + * If you do not have python2.7 installed, you need to install it + * example: `sudo apt update && sudo apt install python2.7` + * Finally, run `npm config set python python2.7` + +### on Windows + + * Install [https://www.npmjs.com/package/windows-build-tools](Windows-Build-Tools) + * `npm install --global windows-build-tools` + +### On macOS + + * I have no idea. + ## Clean install + * `npm run reinstall` + +Which just runs these commands for you: + * `npm run clean` * `npm install` @@ -27,7 +52,7 @@ Builds all packages: Runs all tests: - * `npm test` + * `npm test` (or the shorthand, `npm t`) ## To create a new package From 8a56a8255c558a7238b504f35e8794b8a395d466 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 10 Aug 2020 13:18:14 -0400 Subject: [PATCH 420/691] Add inline doc comments in root tsconfig --- tsconfig.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index f0bbfd7332..5f9a2495e6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,8 +10,10 @@ "moduleResolution": "node", "noErrorTruncation": true, "sourceMap": true, + /** `resolveJsonModule: true` allows for inlining properties from .json files via our `compile.ts` script */ "resolveJsonModule": true, "strict": true, + /** `noImplicitAny: false` and `strictNullChecks: false` are temporary during initial rapid development. */ "strictNullChecks": false, "noImplicitAny": false, "newLine": "lf", From 203754f016eb3312aff4a8c5a7af30811493c31e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 10 Aug 2020 21:27:24 -0400 Subject: [PATCH 421/691] Update to typescript to 4.0.1-tc --- npm-shrinkwrap.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index bda5887fc2..61f7d7a520 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -11422,9 +11422,9 @@ } }, "typescript": { - "version": "4.0.0-beta", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.0-beta.tgz", - "integrity": "sha512-d3s/CogGtB2uPZ2Z8ts6eoUxxyB9PH3R27/UrzvpthuOvpCg4FWWnBbBiqJ0K4eu6eTlgmLiqQkh2dquReJweA==", + "version": "4.0.1-rc", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.1-rc.tgz", + "integrity": "sha512-TCkspT3dSKOykbzS3/WSK7pqU2h1d/lEO6i45Afm5Y3XNAEAo8YXTG3kHOQk/wFq/5uPyO1+X8rb/Q+g7UsxJw==", "dev": true }, "uWebSockets.js": { diff --git a/package.json b/package.json index 8205f966a8..09fe83d65d 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "superagent": "5.2.2", "ts-morph": "7.1.2", "ts-node": "8.10.2", - "typescript": "4.0.0-beta", + "typescript": "4.0.1-rc", "utf-8-validate": "5.0.2", "ws": "7.3.0", "yargs": "15.4.0" From 5cb5ccf782696097b4e518066ae31c3d63a46f98 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 11 Aug 2020 18:45:06 -0400 Subject: [PATCH 422/691] Add support for account_keys_path --- .../ethereum/__tests__/temp-tests.test.ts | 33 +++++++++++++++++++ src/chains/ethereum/src/options.ts | 1 + src/chains/ethereum/src/wallet.ts | 15 +++++++++ src/packages/options/src/options.ts | 11 +++++++ 4 files changed, 60 insertions(+) diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index 49246be2bc..dad4cabdcc 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -1,3 +1,5 @@ +import os from "os"; +import fs from "fs"; import assert from "assert"; import {Quantity} from "@ganache/utils"; import {ProviderOptions} from "@ganache/options"; @@ -229,4 +231,35 @@ describe("Random tests that are temporary!", () => { const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); assert(result, "0x"); }); + + describe("options:account_keys_path", () => { + const fileName = join(os.tmpdir(), "/ganache-core-test-accounts.json"); + + function cleanUp() { + try { + fs.unlinkSync(fileName); + } catch (e) { + // ignore error + } + } + afterEach("clean up", () => { + cleanUp(); + }); + it("should create the file by name", async () => { + await getProvider({ account_keys_path: fileName }); + assert.strictEqual(fs.existsSync(fileName), true, "The account_keys file doesn't exist."); + }); + it("should populate the file by descriptor", async () => { + const fd = fs.openSync(fileName, "w") + try { + await getProvider({ account_keys_path: fd }); + assert.strictEqual(fs.existsSync(fileName), true, "The account_keys file doesn't exist."); + } finally{ + fs.closeSync(fd); + } + }); + afterEach("clean up", () => { + cleanUp(); + }); + }); }); diff --git a/src/chains/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts index 45f2751113..dd621d9c4a 100644 --- a/src/chains/ethereum/src/options.ts +++ b/src/chains/ethereum/src/options.ts @@ -20,6 +20,7 @@ type EthereumOptions = Pick< | "default_balance_ether" | "mnemonic" | "legacyInstamine" + | "account_keys_path" >; export default EthereumOptions; diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index b0943a5bea..3030d6dcc9 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -11,6 +11,7 @@ import HDKey from "hdkey"; import { alea as rng } from "seedrandom"; import crypto from "crypto"; import createKeccakHash from "keccak"; +import {writeFileSync} from "fs"; const SCRYPT_PARAMS = { dklen: 32, @@ -136,6 +137,20 @@ export default class Wallet { unlockedAccounts.set(strAddress, account.privateKey); } //#endregion + + //#region save accounts to disk + if (opts.account_keys_path != null) { + const fileData = { + addresses: {}, + private_keys: {} + }; + unlockedAccounts.forEach((privateKey, address) => { + fileData.addresses[address] = address; + fileData.private_keys[address] = privateKey; + }); + writeFileSync(opts.account_keys_path, JSON.stringify(fileData)); + } + //#endregion } #seedCounter = 0n; diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index a50a296b9d..7bd4dad158 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -182,6 +182,17 @@ export interface Options { hardfork?: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier"; legacyInstamine?: boolean; + + /** + * Specifies a file to save accounts and private keys to, for testing. + * + * Can be a filename or file descriptor. + * + * If specifying a filename, the directory path must already exist. + * + * See: https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options + */ + account_keys_path?: string | number }; const getDefault: (options?: Options) => Options = options => { From 4e786836b8fe5eb753196d615d5a1f93e03e8633 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 11 Aug 2020 18:47:29 -0400 Subject: [PATCH 423/691] Remove keepAliveTimeout option --- src/packages/core/src/options/server-options.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/packages/core/src/options/server-options.ts b/src/packages/core/src/options/server-options.ts index ef9c7a19d2..63723411fc 100644 --- a/src/packages/core/src/options/server-options.ts +++ b/src/packages/core/src/options/server-options.ts @@ -2,16 +2,6 @@ import {ProviderOptions} from "@ganache/options"; export {Apis, Flavors, FlavorMap} from "@ganache/flavors"; export default interface ServerOptions extends ProviderOptions { - /** - * The number of milliseconds of inactivity the http server needs to wait for - * additional incoming data, after it has finished writing the last response, - * before a socket will be destroyed. This does not affect the websocket - * server. - * - * A value of 0 will disable the keep-alive timeout behavior on incoming connections. Defaults to `5000` - */ - keepAliveTimeout: number; - /** * Port number to listen on when running as a server. Defaults to `8545` */ @@ -26,7 +16,6 @@ export default interface ServerOptions extends ProviderOptions { export const getDefault = (options?: ServerOptions) => { return Object.assign( { - keepAliveTimeout: 5000, port: 8545, ws: true }, From 1d34018d5a559e676144f41f6d308b35ce56011a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 11 Aug 2020 18:48:32 -0400 Subject: [PATCH 424/691] Fix blockLogs filter by pulling filterByTopic out into its own fn --- src/chains/ethereum/src/things/blocklogs.ts | 50 ++++++++++----------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index 32678e8116..a6ae9f255a 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -10,6 +10,29 @@ const _raw = Symbol("raw"); const _logs = Symbol("logs"); const _blockNumber = Symbol("blockNumber"); +const filterByTopic = (expectedTopics: (string | string[])[], logTopics: Buffer[]) => { + // Exclude log if its number of topics is less than the number expected + if (expectedTopics.length > logTopics.length) return false; + + // for every expectedTopic, we must much the log topic in the same position + return expectedTopics.every((expectedTopic, logPosition) => { + // a `null` topic means "anything" + if (expectedTopic === null) return true; + + let expectedTopicSet: string[]; + if (!Array.isArray(expectedTopic)) { + return logTopics[logPosition].equals(Data.from(expectedTopic).toBuffer()); + } + // an empty rule set means "anything" + if (expectedTopic.length === 0) return true; + expectedTopicSet = expectedTopic; + + const logTopic = logTopics[logPosition]; + // "OR" logic, e.g., [[A, B]] means log topic in the first position matching either "A" OR "B": + return expectedTopicSet.some(expectedTopic => logTopic.equals(Data.from(expectedTopic).toBuffer())); + }); +} + export default class BlockLogs { [_raw]: [blockHash: Buffer, blockLog: BlockLog[]]; @@ -119,29 +142,6 @@ export default class BlockLogs { }; } - #filterByTopic = (expectedTopics: (string | string[])[], logTopics: Buffer[]) => { - // Exclude log if its number of topics is less than the number expected - if (expectedTopics.length > logTopics.length) return false; - - // for every expectedTopic, we must much the log topic in the same position - return expectedTopics.every((expectedTopic, logPosition) => { - // a `null` topic means "anything" - if (expectedTopic === null) return true; - - let expectedTopicSet: string[]; - if (!Array.isArray(expectedTopic)) { - return logTopics[logPosition] === Data.from(expectedTopic).toBuffer(); - } - // an empty rule set means "anything" - if (expectedTopic.length === 0) return true; - expectedTopicSet = expectedTopic; - - const logTopic = logTopics[logPosition].toString(); - // "OR" logic, e.g., [[A, B]] means log topic in the first position matching either "A" OR "B": - return expectedTopicSet.some(expectedTopic => logTopic === expectedTopic); - }); - } - /** * Note: you must set `this.blockNumber: Quantity` first! * @@ -166,12 +166,12 @@ export default class BlockLogs { } else { for (const log of logs) { if (!expectedAddresses.some(address => address.equals(log.address))) continue; - if (this.#filterByTopic(expectedTopics, log.topics)) yield log.toJSON(); + if (filterByTopic(expectedTopics, log.topics)) yield log.toJSON(); } } } else if (expectedTopics.length !== 0) { for (const log of logs) { - if (this.#filterByTopic(expectedTopics, log.topics)) yield log.toJSON(); + if (filterByTopic(expectedTopics, log.topics)) yield log.toJSON(); } } else { yield* logs.toJSON(); From 3ad48069ef984e52946ff4d331f4b5533b8c270f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 11 Aug 2020 18:48:49 -0400 Subject: [PATCH 425/691] Add types for getTxFn --- src/chains/ethereum/src/components/block-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index 597df00d4b..fbb9fc05ca 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -157,7 +157,7 @@ export class Block { } } - getTxFn = (include = false): ((tx: Transaction) => {[key: string]: string} | Data) => { + getTxFn = (include = false): ((tx: Transaction) => {[key: string]: string | Data | Quantity} | Data) => { if (include) { return (tx: Transaction) => tx.toJSON(this); } else { From ed5380e640f6e0fa3803350f7db985db02c6e93e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 12 Aug 2020 10:04:26 -0400 Subject: [PATCH 426/691] fix eth_sendRawTransaction --- src/chains/ethereum/src/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 97ca76e037..c6e7b8906c 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -904,9 +904,9 @@ export default class EthereumApi implements types.Api { * @param transaction * @returns The transaction hash */ - async eth_sendRawTransaction(transaction: any) { - const tx = new Transaction(Buffer.from(transaction), {common: this.#common}, Transaction.types.signed); - return await this.#blockchain.queueTransaction(tx); + async eth_sendRawTransaction(transaction: string) { + const tx = new Transaction(transaction, {common: this.#common}, Transaction.types.signed); + return this.#blockchain.queueTransaction(tx) } /** From 45bc234c54fda54d388f6e9ad8a513e97326c9ce Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 12 Aug 2020 10:07:59 -0400 Subject: [PATCH 427/691] ensure http-server catch after abort doesn't cause crash --- src/packages/core/src/servers/http-server.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/packages/core/src/servers/http-server.ts b/src/packages/core/src/servers/http-server.ts index a19695cbaa..b0cd446646 100644 --- a/src/packages/core/src/servers/http-server.ts +++ b/src/packages/core/src/servers/http-server.ts @@ -143,7 +143,12 @@ export default class HttpServer { } const data = connector.format(result, payload); sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); - }).catch((error: any) => { + }).catch(error => { + if (aborted) { + // if the request has been aborted don't try sending (it'll + // cause an `Unhandled promise rejection` if we try) + return; + } const data = connector.formatError(error, payload); sendResponse( response, From 6af47e96d477191d63d114129b8425a2de1cf707 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 12 Aug 2020 10:10:51 -0400 Subject: [PATCH 428/691] simplify executor typings --- src/packages/utils/src/utils/executor.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index 7909a0c163..e99738ce19 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -18,11 +18,11 @@ export class Executor { * @param methodName The name of the JSON-RPC method to execute. * @param params The params to pass to the JSON-RPC method. */ - public execute ( + public execute >( api: T, - methodName: KnownKeys, - params: Parameters]> - ): Promise<{value: ReturnType]>}> { + methodName: M, + params: Parameters + ) { // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { From 88ee1731f20ebc9f1fa614866ea8d582a710860a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 12 Aug 2020 10:14:46 -0400 Subject: [PATCH 429/691] Change use of "Ledger" to "API" --- src/chains/ethereum/src/api.ts | 4 ++-- src/chains/ethereum/src/blockchain.ts | 2 +- src/packages/core/__tests__/connector.test.ts | 8 ++++---- src/packages/core/src/connector.ts | 2 +- src/packages/utils/src/utils/executor.ts | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index c6e7b8906c..bcdb0af838 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -95,11 +95,11 @@ export default class EthereumApi implements types.Api { readonly #wallet: Wallet; /** - * This is the Ethereum ledger that the provider interacts with. + * This is the Ethereum API that the provider interacts with. * The only methods permitted on the prototype are the supported json-rpc * methods. * @param options - * @param ready Callback for when the ledger is fully initialized + * @param ready Callback for when the API is fully initialized */ constructor(options: EthereumOptions, emitter: Emittery.Typed<{message: any}, "connect" | "disconnect">) { const opts = (this.#options = options); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 4b54114c7b..cd0381ee85 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -67,7 +67,7 @@ export default class Blockchain extends Emittery.Typed { assert.strictEqual(result, "0x56bc75e2d63100000"); }); - // duck punch a property that shouldn't appear on the ledger. we test this - // to make sure that 3rd party ledger implementations can't shoot themselves + // duck punch a property that shouldn't appear on the API. we test this + // to make sure that 3rd party API implementations can't shoot themselves // in the foot on accident - it.skip("TODO: allow 'injecting' our own engine or ledger into a provider!", async () => { + it.skip("TODO: allow 'injecting' our own engine or API into a provider!", async () => { const p = Ganache.provider() as EthereumProvider; // this won't work becase ganache uses _real_ private properties that can't // be duck punched. This test is supposed to ensure that _real_ non-function // own properties (and __proto__ properties) can't be executed. - (p as any)._engine._ledger.__proto__.illegalProperty = true; + (p as any)._engine._api.__proto__.illegalProperty = true; await assert.rejects(p.send("illegalProperty" as any, []), { message: "`The method illegalProperty does not exist/is not available`" }); diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index 1c5af94313..2d5c2274df 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -15,7 +15,7 @@ export default { // for that (yet), instead of "all" (0) or just 1 as we are doing here: const requestCoordinator = new utils.RequestCoordinator(providerOptions.asyncRequestProcessing ? 0 : 1); - // The Executor is responsible for actually executing the method on the chain/ledger. + // The Executor is responsible for actually executing the method on the chain/API. // It performs some safety checks to ensure "safe" method execution before passing it // to a RequestCoordinator. const executor = new utils.Executor(requestCoordinator); diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index e99738ce19..15d31ef4dd 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -7,14 +7,14 @@ export class Executor { #requestCoordinator: RequestCoordinator /** - * The Executor handles execution of methods on the given Ledger + * The Executor handles execution of methods on the given API */ constructor(requestCoordinator: RequestCoordinator) { this.#requestCoordinator = requestCoordinator; } /** - * Executes the method with the given methodName on the Ledger + * Executes the method with the given methodName on the API * @param methodName The name of the JSON-RPC method to execute. * @param params The params to pass to the JSON-RPC method. */ @@ -38,8 +38,8 @@ export class Executor { if ((hasOwn(api.__proto__, methodName) && methodName !== "constructor") || hasOwn(api, methodName)) { // cast methodName from `KnownKeys & string` back to KnownKeys so our return type isn't weird. const fn = api[methodName]; - // just double check, in case a Ledger breaks the rules and adds non-fns - // to their Ledger interface. + // just double check, in case a API breaks the rules and adds non-fns + // to their API interface. if (typeof fn === "function") { // queue up this method for actual execution: return this.#requestCoordinator.queue(fn, api, params); From e627ea22397a8ab1df3b6084f2b7d4ae903790f0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 12 Aug 2020 12:21:29 -0400 Subject: [PATCH 430/691] Fix simulateTransaction a little more --- src/chains/ethereum/src/blockchain.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index cd0381ee85..51580e5b5f 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -479,11 +479,20 @@ export default class Blockchain extends Emittery.Typed Date: Wed, 12 Aug 2020 12:21:45 -0400 Subject: [PATCH 431/691] Typings updates --- .../ethereum/__tests__/api/eth/logs.test.ts | 2 +- .../__tests__/api/personal/personal.test.ts | 2 +- src/chains/ethereum/src/api.ts | 36 +++++----- src/chains/ethereum/src/blockchain.ts | 1 + src/chains/ethereum/src/index.ts | 13 ++-- src/chains/ethereum/src/miner.ts | 5 +- src/chains/ethereum/src/provider.ts | 52 +++++++------- src/chains/ethereum/src/things/blocklogs.ts | 2 +- src/chains/ethereum/src/wallet.ts | 6 +- src/chains/tezos/src/index.ts | 2 +- src/packages/core/__tests__/connector.test.ts | 6 +- src/packages/core/__tests__/server.test.ts | 42 ++++++------ src/packages/core/package.json | 2 +- src/packages/core/src/servers/http-server.ts | 7 +- src/packages/core/src/servers/ws-server.ts | 67 ++++++++++++------- src/packages/flavors/src/index.ts | 6 +- .../src/things/json-rpc/json-rpc-quantity.ts | 1 + src/packages/utils/src/things/jsonrpc.ts | 8 +-- src/packages/utils/src/things/promievent.ts | 52 +++++++++++--- src/packages/utils/src/types/connector.ts | 8 +-- 20 files changed, 189 insertions(+), 131 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts index 1c33ee0341..d408e088af 100644 --- a/src/chains/ethereum/__tests__/api/eth/logs.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -44,7 +44,7 @@ describe("api", () => { } it("subscribes and unsubscribes", async () => { - const subscriptionId = await provider.send("eth_subscribe", ["logs", {fromBlock: ""}]); + const subscriptionId = await provider.send("eth_subscribe", ["logs"]); assert(subscriptionId != null); assert.notStrictEqual(subscriptionId, false); diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/__tests__/api/personal/personal.test.ts index 264740e973..3cbf925134 100644 --- a/src/chains/ethereum/__tests__/api/personal/personal.test.ts +++ b/src/chains/ethereum/__tests__/api/personal/personal.test.ts @@ -71,7 +71,7 @@ describe("api", () => { // make sure we can't use the account with bad passphrases const invalidPassphrases = ["this is not my passphrase", null, undefined, Buffer.allocUnsafe(0), 1, 0, Infinity, NaN]; await Promise.all(invalidPassphrases.map(invalidPassphrase => { - return assert.rejects(provider.send("personal_sendTransaction", [transaction, invalidPassphrase]), { + return assert.rejects(provider.send("personal_sendTransaction", [transaction, invalidPassphrase as any]), { message: "could not decrypt key with given password" }, "Transaction should have rejected due to locked from account with wrong passphrase") })); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index bcdb0af838..afd8621486 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -138,7 +138,7 @@ export default class EthereumApi implements types.Api { * @param {String} value - String to store. * @returns returns true if the value was stored, otherwise false. */ - async db_putString(dbName, key, value) { + async db_putString(dbName: string, key: string, value: string) { return false; }; @@ -149,7 +149,7 @@ export default class EthereumApi implements types.Api { * @param {String} key - Key name. * @returns The previously stored string. */ - async db_getString(dbName, key) { + async db_getString(dbName: string, key: string) { return ""; }; @@ -161,7 +161,7 @@ export default class EthereumApi implements types.Api { * @param {DATA} data - Data to store. * @returns true if the value was stored, otherwise false. */ - async db_putHex(dbName, key, data) { + async db_putHex(dbName: string, key: string, data: string) { return false; }; @@ -172,18 +172,18 @@ export default class EthereumApi implements types.Api { * @param {String} key - Key name. * @returns The previously stored data. */ - async db_getHex(dbName, key) { + async db_getHex(dbName: string, key: string) { return "0x00"; }; //#endregion //#region bzz async bzz_hive() { - return []; + return [] as any[]; } async bzz_info() { - return []; + return [] as any[]; } //#endregion @@ -211,18 +211,20 @@ export default class EthereumApi implements types.Api { * @returns true if it worked */ async evm_setAccountNonce(address: string, nonce: string) { - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { const buffer = Address.from(address).toBuffer(); const blockchain = this.#blockchain; const stateManager = blockchain.vm.stateManager; stateManager.getAccount(buffer, (err: Error, account: EthereumAccount) => { if (err) { - return void reject(err) + reject(err); + return; } account.nonce = Quantity.from(nonce).toBuffer(); stateManager.putAccount(buffer, account, (err: Error) => { if (err) { - return void reject(err); + reject(err); + return; } blockchain.mine(0).then(() => resolve(true), reject); @@ -522,7 +524,7 @@ export default class EthereumApi implements types.Api { } async eth_getCompilers() { - return []; + return [] as string[]; } /** @@ -568,7 +570,7 @@ export default class EthereumApi implements types.Api { * @param index - the uncle's index position. */ async eth_getUncleByBlockHashAndIndex(hash: Data, index: Quantity) { - return null; + return null as ReturnType; } /** @@ -578,7 +580,7 @@ export default class EthereumApi implements types.Api { * @param uncleIndex - the uncle's index position. */ async eth_getUncleByBlockNumberAndIndex(blockNumber: Buffer | Tag = Tag.LATEST, uncleIndex: Quantity) { - return null; + return null as ReturnType; } /** @@ -591,7 +593,7 @@ export default class EthereumApi implements types.Api { * @returns the hash of the current block, the seedHash, and the boundary condition to be met ("target"). */ async eth_getWork(filterId: Quantity) { - return []; + return [] as [string, string, string] | []; }; /** @@ -1115,7 +1117,7 @@ export default class EthereumApi implements types.Api { const unsubscribe = this.#blockchain.on("block", (block: Block) => { value.updates.push(Data.from(block.value.hash(), 32)); }); - const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.block}; + const value = {updates: [] as Data[], unsubscribe, filter: null as FilterArgs, type: FilterTypes.block}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1131,7 +1133,7 @@ export default class EthereumApi implements types.Api { const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { value.updates.push(Data.from(transaction.hash(), 32)); }); - const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.pendingTransaction}; + const value = {updates: [] as Data[], unsubscribe, filter: null as FilterArgs, type: FilterTypes.pendingTransaction}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1175,7 +1177,7 @@ export default class EthereumApi implements types.Api { value.updates.push(...blockLogs.filter(addresses, topics)); } }); - const value = {updates: [], unsubscribe, filter, type: FilterTypes.log}; + const value = {updates: [] as any[], unsubscribe, filter, type: FilterTypes.log}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1520,7 +1522,7 @@ export default class EthereumApi implements types.Api { * @returns More Info: https://github.com/ethereum/wiki/wiki/JSON-RPC#shh_getfilterchanges */ async shh_getFilterChanges(id: string) { - return []; + return [] as any[]; }; /** diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 51580e5b5f..ab9b5a7112 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -115,6 +115,7 @@ export default class Blockchain extends Emittery.Typed - implements types.Connector> { + implements types.Connector, JsonRpcTypes.Response> { #provider: Provider; @@ -36,22 +36,17 @@ export class EthereumConnector extends Emittery.Typed; } - handle(payload: JsonRpcTypes.Request, connection: HttpRequest | WebSocket): PromiEvent { + handle(payload: JsonRpcTypes.Request, connection: HttpRequest | WebSocket) { const method = payload.method; if (method === "eth_subscribe") { if (isHttp(connection)) { const err = new Error("notifications not supported") as Error & {code: number}; const error = JsonRpcTypes.Error(payload.id, err); - return PromiEvent.reject(error); - } else { - return this.#provider.request({method: "eth_subscribe", params: payload.params as Parameters}); + // return Promise.reject(error); } } - const provider = this.#provider; const params = payload.params as Parameters; - return new PromiEvent((resolve, reject) => { - provider.request({method, params}).then(resolve).catch(reject); - }); + return this.#provider.requestRaw({method, params}); } format(result: any, payload: JsonRpcTypes.Request): RecognizedString { diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 16a3414d23..da7f236aa0 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -114,14 +114,12 @@ export default class Miner extends Emittery { const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); - const blockLogs = []; const blockData = { blockTransactions, transactionsTrie, receiptTrie, gasUsed: 0n, - timestamp: block.header.timestamp, - logs: blockLogs + timestamp: block.header.timestamp }; // don't mine anything at all if maxTransactions is `0` @@ -192,7 +190,6 @@ export default class Miner extends Emittery { const txKey = rlpEncode(numTransactions); promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); promises.push(putInTrie(receiptTrie, txKey, receipt)); - // update the block's bloom const bloom = result.bloom.bitvector; diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 1a346ee3bb..ec9d3dd7a9 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -6,6 +6,8 @@ import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; import {PromiEvent, types, utils} from "@ganache/utils"; +type mergePromiseGenerics = Promise ? X : never>; + interface Callback { (err?: Error, response?: JsonRpcTypes.Response): void; } @@ -38,9 +40,9 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co return cloneDeep(this.#options); } - public send(payload: JsonRpcTypes.Request, callback?: Callback): void; - public send(method: types.KnownKeys, params?: Parameters): Promise; - public send(arg1: types.KnownKeys | JsonRpcTypes.Request, arg2?: Callback | any[]): Promise { + public send(payload: JsonRpcTypes.Request, callback?: Callback) : any; + public send(method: types.KnownKeys, params?: Parameters) : any; + public send(arg1: types.KnownKeys | JsonRpcTypes.Request, arg2?: Callback | any[]) { let method: types.KnownKeys; let params: any; let response: Promise<{}>; @@ -99,26 +101,29 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co return this.send(payload, callback); } - public request = types.KnownKeys>(request: Parameters["length"] extends 0 ? {method: Method} : never): any; // ReturnType; - public request = types.KnownKeys>(request: RequestParams): any; // ReturnType; - public request = types.KnownKeys>({method, params}: RequestParams) { - return this.#executor.execute(this.#api, method, params).then(result => { - const promise = result.value as PromiseLike>; - if (promise instanceof PromiEvent) { - promise.on("message", (data) => { - // EIP-1193 - this.emit("message" as never, data as never); - // legacy - this.emit("data" as never, { - jsonrpc: "2.0", - method: "eth_subscription", - params: (data as any).data - } as never); - }); - } - return promise.then(JSON.stringify).then(JSON.parse); - }).catch((err: Error) => { - // reformat the error to include a `code` + public request>(request: Parameters["length"] extends 0 ? {method: Method} : never): mergePromiseGenerics>; + public request>(request: RequestParams): mergePromiseGenerics>; + public request>(request: RequestParams) { + return this.requestRaw(request).then(r => r.value).then(v => JSON.parse(JSON.stringify(v))); + } + + public async requestRaw>({method, params}: RequestParams) { + const result = await this.#executor.execute(this.#api, method, params); + const promise = (result.value as mergePromiseGenerics); + if (promise instanceof PromiEvent) { + promise.on("message", (data) => { + // EIP-1193 + this.emit(("message" as never), (data as never)); + // legacy + this.emit(("data" as never), ({ + jsonrpc: "2.0", + method: "eth_subscription", + params: (data as any).data + } as never)); + }); + } + const value = promise.catch((err: Error) => { + // reformat errors, yo. this is all horrible... const e = new Error(err.message); (e as any).code = -32000; if (this.#options.vmErrorsOnRPCResponse && (err as any).result) { @@ -127,6 +132,7 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co // then rethrow throw e; }); + return { value: value }; } public disconnect = async () => { diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index a6ae9f255a..7a40f4f045 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -92,7 +92,7 @@ export default class BlockLogs { } [_logs]() { - const blockNumber = this[_blockNumber]; + const blockNumber = this.blockNumber; const raw = this[_raw]; const logs = raw[1]; const l = this.length; diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 3030d6dcc9..b67a7f567a 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -141,8 +141,8 @@ export default class Wallet { //#region save accounts to disk if (opts.account_keys_path != null) { const fileData = { - addresses: {}, - private_keys: {} + addresses: {} as {[address: string]: string}, + private_keys: {} as {[address: string]: Data} }; unlockedAccounts.forEach((privateKey, address) => { fileData.addresses[address] = address; @@ -249,7 +249,7 @@ export default class Wallet { }; } - public async decrypt(keyfile: EncryptType, passphrase) { + public async decrypt(keyfile: EncryptType, passphrase: crypto.BinaryLike) { const crypt = keyfile.crypto; if (crypt.cipher !== CIPHER) { diff --git a/src/chains/tezos/src/index.ts b/src/chains/tezos/src/index.ts index 2b20f4f665..f066ba11a3 100644 --- a/src/chains/tezos/src/index.ts +++ b/src/chains/tezos/src/index.ts @@ -9,7 +9,7 @@ export type TezosProvider = Provider; export const TezosProvider = Provider; export class TezosConnector extends Emittery.Typed - implements types.Connector { + implements types.Connector { provider: Provider; #api: TezosApi; diff --git a/src/packages/core/__tests__/connector.test.ts b/src/packages/core/__tests__/connector.test.ts index 0b84cd3e46..fceed295a2 100644 --- a/src/packages/core/__tests__/connector.test.ts +++ b/src/packages/core/__tests__/connector.test.ts @@ -78,11 +78,11 @@ describe("connector", () => { " ", "constructor" ] as const; - illegalMethodNames.forEach(methodName => { - assert.throws(() => p.send(methodName as any), { + await Promise.all(illegalMethodNames.map(methodName => { + assert.rejects(() => p.send(methodName as any), { message: `The method ${methodName} does not exist/is not available` }); - }); + })); // make sure we reject non-strings over the classical send interface const circular: any = {}; diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/__tests__/server.test.ts index a66e0287db..35796e0da0 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -352,10 +352,10 @@ describe("server", () => { try { const provider = s.provider as EthereumProvider; - const oldRequest = provider.request; + const oldRequestRaw = provider.requestRaw; const req = request.post("http://localhost:" + port); const abortPromise = new Promise(resolve => { - provider.request = () => { + provider.requestRaw = () => { // abort the request object after intercepting the request req.abort(); return new Promise(innerResolve => { @@ -364,7 +364,7 @@ describe("server", () => { setImmediate(setImmediate, () => { // resolve the `provider.send` to make sure the server can // handle _not_ responding to a request that has been aborted: - innerResolve(); + innerResolve( {value: Promise.resolve() as any}); // and finally, resolve the `abort` promise: resolve(); }); @@ -377,7 +377,7 @@ describe("server", () => { // wait for the server to react to the requesrt's `abort` await abortPromise; - provider.request = oldRequest; + provider.requestRaw = oldRequestRaw; // now make sure we are still up and running: await simpleTest(); @@ -537,9 +537,10 @@ describe("server", () => { it("doesn't crash when the connection is closed while a request is in flight", async () => { const provider = s.provider as EthereumProvider; - provider.request = async () => { + provider.requestRaw = async () => { // close our websocket after intercepting the request await s.close(); + return {value: Promise.resolve(undefined) as any}; }; const ws = new WebSocket("ws://localhost:" + port); @@ -564,26 +565,25 @@ describe("server", () => { it("handles PromiEvent messages", async () => { const provider = s.provider as EthereumProvider; const message = "I hope you get this message"; - provider.request = () => { + const oldRequestRaw = provider.requestRaw.bind(provider); + provider.requestRaw = async () => { const promiEvent = new PromiEvent(resolve => { - resolve("0xsubscriptionId"); - setImmediate(() => promiEvent.emit("message", message)); + const subId = "0xsubscriptionId"; + resolve(subId); + setImmediate(() => promiEvent.emit("message", {data: {subscription: subId, result: message}})); }); - return promiEvent; + return {value: promiEvent as any}; }; const ws = new WebSocket("ws://localhost:" + port); const result = await new Promise(resolve => { ws.on("open", () => { - // If we get a message that means things didn't get closed as they - // should have OR they are closing too late for some reason and - // this test isn't testing anything. ws.on("message", data => { - const {result} = JSON.parse(data.toString()); + const {result, params} = JSON.parse(data.toString()); // ignore the initial response if (result === "0xsubscriptionId") return; - resolve(result); + resolve(params.result); }); const subscribeJson: any = { @@ -597,16 +597,18 @@ describe("server", () => { }); assert.strictEqual(result, message); + + provider.requestRaw = oldRequestRaw; }); it("doesn't crash when the connection is closed while a subscription is in flight", async () => { const provider = s.provider as EthereumProvider; let promiEvent: PromiEvent; - provider.request = () => { + provider.requestRaw = async () => { promiEvent = new PromiEvent(resolve => { resolve("0xsubscriptionId"); }); - return promiEvent; + return {value: promiEvent} as any; }; const ws = new WebSocket("ws://localhost:" + port); @@ -647,10 +649,10 @@ describe("server", () => { (IS_WINDOWS ? xit : it)("can handle backpressure", async () => { { // create tons of data to force websocket backpressure - const huge: any = {}; + const huge = {}; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; - (s.provider as EthereumProvider).request = async () => { - return huge; + (s.provider as EthereumProvider).requestRaw = async () => { + return {value: Promise.resolve(huge) as any}; }; } @@ -672,7 +674,7 @@ describe("server", () => { } else { reject( new Error( - "Possible false positive: Didn't detect backpressure " + + "Possible false positive: Didn't detect backpressure" + " before receiving a message. Ensure `s.provider.send` is" + " sending enough data." ) diff --git a/src/packages/core/package.json b/src/packages/core/package.json index 2b3a545ec0..e8f7063fce 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -25,7 +25,7 @@ "scripts": { "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" + "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/core/src/servers/http-server.ts b/src/packages/core/src/servers/http-server.ts index b0cd446646..fd2cec8738 100644 --- a/src/packages/core/src/servers/http-server.ts +++ b/src/packages/core/src/servers/http-server.ts @@ -3,6 +3,8 @@ import ContentTypes from "./utils/content-types"; import HttpResponseCodes from "./utils/http-response-codes"; import {Flavors} from "../options/server-options"; +type HttpMethods = "GET" | "OPTIONS" | "POST"; + const noop = () => {}; /** @@ -14,7 +16,7 @@ const noop = () => {}; * @param method * @param request */ -function prepareCORSResponseHeaders(method: string, request: HttpRequest) { +function prepareCORSResponseHeaders(method: HttpMethods, request: HttpRequest) { // https://fetch.spec.whatwg.org/#http-requests const origin = request.getHeader("origin"); const acrh = request.getHeader("access-control-request-headers"); @@ -135,7 +137,8 @@ export default class HttpServer { connector .handle(payload, request) - .then((result: any) => { + .then(({value}) => value) + .then(result => { if (aborted) { // if the request has been aborted don't try sending (it'll // cause an `Unhandled promise rejection` if we try) diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index 5071f6fbda..912a28d1f6 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -1,6 +1,10 @@ import uWS, {TemplatedApp, WebSocket} from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; import { FlavorMap } from "../options/server-options"; +import { PromiEvent } from "@ganache/utils"; +import { Options } from "@ganache/options"; + +type MergePromiseT = Promise ? X : never>; type WebSocketCapableFlavorMap = { [k in keyof FlavorMap]: FlavorMap[k]["handle"] extends ((payload: any, connection: WebSocket) => any) ? FlavorMap[k] : never; @@ -9,9 +13,14 @@ export type WebSocketCapableFlavor = { [k in keyof WebSocketCapableFlavorMap]: WebSocketCapableFlavorMap[k]; }[keyof WebSocketCapableFlavorMap]; +export type GanacheWebSocket = WebSocket & {closed?: boolean}; + +export type WebsocketServerOptions = Pick + export default class WebsocketServer { - #connections = new Set(); - constructor(app: TemplatedApp, connector: WebSocketCapableFlavor, options: any) { + #connections = new Map void>>(); + constructor(app: TemplatedApp, connector: WebSocketCapableFlavor, options: WebsocketServerOptions) { + const connections = this.#connections; app.ws("/", { /* WS Options */ compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression @@ -19,11 +28,12 @@ export default class WebsocketServer { idleTimeout: 120, // in seconds /* Handlers */ - open: (ws: WebSocket) => { - ws.promiEvents = new Set(); - this.#connections.add(ws); + open: (ws: GanacheWebSocket) => { + ws.closed = false; + connections.set(ws, new Set()); }, - message: async (ws: WebSocket, message: ArrayBuffer, isBinary: boolean) => { + + message: (ws: GanacheWebSocket, message: ArrayBuffer, isBinary: boolean) => { let payload: ReturnType; try { payload = connector.parse(Buffer.from(message)); @@ -32,40 +42,49 @@ export default class WebsocketServer { return; } - const resultEmitter = connector.handle(payload, ws); - resultEmitter.then(result => { + connector.handle(payload, ws).then(({value}) => { // The socket may have closed while we were waiting for the response // Don't bother trying to send to it if it was. if (ws.closed) return; - const message = connector.format(result, payload); - ws.send(message, isBinary, true); - }); - - resultEmitter.on("message", (result: any) => { - // note: we _don't_ need to check if `ws.closed` here because when - // `ws.closed` is set we remove this `"message"` event handler anyway. - const message = connector.format(result, payload); - ws.send(message, isBinary, true); + const resultEmitter = value as MergePromiseT; + resultEmitter.then(result => { + if (ws.closed) return; + + const message = connector.format(result, payload); + ws.send(message, isBinary, true); + }); + + // if the result is an emitter listen to its `"message"` event + if (resultEmitter instanceof PromiEvent) { + resultEmitter.on("message", (result: any) => { + // note: we _don't_ need to check if `ws.closed` here because when + // `ws.closed` is set we remove this event handler anyway. + const message = JSON.stringify({jsonrpc: "2.0", method: result.type, params: result.data}); + ws.send(message, isBinary, true); + }); + + // keep track of listeners to dispose off when the ws disconnects + connections.get(ws).add(resultEmitter.dispose); + } }); - ws.promiEvents.add(resultEmitter.dispose); }, + drain: (ws: WebSocket) => { // This is there so tests can detect if a small amount of backpressure // is happening and that things will still work if it does. We actually // don't do anything to manage excessive backpressure. options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); }, - close: (ws: WebSocket) => { + + close: (ws: GanacheWebSocket) => { ws.closed = true; - ws.promiEvents.forEach(dispose => dispose()); - ws.promiEvents.clear(); - this.#connections.delete(ws); + connections.get(ws).forEach(dispose => dispose()); + connections.delete(ws); } }); } close() { - this.#connections.forEach(ws => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); - this.#connections.clear(); + this.#connections.forEach((_, ws) => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); } } diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts index 72637c807c..87f11af44d 100644 --- a/src/packages/flavors/src/index.ts +++ b/src/packages/flavors/src/index.ts @@ -3,12 +3,12 @@ import {TezosConnector} from "@ganache/tezos"; import {EthereumConnector} from "@ganache/ethereum"; export const FlavorMap = { - tezos: TezosConnector, + //tezos: TezosConnector, ethereum: EthereumConnector }; export type FlavorMap = { - tezos: TezosConnector; +// tezos: TezosConnector; ethereum: EthereumConnector; }; @@ -20,4 +20,4 @@ export type Flavors = { [k in keyof FlavorMap]: FlavorMap[k]; }[keyof FlavorMap]; -export type Apis = T extends types.Connector ? R : never; +export type Apis = T extends types.Connector ? R : never; diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index 7832d79ce0..4c619d5df2 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -5,6 +5,7 @@ const toBigIntBE = require("bigint-buffer").toBigIntBE; export class Quantity extends BaseJsonRpcType { _nullable: boolean = false; public static from(value: number | bigint | string | Buffer, nullable = false) { + if (value instanceof Quantity) return value; const q = new _Quantity(value); q._nullable = nullable; return q; diff --git a/src/packages/utils/src/things/jsonrpc.ts b/src/packages/utils/src/things/jsonrpc.ts index 0844ec8295..f846627fc1 100644 --- a/src/packages/utils/src/things/jsonrpc.ts +++ b/src/packages/utils/src/things/jsonrpc.ts @@ -41,13 +41,13 @@ namespace JsonRpc { }; }; export const Error = (id: string, error: T, result?: unknown): Error => { - type E = {[K in keyof T]: K extends string ? T[K] : never} - // Error objects are weird, `message`isn't included in the property names, + type E = {[K in keyof T]: K extends string ? T[K] : never}; + // Error objects are weird, `message` isn't included in the property names, // so it is pulled out separately. - const details: E = {message: error.message} as any; + const details = {message: error.message} as E; Object.getOwnPropertyNames(error).forEach(name => { if (typeof name === "string") { - details[name] = error[name]; + (details as any)[name] = (error as any)[name]; } }); if (result !== undefined) { diff --git a/src/packages/utils/src/things/promievent.ts b/src/packages/utils/src/things/promievent.ts index cd2fbed972..43c7ac249f 100644 --- a/src/packages/utils/src/things/promievent.ts +++ b/src/packages/utils/src/things/promievent.ts @@ -1,16 +1,15 @@ import Emittery from "emittery"; -// PromiEvent's `resolve and `reject` (and the other static methods -- if you -// need their types too, add them!) return a PromiEvent, but the `Promise` type -// doesn't. +// PromiEvent's `resolve and `reject` need to return a PromiEvent, not just a +// Promise declare var Promise: { /** - * Creates a new rejected promievent for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected PromiEvent. + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. */ - reject(reason?: any): PromiEvent; - + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): PromiEvent; + /** * Creates a new resolved promievent for the provided value. * @param value A promise. @@ -31,9 +30,42 @@ class PromiEvent extends Promise { this.init(); } + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A PromiEvent for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null) { + const prom = new PromiEvent((resolve, reject) => { + this.onAny((eventName, eventData) => { + return prom.emit(eventName, eventData); + }); + const p = super.catch(onrejected); + p.then(resolve, reject); + }); + return prom; + } + + /** + * Creates a new resolved promievent. + * @returns A resolved promievent. + */ + static resolve(): PromiEvent; + /** + * Creates a new resolved promievent for the provided value. + * @param value A promise. + * @returns A promievent whose internal state matches the provided promise. + */ + static resolve(value: T | PromiseLike): PromiEvent; + static resolve(value?: T | PromiseLike) { + return new PromiEvent(resolve => { + resolve(value); + }); + } + /** * Used to immediately clear all event listeners on the instance and prevent - * any additional binding or emittion from the Emitter. + * any additional binding or emission from the Emitter. * * Once disposed no listeners can be bound to this emitter. * @@ -51,7 +83,7 @@ class PromiEvent extends Promise { interface PromiEvent extends Promise, Emittery { } -applyMixins(PromiEvent, [Promise, Emittery]); +applyMixins(PromiEvent, [Emittery]); export default PromiEvent; diff --git a/src/packages/utils/src/types/connector.ts b/src/packages/utils/src/types/connector.ts index 121ea3807d..69de94388f 100644 --- a/src/packages/utils/src/types/connector.ts +++ b/src/packages/utils/src/types/connector.ts @@ -1,13 +1,13 @@ import {Provider} from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; import { Api } from "./api"; +import { KnownKeys } from "../types"; import Emittery from "emittery"; -import PromiEvent from "../things/promievent"; /** * Connects an arbitrary public chain provider to ganache-core */ -export interface Connector extends Emittery.Typed { +export interface Connector extends Emittery.Typed { provider: Provider; /** @@ -21,8 +21,8 @@ export interface Connector Promise) - | ((payload: RequestFormat, connection: WebSocket) => PromiEvent); + | ((payload: RequestFormat, connection: HttpRequest) => Promise<{value: ReturnType]>}>) + | ((payload: RequestFormat, connection: WebSocket) => Promise<{value: ReturnType]>}>); /** * Formats the response (returned from `handle`) From 5f60e9ff28d7d286dea1d4b4ff52b77458b29f92 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 12 Aug 2020 12:21:55 -0400 Subject: [PATCH 432/691] . --- src/packages/utils/src/utils/request-coordinator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/utils/src/utils/request-coordinator.ts b/src/packages/utils/src/utils/request-coordinator.ts index 871c161b38..137a71cb14 100644 --- a/src/packages/utils/src/utils/request-coordinator.ts +++ b/src/packages/utils/src/utils/request-coordinator.ts @@ -71,8 +71,8 @@ export class RequestCoordinator { /** * Insert a new function into the queue. */ - public queue = any>(fn: T, thisArgument: any, argumentsList: Parameters): Promise<{value: ReturnType}> => { - return new Promise((resolve, reject) => { + public queue = unknown>(fn: T, thisArgument: any, argumentsList: Parameters) => { + return new Promise<{value: ReturnType}>((resolve, reject) => { // const executor is `async` to force the return value into a Promise. const executor = async () => { try { From 014210e22cdf1cf24f58b7e168d18de9376787f7 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 18:59:20 -0400 Subject: [PATCH 433/691] update mocha to v8.1.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 09fe83d65d..271d06e62a 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "fs-extra": "9.0.1", "into-stream": "5.1.1", "lerna": "3.22.1", - "mocha": "8.0.1", + "mocha": "8.1.1", "npm-package-arg": "8.0.1", "nyc": "15.1.0", "prettier": "2.0.5", From 2135b9a62cc2e2c7f752bb5b443723adaf3c25a6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 18:59:39 -0400 Subject: [PATCH 434/691] remote extra whitespace --- src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts index 55df24b17a..653c6c2d3d 100644 --- a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts @@ -35,7 +35,6 @@ describe("api", () => { assert.notStrictEqual(receipt, null); }); - it("handles transaction balance errors, callback style", (done) => { getProvider({legacyInstamine: true, vmErrorsOnRPCResponse: true}).then(async (provider) => { const accounts = await provider.send("eth_accounts"); From f5ae9aa851b3385ed38337d1adb3a05e51482a9d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 19:00:46 -0400 Subject: [PATCH 435/691] add additional Executor types --- src/packages/utils/src/utils/executor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index 15d31ef4dd..5a95807772 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -37,7 +37,7 @@ export class Executor { // } if ((hasOwn(api.__proto__, methodName) && methodName !== "constructor") || hasOwn(api, methodName)) { // cast methodName from `KnownKeys & string` back to KnownKeys so our return type isn't weird. - const fn = api[methodName]; + const fn = api[methodName as M]; // just double check, in case a API breaks the rules and adds non-fns // to their API interface. if (typeof fn === "function") { From f2ec66e00cd4337b2562ec933a29e514ff0518d3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 21:08:30 -0400 Subject: [PATCH 436/691] return `null` when block doesn't exist --- src/chains/ethereum/src/api.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index afd8621486..e6216d6328 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -510,8 +510,12 @@ export default class EthereumApi implements types.Api { */ async eth_getBlockTransactionCountByNumber(number: string | Buffer) { const rawBlock = await this.#blockchain.blocks.getRaw(number); - const data = rlpDecode(rawBlock); - return Quantity.from((data[1] as any).length); + if (rawBlock) { + const data = rlpDecode(rawBlock); + return Quantity.from((data[1] as any).length); + } else { + return null; + } } /** @@ -520,7 +524,11 @@ export default class EthereumApi implements types.Api { */ async eth_getBlockTransactionCountByHash(hash: string | Buffer) { const number = await this.#blockchain.blocks.getNumberFromHash(hash); - return this.eth_getBlockTransactionCountByNumber(number); + if (number) { + return this.eth_getBlockTransactionCountByNumber(number); + } else { + return null; + } } async eth_getCompilers() { From bd29aca3fb7d47c14caede973c8a421051fda318 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 21:10:11 -0400 Subject: [PATCH 437/691] ensure eth_chainId returns hex encoding --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index e6216d6328..48346c166f 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -675,7 +675,7 @@ export default class EthereumApi implements types.Api { * @EIP [155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) */ async eth_chainId() { - return this.#options.chainId.toString(); + return Quantity.from(this.#options.chainId); } /** From e7ae0b310fbca8f373949aa70e032fa4e8b1d78e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 21:08:30 -0400 Subject: [PATCH 438/691] return `null` when block doesn't exist --- src/chains/ethereum/src/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 48346c166f..904989f37c 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -490,7 +490,7 @@ export default class EthereumApi implements types.Api { */ async eth_getBlockByNumber(number: string | Buffer, transactions = false) { const block = await this.#blockchain.blocks.get(number); - return block.toJSON(transactions); + return block ? block.toJSON(transactions) : null; } /** @@ -501,7 +501,7 @@ export default class EthereumApi implements types.Api { */ async eth_getBlockByHash(hash: string | Buffer, transactions = false) { const block = await this.#blockchain.blocks.getByHash(hash); - return block.toJSON(transactions); + return block ? block.toJSON(transactions) : null; } /** From e52fc6c3d1be810c09f45406bfdc0abdd1947282 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 21:14:31 -0400 Subject: [PATCH 439/691] ensure blockLogs are deleted when snapshot is reverted --- src/chains/ethereum/src/blockchain.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index ab9b5a7112..7c18d73083 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -367,6 +367,7 @@ export default class Blockchain extends Emittery.Typed { blocks.del(block.value.header.number); blocks.del(block.value.header.hash()); + this.blockLogs.del(block.value.header.number); block.value.transactions.forEach(tx => { const txHash = tx.hash(); this.transactions.del(txHash); From 0ac4c24295b501c031f915445d9825668234ce5c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 21:15:00 -0400 Subject: [PATCH 440/691] Add exception error to transaction object --- src/chains/ethereum/src/things/transaction.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 4c36d4f83b..27f824b4d7 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -385,7 +385,14 @@ class Transaction extends (EthereumJsTransaction as any) { */ fillFromResult (result: RunTxResult) { const vmResult = result.execResult; - const status = vmResult.exceptionError ? ZERO_BUFFER : ONE_BUFFER; + const execException = vmResult.exceptionError; + let status: Buffer; + if (execException) { + status = ZERO_BUFFER; + this.execException = new Error(execException.error); + } else { + status = ONE_BUFFER; + } const gasUsed = result.gasUsed.toBuffer(); const logsBloom = result.bloom.bitvector; const logs = vmResult.logs || [] as TransactionLog[]; @@ -403,6 +410,8 @@ class Transaction extends (EthereumJsTransaction as any) { getLogs() { return this.#logs; }; + + public execException: Error = null; } export default Transaction; From d3860a3f4b665721ba4ca93f58b439cbf621353c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 21:15:26 -0400 Subject: [PATCH 441/691] reuse original Error --- src/chains/ethereum/src/provider.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index ec9d3dd7a9..f4568599fb 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -124,13 +124,12 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co } const value = promise.catch((err: Error) => { // reformat errors, yo. this is all horrible... - const e = new Error(err.message); - (e as any).code = -32000; + (err as any).code = -32000; if (this.#options.vmErrorsOnRPCResponse && (err as any).result) { - (e as any).result = JSON.parse(JSON.stringify((err as any).result)); + (err as any).result = JSON.parse(JSON.stringify((err as any).result)); } // then rethrow - throw e; + throw err; }); return { value: value }; } From 434dedaebde9a2a842a9734839c4295d7ce91bd7 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 13 Aug 2020 21:15:55 -0400 Subject: [PATCH 442/691] update eth_chainId tests --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index c49dc0a66a..5976053233 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -82,7 +82,7 @@ describe("api", () => { describe("eth_chainId", () => { it("should return the default chain id", async () => { const result = await provider.send("eth_chainId"); - assert.deepStrictEqual(result, "1337"); + assert.deepStrictEqual(result, "0x539"); }); xit("should use the default chain id when signing transactions", async () => { @@ -96,7 +96,7 @@ describe("api", () => { it("should update the default chain id", async () => { const provider = await getProvider({chainId: 1234}); const result = await provider.send("eth_chainId"); - assert.deepStrictEqual(result, "1234"); + assert.deepStrictEqual(result, "0x4d2"); }); }); From 7875df43d7dcc5511b7b06e0c520e2d2fc8d6933 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 14 Aug 2020 21:16:15 -0400 Subject: [PATCH 443/691] Add wsBinary option --- src/packages/core/src/options/server-options.ts | 12 +++++++++++- src/packages/core/src/servers/ws-server.ts | 14 ++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/packages/core/src/options/server-options.ts b/src/packages/core/src/options/server-options.ts index 63723411fc..3a102d5177 100644 --- a/src/packages/core/src/options/server-options.ts +++ b/src/packages/core/src/options/server-options.ts @@ -11,13 +11,23 @@ export default interface ServerOptions extends ProviderOptions { * Enable a websocket server. This is `true` by default. */ ws: boolean; + + /** + * Wether or not websockets should response with binary data (ArrayBuffers) or + * strings. + * + * Default is "auto", which responds using the same format as the incoming + * message that triggered the response. + */ + wsBinary: "auto" | boolean; } export const getDefault = (options?: ServerOptions) => { return Object.assign( { port: 8545, - ws: true + ws: true, + wsBinary: "auto" }, ProviderOptions.getDefault(options as ProviderOptions) ) as ServerOptions; diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index 912a28d1f6..58463e66fd 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -1,8 +1,7 @@ import uWS, {TemplatedApp, WebSocket} from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; -import { FlavorMap } from "../options/server-options"; +import ServerOptions, { FlavorMap } from "../options/server-options"; import { PromiEvent } from "@ganache/utils"; -import { Options } from "@ganache/options"; type MergePromiseT = Promise ? X : never>; @@ -15,12 +14,14 @@ export type WebSocketCapableFlavor = { export type GanacheWebSocket = WebSocket & {closed?: boolean}; -export type WebsocketServerOptions = Pick +export type WebsocketServerOptions = Pick export default class WebsocketServer { #connections = new Map void>>(); constructor(app: TemplatedApp, connector: WebSocketCapableFlavor, options: WebsocketServerOptions) { const connections = this.#connections; + const wsBinary = options.wsBinary; + const autoBinary = wsBinary === "auto"; app.ws("/", { /* WS Options */ compression: uWS.SHARED_COMPRESSOR, // Zero memory overhead compression @@ -47,12 +48,17 @@ export default class WebsocketServer { // Don't bother trying to send to it if it was. if (ws.closed) return; + const useBinary = autoBinary ? isBinary : (wsBinary as boolean); + const resultEmitter = value as MergePromiseT; resultEmitter.then(result => { if (ws.closed) return; const message = connector.format(result, payload); - ws.send(message, isBinary, true); + ws.send(message, useBinary, true); + }, err => { + const message = connector.formatError(err, payload); + ws.send(message, useBinary, true); }); // if the result is an emitter listen to its `"message"` event From 44355c256811066b20cb942c32f27bd872d02b19 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 14 Aug 2020 21:16:59 -0400 Subject: [PATCH 444/691] do not try to decrypt if we don't have a keyfile --- src/chains/ethereum/src/wallet.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index b67a7f567a..f514e43610 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -310,6 +310,9 @@ export default class Wallet { public async unlockAccount(lowerAddress: string, passphrase: string, duration: number) { const encryptedKeyFile = this.encryptedKeyFiles.get(lowerAddress); + if (encryptedKeyFile == null) { + return false; + } const secretKey = await this.decrypt(encryptedKeyFile, passphrase); const existingTimer = this.lockTimers.get(lowerAddress); From ad6784c301a446980d83a1accc57753db7c7114e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 14 Aug 2020 21:17:32 -0400 Subject: [PATCH 445/691] temporarily return latest for the pending block --- src/chains/ethereum/src/components/block-manager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index fbb9fc05ca..4e7b957ccf 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -59,7 +59,8 @@ export default class BlockManager extends Manager { // the key is probably a hex string, let nature takes its course. break; case Tag.PENDING: - return this.pending; + // TODO: build a real pending block! + return this.createBlock(this.latest.value.header); case Tag.EARLIEST: return this.earliest; default: From 97b072fdbf72238ecde84a241110f7b6a186a950 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 14 Aug 2020 21:18:21 -0400 Subject: [PATCH 446/691] generate better transaction JSON --- src/chains/ethereum/src/things/transaction.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 27f824b4d7..81090c1a1f 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -10,6 +10,7 @@ import {Block} from "../components/block-manager"; import TransactionReceipt from "./transaction-receipt"; import Common from "ethereumjs-common"; import { TransactionLog } from "./blocklogs"; +import Address from "./address"; type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; @@ -361,13 +362,13 @@ class Transaction extends (EthereumJsTransaction as any) { */ toJSON(block?: Block) { return { - hash: Data.from(this.hash()), + hash: Data.from(this.hash(), 32), nonce: Quantity.from(this.nonce), - blockHash: Data.from(block ? block.value.hash() : this._blockHash), - blockNumber: Data.from(block ? block.value.header.number : this._blockNum), + blockHash: Data.from(block ? block.value.hash() : this._blockHash, 32), + blockNumber: Quantity.from(block ? block.value.header.number : this._blockNum), transactionIndex: Quantity.from(this._index), - from: Data.from(this.from), - to: Data.from(this.to), + from: Address.from(this.from), + to: this.to.length === 0 ? null : Address.from(this.to), value: Quantity.from(this.value), gas: Quantity.from(this.gasLimit), gasPrice: Quantity.from(this.gasPrice), From b0d2bfea2f4b807aa7a3e089b96f18ddbeb1eac9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 14 Aug 2020 21:39:35 -0400 Subject: [PATCH 447/691] Add `legacyInstamine` mode and some back compat for old ganache --- npm-shrinkwrap.json | 66 ++-- src/chains/ethereum/src/api.ts | 59 +++- src/chains/ethereum/src/blockchain.ts | 291 +++++++++--------- .../ethereum/src/components/block-manager.ts | 5 +- src/chains/ethereum/src/components/manager.ts | 4 + src/chains/ethereum/src/miner.ts | 78 +++-- src/chains/ethereum/src/options.ts | 1 + 7 files changed, 282 insertions(+), 222 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 61f7d7a520..bd48abd60d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -3110,9 +3110,9 @@ } }, "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, "bindings": { @@ -8633,9 +8633,9 @@ } }, "mocha": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", - "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.1.tgz", + "integrity": "sha512-p7FuGlYH8t7gaiodlFreseLxEmxTgvyG9RgPHODFPySNhwUehu8NIb0vdSt3WFckSneswZ0Un5typYcWElk7HQ==", "dev": true, "requires": { "ansi-colors": "4.1.1", @@ -8654,7 +8654,7 @@ "ms": "2.1.2", "object.assign": "4.1.0", "promise.allsettled": "1.0.2", - "serialize-javascript": "3.0.0", + "serialize-javascript": "4.0.0", "strip-json-comments": "3.0.1", "supports-color": "7.1.0", "which": "2.0.2", @@ -8662,7 +8662,7 @@ "workerpool": "6.0.0", "yargs": "13.3.2", "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "yargs-unparser": "1.6.1" }, "dependencies": { "ansi-regex": { @@ -10369,10 +10369,13 @@ "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, "serialize-javascript": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", - "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } }, "set-blocking": { "version": "2.0.0", @@ -11369,14 +11372,6 @@ "make-error": "^1.1.1", "source-map-support": "^0.5.17", "yn": "3.1.1" - }, - "dependencies": { - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - } } }, "tslib": { @@ -12083,14 +12078,16 @@ } }, "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.1.tgz", + "integrity": "sha512-qZV14lK9MWsGCmcr7u5oXGH0dbGqZAIxTDrWXZDo5zUr6b6iUmelNKO6x6R1dQT24AH3LgRxJpr8meWy2unolA==", "dev": true, "requires": { + "camelcase": "^5.3.1", + "decamelize": "^1.2.0", "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" + "is-plain-obj": "^1.1.0", + "yargs": "^14.2.3" }, "dependencies": { "ansi-regex": { @@ -12132,12 +12129,13 @@ } }, "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", "dev": true, "requires": { "cliui": "^5.0.0", + "decamelize": "^1.2.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", @@ -12146,17 +12144,7 @@ "string-width": "^3.0.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "yargs-parser": "^15.0.1" } } } diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 904989f37c..2279d33f64 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -83,6 +83,29 @@ function parseFilter(filter: FilterArgs = {address: [], topics: []}, blockchain: }; } +function assertExceptionalTransactions(transactions: Transaction[]) { + let baseError = null; + let errors: string[]; + + transactions.forEach(transaction => { + if (transaction.execException) { + if (baseError) { + baseError = "Multiple VM Exceptions while processing transactions: \n\n"; + errors.push(`${Data.from(transaction.hash(), 32).toString()}: ${transaction.execException}\n`); + } else { + baseError = "VM Exception while processing transaction: "; + errors = [ transaction.execException.message ]; + } + } + }); + + if (baseError) { + const err = new Error(baseError + errors.join("\n")); + (err as any).result = "0x0"; + throw err; + } +} + export default class EthereumApi implements types.Api { readonly [index: string]: (...args: any) => Promise; @@ -115,8 +138,7 @@ export default class EthereumApi implements types.Api { name: "ganache", networkId: options.networkId, chainId: options.chainId, - comment: "Local test network", - bootstrapNodes: [] + comment: "Local test network" }, options.hardfork ); @@ -189,14 +211,19 @@ export default class EthereumApi implements types.Api { //#region evm /** - * Force a block to be mined. + * Force a single block to be mined. * * Mines a block independent of whether or not mining is started or stopped. + * Will mine an empty block if there are no available transactions to mine. * * @param timestamp? the timestamp a block should setup as the mining time. */ async evm_mine(timestamp?: number) { - await this.#blockchain.mine(-1, timestamp); + const transactions = await this.#blockchain.mine(-1, timestamp, true); + if (this.#options.vmErrorsOnRPCResponse) { + assertExceptionalTransactions(transactions); + } + return "0x0"; } @@ -357,7 +384,14 @@ export default class EthereumApi implements types.Api { * @returns true */ async miner_start(threads: number = 1) { - this.#blockchain.resume(threads); + if (this.#options.legacyInstamine === true) { + const transactions = await this.#blockchain.resume(threads); + if (transactions != null && this.#options.vmErrorsOnRPCResponse) { + assertExceptionalTransactions(transactions as any); + } + } else { + this.#blockchain.resume(threads); + } return true; } @@ -486,10 +520,10 @@ export default class EthereumApi implements types.Api { * Returns information about a block by block number. * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in th e default block parameter. * @param transactions Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions. - * @returns Block + * @returns the block, `null` if the block doesn't exist. */ async eth_getBlockByNumber(number: string | Buffer, transactions = false) { - const block = await this.#blockchain.blocks.get(number); + const block = await this.#blockchain.blocks.get(number).catch(_ => null); return block ? block.toJSON(transactions) : null; } @@ -500,7 +534,7 @@ export default class EthereumApi implements types.Api { * @returns Block */ async eth_getBlockByHash(hash: string | Buffer, transactions = false) { - const block = await this.#blockchain.blocks.getByHash(hash); + const block = await this.#blockchain.blocks.getByHash(hash).catch(_ => null); return block ? block.toJSON(transactions) : null; } @@ -542,7 +576,11 @@ export default class EthereumApi implements types.Api { */ async eth_getTransactionByBlockHashAndIndex(hash: string | Buffer, index: string) { const block = await this.eth_getBlockByHash(hash, true); - return block.transactions[parseInt(index, 10)]; + if (block) { + const tx = block.transactions[parseInt(index, 10)]; + if (tx) return tx; + } + return null; } /** @@ -832,7 +870,7 @@ export default class EthereumApi implements types.Api { const receiptPromise = blockchain.transactionReceipts.get(transactionHash); const blockPromise = transactionPromise.then(t => (t ? blockchain.blocks.get(t._blockNum) : null)); const [transaction, receipt, block] = await Promise.all([transactionPromise, receiptPromise, blockPromise]); - if (receipt && block && transaction) { + if (transaction) { return receipt.toJSON(block, transaction); } else { return null; @@ -1285,6 +1323,7 @@ export default class EthereumApi implements types.Api { */ async eth_getTransactionCount(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { const account = await this.#blockchain.accounts.get(Address.from(address), blockNumber); + if (!account) return null; return account.nonce; } diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 7c18d73083..3f2d978166 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -22,6 +22,8 @@ import VM from "ethereumjs-vm"; import Address from "./things/address"; import BlockLogManager from "./components/blocklog-manager"; +const unref = utils.unref; + export enum Status { // Flags started = 1, // 0000 0001 @@ -48,7 +50,7 @@ export type BlockchainOptions = { }; type BlockchainTypedEvents = {block: Block, blockLogs: BlockLogs, pendingTransaction: Transaction}; -type BlockchainEvents = "start" | "resume" | "pause" | "stop" | "step"; +type BlockchainEvents = "start" | "stop" | "step"; export default class Blockchain extends Emittery.Typed { #state: Status = Status.starting; @@ -78,27 +80,40 @@ export default class Blockchain extends Emittery.Typed 0."); + } - if (options.legacyInstamine) { - console.warn("Legacy instamining, where transactions are fully mined before the hash is returned, is deprecated and will be removed in the future."); + if (this.#options.vmErrorsOnRPCResponse === true) { + console.warn("Setting vmErrorsOnRPCResponse to true has no effect when not instamining, i.e., blockTime > 0."); + } + } } database.on("ready", async () => { - // TODO: get the latest block from the database - // if we have a latest block, `root` will be that block's header.stateRoot - // and we will skip creating the genesis block altogether - const root: Buffer = null; - this.trie = new CheckpointTrie(database.trie, root); - this.blocks = new BlockManager(this, database.blocks, {common}); + { // TODO: get the latest block from the database + // if we have a latest block, `root` will be that block's header.stateRoot + // and we will skip creating the genesis block altogether + const root: Buffer = null; + + this.trie = new CheckpointTrie(database.trie, root); + } + + const blocks = this.blocks = new BlockManager(this, database.blocks, {common: options.common}); this.blockLogs = new BlockLogManager(database.blockLogs); this.vm = this.createVmFromStateTrie(this.trie, options.allowUnlimitedContractSize); this.transactions = new TransactionManager(this, database.transactions, options); - this.transactionReceipts = new Manager( + this.transactionReceipts = new Manager( database.transactionReceipts, TransactionReceipt ); @@ -107,131 +122,111 @@ export default class Blockchain extends Emittery.Typed = null; - this.transactions.transactionPool.on("drain", () => { - if (this.#isPaused()) { - // only wait on the resume event once. - if (waitingOnResume) return waitingOnResume; - return waitingOnResume = this.once("resume").then(() => { - waitingOnResume = null; - // when coming out of an un-paused state the miner should mine as - // many transactions in this first block as it can - return this.mine(-1); - }); - } - return this.mine(1); - }); - } else { - const minerInterval = options.blockTime * 1000; - const intervalMine = () => { - let promise: Promise; - if (this.#isPaused()) { - promise = this.once("resume") - // after resuming from a paused state, wait for all transactions - // in the pool to be processed before mining. - .then(() => this.mine(-1)); + { // configure and start miner + const miner = this.#miner = new Miner(this.vm, this.#readyNextBlock, {legacyInstamine, instamine, gasLimit}); + + { // automatic mining + const mineAll = async () => this.#isPaused() ? null : this.mine(1); + if (instamine) { + // whenever the transaction pool is drained mine the txs into blocks + this.transactions.transactionPool.on("drain", mineAll); } else { - // when mining on an interval we always mine whatever executable - // transactions are currently available. - promise = this.mine(-1); + const wait = () => unref(setTimeout(mineNext, options.blockTime * 1000)); + const mineNext = () => mineAll().then(wait); + wait(); } - // set the mining timer once the promise resolves - promise.then(() => utils.unref(setTimeout(intervalMine, minerInterval))); - }; - utils.unref(setTimeout(intervalMine, minerInterval)); - } - - miner.on("transaction-failure", async (failureData: any) => { - this.emit("transaction-failure:" + Data.from(failureData.txHash).toString() as any, failureData.err); - }); + } - miner.on("block", async (blockData: any) => { - await this.#processingBlock; - const previousBlock = this.blocks.latest; - const previousHeader = previousBlock.value.header; - const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; - const block = this.blocks.createBlock({ - parentHash: previousHeader.hash(), - number: Quantity.from(previousNumber + 1n).toBuffer(), - coinbase: this.coinbase.toBuffer(), - timestamp: blockData.timestamp, - // difficulty: - gasLimit: options.gasLimit.toBuffer(), - transactionsTrie: blockData.transactionsTrie.root, - receiptTrie: blockData.receiptTrie.root, - stateRoot: this.trie.root, - gasUsed: Quantity.from(blockData.gasUsed).toBuffer() + miner.on("transaction-failure", async (failureData: any) => { + this.emit("transaction:" + Data.from(failureData.txHash).toString() as any, failureData.errorMessage); }); - this.blocks.latest = block; - this.#processingBlock = this.#database.batch(() => { - const blockHash = block.value.hash(); - const blockNumber = block.value.header.number; - const blockLogs = BlockLogs.create(blockHash); - blockData.blockTransactions.forEach((tx: Transaction, i: number) => { - const hash = tx.hash(); - // TODO: clean up transaction extra data stuffs because this is gross: - const extraData = [...tx.raw, blockHash, blockNumber, Quantity.from(i).toBuffer()]; - const encodedTx = rlpEncode(extraData); - this.transactions.set(hash, encodedTx); - - const receipt = tx.getReceipt(); - const encodedReceipt = receipt.serialize(true); - this.transactionReceipts.set(hash, encodedReceipt); - - tx.getLogs().forEach(log => { - blockLogs.append( - Quantity.from(i).toBuffer(), - hash, - log - ); - }) + miner.on("block", async (blockData: any) => { + await this.#processingBlock; + const previousBlock = blocks.latest; + const previousHeader = previousBlock.value.header; + const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; + const block = blocks.createBlock({ + parentHash: previousHeader.hash(), + number: Quantity.from(previousNumber + 1n).toBuffer(), + coinbase: this.coinbase.toBuffer(), + timestamp: blockData.timestamp, + // difficulty: + gasLimit: options.gasLimit.toBuffer(), + transactionsTrie: blockData.transactionsTrie.root, + receiptTrie: blockData.receiptTrie.root, + stateRoot: this.trie.root, + gasUsed: Quantity.from(blockData.gasUsed).toBuffer() }); - blockLogs.blockNumber = Quantity.from(blockNumber); - this.blockLogs.set(blockNumber, blockLogs.serialize()); - block.value.transactions = blockData.blockTransactions; - this.blocks.putBlock(block); - return {block, blockLogs}; - }); - this.#processingBlock.then(({block, blockLogs}) => { - this.blocks.latest = block; - - if (instamine && options.legacyInstamine) { - block.value.transactions.forEach(transaction => { - this.emit("transaction:" + Data.from(transaction.hash()).toString() as any); + blocks.latest = block; + this.#processingBlock = database.batch(() => { + const blockHash = block.value.hash(); + const blockNumber = block.value.header.number; + const blockLogs = BlockLogs.create(blockHash); + blockData.blockTransactions.forEach((tx: Transaction, i: number) => { + const hash = tx.hash(); + // TODO: clean up transaction extra data stuffs because this is gross: + const extraData = [...tx.raw, blockHash, blockNumber, Quantity.from(i).toBuffer()]; + const encodedTx = rlpEncode(extraData); + this.transactions.set(hash, encodedTx); + + const receipt = tx.getReceipt(); + const encodedReceipt = receipt.serialize(true); + this.transactionReceipts.set(hash, encodedReceipt); + + tx.getLogs().forEach(log => { + blockLogs.append( + Quantity.from(i).toBuffer(), + hash, + log + ); + }) }); + blockLogs.blockNumber = Quantity.from(blockNumber); + this.blockLogs.set(blockNumber, blockLogs.serialize()); + block.value.transactions = blockData.blockTransactions; + blocks.putBlock(block); + return {block, blockLogs}; + }); - // in legacy instamine mode we must delay the broadcast of new blocks - process.nextTick(() => { - // emit the block once everything has been fully saved to the database + return this.#processingBlock.then(({block, blockLogs}) => { + blocks.latest = block; + + if (instamine && options.legacyInstamine) { + block.value.transactions.forEach(transaction => { + this.emit("transaction:" + Data.from(transaction.hash()).toString() as any, transaction.execException); + }); + + // in legacy instamine mode we must delay the broadcast of new blocks + process.nextTick(() => { + // emit the block once everything has been fully saved to the database + this.emit("block", block); + this.emit("blockLogs", blockLogs); + }); + } else { this.emit("block", block); this.emit("blockLogs", blockLogs); - }); - } else { - this.emit("block", block); - this.emit("blockLogs", blockLogs); - } + } + }); }); - }); + } - this.blocks.earliest = this.blocks.latest = await this.#processingBlock.then(({block}) => block); + blocks.earliest = blocks.latest = await this.#processingBlock.then(({block}) => block); this.#state = Status.started; this.emit("start"); }); @@ -254,10 +249,10 @@ export default class Blockchain extends Emittery.Typed { + mine = async (maxTransactions: number, timestamp?: number, onlyOneBlock: boolean = false) => { await this.#processingBlock; const nextBlock = this.#readyNextBlock(this.blocks.latest.value, timestamp); - return this.#miner.mine(this.transactions.transactionPool.executables, nextBlock, maxTransactions); + return this.#miner.mine(this.transactions.transactionPool.executables, nextBlock, maxTransactions, onlyOneBlock); } #isPaused = () => { @@ -266,29 +261,40 @@ export default class Blockchain extends Emittery.Typed { + const blocks = this.blocks; + // ethereumjs vm doesn't use the callback style anymore + const getBlock = class T { + static async [promisify.custom] (number: BN) { + const block = await blocks.get(number.toBuffer()).catch(_ => null); + return block ? block.value : null; + } + }; + const vm = new VM({ state: stateTrie, activatePrecompiles: true, common: this.#options.common, allowUnlimitedContractSize, blockchain: { - getBlock: (number: BN, done: any) => { - this.blocks.get(number.toBuffer()).then((block) => done(block.value)); - } + getBlock } as any }); vm.on("step", this.emit.bind(this, "step")); @@ -432,7 +438,7 @@ export default class Blockchain extends Emittery.Typed { - this.on("start", resolve); - }); + await this.once("start"); } if (this.#state === Status.started) { this.#state = Status.stopping; diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/components/block-manager.ts index 4e7b957ccf..e67fd97d2d 100644 --- a/src/chains/ethereum/src/components/block-manager.ts +++ b/src/chains/ethereum/src/components/block-manager.ts @@ -118,7 +118,10 @@ export default class BlockManager extends Manager { if (block) return block; } - return super.get(tagOrBlockNumber); + const block = await super.get(tagOrBlockNumber); + if (block) return block; + + throw new Error("header not found"); } /** diff --git a/src/chains/ethereum/src/components/manager.ts b/src/chains/ethereum/src/components/manager.ts index 2bc9163099..5cde262750 100644 --- a/src/chains/ethereum/src/components/manager.ts +++ b/src/chains/ethereum/src/components/manager.ts @@ -19,6 +19,10 @@ export default class Manager { key = Data.from(key).toBuffer(); } + if (key.length === 0) { + return null; + } + return this.base.get(key).catch(e => { if (e.status === NOTFOUND) return null; throw e; diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index da7f236aa0..96812a5d7d 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -31,7 +31,8 @@ function replaceFromHeap( type MinerOptions = { gasLimit?: Quantity; - instamine: boolean + instamine: boolean; + legacyInstamine: boolean }; function byPrice(values: Transaction[], a: number, b: number) { @@ -71,20 +72,20 @@ export default class Miner extends Emittery { * * @param pending A live Map of pending transactions from the transaction * pool. The miner will update this Map by removing the best transactions - * and putting them in a block. - * It is possible the miner will not empty the Map if it can't fit all - * transactions within a single block. The remaining items will be left in - * the pending pool to be eligible for mining in the future. + * and putting them in new blocks. * * @param maxTransactions: maximum number of transactions per block. If `-1`, * unlimited. + * @param onlyOneBlock: set to `true` if only 1 block should be mined. + * + * @returns the transactions mined */ - public async mine(pending: Map>, block: Block, maxTransactions: number = -1) { + public async mine(pending: Map>, block: Block, maxTransactions: number = -1, onlyOneBlock = false) { // only allow mining a single block at a time (per miner) if (this.#isMining) { // if we are currently mining a block, set the `pending` property - // so the miner knows it should immediately mine another block once it is - // done with its current work. + // so the miner knows it can immediately start mining another block once + // it is done with its current work. this.#pending = pending; this.#updatePricedHeap(pending); return; @@ -92,25 +93,29 @@ export default class Miner extends Emittery { this.#setPricedHeap(pending); } - const lastBlock = await this.#mineTxs(pending, block, maxTransactions); + const {block: lastBlock, transactions} = await this.#mineTxs(pending, block, maxTransactions, onlyOneBlock); - // if there are more txs to mine, mine them! - if (maxTransactions !== 0 && this.#pending) { + // if there are more txs to mine, start mining them without awaiting their + // result. + if (onlyOneBlock === true && maxTransactions !== 0 && this.#pending) { const nextBlock = this.#createBlock(lastBlock); const pending = this.#pending; this.#pending = null; - this.mine(pending, nextBlock, this.#options.instamine ? 1 : -1); + await this.mine(pending, nextBlock, this.#options.instamine ? 1 : -1); } + return transactions; } - #mineTxs = async (pending: Map>, block: Block, maxTransactions: number) => { + #mineTxs = async (pending: Map>, block: Block, maxTransactions: number, onlyOneBlock: boolean) => { let keepMining = true; const priced = this.#priced; + const legacyInstamine = this.#options.legacyInstamine; + let blockTransactions: Transaction[]; do { keepMining = false; this.#isMining = true; - const blockTransactions: Transaction[] = []; + blockTransactions = []; const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); @@ -128,7 +133,7 @@ export default class Miner extends Emittery { await this.#commit(); this.emit("block", blockData); this.#reset(); - return block; + return {block, transactions: []}; } let numTransactions = 0; @@ -149,21 +154,22 @@ export default class Miner extends Emittery { // origin later. let best: Transaction; while ((best = priced.peek())) { + const origin = Data.from(best.from).toString(); + if (best.calculateIntrinsicGas() > blockGasLeft) { // if the current best transaction can't possibly fit in this block // go ahead and run the next best transaction, ignoring all other // pending transactions from this account for this block. - // * We don't replace this "best" tranasction with another from the + // * We don't replace this "best" transaction with another from the // same account. // * We do "unlock" this transaction in the transaction pool's `pending` // queue so it can be replaced, if needed. priced.removeBest(); best.locked = false; + this.#origins.delete(origin); continue; } - const origin = Data.from(best.from).toString(); - this.#currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); const runArgs = { @@ -251,20 +257,36 @@ export default class Miner extends Emittery { await Promise.all(promises); await this.#commit(); - this.emit("block", blockData); + if (legacyInstamine === true) { + // we need to wait for each block to be done mining when in legacy + // mode because things like `mine` and `miner_start` must wait for the + // first mine operation to be completed. + await this.emit("block", blockData); + } else { + this.emit("block", blockData); + } - if (priced.length !== 0) { - maxTransactions = this.#options.instamine ? 1 : -1; - block = this.#createBlock(block); + if (onlyOneBlock) { this.#currentlyExecutingPrice = 0n; - } else { - // reset the miner this.#reset(); + break; + } else { + this.#currentlyExecutingPrice = 0n; + this.#updatePricedHeap(pending); + + if (priced.length !== 0) { + maxTransactions = this.#options.instamine ? 1 : -1; + block = this.#createBlock(block); + continue; + } else { + // reset the miner + this.#reset(); + } } } while (keepMining); - return block; + return {block, transactions: blockTransactions}; } #runTx = async (runArgs: any, origin: string, pending: Map>) => { @@ -298,7 +320,7 @@ export default class Miner extends Emittery { } } - this.emit("transaction-failure", {txHash: runArgs.tx.hash(), err}); + this.emit("transaction-failure", {txHash: runArgs.tx.hash(), errorMessage}); return null; } } @@ -307,7 +329,6 @@ export default class Miner extends Emittery { this.#origins.clear(); this.#priced.clear(); this.#isMining = false; - this.#currentlyExecutingPrice = 0n; }; #setPricedHeap = (pending: Map>) => { @@ -339,7 +360,8 @@ export default class Miner extends Emittery { const next = heap.peek(); if (next && !next.locked) { const price = Quantity.from(next.gasPrice).toBigInt(); - if (this.#currentlyExecutingPrice < price) { + + if (this.#currentlyExecutingPrice > price) { // don't insert a transaction into the miner's `priced` heap // if it will be better than its last continue; diff --git a/src/chains/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts index dd621d9c4a..13cec338b1 100644 --- a/src/chains/ethereum/src/options.ts +++ b/src/chains/ethereum/src/options.ts @@ -21,6 +21,7 @@ type EthereumOptions = Pick< | "mnemonic" | "legacyInstamine" | "account_keys_path" + | "vmErrorsOnRPCResponse" >; export default EthereumOptions; From 4735d4f67cb3bd07f621a1974db5ae0d9af2bd92 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 19 Aug 2020 18:39:31 -0400 Subject: [PATCH 448/691] make eth_getTransactionByHash return pending txs --- src/chains/ethereum/src/api.ts | 12 +++++++-- .../src/components/transaction-pool.ts | 25 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 2279d33f64..4e9dcd9eb9 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -852,8 +852,16 @@ export default class EthereumApi implements types.Api { */ async eth_getTransactionByHash(transactionHash: string) { const chain = this.#blockchain; - const transaction = await chain.transactions.get(Data.from(transactionHash).toBuffer()); - return transaction; + const hashBuffer = Data.from(transactionHash).toBuffer(); + const transaction = await chain.transactions.get(hashBuffer); + if (transaction == null) { + // maybe it is pending? + const tx = chain.transactions.transactionPool.find(hashBuffer); + if (tx === null) return null; + return tx.toJSON(null); + } else { + return transaction.toJSON(); + } } /** diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index 059423f2af..f7c35e30f9 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -209,6 +209,31 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { } } + /** + * Returns the transaction matching the given hash + * @param transactionHash + */ + public find(transactionHash: Buffer) { + for (let [_, transactions] of this.executables) { + for (let tx of transactions.array) { + if (tx.hash().equals(transactionHash)) { + return tx; + } + } + } + + for (let [_, origin] of this.#origins) { + const transactions = origin.transactions; + if (transactions === undefined) continue; + for (let tx of transactions.array) { + if (tx.hash().equals(transactionHash)) { + return tx; + } + } + } + return null; + } + #drainQueued = ( origin: string, queuedOriginTransactions: utils.Heap, From 15fe0e7a2261606706837766c4b2c5a5d0dae399 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 19 Aug 2020 18:40:56 -0400 Subject: [PATCH 449/691] put error messages in a common place --- src/chains/ethereum/src/api.ts | 5 +- src/chains/ethereum/src/blockchain.ts | 5 +- .../src/components/transaction-pool.ts | 6 +-- src/chains/ethereum/src/things/errors.ts | 52 +++++++++++-------- src/chains/ethereum/src/things/transaction.ts | 6 +-- 5 files changed, 42 insertions(+), 32 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 4e9dcd9eb9..e979df951d 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -5,6 +5,7 @@ import EthereumOptions from "./options"; import { types, Data, Quantity } from "@ganache/utils"; import Blockchain, { BlockchainOptions } from "./blockchain"; import Tag from "./things/tags"; +import {VM_EXCEPTION, VM_EXCEPTIONS} from "./things/errors"; import Address from "./things/address"; import Transaction from "./things/transaction"; import Wallet from "./wallet"; @@ -90,10 +91,10 @@ function assertExceptionalTransactions(transactions: Transaction[]) { transactions.forEach(transaction => { if (transaction.execException) { if (baseError) { - baseError = "Multiple VM Exceptions while processing transactions: \n\n"; + baseError = VM_EXCEPTIONS; errors.push(`${Data.from(transaction.hash(), 32).toString()}: ${transaction.execException}\n`); } else { - baseError = "VM Exception while processing transaction: "; + baseError = VM_EXCEPTION; errors = [ transaction.execException.message ]; } } diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 3f2d978166..01c93f54a8 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -1,3 +1,4 @@ +import {VM_EXCEPTION} from "./things/errors"; import Miner from "./miner"; import Database from "./database"; import Emittery from "emittery"; @@ -468,7 +469,7 @@ export default class Blockchain extends Emittery.Typed { validateTransaction = (transaction: Transaction): Error => { // Check the transaction doesn't exceed the current block limit gas. if (Quantity.from(transaction.gasLimit) > this.#options.gasLimit) { - return new Error(Errors.GAS_LIMIT); + return new Error(GAS_LIMIT); } // Should supply enough intrinsic gas const gas = transaction.calculateIntrinsicGas(); if (Quantity.from(transaction.gasLimit).toBigInt() < gas) { - return new Error(Errors.INTRINSIC_GAS_TOO_LOW); + return new Error(INTRINSIC_GAS_TOO_LOW); } return null; diff --git a/src/chains/ethereum/src/things/errors.ts b/src/chains/ethereum/src/things/errors.ts index 85c56f5790..085a6b2b89 100644 --- a/src/chains/ethereum/src/things/errors.ts +++ b/src/chains/ethereum/src/things/errors.ts @@ -1,26 +1,34 @@ -export default { - /** - * Returned if the transaction contains an invalid signature. - */ - INVALID_SENDER: "invalid sender", +/** + * Returned if the transaction contains an invalid signature. + */ +export const INVALID_SENDER = "invalid sender"; - /** - * Returned if the nonce of a transaction is lower than the one present in the local chain. - */ - NONCE_TOO_LOW: "nonce too low", +/** + * Returned if the nonce of a transaction is lower than the one present in the local chain. + */ +export const NONCE_TOO_LOW = "nonce too low"; - /** - * Returned if a transaction's gas price is below the minimum configured for the transaction pool. - */ - UNDERPRICED: "transaction underpriced", +/** + * Returned if a transaction's gas price is below the minimum configured for the transaction pool. + */ +export const UNDERPRICED = "transaction underpriced"; - /** - * Returned if the transaction is specified to use less gas than required to start the invocation. - */ - INTRINSIC_GAS_TOO_LOW: "intrinsic gas too low", +/** + * Returned if the transaction is specified to use less gas than required to start the invocation. + */ +export const INTRINSIC_GAS_TOO_LOW = "intrinsic gas too low"; - /** - * Returned if a transaction's requested gas limit exceeds the maximum allowance of the current block. - */ - GAS_LIMIT: "exceeds block gas limit" -}; +/** + * Returned if a transaction's requested gas limit exceeds the maximum allowance of the current block. + */ +export const GAS_LIMIT = "exceeds block gas limit"; + +/** + * Prefix for a single VM Exception occuring when running a transaction or block + */ +export const VM_EXCEPTION = "VM Exception while processing transaction: "; + +/** + * Prefix for multiple VM Exceptions occuring when running transactions or a block + */ +export const VM_EXCEPTIONS = "Multiple VM Exceptions while processing transactions: : \n\n"; diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 81090c1a1f..177b269c7f 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -1,4 +1,4 @@ -import Errors from "./errors"; +import {INTRINSIC_GAS_TOO_LOW} from "./errors"; import {Data, Quantity} from "@ganache/utils"; import params from "./params"; import {Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction} from "ethereumjs-tx"; @@ -245,13 +245,13 @@ class Transaction extends (EthereumJsTransaction as any) { } // Make sure we don't exceed uint64 for all data combinations. if ((MAX_UINT64 - gas) / params.TRANSACTION_DATA_NON_ZERO_GAS < nonZeroBytes) { - throw new Error(Errors.INTRINSIC_GAS_TOO_LOW); + throw new Error(INTRINSIC_GAS_TOO_LOW); } gas += nonZeroBytes * params.TRANSACTION_DATA_NON_ZERO_GAS; let z = BigInt(dataLength) - nonZeroBytes; if ((MAX_UINT64 - gas) / params.TRANSACTION_DATA_ZERO_GAS < z) { - throw new Error(Errors.INTRINSIC_GAS_TOO_LOW); + throw new Error(INTRINSIC_GAS_TOO_LOW); } gas += z * params.TRANSACTION_DATA_ZERO_GAS; } From b3208c8321179df4746f53765120294dae07f19c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 19 Aug 2020 18:41:32 -0400 Subject: [PATCH 450/691] handle runtime middle-level errors in ws-server --- src/packages/core/src/servers/ws-server.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index 58463e66fd..18ea3b56a2 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -73,7 +73,14 @@ export default class WebsocketServer { // keep track of listeners to dispose off when the ws disconnects connections.get(ws).add(resultEmitter.dispose); } - }); + }).catch(err => { + if (ws.closed) return; + + const useBinary = autoBinary ? isBinary : (wsBinary as boolean); + + const message = connector.formatError(err, payload); + ws.send(message, useBinary, true); + }) }, drain: (ws: WebSocket) => { From 8407641847d84c6314a7ebb92a19581eda09b858 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 19 Aug 2020 18:42:29 -0400 Subject: [PATCH 451/691] handle transactions sent as buffer-like data --- src/chains/ethereum/src/things/transaction.ts | 69 +++++++++++-------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 177b269c7f..4d834cf68d 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -119,45 +119,38 @@ function fixProps(tx: any, data: any) { * @param {Transaction} tx * @param {Object} [data] */ -function initData(tx: any, data: any) { +function initData(tx: Transaction, data: any) { if (data) { - if (typeof data === "string") { - data = Data.from(data).toBuffer(); - data = rlpDecode(data); - } else if (Buffer.isBuffer(data)) { - data = rlpDecode(data); - } - const self = tx; - if (Array.isArray(data)) { - // add in our hacked-in properties - // which is the index in the block the transaciton - // was mined in - if (data.length === tx._fields.length + 3) { - tx._index = data.pop(); - tx._blockNum = data.pop(); - tx._blockHash = data.pop(); - } - if (data.length > tx._fields.length) { - throw new Error("wrong number of fields in data"); + let parts: Buffer[]; + if (typeof data === "string") { //hex + parts = rlpDecode(Data.from(data).toBuffer()) as any as Buffer[]; + } else if (Buffer.isBuffer(data)) { // Buffer + parts = rlpDecode(data) as any as Buffer[]; + } else if (data.type === "Buffer") { // wire Buffer + // handle case where a Buffer is sent as `{data: "Buffer", data: number[]}` + // like if someone does `web3.eth.sendRawTransaction(tx.serialize())` + const obj = data.data; + const length = obj.length; + const buf = Buffer.allocUnsafe(length); + for (let i = 0; i < length; i++) { + buf[i] = obj[i]; } - - // make sure all the items are buffers - data.forEach((d, i) => { - self[self._fields[i]] = ethUtil.toBuffer(d); - }); - } else if ((typeof data === "undefined" ? "undefined" : typeof data) === "object") { + parts = rlpDecode(buf) as any as Buffer[]; + } else if (Array.isArray(data)) { // rlpdecoded data + parts = data; + } else if (typeof data === "object") { // JSON const keys = Object.keys(data); tx._fields.forEach((field: any) => { if (keys.indexOf(field) !== -1) { - self[field] = data[field]; + tx[field] = data[field]; } if (field === "gasLimit") { if (keys.indexOf("gas") !== -1) { - self["gas"] = data["gas"]; + tx["gas"] = data["gas"]; } } else if (field === "data") { if (keys.indexOf("input") !== -1) { - self["input"] = data["input"]; + tx["input"] = data["input"]; } } }); @@ -166,11 +159,29 @@ function initData(tx: any, data: any) { // contain a `v` value with chainId in it already. If we do have a // data.chainId value let's set the interval v value to it. if (!tx._chainId && data && data.chainId != null) { - tx.raw[self._fields.indexOf("v")] = tx._chainId = data.chainId || 0; + tx.raw[tx._fields.indexOf("v")] = tx._chainId = data.chainId || 0; } + return; } else { throw new Error("invalid data"); } + + // add in our hacked-in properties + // which is the index in the block the transaciton + // was mined in + if (parts.length === tx._fields.length + 3) { + tx._index = parts.pop(); + tx._blockNum = parts.pop(); + tx._blockHash = parts.pop(); + } + if (parts.length > tx._fields.length) { + throw new Error("wrong number of fields in data"); + } + + // make sure all the items are buffers + parts.forEach((d, i) => { + tx[tx._fields[i]] = ethUtil.toBuffer(d); + }); } } From fe03b3972f82ea83875f82c1e483c0d9485626d4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 19 Aug 2020 18:42:47 -0400 Subject: [PATCH 452/691] return null fields in txs when pending --- src/chains/ethereum/src/things/transaction.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 4d834cf68d..335c789d27 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -372,12 +372,14 @@ class Transaction extends (EthereumJsTransaction as any) { * @param {Object} block The block this Transaction appears in. */ toJSON(block?: Block) { + const blockHash = block ? block.value.hash() : this._blockHash; + const blockNum = block ? block.value.header.number : this._blockNum; return { hash: Data.from(this.hash(), 32), nonce: Quantity.from(this.nonce), - blockHash: Data.from(block ? block.value.hash() : this._blockHash, 32), - blockNumber: Quantity.from(block ? block.value.header.number : this._blockNum), - transactionIndex: Quantity.from(this._index), + blockHash: blockHash ? Data.from(blockHash, 32) : null, + blockNumber: blockNum ? Quantity.from(blockNum) : null, + transactionIndex: this._index ? Quantity.from(this._index) : null, from: Address.from(this.from), to: this.to.length === 0 ? null : Address.from(this.to), value: Quantity.from(this.value), From 1dc029a428323a50bae54c3712e5e94ca7d22909 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 19 Aug 2020 18:43:16 -0400 Subject: [PATCH 453/691] update legacy instamine test message --- src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts index 653c6c2d3d..147aa107bd 100644 --- a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts @@ -48,7 +48,7 @@ describe("api", () => { to: accounts[1], value: "0x76bc75e2d63100000" // generates an "exceeds block gas limit" error }]}, (e, r) => { - assert(e.message.startsWith("sender doesn't have enough funds to send tx")); + assert(e.message.includes("VM Exception while processing transaction: sender doesn't have enough funds to send tx")); assert.strictEqual(e.message, (r as any).error.message); assert.strictEqual((r as any).error.code, -32000); assert.strictEqual(typeof (r as any).result, "string"); From db39d608381a9bf2a233d66b4263732ab48f2dcd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 19 Aug 2020 18:44:05 -0400 Subject: [PATCH 454/691] log transaction info once mined --- src/chains/ethereum/src/blockchain.ts | 37 +++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 01c93f54a8..223679279c 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -175,10 +175,14 @@ export default class Blockchain extends Emittery.Typed { - const blockHash = block.value.hash(); - const blockNumber = block.value.header.number; + const blockHash = value.hash(); + const blockNumber = header.number; + const blockNumberQ = Quantity.from(blockNumber); const blockLogs = BlockLogs.create(blockHash); + const timestamp = new Date(Quantity.from(header.timestamp).toNumber() * 1000).toString(); blockData.blockTransactions.forEach((tx: Transaction, i: number) => { const hash = tx.hash(); // TODO: clean up transaction extra data stuffs because this is gross: @@ -196,11 +200,34 @@ export default class Blockchain extends Emittery.Typed Date: Wed, 19 Aug 2020 18:44:27 -0400 Subject: [PATCH 455/691] . --- .../ethereum/src/things/transaction-receipt.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index b49aece9c3..9b894fea46 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -9,8 +9,8 @@ type FullRawReceipt = [status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: type RawReceipt = OmitLastType export default class TransactionReceipt { - #contractAddress: Buffer; - #raw: RawReceipt; + public contractAddress: Buffer; + raw: RawReceipt; constructor(data?: Buffer) { if (data) { @@ -19,8 +19,8 @@ export default class TransactionReceipt { } } #init = (status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer = null) => { - this.#raw = [status, gasUsed, logsBloom, logs]; - this.#contractAddress = contractAddress; + this.raw = [status, gasUsed, logsBloom, logs]; + this.contractAddress = contractAddress; } static fromValues(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer) { @@ -32,16 +32,16 @@ export default class TransactionReceipt { public serialize(all: boolean) { if (all) { // the database format includes the contractAddress: - return rlpEncode([...this.#raw, this.#contractAddress] as FullRawReceipt); + return rlpEncode([...this.raw, this.contractAddress] as FullRawReceipt); } else { // receipt trie format: - return rlpEncode(this.#raw); + return rlpEncode(this.raw); } } public toJSON(block: Block, transaction: Transaction) { - const raw = this.#raw; - const contractAddress = Data.from(this.#contractAddress).toJSON() + const raw = this.raw; + const contractAddress = Data.from(this.contractAddress).toJSON() const blockLog = BlockLogs.create(block.value.hash()); blockLog.blockNumber = Quantity.from(block.value.header.number); (raw[3] as any as TransactionLog[]).forEach(log => { From 0ed02987884f1720a38561a0fa50c1b17c02a778 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 19 Aug 2020 18:44:56 -0400 Subject: [PATCH 456/691] . --- src/chains/ethereum/src/blockchain.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 223679279c..38d0201eb9 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -34,6 +34,10 @@ export enum Status { paused = 16 // 0001 0000 } +interface Logger { + log(message?: any, ...optionalParams: any[]): void; +} + export type BlockchainOptions = { db?: string | object; db_path?: string; @@ -48,6 +52,7 @@ export type BlockchainOptions = { common: Common; legacyInstamine: boolean; vmErrorsOnRPCResponse: boolean; + logger: Logger }; type BlockchainTypedEvents = {block: Block, blockLogs: BlockLogs, pendingTransaction: Transaction}; @@ -80,6 +85,7 @@ export default class Blockchain extends Emittery.Typed Date: Wed, 19 Aug 2020 18:45:25 -0400 Subject: [PATCH 457/691] handle memdown databases --- src/chains/ethereum/src/database.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index 22ed8c827b..6c23ed7572 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -50,8 +50,8 @@ export default class Database extends Emittery { const store = this.#options.db; let db: levelup.LevelUp; if (store) { - this.#rootStore = store as any; - db = levelup(store as any, levelupOptions); + this.#rootStore = encode(store, levelupOptions); + db = levelup(this.#rootStore as any, {}); } else { let directory = this.#options.db_path; if (!directory) { From f17246d3a14e2f96299f164b202c1b0a8444f285 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 20 Aug 2020 15:27:17 -0400 Subject: [PATCH 458/691] clean up listeners before shutting down --- src/chains/ethereum/src/blockchain.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 38d0201eb9..4533af2d29 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -106,11 +106,8 @@ export default class Blockchain extends Emittery.Typed { - { // TODO: get the latest block from the database - // if we have a latest block, `root` will be that block's header.stateRoot - // and we will skip creating the genesis block altogether - const root: Buffer = null; + database.once("ready").then(async () => { + const blocks = this.blocks = await BlockManager.initialize(database.blockIndexes, database.blocks, {common: options.common}); this.trie = new CheckpointTrie(database.trie, root); } @@ -158,8 +155,8 @@ export default class Blockchain extends Emittery.Typed { - this.emit("transaction:" + Data.from(failureData.txHash).toString() as any, failureData.errorMessage); + miner.on("transaction-failure", (failureData: any) => { + return this.emit("transaction:" + Data.from(failureData.txHash).toString() as any, failureData.errorMessage); }); miner.on("block", async (blockData: any) => { @@ -258,6 +255,8 @@ export default class Blockchain extends Emittery.Typed miner.clearListeners()); } blocks.earliest = blocks.latest = await this.#processingBlock.then(({block}) => block); @@ -547,11 +546,16 @@ export default class Blockchain extends Emittery.Typed Date: Thu, 20 Aug 2020 18:34:24 -0400 Subject: [PATCH 459/691] add informative error message for server port bind --- src/packages/core/src/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index 1c23d24478..e263dadfc9 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -98,7 +98,7 @@ export default class Server { if (callbackIsFunction) callback!(null); } else { this.#status = Status.closed; - const err = new Error(`Failed to listen on port: ${port}.`); + const err = new Error(`listen EADDRINUSE: address already in use 127.0.0.1:${port}.`); if (callbackIsFunction) callback!(err); else throw err; } From 7b0260bff9f3b37debfe61736b2ef790340de708 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 20 Aug 2020 18:40:00 -0400 Subject: [PATCH 460/691] Add additional db support and begin robust error handling --- .../api/eth/legacyInstamining.test.ts | 6 +-- src/chains/ethereum/npm-shrinkwrap.json | 47 ++++++++++++++---- src/chains/ethereum/package.json | 3 +- src/chains/ethereum/src/api.ts | 5 ++ src/chains/ethereum/src/blockchain.ts | 44 ++++++++++------- .../ethereum/src/components/block-manager.ts | 48 ++++++++++++++---- src/chains/ethereum/src/database.ts | 2 + .../ethereum/src/things/execution-error.ts | 49 +++++++++++++++++++ .../ethereum/src/things/rejection-error.ts | 19 +++++++ src/chains/ethereum/src/things/transaction.ts | 3 +- src/packages/core/__tests__/server.test.ts | 6 +-- 11 files changed, 186 insertions(+), 46 deletions(-) create mode 100644 src/chains/ethereum/src/things/execution-error.ts create mode 100644 src/chains/ethereum/src/things/rejection-error.ts diff --git a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts index 147aa107bd..7547a62352 100644 --- a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts @@ -46,12 +46,12 @@ describe("api", () => { params: [{ from: accounts[0], to: accounts[1], - value: "0x76bc75e2d63100000" // generates an "exceeds block gas limit" error + value: "0x76bc75e2d63100000" }]}, (e, r) => { - assert(e.message.includes("VM Exception while processing transaction: sender doesn't have enough funds to send tx")); + assert(e.message.includes("sender doesn't have enough funds to send tx")); assert.strictEqual(e.message, (r as any).error.message); assert.strictEqual((r as any).error.code, -32000); - assert.strictEqual(typeof (r as any).result, "string"); + assert.strictEqual(typeof (r as any).error.data.result, "string"); done(); }); }); diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index fee8d29857..8853170ebd 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -948,6 +948,31 @@ "ethereumjs-util": "^5.1.1", "tweetnacl": "^1.0.0", "tweetnacl-util": "^0.15.0" + }, + "dependencies": { + "ethereumjs-abi": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz", + "integrity": "sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE=", + "requires": { + "bn.js": "^4.10.0", + "ethereumjs-util": "^4.3.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz", + "integrity": "sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w==", + "requires": { + "bn.js": "^4.8.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.0.0" + } + } + } + } } }, "ethashjs": { @@ -1012,24 +1037,26 @@ } }, "ethereumjs-abi": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz", - "integrity": "sha1-WmN+8Wq0NHP6cqKa2QhxQFs/UkE=", + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^4.3.0" + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" }, "dependencies": { "ethereumjs-util": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz", - "integrity": "sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", "requires": { - "bn.js": "^4.8.0", + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", "create-hash": "^1.1.2", "elliptic": "^6.5.2", "ethereum-cryptography": "^0.1.3", - "rlp": "^2.0.0" + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" } } } diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 598c448349..26a07f1978 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -27,7 +27,7 @@ "post-process:docs": "node ./scripts/post-process-docs.js", "preview:docs": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", - "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", + "test": "nyc --reporter lcov npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" }, "bugs": { @@ -38,6 +38,7 @@ "@ganache/utils": "^2.2.1", "@types/keccak": "3.0.1", "eth-sig-util": "^2.5.3", + "ethereumjs-abi": "^0.6.8", "ethereumjs-vm": "4.2.0", "keccak": "3.0.0", "levelup": "4.4.0", diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index e979df951d..7105b1f9f7 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -87,6 +87,7 @@ function parseFilter(filter: FilterArgs = {address: [], topics: []}, blockchain: function assertExceptionalTransactions(transactions: Transaction[]) { let baseError = null; let errors: string[]; + const data = {}; transactions.forEach(transaction => { if (transaction.execException) { @@ -97,11 +98,15 @@ function assertExceptionalTransactions(transactions: Transaction[]) { baseError = VM_EXCEPTION; errors = [ transaction.execException.message ]; } + data[Data.from(transaction.hash()).toString()] = { + program_counter: transaction.execResult.runState.programCounter + }; } }); if (baseError) { const err = new Error(baseError + errors.join("\n")); + (err as any).data = data; (err as any).result = "0x0"; throw err; } diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 4533af2d29..273c1576c6 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -1,4 +1,4 @@ -import {VM_EXCEPTION} from "./things/errors"; +import ExecutionError, { RETURN_TYPES } from "./things/execution-error"; import Miner from "./miner"; import Database from "./database"; import Emittery from "emittery"; @@ -22,6 +22,7 @@ import {Block as EthereumBlock} from "ethereumjs-block"; import VM from "ethereumjs-vm"; import Address from "./things/address"; import BlockLogManager from "./components/blocklog-manager"; +import RejectionError from "./things/rejection-error"; const unref = utils.unref; @@ -109,20 +110,25 @@ export default class Blockchain extends Emittery.Typed { const blocks = this.blocks = await BlockManager.initialize(database.blockIndexes, database.blocks, {common: options.common}); - this.trie = new CheckpointTrie(database.trie, root); + // if we have a latest block, use it to set up the trie. + const latest = blocks.latest; + if (latest) { + this.#processingBlock = Promise.resolve({block: latest, blockLogs: null}); + this.trie = new CheckpointTrie(database.trie, latest.value.header.stateRoot); + } else { + this.trie = new CheckpointTrie(database.trie, null); } - - const blocks = this.blocks = new BlockManager(this, database.blocks, {common: options.common}); + this.blockLogs = new BlockLogManager(database.blockLogs); - this.vm = this.createVmFromStateTrie(this.trie, options.allowUnlimitedContractSize); - this.transactions = new TransactionManager(this, database.transactions, options); this.transactionReceipts = new Manager( database.transactionReceipts, TransactionReceipt ); this.accounts = new AccountManager(this, database.trie); + this.coinbase = options.coinbase.address; + this.vm = this.createVmFromStateTrie(this.trie, options.allowUnlimitedContractSize); await this.#commitAccounts(options.initialAccounts); @@ -137,7 +143,11 @@ export default class Blockchain extends Emittery.Typed block); + } } { // configure and start miner @@ -156,7 +166,8 @@ export default class Blockchain extends Emittery.Typed { - return this.emit("transaction:" + Data.from(failureData.txHash).toString() as any, failureData.errorMessage); + const txHash = Data.from(failureData.txHash, 32).toString(); + return this.emit("transaction:" + txHash as any, new RejectionError(txHash.toString(), failureData.errorMessage)); }); miner.on("block", async (blockData: any) => { @@ -240,7 +251,7 @@ export default class Blockchain extends Emittery.Typed { - this.emit("transaction:" + Data.from(transaction.hash()).toString() as any, transaction.execException); + this.emit("transaction:" + Data.from(transaction.hash(), 32).toString() as any, transaction.execException); }); // in legacy instamine mode we must delay the broadcast of new blocks @@ -259,7 +270,6 @@ export default class Blockchain extends Emittery.Typed miner.clearListeners()); } - blocks.earliest = blocks.latest = await this.#processingBlock.then(({block}) => block); this.#state = Status.started; this.emit("start"); }); @@ -493,18 +503,14 @@ export default class Blockchain extends Emittery.Typed { public pending: Block; #options: {common: Common}; + #blockIndexes: LevelUp; - constructor(blockchain: Blockchain, base: LevelUp, options: {common: Common}) { + static async initialize(blockIndexes: LevelUp, base: LevelUp, options: {common: Common}) { + const bm = new BlockManager(blockIndexes, base, options); + await bm.updateTaggedBlocks(); + return bm; + } + + constructor(blockIndexes: LevelUp, base: LevelUp, options: {common: Common}) { super(base, Block, options); this.#options = options; - - // blockchain.on("open", () => { - // // TODO: get the first key, set as "earliest" - // // TODO: get the last key, set as "latest" - // }); + this.#blockIndexes = blockIndexes; } /** - * Gets or creates the next block (which might be the *pending* block). Uses the values in the optional `header` object to create the block + * Gets or creates the next block (which might be the *pending* block). Uses the values in the optional `header` + * object to create the block * @param header The values to set on the block's header. These typically come from the parent block. */ next(header?: {}) { @@ -98,7 +102,7 @@ export default class BlockManager extends Manager { } async getNumberFromHash(hash: string | Buffer | Tag) { - return this.base.get(Data.from(hash).toBuffer()) as Promise; + return this.#blockIndexes.get(Data.from(hash).toBuffer()) as Promise; } async getByHash(hash: string | Buffer | Tag) { @@ -138,9 +142,35 @@ export default class BlockManager extends Manager { } const secondaryKey = header.hash(); const value = blockValue.serialize(true); - await Promise.all([super.set(secondaryKey, key), super.set(key, value)]); + await Promise.all([this.#blockIndexes.put(secondaryKey, key), super.set(key, value)]); return block; } + + updateTaggedBlocks() { + return new Promise((resolve, reject) => { + this.base.createValueStream({limit: 1}) + .on("data", (data: Buffer) => { + this.earliest = new Block(data, this.#options); + }) + .on("error", (err: Error) => { + reject(err); + }) + .on("end", () => { + resolve(); + }); + + this.base.createValueStream({reverse: true, limit: 1}) + .on("data", (data: Buffer) => { + this.latest = new Block(data, this.#options); + }) + .on("error", (err: Error) => { + reject(err); + }) + .on("end", () => { + resolve(); + }); + }) + } } export class Block { diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index 6c23ed7572..06e77dd7a3 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -21,6 +21,7 @@ export default class Database extends Emittery { public directory: string = null; public db: LevelUp = null; public blocks: LevelUp; + public blockIndexes: LevelUp; public blockLogs: LevelUp; public blockHashes: LevelUp; public transactions: LevelUp; @@ -81,6 +82,7 @@ export default class Database extends Emittery { if (this.#closed) return this.#cleanup(); this.blocks = sub(db, "b", levelupOptions); + this.blockIndexes = sub(db, "i", levelupOptions); this.blockLogs = sub(db, "l", levelupOptions); this.transactions = sub(db, "t", levelupOptions); this.transactionReceipts = sub(db, "r", levelupOptions); diff --git a/src/chains/ethereum/src/things/execution-error.ts b/src/chains/ethereum/src/things/execution-error.ts new file mode 100644 index 0000000000..e458fc7855 --- /dev/null +++ b/src/chains/ethereum/src/things/execution-error.ts @@ -0,0 +1,49 @@ +import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; +import Transaction from "./transaction"; +import { VM_EXCEPTION } from "./errors"; +import { Data } from "@ganache/utils"; +import { rawDecode } from "ethereumjs-abi"; + +const REVERT_REASON = Buffer.from("08c379a0", "hex"); // keccak("Error(string)").slice(0, 4) + +export enum RETURN_TYPES { + TRANSACTION_HASH, + RETURN_VALUE +} + +export default class ExecutionError extends Error { + public code: -32000; + public data: { + hash: string, + programCounter: number, + result: string, + reason?: string + } + constructor(transaction: Transaction, result: EVMResult, returnType: RETURN_TYPES) { + super(); + + Error.captureStackTrace(this, this.constructor); + this.name = this.constructor.name; + + const execResult = result.execResult; + let message = VM_EXCEPTION + execResult.exceptionError.error; + const returnValue = execResult.returnValue; + const hash = Data.from(transaction.hash(), 32).toString(); + let reason: string | null; + if (returnValue.length > 4 && REVERT_REASON.compare(returnValue, 0, 4) === 0) { + reason = rawDecode(["bytes"], returnValue.slice(4))[0].toString(); + message += " " + reason; + } else { + reason = null; + } + + this.message = message; + this.code = -32000; + this.data = { + hash: hash, + programCounter: execResult.runState.programCounter, + result: returnType === RETURN_TYPES.TRANSACTION_HASH ? hash : Data.from(returnValue || "0x").toString(), + reason: reason + }; + } +} diff --git a/src/chains/ethereum/src/things/rejection-error.ts b/src/chains/ethereum/src/things/rejection-error.ts new file mode 100644 index 0000000000..e023500004 --- /dev/null +++ b/src/chains/ethereum/src/things/rejection-error.ts @@ -0,0 +1,19 @@ +export default class RejectionError extends Error { + public code: -32000; + public data: { + result: string + } + constructor(result: string, message: string) { + super(); + + Error.captureStackTrace(this, this.constructor); + + this.name = this.constructor.name; + + this.data = { + result + } + this.message = message; + this.code = -32000; + } +} \ No newline at end of file diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 335c789d27..9bf8009347 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -11,6 +11,7 @@ import TransactionReceipt from "./transaction-receipt"; import Common from "ethereumjs-common"; import { TransactionLog } from "./blocklogs"; import Address from "./address"; +import ExecutionError, { RETURN_TYPES } from "./execution-error"; type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; @@ -403,7 +404,7 @@ class Transaction extends (EthereumJsTransaction as any) { let status: Buffer; if (execException) { status = ZERO_BUFFER; - this.execException = new Error(execException.error); + this.execException = new ExecutionError(this, result, RETURN_TYPES.TRANSACTION_HASH); } else { status = ONE_BUFFER; } diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/__tests__/server.test.ts index 35796e0da0..a7c7c7349f 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -158,7 +158,7 @@ describe("server", () => { try { await assert.rejects(setup, { - message: `Failed to listen on port: ${port}.` + message: `listen EADDRINUSE: address already in use 127.0.0.1:${port}.` }); } finally { await teardown(); @@ -174,7 +174,7 @@ describe("server", () => { const s = Ganache.server(); const listen = promisify(s.listen.bind(s)); await assert.rejects(listen(port), { - message: `Failed to listen on port: ${port}.` + message: `listen EADDRINUSE: address already in use 127.0.0.1:${port}.` }); } finally { await teardown(); @@ -189,7 +189,7 @@ describe("server", () => { try { await assert.rejects(s2.listen(port), { - message: `Failed to listen on port: ${port}.` + message: `listen EADDRINUSE: address already in use 127.0.0.1:${port}.` }); } catch (e) { // in case of failure, make sure we properly shut things down From 57fc2df7569c4f0751d6fda56305ac976911b1bb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 20 Aug 2020 21:29:05 -0400 Subject: [PATCH 461/691] add correct type to execException --- src/chains/ethereum/src/things/transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 9bf8009347..0583fdf819 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -426,7 +426,7 @@ class Transaction extends (EthereumJsTransaction as any) { return this.#logs; }; - public execException: Error = null; + public execException: ExecutionError = null; } export default Transaction; From b508ed3e30c9eed24ed52b5158fed3e46749b584 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 20 Aug 2020 21:29:26 -0400 Subject: [PATCH 462/691] send error when eth_subscribe called over http connection --- src/chains/ethereum/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 0b5894995d..8e36be04ee 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -41,8 +41,8 @@ export class EthereumConnector extends Emittery.Typed; From 7e5da8be331bad14dcd130f546ae9f6b3e61dd4c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 20 Aug 2020 21:30:32 -0400 Subject: [PATCH 463/691] improve error handling more --- src/chains/ethereum/src/api.ts | 12 ++++++------ src/chains/ethereum/src/blockchain.ts | 9 +++++---- src/chains/ethereum/src/things/execution-error.ts | 9 ++++++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 7105b1f9f7..2a31bd71fc 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -94,20 +94,18 @@ function assertExceptionalTransactions(transactions: Transaction[]) { if (baseError) { baseError = VM_EXCEPTIONS; errors.push(`${Data.from(transaction.hash(), 32).toString()}: ${transaction.execException}\n`); + data[transaction.execException.data.hash] = transaction.execException.data; } else { baseError = VM_EXCEPTION; errors = [ transaction.execException.message ]; + data[transaction.execException.data.hash] = transaction.execException.data; } - data[Data.from(transaction.hash()).toString()] = { - program_counter: transaction.execResult.runState.programCounter - }; } }); if (baseError) { const err = new Error(baseError + errors.join("\n")); - (err as any).data = data; - (err as any).result = "0x0"; + (err as any).data = data throw err; } } @@ -1150,7 +1148,9 @@ export default class EthereumApi implements types.Api { return promiEvent; } default: - throw new Error("unsupported subscription type"); + const err = new Error("unsupported subscription type"); + (err as any).code = -32000; + throw err; } } diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 273c1576c6..f9c40c28fd 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -231,9 +231,9 @@ export default class Blockchain extends Emittery.Typed { - this.emit("transaction:" + Data.from(transaction.hash(), 32).toString() as any, transaction.execException); + const error = this.#options.vmErrorsOnRPCResponse ? transaction.execException : null + this.emit("transaction:" + Data.from(transaction.hash(), 32).toString() as any, error); }); // in legacy instamine mode we must delay the broadcast of new blocks @@ -532,7 +533,7 @@ export default class Blockchain extends Emittery.Typed Date: Thu, 20 Aug 2020 21:31:32 -0400 Subject: [PATCH 464/691] add decorator to throw error when api param length is incorrect --- src/chains/ethereum/src/api.ts | 14 ++++++++++++++ tsconfig.json | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 2a31bd71fc..6c20e2c5e1 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -110,6 +110,18 @@ function assertExceptionalTransactions(transactions: Transaction[]) { } } +function assertArgLength(min: number, max: number = min) { + return function(_target, _name, descriptor) { + const original = descriptor.value; + descriptor.value = function() { + const length = arguments.length; + if (length < min || length > max) throw new Error("Incorrect number of arguments."); + return Reflect.apply(original, this, arguments); + }; + return descriptor; + }; +} + export default class EthereumApi implements types.Api { readonly [index: string]: (...args: any) => Promise; @@ -222,6 +234,7 @@ export default class EthereumApi implements types.Api { * * @param timestamp? the timestamp a block should setup as the mining time. */ + @assertArgLength(0, 1) async evm_mine(timestamp?: number) { const transactions = await this.#blockchain.mine(-1, timestamp, true); if (this.#options.vmErrorsOnRPCResponse) { @@ -329,6 +342,7 @@ export default class EthereumApi implements types.Api { * assert.strictEqual(BigInt(endingBalance), startingBalance); * */ + @assertArgLength(1) async evm_revert(snapshotId: string | number) { return this.#blockchain.revert(Quantity.from(snapshotId)); } diff --git a/tsconfig.json b/tsconfig.json index 5f9a2495e6..7e0df315f1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,7 @@ "noImplicitAny": false, "newLine": "lf", "lib": ["ES2020"], - "typeRoots": ["./node_modules/@types", "src/@types"] + "typeRoots": ["./node_modules/@types", "src/@types"], + "experimentalDecorators": true } } From ea93f317d568c417cc3d96ab7d5742c55938f2ce Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 21 Aug 2020 17:39:35 -0400 Subject: [PATCH 465/691] ignore coverage directories --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 72e589c302..9918f5fd46 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ test/testdb/* lerna-debug.log npm-debug.log src/**/*/lib +coverage From 7c2ab653eb598254e86016a701c1727f58b31485 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 24 Aug 2020 17:31:56 -0400 Subject: [PATCH 466/691] Don't subscribe to vm steps when createVmFromStateTrie is called --- src/chains/ethereum/src/blockchain.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index f9c40c28fd..b927342a11 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -129,6 +129,7 @@ export default class Blockchain extends Emittery.Typed => { From 98d2e18d5225dda381c7d01faf198dc7abf10cda Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 24 Aug 2020 17:32:11 -0400 Subject: [PATCH 467/691] Store more transaction data with each transaction --- src/chains/ethereum/src/blockchain.ts | 2 +- src/chains/ethereum/src/things/transaction.ts | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index b927342a11..8769348e57 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -201,7 +201,7 @@ export default class Blockchain extends Emittery.Typed { const hash = tx.hash(); // TODO: clean up transaction extra data stuffs because this is gross: - const extraData = [...tx.raw, blockHash, blockNumber, Quantity.from(i).toBuffer()]; + const extraData = [...tx.raw, blockHash, blockNumber, Quantity.from(i).toBuffer(), Buffer.from([tx.type]), tx.from]; const encodedTx = rlpEncode(extraData); this.transactions.set(hash, encodedTx); diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 0583fdf819..2f073ebe9e 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -88,7 +88,9 @@ function fixProps(tx: any, data: any) { tx._chainId = chainId || 0; } }); +} +function makeFake(tx: any, data: any){ if (tx.isFake()) { /** * @prop {Buffer} from (read/write) Set from address to bypass transaction @@ -170,10 +172,17 @@ function initData(tx: Transaction, data: any) { // add in our hacked-in properties // which is the index in the block the transaciton // was mined in - if (parts.length === tx._fields.length + 3) { + if (parts.length === tx._fields.length + 5) { + tx._from = parts.pop(); + tx.type = parts.pop()[0]; tx._index = parts.pop(); tx._blockNum = parts.pop(); tx._blockHash = parts.pop(); + tx.raw.push(tx._blockHash); + tx.raw.push(tx._blockNum); + tx.raw.push(tx._index); + tx.raw.push(tx.type); + tx.raw.push(tx._from); } if (parts.length > tx._fields.length) { throw new Error("wrong number of fields in data"); @@ -217,6 +226,10 @@ class Transaction extends (EthereumJsTransaction as any) { fixProps(this, data); initData(this, data); + + if (this.isFake()) { + makeFake(this, data) + } } static get types() { From 6d9976d5cf4221a857ef1ed4f00554fc4ace98f9 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 11:04:46 -0400 Subject: [PATCH 468/691] Fix test description --- src/chains/ethereum/__tests__/api/eth/logs.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts index d408e088af..e099d2803e 100644 --- a/src/chains/ethereum/__tests__/api/eth/logs.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -79,7 +79,7 @@ describe("api", () => { assert.strictEqual(logs.length, 1); }); - it("should return the code at the deployed block number", async () => { + it("should return the logs", async () => { await provider.send("eth_subscribe", ["newHeads"]); const numberOfLogs = 4; const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); From d951a652869f8adf9a8dcf0424c1cd324c461b69 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 11:04:53 -0400 Subject: [PATCH 469/691] remove dead code --- src/chains/ethereum/src/things/blocklogs.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index 7a40f4f045..00e9358c78 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -8,7 +8,6 @@ export type BlockLog = [removed: Buffer, transactionIndex: Buffer, transactionHa const _raw = Symbol("raw"); const _logs = Symbol("logs"); -const _blockNumber = Symbol("blockNumber"); const filterByTopic = (expectedTopics: (string | string[])[], logTopics: Buffer[]) => { // Exclude log if its number of topics is less than the number expected From 259def797c3bd16b58c8e7680c23c5f27d3c1329 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 11:05:12 -0400 Subject: [PATCH 470/691] dno't append to tx's raw, as it is used for sigs --- src/chains/ethereum/src/things/transaction.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 2f073ebe9e..e78d73268b 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -178,11 +178,6 @@ function initData(tx: Transaction, data: any) { tx._index = parts.pop(); tx._blockNum = parts.pop(); tx._blockHash = parts.pop(); - tx.raw.push(tx._blockHash); - tx.raw.push(tx._blockNum); - tx.raw.push(tx._index); - tx.raw.push(tx.type); - tx.raw.push(tx._from); } if (parts.length > tx._fields.length) { throw new Error("wrong number of fields in data"); From 0344d314a20ccf3a9ec4e58b7445fe72d1e1fe0b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 11:46:04 -0400 Subject: [PATCH 471/691] fix initial blocktime setting --- src/chains/ethereum/__tests__/api/eth/subscribe.test.ts | 4 ++-- src/chains/ethereum/src/blockchain.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index 9661358aad..e35e2b0b47 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -58,13 +58,13 @@ describe("api", () => { "extraData": "0x", "gasLimit": gasLimit, "gasUsed": "0x0", - "hash": "0xdc949ca8143fa0e494f9a07ddaf88c6a28f5752c9d885d075929adeca110e7d3", + "hash": "0x4459bd9523df28f1f0b322af154f77559c0b95977ea97d3472ffd674d1de0224", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": accounts[0], "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": Quantity.from(startingBlockNumber + 1).toString(), - "parentHash": "0x03952e9b420b44ae0b35f9a0375ba91494db28d68d413f9255317ae289a8cd47", + "parentHash": "0x4491767e43978f68585dced6392f302779f117ce39853c946ef2e61a0c104a33", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "stateRoot": "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 8769348e57..0d2297deb5 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -138,8 +138,7 @@ export default class Blockchain extends Emittery.Typed Date: Tue, 25 Aug 2020 11:58:00 -0400 Subject: [PATCH 472/691] just forcing CI to run --- src/chains/ethereum/__tests__/api/eth/subscribe.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index e35e2b0b47..7a1854be33 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -59,6 +59,7 @@ describe("api", () => { "gasLimit": gasLimit, "gasUsed": "0x0", "hash": "0x4459bd9523df28f1f0b322af154f77559c0b95977ea97d3472ffd674d1de0224", + "timestamp": Quantity.from(timestamp).toString(), "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": accounts[0], "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -68,7 +69,6 @@ describe("api", () => { "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "stateRoot": "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", - "timestamp": Quantity.from(timestamp).toString(), "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" }, subscription: subscriptionId From 10e6fc3dc30b9f368ba353bbdc97cd3972ea1cdc Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 12:14:36 -0400 Subject: [PATCH 473/691] time tweaks in tests --- src/chains/ethereum/__tests__/api/eth/subscribe.test.ts | 4 ++-- src/chains/ethereum/__tests__/api/evm/evm.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index 7a1854be33..5cd657e41d 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -9,7 +9,7 @@ describe("api", () => { let provider: EthereumProvider; let accounts: string[]; const gasLimit = "0x6691b7"; - const now = new Date(2019, 3, 15); + const now = new Date(2019, 3, 15, 0, 0, 0, 0); beforeEach(async () => { provider = await getProvider({ @@ -59,7 +59,6 @@ describe("api", () => { "gasLimit": gasLimit, "gasUsed": "0x0", "hash": "0x4459bd9523df28f1f0b322af154f77559c0b95977ea97d3472ffd674d1de0224", - "timestamp": Quantity.from(timestamp).toString(), "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": accounts[0], "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -69,6 +68,7 @@ describe("api", () => { "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "stateRoot": "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", + "timestamp": Quantity.from(timestamp).toString(), "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" }, subscription: subscriptionId diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 356480ceed..36d154b48f 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -47,8 +47,8 @@ describe("api", () => { }); it("should mine a block on demand at the specified timestamp", async () => { - const startDate = new Date(2019, 3, 15); - const miningTimestamp = Math.floor((new Date(2020, 3, 15).getTime() / 1000)); + const startDate = new Date(2019, 3, 15, 0, 0, 0, 0); + const miningTimestamp = Math.floor((new Date(2020, 3, 15, 0, 0, 0, 0).getTime() / 1000)); const provider = await getProvider({time: startDate}); await provider.send("evm_mine", [miningTimestamp]); const currentBlock = await provider.send("eth_getBlockByNumber", ["latest"]); From b7b7def1af29669c1d665e73698d724fa49566fb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 12:59:33 -0400 Subject: [PATCH 474/691] additional time tweaks --- src/chains/ethereum/__tests__/api/eth/subscribe.test.ts | 4 ++-- src/chains/ethereum/__tests__/api/evm/evm.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index 5cd657e41d..03ed718126 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -9,7 +9,7 @@ describe("api", () => { let provider: EthereumProvider; let accounts: string[]; const gasLimit = "0x6691b7"; - const now = new Date(2019, 3, 15, 0, 0, 0, 0); + const now = new Date("2019/03/15 GMT"); beforeEach(async () => { provider = await getProvider({ @@ -58,7 +58,7 @@ describe("api", () => { "extraData": "0x", "gasLimit": gasLimit, "gasUsed": "0x0", - "hash": "0x4459bd9523df28f1f0b322af154f77559c0b95977ea97d3472ffd674d1de0224", + "hash": "0x7e6270b6f40b2143088214eebf5d6834b3ce7001a7179f859ea722955d10ad99", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": accounts[0], "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 36d154b48f..356480ceed 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -47,8 +47,8 @@ describe("api", () => { }); it("should mine a block on demand at the specified timestamp", async () => { - const startDate = new Date(2019, 3, 15, 0, 0, 0, 0); - const miningTimestamp = Math.floor((new Date(2020, 3, 15, 0, 0, 0, 0).getTime() / 1000)); + const startDate = new Date(2019, 3, 15); + const miningTimestamp = Math.floor((new Date(2020, 3, 15).getTime() / 1000)); const provider = await getProvider({time: startDate}); await provider.send("evm_mine", [miningTimestamp]); const currentBlock = await provider.send("eth_getBlockByNumber", ["latest"]); From e66037cecac2a11b0214ef94f8e75b579e6132f6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 13:07:42 -0400 Subject: [PATCH 475/691] Update to typescript@4.0.2 --- npm-shrinkwrap.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index bd48abd60d..675f21fa17 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -11417,9 +11417,9 @@ } }, "typescript": { - "version": "4.0.1-rc", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.1-rc.tgz", - "integrity": "sha512-TCkspT3dSKOykbzS3/WSK7pqU2h1d/lEO6i45Afm5Y3XNAEAo8YXTG3kHOQk/wFq/5uPyO1+X8rb/Q+g7UsxJw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", "dev": true }, "uWebSockets.js": { diff --git a/package.json b/package.json index 271d06e62a..a155318de9 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "superagent": "5.2.2", "ts-morph": "7.1.2", "ts-node": "8.10.2", - "typescript": "4.0.1-rc", + "typescript": "4.0.2", "utf-8-validate": "5.0.2", "ws": "7.3.0", "yargs": "15.4.0" From 5debac5e9bca9b17f2f5fab10a1ffc417019ee20 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 15:49:54 -0400 Subject: [PATCH 476/691] windows builds stopped working --- .github/workflows/nodejs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 8060a8bfbf..4873cc66bf 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -21,6 +21,9 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} + - name: Add msbuild to PATH + if: matrix.os == 'windows-2019' + uses: microsoft/setup-msbuild@v1.0.1 - name: install node tools if: matrix.os == 'windows-2019' run: npm install --global --production windows-build-tools@4.0.0 From bd80eb70a130b94312f574747de0132a1da2cfe3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 15:58:56 -0400 Subject: [PATCH 477/691] Update CI's windows-build-tools to v5.2.2 --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 4873cc66bf..563be4d5b2 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,7 +26,7 @@ jobs: uses: microsoft/setup-msbuild@v1.0.1 - name: install node tools if: matrix.os == 'windows-2019' - run: npm install --global --production windows-build-tools@4.0.0 + run: npm install --global --production windows-build-tools@5.2.2 - name: install node-gyp if: matrix.os == 'windows-2019' run: npm install --global node-gyp@latest From 3b9d50ef054f7bb216f9ad23352e305cdaba854b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 16:00:14 -0400 Subject: [PATCH 478/691] test if we even need microsoft/setup-msbuild --- .github/workflows/nodejs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 563be4d5b2..9f4e8c2e9a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -21,9 +21,6 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} - - name: Add msbuild to PATH - if: matrix.os == 'windows-2019' - uses: microsoft/setup-msbuild@v1.0.1 - name: install node tools if: matrix.os == 'windows-2019' run: npm install --global --production windows-build-tools@5.2.2 From 66d42f167c2e6f247519ff149674a47734b4c5c6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 16:11:31 -0400 Subject: [PATCH 479/691] windows-build-tools@4.0.0 is required --- .github/workflows/nodejs.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 9f4e8c2e9a..34ddeb14c3 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -21,9 +21,13 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} + - name: Add msbuild to PATH + if: matrix.os == 'windows-2019' + uses: microsoft/setup-msbuild@v1.0.1 - name: install node tools if: matrix.os == 'windows-2019' - run: npm install --global --production windows-build-tools@5.2.2 + # windows-build-tools@5.2.2 failed to install, so we use 4.0.0 + run: npm install --global --production windows-build-tools@4.0.0 - name: install node-gyp if: matrix.os == 'windows-2019' run: npm install --global node-gyp@latest From 14689b8a681bf574192753dc825c24b8f9d8781e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 20:39:45 -0400 Subject: [PATCH 480/691] improve precision of timeAdjustments --- .../__tests__/api/eth/subscribe.test.ts | 4 ++-- .../ethereum/__tests__/api/evm/evm.test.ts | 3 +-- src/chains/ethereum/package.json | 2 +- src/chains/ethereum/src/api.ts | 4 ++-- src/chains/ethereum/src/blockchain.ts | 19 ++++++++++++++++--- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index 03ed718126..d000994365 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -58,13 +58,13 @@ describe("api", () => { "extraData": "0x", "gasLimit": gasLimit, "gasUsed": "0x0", - "hash": "0x7e6270b6f40b2143088214eebf5d6834b3ce7001a7179f859ea722955d10ad99", + "hash": "0x477ac0f0a6b67f7a614384a052a0ad4d1bb99b79fccf9dbc7cce878758870503", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": accounts[0], "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": Quantity.from(startingBlockNumber + 1).toString(), - "parentHash": "0x4491767e43978f68585dced6392f302779f117ce39853c946ef2e61a0c104a33", + "parentHash": "0x746144f35cfbcc1bb8ea1dcd540b674c81cc25ffec8fa1ec42d444cba9678cc2", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "stateRoot": "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 356480ceed..9a56f27287 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -14,8 +14,7 @@ describe("api", () => { // bitwise tricks since those won't work on numbers greater than 2**31. const provider = await getProvider(); - // Multiple by 1000 because ganache keeps track of time in seconds - const bin32 = (2**31) * 1000; + const bin32 = 2**31; const now = Date.now(); // fast forward time by bin32, plus 2 seconds, in case testing is slow const newTime = bin32 + now + 2; diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 26a07f1978..21cfa82b92 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -37,7 +37,7 @@ "@ganache/options": "^2.2.1", "@ganache/utils": "^2.2.1", "@types/keccak": "3.0.1", - "eth-sig-util": "^2.5.3", + "eth-sig-util": "2.5.3", "ethereumjs-abi": "^0.6.8", "ethereumjs-vm": "4.2.0", "keccak": "3.0.0", diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 6c20e2c5e1..54bd7d5abe 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -283,7 +283,7 @@ export default class EthereumApi implements types.Api { * @returns Returns the total time adjustment, in seconds. */ async evm_increaseTime(seconds: number) { - return this.#blockchain.increaseTime(seconds); + return Math.floor(this.#blockchain.increaseTime(seconds * 1000) / 1000); } /** @@ -297,7 +297,7 @@ export default class EthereumApi implements types.Api { * @returns The amount of *seconds* between the given timestamp and now. */ async evm_setTime(time?: Date | number) { - return this.#blockchain.setTime(+time); + return Math.floor(this.#blockchain.setTime(+time) / 1000); } /** diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 0d2297deb5..6905f0ca09 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -138,7 +138,9 @@ export default class Blockchain extends Emittery.Typed { - return Math.floor(Date.now() / 1000) + this.#timeAdjustment; + return Math.floor((Date.now() + this.#timeAdjustment) / 1000); }; + /** + * @param seconds + * @returns the total time offset *in milliseconds* + */ public increaseTime(seconds: number) { if (seconds < 0) { seconds = 0; @@ -388,8 +397,12 @@ export default class Blockchain extends Emittery.Typed Date: Tue, 25 Aug 2020 21:05:38 -0400 Subject: [PATCH 481/691] Revert missing `from` error message change because the original was more useful --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 54bd7d5abe..3b0a2980ad 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -917,7 +917,7 @@ export default class EthereumApi implements types.Api { } if (fromString == null) { - throw new Error("unknown account"); + throw new Error("from not found; is required"); } // Error checks. It's possible to JSON.stringify a Buffer to JSON. From 9bcf33397651f59e7d2ea3b2773e8618b01845d3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 25 Aug 2020 21:06:05 -0400 Subject: [PATCH 482/691] revert locked account error message change because the original was more useful --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 3b0a2980ad..a48d9fbb2b 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -932,7 +932,7 @@ export default class EthereumApi implements types.Api { const isUnlockedAccount = wallet.unlockedAccounts.has(fromString); if (!isUnlockedAccount) { - const msg = isKnownAccount ? "authentication needed: password or unlock" : "unknown account"; + const msg = isKnownAccount ? "authentication needed: password or unlock" : "sender account not recognized"; throw new Error(msg); } From 0ca830cd98eaed9c85a5c610c344e7f0778bb443 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 27 Aug 2020 19:08:51 -0400 Subject: [PATCH 483/691] add better errors and handle batched requests --- src/chains/ethereum/src/api.ts | 5 +- .../src/components/transaction-pool.ts | 5 +- src/chains/ethereum/src/index.ts | 47 +++-- src/chains/ethereum/src/provider.ts | 168 +++++++++++++----- src/chains/ethereum/src/things/coded-error.ts | 68 +++++++ .../ethereum/src/things/execution-error.ts | 15 +- .../ethereum/src/things/rejection-error.ts | 10 +- src/packages/core/__tests__/server.test.ts | 113 +++++++++++- src/packages/core/src/servers/http-server.ts | 2 +- .../servers/utils/websocket-close-codes.ts | 10 +- src/packages/core/src/servers/ws-server.ts | 39 ++-- src/packages/utils/src/things/jsonrpc.ts | 3 + src/packages/utils/src/types/connector.ts | 6 +- 13 files changed, 386 insertions(+), 105 deletions(-) create mode 100644 src/chains/ethereum/src/things/coded-error.ts diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index a48d9fbb2b..92511d0806 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -20,6 +20,7 @@ import Common from "ethereumjs-common"; import BlockLogs from "./things/blocklogs"; import EthereumAccount from "ethereumjs-account"; import { Block } from "./components/block-manager"; +import CodedError, { ErrorCodes } from "./things/coded-error"; //#endregion //#region Constants @@ -1162,9 +1163,7 @@ export default class EthereumApi implements types.Api { return promiEvent; } default: - const err = new Error("unsupported subscription type"); - (err as any).code = -32000; - throw err; + throw new CodedError(`no \"${subscriptionName}\" subscription in eth namespace`, ErrorCodes.METHOD_NOT_FOUND); } } diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index c65585153e..7a9ceb8bd4 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -5,6 +5,7 @@ import {utils} from "@ganache/utils"; import Transaction from "../things/transaction"; import {Data, Quantity} from "@ganache/utils"; import {GAS_LIMIT, INTRINSIC_GAS_TOO_LOW} from "../things/errors"; +import CodedError, { ErrorCodes } from "../things/coded-error"; export type TransactionPoolOptions = { /** @@ -276,13 +277,13 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { validateTransaction = (transaction: Transaction): Error => { // Check the transaction doesn't exceed the current block limit gas. if (Quantity.from(transaction.gasLimit) > this.#options.gasLimit) { - return new Error(GAS_LIMIT); + return new CodedError(GAS_LIMIT, ErrorCodes.INVALID_INPUT); } // Should supply enough intrinsic gas const gas = transaction.calculateIntrinsicGas(); if (Quantity.from(transaction.gasLimit).toBigInt() < gas) { - return new Error(INTRINSIC_GAS_TOO_LOW); + return new CodedError(INTRINSIC_GAS_TOO_LOW, ErrorCodes.INVALID_INPUT); } return null; diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 8e36be04ee..456e52da0b 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -4,7 +4,7 @@ import EthereumApi from "./api"; import {JsonRpcTypes, types, utils} from "@ganache/utils"; import Provider from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; -import { PromiEvent } from "@ganache/utils"; +import CodedError, { ErrorCodes } from "./things/coded-error"; function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest { return connection.constructor.name === "uWS.HttpRequest" @@ -14,7 +14,7 @@ export type EthereumProvider = Provider; export const EthereumProvider = Provider; export class EthereumConnector extends Emittery.Typed - implements types.Connector, JsonRpcTypes.Response> { + implements types.Connector | JsonRpcTypes.Request[], JsonRpcTypes.Response> { #provider: Provider; @@ -33,29 +33,54 @@ export class EthereumConnector extends Emittery.Typed; + try { + return JSON.parse(message) as JsonRpcTypes.Request; + } catch(e) { + throw new CodedError(e.message, ErrorCodes.PARSE_ERROR); + } } - handle(payload: JsonRpcTypes.Request, connection: HttpRequest | WebSocket) { + handle(payload: JsonRpcTypes.Request | JsonRpcTypes.Request[], connection: HttpRequest | WebSocket) { + if (Array.isArray(payload)) { + // handle batch transactions + const promises = payload.map(payload => this.#handle(payload, connection) + .then(({value}) => value).catch(e => e)); + return Promise.resolve({value: Promise.all(promises)} as any); + } else { + return this.#handle(payload, connection); + } + } + #handle = (payload: JsonRpcTypes.Request, connection: HttpRequest | WebSocket) => { const method = payload.method; if (method === "eth_subscribe") { if (isHttp(connection)) { - const err = new Error("notifications not supported") as Error & {code: number}; - err.code = -32000; - return Promise.reject(err); + return Promise.reject(new CodedError("notifications not supported", ErrorCodes.METHOD_NOT_SUPPORTED)); } } const params = payload.params as Parameters; return this.#provider.requestRaw({method, params}); } - format(result: any, payload: JsonRpcTypes.Request): RecognizedString { - const json = JsonRpcTypes.Response(payload.id, result); - return JSON.stringify(json); + format(result: any, payload: JsonRpcTypes.Request): RecognizedString; + format(results: any[], payloads: JsonRpcTypes.Request[]): RecognizedString; + format(results: any | any[], payload: JsonRpcTypes.Request | JsonRpcTypes.Request[]): RecognizedString { + if (Array.isArray(payload)) { + return JSON.stringify(payload.map((payload, i) => { + const result = results[i] + if (result instanceof Error) { + return JsonRpcTypes.Error(payload.id, result as any); + } else { + return JsonRpcTypes.Response(payload.id, result); + } + })); + } else { + const json = JsonRpcTypes.Response(payload.id, results); + return JSON.stringify(json); + } } formatError(error: Error & {code: number}, payload: JsonRpcTypes.Request): RecognizedString { - const json = JsonRpcTypes.Error(payload.id, error); + const json = JsonRpcTypes.Error(payload && payload.id ? payload.id : null, error); return JSON.stringify(json); } diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index f4568599fb..7d2f1b4122 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -5,6 +5,7 @@ import {JsonRpcTypes} from "@ganache/utils"; import EthereumOptions from "./options"; import cloneDeep from "lodash.clonedeep"; import {PromiEvent, types, utils} from "@ganache/utils"; +declare type RequestMethods = types.KnownKeys; type mergePromiseGenerics = Promise ? X : never>; @@ -12,8 +13,9 @@ interface Callback { (err?: Error, response?: JsonRpcTypes.Response): void; } -type RequestParams> = { - readonly method: Method, readonly params: Parameters | undefined +type RequestParams = { + readonly method: Method; + readonly params: Parameters | undefined }; const hasOwn = ({}).hasOwnProperty.call.bind(({}).hasOwnProperty); @@ -40,41 +42,51 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co return cloneDeep(this.#options); } - public send(payload: JsonRpcTypes.Request, callback?: Callback) : any; - public send(method: types.KnownKeys, params?: Parameters) : any; - public send(arg1: types.KnownKeys | JsonRpcTypes.Request, arg2?: Callback | any[]) { - let method: types.KnownKeys; + /** + * @param payload + * @param callback + * @deprecated Use the `request` method + */ + public send(payload: JsonRpcTypes.Request, callback?: Callback) : undefined; + /** + * Legacy callback style API + * @param payload JSON-RPC payload + * @param callback callback + * @deprecated Batch transactions have been deprecated. Send payloads + * individually via the `request` method. + */ + public send(payloads: JsonRpcTypes.Request[], callback?: Callback) : undefined; + /** + * @param method + * @param params + * @ignore Non standard! Do not use. + */ + public send(method: RequestMethods, params?: Parameters) : any; + public send(arg1: RequestMethods | JsonRpcTypes.Request | JsonRpcTypes.Request[], arg2?: Callback | any[]) { + let method: RequestMethods; let params: any; - let response: Promise<{}>; + let response: Promise<{}> | undefined; if (typeof arg1 === "string") { // this signature is (not) non-standard and is only a ganache thing!!! // we should probably remove it, but I really like it so I haven't yet. method = arg1; params = arg2 as Parameters; response = this.request({method, params}); + } else if (typeof arg2 === "function") { // handle backward compatibility with callback-style ganache-core - const payload = arg1; const callback = arg2 as Callback; - method = payload.method as types.KnownKeys; - params = payload.params; - this.request({method, params}) - .then((result: any) => { - // execute the callback on the nextTick so errors thrown in the callback - // don't cause the error to bubble up to ganache-core - process.nextTick(callback, null, JsonRpcTypes.Response(payload.id, JSON.parse(JSON.stringify(result)))) - }) - .catch((error: Error & {code: number, result?: unknown}) => { - let result: any; - // In order to provide `vmErrorsOnRPCResponse`, the `error` might have - // a `result`, which is pretty much just a hack - if (hasOwn(error, "result")) { - result = error.result - delete error.result; - } - const errorResult = JsonRpcTypes.Error(payload.id, error, result); - process.nextTick(callback, error, errorResult); + if (Array.isArray(arg1)) { + this.#legacySendPayloads(arg1).then(({error, result}) => { + process.nextTick(callback, error, result); + }); + } else { + this.#legacySendPayload(arg1).then(({error, result}) => { + process.nextTick(callback, error, result); }); + } + + } else { throw new Error( "No callback provided to provider's send function. As of web3 1.0, provider.send " + @@ -82,13 +94,6 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co ); } - const _options = this.#options; - if (_options.verbose) { - _options.logger.log( - ` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}` - ); - } - return response; } @@ -96,18 +101,40 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co * Legacy callback style API * @param payload JSON-RPC payload * @param callback callback + * @deprecated Use the `request` method. */ public sendAsync(payload: JsonRpcTypes.Request, callback?: Callback): void { return this.send(payload, callback); } - public request>(request: Parameters["length"] extends 0 ? {method: Method} : never): mergePromiseGenerics>; - public request>(request: RequestParams): mergePromiseGenerics>; - public request>(request: RequestParams) { - return this.requestRaw(request).then(r => r.value).then(v => JSON.parse(JSON.stringify(v))); + /** + * EIP-1193 style request method + * @param args + * @returns A Promise that resolves with the method's result or rejects with a CodedError + * @EIP [1193](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md) + */ + public async request(args: Parameters["length"] extends 0 ? Pick, "method"> : never): mergePromiseGenerics>; + /** + * EIP-1193 style request method + * @param args + * @returns A Promise that resolves with the method's result or rejects with a CodedError + * @EIP [1193](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md) + */ + public async request(args: RequestParams): mergePromiseGenerics>; + public async request(args: RequestParams) { + const rawResult = await this.requestRaw(args); + const value = await rawResult.value; + return JSON.parse(JSON.stringify(value)); } - public async requestRaw>({method, params}: RequestParams) { + /** + * Used when the caller wants to access the orignal `PromiEvent`, which would + * otherwise be flattened into a regular Promise through the Promise chain. + * @param request + */ + public async requestRaw({method, params}: RequestParams) { + this.#logRequest(method, params); + const result = await this.#executor.execute(this.#api, method, params); const promise = (result.value as mergePromiseGenerics); if (promise instanceof PromiEvent) { @@ -122,20 +149,73 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co } as never)); }); } - const value = promise.catch((err: Error) => { - // reformat errors, yo. this is all horrible... - (err as any).code = -32000; - if (this.#options.vmErrorsOnRPCResponse && (err as any).result) { - (err as any).result = JSON.parse(JSON.stringify((err as any).result)); + const value = promise.catch((error: Error) => { + if (this.#options.vmErrorsOnRPCResponse) { + if (hasOwn(error, "result")) { + // stringify the result here + // TODO: not sure why the stringification is even needed. + (error as any).result = JSON.parse(JSON.stringify((error as any).result)); + } } // then rethrow - throw err; + throw error; }); return { value: value }; } + #logRequest = (method: string, params: Parameters) => { + const options = this.#options; + if (options.verbose) { + options.logger.log( + ` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ") }` + ); + } + } + public disconnect = async () => { await this.emit("disconnect"); return; }; + + //#region legacy + #legacySendPayloads = (payloads: JsonRpcTypes.Request[]) => { + return Promise.all(payloads.map(this.#legacySendPayload)) + .then(results => { + let mainError: Error = null; + const responses = []; + results.forEach(({error, result}, i) => { + responses.push(result); + if (error) { + if (mainError == null) { + mainError = new Error("Batch error:") as Error & {errors: []}; + } + (mainError as any).errors[i] = error; + } + }); + return {error: mainError, result: responses}; + }); + } + + #legacySendPayload = async (payload: JsonRpcTypes.Request) => { + const method = payload.method as RequestMethods; + const params = payload.params as Parameters; + try { + const result = await this.request({ method, params }); + return { + error: null, + result: JsonRpcTypes.Response(payload.id, JSON.parse(JSON.stringify(result))) + }; + } catch (error) { + let result: any; + // In order to provide `vmErrorsOnRPCResponse`, the `error` might have + // a `result` property that we need to move to the result field. Yes, + // it's super weird behavior! + if (hasOwn(error, "result")) { + result = error.result; + delete error.result; + } + return { error, result: JsonRpcTypes.Error(payload.id, error, result) }; + } + } + //#endregion } diff --git a/src/chains/ethereum/src/things/coded-error.ts b/src/chains/ethereum/src/things/coded-error.ts new file mode 100644 index 0000000000..2662b6f5b9 --- /dev/null +++ b/src/chains/ethereum/src/things/coded-error.ts @@ -0,0 +1,68 @@ +export const ErrorCodes = { + /** + * Invalid JSON was received by the server. + * An error occurred on the server while parsing the JSON text. + */ + PARSE_ERROR: -32700, + + /** + * The JSON sent is not a valid Request object. + */ + INVALID_REQUEST: -32600, + + /** + * The method does not exist / is not available. + */ + METHOD_NOT_FOUND: -32601, + + /** + * Invalid method parameter(s). + */ + INVALID_PARAMS: -32602, + + /** + * Internal JSON-RPC error. + */ + INTERNAL_ERROR: -32603, + + /** + * Custom Ganache Application Error for transactions that fail to execute. + */ + VM_ERROR: -32103, + + /** + * Missing or invalid parameters + */ + INVALID_INPUT: -32000, + + /** + * Transaction creation failed + */ + TRANSACTION_REJECTED: -32003, + + /** + * Method is not implemented + */ + METHOD_NOT_SUPPORTED: -32004, + + /** + * Version of JSON-RPC protocol is not supported + */ + JSON_RPC_VERSION_NOT_SUPPORTED: -32006 +} as const; + +export default class CodedError extends Error { + code: number + constructor(message: string, code: number){ + super(message); + Error.captureStackTrace(this, this.constructor); + + this.code = code; + } + + static from(error: Error, code: number) { + const codedError = new CodedError(error.message, code); + codedError.stack = error.stack; + return codedError; + } +} diff --git a/src/chains/ethereum/src/things/execution-error.ts b/src/chains/ethereum/src/things/execution-error.ts index 915d853912..3e73921aee 100644 --- a/src/chains/ethereum/src/things/execution-error.ts +++ b/src/chains/ethereum/src/things/execution-error.ts @@ -3,6 +3,7 @@ import Transaction from "./transaction"; import { VM_EXCEPTION } from "./errors"; import { Data } from "@ganache/utils"; import { rawDecode } from "ethereumjs-abi"; +import CodedError, { ErrorCodes } from "./coded-error"; const REVERT_REASON = Buffer.from("08c379a0", "hex"); // keccak("Error(string)").slice(0, 4) @@ -11,8 +12,8 @@ export enum RETURN_TYPES { RETURN_VALUE } -export default class ExecutionError extends Error { - public code: -32000; +export default class ExecutionError extends CodedError { + public code: typeof ErrorCodes.VM_ERROR; public data: { hash: string, programCounter: number, @@ -21,14 +22,15 @@ export default class ExecutionError extends Error { message: string } constructor(transaction: Transaction, result: EVMResult, returnType: RETURN_TYPES) { - super(); + const execResult = result.execResult; + const error = execResult.exceptionError.error; + let message = VM_EXCEPTION + error; + + super(message, ErrorCodes.VM_ERROR); Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; - const execResult = result.execResult; - const error = execResult.exceptionError.error; - let message = VM_EXCEPTION + error; const returnValue = execResult.returnValue; const hash = Data.from(transaction.hash(), 32).toString(); let reason: string | null; @@ -40,7 +42,6 @@ export default class ExecutionError extends Error { } this.message = message; - this.code = -32000; this.data = { hash: hash, programCounter: execResult.runState.programCounter, diff --git a/src/chains/ethereum/src/things/rejection-error.ts b/src/chains/ethereum/src/things/rejection-error.ts index e023500004..31261ed10d 100644 --- a/src/chains/ethereum/src/things/rejection-error.ts +++ b/src/chains/ethereum/src/things/rejection-error.ts @@ -1,10 +1,12 @@ -export default class RejectionError extends Error { - public code: -32000; +import CodedError, { ErrorCodes } from "./coded-error"; + +export default class RejectionError extends CodedError { + public code: typeof ErrorCodes.INVALID_INPUT; public data: { result: string } constructor(result: string, message: string) { - super(); + super(message, ErrorCodes.INVALID_INPUT); Error.captureStackTrace(this, this.constructor); @@ -13,7 +15,5 @@ export default class RejectionError extends Error { this.data = { result } - this.message = message; - this.code = -32000; } } \ No newline at end of file diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/__tests__/server.test.ts index a7c7c7349f..cbb1f875bc 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -292,7 +292,8 @@ describe("server", () => { } }); - it("fails to subscribe over HTTP", async () => { + + it("returns 200/OK for RPC errors over HTTP", async () => { await setup(); const jsonRpcJson: any = { jsonrpc: "2.0", @@ -303,10 +304,49 @@ describe("server", () => { try { // TODO: should we expect a 200 OK response with an `error` property // in a json rpc body? Probably, because we _do_ already send one. :-/ - await assert.rejects(request.post("http://localhost:" + port).send(jsonRpcJson), { - status: 400, - message: "Bad Request" + const response = await request.post("http://localhost:" + port).send(jsonRpcJson); + assert.strictEqual(response.status, 200); + assert.strictEqual(JSON.parse(response.text).error.message, "notifications not supported"); + } finally { + await teardown(); + } + }); + + it("handles batched json-rpc requests/responses", async () => { + await setup(); + const jsonRpcJson: any = [{ + jsonrpc: "2.0", + id: "1", + method: "net_version", + params: [] + }, { + jsonrpc: "2.0", + id: "2", + method: "eth_chainId", + params: [] + }, { + jsonrpc: "2.0", + id: "3", + method: "eth_subscribe", // this one fails over HTTP + params: ["newHeads"] + }]; + try { + const response = await request.post("http://localhost:" + port).send(jsonRpcJson); + const json = JSON.parse(response.text); + assert.deepStrictEqual(json[0], { + jsonrpc: "2.0", + id: "1", + result: "1234" }); + assert.deepStrictEqual(json[1], { + jsonrpc: "2.0", + id: "2", + result: "0x539" + }); + assert.deepStrictEqual(json[2].jsonrpc, "2.0"); + assert.deepStrictEqual(json[2].id, "3"); + assert.deepStrictEqual(json[2].error.code, -32004); + assert.deepStrictEqual(json[2].error.message, "notifications not supported"); } finally { await teardown(); } @@ -526,13 +566,14 @@ describe("server", () => { it("doesn't crash when sending bad data over websocket", async () => { const ws = new WebSocket("ws://localhost:" + port); - const result: number = await new Promise(resolve => { + const result = await new Promise(resolve => { ws.on("open", () => { - ws.on("close", resolve); + ws.on("message", resolve); ws.send("What is it?"); }); }); - assert.strictEqual(result, 1002, "Did not receive expected close code 1002"); + const json = JSON.parse(result); + assert.strictEqual(json.error.code, -32700); }); it("doesn't crash when the connection is closed while a request is in flight", async () => { @@ -601,6 +642,64 @@ describe("server", () => { provider.requestRaw = oldRequestRaw; }); + it("handles batched json-rpc requests/responses", async () => { + const jsonRpcJson: any = [{ + jsonrpc: "2.0", + id: "1", + method: "net_version", + params: [] + }, { + jsonrpc: "2.0", + id: "2", + method: "eth_chainId", + params: [] + }, { + jsonrpc: "2.0", + id: "3", + method: "eth_subscribe", // this one works here in WS-land + params: ["newHeads"] + }]; + + const ws = new WebSocket("ws://localhost:" + port); + const response: any = await new Promise(resolve => { + ws.on("open", () => { + ws.send(JSON.stringify(jsonRpcJson)); + }); + ws.on("message", resolve); + }); + ws.close(); + + const json = JSON.parse(response); + assert.deepStrictEqual(json, [ + { + jsonrpc: "2.0", + id: "1", + result: "1234" + }, { + jsonrpc: "2.0", + id: "2", + result: "0x539" + }, { + jsonrpc: "2.0", + id: "3", + result: "0x1" + } + ]); + }); + + it("handles invalid json-rpc JSON", async () => { + const ws = new WebSocket("ws://localhost:" + port); + const response = await new Promise(resolve => { + ws.on("open", () => { + ws.send(JSON.stringify(null)); + }); + ws.on("message", (data) => { + resolve(JSON.parse(data.toString())); + }); + }); + assert.strictEqual(response.error.code, -32700); + }); + it("doesn't crash when the connection is closed while a subscription is in flight", async () => { const provider = s.provider as EthereumProvider; let promiEvent: PromiEvent; diff --git a/src/packages/core/src/servers/http-server.ts b/src/packages/core/src/servers/http-server.ts index fd2cec8738..bba34de59a 100644 --- a/src/packages/core/src/servers/http-server.ts +++ b/src/packages/core/src/servers/http-server.ts @@ -155,7 +155,7 @@ export default class HttpServer { const data = connector.formatError(error, payload); sendResponse( response, - HttpResponseCodes.BAD_REQUEST, + HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders diff --git a/src/packages/core/src/servers/utils/websocket-close-codes.ts b/src/packages/core/src/servers/utils/websocket-close-codes.ts index 1c821c2555..0aff503256 100644 --- a/src/packages/core/src/servers/utils/websocket-close-codes.ts +++ b/src/packages/core/src/servers/utils/websocket-close-codes.ts @@ -1,7 +1,11 @@ -// 1001 indicates that an endpoint is "going away", such as a server -// going down or a browser having navigated away from a page. enum WebSocketCloseCodes { + // CLOSE_NORMAL = 1000, + /** + * Indicates that an endpoint is "going away", such as a server going down or + * a browser having navigated away from a page. + */ CLOSE_GOING_AWAY = 1001, - CLOSE_PROTOCOL_ERROR = 1002 + // CLOSE_PROTOCOL_ERROR = 1002, + // CLOSE_ABNORMAL = 1006 } export default WebSocketCloseCodes; diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index 18ea3b56a2..c6dbbb0443 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -34,32 +34,31 @@ export default class WebsocketServer { connections.set(ws, new Set()); }, - message: (ws: GanacheWebSocket, message: ArrayBuffer, isBinary: boolean) => { + message: async (ws: GanacheWebSocket, message: ArrayBuffer, isBinary: boolean) => { let payload: ReturnType; + const useBinary = autoBinary ? isBinary : (wsBinary as boolean); try { payload = connector.parse(Buffer.from(message)); - } catch (e) { - ws.end(WebSocketCloseCodes.CLOSE_PROTOCOL_ERROR, "Received a malformed frame: " + e.message); + } catch (err) { + const response = connector.formatError(err, payload); + ws.send(response, useBinary, true); return; } + + let response: uWS.RecognizedString; - connector.handle(payload, ws).then(({value}) => { + try { + const {value} = await connector.handle(payload, ws); + // The socket may have closed while we were waiting for the response // Don't bother trying to send to it if it was. if (ws.closed) return; - const useBinary = autoBinary ? isBinary : (wsBinary as boolean); - const resultEmitter = value as MergePromiseT; - resultEmitter.then(result => { - if (ws.closed) return; + const result = await resultEmitter; + if (ws.closed) return; - const message = connector.format(result, payload); - ws.send(message, useBinary, true); - }, err => { - const message = connector.formatError(err, payload); - ws.send(message, useBinary, true); - }); + response = connector.format(result, payload); // if the result is an emitter listen to its `"message"` event if (resultEmitter instanceof PromiEvent) { @@ -73,14 +72,14 @@ export default class WebsocketServer { // keep track of listeners to dispose off when the ws disconnects connections.get(ws).add(resultEmitter.dispose); } - }).catch(err => { + } catch(err) { + // ensure the connector's `handle` fn doesn't throw outside of a Promise + if (ws.closed) return; - - const useBinary = autoBinary ? isBinary : (wsBinary as boolean); + response = connector.formatError(err, payload); + } - const message = connector.formatError(err, payload); - ws.send(message, useBinary, true); - }) + ws.send(response, useBinary, true); }, drain: (ws: WebSocket) => { diff --git a/src/packages/utils/src/things/jsonrpc.ts b/src/packages/utils/src/things/jsonrpc.ts index f846627fc1..b22999de35 100644 --- a/src/packages/utils/src/things/jsonrpc.ts +++ b/src/packages/utils/src/things/jsonrpc.ts @@ -50,6 +50,9 @@ namespace JsonRpc { (details as any)[name] = (error as any)[name]; } }); + if (typeof details.code !== "number") { + details.code = -32700; // JSON-RPC Parse error + } if (result !== undefined) { return { id, diff --git a/src/packages/utils/src/types/connector.ts b/src/packages/utils/src/types/connector.ts index 69de94388f..581760c8f4 100644 --- a/src/packages/utils/src/types/connector.ts +++ b/src/packages/utils/src/types/connector.ts @@ -21,8 +21,10 @@ export interface Connector Promise<{value: ReturnType]>}>) - | ((payload: RequestFormat, connection: WebSocket) => Promise<{value: ReturnType]>}>); + | ((payload: RequestFormat, connection: HttpRequest) => Promise<{value: ReturnType]>}>) + | ((payload: RequestFormat[], connection: HttpRequest) => Promise<{value: ReturnType]>[]}>) + | ((payload: RequestFormat, connection: WebSocket) => Promise<{value: ReturnType]>}>) + | ((payload: RequestFormat[], connection: WebSocket) => Promise<{value: ReturnType]>[]}>); /** * Formats the response (returned from `handle`) From 1640debce4fd15e461ec9099a1bfecbace0466a0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 27 Aug 2020 19:09:07 -0400 Subject: [PATCH 484/691] udpate uWebSockets.js --- npm-shrinkwrap.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 675f21fa17..8027abf502 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -11423,8 +11423,8 @@ "dev": true }, "uWebSockets.js": { - "version": "github:uNetworking/uWebSockets.js#116a85f9668dcb03e7799db06dc8275bc43c0963", - "from": "github:uNetworking/uWebSockets.js#v17.4.0" + "version": "github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c", + "from": "github:uNetworking/uWebSockets.js#v18.4.0" }, "uglify-js": { "version": "3.9.4", diff --git a/package.json b/package.json index a155318de9..c6c59a2c62 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "seedrandom": "3.0.5", "subleveldown": "5.0.1", "tmp-promise": "3.0.2", - "uWebSockets.js": "github:uNetworking/uWebSockets.js#v17.4.0" + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "1.0.1", From a2e7866b3318c75a752d6f1c0658b442e5d55896 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 27 Aug 2020 19:14:17 -0400 Subject: [PATCH 485/691] eth_estimateGas (#619) Co-authored-by: Nicholas J. Paterno --- .../ethereum/__tests__/api/eth/eth.test.ts | 28 + .../ethereum/__tests__/api/eth/gas.test.ts | 961 ++++++++++++++++++ src/chains/ethereum/src/api.ts | 38 +- src/chains/ethereum/src/blockchain.ts | 17 + .../ethereum/src/things/gas-estimator.ts | 264 +++++ src/packages/core/__tests__/gas.ts | 24 + 6 files changed, 1321 insertions(+), 11 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/eth/gas.test.ts create mode 100644 src/chains/ethereum/src/things/gas-estimator.ts create mode 100644 src/packages/core/__tests__/gas.ts diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 5976053233..b1c970cabe 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -57,6 +57,34 @@ describe("api", () => { assert.deepStrictEqual(result, []); }); }); + + + describe("eth_estimateGas", () => { + it.only("EOA to EOA", async () => { + const estimate = await provider.send("eth_estimateGas", [ + { + from: accounts[0], + to: accounts[1], + value: "0xffffff" + } + ]); + console.log(estimate); + assert(estimate); + // await provider.send("eth_sendTransaction", [ + // { + // from: accounts[0], + // to: accounts[1], + // value: 1 + // } + // ]); + // const _message = await provider.once("message"); + // const blocks = await Promise.all([ + // provider.send("eth_getBlockByNumber", ["0x1", true]), + // provider.send("eth_getBlockByNumber", ["0x1"]) + // ]); + // assert(blocks[0].hash, blocks[1].hash); + }); + }); describe("eth_submitWork", () => { it("should get compilers list", async () => { diff --git a/src/chains/ethereum/__tests__/api/eth/gas.test.ts b/src/chains/ethereum/__tests__/api/eth/gas.test.ts new file mode 100644 index 0000000000..96673a8ab9 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/gas.test.ts @@ -0,0 +1,961 @@ +import memdown from "memdown"; +import assert from "assert"; +import EthereumProvider from "../../../src/provider"; +import getProvider from "../../helpers/getProvider"; +import { BN } from "ethereumjs-util" + +const SEED_RANGE = 1000000; +const RSCLEAR_REFUND = 15000; +const RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO_ISTANBUL = 19200; +const RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO = 19800; +const RSELFDESTRUCT_REFUND = 24000; +const HARDFORKS = ["byzantium", "constantinople", "petersburg", "istanbul", "muirGlacier"]; + +function hex(length: number) { + return `0x${Buffer.allocUnsafe(length).fill(0).toString("hex")}`; +} + + +/** + * Generates a random integer + * @param {Number} max Maximum integer to randomly generate + * @returns {Number} Returns a random integer between 0 and `max` + */ +const randomInteger = (max) => { + return Math.floor(Math.random() * (max + 1)); +}; + +describe("Gas", function() { + let provider: EthereumProvider; + let accounts: string[]; + + beforeEach(async () => { + provider = await getProvider(); + accounts = await provider.send("eth_accounts"); + }); + + HARDFORKS.forEach((hardfork) => { + describe(`Hardfork: ${hardfork.toUpperCase()}`, function() { + let context; + const seed = randomInteger(SEED_RANGE); + + before("Setting up web3 and contract", async function() { + this.timeout(10000); + + const contractRef = { + contractFiles: ["EstimateGas"], + contractSubdirectory: "gas" + }; + + const ganacheProviderOptions = { + seed, + hardfork + }; + + context = await bootstrap(contractRef, ganacheProviderOptions, hardfork); + }); + + describe("EIP150 Gas Estimation: ", function() { + const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); + let ContractFactory; + let TestDepth; + let Donation; + let Fib; + let SendContract; + let Create2; + let NonZero; + before("Setting up EIP150 contracts", async function() { + this.timeout(10000); + + const subDirectory = { contractSubdirectory: "gas" }; + const create2 = Object.assign({ contractFiles: ["CreateTwo", "GasLeft"] }, subDirectory); + const factory = Object.assign({ contractFiles: ["ContractFactory"] }, subDirectory); + const testDepth = Object.assign({ contractFiles: ["TestDepth"] }, subDirectory); + const donation = Object.assign({ contractFiles: ["Donation"] }, subDirectory); + const fib = Object.assign({ contractFiles: ["Fib"] }, subDirectory); + const sendContract = Object.assign({ contractFiles: ["SendContract"] }, subDirectory); + const nonZero = Object.assign({ contractFiles: ["NonZero"] }, subDirectory); + + const ganacheProviderOptions = { + seed, + hardfork + }; + + ContractFactory = await bootstrap(factory, ganacheProviderOptions, hardfork); + // memdown makes the test that uses TestDepth about 20% faster, so we use it here because CI makes us sad. + TestDepth = await bootstrap(testDepth, Object.assign({ db: memdown() }, ganacheProviderOptions), hardfork); + Donation = await bootstrap(donation, ganacheProviderOptions, hardfork); + Fib = await bootstrap(fib, ganacheProviderOptions, hardfork); + NonZero = await bootstrap(nonZero, ganacheProviderOptions, hardfork); + SendContract = await bootstrap( + sendContract, + Object.assign( + { + accounts: [ + { + secretKey: "0x" + privateKey.toString("hex"), + balance: "0x" + new BN("1000000000000000000000").toString("hex") + } + ] + }, + ganacheProviderOptions + ), + hardfork + ); + if (hardfork !== "byzantium") { + Create2 = await bootstrap(create2, ganacheProviderOptions, hardfork); + } + }); + + it("Should not timeout when running a long test", async() => { + try { + await context.instance.methods.runsOutOfGas().send({ from: context.accounts[0] }); + assert.fail(); + } catch (e) { + assert(e.message.includes("out of gas")); + } + }).timeout(5000); + + it("Should estimate gas perfectly with EIP150 - recursive CALL", async() => { + const { accounts, instance, send } = Fib; + const txParams = { + from: accounts[0], + to: instance._address, + value: 10 + }; + const { result: estimateHex } = await send("eth_estimateGas", txParams); + const estimate = parseInt(estimateHex); + const tx = Object.assign({ gas: `0x${(estimate - 1).toString(16)}` }, txParams); + await assert.rejects( + () => send("eth_sendTransaction", tx), + { + message: "VM Exception while processing transaction: out of gas" + }, + `SANITY CHECK: Gas estimate: ${estimate - 1} is too high.` + ); + tx.gas = estimateHex; + await assert.doesNotReject( + () => send("eth_sendTransaction", tx), + undefined, + `SANITY CHECK. Still not enough gas? ${estimate} Our estimate is still too low` + ); + }); + + it("Should estimate gas perfectly with EIP150 - CREATE", async() => { + const { accounts, instance, send } = ContractFactory; + const txParams = { + from: accounts[0], + to: instance._address, + data: instance.methods.createInstance().encodeABI() + }; + const { result: estimateHex } = await send("eth_estimateGas", txParams); + const estimate = new BN(estimateHex.substring(2), "hex"); + txParams.gas = "0x" + estimate.subn(1).toString("hex"); + await assert.rejects(() => send("eth_sendTransaction", txParams), { + message: "VM Exception while processing transaction: revert" + }); + + txParams.gas = estimateHex; + await assert.doesNotReject( + () => send("eth_sendTransaction", txParams), + undefined, + `SANITY CHECK. Still not enough gas? ${estimate} Our estimate is still too low` + ); + }); + + it("Should estimate gas perfectly with EIP150 - CALL INSIDE CREATE", async() => { + const { accounts, instance } = Donation; + // Pre-condition + const address = accounts[0]; + const donateTx = { from: address, value: 50 }; + donateTx.gas = await instance.methods.donate().estimateGas(donateTx); + await instance.methods.donate().send(donateTx); + const tx = { from: address }; + const est = await instance.methods.moveFund(address, 5).estimateGas(tx); + tx.gas = est - 1; + await assert.rejects(() => instance.methods.moveFund(address, 5).send(tx), { + message: "VM Exception while processing transaction: out of gas" + }); + tx.gas = est; + await assert.doesNotReject( + () => instance.methods.moveFund(address, 5).send(tx), + undefined, + `SANITY CHECK. Still not enough gas? ${est} Our estimate is still too low` + ); + }).timeout(1000000); + + if (hardfork !== "byzantium") { + it("Should estimate gas perfectly with EIP150 - DELEGATECALL", async() => { + const { accounts, instance } = TestDepth; + const depth = 3; + const promises = Array(depth) + .fill(0) + .map((_, i) => { + const depth = i + 1; + return instance.methods + .depth(depth) + .estimateGas() + .then(async(est) => { + return Promise.all([ + assert.doesNotReject( + instance.methods.depth(depth).send({ + from: accounts[5], + gas: est + }), + undefined, + `SANITY CHECK. Still not enough gas? ${est} Our estimate is still too low` + ), + assert.rejects( + instance.methods.depth(depth).send({ + from: accounts[5], + gas: est - 1 + }), + { + name: "RuntimeError" + } + ) + ]); + }); + }); + await Promise.all(promises); + }).timeout(3000); + + it("Should estimate gas perfectly with EIP150 - CREATE2", async() => { + const { accounts, instance, web3 } = Create2; + const { result: newContract } = compile("./test/contracts/gas/", "GasLeft"); + const bytecode = newContract.contracts["GasLeft.sol"].GasLeft.evm.bytecode.object; + const byteCode = `0x${bytecode}${web3.eth.abi.encodeParameter("address", accounts[0]).slice(2)}`; + const salt = `0x${"0".repeat(63)}1`; + const futureAddress = `0x${web3.utils + .sha3( + `0x${["ff", instance._address, salt, web3.utils.sha3(byteCode)] + .map((val) => val.replace(/0x/, "")) + .join("")}` + ) + .slice(-40)}`.toLowerCase(); + const codeCheck = await web3.eth.getCode(futureAddress); + assert(codeCheck.slice(2).length === 0, "contract should not be deployed on chain!"); + + const nonce = await web3.eth.getTransactionCount(accounts[0]); + const result = await instance.methods.deploy(byteCode, salt).send({ + from: accounts[0], + gas: 4500000, + gasPrice: 10000000000, + nonce + }); + + const addr = result.events.RelayAddress.returnValues.addr; + assert(addr, futureAddress, "future contract address not the same as computed value"); + const codeCheck2 = await web3.eth.getCode(futureAddress); + assert(codeCheck2.slice(2).length > 0, "contract should be deployed on chain!"); + }).timeout(1000000); + + // TODO: Make this actually test SVT + it("Should estimate gas perfectly with EIP150 - Simple Value Transfer", async() => { + const { accounts, instance, send, web3 } = SendContract; + const toBN = (hex) => new BN(hex.substring(2), "hex"); + const toBNStr = (hex, base = 10) => toBN(hex).toString(base); + const sign = createSignedTx(privateKey); + const gasPrice = "0x77359400"; + const amountToTransfer = "0xfffffff1ff000000"; + + // Get initial Balance after contract deploy + const { result: balance } = await send("eth_getBalance", accounts[0]); + + // Initial seeding of capital to contract, we check the balance after. + const tx = { + gasPrice, + value: amountToTransfer, // ~18 ether + from: accounts[0], + to: instance._address + }; + ({ result: tx.gasLimit } = await send("eth_estimateGas", tx)); + const { result: hash } = await send("eth_sendTransaction", tx); + const { + result: { gasUsed: initialGasUsed } + } = await send("eth_getTransactionReceipt", hash); + + // Assert that the contract has the correct balance ~18 ether + const getBalance = await instance.methods.getBalance().call({ from: accounts[0] }); + assert.strictEqual(toBNStr(amountToTransfer), getBalance, "balance is not ~18 ether"); + + // It's not neccessary to sign but currently it's the only test that demonstrates sending signed + // transactions that call a contract method. + // Calling `encodeABI()` on the desired contract method will return the + // the necessary bytecode to call the contract method with the given parameters + // NOTE: errors from encodeABI are likely do to incorrect types for the method arguments + // Double check the contracts method signature and your arguments + // Ex: transfer(Address[], uint)) => transfer(Array, hex string of int) + const txParams = { + gasPrice, + nonce: "0x2", + to: instance._address, + value: "0x0", + data: instance.methods.transfer(accounts, amountToTransfer).encodeABI() + }; + ({ result: txParams.gasLimit } = await send("eth_estimateGas", sign(txParams).serialize())); + const { gasUsed: signedGasUsed } = await web3.eth.sendSignedTransaction(sign(txParams).serialize()); + const { result: newBalance } = await send("eth_getBalance", accounts[0]); + // Gasprice * ( sum of gas used ) + const gas = toBN(gasPrice).mul(toBN(initialGasUsed).addn(signedGasUsed)); + // Our current balance, plus the wei spent on gas === original gas + const currentBalancePlusGas = toBN(newBalance) + .add(gas) + .toString(); + assert.strictEqual(toBNStr(balance), currentBalancePlusGas, "balance + gas used !== to start balance"); + + // Assert that signed tx successfully drains contract to address + const newContractBalance = await instance.methods.getBalance().call({ from: accounts[0] }); + assert.strictEqual(newContractBalance, "0", "balance is not 0"); + }).timeout(10000); + } + + it("should correctly handle non-zero value child messages", async() => { + const { + accounts: [from], + instance: { _address: to, methods }, + send + } = NonZero; + const fns = [methods.doSend, methods.doTransfer, methods.doCall]; + for (let i = 0, l = fns; i < l.length; i++) { + const tx = { + from, + to, + value: "1000000000000000000", + data: fns[i]().encodeABI() + }; + const { result: gasLimit } = await send("eth_estimateGas", tx); + tx.gasLimit = "0x" + (parseInt(gasLimit) - 1).toString(16); + await assert.rejects(() => send("eth_sendTransaction", tx), { + message: "VM Exception while processing transaction: out of gas" + }); + tx.gasLimit = gasLimit; + await assert.doesNotReject( + () => send("eth_sendTransaction", tx), + undefined, + `SANITY CHECK. Still not enough gas? ${gasLimit} Our estimate is still too low` + ); + } + }); + }); + + describe("Refunds", function() { + it( + "accounts for Rsclear Refund in gasEstimate when a dirty storage slot is reset and it's original " + + "value is 0", + async function() { + const { accounts, instance, provider } = context; + const from = accounts[0]; + const options = { from, gas: 5000000 }; + + // prime storage by making sure it is set to 0 + await instance.methods.reset().send(options); + + // update storage and then reset it back to 0 + const method = instance.methods.triggerRsclearRefund(); + + const estimate = await method.estimateGas(options); + + const receipt = await method.send({ from, gas: estimate }); + + switch (provider.options.hardfork) { + case "byzantium": + case "petersburg": + assert.strictEqual(receipt.gasUsed, estimate - RSCLEAR_REFUND); + break; + case "muirGlacier": + case "istanbul": + // EIP-2200 + assert(receipt.gasUsed <= estimate - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO_ISTANBUL + 2300); + break; + case "constantinople": + // since storage was initially primed to 0 and we call triggerRsclearRefund(), which then + // resets storage back to 0, 19800 gas is added to the refund counter per Constantinople EIP 1283 + assert.strictEqual(receipt.gasUsed, estimate - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO); + break; + default: + throw new Error("Invalid hardfork option: " + provider.options.hardfork); + } + assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); + } + ); + + it( + "accounts for Rsclear Refund in gasEstimate when a dirty storage slot is reset and it's " + + "original value is not 0", + async function() { + const { accounts, instance, provider } = context; + const from = accounts[0]; + const rsclearRefundForResettingDirtySlotToNonZeroValue = 4800; + const rsclearRefundForResettingDirtySlotToNonZeroValueIstanbul = 4200; + const options = { from, gas: 5000000 }; + + await instance.methods.reset().send(options); // prime storage by making sure y is set to 1 + + // update storage and then reset it back to 1 + const method = instance.methods.triggerRsclearRefundForY(); + + const gasEstimate = await method.estimateGas(options); + + const receipt = await method.send({ from, gas: gasEstimate }); + + switch (provider.options.hardfork) { + case "byzantium": + case "petersburg": + // since we are resetting to a non-zero value, there is no gas added to the refund counter here + assert.strictEqual(receipt.gasUsed, gasEstimate); + break; + case "muirGlacier": + case "istanbul": // EIP-2200 + assert( + receipt.gasUsed <= gasEstimate - rsclearRefundForResettingDirtySlotToNonZeroValueIstanbul + 2300 + ); + break; + case "constantinople": + // since storage was initially primed to 1 and we call triggerRsclearRefundForY(), which then + // resets storage back to 1, 4800 gas is added to the refund counter per Constantinople EIP 1283 + assert.strictEqual(receipt.gasUsed, gasEstimate - rsclearRefundForResettingDirtySlotToNonZeroValue); + break; + default: + throw new Error("Invalid hardfork option: " + provider.options.hardfork); + } + assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); + } + ); + + it( + "accounts for Rsclear Refund in gasEstimate when a fresh storage slot's original " + + "value is not 0 and new value is 0", + async function() { + const { accounts, instance, provider } = context; + const from = accounts[0]; + const options = { from, gas: 5000000 }; + + // prime storage by making sure storage is set to 1 + await instance.methods.initialSettingOfX().send(options); + + // update storage to be 0 + const method = instance.methods.reset(); + + const gasEstimate = await method.estimateGas(options); + + const receipt = await method.send({ from, gas: gasEstimate }); + + switch (provider.options.hardfork) { + case "byzantium": + case "petersburg": + case "constantinople": + assert.strictEqual(receipt.gasUsed, gasEstimate - RSCLEAR_REFUND); + break; + case "muirGlacier": + case "istanbul": // EIP-2200 + assert(receipt.gasUsed <= gasEstimate - RSCLEAR_REFUND + 2300); + break; + default: + throw new Error("Invalid hardfork option: " + provider.options.hardfork); + } + assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); + } + ); + + it( + "accounts for Rsclear Refund in gasEstimate when a dirty storage slot's original value " + + "is not 0 and new value is 0", + async function() { + const { accounts, instance, provider } = context; + const from = accounts[0]; + const options = { from, gas: 5000000 }; + + // prime storage by making sure storage is set to 1 + await instance.methods.initialSettingOfX().send(options); + + // update storage and then reset it to 0 + const method = instance.methods.triggerRsclearRefund(); + + const gasEstimate = await method.estimateGas(options); + + const receipt = await method.send({ from, gas: gasEstimate }); + + switch (provider.options.hardfork) { + case "byzantium": + case "petersburg": + case "constantinople": + assert.strictEqual(receipt.gasUsed, gasEstimate - RSCLEAR_REFUND); + break; + case "muirGlacier": + case "istanbul": // EIP-2200 + assert(receipt.gasUsed <= gasEstimate - RSCLEAR_REFUND + 2300); + break; + default: + throw new Error("Invalid hardfork option: " + provider.options.hardfork); + } + assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); + } + ); + + it( + "accounts for Rsclear Refund in gasEstimate when a dirty storage slot's original value " + + "is not 0 and current value is 0", + async function() { + const { accounts, instance, provider } = context; + const from = accounts[0]; + const options = { from, gas: 5000000 }; + + // prime storage by making sure storage is set to 1 + await instance.methods.initialSettingOfX().send(options); + + // updates current value to 0 and new value to be the remaining amount of gas + const method = instance.methods.triggerRsclearRefundForX(); + + const gasEstimate = await method.estimateGas(options); + + const receipt = await method.send({ from, gas: gasEstimate }); + + switch (provider.options.hardfork) { + case "byzantium": + case "petersburg": + assert.strictEqual(receipt.gasUsed, gasEstimate - RSCLEAR_REFUND); + break; + case "muirGlacier": + case "istanbul": + assert(receipt.gasUsed <= gasEstimate + 2300); + break; + case "constantinople": + // since storage was initially primed to 1 and we call triggerRsclearRefundForX(), which then + // resets storage's current value to 0 and 15000 gas is added to the refund counter, and then + // it replaces x with gasleft, which removes 150000 gas from the refund counter per Constantinople + // EIP 1283 leaving us with a rsclear refund of 0 + assert.strictEqual(receipt.gasUsed, gasEstimate); + break; + default: + throw new Error("Invalid hardfork option: " + provider.options.hardfork); + } + assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); + } + ); + + it("accounts for Rselfdestruct Refund in gasEstimate", async function() { + const { abi, accounts, bytecode, web3 } = context; + const from = accounts[0]; + const options = { from, gas: 5000000 }; + + const deploymentOptions = { gas: 3141592 }; + const { instance } = await deploy(abi, bytecode, web3, deploymentOptions); + await instance.methods.reset().send(options); // prime storage by making sure it is set to 0 + + const method = instance.methods.triggerRselfdestructRefund(); + + const gasEstimate = await method.estimateGas(options); + + const receipt = await method.send({ from, gas: gasEstimate }); + + assert.strictEqual(receipt.gasUsed, gasEstimate - RSELFDESTRUCT_REFUND); + assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); + }); + + it("accounts for Rsclear and Rselfdestruct Refunds in gasEstimate", async function() { + const { abi, accounts, bytecode, provider, web3 } = context; + const from = accounts[0]; + + const deploymentOptions = { gas: 3141592 }; + const { instance } = await deploy(abi, bytecode, web3, deploymentOptions); + await instance.methods.reset().send({ from, gas: 5000000 }); // prime storage by making sure it is set to 0 + + const method = instance.methods.triggerAllRefunds(); + + const gasEstimate = await method.estimateGas({ from }); + + const receipt = await method.send({ from, gas: gasEstimate }); + + switch (provider.options.hardfork) { + case "byzantium": + case "petersburg": + assert.strictEqual(receipt.gasUsed, gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND); + break; + case "muirGlacier": + case "istanbul": // EIP-2200 + assert.strictEqual( + receipt.gasUsed, + gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO_ISTANBUL + ); + break; + case "constantinople": + // since storage was initially primed to 0 and we call triggerAllRefunds(), which then + // resets storage back to 0, 19800 gas is added to the refund counter per Constantinople EIP 1283 + assert.strictEqual( + receipt.gasUsed, + gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO + ); + break; + default: + throw new Error("Invalid hardfork option: " + provider.options.hardfork); + } + assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); + }); + + it("account Rsclear/Rselfdestruct/Refunds in gasEstimate w/many transactions in a block", async function() { + const { abi, bytecode, provider } = context; + const options = { + seed, + hardfork + }; + const { send, accounts, web3 } = await initializeTestProvider(options); + + const transactions = [ + { + value: "0x10000000", + gasLimit: "0x33450", + from: accounts[2], + to: accounts[1], + nonce: "0x0" + }, + { + value: "0x10000000", + gasLimit: "0x33450", + from: accounts[2], + to: accounts[1], + nonce: "0x1" + }, + { + value: "0x10000000", + gasLimit: "0x33450", + from: accounts[1], // < + to: accounts[2], // <^ reversed tx order + nonce: "0x0" + } + ]; + + // Precondition + const initialBlockNumber = await web3.eth.getBlockNumber(); + assert.deepStrictEqual(initialBlockNumber, 0, "Current Block Should be 0"); + + const deploymentOptions = { gas: 3141592 }; + const { instance } = await deploy(abi, bytecode, web3, deploymentOptions); + + // prime storage by making sure it is set to 0 + await instance.methods.reset().send({ from: accounts[0], gas: 5000000 }); + await send("miner_stop"); + const hashes = await Promise.all( + transactions.map((transaction) => { + const promiEvent = web3.eth.sendTransaction(transaction); + + return new Promise((resolve) => { + promiEvent.once("transactionHash", async(hash) => { + // Ensure there's no receipt since the transaction hasn't yet been processed. Ensure IntervalMining + const receipt = await web3.eth.getTransactionReceipt(hash); + assert.strictEqual(receipt, null, "No receipt since the transaction hasn't yet been processed."); + resolve(hash); + }); + }); + }) + ); + + const currentBlockNumber = await web3.eth.getBlockNumber(); + assert.deepStrictEqual(currentBlockNumber, 2, "Current Block Should be 2"); + + const method = instance.methods.triggerAllRefunds(); + const gasEstimate = await method.estimateGas({ from: accounts[0] }); + const prom = method.send({ from: accounts[0], gas: gasEstimate }); + await new Promise((resolve) => { + prom.once("transactionHash", resolve); + }); + await send("evm_mine"); + // web3 doesn't subscribe fast enough to newHeads after issuing the previous send + // we we mine another block to give it an additional newHeads notification. /shrug + await send("evm_mine"); + const rec = await prom; + const { gasUsed } = rec; + + let transactionCostMinusRefund = gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND; + switch (provider.options.hardfork) { + case "byzantium": + case "petersburg": + assert.strictEqual(gasUsed, transactionCostMinusRefund); + break; + case "muirGlacier": + case "istanbul": + // EIP-2200 + transactionCostMinusRefund = + gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO_ISTANBUL; + assert.strictEqual(gasUsed, transactionCostMinusRefund); + break; + case "constantinople": + // since storage was initially primed to 0 and we call triggerAllRefunds(), which then + // resets storage back to 0, 19800 gas is added to the refund counter per Constantinople EIP 1283 + transactionCostMinusRefund = + gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO; + assert.strictEqual(gasUsed, transactionCostMinusRefund); + break; + default: + throw new Error("Invalid hardfork option: " + provider.options.hardfork); + } + + const receipt = await Promise.all(hashes.map((hash) => web3.eth.getTransactionReceipt(hash))); + assert.deepStrictEqual(receipt[0].gasUsed, receipt[1].gasUsed, "Tx1 and Tx2 should cost the same gas."); + assert.deepStrictEqual( + receipt[1].gasUsed, + receipt[2].gasUsed, + "Tx2 and Tx3 should cost the same gas. -> Tx1 gas === Tx3 gas Transitive" + ); + assert.deepStrictEqual( + receipt[1].transactionIndex > receipt[2].transactionIndex, + true, + "(Tx3 has a lower nonce) -> (Tx3 index is < Tx2 index)" + ); + const currentBlock = await web3.eth.getBlock(receipt[0].blockNumber); + + // ( Tx3 has a lower nonce -> Tx3 index is < Tx2 index ) -> cumulative gas Tx2 > Tx3 > Tx1 + const isAccumulating = + receipt[1].cumulativeGasUsed > receipt[2].cumulativeGasUsed && + receipt[2].cumulativeGasUsed > receipt[0].cumulativeGasUsed; + + assert.deepStrictEqual( + isAccumulating, + true, + "Cumulative gas should be accumulating for any transactions in the same block." + ); + + assert.deepStrictEqual( + receipt[0].gasUsed, + receipt[0].cumulativeGasUsed, + "Gas and cumulative gas should be equal for the FIRST Tx." + ); + + assert.notDeepStrictEqual( + receipt[1].gasUsed, + receipt[1].cumulativeGasUsed, + "Gas and cumulative gas should NOT be equal for the Second Tx." + ); + + assert.notDeepStrictEqual( + receipt[2].gasUsed, + receipt[2].cumulativeGasUsed, + "Gas and cumulative gas should NOT be equal for the Third Tx." + ); + + const totalGas = receipt[0].gasUsed + receipt[1].gasUsed + receipt[2].gasUsed; + assert.deepStrictEqual( + totalGas + transactionCostMinusRefund, + receipt[1].cumulativeGasUsed, + "Total Gas should equal the final tx.cumulativeGas" + ); + + assert.deepStrictEqual( + totalGas + transactionCostMinusRefund, + currentBlock.gasUsed, + "Total Gas should be equal to the currentBlock.gasUsed" + ); + }); + + it("clears mapping storage slots", async function() { + const { accounts, instance } = context; + const from = accounts[0]; + const options = { from }; + + await instance.methods.reset().send({ from, gas: 5000000 }); + + const uintsa = await instance.methods.uints(1).call(); + assert.strictEqual(uintsa, "0", "initial value is not correct"); + + const receipta = await instance.methods.store(1).send(options); + assert.strictEqual(receipta.status, true, "storing value did not work"); + + const uintsb = await instance.methods.uints(1).call(); + assert.strictEqual(uintsb, "1", "set value is incorrect"); + + const receiptb = await instance.methods.clear().send(options); + assert.strictEqual(receiptb.status, true, "clearing value did not work"); + + const uintsc = await instance.methods.uints(1).call(); + assert.strictEqual(uintsc, "0", "cleared value is not correct"); + }); + }).timeout(4000); + + describe("Estimation", function() { + it("matches estimate for deployment", async function() { + const { accounts, bytecode, contract, receipt } = context; + const gasEstimate = await contract.deploy({ data: bytecode }).estimateGas({ + from: accounts[1] + }); + + assert.deepStrictEqual(receipt.gasUsed, gasEstimate); + assert.deepStrictEqual(receipt.cumulativeGasUsed, gasEstimate); + }).timeout(4000); + + it("matches usage for complex function call (add)", async function() { + const { accounts, instance } = context; + await testTransactionEstimate( + instance.methods.add, + [toBytesHexString("Tim"), toBytesHexString("A great guy"), 10], + { from: accounts[0], gas: 3141592 }, + instance + ); + }).timeout(10000); + + it("matches usage for complex function call (transfer)", async function() { + const { accounts, instance } = context; + await testTransactionEstimate( + instance.methods.transfer, + ["0x0123456789012345678901234567890123456789", 5, toBytesHexString("Tim")], + { from: accounts[0], gas: 3141592 }, + instance + ); + }).timeout(10000); + + it("matches usage for simple account to account transfer", async function() { + const { accounts, web3 } = context; + const transferAmount = web3.utils.toBN(web3.utils.toWei("5", "finney")); + const transactionData = { + from: accounts[0], + to: accounts[1], + value: transferAmount + }; + + const web3Transactions = [ + await web3.eth.estimateGas(transactionData), + await web3.eth.sendTransaction(transactionData) + ]; + const [gasEstimate, receipt] = await Promise.all(web3Transactions); + + assert.strictEqual(receipt.gasUsed, gasEstimate); + }); + }); + + describe("Expenditure", function() { + it("should calculate gas expenses correctly in consideration of the default gasPrice", async function() { + const { accounts, web3 } = context; + const transferAmount = "500"; + const gasPrice = await web3.eth.getGasPrice(); + await confirmGasPrice(gasPrice, false, web3, accounts, transferAmount); + }); + + it("should calculate gas expenses correctly in consideration of the requested gasPrice", async function() { + const transferAmount = "500"; + const gasPrice = "0x10000"; + const { accounts, web3 } = context; + await confirmGasPrice(gasPrice, true, web3, accounts, transferAmount); + }); + + it("should calculate gas expenses correctly with a user-defined default gasPrice", async function() { + const transferAmount = "500"; + const gasPrice = "0x2000"; + const options = { seed, gasPrice }; + const { accounts, web3 } = await initializeTestProvider(options); + await confirmGasPrice(gasPrice, false, web3, accounts, transferAmount); + }); + + it("should calculate cumalativeGas and gasUsed correctly for many transactions in a block", async function() { + const options = { + blockTime: 0.5, // seconds + seed + }; + const { send, accounts, web3 } = await initializeTestProvider(options); + await send("miner_stop"); + + const transactions = [ + { + value: "0x10000000", + gasLimit: "0x33450", + from: accounts[0], + to: accounts[1], + nonce: "0x0" + }, + { + value: "0x10000000", + gasLimit: "0x33450", + from: accounts[0], + to: accounts[1], + nonce: "0x1" + }, + { + value: "0x10000000", + gasLimit: "0x33450", + from: accounts[1], // < + to: accounts[0], // <^ reversed tx order + nonce: "0x0" + } + ]; + + // Precondition + const initialBlockNumber = await web3.eth.getBlockNumber(); + assert.deepStrictEqual(initialBlockNumber, 0, "Current Block Should be 0"); + + const hashes = await Promise.all( + transactions.map((transaction) => { + const promiEvent = web3.eth.sendTransaction(transaction); + + return new Promise((resolve) => { + promiEvent.once("transactionHash", async(hash) => { + // Ensure there's no receipt since the transaction hasn't yet been processed. Ensure IntervalMining + const receipt = await web3.eth.getTransactionReceipt(hash); + assert.strictEqual(receipt, null, "No receipt since the transaction hasn't yet been processed."); + + resolve(hash); + }); + }); + }) + ); + + await send("evm_mine"); + + const currentBlockNumber = await web3.eth.getBlockNumber(); + assert.deepStrictEqual(currentBlockNumber, 1, "Current Block Should be 1"); + + const [currentBlock, receipt] = await Promise.all([ + web3.eth.getBlock(currentBlockNumber), + Promise.all(hashes.map((hash) => web3.eth.getTransactionReceipt(hash))) + ]); + + assert.deepStrictEqual(receipt[0].gasUsed, receipt[1].gasUsed, "Tx1 and Tx2 should cost the same gas."); + assert.deepStrictEqual( + receipt[1].gasUsed, + receipt[2].gasUsed, + "Tx2 and Tx3 should cost the same gas. -> Tx1 gas === Tx3 gas Transitive" + ); + assert.deepStrictEqual( + receipt[1].transactionIndex > receipt[2].transactionIndex, + true, + "(Tx3 has a lower nonce) -> (Tx3 index is < Tx2 index)" + ); + + // ( Tx3 has a lower nonce -> Tx3 index is < Tx2 index ) -> cumulative gas Tx2 > Tx3 > Tx1 + const isAccumulating = + receipt[1].cumulativeGasUsed > receipt[2].cumulativeGasUsed && + receipt[2].cumulativeGasUsed > receipt[0].cumulativeGasUsed; + assert.deepStrictEqual( + isAccumulating, + true, + "Cumulative gas should be accumulating for any transactions in the same block." + ); + assert.deepStrictEqual( + receipt[0].gasUsed, + receipt[0].cumulativeGasUsed, + "Gas and cumulative gas should be equal for the FIRST Tx." + ); + assert.notDeepStrictEqual( + receipt[1].gasUsed, + receipt[1].cumulativeGasUsed, + "Gas and cumulative gas should NOT be equal for the Second Tx." + ); + assert.notDeepStrictEqual( + receipt[2].gasUsed, + receipt[2].cumulativeGasUsed, + "Gas and cumulative gas should NOT be equal for the Third Tx." + ); + + const totalGas = receipt[0].gasUsed + receipt[1].gasUsed + receipt[2].gasUsed; + assert.deepStrictEqual( + totalGas, + receipt[1].cumulativeGasUsed, + "Total Gas should be equal the final tx.cumulativeGas" + ); + assert.deepStrictEqual( + totalGas, + currentBlock.gasUsed, + "Total Gas should be equal to the currentBlock.gasUsed" + ); + }).timeout(4000); + }); + }); + }); +}); \ No newline at end of file diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 92511d0806..c022f35b96 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -20,6 +20,7 @@ import Common from "ethereumjs-common"; import BlockLogs from "./things/blocklogs"; import EthereumAccount from "ethereumjs-account"; import { Block } from "./components/block-manager"; +import GasEstimator from "./things/gas-estimator"; import CodedError, { ErrorCodes } from "./things/coded-error"; //#endregion @@ -502,9 +503,23 @@ export default class EthereumApi implements types.Api { * * @returns the amount of gas used. */ - async eth_estimateGas() { - // TODO: do this for real - return Quantity.from(6721975); + async eth_estimateGas(transaction: any, blockNumber: Buffer | Tag | string = Tag.LATEST): Promise { + const blockchain = this.#blockchain; + const options = this.#options; + if (transaction.gasLimit) { + transaction.gas = transaction.gasLimit; + } else { + if (transaction.gas) { + transaction.gasLimit = transaction.gas; + } else { + // eth_estimateGas isn't subject to regular transaction gas limits + transaction.gas = transaction.gasLimit = options.callGasLimit.toString(); + } + } + const tx = Transaction.fromJSON(transaction, null, Transaction.types.none); + // const result = await GasEstimator.binSearch(blockchain, tx, blockNumber); + // return result; + return GasEstimator.binSearch(blockchain, tx, blockNumber); } /** @@ -1370,15 +1385,15 @@ export default class EthereumApi implements types.Api { const parentHeader = parentBlock.value.header; const options = this.#options; - if (!transaction.gasLimit) { - if (!transaction.gas) { - // eth_call isn't subject to regular transaction gas limits - transaction.gasLimit = transaction.gas = options.callGasLimit.toString(); - } else { + if (transaction.gasLimit) { + transaction.gas = transaction.gasLimit; + } else { + if (transaction.gas) { transaction.gasLimit = transaction.gas; + } else { + // eth_estimateGas isn't subject to regular transaction gas limits + transaction.gas = transaction.gasLimit = options.callGasLimit.toString(); } - } else { - transaction.gas = transaction.gasLimit; } const newBlock = blocks.createBlock({ @@ -1389,7 +1404,8 @@ export default class EthereumApi implements types.Api { // gas estimates and eth_calls aren't subject to regular block gas limits gasLimit: transaction.gas }); - return blockchain.simulateTransaction(transaction, parentBlock, newBlock); + const result = await blockchain.simulateTransaction(transaction, parentBlock, newBlock); + return Data.from(result.execResult.returnValue || "0x"); } //#endregion diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 6905f0ca09..500db56c18 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -553,6 +553,23 @@ export default class Blockchain extends Emittery.Typed new BN(val); +const STIPEND = bn(2300); + +const check = (set) => (opname) => set.has(opname); +const isCall = check(new Set(["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"])); +const isCallOrCallcode = check(new Set(["CALL", "CALLCODE"])); +const isCreate = check(new Set(["CREATE", "CREATE2"])); +const isTerminator = check(new Set(["STOP", "RETURN", "REVERT", "INVALID", "SELFDESTRUCT"])); + +export default class GasEstimator { + static async getParentAndNewBlock( + blockchain: Blockchain, + transaction: Transaction, + blockNumber: Buffer | Tag | string = Tag.LATEST + ){ + const blocks = blockchain.blocks; + const parentBlock = await blocks.get(blockNumber); + const parentHeader = parentBlock.value.header; + + const newBlock = blocks.createBlock({ + number: parentHeader.number, + timestamp: parentHeader.timestamp, + parentHash: parentHeader.parentHash, + gasLimit: transaction.gasLimit + }); + return {parentBlock, newBlock}; + } + + static async binSearch( + blockchain: Blockchain, + transaction: Transaction, + blockNumber: Buffer | Tag | string = Tag.LATEST + ): Promise { + const isEnoughGas = async(gas) => { + transaction.gasLimit = gas.toBuffer(); + const {newBlock, parentBlock} = await GasEstimator.getParentAndNewBlock(blockchain, transaction, blockNumber); + const result = await blockchain.simulateTransaction2(transaction, parentBlock, newBlock); + // return !result.vmerr && !result.execResult.exceptionError; + return !result.execResult.exceptionError; + }; + const {newBlock, parentBlock} = await GasEstimator.getParentAndNewBlock(blockchain, transaction, blockNumber); + const result = await blockchain.simulateTransaction2(transaction, parentBlock, newBlock); + // const result = JSON.parse((await blockchain.simulateTransaction2(transaction, parentBlock, test)).toString()); + // return blockchain.simulateTransaction(transaction, parentBlock, newBlock); + + const MAX = new BN(blockchain.blocks.latest.value.header.gasLimit); + // const MAX = Quantity.from(blockchain.blocks.latest.value.header.gasLimit).toBigInt(); + // const MAX = hexToBn(runArgs.block.header.gasLimit); + const gasRefund = result.execResult.gasRefund; + let gasEstimate = result.gasUsed; + const startingGas = gasRefund ? gasEstimate.add(gasRefund) : gasEstimate; + const range = { lo: startingGas, hi: startingGas }; + + if (!(await isEnoughGas(range.hi))) { + do { + range.hi = range.hi.muln(MULTIPLE); + } while (!(await isEnoughGas(range.hi))); + while (range.lo.addn(1).lt(range.hi)) { + const mid = range.lo.add(range.hi).divn(2); + if (await isEnoughGas(mid)) { + range.hi = mid; + } else { + range.lo = mid; + } + } + if (range.hi.gte(MAX)) { + if (!(await isEnoughGas(range.hi))) { + throw new Error("gas required exceeds allowance or always failing transaction"); + + // return Data.from("gas required exceeds allowance or always failing transaction"); + } + } + } + + gasEstimate = range.hi; + return Quantity.from(`0x${gasEstimate.toString('hex')}`); + } + + async guestimation( + blockchain: Blockchain, + transaction: Transaction, + blockNumber: Buffer | Tag | string = Tag.LATEST + ){ + const steps = stepTracker(); + + const Context = (index, fee?) => { + const base = index === 0; + let start = index; + let stop = 0; + const cost = bn(); + let sixtyFloorths = bn(); + const op = steps.ops[index]; + const next = steps.ops[index + 1]; + const intermediateCost = op.gasLeft.sub(next.gasLeft); + const callingFee = fee || bn(); + let compositeContext = false; + + function addGas(val) { + // Add to our current context, but accounted for in sixtyfloorths + if (sixtyFloorths.gtn(0)) { + if (val.gte(sixtyFloorths)) { + sixtyFloorths = bn(); + } else { + sixtyFloorths.isub(val); + } + } + cost.iadd(val); + } + + return { + start: () => start, + stop: () => stop, + setStart: (val) => { + start = val; + compositeContext = true; + }, + setStop: (val) => { + stop = val; + }, + getCost: () => ({ cost, sixtyFloorths }), + transfer: (ctx) => { + const values = ctx.getCost(); + addGas(values.cost); + sixtyFloorths.iadd(values.sixtyFloorths); + }, + addSixtyFloorth: (sixtyFloorth) => { + sixtyFloorths.iadd(sixtyFloorth); + }, + addRange: (fee = bn()) => { + // only occurs on stack increasing ops + addGas(steps.ops[base || compositeContext ? start : start + 1].gasLeft.sub(steps.ops[stop].gasLeft).add(fee)); + }, + finalizeRange: () => { + let range; + // if we have a composite context and we are NOT at the final terminator + if (compositeContext && stop !== steps.ops.length - 1) { + range = steps.ops[start].gasLeft.sub(steps.ops[stop - 1].gasLeft); + addGas(range); + const tail = steps.ops[stop - 1].gasLeft.sub(steps.ops[stop].gasLeft); + range = tail.add(intermediateCost); + } else { + range = steps.ops[start].gasLeft.sub(steps.ops[stop].gasLeft); + } + range.isub(callingFee); + addGas(range); + if (isCallOrCallcode(op.opcode.name) && !op.stack[op.stack.length - 3].isZero()) { + cost.iadd(sixtyFloorths); + const innerCost = next.gasLeft.sub(steps.ops[stop - 1].gasLeft); + if (innerCost.gt(STIPEND)) { + sixtyFloorths = cost.divn(63); + } else if (innerCost.lte(STIPEND)) { + sixtyFloorths = STIPEND.sub(innerCost); + } + } else if (stop !== steps.ops.length - 1) { + cost.iadd(sixtyFloorths); + sixtyFloorths = cost.divn(63); + } + } + }; + }; + + const getTotal = () => { + const sysops = steps.systemOps; + const ops = steps.ops; + const opIndex = (cursor) => sysops[cursor].index; + const stack = []; + let cursor = 0; + let context = Context(0); + while (cursor < sysops.length) { + const currentIndex = opIndex(cursor); + const current = ops[currentIndex]; + const name = current.opcode.name; + if (isCall(name) || isCreate(name)) { + if (steps.isPrecompile(currentIndex)) { + context.setStop(currentIndex + 1); + context.addRange(); + context.setStart(currentIndex + 1); + context.addSixtyFloorth(STIPEND); + } else { + context.setStop(currentIndex); + context.addRange(bn(current.opcode.fee)); + stack.push(context); + context = Context(currentIndex, bn(current.opcode.fee)); // setup next context + } + } else if (isTerminator(name)) { + // only on the last operation + context.setStop(currentIndex + 1 < steps.ops.length ? currentIndex + 1 : currentIndex); + context.finalizeRange(); + const ctx = stack.pop(); + if (ctx) { + ctx.transfer(context); + context = ctx; + context.setStart(currentIndex + 1); + } else { + break; + } + } else { + throw new Error("INVALID OPCODE"); + } + cursor++; + } + const gas = context.getCost(); + return gas.cost.add(gas.sixtyFloorths); + }; + + const {newBlock, parentBlock} = await GasEstimator.getParentAndNewBlock(blockchain, transaction, blockNumber); + // const result = await vm.runTx(runArgs).catch((vmerr) => ({ vmerr })); + const result = await blockchain.simulateTransaction2(transaction, parentBlock, newBlock); + let estimate; + if (result.execResult.exceptionError) { + throw new Error("test"); + // return RuntimeError.fromResults([runArgs.tx], { results: [result] }); + } else if (steps.done()) { + estimate = result.gasUsed; + } else { + const actualUsed = steps.ops[0].gasLeft.sub(steps.ops[steps.ops.length - 1].gasLeft); + const sixtyFloorths = getTotal().sub(actualUsed); + estimate = result.gasUsed.add(sixtyFloorths); + } + return result; + } +} + +const stepTracker = () => { + const sysOps = []; + const allOps = []; + const preCompile = new Set(); + let preCompileCheck = false; + let precompileCallDepth = 0; + return { + collect: (info) => { + if (preCompileCheck) { + if (info.depth === precompileCallDepth) { + // If the current depth is unchanged. + // we record its position. + preCompile.add(allOps.length - 1); + } + // Reset the flag immediately here + preCompileCheck = false; + } + if (isCall(info.opcode.name)) { + info.stack = info.stack.map((val) => val.clone()); + preCompileCheck = true; + precompileCallDepth = info.depth; + sysOps.push({ index: allOps.length, depth: info.depth, name: info.opcode.name }); + } else if (isCreate(info.opcode.name) || isTerminator(info.opcode.name)) { + sysOps.push({ index: allOps.length, depth: info.depth, name: info.opcode.name }); + } + // This goes last so we can use the length for the index ^ + allOps.push(info); + }, + isPrecompile: (index) => preCompile.has(index), + done: () => !allOps.length || sysOps.length < 2 || !isTerminator(allOps[allOps.length - 1].opcode.name), + ops: allOps, + systemOps: sysOps + }; +}; diff --git a/src/packages/core/__tests__/gas.ts b/src/packages/core/__tests__/gas.ts new file mode 100644 index 0000000000..81d8891d7e --- /dev/null +++ b/src/packages/core/__tests__/gas.ts @@ -0,0 +1,24 @@ +import Ganache from "../src"; +import * as assert from "assert"; +import EthereumProvider from "@ganache/ethereum/src/provider"; + +describe("gas", () => { + let ganache: EthereumProvider; + + before(() => { + ganache = Ganache.provider() as EthereumProvider; + }) + + it.only("works", async () => { + const accounts = await ganache.send("eth_accounts"); + const response = await ganache.send("eth_estimateGas", [ + { + from: accounts[0], + to: accounts[1], + value: 100000 + } + ]); + console.log(response); + + }); +}); From 9c07ea340a4eebf72ac0a8164541d77593868ff8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 27 Aug 2020 19:21:06 -0400 Subject: [PATCH 486/691] remove broken estimate gas stuff/tests --- .../ethereum/__tests__/api/eth/eth.test.ts | 28 - .../ethereum/__tests__/api/eth/gas.test.ts | 961 ------------------ src/chains/ethereum/src/api.ts | 3 +- .../ethereum/src/things/gas-estimator.ts | 2 +- src/packages/core/__tests__/gas.ts | 24 - 5 files changed, 2 insertions(+), 1016 deletions(-) delete mode 100644 src/chains/ethereum/__tests__/api/eth/gas.test.ts delete mode 100644 src/packages/core/__tests__/gas.ts diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index b1c970cabe..5976053233 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -57,34 +57,6 @@ describe("api", () => { assert.deepStrictEqual(result, []); }); }); - - - describe("eth_estimateGas", () => { - it.only("EOA to EOA", async () => { - const estimate = await provider.send("eth_estimateGas", [ - { - from: accounts[0], - to: accounts[1], - value: "0xffffff" - } - ]); - console.log(estimate); - assert(estimate); - // await provider.send("eth_sendTransaction", [ - // { - // from: accounts[0], - // to: accounts[1], - // value: 1 - // } - // ]); - // const _message = await provider.once("message"); - // const blocks = await Promise.all([ - // provider.send("eth_getBlockByNumber", ["0x1", true]), - // provider.send("eth_getBlockByNumber", ["0x1"]) - // ]); - // assert(blocks[0].hash, blocks[1].hash); - }); - }); describe("eth_submitWork", () => { it("should get compilers list", async () => { diff --git a/src/chains/ethereum/__tests__/api/eth/gas.test.ts b/src/chains/ethereum/__tests__/api/eth/gas.test.ts deleted file mode 100644 index 96673a8ab9..0000000000 --- a/src/chains/ethereum/__tests__/api/eth/gas.test.ts +++ /dev/null @@ -1,961 +0,0 @@ -import memdown from "memdown"; -import assert from "assert"; -import EthereumProvider from "../../../src/provider"; -import getProvider from "../../helpers/getProvider"; -import { BN } from "ethereumjs-util" - -const SEED_RANGE = 1000000; -const RSCLEAR_REFUND = 15000; -const RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO_ISTANBUL = 19200; -const RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO = 19800; -const RSELFDESTRUCT_REFUND = 24000; -const HARDFORKS = ["byzantium", "constantinople", "petersburg", "istanbul", "muirGlacier"]; - -function hex(length: number) { - return `0x${Buffer.allocUnsafe(length).fill(0).toString("hex")}`; -} - - -/** - * Generates a random integer - * @param {Number} max Maximum integer to randomly generate - * @returns {Number} Returns a random integer between 0 and `max` - */ -const randomInteger = (max) => { - return Math.floor(Math.random() * (max + 1)); -}; - -describe("Gas", function() { - let provider: EthereumProvider; - let accounts: string[]; - - beforeEach(async () => { - provider = await getProvider(); - accounts = await provider.send("eth_accounts"); - }); - - HARDFORKS.forEach((hardfork) => { - describe(`Hardfork: ${hardfork.toUpperCase()}`, function() { - let context; - const seed = randomInteger(SEED_RANGE); - - before("Setting up web3 and contract", async function() { - this.timeout(10000); - - const contractRef = { - contractFiles: ["EstimateGas"], - contractSubdirectory: "gas" - }; - - const ganacheProviderOptions = { - seed, - hardfork - }; - - context = await bootstrap(contractRef, ganacheProviderOptions, hardfork); - }); - - describe("EIP150 Gas Estimation: ", function() { - const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); - let ContractFactory; - let TestDepth; - let Donation; - let Fib; - let SendContract; - let Create2; - let NonZero; - before("Setting up EIP150 contracts", async function() { - this.timeout(10000); - - const subDirectory = { contractSubdirectory: "gas" }; - const create2 = Object.assign({ contractFiles: ["CreateTwo", "GasLeft"] }, subDirectory); - const factory = Object.assign({ contractFiles: ["ContractFactory"] }, subDirectory); - const testDepth = Object.assign({ contractFiles: ["TestDepth"] }, subDirectory); - const donation = Object.assign({ contractFiles: ["Donation"] }, subDirectory); - const fib = Object.assign({ contractFiles: ["Fib"] }, subDirectory); - const sendContract = Object.assign({ contractFiles: ["SendContract"] }, subDirectory); - const nonZero = Object.assign({ contractFiles: ["NonZero"] }, subDirectory); - - const ganacheProviderOptions = { - seed, - hardfork - }; - - ContractFactory = await bootstrap(factory, ganacheProviderOptions, hardfork); - // memdown makes the test that uses TestDepth about 20% faster, so we use it here because CI makes us sad. - TestDepth = await bootstrap(testDepth, Object.assign({ db: memdown() }, ganacheProviderOptions), hardfork); - Donation = await bootstrap(donation, ganacheProviderOptions, hardfork); - Fib = await bootstrap(fib, ganacheProviderOptions, hardfork); - NonZero = await bootstrap(nonZero, ganacheProviderOptions, hardfork); - SendContract = await bootstrap( - sendContract, - Object.assign( - { - accounts: [ - { - secretKey: "0x" + privateKey.toString("hex"), - balance: "0x" + new BN("1000000000000000000000").toString("hex") - } - ] - }, - ganacheProviderOptions - ), - hardfork - ); - if (hardfork !== "byzantium") { - Create2 = await bootstrap(create2, ganacheProviderOptions, hardfork); - } - }); - - it("Should not timeout when running a long test", async() => { - try { - await context.instance.methods.runsOutOfGas().send({ from: context.accounts[0] }); - assert.fail(); - } catch (e) { - assert(e.message.includes("out of gas")); - } - }).timeout(5000); - - it("Should estimate gas perfectly with EIP150 - recursive CALL", async() => { - const { accounts, instance, send } = Fib; - const txParams = { - from: accounts[0], - to: instance._address, - value: 10 - }; - const { result: estimateHex } = await send("eth_estimateGas", txParams); - const estimate = parseInt(estimateHex); - const tx = Object.assign({ gas: `0x${(estimate - 1).toString(16)}` }, txParams); - await assert.rejects( - () => send("eth_sendTransaction", tx), - { - message: "VM Exception while processing transaction: out of gas" - }, - `SANITY CHECK: Gas estimate: ${estimate - 1} is too high.` - ); - tx.gas = estimateHex; - await assert.doesNotReject( - () => send("eth_sendTransaction", tx), - undefined, - `SANITY CHECK. Still not enough gas? ${estimate} Our estimate is still too low` - ); - }); - - it("Should estimate gas perfectly with EIP150 - CREATE", async() => { - const { accounts, instance, send } = ContractFactory; - const txParams = { - from: accounts[0], - to: instance._address, - data: instance.methods.createInstance().encodeABI() - }; - const { result: estimateHex } = await send("eth_estimateGas", txParams); - const estimate = new BN(estimateHex.substring(2), "hex"); - txParams.gas = "0x" + estimate.subn(1).toString("hex"); - await assert.rejects(() => send("eth_sendTransaction", txParams), { - message: "VM Exception while processing transaction: revert" - }); - - txParams.gas = estimateHex; - await assert.doesNotReject( - () => send("eth_sendTransaction", txParams), - undefined, - `SANITY CHECK. Still not enough gas? ${estimate} Our estimate is still too low` - ); - }); - - it("Should estimate gas perfectly with EIP150 - CALL INSIDE CREATE", async() => { - const { accounts, instance } = Donation; - // Pre-condition - const address = accounts[0]; - const donateTx = { from: address, value: 50 }; - donateTx.gas = await instance.methods.donate().estimateGas(donateTx); - await instance.methods.donate().send(donateTx); - const tx = { from: address }; - const est = await instance.methods.moveFund(address, 5).estimateGas(tx); - tx.gas = est - 1; - await assert.rejects(() => instance.methods.moveFund(address, 5).send(tx), { - message: "VM Exception while processing transaction: out of gas" - }); - tx.gas = est; - await assert.doesNotReject( - () => instance.methods.moveFund(address, 5).send(tx), - undefined, - `SANITY CHECK. Still not enough gas? ${est} Our estimate is still too low` - ); - }).timeout(1000000); - - if (hardfork !== "byzantium") { - it("Should estimate gas perfectly with EIP150 - DELEGATECALL", async() => { - const { accounts, instance } = TestDepth; - const depth = 3; - const promises = Array(depth) - .fill(0) - .map((_, i) => { - const depth = i + 1; - return instance.methods - .depth(depth) - .estimateGas() - .then(async(est) => { - return Promise.all([ - assert.doesNotReject( - instance.methods.depth(depth).send({ - from: accounts[5], - gas: est - }), - undefined, - `SANITY CHECK. Still not enough gas? ${est} Our estimate is still too low` - ), - assert.rejects( - instance.methods.depth(depth).send({ - from: accounts[5], - gas: est - 1 - }), - { - name: "RuntimeError" - } - ) - ]); - }); - }); - await Promise.all(promises); - }).timeout(3000); - - it("Should estimate gas perfectly with EIP150 - CREATE2", async() => { - const { accounts, instance, web3 } = Create2; - const { result: newContract } = compile("./test/contracts/gas/", "GasLeft"); - const bytecode = newContract.contracts["GasLeft.sol"].GasLeft.evm.bytecode.object; - const byteCode = `0x${bytecode}${web3.eth.abi.encodeParameter("address", accounts[0]).slice(2)}`; - const salt = `0x${"0".repeat(63)}1`; - const futureAddress = `0x${web3.utils - .sha3( - `0x${["ff", instance._address, salt, web3.utils.sha3(byteCode)] - .map((val) => val.replace(/0x/, "")) - .join("")}` - ) - .slice(-40)}`.toLowerCase(); - const codeCheck = await web3.eth.getCode(futureAddress); - assert(codeCheck.slice(2).length === 0, "contract should not be deployed on chain!"); - - const nonce = await web3.eth.getTransactionCount(accounts[0]); - const result = await instance.methods.deploy(byteCode, salt).send({ - from: accounts[0], - gas: 4500000, - gasPrice: 10000000000, - nonce - }); - - const addr = result.events.RelayAddress.returnValues.addr; - assert(addr, futureAddress, "future contract address not the same as computed value"); - const codeCheck2 = await web3.eth.getCode(futureAddress); - assert(codeCheck2.slice(2).length > 0, "contract should be deployed on chain!"); - }).timeout(1000000); - - // TODO: Make this actually test SVT - it("Should estimate gas perfectly with EIP150 - Simple Value Transfer", async() => { - const { accounts, instance, send, web3 } = SendContract; - const toBN = (hex) => new BN(hex.substring(2), "hex"); - const toBNStr = (hex, base = 10) => toBN(hex).toString(base); - const sign = createSignedTx(privateKey); - const gasPrice = "0x77359400"; - const amountToTransfer = "0xfffffff1ff000000"; - - // Get initial Balance after contract deploy - const { result: balance } = await send("eth_getBalance", accounts[0]); - - // Initial seeding of capital to contract, we check the balance after. - const tx = { - gasPrice, - value: amountToTransfer, // ~18 ether - from: accounts[0], - to: instance._address - }; - ({ result: tx.gasLimit } = await send("eth_estimateGas", tx)); - const { result: hash } = await send("eth_sendTransaction", tx); - const { - result: { gasUsed: initialGasUsed } - } = await send("eth_getTransactionReceipt", hash); - - // Assert that the contract has the correct balance ~18 ether - const getBalance = await instance.methods.getBalance().call({ from: accounts[0] }); - assert.strictEqual(toBNStr(amountToTransfer), getBalance, "balance is not ~18 ether"); - - // It's not neccessary to sign but currently it's the only test that demonstrates sending signed - // transactions that call a contract method. - // Calling `encodeABI()` on the desired contract method will return the - // the necessary bytecode to call the contract method with the given parameters - // NOTE: errors from encodeABI are likely do to incorrect types for the method arguments - // Double check the contracts method signature and your arguments - // Ex: transfer(Address[], uint)) => transfer(Array, hex string of int) - const txParams = { - gasPrice, - nonce: "0x2", - to: instance._address, - value: "0x0", - data: instance.methods.transfer(accounts, amountToTransfer).encodeABI() - }; - ({ result: txParams.gasLimit } = await send("eth_estimateGas", sign(txParams).serialize())); - const { gasUsed: signedGasUsed } = await web3.eth.sendSignedTransaction(sign(txParams).serialize()); - const { result: newBalance } = await send("eth_getBalance", accounts[0]); - // Gasprice * ( sum of gas used ) - const gas = toBN(gasPrice).mul(toBN(initialGasUsed).addn(signedGasUsed)); - // Our current balance, plus the wei spent on gas === original gas - const currentBalancePlusGas = toBN(newBalance) - .add(gas) - .toString(); - assert.strictEqual(toBNStr(balance), currentBalancePlusGas, "balance + gas used !== to start balance"); - - // Assert that signed tx successfully drains contract to address - const newContractBalance = await instance.methods.getBalance().call({ from: accounts[0] }); - assert.strictEqual(newContractBalance, "0", "balance is not 0"); - }).timeout(10000); - } - - it("should correctly handle non-zero value child messages", async() => { - const { - accounts: [from], - instance: { _address: to, methods }, - send - } = NonZero; - const fns = [methods.doSend, methods.doTransfer, methods.doCall]; - for (let i = 0, l = fns; i < l.length; i++) { - const tx = { - from, - to, - value: "1000000000000000000", - data: fns[i]().encodeABI() - }; - const { result: gasLimit } = await send("eth_estimateGas", tx); - tx.gasLimit = "0x" + (parseInt(gasLimit) - 1).toString(16); - await assert.rejects(() => send("eth_sendTransaction", tx), { - message: "VM Exception while processing transaction: out of gas" - }); - tx.gasLimit = gasLimit; - await assert.doesNotReject( - () => send("eth_sendTransaction", tx), - undefined, - `SANITY CHECK. Still not enough gas? ${gasLimit} Our estimate is still too low` - ); - } - }); - }); - - describe("Refunds", function() { - it( - "accounts for Rsclear Refund in gasEstimate when a dirty storage slot is reset and it's original " + - "value is 0", - async function() { - const { accounts, instance, provider } = context; - const from = accounts[0]; - const options = { from, gas: 5000000 }; - - // prime storage by making sure it is set to 0 - await instance.methods.reset().send(options); - - // update storage and then reset it back to 0 - const method = instance.methods.triggerRsclearRefund(); - - const estimate = await method.estimateGas(options); - - const receipt = await method.send({ from, gas: estimate }); - - switch (provider.options.hardfork) { - case "byzantium": - case "petersburg": - assert.strictEqual(receipt.gasUsed, estimate - RSCLEAR_REFUND); - break; - case "muirGlacier": - case "istanbul": - // EIP-2200 - assert(receipt.gasUsed <= estimate - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO_ISTANBUL + 2300); - break; - case "constantinople": - // since storage was initially primed to 0 and we call triggerRsclearRefund(), which then - // resets storage back to 0, 19800 gas is added to the refund counter per Constantinople EIP 1283 - assert.strictEqual(receipt.gasUsed, estimate - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO); - break; - default: - throw new Error("Invalid hardfork option: " + provider.options.hardfork); - } - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - } - ); - - it( - "accounts for Rsclear Refund in gasEstimate when a dirty storage slot is reset and it's " + - "original value is not 0", - async function() { - const { accounts, instance, provider } = context; - const from = accounts[0]; - const rsclearRefundForResettingDirtySlotToNonZeroValue = 4800; - const rsclearRefundForResettingDirtySlotToNonZeroValueIstanbul = 4200; - const options = { from, gas: 5000000 }; - - await instance.methods.reset().send(options); // prime storage by making sure y is set to 1 - - // update storage and then reset it back to 1 - const method = instance.methods.triggerRsclearRefundForY(); - - const gasEstimate = await method.estimateGas(options); - - const receipt = await method.send({ from, gas: gasEstimate }); - - switch (provider.options.hardfork) { - case "byzantium": - case "petersburg": - // since we are resetting to a non-zero value, there is no gas added to the refund counter here - assert.strictEqual(receipt.gasUsed, gasEstimate); - break; - case "muirGlacier": - case "istanbul": // EIP-2200 - assert( - receipt.gasUsed <= gasEstimate - rsclearRefundForResettingDirtySlotToNonZeroValueIstanbul + 2300 - ); - break; - case "constantinople": - // since storage was initially primed to 1 and we call triggerRsclearRefundForY(), which then - // resets storage back to 1, 4800 gas is added to the refund counter per Constantinople EIP 1283 - assert.strictEqual(receipt.gasUsed, gasEstimate - rsclearRefundForResettingDirtySlotToNonZeroValue); - break; - default: - throw new Error("Invalid hardfork option: " + provider.options.hardfork); - } - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - } - ); - - it( - "accounts for Rsclear Refund in gasEstimate when a fresh storage slot's original " + - "value is not 0 and new value is 0", - async function() { - const { accounts, instance, provider } = context; - const from = accounts[0]; - const options = { from, gas: 5000000 }; - - // prime storage by making sure storage is set to 1 - await instance.methods.initialSettingOfX().send(options); - - // update storage to be 0 - const method = instance.methods.reset(); - - const gasEstimate = await method.estimateGas(options); - - const receipt = await method.send({ from, gas: gasEstimate }); - - switch (provider.options.hardfork) { - case "byzantium": - case "petersburg": - case "constantinople": - assert.strictEqual(receipt.gasUsed, gasEstimate - RSCLEAR_REFUND); - break; - case "muirGlacier": - case "istanbul": // EIP-2200 - assert(receipt.gasUsed <= gasEstimate - RSCLEAR_REFUND + 2300); - break; - default: - throw new Error("Invalid hardfork option: " + provider.options.hardfork); - } - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - } - ); - - it( - "accounts for Rsclear Refund in gasEstimate when a dirty storage slot's original value " + - "is not 0 and new value is 0", - async function() { - const { accounts, instance, provider } = context; - const from = accounts[0]; - const options = { from, gas: 5000000 }; - - // prime storage by making sure storage is set to 1 - await instance.methods.initialSettingOfX().send(options); - - // update storage and then reset it to 0 - const method = instance.methods.triggerRsclearRefund(); - - const gasEstimate = await method.estimateGas(options); - - const receipt = await method.send({ from, gas: gasEstimate }); - - switch (provider.options.hardfork) { - case "byzantium": - case "petersburg": - case "constantinople": - assert.strictEqual(receipt.gasUsed, gasEstimate - RSCLEAR_REFUND); - break; - case "muirGlacier": - case "istanbul": // EIP-2200 - assert(receipt.gasUsed <= gasEstimate - RSCLEAR_REFUND + 2300); - break; - default: - throw new Error("Invalid hardfork option: " + provider.options.hardfork); - } - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - } - ); - - it( - "accounts for Rsclear Refund in gasEstimate when a dirty storage slot's original value " + - "is not 0 and current value is 0", - async function() { - const { accounts, instance, provider } = context; - const from = accounts[0]; - const options = { from, gas: 5000000 }; - - // prime storage by making sure storage is set to 1 - await instance.methods.initialSettingOfX().send(options); - - // updates current value to 0 and new value to be the remaining amount of gas - const method = instance.methods.triggerRsclearRefundForX(); - - const gasEstimate = await method.estimateGas(options); - - const receipt = await method.send({ from, gas: gasEstimate }); - - switch (provider.options.hardfork) { - case "byzantium": - case "petersburg": - assert.strictEqual(receipt.gasUsed, gasEstimate - RSCLEAR_REFUND); - break; - case "muirGlacier": - case "istanbul": - assert(receipt.gasUsed <= gasEstimate + 2300); - break; - case "constantinople": - // since storage was initially primed to 1 and we call triggerRsclearRefundForX(), which then - // resets storage's current value to 0 and 15000 gas is added to the refund counter, and then - // it replaces x with gasleft, which removes 150000 gas from the refund counter per Constantinople - // EIP 1283 leaving us with a rsclear refund of 0 - assert.strictEqual(receipt.gasUsed, gasEstimate); - break; - default: - throw new Error("Invalid hardfork option: " + provider.options.hardfork); - } - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - } - ); - - it("accounts for Rselfdestruct Refund in gasEstimate", async function() { - const { abi, accounts, bytecode, web3 } = context; - const from = accounts[0]; - const options = { from, gas: 5000000 }; - - const deploymentOptions = { gas: 3141592 }; - const { instance } = await deploy(abi, bytecode, web3, deploymentOptions); - await instance.methods.reset().send(options); // prime storage by making sure it is set to 0 - - const method = instance.methods.triggerRselfdestructRefund(); - - const gasEstimate = await method.estimateGas(options); - - const receipt = await method.send({ from, gas: gasEstimate }); - - assert.strictEqual(receipt.gasUsed, gasEstimate - RSELFDESTRUCT_REFUND); - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - }); - - it("accounts for Rsclear and Rselfdestruct Refunds in gasEstimate", async function() { - const { abi, accounts, bytecode, provider, web3 } = context; - const from = accounts[0]; - - const deploymentOptions = { gas: 3141592 }; - const { instance } = await deploy(abi, bytecode, web3, deploymentOptions); - await instance.methods.reset().send({ from, gas: 5000000 }); // prime storage by making sure it is set to 0 - - const method = instance.methods.triggerAllRefunds(); - - const gasEstimate = await method.estimateGas({ from }); - - const receipt = await method.send({ from, gas: gasEstimate }); - - switch (provider.options.hardfork) { - case "byzantium": - case "petersburg": - assert.strictEqual(receipt.gasUsed, gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND); - break; - case "muirGlacier": - case "istanbul": // EIP-2200 - assert.strictEqual( - receipt.gasUsed, - gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO_ISTANBUL - ); - break; - case "constantinople": - // since storage was initially primed to 0 and we call triggerAllRefunds(), which then - // resets storage back to 0, 19800 gas is added to the refund counter per Constantinople EIP 1283 - assert.strictEqual( - receipt.gasUsed, - gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO - ); - break; - default: - throw new Error("Invalid hardfork option: " + provider.options.hardfork); - } - assert.strictEqual(receipt.gasUsed, receipt.cumulativeGasUsed); - }); - - it("account Rsclear/Rselfdestruct/Refunds in gasEstimate w/many transactions in a block", async function() { - const { abi, bytecode, provider } = context; - const options = { - seed, - hardfork - }; - const { send, accounts, web3 } = await initializeTestProvider(options); - - const transactions = [ - { - value: "0x10000000", - gasLimit: "0x33450", - from: accounts[2], - to: accounts[1], - nonce: "0x0" - }, - { - value: "0x10000000", - gasLimit: "0x33450", - from: accounts[2], - to: accounts[1], - nonce: "0x1" - }, - { - value: "0x10000000", - gasLimit: "0x33450", - from: accounts[1], // < - to: accounts[2], // <^ reversed tx order - nonce: "0x0" - } - ]; - - // Precondition - const initialBlockNumber = await web3.eth.getBlockNumber(); - assert.deepStrictEqual(initialBlockNumber, 0, "Current Block Should be 0"); - - const deploymentOptions = { gas: 3141592 }; - const { instance } = await deploy(abi, bytecode, web3, deploymentOptions); - - // prime storage by making sure it is set to 0 - await instance.methods.reset().send({ from: accounts[0], gas: 5000000 }); - await send("miner_stop"); - const hashes = await Promise.all( - transactions.map((transaction) => { - const promiEvent = web3.eth.sendTransaction(transaction); - - return new Promise((resolve) => { - promiEvent.once("transactionHash", async(hash) => { - // Ensure there's no receipt since the transaction hasn't yet been processed. Ensure IntervalMining - const receipt = await web3.eth.getTransactionReceipt(hash); - assert.strictEqual(receipt, null, "No receipt since the transaction hasn't yet been processed."); - resolve(hash); - }); - }); - }) - ); - - const currentBlockNumber = await web3.eth.getBlockNumber(); - assert.deepStrictEqual(currentBlockNumber, 2, "Current Block Should be 2"); - - const method = instance.methods.triggerAllRefunds(); - const gasEstimate = await method.estimateGas({ from: accounts[0] }); - const prom = method.send({ from: accounts[0], gas: gasEstimate }); - await new Promise((resolve) => { - prom.once("transactionHash", resolve); - }); - await send("evm_mine"); - // web3 doesn't subscribe fast enough to newHeads after issuing the previous send - // we we mine another block to give it an additional newHeads notification. /shrug - await send("evm_mine"); - const rec = await prom; - const { gasUsed } = rec; - - let transactionCostMinusRefund = gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND; - switch (provider.options.hardfork) { - case "byzantium": - case "petersburg": - assert.strictEqual(gasUsed, transactionCostMinusRefund); - break; - case "muirGlacier": - case "istanbul": - // EIP-2200 - transactionCostMinusRefund = - gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO_ISTANBUL; - assert.strictEqual(gasUsed, transactionCostMinusRefund); - break; - case "constantinople": - // since storage was initially primed to 0 and we call triggerAllRefunds(), which then - // resets storage back to 0, 19800 gas is added to the refund counter per Constantinople EIP 1283 - transactionCostMinusRefund = - gasEstimate - RSELFDESTRUCT_REFUND - RSCLEAR_REFUND_FOR_RESETTING_DIRTY_SLOT_TO_ZERO; - assert.strictEqual(gasUsed, transactionCostMinusRefund); - break; - default: - throw new Error("Invalid hardfork option: " + provider.options.hardfork); - } - - const receipt = await Promise.all(hashes.map((hash) => web3.eth.getTransactionReceipt(hash))); - assert.deepStrictEqual(receipt[0].gasUsed, receipt[1].gasUsed, "Tx1 and Tx2 should cost the same gas."); - assert.deepStrictEqual( - receipt[1].gasUsed, - receipt[2].gasUsed, - "Tx2 and Tx3 should cost the same gas. -> Tx1 gas === Tx3 gas Transitive" - ); - assert.deepStrictEqual( - receipt[1].transactionIndex > receipt[2].transactionIndex, - true, - "(Tx3 has a lower nonce) -> (Tx3 index is < Tx2 index)" - ); - const currentBlock = await web3.eth.getBlock(receipt[0].blockNumber); - - // ( Tx3 has a lower nonce -> Tx3 index is < Tx2 index ) -> cumulative gas Tx2 > Tx3 > Tx1 - const isAccumulating = - receipt[1].cumulativeGasUsed > receipt[2].cumulativeGasUsed && - receipt[2].cumulativeGasUsed > receipt[0].cumulativeGasUsed; - - assert.deepStrictEqual( - isAccumulating, - true, - "Cumulative gas should be accumulating for any transactions in the same block." - ); - - assert.deepStrictEqual( - receipt[0].gasUsed, - receipt[0].cumulativeGasUsed, - "Gas and cumulative gas should be equal for the FIRST Tx." - ); - - assert.notDeepStrictEqual( - receipt[1].gasUsed, - receipt[1].cumulativeGasUsed, - "Gas and cumulative gas should NOT be equal for the Second Tx." - ); - - assert.notDeepStrictEqual( - receipt[2].gasUsed, - receipt[2].cumulativeGasUsed, - "Gas and cumulative gas should NOT be equal for the Third Tx." - ); - - const totalGas = receipt[0].gasUsed + receipt[1].gasUsed + receipt[2].gasUsed; - assert.deepStrictEqual( - totalGas + transactionCostMinusRefund, - receipt[1].cumulativeGasUsed, - "Total Gas should equal the final tx.cumulativeGas" - ); - - assert.deepStrictEqual( - totalGas + transactionCostMinusRefund, - currentBlock.gasUsed, - "Total Gas should be equal to the currentBlock.gasUsed" - ); - }); - - it("clears mapping storage slots", async function() { - const { accounts, instance } = context; - const from = accounts[0]; - const options = { from }; - - await instance.methods.reset().send({ from, gas: 5000000 }); - - const uintsa = await instance.methods.uints(1).call(); - assert.strictEqual(uintsa, "0", "initial value is not correct"); - - const receipta = await instance.methods.store(1).send(options); - assert.strictEqual(receipta.status, true, "storing value did not work"); - - const uintsb = await instance.methods.uints(1).call(); - assert.strictEqual(uintsb, "1", "set value is incorrect"); - - const receiptb = await instance.methods.clear().send(options); - assert.strictEqual(receiptb.status, true, "clearing value did not work"); - - const uintsc = await instance.methods.uints(1).call(); - assert.strictEqual(uintsc, "0", "cleared value is not correct"); - }); - }).timeout(4000); - - describe("Estimation", function() { - it("matches estimate for deployment", async function() { - const { accounts, bytecode, contract, receipt } = context; - const gasEstimate = await contract.deploy({ data: bytecode }).estimateGas({ - from: accounts[1] - }); - - assert.deepStrictEqual(receipt.gasUsed, gasEstimate); - assert.deepStrictEqual(receipt.cumulativeGasUsed, gasEstimate); - }).timeout(4000); - - it("matches usage for complex function call (add)", async function() { - const { accounts, instance } = context; - await testTransactionEstimate( - instance.methods.add, - [toBytesHexString("Tim"), toBytesHexString("A great guy"), 10], - { from: accounts[0], gas: 3141592 }, - instance - ); - }).timeout(10000); - - it("matches usage for complex function call (transfer)", async function() { - const { accounts, instance } = context; - await testTransactionEstimate( - instance.methods.transfer, - ["0x0123456789012345678901234567890123456789", 5, toBytesHexString("Tim")], - { from: accounts[0], gas: 3141592 }, - instance - ); - }).timeout(10000); - - it("matches usage for simple account to account transfer", async function() { - const { accounts, web3 } = context; - const transferAmount = web3.utils.toBN(web3.utils.toWei("5", "finney")); - const transactionData = { - from: accounts[0], - to: accounts[1], - value: transferAmount - }; - - const web3Transactions = [ - await web3.eth.estimateGas(transactionData), - await web3.eth.sendTransaction(transactionData) - ]; - const [gasEstimate, receipt] = await Promise.all(web3Transactions); - - assert.strictEqual(receipt.gasUsed, gasEstimate); - }); - }); - - describe("Expenditure", function() { - it("should calculate gas expenses correctly in consideration of the default gasPrice", async function() { - const { accounts, web3 } = context; - const transferAmount = "500"; - const gasPrice = await web3.eth.getGasPrice(); - await confirmGasPrice(gasPrice, false, web3, accounts, transferAmount); - }); - - it("should calculate gas expenses correctly in consideration of the requested gasPrice", async function() { - const transferAmount = "500"; - const gasPrice = "0x10000"; - const { accounts, web3 } = context; - await confirmGasPrice(gasPrice, true, web3, accounts, transferAmount); - }); - - it("should calculate gas expenses correctly with a user-defined default gasPrice", async function() { - const transferAmount = "500"; - const gasPrice = "0x2000"; - const options = { seed, gasPrice }; - const { accounts, web3 } = await initializeTestProvider(options); - await confirmGasPrice(gasPrice, false, web3, accounts, transferAmount); - }); - - it("should calculate cumalativeGas and gasUsed correctly for many transactions in a block", async function() { - const options = { - blockTime: 0.5, // seconds - seed - }; - const { send, accounts, web3 } = await initializeTestProvider(options); - await send("miner_stop"); - - const transactions = [ - { - value: "0x10000000", - gasLimit: "0x33450", - from: accounts[0], - to: accounts[1], - nonce: "0x0" - }, - { - value: "0x10000000", - gasLimit: "0x33450", - from: accounts[0], - to: accounts[1], - nonce: "0x1" - }, - { - value: "0x10000000", - gasLimit: "0x33450", - from: accounts[1], // < - to: accounts[0], // <^ reversed tx order - nonce: "0x0" - } - ]; - - // Precondition - const initialBlockNumber = await web3.eth.getBlockNumber(); - assert.deepStrictEqual(initialBlockNumber, 0, "Current Block Should be 0"); - - const hashes = await Promise.all( - transactions.map((transaction) => { - const promiEvent = web3.eth.sendTransaction(transaction); - - return new Promise((resolve) => { - promiEvent.once("transactionHash", async(hash) => { - // Ensure there's no receipt since the transaction hasn't yet been processed. Ensure IntervalMining - const receipt = await web3.eth.getTransactionReceipt(hash); - assert.strictEqual(receipt, null, "No receipt since the transaction hasn't yet been processed."); - - resolve(hash); - }); - }); - }) - ); - - await send("evm_mine"); - - const currentBlockNumber = await web3.eth.getBlockNumber(); - assert.deepStrictEqual(currentBlockNumber, 1, "Current Block Should be 1"); - - const [currentBlock, receipt] = await Promise.all([ - web3.eth.getBlock(currentBlockNumber), - Promise.all(hashes.map((hash) => web3.eth.getTransactionReceipt(hash))) - ]); - - assert.deepStrictEqual(receipt[0].gasUsed, receipt[1].gasUsed, "Tx1 and Tx2 should cost the same gas."); - assert.deepStrictEqual( - receipt[1].gasUsed, - receipt[2].gasUsed, - "Tx2 and Tx3 should cost the same gas. -> Tx1 gas === Tx3 gas Transitive" - ); - assert.deepStrictEqual( - receipt[1].transactionIndex > receipt[2].transactionIndex, - true, - "(Tx3 has a lower nonce) -> (Tx3 index is < Tx2 index)" - ); - - // ( Tx3 has a lower nonce -> Tx3 index is < Tx2 index ) -> cumulative gas Tx2 > Tx3 > Tx1 - const isAccumulating = - receipt[1].cumulativeGasUsed > receipt[2].cumulativeGasUsed && - receipt[2].cumulativeGasUsed > receipt[0].cumulativeGasUsed; - assert.deepStrictEqual( - isAccumulating, - true, - "Cumulative gas should be accumulating for any transactions in the same block." - ); - assert.deepStrictEqual( - receipt[0].gasUsed, - receipt[0].cumulativeGasUsed, - "Gas and cumulative gas should be equal for the FIRST Tx." - ); - assert.notDeepStrictEqual( - receipt[1].gasUsed, - receipt[1].cumulativeGasUsed, - "Gas and cumulative gas should NOT be equal for the Second Tx." - ); - assert.notDeepStrictEqual( - receipt[2].gasUsed, - receipt[2].cumulativeGasUsed, - "Gas and cumulative gas should NOT be equal for the Third Tx." - ); - - const totalGas = receipt[0].gasUsed + receipt[1].gasUsed + receipt[2].gasUsed; - assert.deepStrictEqual( - totalGas, - receipt[1].cumulativeGasUsed, - "Total Gas should be equal the final tx.cumulativeGas" - ); - assert.deepStrictEqual( - totalGas, - currentBlock.gasUsed, - "Total Gas should be equal to the currentBlock.gasUsed" - ); - }).timeout(4000); - }); - }); - }); -}); \ No newline at end of file diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index c022f35b96..147a51adf2 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1404,8 +1404,7 @@ export default class EthereumApi implements types.Api { // gas estimates and eth_calls aren't subject to regular block gas limits gasLimit: transaction.gas }); - const result = await blockchain.simulateTransaction(transaction, parentBlock, newBlock); - return Data.from(result.execResult.returnValue || "0x"); + return blockchain.simulateTransaction(transaction, parentBlock, newBlock); } //#endregion diff --git a/src/chains/ethereum/src/things/gas-estimator.ts b/src/chains/ethereum/src/things/gas-estimator.ts index 35d5337f2c..368ec8a77a 100644 --- a/src/chains/ethereum/src/things/gas-estimator.ts +++ b/src/chains/ethereum/src/things/gas-estimator.ts @@ -1,6 +1,6 @@ import Blockchain from "../blockchain"; import Transaction from "./transaction"; -import {Data, Quantity} from "@ganache/utils/src/things/json-rpc"; +import {Quantity} from "@ganache/utils"; import Tag from "./tags"; import BN from "bn.js"; const MULTIPLE = 64 / 63; diff --git a/src/packages/core/__tests__/gas.ts b/src/packages/core/__tests__/gas.ts deleted file mode 100644 index 81d8891d7e..0000000000 --- a/src/packages/core/__tests__/gas.ts +++ /dev/null @@ -1,24 +0,0 @@ -import Ganache from "../src"; -import * as assert from "assert"; -import EthereumProvider from "@ganache/ethereum/src/provider"; - -describe("gas", () => { - let ganache: EthereumProvider; - - before(() => { - ganache = Ganache.provider() as EthereumProvider; - }) - - it.only("works", async () => { - const accounts = await ganache.send("eth_accounts"); - const response = await ganache.send("eth_estimateGas", [ - { - from: accounts[0], - to: accounts[1], - value: 100000 - } - ]); - console.log(response); - - }); -}); From 8487557a849f917d2a2d339e0094ff78525176da Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 28 Aug 2020 17:58:25 -0400 Subject: [PATCH 487/691] remove unneeded length check --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 147a51adf2..212169a4a0 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -977,7 +977,7 @@ export default class EthereumApi implements types.Api { tx.value = Buffer.from([0]); } - if (tx.to.length === 0 || tx.to.equals(BUFFER_ZERO)) { + if (tx.to.equals(BUFFER_ZERO)) { tx.to = BUFFER_EMPTY; } From 4d49cddb8ee6014e06e9975559ef0bf987b30e4b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 28 Aug 2020 17:59:05 -0400 Subject: [PATCH 488/691] make a copy of the transaction before mutating it for eth_call (temp) --- src/chains/ethereum/src/api.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 212169a4a0..8c019f060d 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1385,13 +1385,17 @@ export default class EthereumApi implements types.Api { const parentHeader = parentBlock.value.header; const options = this.#options; + // TODO: we need a copy of transaction since we are going to mutate it. + // copy it in a better way than this: + transaction = {...transaction}; + if (transaction.gasLimit) { transaction.gas = transaction.gasLimit; } else { if (transaction.gas) { transaction.gasLimit = transaction.gas; } else { - // eth_estimateGas isn't subject to regular transaction gas limits + // eth_call isn't subject to regular transaction gas limits transaction.gas = transaction.gasLimit = options.callGasLimit.toString(); } } From 2b1065449b0392bb4038d14cbea6704867a51ddd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 28 Aug 2020 18:00:59 -0400 Subject: [PATCH 489/691] fix receipts so they return correct gas values --- .../src/things/transaction-receipt.ts | 28 ++++++++++--------- src/chains/ethereum/src/things/transaction.ts | 14 ++++++---- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index 9b894fea46..d5b6ac0579 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -5,34 +5,36 @@ import {Data, Quantity} from "@ganache/utils"; import BlockLogs, { TransactionLog } from "./blocklogs"; type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; -type FullRawReceipt = [status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer | null]; -type RawReceipt = OmitLastType +type FullRawReceipt = [status: Buffer, cumulativeGasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], gasUsed: Buffer, contractAddress: Buffer | null]; +type RawReceipt = OmitLastType>; export default class TransactionReceipt { public contractAddress: Buffer; + #gasUsed: Buffer; raw: RawReceipt; constructor(data?: Buffer) { if (data) { const decoded = (rlpDecode(data) as unknown) as FullRawReceipt; - this.#init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4]); + this.#init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4], decoded[5]); } } - #init = (status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer = null) => { - this.raw = [status, gasUsed, logsBloom, logs]; + #init = (status: Buffer, cumulativeGasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], gasUsed: Buffer, contractAddress: Buffer = null) => { + this.raw = [status, cumulativeGasUsed, logsBloom, logs]; this.contractAddress = contractAddress; + this.#gasUsed = gasUsed; } - static fromValues(status: Buffer, gasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], contractAddress: Buffer) { + static fromValues(status: Buffer, cumulativeGasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], gasUsed: Buffer, contractAddress: Buffer) { const receipt = new TransactionReceipt(); - receipt.#init(status, gasUsed, logsBloom, logs, contractAddress); + receipt.#init(status, cumulativeGasUsed, logsBloom, logs, contractAddress, gasUsed); return receipt; } public serialize(all: boolean) { if (all) { // the database format includes the contractAddress: - return rlpEncode([...this.raw, this.contractAddress] as FullRawReceipt); + return rlpEncode([...this.raw, this.#gasUsed, this.contractAddress] as FullRawReceipt); } else { // receipt trie format: return rlpEncode(this.raw); @@ -41,7 +43,7 @@ export default class TransactionReceipt { public toJSON(block: Block, transaction: Transaction) { const raw = this.raw; - const contractAddress = Data.from(this.contractAddress).toJSON() + const contractAddress = this.contractAddress.length === 0 ? null : Data.from(this.contractAddress); const blockLog = BlockLogs.create(block.value.hash()); blockLog.blockNumber = Quantity.from(block.value.header.number); (raw[3] as any as TransactionLog[]).forEach(log => { @@ -54,10 +56,10 @@ export default class TransactionReceipt { blockNumber: Quantity.from(block.value.header.number), blockHash: Data.from(block.value.hash()), from: Data.from(transaction.from), - to: contractAddress === "0x" ? Data.from(transaction.to) : null, - cumulativeGasUsed: Quantity.from(block.value.header.gasUsed), - gasUsed: Quantity.from(raw[1]), - contractAddress: contractAddress === "0x" ? null : contractAddress, + to: contractAddress ? null : Data.from(transaction.to), + cumulativeGasUsed: Quantity.from(raw[1]), + gasUsed: Quantity.from(this.#gasUsed), + contractAddress, logs, logsBloom: Data.from(raw[2], 256), status: raw[0][0] diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index e78d73268b..38daeadd53 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -406,7 +406,7 @@ class Transaction extends (EthereumJsTransaction as any) { * @param result * @returns RLP encoded data for use in a transaction trie */ - fillFromResult (result: RunTxResult) { + fillFromResult (result: RunTxResult, cumulativeGasUsed: bigint) { const vmResult = result.execResult; const execException = vmResult.exceptionError; let status: Buffer; @@ -416,12 +416,14 @@ class Transaction extends (EthereumJsTransaction as any) { } else { status = ONE_BUFFER; } - const gasUsed = result.gasUsed.toBuffer(); - const logsBloom = result.bloom.bitvector; - const logs = vmResult.logs || [] as TransactionLog[]; - const receipt = this.#receipt = TransactionReceipt.fromValues(status, gasUsed, logsBloom, logs, result.createdAddress); - this.#logs = logs; + const receipt = this.#receipt = TransactionReceipt.fromValues( + status, Quantity.from(cumulativeGasUsed).toBuffer(), + result.bloom.bitvector, + (this.#logs = vmResult.logs || [] as TransactionLog[]), + result.createdAddress, + result.gasUsed.toBuffer() + ); return receipt.serialize(false); }; From 59cd4761bcdce44f1e0b7f3b9e29a4b7111f43fa Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 28 Aug 2020 18:01:48 -0400 Subject: [PATCH 490/691] require repc quantity strings be 0x prefixed hex strings --- .../utils/src/things/json-rpc/json-rpc-base-types.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts index bb68d25cee..bed857b443 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts @@ -57,14 +57,7 @@ export class BaseJsonRpcType { - const buf = this.toBuffer(); - return buf.toString("hex"); - }); - // treat string without `0x` as just plain text. This is probably - // wrong. TODO: look into this. - toBuffers.set(this, () => Buffer.from(value as string)); + throw new Error(`cannot convert string value "${value}" into type \`${this.constructor.name}\`; strings must be hex-encoded and prefixed with "0x".`); } break; } From 0f7485a0b2557b9433c2e4126b9ede9c3c43727c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 28 Aug 2020 18:02:22 -0400 Subject: [PATCH 491/691] ensure tranasction logs aren't truncated --- src/chains/ethereum/src/things/blocklogs.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index 00e9358c78..b1501e929d 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -3,7 +3,7 @@ import { Data, Quantity } from "@ganache/utils"; import Address from "./address"; const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); -export type TransactionLog = [address: Buffer, topics: Buffer[], data: Buffer[]] +export type TransactionLog = [address: Buffer, topics: Buffer[], data: Buffer|Buffer[]] export type BlockLog = [removed: Buffer, transactionIndex: Buffer, transactionHash: Buffer, address: TransactionLog[0], topics: TransactionLog[1], data: TransactionLog[2]]; const _raw = Symbol("raw"); @@ -132,7 +132,7 @@ export default class BlockLogs { address: Address.from(log[3]), blockHash, blockNumber, - data: Array.isArray(data) ? data.map(d => Data.from(d)) : Data.from(data, 32), + data: Array.isArray(data) ? data.map(d => Data.from(d, d.length)) : Data.from(data, data.length), logIndex, // this is the index in the *block* removed: log[0].equals(BUFFER_ZERO) ? false : true, topics: Array.isArray(topics) ? topics.map(t => Data.from(t, 32)) : Data.from(topics, 32), From 5a37945fcd97684ea6275c4dab777e7f7e5e026c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 28 Aug 2020 18:02:31 -0400 Subject: [PATCH 492/691] +receipts fix --- src/chains/ethereum/src/miner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 96812a5d7d..2d9d9fcb99 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -192,7 +192,7 @@ export default class Miner extends Emittery { blockData.gasUsed += gasUsed; // calculate receipt and tx tries - const receipt = best.fillFromResult(result); + const receipt = best.fillFromResult(result, blockData.gasUsed); const txKey = rlpEncode(numTransactions); promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); promises.push(putInTrie(receiptTrie, txKey, receipt)); From 88161244ef1a7426fb82aa7da443d1a2c4cf0cf6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 28 Aug 2020 18:02:43 -0400 Subject: [PATCH 493/691] add eth_estimateGas --- src/chains/ethereum/src/api.ts | 58 ++++-- .../ethereum/src/things/gas-estimator.ts | 183 ++++++++---------- 2 files changed, 122 insertions(+), 119 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 8c019f060d..8ed98bb7d8 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -20,7 +20,7 @@ import Common from "ethereumjs-common"; import BlockLogs from "./things/blocklogs"; import EthereumAccount from "ethereumjs-account"; import { Block } from "./components/block-manager"; -import GasEstimator from "./things/gas-estimator"; +import estimateGas from "./things/gas-estimator"; import CodedError, { ErrorCodes } from "./things/coded-error"; //#endregion @@ -503,23 +503,53 @@ export default class EthereumApi implements types.Api { * * @returns the amount of gas used. */ - async eth_estimateGas(transaction: any, blockNumber: Buffer | Tag | string = Tag.LATEST): Promise { + async eth_estimateGas(transaction: any, blockNumber: Buffer | Tag | string = Tag.LATEST) { const blockchain = this.#blockchain; + const blocks = blockchain.blocks; + const parentBlock = await blocks.get(blockNumber); + const parentHeader = parentBlock.value.header; const options = this.#options; - if (transaction.gasLimit) { - transaction.gas = transaction.gasLimit; - } else { - if (transaction.gas) { - transaction.gasLimit = transaction.gas; + + const generateVM = () => { + return blockchain.vm.copy(); + }; + return new Promise((resolve, reject) => { + const coinbase = blockchain.coinbase; + const tx = Transaction.fromJSON(transaction, this.#common, Transaction.types.fake); + if (tx._from == null) { + tx._from = blockchain.coinbase.toBuffer(); + } + if (tx.gasLimit.length !== 0) { + tx.gas = tx.gasLimit; } else { - // eth_estimateGas isn't subject to regular transaction gas limits - transaction.gas = transaction.gasLimit = options.callGasLimit.toString(); + if (tx.gas.length !== 0) { + tx.gasLimit = tx.gas; + } else { + // eth_estimateGas isn't subject to regular transaction gas limits + tx.gas = tx.gasLimit = options.callGasLimit.toBuffer(); + } } - } - const tx = Transaction.fromJSON(transaction, null, Transaction.types.none); - // const result = await GasEstimator.binSearch(blockchain, tx, blockNumber); - // return result; - return GasEstimator.binSearch(blockchain, tx, blockNumber); + const newBlock = blocks.createBlock({ + number: parentHeader.number, + timestamp: parentHeader.timestamp, + parentHash: parentHeader.parentHash, + coinbase: coinbase.toBuffer(), + // gas estimates and eth_calls aren't subject to regular block gas limits + gasLimit: tx.gas + }); + newBlock.value.transactions.push(tx); + const runArgs = { + tx: tx, + block: newBlock.value, + skipBalance: true, + skipNonce: true + }; + estimateGas(generateVM, runArgs, (err, result) => { + if(err) return reject(err); + resolve(Quantity.from(result.gasEstimate.toBuffer())); + }); + }); + // return GasEstimator.binSearch(blockchain, tx, blockNumber); } /** diff --git a/src/chains/ethereum/src/things/gas-estimator.ts b/src/chains/ethereum/src/things/gas-estimator.ts index 368ec8a77a..179baae648 100644 --- a/src/chains/ethereum/src/things/gas-estimator.ts +++ b/src/chains/ethereum/src/things/gas-estimator.ts @@ -1,12 +1,10 @@ -import Blockchain from "../blockchain"; -import Transaction from "./transaction"; -import {Quantity} from "@ganache/utils"; -import Tag from "./tags"; -import BN from "bn.js"; -const MULTIPLE = 64 / 63; +import { Quantity } from "@ganache/utils"; +import { BN } from "ethereumjs-util"; +import ExecutionError, { RETURN_TYPES } from "./execution-error"; -const bn = (val = 0) => new BN(val); +const bn = (val = 0) => new (BN as any)(val); const STIPEND = bn(2300); +const MULTIPLE = 64 / 63; const check = (set) => (opname) => set.has(opname); const isCall = check(new Set(["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"])); @@ -14,50 +12,63 @@ const isCallOrCallcode = check(new Set(["CALL", "CALLCODE"])); const isCreate = check(new Set(["CREATE", "CREATE2"])); const isTerminator = check(new Set(["STOP", "RETURN", "REVERT", "INVALID", "SELFDESTRUCT"])); -export default class GasEstimator { - static async getParentAndNewBlock( - blockchain: Blockchain, - transaction: Transaction, - blockNumber: Buffer | Tag | string = Tag.LATEST - ){ - const blocks = blockchain.blocks; - const parentBlock = await blocks.get(blockNumber); - const parentHeader = parentBlock.value.header; - - const newBlock = blocks.createBlock({ - number: parentHeader.number, - timestamp: parentHeader.timestamp, - parentHash: parentHeader.parentHash, - gasLimit: transaction.gasLimit - }); - return {parentBlock, newBlock}; +const stepTracker = () => { + const sysOps = []; + const allOps = []; + const preCompile = new Set(); + let preCompileCheck = false; + let precompileCallDepth = 0; + return { + collect: (info) => { + if (preCompileCheck) { + if (info.depth === precompileCallDepth) { + // If the current depth is unchanged. + // we record its position. + preCompile.add(allOps.length - 1); + } + // Reset the flag immediately here + preCompileCheck = false; + } + if (isCall(info.opcode.name)) { + info.stack = info.stack.map((val) => val.clone()); + preCompileCheck = true; + precompileCallDepth = info.depth; + sysOps.push({ index: allOps.length, depth: info.depth, name: info.opcode.name }); + } else if (isCreate(info.opcode.name) || isTerminator(info.opcode.name)) { + sysOps.push({ index: allOps.length, depth: info.depth, name: info.opcode.name }); + } + // This goes last so we can use the length for the index ^ + allOps.push(info); + }, + isPrecompile: (index) => preCompile.has(index), + done: () => !allOps.length || sysOps.length < 2 || !isTerminator(allOps[allOps.length - 1].opcode.name), + ops: allOps, + systemOps: sysOps } +} - static async binSearch( - blockchain: Blockchain, - transaction: Transaction, - blockNumber: Buffer | Tag | string = Tag.LATEST - ): Promise { - const isEnoughGas = async(gas) => { - transaction.gasLimit = gas.toBuffer(); - const {newBlock, parentBlock} = await GasEstimator.getParentAndNewBlock(blockchain, transaction, blockNumber); - const result = await blockchain.simulateTransaction2(transaction, parentBlock, newBlock); - // return !result.vmerr && !result.execResult.exceptionError; - return !result.execResult.exceptionError; - }; - const {newBlock, parentBlock} = await GasEstimator.getParentAndNewBlock(blockchain, transaction, blockNumber); - const result = await blockchain.simulateTransaction2(transaction, parentBlock, newBlock); - // const result = JSON.parse((await blockchain.simulateTransaction2(transaction, parentBlock, test)).toString()); - // return blockchain.simulateTransaction(transaction, parentBlock, newBlock); - - const MAX = new BN(blockchain.blocks.latest.value.header.gasLimit); - // const MAX = Quantity.from(blockchain.blocks.latest.value.header.gasLimit).toBigInt(); - // const MAX = hexToBn(runArgs.block.header.gasLimit); + const estimateGas = (generateVM, runArgs, callback) => { + exactimate(generateVM(), runArgs, (err, result) => { + if (err) return callback(err); + binSearch(generateVM, runArgs, result, (err, result) => { + if (err) return callback(err); + callback(null, result); + }) + }) + }; + + const binSearch = async (generateVM, runArgs, result, callback) => { + const MAX = Quantity.from(runArgs.block.header.gasLimit).toBigInt(); const gasRefund = result.execResult.gasRefund; - let gasEstimate = result.gasUsed; - const startingGas = gasRefund ? gasEstimate.add(gasRefund) : gasEstimate; + const startingGas = gasRefund ? result.gasEstimate.add(gasRefund) : result.gasEstimate; const range = { lo: startingGas, hi: startingGas }; - + const isEnoughGas = async(gas) => { + const vm = generateVM(); // Generate fresh VM + runArgs.tx.gasLimit = gas.toBuffer(); + const result = await vm.runTx(runArgs).catch((vmerr) => ({ vmerr })); + return !result.vmerr && !result.execResult.exceptionError; + }; + if (!(await isEnoughGas(range.hi))) { do { range.hi = range.hi.muln(MULTIPLE); @@ -72,25 +83,20 @@ export default class GasEstimator { } if (range.hi.gte(MAX)) { if (!(await isEnoughGas(range.hi))) { - throw new Error("gas required exceeds allowance or always failing transaction"); - - // return Data.from("gas required exceeds allowance or always failing transaction"); + return callback(new Error("gas required exceeds allowance or always failing transaction")); } } } + + result.gasEstimate = range.hi; + callback(null, result); + }; - gasEstimate = range.hi; - return Quantity.from(`0x${gasEstimate.toString('hex')}`); - } - - async guestimation( - blockchain: Blockchain, - transaction: Transaction, - blockNumber: Buffer | Tag | string = Tag.LATEST - ){ + const exactimate = async (vm, runArgs, callback) => { const steps = stepTracker(); + vm.on("step", steps.collect); - const Context = (index, fee?) => { + const Context = (index: number, fee?: BN) => { const base = index === 0; let start = index; let stop = 0; @@ -210,55 +216,22 @@ export default class GasEstimator { return gas.cost.add(gas.sixtyFloorths); }; - const {newBlock, parentBlock} = await GasEstimator.getParentAndNewBlock(blockchain, transaction, blockNumber); - // const result = await vm.runTx(runArgs).catch((vmerr) => ({ vmerr })); - const result = await blockchain.simulateTransaction2(transaction, parentBlock, newBlock); - let estimate; - if (result.execResult.exceptionError) { - throw new Error("test"); - // return RuntimeError.fromResults([runArgs.tx], { results: [result] }); + const result = await vm.runTx(runArgs).catch((vmerr) => ({ vmerr })); + const vmerr = result.vmerr; + if (vmerr) { + return callback(vmerr); + } else if (result.execResult.exceptionError) { + const error = new ExecutionError(runArgs.tx, result, RETURN_TYPES.RETURN_VALUE); + return callback(error, result); } else if (steps.done()) { - estimate = result.gasUsed; + const estimate = result.gasUsed; + result.gasEstimate = estimate; } else { const actualUsed = steps.ops[0].gasLeft.sub(steps.ops[steps.ops.length - 1].gasLeft); const sixtyFloorths = getTotal().sub(actualUsed); - estimate = result.gasUsed.add(sixtyFloorths); + result.gasEstimate = result.gasUsed.add(sixtyFloorths); } - return result; + callback(vmerr, result); } -} -const stepTracker = () => { - const sysOps = []; - const allOps = []; - const preCompile = new Set(); - let preCompileCheck = false; - let precompileCallDepth = 0; - return { - collect: (info) => { - if (preCompileCheck) { - if (info.depth === precompileCallDepth) { - // If the current depth is unchanged. - // we record its position. - preCompile.add(allOps.length - 1); - } - // Reset the flag immediately here - preCompileCheck = false; - } - if (isCall(info.opcode.name)) { - info.stack = info.stack.map((val) => val.clone()); - preCompileCheck = true; - precompileCallDepth = info.depth; - sysOps.push({ index: allOps.length, depth: info.depth, name: info.opcode.name }); - } else if (isCreate(info.opcode.name) || isTerminator(info.opcode.name)) { - sysOps.push({ index: allOps.length, depth: info.depth, name: info.opcode.name }); - } - // This goes last so we can use the length for the index ^ - allOps.push(info); - }, - isPrecompile: (index) => preCompile.has(index), - done: () => !allOps.length || sysOps.length < 2 || !isTerminator(allOps[allOps.length - 1].opcode.name), - ops: allOps, - systemOps: sysOps - }; -}; + export default estimateGas; \ No newline at end of file From 31f950fc4fbb89dd9e9bde59759975e598d2f37e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 28 Aug 2020 18:14:37 -0400 Subject: [PATCH 494/691] remove simulateTransaction2 since it isn't used --- src/chains/ethereum/src/blockchain.ts | 17 ----- test.js | 103 ++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 17 deletions(-) create mode 100644 test.js diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 500db56c18..6905f0ca09 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -553,23 +553,6 @@ export default class Blockchain extends Emittery.Typed { + connection.send("null"); +}); +client.connect('ws://localhost:8546') + + + +// const map = new WeakMap() +// var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { +// if (!privateMap.has(receiver)) { +// throw new TypeError("attempted to get private field on non-instance"); +// } +// return privateMap.get(receiver); +// }; + +// class Test { +// constructor(){ +// map.set(this, {a: 1, b: 1}); +// } +// test1() { +// const a = __classPrivateFieldGet(this, map).a; +// const b = __classPrivateFieldGet(this, map).b; +// __classPrivateFieldGet(this, map).a = a + b; +// __classPrivateFieldGet(this, map).b = a * b; +// return [a, b]; +// } + +// test2() { +// const options = __classPrivateFieldGet(this, map) +// const a = options.a; +// const b = options.b; +// options.a = a + b; +// options.b = a * b; +// return [a, b]; +// } +// } + +// const c = new Test(); + +// let start; + +// const l = 1e5; + +// let array = Array.from({length: 1000}, () => Math.round(Math.random() * 100)); + +// start = Date.now(); +// let r1; +// for (let i = 0; i < l; i++) { +// r1 = array.map((a)=>{return a+1}).filter(a=>a%2 === 0).map(a => a*2); +// } +// console.log("functional: ", Date.now() - start); + +// start = Date.now(); +// let r2; +// for (let i = 0; i < l; i++) { +// r2 = []; +// for(let j = 0, length = array.length; j < length; j++) { +// const step1 = array[j] + 1; +// if (step1 % 2 === 0) { +// r2.push(step1 * 2); +// } +// } +// } +// console.log("for: ", Date.now() - start); + + +// start = Date.now(); +// let r3 = []; +// let fn = a => { +// const step1 = a + 1; +// if (step1 % 2 === 0) { +// r3.push(step1 * 2); +// } +// } +// for (let i = 0; i < l; i++) { +// r3 = []; +// array.forEach(a => { +// const step1 = a + 1; +// if (step1 % 2 === 0) { +// r3.push(step1 * 2); +// } +// }); +// } +// console.log("foreach: ", Date.now() - start); + + +// start = Date.now(); +// let r4; +// let fn2 = a => { +// const step1 = a + 1; +// if (step1 % 2 === 0) { +// r4.push(step1 * 2); +// } +// } +// for (let i = 0; i < l; i++) { +// r4 = []; +// for(let j = 0, length = array.length; j < length; j++) { +// fn2(array[j]); +// } +// } +// console.log("for2: ", Date.now() - start); \ No newline at end of file From 1d5543116523c6b987437a4d8782459b589a7344 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 1 Sep 2020 13:03:54 -0400 Subject: [PATCH 495/691] Allow eth_call to run out of gas --- src/chains/ethereum/src/blockchain.ts | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 6905f0ca09..3cd26c0923 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -23,6 +23,8 @@ import VM from "ethereumjs-vm"; import Address from "./things/address"; import BlockLogManager from "./components/blocklog-manager"; import RejectionError from "./things/rejection-error"; +import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; +import { VmError, ERROR } from "ethereumjs-vm/dist/exceptions"; const unref = utils.unref; @@ -534,14 +536,26 @@ export default class Blockchain extends Emittery.Typed= 0) { + tx.gasLimit = Quantity.from(gasLeft).toBuffer(); + + await promisify(stateManager.setStateRoot.bind(stateManager))( + parentBlock.value.header.stateRoot + ); + + result = await vm.runCall(tx); + } else { + result = {execResult: {exceptionError: new VmError(ERROR.OUT_OF_GAS), returnValue: Buffer.allocUnsafe(0)}} as any; + } if (result.execResult.exceptionError) { if (this.#options.vmErrorsOnRPCResponse) { throw new ExecutionError(tx, result, RETURN_TYPES.RETURN_VALUE); From f05be1a630f55a798640d7b1e5030a6fe9330025 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 1 Sep 2020 13:04:23 -0400 Subject: [PATCH 496/691] Update some error and todos --- src/chains/ethereum/src/components/transaction-pool.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index 7a9ceb8bd4..304c2aa5c1 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -57,7 +57,6 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { err = this.validateTransaction(transaction); if (err != null) { - // TODO: how do we surface these transaction failures to the caller?! throw err; } @@ -110,8 +109,6 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { const gasPrice = Quantity.from(currentPendingTx.gasPrice).toBigInt(); const thisPricePremium = gasPrice + (gasPrice * priceBump) / 100n; - // TODO: how do we surface these transaction failures to the caller?! - // if our new price is `gasPrice * priceBumpPercent` better than our // oldPrice, throw out the old now. if (!currentPendingTx.locked && newGasPrice > thisPricePremium) { @@ -120,9 +117,11 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // already known where this tranassction should go in this byNonce // heap. pendingArray[i] = transaction; - throw new Error("That old transaction sucked, yo!"); + + // TODO: how to surface this to the caller?!? + console.error("The *old* transation was rejected"); } else { - throw new Error("That new transaction sucked, yo!"); + throw new CodedError("transaction rejected; gas price too low to replace existing transaction", ErrorCodes.TRANSACTION_REJECTED); } } if (thisNonce > highestNonce) { From a207d32b31dbe1943fe82b8f36b5e18997ef8310 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 1 Sep 2020 13:04:46 -0400 Subject: [PATCH 497/691] Remove unused error code --- src/chains/ethereum/src/things/coded-error.ts | 5 ----- src/chains/ethereum/src/things/execution-error.ts | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/chains/ethereum/src/things/coded-error.ts b/src/chains/ethereum/src/things/coded-error.ts index 2662b6f5b9..2f7a9ec9e9 100644 --- a/src/chains/ethereum/src/things/coded-error.ts +++ b/src/chains/ethereum/src/things/coded-error.ts @@ -25,11 +25,6 @@ export const ErrorCodes = { */ INTERNAL_ERROR: -32603, - /** - * Custom Ganache Application Error for transactions that fail to execute. - */ - VM_ERROR: -32103, - /** * Missing or invalid parameters */ diff --git a/src/chains/ethereum/src/things/execution-error.ts b/src/chains/ethereum/src/things/execution-error.ts index 3e73921aee..be20bb07c1 100644 --- a/src/chains/ethereum/src/things/execution-error.ts +++ b/src/chains/ethereum/src/things/execution-error.ts @@ -13,7 +13,7 @@ export enum RETURN_TYPES { } export default class ExecutionError extends CodedError { - public code: typeof ErrorCodes.VM_ERROR; + public code: typeof ErrorCodes.INVALID_INPUT; public data: { hash: string, programCounter: number, @@ -26,7 +26,7 @@ export default class ExecutionError extends CodedError { const error = execResult.exceptionError.error; let message = VM_EXCEPTION + error; - super(message, ErrorCodes.VM_ERROR); + super(message, ErrorCodes.INVALID_INPUT); Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; From 9c82a1a4dee38544e553e093142439cd7d55f8c0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 1 Sep 2020 13:05:04 -0400 Subject: [PATCH 498/691] add blockchain-aware tx costs. --- src/chains/ethereum/src/things/params.ts | 6 +++++- src/chains/ethereum/src/things/transaction.ts | 12 +++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/chains/ethereum/src/things/params.ts b/src/chains/ethereum/src/things/params.ts index 4562dddb1e..2c9bc274bb 100644 --- a/src/chains/ethereum/src/things/params.ts +++ b/src/chains/ethereum/src/things/params.ts @@ -1,3 +1,6 @@ +// NOTE these params may need to be changed at each hardfork +// they can be tracked here: https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/common/src/hardforks/ + export default { /** * Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. @@ -7,7 +10,8 @@ export default { /** * Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. */ - TRANSACTION_DATA_NON_ZERO_GAS: 68n, + TRANSACTION_DATA_NON_ZERO_GAS: new Map<"constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier", bigint>([["constantinople", 68n], ["byzantium", 68n], ["petersburg", 68n], ["istanbul", 68n], ["muirGlacier", 16n]]), + /** * Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. */ diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 38daeadd53..75c8b76e48 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -252,6 +252,8 @@ class Transaction extends (EthereumJsTransaction as any) { // Set the starting gas for the raw transaction let gas = params.TRANSACTION_GAS; + const TRANSACTION_DATA_NON_ZERO_GAS = params.TRANSACTION_DATA_NON_ZERO_GAS.get(this._common._hardfork); + const TRANSACTION_DATA_ZERO_GAS = params.TRANSACTION_DATA_ZERO_GAS // Bump the required gas by the amount of transactional data const dataLength = data.byteLength; @@ -264,16 +266,16 @@ class Transaction extends (EthereumJsTransaction as any) { } } // Make sure we don't exceed uint64 for all data combinations. - if ((MAX_UINT64 - gas) / params.TRANSACTION_DATA_NON_ZERO_GAS < nonZeroBytes) { + if ((MAX_UINT64 - gas) / TRANSACTION_DATA_NON_ZERO_GAS < nonZeroBytes) { throw new Error(INTRINSIC_GAS_TOO_LOW); } - gas += nonZeroBytes * params.TRANSACTION_DATA_NON_ZERO_GAS; + gas += nonZeroBytes * TRANSACTION_DATA_NON_ZERO_GAS; - let z = BigInt(dataLength) - nonZeroBytes; - if ((MAX_UINT64 - gas) / params.TRANSACTION_DATA_ZERO_GAS < z) { + const z = BigInt(dataLength) - nonZeroBytes; + if ((MAX_UINT64 - gas) / TRANSACTION_DATA_ZERO_GAS < z) { throw new Error(INTRINSIC_GAS_TOO_LOW); } - gas += z * params.TRANSACTION_DATA_ZERO_GAS; + gas += z * TRANSACTION_DATA_ZERO_GAS; } return gas; } From cec1a18946c3fc268a64d044a072d50058252cb0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 2 Sep 2020 11:34:43 -0400 Subject: [PATCH 499/691] rename ExecutionError to RuntimeError for v2 compat --- src/chains/ethereum/src/blockchain.ts | 4 ++-- src/chains/ethereum/src/provider.ts | 5 +++++ src/chains/ethereum/src/things/gas-estimator.ts | 4 ++-- .../src/things/{execution-error.ts => runtime-error.ts} | 2 +- src/chains/ethereum/src/things/transaction.ts | 6 +++--- 5 files changed, 13 insertions(+), 8 deletions(-) rename src/chains/ethereum/src/things/{execution-error.ts => runtime-error.ts} (96%) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 3cd26c0923..ff7f626824 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -1,4 +1,4 @@ -import ExecutionError, { RETURN_TYPES } from "./things/execution-error"; +import RuntimeError, { RETURN_TYPES } from "./things/runtime-error"; import Miner from "./miner"; import Database from "./database"; import Emittery from "emittery"; @@ -558,7 +558,7 @@ export default class Blockchain extends Emittery.Typed new (BN as any)(val); const STIPEND = bn(2300); @@ -221,7 +221,7 @@ const stepTracker = () => { if (vmerr) { return callback(vmerr); } else if (result.execResult.exceptionError) { - const error = new ExecutionError(runArgs.tx, result, RETURN_TYPES.RETURN_VALUE); + const error = new RuntimeError(runArgs.tx, result, RETURN_TYPES.RETURN_VALUE); return callback(error, result); } else if (steps.done()) { const estimate = result.gasUsed; diff --git a/src/chains/ethereum/src/things/execution-error.ts b/src/chains/ethereum/src/things/runtime-error.ts similarity index 96% rename from src/chains/ethereum/src/things/execution-error.ts rename to src/chains/ethereum/src/things/runtime-error.ts index be20bb07c1..91f72e7e4f 100644 --- a/src/chains/ethereum/src/things/execution-error.ts +++ b/src/chains/ethereum/src/things/runtime-error.ts @@ -12,7 +12,7 @@ export enum RETURN_TYPES { RETURN_VALUE } -export default class ExecutionError extends CodedError { +export default class RuntimeError extends CodedError { public code: typeof ErrorCodes.INVALID_INPUT; public data: { hash: string, diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 75c8b76e48..20b13ab0f3 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -11,7 +11,7 @@ import TransactionReceipt from "./transaction-receipt"; import Common from "ethereumjs-common"; import { TransactionLog } from "./blocklogs"; import Address from "./address"; -import ExecutionError, { RETURN_TYPES } from "./execution-error"; +import RuntimeError, { RETURN_TYPES } from "./runtime-error"; type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; @@ -414,7 +414,7 @@ class Transaction extends (EthereumJsTransaction as any) { let status: Buffer; if (execException) { status = ZERO_BUFFER; - this.execException = new ExecutionError(this, result, RETURN_TYPES.TRANSACTION_HASH); + this.execException = new RuntimeError(this, result, RETURN_TYPES.TRANSACTION_HASH); } else { status = ONE_BUFFER; } @@ -438,7 +438,7 @@ class Transaction extends (EthereumJsTransaction as any) { return this.#logs; }; - public execException: ExecutionError = null; + public execException: RuntimeError = null; } export default Transaction; From 16e9ac1c8634c64ddfcdca8443c73dd2a94f9880 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 2 Sep 2020 17:36:26 -0400 Subject: [PATCH 500/691] change coinbase address to 0x0 and add coinbase flag/option --- .../ethereum/__tests__/api/eth/eth.test.ts | 2 +- .../__tests__/api/eth/subscribe.test.ts | 4 ++-- src/chains/ethereum/src/api.ts | 22 +++++++++++++++++-- src/chains/ethereum/src/blockchain.ts | 4 ++-- src/chains/ethereum/src/options.ts | 5 +++-- src/packages/options/src/options.ts | 22 +++++++++++++++++-- 6 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 5976053233..c46d41a2a5 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -19,7 +19,7 @@ describe("api", () => { describe("eth_coinbase", function() { it("should return correct address", async function() { const coinbase = await provider.send("eth_coinbase"); - assert.strictEqual(coinbase, accounts[0]); + assert.strictEqual(coinbase, "0x" + "0".repeat(40)); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index d000994365..3542aac9d4 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -58,9 +58,9 @@ describe("api", () => { "extraData": "0x", "gasLimit": gasLimit, "gasUsed": "0x0", - "hash": "0x477ac0f0a6b67f7a614384a052a0ad4d1bb99b79fccf9dbc7cce878758870503", + "hash": "0xf821422e084d82d550019e555b656b9113c9af45c4c03fad670caaa9b5d8acde", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "miner": accounts[0], + "miner": `0x${"0".repeat(40)}`, "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": Quantity.from(startingBlockNumber + 1).toString(), diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 8ed98bb7d8..e02919e17e 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -147,9 +147,26 @@ export default class EthereumApi implements types.Api { const {initialAccounts} = this.#wallet = new Wallet(opts); - const blockchainOptions = options as BlockchainOptions; + const blockchainOptions = options as any as BlockchainOptions; blockchainOptions.initialAccounts = initialAccounts; - blockchainOptions.coinbase = initialAccounts[0]; + + switch (typeof options.coinbase) { + case "number": + const account = blockchainOptions.initialAccounts[options.coinbase]; + if (account) { + blockchainOptions.coinbaseAddress = account.address; + } else { + throw new Error(`invalid coinbase address index: ${options.coinbase}`); + } + break; + case "string": + blockchainOptions.coinbaseAddress = Address.from(options.coinbase); + break; + default: { + throw new Error(`coinbase address must be string or number, received: ${options.coinbase}`); + } + } + this.#common = blockchainOptions.common = Common.forCustomChain( "mainnet", // TODO needs to match chain id { @@ -160,6 +177,7 @@ export default class EthereumApi implements types.Api { }, options.hardfork ); + const blockchain = (this.#blockchain = new Blockchain(blockchainOptions)); blockchain.on("start", () => { emitter.emit("connect"); diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index ff7f626824..f655b299c6 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -50,7 +50,7 @@ export type BlockchainOptions = { gasLimit?: Quantity; time?: Date; blockTime?: number; - coinbase: Account; + coinbaseAddress: Address; chainId: number; common: Common; legacyInstamine: boolean; @@ -129,7 +129,7 @@ export default class Blockchain extends Emittery.Typed; + | "coinbase" +>>; export default EthereumOptions; diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index 7bd4dad158..07dfdc4953 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -192,7 +192,23 @@ export interface Options { * * See: https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options */ - account_keys_path?: string | number + account_keys_path?: string | number; + + /** + * Sets the address where mining rewards will go. + * + * * `{string}` hex-encoded address + * * `{number}` index of the account returned by `eth_getAccounts` + * + * Defaults to `0x0000000000000000000000000000000000000000` + * + */ + coinbase?: string | number; + + /** + * Alias of `coinbase`. + */ + etherbase?: string | number; }; const getDefault: (options?: Options) => Options = options => { @@ -202,6 +218,7 @@ const getDefault: (options?: Options) => Options = options => { ).toString(); const chainId = options ? options.chainId || 1337 : 1337; const secure = options ? options.secure || options.locked || false : false; + const coinbase = options ? options.coinbase || options.etherbase || "0x0000000000000000000000000000000000000000" : "0x0000000000000000000000000000000000000000"; return Object.assign( { chainId, @@ -221,7 +238,8 @@ const getDefault: (options?: Options) => Options = options => { asyncRequestProcessing: true, hardfork: "muirGlacier", secure, - legacyInstamine: false + legacyInstamine: false, + coinbase }, options ); From c97da87f45a4c9fa3f1895d115c53dee93f435fa Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 3 Sep 2020 18:33:52 -0400 Subject: [PATCH 501/691] ensure bad revert reason strings don't crash ganache --- .../__tests__/api/eth/contracts/Reverts.sol | 17 ++++++ .../__tests__/api/eth/sendTransaction.test.ts | 54 +++++++++++++++++++ .../ethereum/src/things/runtime-error.ts | 11 +++- 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol create mode 100644 src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol b/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol new file mode 100644 index 0000000000..d4d0d47a69 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.6.1; + +contract Reverts { + + function invalidRevertReason() public pure { + assembly { + // revert reason code + mstore(0x80, 0x0000000000000000000000000000000000000000000000000000000008c379a0) + // invalid data + mstore(0xA0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0) + // trigger revert, returning the mstore values set above + revert(0x9C /* mem start */, 0x24 /* mem length */) + } + } +} diff --git a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts new file mode 100644 index 0000000000..824588e701 --- /dev/null +++ b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts @@ -0,0 +1,54 @@ +import assert from "assert"; +import getProvider from "../../helpers/getProvider"; +import compile from "../../helpers/compile"; +import { join } from "path"; +import EthereumProvider from "../../../src/provider"; + +describe("api", () => { + describe("eth", () => { + describe("sendTransaction", () => { + describe("contracts", () => { + describe("revert", () => { + + async function deployContract(provider: EthereumProvider, accounts: string[]) { + const contract = compile(join(__dirname, "./contracts/Reverts.sol")); + + const from = accounts[0]; + + await provider.send("eth_subscribe", ["newHeads"]); + + const transactionHash = await provider.send("eth_sendTransaction", [ + { + from, + data: contract.code, + gas: 3141592 + } + ]); + + await provider.once("message"); + + const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + assert.strictEqual(receipt.blockNumber, "0x1"); + + const contractAddress = receipt.contractAddress; + return { + contract, + contractAddress + }; + } + + it("doesn't crash on badly encoded revert string", async () => { + const provider = await getProvider(); + const accounts = await provider.send("eth_accounts"); + const {contract, contractAddress} = await deployContract(provider, accounts); + const contractMethods = contract.contract.evm.methodIdentifiers; + const value = await provider.send("eth_call", [ + {from: accounts[0], to: contractAddress, data: "0x" + contractMethods["invalidRevertReason()"]} + ]); + assert.strictEqual(value, "0x08c379a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0"); + }); + }); + }); + }); + }); +}); diff --git a/src/chains/ethereum/src/things/runtime-error.ts b/src/chains/ethereum/src/things/runtime-error.ts index 91f72e7e4f..6015bc5355 100644 --- a/src/chains/ethereum/src/things/runtime-error.ts +++ b/src/chains/ethereum/src/things/runtime-error.ts @@ -35,8 +35,15 @@ export default class RuntimeError extends CodedError { const hash = Data.from(transaction.hash(), 32).toString(); let reason: string | null; if (returnValue.length > 4 && REVERT_REASON.compare(returnValue, 0, 4) === 0) { - reason = rawDecode(["bytes"], returnValue.slice(4))[0].toString(); - message += " " + reason; + try { + // it is possible for the `returnValue` to be gibberish that can't be + // decoded. See: https://github.com/trufflesuite/ganache-core/pull/452 + reason = rawDecode(["bytes"], returnValue.slice(4))[0].toString(); + message += " " + reason; + } catch { + // ignore error since reason string recover is impossible + reason = null; + } } else { reason = null; } From 696ad30c329e4334ecc016506399b9f6d0d2cc0c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 3 Sep 2020 18:34:08 -0400 Subject: [PATCH 502/691] this should never have been committed --- test.js | 103 -------------------------------------------------------- 1 file changed, 103 deletions(-) delete mode 100644 test.js diff --git a/test.js b/test.js deleted file mode 100644 index 687ae7a10d..0000000000 --- a/test.js +++ /dev/null @@ -1,103 +0,0 @@ -const WebSocketClient = require("../ganache-core-copy/node_modules/websocket").client; -const client = new WebSocketClient(); -client.on("connect", (connection) => { - connection.send("null"); -}); -client.connect('ws://localhost:8546') - - - -// const map = new WeakMap() -// var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) { -// if (!privateMap.has(receiver)) { -// throw new TypeError("attempted to get private field on non-instance"); -// } -// return privateMap.get(receiver); -// }; - -// class Test { -// constructor(){ -// map.set(this, {a: 1, b: 1}); -// } -// test1() { -// const a = __classPrivateFieldGet(this, map).a; -// const b = __classPrivateFieldGet(this, map).b; -// __classPrivateFieldGet(this, map).a = a + b; -// __classPrivateFieldGet(this, map).b = a * b; -// return [a, b]; -// } - -// test2() { -// const options = __classPrivateFieldGet(this, map) -// const a = options.a; -// const b = options.b; -// options.a = a + b; -// options.b = a * b; -// return [a, b]; -// } -// } - -// const c = new Test(); - -// let start; - -// const l = 1e5; - -// let array = Array.from({length: 1000}, () => Math.round(Math.random() * 100)); - -// start = Date.now(); -// let r1; -// for (let i = 0; i < l; i++) { -// r1 = array.map((a)=>{return a+1}).filter(a=>a%2 === 0).map(a => a*2); -// } -// console.log("functional: ", Date.now() - start); - -// start = Date.now(); -// let r2; -// for (let i = 0; i < l; i++) { -// r2 = []; -// for(let j = 0, length = array.length; j < length; j++) { -// const step1 = array[j] + 1; -// if (step1 % 2 === 0) { -// r2.push(step1 * 2); -// } -// } -// } -// console.log("for: ", Date.now() - start); - - -// start = Date.now(); -// let r3 = []; -// let fn = a => { -// const step1 = a + 1; -// if (step1 % 2 === 0) { -// r3.push(step1 * 2); -// } -// } -// for (let i = 0; i < l; i++) { -// r3 = []; -// array.forEach(a => { -// const step1 = a + 1; -// if (step1 % 2 === 0) { -// r3.push(step1 * 2); -// } -// }); -// } -// console.log("foreach: ", Date.now() - start); - - -// start = Date.now(); -// let r4; -// let fn2 = a => { -// const step1 = a + 1; -// if (step1 % 2 === 0) { -// r4.push(step1 * 2); -// } -// } -// for (let i = 0; i < l; i++) { -// r4 = []; -// for(let j = 0, length = array.length; j < length; j++) { -// fn2(array[j]); -// } -// } -// console.log("for2: ", Date.now() - start); \ No newline at end of file From 4d19576f72f7250b7f848a6ea35de5c919d2b5ad Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 3 Sep 2020 18:34:15 -0400 Subject: [PATCH 503/691] remove qhitespace --- src/chains/ethereum/__tests__/api/eth/logs.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts index e099d2803e..2182e30247 100644 --- a/src/chains/ethereum/__tests__/api/eth/logs.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -161,7 +161,6 @@ describe("api", () => { const lastBlockNumber = `0x${(parseInt(blockNumber) + 1).toString(16)}`; await provider.once("message"); - // test variations of `earliest` and `0x0` await testGetLogs(genesisBlockNumber, genesisBlockNumber, 0); await testGetLogs("earliest", "earliest", 0); From 3f15c332969eb71b8d8c2fa2a7fe4ff6daee81ea Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 3 Sep 2020 18:34:27 -0400 Subject: [PATCH 504/691] set vmErrorsOnRPCResponse to false --- src/packages/options/src/options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/options.ts index 07dfdc4953..184f1468a7 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/options.ts @@ -227,7 +227,7 @@ const getDefault: (options?: Options) => Options = options => { default_balance_ether: 100n, total_accounts: 10n, networkId, - vmErrorsOnRPCResponse: true, + vmErrorsOnRPCResponse: false, hdPath: "m/44'/60'/0'/0/", allowUnlimitedContractSize: false, gasPrice: new Quantity(2000000000), From 9e8195449fdff393265d82b5f4cc64173dec793d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 3 Sep 2020 18:35:07 -0400 Subject: [PATCH 505/691] truthy checks ust look better --- src/chains/ethereum/src/blockchain.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index f655b299c6..6cc8e43773 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -103,7 +103,7 @@ export default class Blockchain extends Emittery.Typed 0."); } - if (this.#options.vmErrorsOnRPCResponse === true) { + if (options.vmErrorsOnRPCResponse) { console.warn("Setting vmErrorsOnRPCResponse to true has no effect when not instamining, i.e., blockTime > 0."); } } From eb3f718c9f6ae8d8505188f6f6de28ac9b69c9cf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 3 Sep 2020 18:35:42 -0400 Subject: [PATCH 506/691] Ensure bad revert strings don't cause errors --- .../__tests__/api/eth/sendTransaction.test.ts | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts index 824588e701..56c102fe7e 100644 --- a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts @@ -38,14 +38,28 @@ describe("api", () => { } it("doesn't crash on badly encoded revert string", async () => { - const provider = await getProvider(); - const accounts = await provider.send("eth_accounts"); - const {contract, contractAddress} = await deployContract(provider, accounts); - const contractMethods = contract.contract.evm.methodIdentifiers; - const value = await provider.send("eth_call", [ - {from: accounts[0], to: contractAddress, data: "0x" + contractMethods["invalidRevertReason()"]} - ]); - assert.strictEqual(value, "0x08c379a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0"); + async function test(opts) { + const provider = await getProvider(opts as any); + const accounts = await provider.send("eth_accounts"); + const {contract, contractAddress} = await deployContract(provider, accounts); + const contractMethods = contract.contract.evm.methodIdentifiers; + const prom = provider.send("eth_call", [ + {from: accounts[0], to: contractAddress, data: "0x" + contractMethods["invalidRevertReason()"]} + ]); + + const revertString = "0x08c379a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0" + if (opts.vmErrorsOnRPCResponse) { + const result = await prom.catch(e =>e); + assert.strictEqual(result.code, -32000, "Error code should be -32000"); + assert.strictEqual(result.data.reason, null, "The reason is undecodable, and thus should be null"); + assert.strictEqual(result.data.message, "revert", "The message should not have a reason string included"); + assert.strictEqual(result.data.result, revertString, "The revert reason should be encoded as hex"); + } else { + assert.strictEqual(await prom, revertString, "The revert reason should be encoded as hex"); + } + } + await test({vmErrorsOnRPCResponse: false}); + await test({vmErrorsOnRPCResponse: true}); }); }); }); From e33c31f50c42e226e26fa609ca6a83bf290cbda1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 4 Sep 2020 12:18:13 -0400 Subject: [PATCH 507/691] set currect "Common" for given chain id --- .../ethereum/__tests__/api/eth/sendRawTransaction.test.ts | 2 +- src/chains/ethereum/src/api.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts index 8df86b1b35..395dd2f49c 100644 --- a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts @@ -12,7 +12,7 @@ describe("api", () => { let provider: EthereumProvider; let accounts: string[]; const common = Common.forCustomChain( - "mainnet", // TODO needs to match chain id + "mainnet", { name: "ganache", chainId: 1337, diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index e02919e17e..c98278e7a2 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -31,6 +31,7 @@ const CLIENT_VERSION = `Ganache/v${version}`; const PROTOCOL_VERSION = Data.from("0x3f"); const RPCQUANTITY_ZERO = Quantity.from("0x0"); const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; +const KNOWN_CHAINIDS = new Set([1, 3, 4, 5, 42]); //#endregion //#region types @@ -168,7 +169,11 @@ export default class EthereumApi implements types.Api { } this.#common = blockchainOptions.common = Common.forCustomChain( - "mainnet", // TODO needs to match chain id + // if we were given a chain id that matches a real chain, use it + // NOTE: I don't think Common serves a purpose ther than instructing the + // VM what hardfork is in use. But just incase things change in the future + // its configured "more correctly" here. + KNOWN_CHAINIDS.has(options.chainId) ? options.chainId : 1, { name: "ganache", networkId: options.networkId, From c08aa5aa45a03055ac5235d2e1e0178a6cd5e13c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 4 Sep 2020 14:03:07 -0400 Subject: [PATCH 508/691] Update snapshot tests to implement TODOs --- .../ethereum/__tests__/api/evm/snapshot.test.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 7931b98a48..0ac1f86628 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -75,11 +75,10 @@ describe("api", function() { // Since transactions happen immediately, we can assert the balance. let balance = await send("eth_getBalance", [accounts[0]]); - balance = parseInt(balance); + balance = BigInt(balance); // Assert the starting balance is where we think it is, including tx costs. - // TODO: - // assert(balance > 98.9 && balance < 99); + assert(balance > 98900000000000000000 && balance < 99000000000000000000); startingBalance = balance; // Now checkpoint. @@ -100,18 +99,17 @@ describe("api", function() { await provider.once("message"); let balance = await send("eth_getBalance", [accounts[0]]); - balance = parseInt(balance); + balance = BigInt(balance); // Assert the starting balance is where we think it is, including tx costs. - // TODO: - // assert(balance > 97.9 && balance < 98); + assert(balance > 97900000000000000000n && balance < 98000000000000000000n); const status = await send("evm_revert", [snapshotId]); assert(status, "Snapshot should have returned true"); let revertedBalance = await send("eth_getBalance", [accounts[0]]); - revertedBalance = parseInt(revertedBalance); + revertedBalance = BigInt(revertedBalance); assert(revertedBalance === startingBalance, "Should have reverted back to the starting balance"); From 7d574328ed29909c1cae84f2fe49c2db577f71ca Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 4 Sep 2020 16:04:54 -0400 Subject: [PATCH 509/691] improve eth_call/eimulateTransaction beyond just a prototype impl --- src/chains/ethereum/src/api.ts | 48 ++++++++++++------ src/chains/ethereum/src/blockchain.ts | 71 ++++++++++++++++++++------- 2 files changed, 85 insertions(+), 34 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index c98278e7a2..5649831560 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1438,30 +1438,48 @@ export default class EthereumApi implements types.Api { const parentHeader = parentBlock.value.header; const options = this.#options; - // TODO: we need a copy of transaction since we are going to mutate it. - // copy it in a better way than this: - transaction = {...transaction}; - - if (transaction.gasLimit) { - transaction.gas = transaction.gasLimit; - } else { - if (transaction.gas) { - transaction.gasLimit = transaction.gas; + let gas: Quantity; + if (typeof transaction.gasLimit === "undefined") { + if (typeof transaction.gas === undefined){ + gas = Quantity.from(transaction.gas); } else { - // eth_call isn't subject to regular transaction gas limits - transaction.gas = transaction.gasLimit = options.callGasLimit.toString(); + // eth_call isn't subject to regular transaction gas limits by default + gas = options.callGasLimit; } } + else { + gas = Quantity.from(transaction.gasLimit) + } + + let data:Data; + if (typeof transaction.data === "undefined") { + if (typeof transaction.input === "undefined") { + data = Data.from(transaction.input); + } + } else { + data = Data.from(transaction.data); + } - const newBlock = blocks.createBlock({ + const block = blocks.createBlock({ number: parentHeader.number, timestamp: parentHeader.timestamp, parentHash: parentHeader.parentHash, coinbase: blockchain.coinbase.toBuffer(), - // gas estimates and eth_calls aren't subject to regular block gas limits - gasLimit: transaction.gas + gas }); - return blockchain.simulateTransaction(transaction, parentBlock, newBlock); + + const simulatedTransaction = { + gas, + // if we don't have a from address, our caller sut be the configured coinbase address + from: transaction.from == null ? blockchain.coinbase : Address.from(transaction.from), + to: transaction.to == null ? null : Address.from(transaction.to), + gasPrice: Quantity.from(transaction.gasPrice == null ? 0 : transaction.gasPrice), + value: transaction.value == null ? null : Quantity.from(transaction.value), + data, + block + }; + + return blockchain.simulateTransaction(simulatedTransaction, parentBlock); } //#endregion diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 6cc8e43773..0252529fff 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -26,6 +26,35 @@ import RejectionError from "./things/rejection-error"; import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; import { VmError, ERROR } from "ethereumjs-vm/dist/exceptions"; + +type SimulationTransaction = { + /** + * The address the transaction is sent from. + */ + from: Address, + /** + * The address the transaction is directed to. + */ + to?: Address, + /** + * Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. + */ + gas: Quantity, + /** + * Integer of the gasPrice used for each paid gas + */ + gasPrice: Quantity, + /** + * Integer of the value sent with this transaction + */ + value?: Quantity, + /** + * Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation + */ + data?: Data, + block: Block +} + const unref = utils.unref; export enum Status { @@ -532,33 +561,37 @@ export default class Blockchain extends Emittery.Typed= 0) { - tx.gasLimit = Quantity.from(gasLeft).toBuffer(); - - await promisify(stateManager.setStateRoot.bind(stateManager))( - parentBlock.value.header.stateRoot - ); + const data = transaction.data; + let gasLeft = transaction.gas.toBigInt(); + // subtract out the transaction's base fee from the gas limit before + // simulating the tx, because `runCall` doesn't account for raw gas costs. + gasLeft -= Transaction.calculateIntrinsicGas(data ? data.toBuffer() : null, options.hardfork as any); - result = await vm.runCall(tx); + if (gasLeft >= 0) { + const stateTrie = new CheckpointTrie(this.#database.trie, parentBlock.value.header.stateRoot); + const vm = this.createVmFromStateTrie(stateTrie, this.vm.allowUnlimitedContractSize); + vm.on("step", this.emit.bind(this, "step")); + + result = await vm.runCall({ + caller: transaction.from.toBuffer(), + data: transaction.data && transaction.data.toBuffer(), + gasPrice: transaction.gasPrice.toBuffer(), + gasLimit: Quantity.from(gasLeft).toBuffer(), + to: transaction.to && transaction.to.toBuffer(), + value: transaction.value && transaction.value.toBuffer(), + }); } else { result = {execResult: {exceptionError: new VmError(ERROR.OUT_OF_GAS), returnValue: Buffer.allocUnsafe(0)}} as any; } if (result.execResult.exceptionError) { if (this.#options.vmErrorsOnRPCResponse) { - throw new RuntimeError(tx, result, RETURN_TYPES.RETURN_VALUE); + // eth_call transactions don't really have a transaction hash + const hash = Buffer.allocUnsafe(0); + throw new RuntimeError(hash, result, RETURN_TYPES.RETURN_VALUE); } else { return Data.from(result.execResult.returnValue || "0x"); } From 3356f4427b92a3687da8da4dbe86d08557bbd31d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 4 Sep 2020 16:05:09 -0400 Subject: [PATCH 510/691] . --- src/chains/ethereum/src/things/transaction.ts | 55 +++++++++++-------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 20b13ab0f3..780ba9301a 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -246,39 +246,46 @@ class Transaction extends (EthereumJsTransaction as any) { /** * Compute the 'intrinsic gas' for a message with the given data. * @param data The transaction's data + * @param hardfork The hardfork use to determine gas costs */ - public calculateIntrinsicGas(): bigint { - const data = this.data; - + public static calculateIntrinsicGas(data: Buffer | null, hardfork: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier") { // Set the starting gas for the raw transaction let gas = params.TRANSACTION_GAS; - const TRANSACTION_DATA_NON_ZERO_GAS = params.TRANSACTION_DATA_NON_ZERO_GAS.get(this._common._hardfork); - const TRANSACTION_DATA_ZERO_GAS = params.TRANSACTION_DATA_ZERO_GAS - - // Bump the required gas by the amount of transactional data - const dataLength = data.byteLength; - if (dataLength > 0) { - // Zero and non-zero bytes are priced differently - let nonZeroBytes: bigint = 0n; - for (const b of data) { - if (b !== 0) { - nonZeroBytes++; + if (data) { + // Bump the required gas by the amount of transactional data + const dataLength = data.byteLength; + if (dataLength > 0) { + const TRANSACTION_DATA_NON_ZERO_GAS = params.TRANSACTION_DATA_NON_ZERO_GAS.get(hardfork); + const TRANSACTION_DATA_ZERO_GAS = params.TRANSACTION_DATA_ZERO_GAS + + // Zero and non-zero bytes are priced differently + let nonZeroBytes: bigint = 0n; + for (const b of data) { + if (b !== 0) { + nonZeroBytes++; + } } - } - // Make sure we don't exceed uint64 for all data combinations. - if ((MAX_UINT64 - gas) / TRANSACTION_DATA_NON_ZERO_GAS < nonZeroBytes) { - throw new Error(INTRINSIC_GAS_TOO_LOW); - } - gas += nonZeroBytes * TRANSACTION_DATA_NON_ZERO_GAS; + // Make sure we don't exceed uint64 for all data combinations. + if ((MAX_UINT64 - gas) / TRANSACTION_DATA_NON_ZERO_GAS < nonZeroBytes) { + throw new Error(INTRINSIC_GAS_TOO_LOW); + } + gas += nonZeroBytes * TRANSACTION_DATA_NON_ZERO_GAS; - const z = BigInt(dataLength) - nonZeroBytes; - if ((MAX_UINT64 - gas) / TRANSACTION_DATA_ZERO_GAS < z) { - throw new Error(INTRINSIC_GAS_TOO_LOW); + const z = BigInt(dataLength) - nonZeroBytes; + if ((MAX_UINT64 - gas) / TRANSACTION_DATA_ZERO_GAS < z) { + throw new Error(INTRINSIC_GAS_TOO_LOW); + } + gas += z * TRANSACTION_DATA_ZERO_GAS; } - gas += z * TRANSACTION_DATA_ZERO_GAS; } return gas; } + /** + * Compute the 'intrinsic gas' for a message with the given data. + */ + public calculateIntrinsicGas(): bigint { + return Transaction.calculateIntrinsicGas(this.data, this._common._hardfork) + } /** * Prepares arbitrary JSON data for use in a Transaction. From 306b17eca6d1efc8124ea7abb73b8668e590cc5c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 4 Sep 2020 16:06:03 -0400 Subject: [PATCH 511/691] . --- src/chains/ethereum/src/things/gas-estimator.ts | 2 +- src/chains/ethereum/src/things/runtime-error.ts | 4 ++-- src/chains/ethereum/src/things/transaction.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/things/gas-estimator.ts b/src/chains/ethereum/src/things/gas-estimator.ts index d1a378620d..410ffc7e98 100644 --- a/src/chains/ethereum/src/things/gas-estimator.ts +++ b/src/chains/ethereum/src/things/gas-estimator.ts @@ -221,7 +221,7 @@ const stepTracker = () => { if (vmerr) { return callback(vmerr); } else if (result.execResult.exceptionError) { - const error = new RuntimeError(runArgs.tx, result, RETURN_TYPES.RETURN_VALUE); + const error = new RuntimeError(runArgs.tx.hash(), result, RETURN_TYPES.RETURN_VALUE); return callback(error, result); } else if (steps.done()) { const estimate = result.gasUsed; diff --git a/src/chains/ethereum/src/things/runtime-error.ts b/src/chains/ethereum/src/things/runtime-error.ts index 6015bc5355..3ad39106e0 100644 --- a/src/chains/ethereum/src/things/runtime-error.ts +++ b/src/chains/ethereum/src/things/runtime-error.ts @@ -21,7 +21,7 @@ export default class RuntimeError extends CodedError { reason?: string, message: string } - constructor(transaction: Transaction, result: EVMResult, returnType: RETURN_TYPES) { + constructor(transactionHash: Buffer, result: EVMResult, returnType: RETURN_TYPES) { const execResult = result.execResult; const error = execResult.exceptionError.error; let message = VM_EXCEPTION + error; @@ -32,7 +32,7 @@ export default class RuntimeError extends CodedError { this.name = this.constructor.name; const returnValue = execResult.returnValue; - const hash = Data.from(transaction.hash(), 32).toString(); + const hash = `0x${transactionHash.toString("hex")}`; let reason: string | null; if (returnValue.length > 4 && REVERT_REASON.compare(returnValue, 0, 4) === 0) { try { diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 780ba9301a..d79241f7e3 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -421,7 +421,7 @@ class Transaction extends (EthereumJsTransaction as any) { let status: Buffer; if (execException) { status = ZERO_BUFFER; - this.execException = new RuntimeError(this, result, RETURN_TYPES.TRANSACTION_HASH); + this.execException = new RuntimeError(this.hash(), result, RETURN_TYPES.TRANSACTION_HASH); } else { status = ONE_BUFFER; } From 4293a05562f827409e5b77d3026ca6d91cb86485 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 4 Sep 2020 16:06:24 -0400 Subject: [PATCH 512/691] define some constants in a single place --- src/chains/ethereum/src/api.ts | 10 ++++------ src/chains/ethereum/src/things/blocklogs.ts | 6 +++--- src/chains/ethereum/src/things/transaction.ts | 7 +++---- src/chains/ethereum/src/wallet.ts | 3 +-- src/packages/utils/src/utils/constants.ts | 5 +++++ src/packages/utils/src/utils/index.ts | 3 ++- 6 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 src/packages/utils/src/utils/constants.ts diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 5649831560..ddb8371bc9 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -14,7 +14,7 @@ import { decode as rlpDecode } from "rlp"; const createKeccakHash = require("keccak"); // Read in the current ganache version from core's package.json import { version } from "../../../packages/core/package.json"; -import { PromiEvent } from "@ganache/utils"; +import { PromiEvent, utils } from "@ganache/utils"; import Emittery from "emittery"; import Common from "ethereumjs-common"; import BlockLogs from "./things/blocklogs"; @@ -25,11 +25,9 @@ import CodedError, { ErrorCodes } from "./things/coded-error"; //#endregion //#region Constants -const BUFFER_EMPTY = Buffer.allocUnsafe(0); -const BUFFER_ZERO = Buffer.from([0]); +const RPCQUANTITY_ZERO = utils.RPCQUANTITY_ZERO; const CLIENT_VERSION = `Ganache/v${version}`; const PROTOCOL_VERSION = Data.from("0x3f"); -const RPCQUANTITY_ZERO = Quantity.from("0x0"); const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; const KNOWN_CHAINIDS = new Set([1, 3, 4, 5, 42]); //#endregion @@ -1030,8 +1028,8 @@ export default class EthereumApi implements types.Api { tx.value = Buffer.from([0]); } - if (tx.to.equals(BUFFER_ZERO)) { - tx.to = BUFFER_EMPTY; + if (tx.to.equals(utils.BUFFER_ZERO)) { + tx.to = utils.BUFFER_EMPTY; } if (isUnlockedAccount) { diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index b1501e929d..a4adf85abc 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -1,8 +1,8 @@ import { encode as rlpEncode, decode as rlpDecode } from "rlp"; import { Data, Quantity } from "@ganache/utils"; import Address from "./address"; +import {utils} from "@ganache/utils"; -const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); export type TransactionLog = [address: Buffer, topics: Buffer[], data: Buffer|Buffer[]] export type BlockLog = [removed: Buffer, transactionIndex: Buffer, transactionHash: Buffer, address: TransactionLog[0], topics: TransactionLog[1], data: TransactionLog[2]]; @@ -68,7 +68,7 @@ export default class BlockLogs { */ public append(/*removed: boolean, */transactionIndex: Buffer, transactionHash: Buffer, log: TransactionLog) { this[_raw][1].push([ - BUFFER_ZERO, // `removed`, TODO: this is used for uncles, but we don't support them yet + utils.BUFFER_ZERO, // `removed`, TODO: this is used for uncles, but we don't support them yet transactionIndex, // transactionIndex transactionHash, // transactionHash log[0], // `address` @@ -134,7 +134,7 @@ export default class BlockLogs { blockNumber, data: Array.isArray(data) ? data.map(d => Data.from(d, d.length)) : Data.from(data, data.length), logIndex, // this is the index in the *block* - removed: log[0].equals(BUFFER_ZERO) ? false : true, + removed: log[0].equals(utils.BUFFER_ZERO) ? false : true, topics: Array.isArray(topics) ? topics.map(t => Data.from(t, 32)) : Data.from(topics, 32), transactionHash: Data.from(log[2], 32), transactionIndex: Quantity.from(log[1]) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index d79241f7e3..6644c08475 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -1,5 +1,5 @@ import {INTRINSIC_GAS_TOO_LOW} from "./errors"; -import {Data, Quantity} from "@ganache/utils"; +import {utils, Data, Quantity} from "@ganache/utils"; import params from "./params"; import {Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction} from "ethereumjs-tx"; import * as ethUtil from "ethereumjs-util"; @@ -31,7 +31,6 @@ const fakeHash = function (this: Transaction) { } return EthereumJsFakeTransaction.prototype.hash.apply(this, arguments as unknown as [(boolean | undefined)?]); }; -const BUFFER_ZERO = Buffer.from([0]); function configZeroableField(tx: any, fieldName: string, fieldLength = 32) { const index = tx._fields.indexOf(fieldName); @@ -299,7 +298,7 @@ class Transaction extends (EthereumJsTransaction as any) { // Remove all padding and make it easily comparible. const buf = Data.from(json.to).toBuffer(); - if (buf.equals(BUFFER_ZERO)) { + if (buf.equals(utils.BUFFER_ZERO)) { // if the address is 0x0 make it 0x0{20} toAccount = Buffer.allocUnsafe(20).fill(0); } else { @@ -368,7 +367,7 @@ class Transaction extends (EthereumJsTransaction as any) { validateNonce(expectedNonce: any) { let nonce; if (this.isSigned() && this.nonce.length === 0) { - nonce = BUFFER_ZERO; + nonce = utils.BUFFER_ZERO; } else { nonce = this.nonce; } diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index f514e43610..3e994c218f 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -21,7 +21,6 @@ const SCRYPT_PARAMS = { } as const; const CIPHER = "aes-128-ctr"; const WEI = 1000000000000000000n; -const RPCQUANTITY_ZERO = Quantity.from("0x0"); type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; type LastType]> = T extends [...infer _A, infer L] ? L : never; @@ -305,7 +304,7 @@ export default class Wallet { const acct = HDKey.fromMasterSeed(seed); const address = uncompressedPublicKeyToAddress(acct.publicKey); const privateKey = Data.from(acct.privateKey); - return Wallet.createAccount(RPCQUANTITY_ZERO, privateKey, address); + return Wallet.createAccount(utils.RPCQUANTITY_ZERO, privateKey, address); } public async unlockAccount(lowerAddress: string, passphrase: string, duration: number) { diff --git a/src/packages/utils/src/utils/constants.ts b/src/packages/utils/src/utils/constants.ts new file mode 100644 index 0000000000..d91ee228df --- /dev/null +++ b/src/packages/utils/src/utils/constants.ts @@ -0,0 +1,5 @@ +import { Quantity } from "../things/json-rpc/json-rpc-quantity"; + +export const BUFFER_EMPTY = Buffer.allocUnsafe(0); +export const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); +export const RPCQUANTITY_ZERO = Quantity.from("0x0"); \ No newline at end of file diff --git a/src/packages/utils/src/utils/index.ts b/src/packages/utils/src/utils/index.ts index 14e2b4a554..2708c61f72 100644 --- a/src/packages/utils/src/utils/index.ts +++ b/src/packages/utils/src/utils/index.ts @@ -3,4 +3,5 @@ export * from "./executor"; export * from "./heap"; export * from "./request-coordinator"; export * from "./unref"; -export * from "./uint-to-buffer" \ No newline at end of file +export * from "./uint-to-buffer"; +export * from "./constants"; From 6de9da927c6fa18a583ef3d17c8df1836236aeb8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 8 Sep 2020 16:53:39 -0400 Subject: [PATCH 513/691] add and use an account-zero alias --- src/chains/ethereum/src/things/transaction.ts | 2 +- src/packages/utils/src/utils/constants.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 6644c08475..60512c1515 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -300,7 +300,7 @@ class Transaction extends (EthereumJsTransaction as any) { if (buf.equals(utils.BUFFER_ZERO)) { // if the address is 0x0 make it 0x0{20} - toAccount = Buffer.allocUnsafe(20).fill(0); + toAccount = utils.ACCOUNT_ZERO; } else { toAccount = buf; } diff --git a/src/packages/utils/src/utils/constants.ts b/src/packages/utils/src/utils/constants.ts index d91ee228df..9077f5c10e 100644 --- a/src/packages/utils/src/utils/constants.ts +++ b/src/packages/utils/src/utils/constants.ts @@ -1,5 +1,6 @@ import { Quantity } from "../things/json-rpc/json-rpc-quantity"; +export const ACCOUNT_ZERO = Buffer.allocUnsafe(20).fill(0); export const BUFFER_EMPTY = Buffer.allocUnsafe(0); export const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); export const RPCQUANTITY_ZERO = Quantity.from("0x0"); \ No newline at end of file From 96eefad67ba71645fbc23683e47c30a6e06c4c70 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 8 Sep 2020 18:03:54 -0400 Subject: [PATCH 514/691] add clarification to some log warnings --- src/chains/ethereum/src/blockchain.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 0252529fff..742ce4c43d 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -129,11 +129,11 @@ export default class Blockchain extends Emittery.Typed 0."); + console.warn("Setting `legacyInstamine` to `true` has no effect when blockTime is 0 (default)"); } if (options.vmErrorsOnRPCResponse) { - console.warn("Setting vmErrorsOnRPCResponse to true has no effect when not instamining, i.e., blockTime > 0."); + console.warn("Setting `vmErrorsOnRPCResponse` to `true` has no effect on transactions when blockTime is 0 (default)"); } } } From bd1fcce118b7eda77a22aafac0becaa71f05ec0d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 18 Sep 2020 20:33:05 -0400 Subject: [PATCH 515/691] add options helper types --- .../ethereum/src/options/helpers/base.ts | 18 +++ .../src/options/helpers/definition.ts | 23 +++ .../ethereum/src/options/helpers/exclusive.ts | 149 ++++++++++++++++++ .../ethereum/src/options/helpers/getters.ts | 38 +++++ .../ethereum/src/options/helpers/index.ts | 3 + 5 files changed, 231 insertions(+) create mode 100644 src/chains/ethereum/src/options/helpers/base.ts create mode 100644 src/chains/ethereum/src/options/helpers/definition.ts create mode 100644 src/chains/ethereum/src/options/helpers/exclusive.ts create mode 100644 src/chains/ethereum/src/options/helpers/getters.ts create mode 100644 src/chains/ethereum/src/options/helpers/index.ts diff --git a/src/chains/ethereum/src/options/helpers/base.ts b/src/chains/ethereum/src/options/helpers/base.ts new file mode 100644 index 0000000000..790946fcce --- /dev/null +++ b/src/chains/ethereum/src/options/helpers/base.ts @@ -0,0 +1,18 @@ +export namespace Base { + export type Option = { + rawType?: any; + type: any; + hasDefault?: true; + } + + export type ExclusiveGroupOptionName = string; + export type ExclusiveGroup = ExclusiveGroupOptionName[]; + + export type Config = { + options: { + [optionName: string]: Option; + }; + + exclusiveGroups: ExclusiveGroup[]; + } +} diff --git a/src/chains/ethereum/src/options/helpers/definition.ts b/src/chains/ethereum/src/options/helpers/definition.ts new file mode 100644 index 0000000000..0d5b2625a1 --- /dev/null +++ b/src/chains/ethereum/src/options/helpers/definition.ts @@ -0,0 +1,23 @@ +import {Base} from "./base"; +import { OptionHasDefault, OptionName, OptionRawType, OptionType } from "./getters"; + +//#region Definition helpers +type Normalize< + C extends Base.Config, + N extends OptionName = OptionName +> = (rawInput: OptionRawType) => OptionType; + +type InternalConfig< + C extends Base.Config, +> = {[N in OptionName]: OptionRawType}; + +export type Definitions = { + [N in OptionName]: { + normalize?: Normalize; + } & ( + void extends OptionHasDefault + ? {} + : { default: (config: InternalConfig) => OptionRawType } + ); +} +//#endregion Definition helpers \ No newline at end of file diff --git a/src/chains/ethereum/src/options/helpers/exclusive.ts b/src/chains/ethereum/src/options/helpers/exclusive.ts new file mode 100644 index 0000000000..099fcdd182 --- /dev/null +++ b/src/chains/ethereum/src/options/helpers/exclusive.ts @@ -0,0 +1,149 @@ +import {Base} from "./base"; +import {OptionName, Option, ExclusiveGroupIndex, ExclusiveGroups, Options, OptionType} from "./getters"; + + +//#region options not part of exclusive groups +export type UnconstrainedOptions = Omit, ExclusiveGroupOptionName>; +export type UnconstrainedOptionRawTypes = {[N in UnconstrainedOptionName]: OptionType}; +export type UnconstrainedOptionName = string & keyof UnconstrainedOptions; +//#endregion options not part of exclusive groups + + +//#region exclusive group options helpers +type ExclusiveGroupOptionPairs< + C extends Base.Config, + G extends unknown[] +> = + G extends [] + ? [] + : G extends [infer N, ...infer R] + ? [ + [N, ExclusiveGroupOptionNameOption], + ...ExclusiveGroupOptionPairs + ] + : never; + +type ExclusiveGroupOptionNameOption< + C extends Base.Config, + N +> = + N extends OptionName + ? Option + : never; + +type PairsToMapping = + T extends [] + ? {} + : T extends [[infer N, infer O], ...infer R] + ? { + [N_ in string & N]: O; + } & PairsToMapping + : never; + +type RequireOnly = Pick & Partial> + +type ExclusiveGroupOptionalUnionByName, M extends OptionName> = +{ + [K in keyof RequireOnly, M>] : K extends M ? OptionType + : never +} + +type Combine> = { + [N in keyof GRP]: + GRP[N] extends OptionName + ? { + [ + Key in keyof ( + & ExclusiveGroupOptionalUnionByName + & UnconstrainedOptionRawTypes + & O + ) + ]: Key extends keyof ExclusiveGroupOptionalUnionByName + ? ExclusiveGroupOptionalUnionByName[Key] + : Key extends keyof UnconstrainedOptionRawTypes + ? UnconstrainedOptionRawTypes[Key] + : Key extends keyof O + ? O[Key] + : never; + + } + : never; + } extends {[n:number]: infer I} ? I : never; + + +export type ExclusiveGroupUnionAndUnconstrainedPlus = ExclusiveGroups, O extends unknown[] = []> = ( + GRPS extends [infer GRP, ...infer Rest] + ? GRP extends ExclusiveGroup + ? Rest extends any[] + ? O extends [] + // first time through + ? ExclusiveGroupUnionAndUnconstrainedPlus>> + // recurse + : ExclusiveGroupUnionAndUnconstrainedPlus makes it include only the indexes, but TypeScript will treat it as an object now, so we `UnionToTuple` + // to turn it back into a Tuple + [OK in keyof Omit]: Combine + } extends {[n:number]: infer I} ? I : never>> + : never + : never + : O extends {[n:number]: infer I} ? I : never +) + +//#region UnionToTuple +type TuplePrepend = +[NewElement, ...Tuple] + +type Consumer = (value: Value) => void; + +type IntersectionFromUnion = +(Union extends unknown ? Consumer : never) extends (Consumer) +? ResultIntersection +: never; + +type OverloadedConsumerFromUnion = IntersectionFromUnion : never>; + +type UnionLast = OverloadedConsumerFromUnion extends ((a: infer A) => void) ? A : never; + +type UnionExcludingLast = Exclude>; + +type TupleFromUnionRec = +[RemainingUnion] extends [never] +? CurrentTuple +: TupleFromUnionRec, TuplePrepend>>; + +export type UnionToTuple = TupleFromUnionRec; +//#endregion + +//#endregion exclusive group options helpers + + + +//#region exclusive groups +type ExclusiveGroup< + C extends Base.Config, + K extends ExclusiveGroupIndex = ExclusiveGroupIndex +> = ExclusiveGroups[K]; + +type ExclusiveGroupOptionName< + C extends Base.Config, + K extends ExclusiveGroupIndex = ExclusiveGroupIndex +> = Extract, DeepTupleToUnion>>; + +type DeepTupleToUnion = + T extends [] // empty tuple case (base case) + ? never + : T extends [infer N, ...infer R] // inductive case + ? N extends unknown[] + ? DeepTupleToUnion | DeepTupleToUnion + : N | DeepTupleToUnion + : never; // we should never hit this case +//#endregion exclusive groups + + +//#region options separated by exclusive group +type ExclusiveGroupOptionsByGroup< + C extends Base.Config, + G extends ExclusiveGroup +> = PairsToMapping>; +//#endregion diff --git a/src/chains/ethereum/src/options/helpers/getters.ts b/src/chains/ethereum/src/options/helpers/getters.ts new file mode 100644 index 0000000000..7bc574075b --- /dev/null +++ b/src/chains/ethereum/src/options/helpers/getters.ts @@ -0,0 +1,38 @@ +import {Base} from "./base"; + +//#region getters for buckets +export type Options = C["options"]; +export type ExclusiveGroups = C["exclusiveGroups"]; +//#endregion + + +//#region getters for keys +export type OptionName = string & keyof Options; +export type ExclusiveGroupIndex = number & keyof ExclusiveGroups; +//#endregion + + +//#region getters for individual things +export type Option< + C extends Base.Config, + N extends OptionName = OptionName +> = Options[N]; +//#endregion + + +//#region getters for option +export type OptionRawType< + C extends Base.Config, + N extends OptionName = OptionName +> = void extends Option["rawType"] ? Option["type"] : Option["rawType"]; + +export type OptionType< + C extends Base.Config, + N extends OptionName = OptionName +> = Option["type"]; + +export type OptionHasDefault< + C extends Base.Config, + N extends OptionName = OptionName +> = Option["hasDefault"]; +//#endregion getters for option diff --git a/src/chains/ethereum/src/options/helpers/index.ts b/src/chains/ethereum/src/options/helpers/index.ts new file mode 100644 index 0000000000..bd9618feb7 --- /dev/null +++ b/src/chains/ethereum/src/options/helpers/index.ts @@ -0,0 +1,3 @@ +export * from "./base"; +export * from "./exclusive"; +export * from "./definition"; From 2641bb668fe2019b1aa401e60735d8f24c3f10ad Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 18 Sep 2020 20:59:41 -0400 Subject: [PATCH 516/691] port miner-options to new options config types --- .../ethereum/src/options/miner-options.ts | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/chains/ethereum/src/options/miner-options.ts diff --git a/src/chains/ethereum/src/options/miner-options.ts b/src/chains/ethereum/src/options/miner-options.ts new file mode 100644 index 0000000000..4e5fca9998 --- /dev/null +++ b/src/chains/ethereum/src/options/miner-options.ts @@ -0,0 +1,91 @@ +import { Quantity, utils } from "@ganache/utils"; +import { Definitions, ExclusiveGroupUnionAndUnconstrainedPlus } from "./helpers"; +import Address from "../things/address"; + +type MinerConfig = { + options: { + readonly blockTime: { + type: number; + hasDefault: true; + } + readonly gasPrice: { + type: Quantity; + rawType: string | number | bigint; + hasDefault: true; + } + readonly blockGasLimit: { + type: Quantity; + rawType: string | number | bigint; + hasDefault: true; + } + readonly transactionGasLimit: { + type: Quantity; + rawType: string | number | bigint; + hasDefault: true; + } + readonly callGasLimit: { + type: Quantity; + rawType: string | number | bigint; + hasDefault: true; + } + readonly legacyInstamine: { + type: boolean; + hasDefault: true; + } + readonly coinbase: { + rawType: string; + type: Address; + hasDefault: true; + } + }, + exclusiveGroups: [ + ["blockTime", "legacyInstamine"] + ] +} + +export const MinerOptions: Definitions = { + blockTime: { + normalize(rawInput) { + return rawInput; + }, + default: () => 0 + }, + gasPrice: { + normalize(rawInput) { + return Quantity.from(rawInput); + }, + default: () => Quantity.from(2_000_000_000) + }, + blockGasLimit: { + normalize(rawInput) { + return Quantity.from(rawInput); + }, + default: () => Quantity.from(12_000_000) + }, + transactionGasLimit: { + normalize(rawInput) { + return Quantity.from(rawInput); + }, + default: () => Quantity.from(90000) + }, + callGasLimit: { + normalize(rawInput) { + return Quantity.from(rawInput); + }, + default: () => Quantity.from(Number.MAX_SAFE_INTEGER), + }, + coinbase: { + normalize(rawInput) { + return Address.from(rawInput); + }, + default: () => Address.from(utils.ACCOUNT_ZERO) + }, + legacyInstamine: { + normalize(rawInput) { + return rawInput; + }, + default: () => false + } +} + +export type InternalMinerOptions = ExclusiveGroupUnionAndUnconstrainedPlus From 19d91951831c9e0e76d5f0a0c3fb232d3b435373 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 18 Sep 2020 21:01:00 -0400 Subject: [PATCH 517/691] blockTime and legacyInstamine are actually required pairs --- src/chains/ethereum/src/options/miner-options.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/options/miner-options.ts b/src/chains/ethereum/src/options/miner-options.ts index 4e5fca9998..59eb5e7b79 100644 --- a/src/chains/ethereum/src/options/miner-options.ts +++ b/src/chains/ethereum/src/options/miner-options.ts @@ -38,9 +38,7 @@ type MinerConfig = { hasDefault: true; } }, - exclusiveGroups: [ - ["blockTime", "legacyInstamine"] - ] + exclusiveGroups: [] } export const MinerOptions: Definitions = { From c2a46c3852b73a4a44d95cf43103228783e84a65 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 22 Sep 2020 12:16:43 -0400 Subject: [PATCH 518/691] expose a `hasOwn` helper in utils --- src/packages/utils/src/utils/has-own.ts | 16 ++++++++++++++++ src/packages/utils/src/utils/index.ts | 1 + 2 files changed, 17 insertions(+) create mode 100644 src/packages/utils/src/utils/has-own.ts diff --git a/src/packages/utils/src/utils/has-own.ts b/src/packages/utils/src/utils/has-own.ts new file mode 100644 index 0000000000..60b46e6097 --- /dev/null +++ b/src/packages/utils/src/utils/has-own.ts @@ -0,0 +1,16 @@ +/** + * /** + * Determines whether an object has a property with the specified name. + * + * Safe for use on user-supplied data. + * + * @param obj The object that will be checked. + * @param v A property name. + * @returns `true` if the object has a property with the specified name, + * otherwise false. + */ +export const hasOwn: < + X extends unknown, + Y extends string | number | symbol +>(obj: X, prop: Y) => obj is X extends Record ? X & Required> : never + = ({}).hasOwnProperty.call.bind(({}).hasOwnProperty) as any; \ No newline at end of file diff --git a/src/packages/utils/src/utils/index.ts b/src/packages/utils/src/utils/index.ts index 2708c61f72..e2ab466a84 100644 --- a/src/packages/utils/src/utils/index.ts +++ b/src/packages/utils/src/utils/index.ts @@ -3,5 +3,6 @@ export * from "./executor"; export * from "./heap"; export * from "./request-coordinator"; export * from "./unref"; +export * from "./has-own"; export * from "./uint-to-buffer"; export * from "./constants"; From b027750003ef9756f9cb874a2f313f70a789c138 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 22 Sep 2020 12:17:03 -0400 Subject: [PATCH 519/691] use new hasOwn in executor --- src/packages/utils/src/utils/executor.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index 5a95807772..ba286dafd7 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -1,8 +1,7 @@ +import { hasOwn } from "./has-own"; import { KnownKeys, Api } from "../types"; import {RequestCoordinator} from "./request-coordinator"; -const hasOwn = ({}).hasOwnProperty.call.bind(({}).hasOwnProperty); - export class Executor { #requestCoordinator: RequestCoordinator From 73c92d72c5715646b0a0d53011a837d358fcf19f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 22 Sep 2020 12:17:26 -0400 Subject: [PATCH 520/691] add WEI as bigint to utils constants --- src/packages/utils/src/utils/constants.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packages/utils/src/utils/constants.ts b/src/packages/utils/src/utils/constants.ts index 9077f5c10e..0ab1299c77 100644 --- a/src/packages/utils/src/utils/constants.ts +++ b/src/packages/utils/src/utils/constants.ts @@ -3,4 +3,5 @@ import { Quantity } from "../things/json-rpc/json-rpc-quantity"; export const ACCOUNT_ZERO = Buffer.allocUnsafe(20).fill(0); export const BUFFER_EMPTY = Buffer.allocUnsafe(0); export const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); -export const RPCQUANTITY_ZERO = Quantity.from("0x0"); \ No newline at end of file +export const RPCQUANTITY_ZERO = Quantity.from("0x0"); +export const WEI = 1000000000000000000n as const; \ No newline at end of file From 9ec4bd929a4fd1653e1504150ec7cdc9332ce7d0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 22 Sep 2020 12:18:17 -0400 Subject: [PATCH 521/691] make Manager more type-safe --- src/chains/ethereum/src/components/manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/components/manager.ts b/src/chains/ethereum/src/components/manager.ts index 5cde262750..c8c5ba4989 100644 --- a/src/chains/ethereum/src/components/manager.ts +++ b/src/chains/ethereum/src/components/manager.ts @@ -9,7 +9,7 @@ export default class Manager { #Type: Instantiable; #options: {}; protected base: LevelUp; - constructor(base: LevelUp, type: Instantiable, options?: {}) { + constructor(base: LevelUp, type: Instantiable, options?: ConstructorParameters>[1]) { this.#Type = type; this.#options = options; this.base = base; From 329a671736336fea5875762b95960665c758b212 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 22 Sep 2020 12:18:58 -0400 Subject: [PATCH 522/691] update emittery --- package.json | 3 +-- .../{emittery+0.6.0.patch => emittery+0.7.1.patch} | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) rename patches/{emittery+0.6.0.patch => emittery+0.7.1.patch} (73%) diff --git a/package.json b/package.json index c6c59a2c62..5c6dafb8d8 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,7 @@ }, "dependencies": { "bip39": "3.0.2", - "bn.js": "5.1.2", - "emittery": "0.6.0", + "emittery": "0.7.1", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.2", "ethereumjs-common": "1.5.1", diff --git a/patches/emittery+0.6.0.patch b/patches/emittery+0.7.1.patch similarity index 73% rename from patches/emittery+0.6.0.patch rename to patches/emittery+0.7.1.patch index 19a174098c..d9dedf8d5f 100644 --- a/patches/emittery+0.6.0.patch +++ b/patches/emittery+0.7.1.patch @@ -1,25 +1,25 @@ diff --git a/node_modules/emittery/index.d.ts b/node_modules/emittery/index.d.ts -index d386ddb..f76ed70 100644 +index 690f3c7..bca8679 100644 --- a/node_modules/emittery/index.d.ts +++ b/node_modules/emittery/index.d.ts -@@ -77,6 +77,8 @@ declare class Emittery { +@@ -82,6 +82,8 @@ declare class Emittery { */ static readonly listenerRemoved: unique symbol; + init(){} + /** - Subscribe to an event. + Subscribe to one or more events. diff --git a/node_modules/emittery/index.js b/node_modules/emittery/index.js -index 5ddd3db..9a68c72 100644 +index d3f9bb3..e81e7a5 100644 --- a/node_modules/emittery/index.js +++ b/node_modules/emittery/index.js -@@ -182,6 +182,10 @@ class Emittery { +@@ -190,6 +190,10 @@ class Emittery { } constructor() { -+ this.init(); ++ this.init(); + } + + init() { From 22f8ee8c2d4b3669f173b633a7deba1c0206747a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 22 Sep 2020 12:19:20 -0400 Subject: [PATCH 523/691] update max tested node version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5c6dafb8d8..4a364a3fe6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "root", "private": true, "engines": { - "node": ">=10.7.0 <=14.5.0", + "node": ">=10.7.0 <=14.11.0", "npm": ">=6.1.0" }, "scripts": { From 0f497c3584569c3fb801423d5f74caa7295ac11c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 22 Sep 2020 12:25:53 -0400 Subject: [PATCH 524/691] add stricter typing for `assertArgLength` --- src/chains/ethereum/src/api.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index ddb8371bc9..5fbd7d0b97 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -111,16 +111,18 @@ function assertExceptionalTransactions(transactions: Transaction[]) { } } +type UnknownFn = (this: unknown, ...args: unknown[]) => unknown; +type FunctionPropertyDescriptor = TypedPropertyDescriptor; function assertArgLength(min: number, max: number = min) { - return function(_target, _name, descriptor) { + return function(_target: any, _propertyKey: any, descriptor: FunctionPropertyDescriptor) { const original = descriptor.value; - descriptor.value = function() { + descriptor.value = function(this: any) { const length = arguments.length; if (length < min || length > max) throw new Error("Incorrect number of arguments."); return Reflect.apply(original, this, arguments); - }; - return descriptor; - }; + } as any; + return descriptor as TypedPropertyDescriptor; + } as MethodDecorator; } export default class EthereumApi implements types.Api { From 466cad6f88ef06bb07dde59c34ce12ad130cda0a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 22 Sep 2020 12:29:43 -0400 Subject: [PATCH 525/691] use hasOwn helper in provider --- src/chains/ethereum/src/provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index d467d6f9f7..d667112676 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -18,7 +18,7 @@ type RequestParams = { readonly params: Parameters | undefined }; -const hasOwn = ({}).hasOwnProperty.call.bind(({}).hasOwnProperty); +const hasOwn = utils.hasOwn; export default class EthereumProvider extends Emittery.Typed<{message: any}, "connect" | "disconnect"> implements types.Provider From 599d86a82eaab8d5a0d35e6b6053ac29ea54ca43 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 22 Sep 2020 12:30:02 -0400 Subject: [PATCH 526/691] use WEI constant in wallet --- src/chains/ethereum/src/wallet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 3e994c218f..314252e6f6 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -20,7 +20,7 @@ const SCRYPT_PARAMS = { r: 1 } as const; const CIPHER = "aes-128-ctr"; -const WEI = 1000000000000000000n; +const WEI = utils.WEI; type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; type LastType]> = T extends [...infer _A, infer L] ? L : never; From 71d18f2a3897e058e0a8842d5ce29d6726753ccc Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 23 Sep 2020 21:23:26 -0400 Subject: [PATCH 527/691] options rewrite (WIP) --- npm-shrinkwrap.json | 2809 +++++++---------- package.json | 2 +- .../ethereum/__tests__/api/eth/eth.test.ts | 6 +- .../__tests__/api/eth/getCode.test.ts | 2 +- .../__tests__/api/eth/getStorageAt.test.ts | 2 +- .../api/eth/legacyInstamining.test.ts | 6 +- .../api/eth/sendRawTransaction.test.ts | 6 +- .../__tests__/api/eth/sendTransaction.test.ts | 11 +- .../ethereum/__tests__/api/eth/sign.test.ts | 4 +- .../__tests__/api/eth/signTypedData.test.ts | 4 +- .../__tests__/api/eth/subscribe.test.ts | 12 +- .../ethereum/__tests__/api/evm/evm.test.ts | 6 +- .../__tests__/api/evm/snapshot.test.ts | 2 +- .../__tests__/api/miner/miner.test.ts | 2 +- .../__tests__/api/personal/personal.test.ts | 16 +- .../ethereum/__tests__/helpers/getProvider.ts | 37 +- .../ethereum/__tests__/provider.test.ts | 12 +- .../ethereum/__tests__/temp-tests.test.ts | 45 +- src/chains/ethereum/src/api.ts | 160 +- src/chains/ethereum/src/blockchain.ts | 82 +- .../ethereum/src/components/block-manager.ts | 35 +- .../src/components/transaction-manager.ts | 13 +- .../src/components/transaction-pool.ts | 63 +- src/chains/ethereum/src/database.ts | 19 +- src/chains/ethereum/src/index.ts | 15 +- src/chains/ethereum/src/miner.ts | 23 +- src/chains/ethereum/src/options.ts | 28 - .../ethereum/src/options/chain-options.ts | 107 + .../ethereum/src/options/database-options.ts | 33 + src/chains/ethereum/src/options/index.ts | 36 + .../ethereum/src/options/logging-options.ts | 64 + .../ethereum/src/options/miner-options.ts | 109 +- .../ethereum/src/options/wallet-options.ts | 160 + src/chains/ethereum/src/provider.ts | 22 +- src/chains/ethereum/src/things/transaction.ts | 6 +- .../ethereum/src/types/tuple-from-union.ts | 22 + src/chains/ethereum/src/wallet.ts | 27 +- src/chains/tezos/src/index.ts | 5 +- src/chains/tezos/src/provider.ts | 3 +- src/packages/core/__tests__/connector.test.ts | 14 +- src/packages/core/__tests__/server.test.ts | 64 +- src/packages/core/src/connector.ts | 14 +- src/packages/core/src/index.ts | 3 +- src/packages/core/src/options/index.ts | 27 + .../core/src/options/server-options.ts | 75 +- src/packages/core/src/server.ts | 19 +- src/packages/core/src/servers/ws-server.ts | 16 +- src/packages/flavors/src/index.ts | 34 +- .../options/src}/helpers/base.ts | 0 src/packages/options/src/helpers/create.ts | 79 + .../options/src}/helpers/definition.ts | 14 +- .../options/src}/helpers/exclusive.ts | 55 +- .../options/src}/helpers/getters.ts | 0 .../options/src}/helpers/index.ts | 1 + src/packages/options/src/index.ts | 5 +- .../src/{options.ts => old/options.ts.old} | 83 +- .../provider-options.ts.old} | 0 .../options/src/provider-options.ts.old | 3 + .../things/json-rpc/json-rpc-base-types.ts | 9 +- .../src/things/json-rpc/json-rpc-data.ts | 21 +- .../src/things/json-rpc/json-rpc-quantity.ts | 25 +- src/packages/utils/src/things/jsonrpc.ts | 2 +- 62 files changed, 2376 insertions(+), 2203 deletions(-) delete mode 100644 src/chains/ethereum/src/options.ts create mode 100644 src/chains/ethereum/src/options/chain-options.ts create mode 100644 src/chains/ethereum/src/options/database-options.ts create mode 100644 src/chains/ethereum/src/options/index.ts create mode 100644 src/chains/ethereum/src/options/logging-options.ts create mode 100644 src/chains/ethereum/src/options/wallet-options.ts create mode 100644 src/chains/ethereum/src/types/tuple-from-union.ts create mode 100644 src/packages/core/src/options/index.ts rename src/{chains/ethereum/src/options => packages/options/src}/helpers/base.ts (100%) create mode 100644 src/packages/options/src/helpers/create.ts rename src/{chains/ethereum/src/options => packages/options/src}/helpers/definition.ts (54%) rename src/{chains/ethereum/src/options => packages/options/src}/helpers/exclusive.ts (71%) rename src/{chains/ethereum/src/options => packages/options/src}/helpers/getters.ts (100%) rename src/{chains/ethereum/src/options => packages/options/src}/helpers/index.ts (76%) rename src/packages/options/src/{options.ts => old/options.ts.old} (77%) rename src/packages/options/src/{provider-options.ts => old/provider-options.ts.old} (100%) create mode 100644 src/packages/options/src/provider-options.ts.old diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8027abf502..9e7446c250 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4,75 +4,57 @@ "lockfileVersion": 1, "dependencies": { "@babel/code-frame": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", - "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, "requires": { - "@babel/highlight": "^7.10.1" + "@babel/highlight": "^7.10.4" } }, "@babel/core": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.4.tgz", - "integrity": "sha512-3A0tS0HWpy4XujGc7QtOIHTeNwUgWaZc/WuS5YQrfhU67jnVmsD6OGPc1AKHH0LJHQICGncy3+YUjIhVlfDdcA==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", + "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.10.4", - "@babel/helper-module-transforms": "^7.10.4", + "@babel/generator": "^7.11.6", + "@babel/helper-module-transforms": "^7.11.0", "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.10.4", + "@babel/parser": "^7.11.5", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4", + "@babel/traverse": "^7.11.5", + "@babel/types": "^7.11.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", "json5": "^2.1.2", - "lodash": "^4.17.13", + "lodash": "^4.17.19", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "ms": "2.1.2" } } } }, "@babel/generator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.4.tgz", - "integrity": "sha512-toLIHUIAgcQygFZRAQcsLQV3CBuX6yOIru1kJk/qqqvcRmZrYe6WavZTSG+bB8MxhnL9YPf+pKQfuiP161q7ng==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", "dev": true, "requires": { - "@babel/types": "^7.10.4", + "@babel/types": "^7.11.5", "jsesc": "^2.5.1", - "lodash": "^4.17.13", "source-map": "^0.5.0" } }, @@ -97,12 +79,12 @@ } }, "@babel/helper-member-expression-to-functions": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.4.tgz", - "integrity": "sha512-m5j85pK/KZhuSdM/8cHUABQTAslV47OjfIB9Cc7P+PvlAoBzdb79BGNfw8RhT5Mq3p+xGd0ZfAKixbrUZx0C7A==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", + "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.11.0" } }, "@babel/helper-module-imports": { @@ -115,18 +97,18 @@ } }, "@babel/helper-module-transforms": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.4.tgz", - "integrity": "sha512-Er2FQX0oa3nV7eM1o0tNCTx7izmQtwAQsIiaLRWtavAAEcskb0XJ5OjJbVrYXWOTr8om921Scabn4/tzlx7j1Q==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", + "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.10.4", "@babel/helper-replace-supers": "^7.10.4", "@babel/helper-simple-access": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4", - "lodash": "^4.17.13" + "@babel/types": "^7.11.0", + "lodash": "^4.17.19" } }, "@babel/helper-optimise-call-expression": { @@ -161,18 +143,18 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz", - "integrity": "sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.11.0" } }, "@babel/helper-validator-identifier": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", - "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, "@babel/helpers": { @@ -187,26 +169,26 @@ } }, "@babel/highlight": { - "version": "7.10.1", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", - "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.1", + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.4.tgz", - "integrity": "sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", "dev": true }, "@babel/runtime-corejs3": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.10.4.tgz", - "integrity": "sha512-BFlgP2SoLO9HJX9WBwN67gHWMBhDX/eDz64Jajd6mR/UAUzqrNMm99d4qHnVaKscAElZoFiPv+JpR/Siud5lXw==", + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.11.2.tgz", + "integrity": "sha512-qh5IR+8VgFz83VBa6OkaET6uN/mJOhHONuy3m1sgF0CV6mXdPSEBdA7e1eUbVvyNtANjMbg22JUv71BaDXLY6A==", "dev": true, "requires": { "core-js-pure": "^3.0.0", @@ -222,98 +204,45 @@ "@babel/code-frame": "^7.10.4", "@babel/parser": "^7.10.4", "@babel/types": "^7.10.4" - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - } } }, "@babel/traverse": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.4.tgz", - "integrity": "sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.10.4", + "@babel/generator": "^7.11.5", "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.10.4", - "@babel/parser": "^7.10.4", - "@babel/types": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.13" + "lodash": "^4.17.19" }, "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" + "ms": "2.1.2" } } } }, "@babel/types": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", - "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.13", + "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - } } }, "@dsherret/to-absolute-glob": { @@ -345,12 +274,6 @@ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -394,12 +317,6 @@ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -435,12 +352,6 @@ "safe-buffer": "^5.1.2" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -498,12 +409,6 @@ "which": "^1.3.1" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -516,6 +421,15 @@ "validate-npm-package-name": "^3.0.0" } }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -627,12 +541,6 @@ "semver": "^6.2.0" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -692,45 +600,6 @@ "semver": "^6.2.0" }, "dependencies": { - "array-differ": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", - "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, - "multimatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", - "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", - "dev": true, - "requires": { - "array-differ": "^2.0.3", - "array-union": "^1.0.2", - "arrify": "^1.0.1", - "minimatch": "^3.0.4" - } - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -947,12 +816,6 @@ "universalify": "^0.1.0" } }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1039,12 +902,6 @@ "universalify": "^0.1.0" } }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1186,41 +1043,6 @@ "@lerna/validation-error": "3.13.0", "multimatch": "^3.0.0", "npmlog": "^4.1.2" - }, - "dependencies": { - "array-differ": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", - "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "multimatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", - "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", - "dev": true, - "requires": { - "array-differ": "^2.0.3", - "array-union": "^1.0.2", - "arrify": "^1.0.1", - "minimatch": "^3.0.4" - } - } } }, "@lerna/get-npm-exec-opts": { @@ -1486,12 +1308,6 @@ "npmlog": "^4.1.2" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -1538,12 +1354,6 @@ "universalify": "^0.1.0" } }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1607,12 +1417,6 @@ "universalify": "^0.1.0" } }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1705,12 +1509,6 @@ "write-pkg": "^3.1.0" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -1744,12 +1542,6 @@ "semver": "^6.2.0" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -1914,12 +1706,6 @@ "universalify": "^0.1.0" } }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -2031,6 +1817,17 @@ "npmlog": "^4.1.2", "path-exists": "^3.0.0", "rimraf": "^2.6.2" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, "@lerna/run": { @@ -2241,12 +2038,20 @@ "requires": { "@nodelib/fs.stat": "2.0.3", "run-parallel": "^1.1.9" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + } } }, "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, "@nodelib/fs.walk": { @@ -2269,39 +2074,27 @@ } }, "@octokit/endpoint": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.3.tgz", - "integrity": "sha512-Y900+r0gIz+cWp6ytnkibbD95ucEzDSKzlEnaWS52hbCDNcCJYO5mRmWW7HRAnDc7am+N/5Lnd8MppSaTYx1Yg==", + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.6.tgz", + "integrity": "sha512-7Cc8olaCoL/mtquB7j/HTbPM+sY6Ebr4k2X2y4JoXpVKQ7r5xB4iGQE0IoO58wIPsUk4AzoT65AMEpymSbWTgQ==", "dev": true, "requires": { "@octokit/types": "^5.0.0", - "is-plain-object": "^3.0.0", - "universal-user-agent": "^5.0.0" + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" }, "dependencies": { "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", "dev": true }, "universal-user-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", - "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", - "dev": true, - "requires": { - "os-name": "^3.1.0" - } + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true } } }, @@ -2359,66 +2152,43 @@ } }, "@octokit/request": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.5.tgz", - "integrity": "sha512-atAs5GAGbZedvJXXdjtKljin+e2SltEs48B3naJjqWupYl2IUBbB/CJisyjbNHcKpHzb3E+OYEZ46G8eakXgQg==", + "version": "5.4.9", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz", + "integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==", "dev": true, "requires": { "@octokit/endpoint": "^6.0.1", "@octokit/request-error": "^2.0.0", "@octokit/types": "^5.0.0", "deprecation": "^2.0.0", - "is-plain-object": "^3.0.0", - "node-fetch": "^2.3.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.1", "once": "^1.4.0", - "universal-user-agent": "^5.0.0" + "universal-user-agent": "^6.0.0" }, "dependencies": { "@octokit/request-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.1.tgz", - "integrity": "sha512-5lqBDJ9/TOehK82VvomQ6zFiZjPeSom8fLkFVLuYL3sKiIb5RB8iN/lenLkY7oBmyQcGP7FBMGiIZTO8jufaRQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz", + "integrity": "sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==", "dev": true, "requires": { - "@octokit/types": "^4.0.1", + "@octokit/types": "^5.0.1", "deprecation": "^2.0.0", "once": "^1.4.0" - }, - "dependencies": { - "@octokit/types": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-4.1.10.tgz", - "integrity": "sha512-/wbFy1cUIE5eICcg0wTKGXMlKSbaAxEr00qaBXzscLXpqhcwgXeS6P8O0pkysBhRfyjkKjJaYrvR1ExMO5eOXQ==", - "dev": true, - "requires": { - "@types/node": ">= 8" - } - } } }, "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } - }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", "dev": true }, "universal-user-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz", - "integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==", - "dev": true, - "requires": { - "os-name": "^3.1.0" - } + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true } } }, @@ -2445,9 +2215,9 @@ } }, "@octokit/rest": { - "version": "16.43.1", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz", - "integrity": "sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==", + "version": "16.43.2", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz", + "integrity": "sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ==", "dev": true, "requires": { "@octokit/auth-token": "^2.4.0", @@ -2469,18 +2239,18 @@ } }, "@octokit/types": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.0.0.tgz", - "integrity": "sha512-3LVS+MbeqwSd5G4KS8123cZz+hWomsiGeMnQ/QJIBFDwL/YHX8kkr0FZXrgWEMO7Fgi2/VOrhbiFnk9sZ+s4qA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz", + "integrity": "sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==", "dev": true, "requires": { "@types/node": ">= 8" } }, "@ts-morph/common": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.5.1.tgz", - "integrity": "sha512-0qasHorGK8VfUK20oECpIfmu/B6cwGSNTj2HoNsIKeDE1kB/uCk5jWFHkgBuoZu/3i3ysLOwO9QsFJaRAH65UA==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.5.2.tgz", + "integrity": "sha512-eLmfYV6u6gUgHrB9QV9lpuWg3cD60mhXdv0jvM5exWR/Cor8HG+GziFIj2hPEWHJknqzuU4meZd8DTqIzZfDRQ==", "dev": true, "requires": { "@dsherret/to-absolute-glob": "^2.0.2", @@ -2488,13 +2258,107 @@ "fs-extra": "^9.0.0", "is-negated-glob": "^1.0.0", "multimatch": "^4.0.0", - "typescript": "~3.9.2" + "typescript": "~3.9.7" }, "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fast-glob": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "typescript": { - "version": "3.9.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", - "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true } } @@ -2505,6 +2369,13 @@ "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", "requires": { "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" + } } }, "@types/color-name": { @@ -2535,9 +2406,9 @@ } }, "@types/glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-VgNIkxK+j7Nz5P7jvUZlRvhuPSmsEfS03b0alKcq5V/STUKAa3Plemsn5mrQUO7am6OErJ4rhGEGJbACclrtRA==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", "dev": true, "requires": { "@types/minimatch": "*", @@ -2545,9 +2416,9 @@ } }, "@types/lodash": { - "version": "4.14.150", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.150.tgz", - "integrity": "sha512-kMNLM5JBcasgYscD9x/Gvr6lTAv2NVgsKtet/hm93qMyf/D1pt+7jeEZklKJKxMVmXjxbRVQQGfqDSfipYCO6w==", + "version": "4.14.161", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.161.tgz", + "integrity": "sha512-EP6O3Jkr7bXvZZSZYlsgt5DIjiGr0dXP1/jVEwVLTFgg0d+3lWVQkRavYVQszV7dYUwvg0B8R0MBDpcmXg7XIA==", "dev": true }, "@types/lodash.clonedeep": { @@ -2580,7 +2451,8 @@ "@types/node": { "version": "14.0.14", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.14.tgz", - "integrity": "sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ==" + "integrity": "sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ==", + "dev": true }, "@types/normalize-package-data": { "version": "2.4.0", @@ -2594,8 +2466,23 @@ "integrity": "sha512-vbt5fb0y1svMhu++1lwtKmZL76d0uPChFlw7kEzyUmTwfmpHRcFb8i0R8ElT69q/L+QLgK2hgECivIAvaEDwag==", "dev": true }, - "@types/prettier": { - "version": "2.0.1", + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "requires": { + "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" + } + } + }, + "@types/prettier": { + "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.1.tgz", "integrity": "sha512-boy4xPNEtiw6N3abRhBi/e7hNvy3Tt8E9ZRAQrwAGzoCGZS/1wjo9KY7JHhnfnEsG5wSjDbymCozUM9a3ea7OQ==", "dev": true @@ -2604,9 +2491,15 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", - "dev": true, "requires": { "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" + } } }, "@types/seedrandom": { @@ -2687,11 +2580,18 @@ "dev": true }, "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", "requires": { "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } } }, "agent-base": { @@ -2713,9 +2613,9 @@ } }, "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "requires": { "clean-stack": "^2.0.0", @@ -2723,9 +2623,9 @@ } }, "ajv": { - "version": "6.12.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", - "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -2880,9 +2780,9 @@ "dev": true }, "array-differ": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", - "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", + "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", "dev": true }, "array-find-index": { @@ -2898,10 +2798,13 @@ "dev": true }, "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } }, "array-uniq": { "version": "1.0.3", @@ -2928,9 +2831,9 @@ } }, "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "asap": { @@ -3007,9 +2910,9 @@ "dev": true }, "aws4": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", - "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", "dev": true }, "balanced-match": { @@ -3119,6 +3022,7 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, "requires": { "file-uri-to-path": "1.0.0" } @@ -3141,13 +3045,10 @@ } } }, - "bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", - "requires": { - "safe-buffer": "^5.0.1" - } + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" }, "bluebird": { "version": "3.7.2", @@ -3156,9 +3057,9 @@ "dev": true }, "bn.js": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", - "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==" + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" }, "brace-expansion": { "version": "1.1.11", @@ -3170,12 +3071,32 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "brorand": { @@ -3202,15 +3123,6 @@ "safe-buffer": "^5.0.1" } }, - "browserify-sha3": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.4.tgz", - "integrity": "sha1-CGxHuMgjFsnUcCLCYYWVRXbdjiY=", - "requires": { - "js-sha3": "^0.6.1", - "safe-buffer": "^5.1.1" - } - }, "bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", @@ -3294,6 +3206,17 @@ "ssri": "^6.0.1", "unique-filename": "^1.1.1", "y18n": "^4.0.0" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, "cache-base": { @@ -3448,12 +3371,46 @@ "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.3.0" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } } }, "chownr": { @@ -3658,23 +3615,29 @@ "dev": true }, "compare-func": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", - "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", "dev": true, "requires": { "array-ify": "^1.0.0", - "dot-prop": "^3.0.0" + "dot-prop": "^5.1.0" }, "dependencies": { "dot-prop": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", - "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", "dev": true, "requires": { - "is-obj": "^1.0.0" + "is-obj": "^2.0.0" } + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true } } }, @@ -3756,12 +3719,12 @@ "dev": true }, "conventional-changelog-angular": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.10.tgz", - "integrity": "sha512-k7RPPRs0vp8+BtPsM9uDxRl6KcgqtCJmzRD1wRtgqmhQ96g8ifBGo9O/TZBG23jqlXS/rg8BKRDELxfnQQGiaA==", + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", + "integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "q": "^1.5.1" } }, @@ -3787,11 +3750,12 @@ }, "dependencies": { "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", "dev": true, "requires": { + "inherits": "^2.0.4", "readable-stream": "2 || 3" } } @@ -3804,12 +3768,12 @@ "dev": true }, "conventional-changelog-writer": { - "version": "4.0.16", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.16.tgz", - "integrity": "sha512-jmU1sDJDZpm/dkuFxBeRXvyNcJQeKhGtVcFFkwTphUAzyYWcwz2j36Wcv+Mv2hU3tpvLMkysOPXJTLO55AUrYQ==", + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz", + "integrity": "sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "conventional-commits-filter": "^2.0.6", "dateformat": "^3.0.0", "handlebars": "^4.7.6", @@ -3828,11 +3792,12 @@ "dev": true }, "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", "dev": true, "requires": { + "inherits": "^2.0.4", "readable-stream": "2 || 3" } } @@ -3864,11 +3829,12 @@ }, "dependencies": { "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", "dev": true, "requires": { + "inherits": "^2.0.4", "readable-stream": "2 || 3" } } @@ -3890,12 +3856,6 @@ "q": "^1.5.1" }, "dependencies": { - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -4029,6 +3989,17 @@ "mkdirp": "^0.5.1", "rimraf": "^2.5.4", "run-queue": "^1.0.0" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, "copy-descriptor": { @@ -4144,12 +4115,20 @@ "dev": true }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "debuglog": { @@ -4226,16 +4205,6 @@ "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", "requires": { "abstract-leveldown": "~2.6.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", - "requires": { - "xtend": "~4.0.0" - } - } } }, "define-properties": { @@ -4349,28 +4318,18 @@ } }, "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", + "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", "dev": true, "requires": { "is-obj": "^1.0.0" } }, - "drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", - "requires": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - } - }, "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", "dev": true }, "duplexify": { @@ -4434,9 +4393,9 @@ } }, "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -4445,19 +4404,12 @@ "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } } }, "emittery": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.6.0.tgz", - "integrity": "sha512-6EMRGr9KzYWp8DzHFZsKVZBsMO6QhAeHMeHND8rhyBNCHKMLpgW9tZv40bwN3rAIKRS5CxcK8oLRKUJSB9h7yQ==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.1.tgz", + "integrity": "sha512-d34LN4L6h18Bzz9xpoku2nPwKxCPlPMr3EEKTkoEBi+1/+b0lcRkRJ1UVyyZaKNeqGR3swcGl6s390DNO4YVgQ==" }, "emoji-regex": { "version": "7.0.3", @@ -4466,12 +4418,12 @@ "dev": true }, "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", "dev": true, "requires": { - "iconv-lite": "~0.4.13" + "iconv-lite": "^0.6.2" } }, "encoding-down": { @@ -4495,9 +4447,12 @@ } }, "level-codec": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.1.tgz", - "integrity": "sha512-ajFP0kJ+nyq4i6kptSM+mAvJKLOg1X5FiFPtLG9M5gCEZyBmgDi3FkDrvlMkEzrUn1cWxtvVmrvoS4ASyO/q+Q==" + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "requires": { + "buffer": "^5.6.0" + } }, "level-errors": { "version": "2.0.1", @@ -4506,6 +4461,11 @@ "requires": { "errno": "~0.1.1" } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -4525,9 +4485,9 @@ "dev": true }, "envinfo": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.5.1.tgz", - "integrity": "sha512-hQBkDf2iO4Nv0CNHpCuSBeaSrveU6nThVxFGTrq/eDlV716UQk09zChaJae4mZRsos1x4YLY2TaH3LHUae3ZmQ==", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz", + "integrity": "sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==", "dev": true }, "err-code": { @@ -4554,21 +4514,21 @@ } }, "es-abstract": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", - "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.1.5", - "is-regex": "^1.0.5", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", "object-inspect": "^1.7.0", "object-keys": "^1.1.1", "object.assign": "^4.1.0", - "string.prototype.trimleft": "^2.1.1", - "string.prototype.trimright": "^2.1.1" + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" }, "dependencies": { "object-keys": { @@ -4651,55 +4611,48 @@ "dev": true }, "ethashjs": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.7.tgz", - "integrity": "sha1-ML/kGWcmaQoMWdO4Jy5w1NDDS64=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz", + "integrity": "sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==", "requires": { - "async": "^1.4.2", - "buffer-xor": "^1.0.3", - "ethereumjs-util": "^4.0.1", + "async": "^2.1.2", + "buffer-xor": "^2.0.1", + "ethereumjs-util": "^7.0.2", "miller-rabin": "^4.0.0" }, "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "ethereumjs-util": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz", - "integrity": "sha1-PpQosxfuvaPXJg2FT93alUsfG8Y=", - "requires": { - "bn.js": "^4.8.0", - "create-hash": "^1.1.2", - "keccakjs": "^0.2.0", - "rlp": "^2.0.0", - "secp256k1": "^3.0.1" - } - }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "buffer-xor": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" + "safe-buffer": "^5.1.1" } } } }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, "ethereumjs-account": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", @@ -4710,49 +4663,18 @@ "safe-buffer": "^5.1.1" }, "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, "ethereumjs-util": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", - "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", "requires": { "@types/bn.js": "^4.11.3", "bn.js": "^4.11.0", "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^2.0.0", - "rlp": "^2.2.3", - "secp256k1": "^3.0.1" - } - }, - "keccak": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", - "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", - "requires": { - "bindings": "^1.5.0", - "inherits": "^2.0.4", - "nan": "^2.14.0", - "safe-buffer": "^5.2.0" - } - }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" } } } @@ -4769,192 +4691,51 @@ "merkle-patricia-tree": "^2.1.2" }, "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", "requires": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - }, - "dependencies": { - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - } - } - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" + "safe-buffer": "^5.1.1" } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + } + } + }, + "ethereumjs-blockchain": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz", + "integrity": "sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ==", + "requires": { + "async": "^2.6.1", + "ethashjs": "~0.0.7", + "ethereumjs-block": "~2.2.2", + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.1.0", + "flow-stoplight": "^1.0.0", + "level-mem": "^3.0.1", + "lru-cache": "^5.1.1", + "rlp": "^2.2.2", + "semaphore": "^1.1.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - } - } - }, - "ethereumjs-blockchain": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.3.tgz", - "integrity": "sha512-0nJWbyA+Gu0ZKZr/cywMtB/77aS/4lOVsIKbgUN2sFQYscXO5rPbUfrEe7G2Zhjp86/a0VqLllemDSTHvx3vZA==", - "requires": { - "async": "^2.6.1", - "ethashjs": "~0.0.7", - "ethereumjs-block": "~2.2.2", - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "~6.1.0", - "flow-stoplight": "^1.0.0", - "level-mem": "^3.0.1", - "lru-cache": "^5.1.1", - "rlp": "^2.2.2", - "semaphore": "^1.1.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, - "ethereumjs-util": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", - "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" } } } @@ -4973,49 +4754,18 @@ "ethereumjs-util": "^6.0.0" }, "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, "ethereumjs-util": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", - "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", "requires": { "@types/bn.js": "^4.11.3", "bn.js": "^4.11.0", "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^2.0.0", - "rlp": "^2.2.3", - "secp256k1": "^3.0.1" - } - }, - "keccak": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", - "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", - "requires": { - "bindings": "^1.5.0", - "inherits": "^2.0.4", - "nan": "^2.14.0", - "safe-buffer": "^5.2.0" - } - }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" } } } @@ -5032,6 +4782,13 @@ "keccak": "^3.0.0", "rlp": "^2.2.4", "secp256k1": "^4.0.1" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==" + } } }, "ethereumjs-vm": { @@ -5056,151 +4813,18 @@ "util.promisify": "^1.0.0" }, "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - }, "ethereumjs-util": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", - "integrity": "sha512-vb0XN9J2QGdZGIEKG2vXM+kUdEivUfU6Wmi5y0cg+LRhDYKnXIZ/Lz7XjFbHRR9VIKq2lVGLzGBkA++y2nOdOQ==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", "requires": { "@types/bn.js": "^4.11.3", "bn.js": "^4.11.0", "create-hash": "^1.1.2", - "ethjs-util": "0.1.6", - "keccak": "^2.0.0", - "rlp": "^2.2.3", - "secp256k1": "^3.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "keccak": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-2.1.0.tgz", - "integrity": "sha512-m1wbJRTo+gWbctZWay9i26v5fFnYkOn7D5PCxJ3fZUGUEb49dE1Pm4BREUYCt/aoO6di7jeoGmhvqN9Nzylm3Q==", - "requires": { - "bindings": "^1.5.0", - "inherits": "^2.0.4", - "nan": "^2.14.0", - "safe-buffer": "^5.2.0" - } - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "ethereumjs-util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz", - "integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "ethjs-util": "^0.1.3", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - }, - "keccak": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", - "requires": { - "bindings": "^1.2.1", - "inherits": "^2.0.3", - "nan": "^2.2.1", - "safe-buffer": "^5.1.0" - } - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" } } } @@ -5381,6 +5005,26 @@ "chardet": "^0.7.0", "iconv-lite": "^0.4.24", "tmp": "^0.0.33" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + } } }, "extglob": { @@ -5469,17 +5113,40 @@ "dev": true }, "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", "dev": true, "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + }, + "dependencies": { + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + } } }, "fast-json-stable-stringify": { @@ -5521,15 +5188,30 @@ "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "to-regex-range": "^5.0.1" + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } } }, "find-cache-dir": { @@ -5705,13 +5387,13 @@ "dev": true }, "form-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", - "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" } }, @@ -5779,9 +5461,9 @@ } }, "fromentries": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", - "integrity": "sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", + "integrity": "sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==", "dev": true }, "fs-extra": { @@ -5860,13 +5542,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -5956,12 +5631,6 @@ "pinkie-promise": "^2.0.0" } }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "indent-string": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", @@ -6149,12 +5818,6 @@ "through2": "^2.0.0" }, "dependencies": { - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -6269,12 +5932,6 @@ "semver": "^6.0.0" }, "dependencies": { - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -6368,9 +6025,9 @@ } }, "git-up": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/git-up/-/git-up-4.0.1.tgz", - "integrity": "sha512-LFTZZrBlrCrGCG07/dm1aCjjpL1z9L3+5aEeI9SBhAqSc+kiA9Or1bgZhQFNppJX6h/f5McrvJt1mQXTFm6Qrw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/git-up/-/git-up-4.0.2.tgz", + "integrity": "sha512-kbuvus1dWQB2sSW4cbfTeGpCMd8ge9jx9RKnhXhuJ7tnvT+NIrTVfYZxjtflZddQYcmdOTlkAcjmx7bor+15AQ==", "dev": true, "requires": { "is-ssh": "^1.3.0", @@ -6378,9 +6035,9 @@ } }, "git-url-parse": { - "version": "11.1.2", - "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.1.2.tgz", - "integrity": "sha512-gZeLVGY8QVKMIkckncX+iCq2/L8PlwncvDFKiWkBn9EtCfYDbliRTTp6qzyQ1VMdITUfq7293zDzfpjdiGASSQ==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.2.0.tgz", + "integrity": "sha512-KPoHZg8v+plarZvto4ruIzzJLFQoRx+sUs5DQSr07By9IBKguVd+e6jwrFR6/TP6xrCJlNV1tPqLO1aREc7O2g==", "dev": true, "requires": { "git-up": "^4.0.0" @@ -6432,172 +6089,17 @@ "globby": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", - "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^1.0.2", - "dir-glob": "^2.2.2", - "fast-glob": "^2.2.6", - "glob": "^7.1.3", - "ignore": "^4.0.3", - "pify": "^4.0.1", - "slash": "^2.0.0" - }, - "dependencies": { - "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", - "dev": true, - "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "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" - } - }, - "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=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } + "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^1.0.2", + "dir-glob": "^2.2.2", + "fast-glob": "^2.2.6", + "glob": "^7.1.3", + "ignore": "^4.0.3", + "pify": "^4.0.1", + "slash": "^2.0.0" } }, "graceful-fs": { @@ -6640,12 +6142,12 @@ "dev": true }, "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "dev": true, "requires": { - "ajv": "^6.5.5", + "ajv": "^6.12.3", "har-schema": "^2.0.0" } }, @@ -6701,26 +6203,6 @@ "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", @@ -6802,13 +6284,10 @@ } }, "hosted-git-info": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.4.tgz", - "integrity": "sha512-4oT62d2jwSDBbLLFLZE+1vPuQ1h8p9wjrJ8Mqx5TjsyWmBMV5B13eJqn8pvluqubLf3cJPTfiYCIwNwDNmzScQ==", - "dev": true, - "requires": { - "lru-cache": "^5.1.1" - } + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true }, "html-escaper": { "version": "2.0.2", @@ -6830,23 +6309,6 @@ "requires": { "agent-base": "4", "debug": "3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } } }, "http-signature": { @@ -6868,17 +6330,6 @@ "requires": { "agent-base": "^4.3.0", "debug": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } } }, "humanize-ms": { @@ -6891,12 +6342,12 @@ } }, "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", "dev": true, "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "ieee754": { @@ -6926,9 +6377,9 @@ } }, "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" }, "import-fresh": { "version": "2.0.0", @@ -7012,12 +6463,6 @@ "validate-npm-package-name": "^3.0.0" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -7187,9 +6632,9 @@ "dev": true }, "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" }, "is-ci": { "version": "2.0.0", @@ -7303,11 +6748,30 @@ "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", "dev": true }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=" + }, "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } }, "is-obj": { "version": "1.0.1", @@ -7331,11 +6795,11 @@ } }, "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", "requires": { - "has": "^1.0.3" + "has-symbols": "^1.0.1" } }, "is-relative": { @@ -7354,9 +6818,9 @@ "dev": true }, "is-ssh": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.1.tgz", - "integrity": "sha512-0eRIASHZt1E68/ixClI8bp2YK2wmBPVWEismTs6M+M099jKgrzl/3E976zIbImSIob48N2/XGe9y7ZiYdImSlg==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz", + "integrity": "sha512-elEw0/0c2UscLrNG+OAorbP539E3rhliKPg+hDMWN9VwrDXfYK+4PBEykDPfxlYYtQvl84TascnQyobfQLHEhQ==", "dev": true, "requires": { "protocols": "^1.1.0" @@ -7509,15 +6973,6 @@ "aggregate-error": "^3.0.0" } }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -7559,9 +7014,9 @@ "dev": true }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -7580,6 +7035,15 @@ "source-map": "^0.6.1" }, "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -7615,9 +7079,10 @@ } }, "js-sha3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", - "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true }, "js-tokens": { "version": "4.0.0", @@ -7653,6 +7118,12 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -7709,23 +7180,14 @@ } }, "keccak": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", - "integrity": "sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", "requires": { "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0" } }, - "keccakjs": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.3.tgz", - "integrity": "sha512-BjLkNDcfaZ6l8HBG9tH0tpmDv3sS2mA7FNQxFHpCdzP3Gb2MVruXBSuoM66SnVxKJpAr5dKGdkHD+bDokt8fTg==", - "requires": { - "browserify-sha3": "^0.0.4", - "sha3": "^1.2.2" - } - }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -7811,6 +7273,11 @@ "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -7831,6 +7298,11 @@ "xtend": "~4.0.0" } }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, "memdown": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", @@ -7848,6 +7320,11 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -7945,6 +7422,11 @@ "requires": { "safe-buffer": "~5.1.0" } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -7954,6 +7436,13 @@ "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", "requires": { "xtend": "^4.0.2" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } } }, "level-ws": { @@ -7980,14 +7469,6 @@ "version": "0.10.31", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } } } }, @@ -8017,59 +7498,32 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, "levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", - "requires": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", "xtend": "~4.0.0" }, "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { + "xtend": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - } + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -8103,9 +7557,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" }, "lodash._reinterpolate": { "version": "3.0.0", @@ -8206,9 +7660,9 @@ "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" }, "macos-release": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", - "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz", + "integrity": "sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg==", "dev": true }, "make-dir": { @@ -8297,10 +7751,23 @@ "safe-buffer": "~5.1.1" }, "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "~4.0.0" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -8311,18 +7778,16 @@ "dev": true }, "meow": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.0.1.tgz", - "integrity": "sha512-tBKIQqVrAHqwit0vfuFPY3LlzJYkEOFyKa3bPgxzNl6q/RtN8KQ+ALYEASYuFayzSAsjlhXj/JZ10rH85Q6TUw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", "dev": true, "requires": { "@types/minimist": "^1.2.0", - "arrify": "^2.0.1", - "camelcase": "^6.0.0", "camelcase-keys": "^6.2.2", "decamelize-keys": "^1.1.0", "hard-rejection": "^2.1.0", - "minimist-options": "^4.0.2", + "minimist-options": "4.1.0", "normalize-package-data": "^2.5.0", "read-pkg-up": "^7.0.1", "redent": "^3.0.0", @@ -8331,6 +7796,12 @@ "yargs-parser": "^18.1.3" }, "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -8360,14 +7831,14 @@ } }, "parse-json": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", - "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", + "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, @@ -8430,24 +7901,93 @@ "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" + } + } + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" }, "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" } } } } }, - "merge2": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", - "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", - "dev": true - }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -8455,13 +7995,24 @@ "dev": true }, "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" + "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" } }, "miller-rabin": { @@ -8471,19 +8022,12 @@ "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } } }, "mime": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz", - "integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w==", + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==", "dev": true }, "mime-db": { @@ -8546,14 +8090,6 @@ "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", "kind-of": "^6.0.3" - }, - "dependencies": { - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - } } }, "minipass": { @@ -8727,6 +8263,24 @@ "p-locate": "^4.1.0" } }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", @@ -8855,6 +8409,17 @@ "mkdirp": "^0.5.1", "rimraf": "^2.5.4", "run-queue": "^1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } } }, "ms": { @@ -8864,15 +8429,14 @@ "dev": true }, "multimatch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", - "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", + "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", "dev": true, "requires": { - "@types/minimatch": "^3.0.3", - "array-differ": "^3.0.0", - "array-union": "^2.1.0", - "arrify": "^2.0.1", + "array-differ": "^2.0.3", + "array-union": "^1.0.2", + "arrify": "^1.0.1", "minimatch": "^3.0.4" } }, @@ -8893,11 +8457,6 @@ "thenify-all": "^1.0.0" } }, - "nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -8923,9 +8482,9 @@ "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" }, "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, "nice-try": { @@ -8935,14 +8494,14 @@ "dev": true }, "node-addon-api": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.0.tgz", - "integrity": "sha512-ASCL5U13as7HhOExbT6OlWJJUV/lLzL2voOSP1UVehpRD8FbSrSDjfScK/KwAvVTI5AS6r4VwbOMlIqtvRidnA==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", "dev": true }, "node-fetch-npm": { @@ -8975,6 +8534,15 @@ "which": "^1.3.1" }, "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -8993,9 +8561,9 @@ } }, "node-gyp-build": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.2.tgz", - "integrity": "sha512-Lqh7mrByWCM8Cf9UPqpeoVBBo5Ugx+RKu885GAzmLBVYjeywScxHXPGLa4JfYNZmcNGwzR0Glu5/9GaQZMFqyA==" + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" }, "node-preload": { "version": "0.2.1", @@ -9026,14 +8594,6 @@ "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - } } }, "normalize-path": { @@ -9101,11 +8661,35 @@ "validate-npm-package-name": "^3.0.0" }, "dependencies": { + "hosted-git-info": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.5.tgz", + "integrity": "sha512-i4dpK6xj9BIpVOTboXIlKG9+8HMKggcrMX7WA24xZtKwX0TPelq/rbaS5rCKeNX8sJXZJGdSxpnEGtta+wismQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true } } }, @@ -9131,12 +8715,6 @@ "semver": "^5.4.1" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "npm-package-arg": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", @@ -9287,15 +8865,6 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -9348,9 +8917,9 @@ } }, "object-inspect": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", - "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" }, "object-keys": { "version": "0.4.0", @@ -9367,16 +8936,35 @@ } }, "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" }, "dependencies": { + "es-abstract": { + "version": "1.18.0-next.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", + "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -9616,9 +9204,9 @@ } }, "parse-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.1.tgz", - "integrity": "sha512-d7yhga0Oc+PwNXDvQ0Jv1BuWkLVPXcAoQ/WREgd6vNNoKYaW52KI+RdOFjI63wjkmps9yUE8VS4veP+AgpQ/hA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.2.tgz", + "integrity": "sha512-HSqVz6iuXSiL8C1ku5Gl1Z5cwDd9Wo0q8CoffdAghP6bz8pJa1tcMC+m4N+z6VAS8QdksnIGq1TB6EgR4vPR6w==", "dev": true, "requires": { "is-ssh": "^1.3.0", @@ -9626,9 +9214,9 @@ } }, "parse-url": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-5.0.1.tgz", - "integrity": "sha512-flNUPP27r3vJpROi0/R3/2efgKkyXqnXwyP1KQ2U0SfFRgdizOdWfvrrvJg1LuOoxs7GQhmxJlq23IpQ/BkByg==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-5.0.2.tgz", + "integrity": "sha512-Czj+GIit4cdWtxo3ISZCvLiUjErSo0iI3wJ+q9Oi3QuMYTI6OZu+7cewMWZ+C1YAnKhYTk6/TLuhIgCypLthPA==", "dev": true, "requires": { "is-ssh": "^1.3.0", @@ -9690,9 +9278,9 @@ } }, "pbkdf2": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", - "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", "requires": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -9814,9 +9402,9 @@ "dev": true }, "protocols": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.7.tgz", - "integrity": "sha512-Fx65lf9/YDn3hUX08XUc0J8rSux36rEsyiv21ZGUC1mOyeM3lTRpZLcrm8aAolzS4itwVfm7TAPyxC2E5zd6xg==", + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz", + "integrity": "sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg==", "dev": true }, "protoduck": { @@ -9885,9 +9473,9 @@ "dev": true }, "qs": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", - "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, "quick-lru": { @@ -9928,14 +9516,13 @@ } }, "read-package-json": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.1.tgz", - "integrity": "sha512-dAiqGtVc/q5doFz6096CcnXhpYk0ZN8dEKVkGLU0CsASt8SrgF6SF7OTKAYubfvFhWaqofl+Y8HK19GR8jwW+A==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz", + "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==", "dev": true, "requires": { "glob": "^7.1.1", - "graceful-fs": "^4.1.2", - "json-parse-better-errors": "^1.0.1", + "json-parse-even-better-errors": "^2.3.0", "normalize-package-data": "^2.0.0", "npm-normalize-package-bin": "^1.0.0" } @@ -10079,9 +9666,9 @@ } }, "regenerator-runtime": { - "version": "0.13.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", "dev": true }, "regex-not": { @@ -10150,25 +9737,6 @@ "tough-cookie": "~2.5.0", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" - }, - "dependencies": { - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - } } }, "require-directory": { @@ -10256,10 +9824,9 @@ "dev": true }, "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "requires": { "glob": "^7.1.3" } @@ -10274,18 +9841,11 @@ } }, "rlp": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.4.tgz", - "integrity": "sha512-fdq2yYCWpAQBhwkZv+Z8o/Z4sPmYm1CUq6P7n6lVTOdb949CnqA0sndXal5C1NleSVSZm6q5F3iEbauyVln/iw==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", "requires": { "bn.js": "^4.11.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" - } } }, "run-async": { @@ -10315,9 +9875,9 @@ "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" }, "rxjs": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", - "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -10343,6 +9903,11 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, "secp256k1": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.1.tgz", @@ -10406,6 +9971,11 @@ } } }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, "sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", @@ -10415,21 +9985,6 @@ "safe-buffer": "^5.0.1" } }, - "sha3": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.6.tgz", - "integrity": "sha512-KgLGmJGrmNB4JWVsAV11Yk6KbvsAiygWJc7t5IebWva/0NukNrjJqhtKhzy3Eiv2AKuGvhZZt7dt1mDo7HkoiQ==", - "requires": { - "nan": "2.13.2" - }, - "dependencies": { - "nan": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", - "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==" - } - } - }, "shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -10660,12 +10215,6 @@ "rimraf": "^2.2.8" } }, - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "dev": true - }, "jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", @@ -10675,11 +10224,29 @@ "graceful-fs": "^4.1.6" } }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } } } }, @@ -10758,15 +10325,6 @@ "semver": "^6.0.0" } }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -10802,9 +10360,9 @@ } }, "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", "dev": true }, "split": { @@ -10923,26 +10481,6 @@ "es-abstract": "^1.17.5" } }, - "string.prototype.trimleft": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", - "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimstart": "^1.0.0" - } - }, - "string.prototype.trimright": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", - "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5", - "string.prototype.trimend": "^1.0.0" - } - }, "string.prototype.trimstart": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", @@ -11040,6 +10578,29 @@ "xtend": "~4.0.0" } }, + "deferred-leveldown": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "requires": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + } + } + }, "encoding-down": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", @@ -11066,6 +10627,33 @@ "requires": { "errno": "~0.1.1" } + }, + "level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + } + }, + "levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "requires": { + "deferred-leveldown": "~5.3.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -11088,6 +10676,32 @@ "semver": "^6.3.0" }, "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "dev": true + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -11166,9 +10780,9 @@ "dev": true }, "thenify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", - "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "dev": true, "requires": { "any-promise": "^1.0.0" @@ -11234,16 +10848,21 @@ "requires": { "safe-buffer": "~5.1.0" } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true } } }, "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "requires": { - "os-tmpdir": "~1.0.2" + "rimraf": "^3.0.0" } }, "tmp-promise": { @@ -11252,24 +10871,6 @@ "integrity": "sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA==", "requires": { "tmp": "^0.2.0" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "requires": { - "rimraf": "^3.0.0" - } - } } }, "to-fast-properties": { @@ -11311,12 +10912,13 @@ } }, "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { - "is-number": "^7.0.0" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, "tough-cookie": { @@ -11417,9 +11019,9 @@ } }, "typescript": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", - "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "version": "4.1.0-beta", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.0-beta.tgz", + "integrity": "sha512-b/LAttdVl3G6FEmnMkDsK0xvfvaftXpSKrjXn+OVCRqrwz5WD/6QJOiN+dTorqDY+hkaH+r2gP5wI1jBDmdQ7A==", "dev": true }, "uWebSockets.js": { @@ -11427,23 +11029,11 @@ "from": "github:uNetworking/uWebSockets.js#v18.4.0" }, "uglify-js": { - "version": "3.9.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.4.tgz", - "integrity": "sha512-8RZBJq5smLOa7KslsNsVcSH+KOXf1uDU8yqLeNuVKwmT0T3FA0ZoXlinQfRad7SDcbZZRZE4ov+2v71EnxNyCA==", + "version": "3.10.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz", + "integrity": "sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==", "dev": true, - "optional": true, - "requires": { - "commander": "~2.20.3" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "optional": true - } - } + "optional": true }, "uid-number": { "version": "0.0.6", @@ -11561,9 +11151,9 @@ "dev": true }, "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", "dev": true, "requires": { "punycode": "^2.1.0" @@ -11710,9 +11300,9 @@ } }, "windows-release": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.1.tgz", - "integrity": "sha512-Pngk/RDCaI/DkuHPlGTdIkDiTAnAkyMjoQMZqRsxydNl1qGXNIoZrB7RK8g53F2tEgQBMqQJHQdYZuQEEAu54A==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.3.tgz", + "integrity": "sha512-OSOGH1QYiW5yVor9TtmXKQvt2vjQqbYS+DqmsZw+r7xDwLXEeT3JGW0ZppFmHx4diyXmxt238KFR3N9jzevBRg==", "dev": true, "requires": { "execa": "^1.0.0" @@ -11871,9 +11461,12 @@ } }, "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } }, "y18n": { "version": "4.0.0", diff --git a/package.json b/package.json index 4a364a3fe6..946ed494c3 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "superagent": "5.2.2", "ts-morph": "7.1.2", "ts-node": "8.10.2", - "typescript": "4.0.2", + "typescript": "4.1.0-beta", "utf-8-validate": "5.0.2", "ws": "7.3.0", "yargs": "15.4.0" diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index c46d41a2a5..59841d2880 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -94,7 +94,7 @@ describe("api", () => { }); it("should update the default chain id", async () => { - const provider = await getProvider({chainId: 1234}); + const provider = await getProvider({chain: {chainId: 1234}}); const result = await provider.send("eth_chainId"); assert.deepStrictEqual(result, "0x4d2"); }); @@ -192,9 +192,9 @@ describe("api", () => { counter++; if (counter === count) { off(); - resolve(); + resolve(void 0); } - }) as any); + })); }); let wait = awaitFor(4); diff --git a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts index 48e59c40b7..d755b41fd9 100644 --- a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts @@ -67,7 +67,7 @@ describe("api", () => { }); it("should return the no code at the previous block number", async function() { - const code = await provider.send("eth_getCode", [contractAddress, Quantity.from((blockNumber as any) - 1n).toString()]); + const code = await provider.send("eth_getCode", [contractAddress, Quantity.from(blockNumber.toBigInt() - 1n).toString()]); assert.strictEqual(code, "0x"); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts index 9ef36bb11a..866435c7d1 100644 --- a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts @@ -18,7 +18,7 @@ describe("api", () => { beforeEach(async () => { provider = await getProvider({ - defaultTransactionGasLimit: Quantity.from(6721975) + miner: {defaultTransactionGasLimit: 6721975} }); const accounts = await provider.send("eth_accounts"); const from = accounts[0]; diff --git a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts index 7547a62352..c5b81b2072 100644 --- a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts @@ -6,7 +6,7 @@ describe("api", () => { describe("eth", () => { describe("legacy", () => { it("when not in legacy mode, does not mine before returning the tx hash", async () => { - const provider = await getProvider({legacyInstamine: false}); + const provider = await getProvider({miner: {legacyInstamine: false}}); const accounts = await provider.send("eth_accounts"); const hash = await provider.send("eth_sendTransaction", [ @@ -21,7 +21,7 @@ describe("api", () => { }); it("when in legacy mode, mines before returns in the tx hash", async () => { - const provider = await getProvider({legacyInstamine: true}); + const provider = await getProvider({miner:{legacyInstamine: true}}); const accounts = await provider.send("eth_accounts"); const hash = await provider.send("eth_sendTransaction", [ @@ -36,7 +36,7 @@ describe("api", () => { }); it("handles transaction balance errors, callback style", (done) => { - getProvider({legacyInstamine: true, vmErrorsOnRPCResponse: true}).then(async (provider) => { + getProvider({miner: {legacyInstamine: true}, chain: {vmErrorsOnRPCResponse: true}}).then(async (provider) => { const accounts = await provider.send("eth_accounts"); provider.send({ diff --git a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts index 395dd2f49c..c6ebf49a93 100644 --- a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts @@ -24,8 +24,10 @@ describe("api", () => { beforeEach(async () => { provider = await getProvider({ - mnemonic: "sweet treat", - accounts: [{secretKey, balance: "0xffffff"}] + wallet: { + mnemonic: "sweet treat", + accounts: [{secretKey, balance: "0xffffff"}] + } }); accounts = await provider.send("eth_accounts"); }); diff --git a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts index 56c102fe7e..7dc7f6f9a2 100644 --- a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts @@ -3,6 +3,7 @@ import getProvider from "../../helpers/getProvider"; import compile from "../../helpers/compile"; import { join } from "path"; import EthereumProvider from "../../../src/provider"; +import { EthereumProviderOptions } from "../../../src/options"; describe("api", () => { describe("eth", () => { @@ -38,8 +39,8 @@ describe("api", () => { } it("doesn't crash on badly encoded revert string", async () => { - async function test(opts) { - const provider = await getProvider(opts as any); + async function test(opts: EthereumProviderOptions) { + const provider = await getProvider(opts); const accounts = await provider.send("eth_accounts"); const {contract, contractAddress} = await deployContract(provider, accounts); const contractMethods = contract.contract.evm.methodIdentifiers; @@ -48,7 +49,7 @@ describe("api", () => { ]); const revertString = "0x08c379a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0" - if (opts.vmErrorsOnRPCResponse) { + if (opts.chain.vmErrorsOnRPCResponse) { const result = await prom.catch(e =>e); assert.strictEqual(result.code, -32000, "Error code should be -32000"); assert.strictEqual(result.data.reason, null, "The reason is undecodable, and thus should be null"); @@ -58,8 +59,8 @@ describe("api", () => { assert.strictEqual(await prom, revertString, "The revert reason should be encoded as hex"); } } - await test({vmErrorsOnRPCResponse: false}); - await test({vmErrorsOnRPCResponse: true}); + await test({chain:{vmErrorsOnRPCResponse: false}}); + await test({chain:{vmErrorsOnRPCResponse: true}}); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/sign.test.ts b/src/chains/ethereum/__tests__/api/eth/sign.test.ts index 4259a8e024..ca171f254f 100644 --- a/src/chains/ethereum/__tests__/api/eth/sign.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sign.test.ts @@ -18,7 +18,9 @@ describe("api", () => { secretKey: "0xe6d66f02cd45a13982b99a5abf3deab1f67cf7be9fee62f0a072cb70896342e4" }; provider = await getProvider({ - accounts: [acc] + wallet: { + accounts: [acc] + } }) accounts = await provider.send("eth_accounts"); }); diff --git a/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts b/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts index a69cb588a7..8ebec6ae3f 100644 --- a/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts @@ -16,7 +16,9 @@ describe("api", () => { secretKey: createKeccakHash("keccak256").update("cow").digest() }; provider = await getProvider({ - accounts: [acc] + wallet:{ + accounts: [acc] + } }) accounts = await provider.send("eth_accounts"); }); diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index 3542aac9d4..da031fbd3d 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -13,9 +13,13 @@ describe("api", () => { beforeEach(async () => { provider = await getProvider({ - time: now, - gasLimit: Quantity.from(gasLimit), - mnemonic: "sweet treat" + chain: { + time: now, + }, miner: { + blockGasLimit: gasLimit, + }, wallet: { + mnemonic: "sweet treat" + } }); accounts = await provider.send("eth_accounts"); }); @@ -85,7 +89,7 @@ describe("api", () => { const blockNumber = parseInt(await provider.send("eth_blockNumber")); assert.strictEqual(blockNumber, startingBlockNumber + 2); - resolve(); + resolve(void 0); } else { reject(new Error("Unsubscribe didn't work!")); } diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 9a56f27287..884cc1ec5b 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -48,7 +48,7 @@ describe("api", () => { it("should mine a block on demand at the specified timestamp", async () => { const startDate = new Date(2019, 3, 15); const miningTimestamp = Math.floor((new Date(2020, 3, 15).getTime() / 1000)); - const provider = await getProvider({time: startDate}); + const provider = await getProvider({chain:{time: startDate}}); await provider.send("evm_mine", [miningTimestamp]); const currentBlock = await provider.send("eth_getBlockByNumber", ["latest"]); assert.strictEqual(parseInt(currentBlock.timestamp), miningTimestamp); @@ -64,7 +64,7 @@ describe("api", () => { }); it("should mine a block when in interval mode", async () => { - const provider = await getProvider({blockTime: 1000}); + const provider = await getProvider({miner:{blockTime: 1000}}); const initialBlock = parseInt(await provider.send("eth_blockNumber")); await provider.send("evm_mine"); const currentBlock = parseInt(await provider.send("eth_blockNumber")); @@ -72,7 +72,7 @@ describe("api", () => { }); it("should mine a block when in interval mode even when mining is stopped", async () => { - const provider = await getProvider({blockTime: 1000}); + const provider = await getProvider({miner:{blockTime: 1000}}); const initialBlock = parseInt(await provider.send("eth_blockNumber")); await provider.send("miner_stop"); await provider.send("evm_mine"); diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 0ac1f86628..9de5f675a7 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -17,7 +17,7 @@ describe("api", function() { const contract = compile(join(__dirname, "./snapshot.sol")); const p = await getProvider({ - defaultTransactionGasLimit: Quantity.from(6721975) + miner: {defaultTransactionGasLimit: 6721975} }); const accounts = await p.send("eth_accounts"); const from = accounts[3]; diff --git a/src/chains/ethereum/__tests__/api/miner/miner.test.ts b/src/chains/ethereum/__tests__/api/miner/miner.test.ts index 495ba0af8b..f1a6d07c04 100644 --- a/src/chains/ethereum/__tests__/api/miner/miner.test.ts +++ b/src/chains/ethereum/__tests__/api/miner/miner.test.ts @@ -60,7 +60,7 @@ describe("api", () => { }).timeout(3000); it("should stop mining, then mine when started", async () => { - const provider = await getProvider({blockTime: 1}); + const provider = await getProvider({miner:{blockTime: 1}}); await testStopStartMining(provider); }).timeout(4000); }); diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/__tests__/api/personal/personal.test.ts index 3cbf925134..b47553aec4 100644 --- a/src/chains/ethereum/__tests__/api/personal/personal.test.ts +++ b/src/chains/ethereum/__tests__/api/personal/personal.test.ts @@ -7,7 +7,7 @@ describe("api", () => { describe("personal", () => { describe("listAccounts", () => { it("matches eth_accounts", async () => { - const provider = await getProvider({ seed: "temet nosce" }); + const provider = await getProvider({wallet:{ seed: "temet nosce" }}); const accounts = await provider.send("eth_accounts"); const personalAccounts = await provider.send("personal_listAccounts"); assert.deepStrictEqual(personalAccounts, accounts); @@ -108,7 +108,7 @@ describe("api", () => { it("generates different accounts based on the `seed` option", async () => { const controlProvider = await getProvider(); - const provider = await getProvider({ seed: "temet nosce" }); + const provider = await getProvider({wallet:{ seed: "temet nosce" }}); const newAccount = await provider.send("personal_newAccount", [""]); const controlAccount = await controlProvider.send("personal_newAccount", [""]); assert.notStrictEqual(newAccount, controlAccount); @@ -116,7 +116,7 @@ describe("api", () => { it("generates different accounts based on the `mnemonic` option", async () => { const controlProvider = await getProvider(); - const provider = await getProvider({ mnemonic: "sweet treat" }); + const provider = await getProvider({wallet:{ mnemonic: "sweet treat" }}); const newAccount = await provider.send("personal_newAccount", [""]); const controlAccount = await controlProvider.send("personal_newAccount", [""]); assert.notStrictEqual(newAccount, controlAccount); @@ -131,7 +131,7 @@ describe("api", () => { it("generates different accounts on successive calls based on the seed", async () => { const controlProvider = await getProvider(); - const provider = await getProvider({ seed: "temet nosce" }); + const provider = await getProvider({wallet:{ seed: "temet nosce" }}); const firstNewAccount = await provider.send("personal_newAccount", [""]); const secondNewAccount = await provider.send("personal_newAccount", [""]); @@ -144,7 +144,7 @@ describe("api", () => { describe("personal_unlockAccount ➡ eth_sendTransaction ➡ personal_lockAccount", () => { it("generates locked accounts with passphrase", async () => { - const provider = await getProvider({gasPrice: Quantity.from(0x0)}); + const provider = await getProvider({miner:{gasPrice: 0}}); const passphrase = "this is my passphrase"; // generate an account const newAccount = await provider.send("personal_newAccount", [passphrase]); @@ -155,7 +155,7 @@ describe("api", () => { describe("personal_sendTransaction", () => { it("generates locked accounts with passphrase", async () => { - const provider = await getProvider({gasPrice: Quantity.from(0x0)}); + const provider = await getProvider({miner:{gasPrice: 0}}); const passphrase = "this is my passphrase"; // generate an account const newAccount = await provider.send("personal_newAccount", [passphrase]); @@ -177,7 +177,7 @@ describe("api", () => { describe("personal_unlockAccount ➡ eth_sendTransaction ➡ personal_lockAccount", () => { it("generates locked accounts with passphrase", async () => { - const provider = await getProvider({gasPrice: Quantity.from(0x0)}); + const provider = await getProvider({miner:{gasPrice: 0}}); const passphrase = "this is my passphrase"; // generate an account const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); @@ -188,7 +188,7 @@ describe("api", () => { describe("personal_sendTransaction", () => { it("generates locked accounts with passphrase", async () => { - const provider = await getProvider({gasPrice: Quantity.from(0x0)}); + const provider = await getProvider({miner:{gasPrice: 0}}); // generate an account const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); diff --git a/src/chains/ethereum/__tests__/helpers/getProvider.ts b/src/chains/ethereum/__tests__/helpers/getProvider.ts index 4569591380..793b57f94c 100644 --- a/src/chains/ethereum/__tests__/helpers/getProvider.ts +++ b/src/chains/ethereum/__tests__/helpers/getProvider.ts @@ -1,20 +1,35 @@ import { utils } from "@ganache/utils"; import EthereumProvider from "../../src/provider"; -import {ProviderOptions} from "@ganache/options"; +import { EthereumProviderOptions } from "../../src/options"; const { RequestCoordinator, Executor } = utils; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; -const getProvider = async (options: ProviderOptions = {mnemonic}) => { - const requestCoordinator = new RequestCoordinator(options.asyncRequestProcessing ? 0 : 1); - const executor = new Executor(requestCoordinator); - const provider = new EthereumProvider(options, executor); - await new Promise(resolve => { - provider.on("connect", () => { - requestCoordinator.resume(); - resolve(); - }) + +type Writeable = { -readonly [P in keyof T]: T[P] }; + +const getProvider = async (options: Writeable = {wallet: {mnemonic: mnemonic}}) => { + options.chain = options.chain || {}; + options.logging = options.logging || {}; + + // set `asyncRequestProcessing` to `true` by default + const doAsync = options.chain.asyncRequestProcessing; + options.chain.asyncRequestProcessing = doAsync != null ? doAsync : true; + + // don't write to stdout in tests + if (!options.logging.logger) { + options.logging.logger = {log:()=>{}}; + } + + const requestCoordinator = new RequestCoordinator(doAsync ? 0 : 1); + const executor = new Executor(requestCoordinator); + const provider = new EthereumProvider(options, executor); + await new Promise(resolve => { + provider.on("connect", () => { + requestCoordinator.resume(); + resolve(void 0); }); - return provider; + }); + return provider; } export default getProvider; diff --git a/src/chains/ethereum/__tests__/provider.test.ts b/src/chains/ethereum/__tests__/provider.test.ts index 6cbee1039e..b58da4334b 100644 --- a/src/chains/ethereum/__tests__/provider.test.ts +++ b/src/chains/ethereum/__tests__/provider.test.ts @@ -7,22 +7,22 @@ import EthereumApi from "../src/api"; describe("provider", () => { describe("options", () => { it("generates predictable accounts when given a seed", async () => { - const provider = await getProvider({seed: "temet nosce"}); + const provider = await getProvider({wallet:{seed: "temet nosce"}}); const accounts = await provider.send("eth_accounts"); assert.strictEqual(accounts[0], "0x59ef313e6ee26bab6bcb1b5694e59613debd88da"); }); }); describe("interface", () => { - const network_id = "1234"; + const networkId = 1234; let provider: EthereumProvider; beforeEach(async () => { - provider = await getProvider({network_id}); + provider = await getProvider({chain:{ networkId }}); }); it("returns things via EIP-1193", async () => { - assert.strictEqual(await provider.send("net_version"), network_id); + assert.strictEqual(await provider.send("net_version"), `${networkId}`); }); it("returns things via legacy", async () => { @@ -36,8 +36,8 @@ describe("provider", () => { return new Promise((resolve, reject) => { provider[method](jsonRpcRequest, (err: Error, {result}): void => { if(err) return reject(err); - assert.strictEqual(result, network_id); - resolve(); + assert.strictEqual(result, `${networkId}`); + resolve(void 0); }); }); }).map(async prom => { diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index dad4cabdcc..368ed52d69 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -1,8 +1,6 @@ import os from "os"; import fs from "fs"; import assert from "assert"; -import {Quantity} from "@ganache/utils"; -import {ProviderOptions} from "@ganache/options"; import getProvider from "./helpers/getProvider"; import compile from "./helpers/compile"; import { join } from "path"; @@ -17,7 +15,7 @@ describe("Random tests that are temporary!", () => { const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; it("should respect the BIP99 mnemonic", async () => { - const options = {mnemonic}; + const options = {wallet:{mnemonic}}; const p = await getProvider(options); const accounts = await p.send("eth_accounts"); @@ -25,7 +23,7 @@ describe("Random tests that are temporary!", () => { }); it("eth_sendTransaction", async () => { - const options = {mnemonic}; + const options = {wallet:{mnemonic}}; const p = await getProvider(options); const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); @@ -46,16 +44,16 @@ describe("Random tests that are temporary!", () => { it("should create its own mnemonic", async () => { const p = await getProvider(); const options = p.getOptions(); - assert.deepStrictEqual(typeof options.mnemonic, "string"); + assert.deepStrictEqual(typeof options.wallet.mnemonic, "string"); }); it("shouldn't allow initialization without accounts", async () => { - const options: ProviderOptions = {total_accounts: 0}; + const options = {wallet: {totalAccounts: 0}} as any; await assert.rejects(getProvider(options), { message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" }); - options.accounts = []; + options.wallet.accounts = []; await assert.rejects(getProvider(options), { message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" }); @@ -63,15 +61,15 @@ describe("Random tests that are temporary!", () => { it("sets up accounts", async () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); - const p = await getProvider({ + const p = await getProvider({wallet: { accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }); + }}); const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts.length, 2); }); it("sets errors when unlocked_accounts index is too high", async () => { - await assert.rejects(getProvider({unlocked_accounts: [99]}), { + await assert.rejects(getProvider({wallet: {unlockedAccounts: [99]}}), { message: "Account at index 99 not found. Max index available is 9." }); }); @@ -79,9 +77,9 @@ describe("Random tests that are temporary!", () => { it("sets errors when unlocked_accounts index is a (big) bigint", async () => { const bigNumber = BigInt(Number.MAX_SAFE_INTEGER) + 1n; await assert.rejects( - getProvider({ - unlocked_accounts: [bigNumber.toString()] - }), + getProvider({wallet:{ + unlockedAccounts: [bigNumber.toString()] + }}), { message: `Invalid value in unlocked_accounts: ${bigNumber}` } @@ -89,10 +87,11 @@ describe("Random tests that are temporary!", () => { }); it("unlocks accounts via unlock_accounts (both string and numbered numbers)", async () => { - const p = await getProvider({ - locked: true, - unlocked_accounts: ["0", 1] - }); + const p = await getProvider({wallet: { + mnemonic, + secure: true, + unlockedAccounts: ["0", 1] + }}); const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); @@ -141,7 +140,7 @@ describe("Random tests that are temporary!", () => { const contract = compile(join(__dirname, "./contracts/HelloWorld.sol")); const p = await getProvider({ - defaultTransactionGasLimit: Quantity.from(6721975) + miner: {defaultTransactionGasLimit: 6721975} }); const accounts = await p.send("eth_accounts"); const from = accounts[3]; @@ -200,7 +199,7 @@ describe("Random tests that are temporary!", () => { }); it("transfers value", async () => { - const p = await getProvider({gasPrice: Quantity.from(0)}); + const p = await getProvider({miner:{gasPrice: 0}}); const accounts = await p.send("eth_accounts"); const ONE_ETHER = 1000000000000000000n; const startingBalance = 100n * ONE_ETHER; @@ -224,9 +223,9 @@ describe("Random tests that are temporary!", () => { it("runs eth_call", async () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); - const p = await getProvider({ + const p = await getProvider({wallet:{ accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }); + }}); const accounts = await p.send("eth_accounts"); const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); assert(result, "0x"); @@ -246,13 +245,13 @@ describe("Random tests that are temporary!", () => { cleanUp(); }); it("should create the file by name", async () => { - await getProvider({ account_keys_path: fileName }); + await getProvider({wallet:{ accountKeysPath: fileName }}); assert.strictEqual(fs.existsSync(fileName), true, "The account_keys file doesn't exist."); }); it("should populate the file by descriptor", async () => { const fd = fs.openSync(fileName, "w") try { - await getProvider({ account_keys_path: fd }); + await getProvider({wallet: { accountKeysPath: fd }}); assert.strictEqual(fs.existsSync(fileName), true, "The account_keys file doesn't exist."); } finally{ fs.closeSync(fd); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 5fbd7d0b97..0545e04dec 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,9 +1,9 @@ //#region Imports import { toRpcSig, KECCAK256_NULL, ecsign, hashPersonalMessage } from "ethereumjs-util"; import { TypedData as NotTypedData, signTypedData_v4 } from "eth-sig-util"; -import EthereumOptions from "./options"; +import { EthereumInternalOptions } from "./options"; import { types, Data, Quantity } from "@ganache/utils"; -import Blockchain, { BlockchainOptions } from "./blockchain"; +import Blockchain from "./blockchain"; import Tag from "./things/tags"; import {VM_EXCEPTION, VM_EXCEPTIONS} from "./things/errors"; import Address from "./things/address"; @@ -86,7 +86,7 @@ function parseFilter(filter: FilterArgs = {address: [], topics: []}, blockchain: } function assertExceptionalTransactions(transactions: Transaction[]) { - let baseError = null; + let baseError: string = null; let errors: string[]; const data = {}; @@ -133,7 +133,7 @@ export default class EthereumApi implements types.Api { readonly #filters = new Map(); readonly #subscriptions = new Map(); readonly #blockchain: Blockchain; - readonly #options: EthereumOptions; + readonly #options: EthereumInternalOptions; readonly #wallet: Wallet; /** @@ -143,47 +143,48 @@ export default class EthereumApi implements types.Api { * @param options * @param ready Callback for when the API is fully initialized */ - constructor(options: EthereumOptions, emitter: Emittery.Typed<{message: any}, "connect" | "disconnect">) { + constructor(options: EthereumInternalOptions, emitter: Emittery.Typed<{message: any}, "connect" | "disconnect">) { const opts = (this.#options = options); - const {initialAccounts} = this.#wallet = new Wallet(opts); + const {initialAccounts} = this.#wallet = new Wallet(opts.wallet); - const blockchainOptions = options as any as BlockchainOptions; - blockchainOptions.initialAccounts = initialAccounts; - - switch (typeof options.coinbase) { + let coinbaseAddress: Address; + switch (typeof options.miner.coinbase) { + case "object": + coinbaseAddress = options.miner.coinbase; + break; case "number": - const account = blockchainOptions.initialAccounts[options.coinbase]; + const account = initialAccounts[options.miner.coinbase]; if (account) { - blockchainOptions.coinbaseAddress = account.address; + coinbaseAddress = account.address; } else { - throw new Error(`invalid coinbase address index: ${options.coinbase}`); + throw new Error(`invalid coinbase address index: ${options.miner.coinbase}`); } break; case "string": - blockchainOptions.coinbaseAddress = Address.from(options.coinbase); + coinbaseAddress = Address.from(options.miner.coinbase); break; default: { - throw new Error(`coinbase address must be string or number, received: ${options.coinbase}`); + throw new Error(`coinbase address must be string or number, received: ${options.miner.coinbase}`); } } - this.#common = blockchainOptions.common = Common.forCustomChain( + const common = this.#common = Common.forCustomChain( // if we were given a chain id that matches a real chain, use it // NOTE: I don't think Common serves a purpose ther than instructing the // VM what hardfork is in use. But just incase things change in the future // its configured "more correctly" here. - KNOWN_CHAINIDS.has(options.chainId) ? options.chainId : 1, + KNOWN_CHAINIDS.has(options.chain.chainId) ? options.chain.chainId : 1, { name: "ganache", - networkId: options.networkId, - chainId: options.chainId, + networkId: options.chain.networkId, + chainId: options.chain.chainId, comment: "Local test network" }, - options.hardfork + options.chain.hardfork ); - const blockchain = (this.#blockchain = new Blockchain(blockchainOptions)); + const blockchain = (this.#blockchain = new Blockchain(options, common, initialAccounts, coinbaseAddress)); blockchain.on("start", () => { emitter.emit("connect"); }); @@ -242,11 +243,11 @@ export default class EthereumApi implements types.Api { //#region bzz async bzz_hive() { - return [] as any[]; + return []; } async bzz_info() { - return [] as any[]; + return []; } //#endregion @@ -262,13 +263,76 @@ export default class EthereumApi implements types.Api { @assertArgLength(0, 1) async evm_mine(timestamp?: number) { const transactions = await this.#blockchain.mine(-1, timestamp, true); - if (this.#options.vmErrorsOnRPCResponse) { + if (this.#options.chain.vmErrorsOnRPCResponse) { assertExceptionalTransactions(transactions); } return "0x0"; } + async evm_setStorageAt( + address: string, + position: bigint | number, + storage: string, + blockNumber: string | Buffer | Tag = Tag.LATEST + ) { + const blockProm = this.#blockchain.blocks.getRaw(blockNumber); + + const trie = this.#blockchain.trie.copy(); + const getFromTrie = (address: Buffer): Promise => + new Promise((resolve, reject) => { + trie.get(address, (err, data) => { + if (err) return void reject(err); + resolve(data); + }); + }); + const block = await blockProm; + if (!block) throw new Error("header not found"); + + const blockData = (rlpDecode(block) as unknown) as [ + [Buffer, Buffer, Buffer, Buffer /* stateRoot */] /* header */, + Buffer[], + Buffer[] + ]; + const headerData = blockData[0]; + const blockStateRoot = headerData[3]; + trie.root = blockStateRoot; + + const addressDataPromise = getFromTrie(Address.from(address).toBuffer()); + + const posBuff = Quantity.from(position).toBuffer(); + const length = posBuff.length; + let paddedPosBuff: Buffer; + if (length < 32) { + // storage locations are 32 bytes wide, so we need to expand any value + // given to 32 bytes. + paddedPosBuff = Buffer.allocUnsafe(32).fill(0); + posBuff.copy(paddedPosBuff, 32 - length); + } else if (length === 32) { + paddedPosBuff = posBuff; + } else { + // if the position value we're passed is > 32 bytes, truncate it. This is + // what geth does. + paddedPosBuff = posBuff.slice(-32); + } + + const addressData = await addressDataPromise; + // An address's stateRoot is stored in the 3rd rlp entry + this.#blockchain.trie.root = ((rlpDecode(addressData) as any) as [ + Buffer /*nonce*/, + Buffer /*amount*/, + Buffer /*stateRoot*/, + Buffer /*codeHash*/ + ])[2]; + + return new Promise((resolve, reject) => { + this.#blockchain.trie.put(paddedPosBuff, storage, (err) => { + if(err) return reject(err); + resolve(void 0); + }); + }); + } + /** * Sets the given account's nonce to the specified value. Mines a new block * before returning. @@ -427,10 +491,10 @@ export default class EthereumApi implements types.Api { * @returns true */ async miner_start(threads: number = 1) { - if (this.#options.legacyInstamine === true) { + if (this.#options.miner.legacyInstamine === true) { const transactions = await this.#blockchain.resume(threads); - if (transactions != null && this.#options.vmErrorsOnRPCResponse) { - assertExceptionalTransactions(transactions as any); + if (transactions != null && this.#options.chain.vmErrorsOnRPCResponse) { + assertExceptionalTransactions(transactions); } } else { this.#blockchain.resume(threads); @@ -452,8 +516,8 @@ export default class EthereumApi implements types.Api { * Any transactions that are below this limit are excluded from the mining * process. */ - async miner_setGasPrice(number: Quantity) { - this.#options.gasPrice = number; + async miner_setGasPrice(number: string) { + this.#options.miner.gasPrice = Quantity.from(number); return true; } @@ -493,7 +557,7 @@ export default class EthereumApi implements types.Api { * Quantity/Data encoded. */ async net_version() { - return this.#options.networkId.toString(); + return this.#options.chain.networkId.toString(); } /** @@ -549,7 +613,7 @@ export default class EthereumApi implements types.Api { tx.gasLimit = tx.gas; } else { // eth_estimateGas isn't subject to regular transaction gas limits - tx.gas = tx.gasLimit = options.callGasLimit.toBuffer(); + tx.gas = tx.gasLimit = options.miner.callGasLimit.toBuffer(); } } const newBlock = blocks.createBlock({ @@ -567,7 +631,7 @@ export default class EthereumApi implements types.Api { skipBalance: true, skipNonce: true }; - estimateGas(generateVM, runArgs, (err, result) => { + estimateGas(generateVM, runArgs, (err: Error, result: any) => { if(err) return reject(err); resolve(Quantity.from(result.gasEstimate.toBuffer())); }); @@ -773,7 +837,7 @@ export default class EthereumApi implements types.Api { * @returns integer of the current gas price in wei. */ async eth_gasPrice() { - return this.#options.gasPrice; + return this.#options.miner.gasPrice; } /** @@ -800,7 +864,7 @@ export default class EthereumApi implements types.Api { * @EIP [155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) */ async eth_chainId() { - return Quantity.from(this.#options.chainId); + return Quantity.from(this.#options.chain.chainId); } /** @@ -1014,16 +1078,11 @@ export default class EthereumApi implements types.Api { const tx = Transaction.fromJSON(transaction, this.#common, type); if (tx.gasLimit.length === 0) { - tx.gasLimit = this.#options.defaultTransactionGasLimit.toBuffer(); + tx.gasLimit = this.#options.miner.defaultTransactionGasLimit.toBuffer(); } if (tx.gasPrice.length === 0) { - const gasPrice = this.#options.gasPrice; - if (gasPrice instanceof Quantity) { - tx.gasPrice = gasPrice.toBuffer(); - } else { - tx.gasPrice = Quantity.from(gasPrice as any).toBuffer(); - } + tx.gasPrice = this.#options.miner.gasPrice.toBuffer(); } if (tx.value.length === 0) { @@ -1048,7 +1107,7 @@ export default class EthereumApi implements types.Api { * @returns The transaction hash */ async eth_sendRawTransaction(transaction: string) { - const tx = new Transaction(transaction, {common: this.#common}, Transaction.types.signed); + const tx = new Transaction(transaction, this.#common, Transaction.types.signed); return this.#blockchain.queueTransaction(tx) } @@ -1075,7 +1134,7 @@ export default class EthereumApi implements types.Api { const messageHash = hashPersonalMessage(Data.from(message).toBuffer()); const signature = ecsign(messageHash, privateKey.toBuffer()); - return toRpcSig(signature.v, signature.r, signature.s, +this.#options.chainId); + return toRpcSig(signature.v, signature.r, signature.s, +this.#options.chain.chainId); } /** @@ -1318,7 +1377,7 @@ export default class EthereumApi implements types.Api { value.updates.push(...blockLogs.filter(addresses, topics)); } }); - const value = {updates: [] as any[], unsubscribe, filter, type: FilterTypes.log}; + const value = {updates: [], unsubscribe, filter, type: FilterTypes.log}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1440,11 +1499,11 @@ export default class EthereumApi implements types.Api { let gas: Quantity; if (typeof transaction.gasLimit === "undefined") { - if (typeof transaction.gas === undefined){ + if (typeof transaction.gas !== "undefined"){ gas = Quantity.from(transaction.gas); } else { // eth_call isn't subject to regular transaction gas limits by default - gas = options.callGasLimit; + gas = options.miner.callGasLimit; } } else { @@ -1505,7 +1564,7 @@ export default class EthereumApi implements types.Api { } const wallet = this.#wallet; - const newAccount = wallet.createRandomAccount(this.#options.mnemonic); + const newAccount = wallet.createRandomAccount(this.#options.wallet.mnemonic); const address = newAccount.address; const strAddress = address.toString(); const encryptedKeyFile = await wallet.encrypt(newAccount.privateKey, passphrase); @@ -1595,14 +1654,13 @@ export default class EthereumApi implements types.Api { throw new Error("no key for given address or file"); } let tx: Transaction; - const options = {common: this.#common} if (encryptedKeyFile !== null) { const secretKey = await wallet.decrypt(encryptedKeyFile, passphrase); - tx = new Transaction(transaction, options); + tx = new Transaction(transaction, this.#common); tx.sign(secretKey); } else { - tx = new Transaction(transaction, options, Transaction.types.fake); + tx = new Transaction(transaction, this.#common, Transaction.types.fake); } return this.#blockchain.queueTransaction(tx); @@ -1686,7 +1744,7 @@ export default class EthereumApi implements types.Api { * @returns More Info: https://github.com/ethereum/wiki/wiki/JSON-RPC#shh_getfilterchanges */ async shh_getFilterChanges(id: string) { - return [] as any[]; + return []; }; /** diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 742ce4c43d..288a92687a 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -25,6 +25,7 @@ import BlockLogManager from "./components/blocklog-manager"; import RejectionError from "./things/rejection-error"; import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; import { VmError, ERROR } from "ethereumjs-vm/dist/exceptions"; +import { EthereumInternalOptions } from "./options"; type SimulationTransaction = { @@ -66,27 +67,6 @@ export enum Status { paused = 16 // 0001 0000 } -interface Logger { - log(message?: any, ...optionalParams: any[]): void; -} - -export type BlockchainOptions = { - db?: string | object; - db_path?: string; - initialAccounts?: Account[]; - hardfork?: string; - allowUnlimitedContractSize?: boolean; - gasLimit?: Quantity; - time?: Date; - blockTime?: number; - coinbaseAddress: Address; - chainId: number; - common: Common; - legacyInstamine: boolean; - vmErrorsOnRPCResponse: boolean; - logger: Logger -}; - type BlockchainTypedEvents = {block: Block, blockLogs: BlockLogs, pendingTransaction: Transaction}; type BlockchainEvents = "start" | "stop" | "step"; @@ -102,7 +82,8 @@ export default class Blockchain extends Emittery.Typed { - const blocks = this.blocks = await BlockManager.initialize(database.blockIndexes, database.blocks, {common: options.common}); + const blocks = this.blocks = await BlockManager.initialize(common, database.blockIndexes, database.blocks); // if we have a latest block, use it to set up the trie. const latest = blocks.latest; @@ -151,25 +132,25 @@ export default class Blockchain extends Emittery.Typed this.#isPaused() ? null : this.mine(1); @@ -192,7 +175,7 @@ export default class Blockchain extends Emittery.Typed unref(setTimeout(mineNext, options.blockTime * 1000)); + const wait = () => unref(setTimeout(mineNext, options.miner.blockTime * 1000)); const mineNext = () => mineAll().then(wait); wait(); } @@ -214,7 +197,7 @@ export default class Blockchain extends Emittery.Typed { blocks.latest = block; - if (instamine && options.legacyInstamine) { + if (instamine && options.miner.legacyInstamine) { block.value.transactions.forEach(transaction => { - const error = this.#options.vmErrorsOnRPCResponse ? transaction.execException : null + const error = options.chain.vmErrorsOnRPCResponse ? transaction.execException : null this.emit("transaction:" + Data.from(transaction.hash(), 32).toString() as any, error); }); @@ -316,7 +299,7 @@ export default class Blockchain extends Emittery.Typed= 0) { const stateTrie = new CheckpointTrie(this.#database.trie, parentBlock.value.header.stateRoot); @@ -583,12 +566,13 @@ export default class Blockchain extends Emittery.Typed { */ public pending: Block; - #options: {common: Common}; + #common: Common; #blockIndexes: LevelUp; - static async initialize(blockIndexes: LevelUp, base: LevelUp, options: {common: Common}) { - const bm = new BlockManager(blockIndexes, base, options); + static async initialize(common: Common, blockIndexes: LevelUp, base: LevelUp) { + const bm = new BlockManager(common, blockIndexes, base); await bm.updateTaggedBlocks(); return bm; } - constructor(blockIndexes: LevelUp, base: LevelUp, options: {common: Common}) { - super(base, Block, options); + constructor(common: Common, blockIndexes: LevelUp, base: LevelUp) { + super(base, Block, common); - this.#options = options; + this.#common = common; this.#blockIndexes = blockIndexes; } @@ -95,7 +94,7 @@ export default class BlockManager extends Manager { * @param header */ createBlock(header: {}): Block { - const block = new Block(null, this.#options); + const block = new Block(null, this.#common); // TODO: make better Object.assign(block.value.header, header); return block; @@ -150,24 +149,24 @@ export default class BlockManager extends Manager { return new Promise((resolve, reject) => { this.base.createValueStream({limit: 1}) .on("data", (data: Buffer) => { - this.earliest = new Block(data, this.#options); + this.earliest = new Block(data, this.#common); }) .on("error", (err: Error) => { reject(err); }) - .on("end", () => { - resolve(); + .on("end", () => { + resolve(void 0); }); this.base.createValueStream({reverse: true, limit: 1}) .on("data", (data: Buffer) => { - this.latest = new Block(data, this.#options); + this.latest = new Block(data, this.#common); }) .on("error", (err: Error) => { reject(err); }) - .on("end", () => { - resolve(); + .on("end", () => { + resolve(void 0); }); }) } @@ -175,19 +174,19 @@ export default class BlockManager extends Manager { export class Block { public readonly value: EthereumJsBlock; - constructor(raw: Buffer, options: {common: Common}) { + constructor(raw: Buffer, common: Common) { if (raw) { const data = (rlpDecode(raw) as any) as [Buffer[], Buffer[], Buffer[]]; - this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, options); + this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, {common}); const rawTransactions = data[1]; // parse transactions so we can use our own transaction class for (let i = 0; i < rawTransactions.length; i++) { - const tx = new Transaction(rawTransactions[i], {common: options.common}); + const tx = new Transaction(rawTransactions[i], common); this.value.transactions.push(tx); } } else { - this.value = new EthereumJsBlock(null, options); + this.value = new EthereumJsBlock(null, {common}); } } diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/components/transaction-manager.ts index 063ef7df58..6390f2cedf 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/components/transaction-manager.ts @@ -1,22 +1,19 @@ import Transaction from "../things/transaction"; import Manager from "./manager"; -import TransactionPool, {TransactionPoolOptions} from "./transaction-pool"; +import TransactionPool from "./transaction-pool"; +import { EthereumInternalOptions } from "../options"; import { LevelUp } from "levelup"; import Blockchain from "../blockchain"; import { Data } from "@ganache/utils"; import Common from "ethereumjs-common"; -export type TransactionManagerOptions = TransactionPoolOptions & { - common: Common -}; - export default class TransactionManager extends Manager { public transactionPool: TransactionPool; - constructor(blockchain: Blockchain, base: LevelUp, options: TransactionManagerOptions) { - super(base, Transaction, {common: options.common}); + constructor(options: EthereumInternalOptions["miner"], common: Common, blockchain: Blockchain, base: LevelUp) { + super(base, Transaction, common); - this.transactionPool = new TransactionPool(blockchain, options); + this.transactionPool = new TransactionPool(options, blockchain); this.transactionPool.on("drain", () => { // TODO: create "pending" block? }); diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index 304c2aa5c1..db5dfe721a 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -6,25 +6,14 @@ import Transaction from "../things/transaction"; import {Data, Quantity} from "@ganache/utils"; import {GAS_LIMIT, INTRINSIC_GAS_TOO_LOW} from "../things/errors"; import CodedError, { ErrorCodes } from "../things/coded-error"; - -export type TransactionPoolOptions = { - /** - * TODO: use this value. - */ - gasPrice?: Quantity; - - /** - * Minimum gas price to enforce for acceptance into the pool - */ - gasLimit?: Quantity; -}; +import { EthereumInternalOptions } from "../options"; function byNonce(values: Transaction[], a: number, b: number) { return (Quantity.from(values[b].nonce).toBigInt() || 0n) > (Quantity.from(values[a].nonce).toBigInt() || 0n); } export default class TransactionPool extends Emittery.Typed<{}, "drain"> { - #options: TransactionPoolOptions; + #options: EthereumInternalOptions["miner"]; /** * Minimum price bump percentage to replace an already existing transaction (nonce) @@ -32,16 +21,16 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { public priceBump: bigint = 10n; #blockchain: Blockchain; - constructor(blockchain: Blockchain, options: TransactionPoolOptions) { + constructor(options: EthereumInternalOptions["miner"], blockchain: Blockchain) { super(); this.#blockchain = blockchain; this.#options = options; } - public executables: Map> = new Map(); - #origins: Map, - nonce: bigint + public executables: Map }> = new Map(); + #origins: Map> = new Map(); #accountPromises = new Map>(); /** @@ -71,10 +60,8 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { const origin = from.toString(); const origins = this.#origins; - let queuedOrigin = origins.get(origin); + let queuedOriginTransactions = origins.get(origin); - // since we don't have any pending transactions for this account - // verify the transaction's nonce is valid against the persisted account // Note: we need to lock on this async request to ensure we always process // incoming requests in the order they were received! It is possible for // the file IO performed by `accounts.get` to vary. @@ -82,15 +69,15 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { transactorPromise && await transactorPromise; let highestNonce = 0n; - let queuedOriginTransactions: utils.Heap; - if (queuedOrigin) { - highestNonce = queuedOrigin.nonce; - queuedOriginTransactions = queuedOrigin.transactions; - } let isExecutableTransaction = false; const executables = this.executables; - let executableOriginTransactions = executables.get(origin); + let executableOrigin = executables.get(origin); + let executableOriginTransactions: utils.Heap; + if (executableOrigin) { + highestNonce = executableOrigin.nonce; + executableOriginTransactions = executableOrigin.transactions; + } let length: number; if (executableOriginTransactions && (length = executableOriginTransactions.length)) { @@ -177,20 +164,12 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // if it is executable add it to the executables queue if (isExecutableTransaction) { if (executableOriginTransactions) { + executableOrigin.nonce = highestNonce; executableOriginTransactions.push(transaction); } else { // if we don't yet have a executables queue for this origin make one now executableOriginTransactions = utils.Heap.from(transaction, byNonce); - executables.set(origin, executableOriginTransactions); - } - if (queuedOrigin) { - queuedOrigin.nonce = highestNonce; - } else { - origins.set(origin, { - nonce: highestNonce, - // note: queuedOriginTransactions might be undefined here, and that's okay. - transactions: queuedOriginTransactions - }); + executables.set(origin, {nonce: highestNonce, transactions: executableOriginTransactions}); } this.#drainQueued(origin, queuedOriginTransactions, executableOriginTransactions, transactionNonce); @@ -200,10 +179,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { queuedOriginTransactions.push(transaction); } else { queuedOriginTransactions = utils.Heap.from(transaction, byNonce); - origins.set(origin, { - nonce: highestNonce, - transactions: queuedOriginTransactions - }); + origins.set(origin, queuedOriginTransactions); } return false; } @@ -222,8 +198,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { } } - for (let [_, origin] of this.#origins) { - const transactions = origin.transactions; + for (let [_, transactions] of this.#origins) { if (transactions === undefined) continue; for (let tx of transactions.array) { if (tx.hash().equals(transactionHash)) { @@ -275,7 +250,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { validateTransaction = (transaction: Transaction): Error => { // Check the transaction doesn't exceed the current block limit gas. - if (Quantity.from(transaction.gasLimit) > this.#options.gasLimit) { + if (Quantity.from(transaction.gasLimit) > this.#options.blockGasLimit) { return new CodedError(GAS_LIMIT, ErrorCodes.INVALID_INPUT); } diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index 06e77dd7a3..493bd5504c 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -3,19 +3,18 @@ import Emittery from "emittery"; import {dir, setGracefulCleanup} from "tmp-promise"; import levelup, { LevelUp } from "levelup"; import Blockchain from "./blockchain"; +import { EthereumInternalOptions } from "./options"; const leveldown = require("leveldown"); const sub = require("subleveldown"); const encode = require("encoding-down"); -type DatabaseOptions = {db?: string | object; db_path?: string}; - setGracefulCleanup(); const tmpOptions = {prefix: "ganache-core_", unsafeCleanup: true}; -const noop = (callback: () => void): void => callback(); +const noop = () => Promise.resolve(); export default class Database extends Emittery { public readonly blockchain: Blockchain; - readonly #options: DatabaseOptions; + readonly #options: EthereumInternalOptions["database"]; #cleanupDirectory = noop; #closed = false; public directory: string = null; @@ -35,10 +34,10 @@ export default class Database extends Emittery { * Once the database has been fully initialized it will emit a `ready` * event. * @param options Supports one of two options: `db` (a leveldown compliant - * store instance) or `db_path` (the path to store/read the db instance) + * store instance) or `dbPath` (the path to store/read the db instance) * @param blockchain */ - constructor(options: DatabaseOptions, blockchain: Blockchain) { + constructor(options: EthereumInternalOptions["database"], blockchain: Blockchain) { super(); this.#options = options; @@ -52,9 +51,9 @@ export default class Database extends Emittery { let db: levelup.LevelUp; if (store) { this.#rootStore = encode(store, levelupOptions); - db = levelup(this.#rootStore as any, {}); + db = levelup(this.#rootStore, {}); } else { - let directory = this.#options.db_path; + let directory = this.#options.dbPath; if (!directory) { const dirInfo = await dir(tmpOptions); directory = dirInfo.path; @@ -149,10 +148,10 @@ export default class Database extends Emittery { if (db) { await new Promise((resolve, reject) => db.close((err => { if (err) return void reject(err); - resolve(); + resolve(void 0); }))); await Promise.all([this.blocks.close(), this.transactions.close(), this.trie.close()]); } - return new Promise(resolve => this.#cleanupDirectory(resolve)); + return this.#cleanupDirectory(); }; } diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 456e52da0b..e65895c701 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -1,22 +1,23 @@ -import {ProviderOptions} from "@ganache/options"; import Emittery from "emittery"; import EthereumApi from "./api"; import {JsonRpcTypes, types, utils} from "@ganache/utils"; -import Provider from "./provider"; +import EthereumProvider from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; import CodedError, { ErrorCodes } from "./things/coded-error"; +import { EthereumProviderOptions } from "./options"; function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest { return connection.constructor.name === "uWS.HttpRequest" } -export type EthereumProvider = Provider; -export const EthereumProvider = Provider; +export type ProviderOptions = EthereumProviderOptions; +export const Provider = EthereumProvider; +export const FlavorName = "ethereum" as const; -export class EthereumConnector extends Emittery.Typed +export class Connector extends Emittery.Typed implements types.Connector | JsonRpcTypes.Request[], JsonRpcTypes.Response> { - #provider: Provider; + #provider: EthereumProvider; get provider() { return this.#provider; @@ -45,7 +46,7 @@ export class EthereumConnector extends Emittery.Typed this.#handle(payload, connection) .then(({value}) => value).catch(e => e)); - return Promise.resolve({value: Promise.all(promises)} as any); + return Promise.resolve({value: Promise.all(promises)}); } else { return this.#handle(payload, connection); } diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 2d9d9fcb99..147f9c262d 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -8,6 +8,7 @@ import Emittery from "emittery"; import Block from "ethereumjs-block"; import VM from "ethereumjs-vm"; import {encode as rlpEncode} from "rlp"; +import { EthereumInternalOptions } from "./options"; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); @@ -29,12 +30,6 @@ function replaceFromHeap( } } -type MinerOptions = { - gasLimit?: Quantity; - instamine: boolean; - legacyInstamine: boolean -}; - function byPrice(values: Transaction[], a: number, b: number) { return Quantity.from(values[a].gasPrice) > Quantity.from(values[b].gasPrice); } @@ -44,7 +39,8 @@ export default class Miner extends Emittery { #origins = new Set(); #pending: Map>; #isMining: boolean = false; - readonly #options: MinerOptions; + readonly #options: EthereumInternalOptions["miner"]; + readonly #instamine: boolean; readonly #vm: VM; readonly #checkpoint: () => Promise; readonly #commit: () => Promise; @@ -53,12 +49,13 @@ export default class Miner extends Emittery { // create a Heap that sorts by gasPrice readonly #priced = new utils.Heap(byPrice); - constructor(vm: VM, createBlock: (previousBlock: Block) => Block, options: MinerOptions) { + constructor(options: EthereumInternalOptions["miner"], instamine: boolean, vm: VM, createBlock: (previousBlock: Block) => Block) { super(); const stateManager = vm.stateManager; this.#vm = vm; this.#options = options; + this.#instamine = instamine; this.#checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); this.#commit = promisify(stateManager.commit.bind(stateManager)); this.#revert = promisify(stateManager.revert.bind(stateManager)); @@ -101,7 +98,7 @@ export default class Miner extends Emittery { const nextBlock = this.#createBlock(lastBlock); const pending = this.#pending; this.#pending = null; - await this.mine(pending, nextBlock, this.#options.instamine ? 1 : -1); + await this.mine(pending, nextBlock, this.#instamine ? 1 : -1); } return transactions; } @@ -137,7 +134,7 @@ export default class Miner extends Emittery { } let numTransactions = 0; - let blockGasLeft = this.#options.gasLimit.toBigInt(); + let blockGasLeft = this.#options.blockGasLimit.toBigInt(); const promises: Promise[] = []; @@ -173,7 +170,7 @@ export default class Miner extends Emittery { this.#currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); const runArgs = { - tx: best as any, + tx: best, block }; // Set a transaction-level checkpoint so we can undo state changes in @@ -275,7 +272,7 @@ export default class Miner extends Emittery { this.#updatePricedHeap(pending); if (priced.length !== 0) { - maxTransactions = this.#options.instamine ? 1 : -1; + maxTransactions = this.#instamine ? 1 : -1; block = this.#createBlock(block); continue; } else { @@ -308,7 +305,7 @@ export default class Miner extends Emittery { } } else { // TODO: handle other errors? Maybe there are some that allow this tx to - //be run again later? For now, just remove it so stuff works. + // be run again later? For now, just remove it so stuff works. // Update the `priced` heap with the next best transaction from this // account diff --git a/src/chains/ethereum/src/options.ts b/src/chains/ethereum/src/options.ts deleted file mode 100644 index a55a6ecf78..0000000000 --- a/src/chains/ethereum/src/options.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {ProviderOptions} from "@ganache/options"; - -type EthereumOptions = Required>; - -export default EthereumOptions; diff --git a/src/chains/ethereum/src/options/chain-options.ts b/src/chains/ethereum/src/options/chain-options.ts new file mode 100644 index 0000000000..f2ff052b18 --- /dev/null +++ b/src/chains/ethereum/src/options/chain-options.ts @@ -0,0 +1,107 @@ +import { Definitions } from "@ganache/options"; + +export type Hardfork = "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier"; + +export type ChainConfig = { + options: { + /** + * Allows unlimited contract sizes while debugging. By setting this to + * `true`, the check within the EVM for a contract size limit of 24KB (see + * [EIP-170](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-170.md)) + * is bypassed. Setting this to `true` will cause ganache to behave + * differently than production environments. You should only set this to + * `true` during local debugging. + * + * Default is `false`. + */ + readonly allowUnlimitedContractSize: { + type: boolean; + hasDefault: true; + } + + readonly asyncRequestProcessing: { + type: boolean; + hasDefault: true; + } + + /** + * The currently configured chain id, a value used in replay-protected + * transaction signing as introduced by + * [EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md). + * + * Defaults to `1337`. + */ + readonly chainId: { + type: number; + hasDefault: true; + } + + /** + * The id of the network returned by the RPC method `net_version`. + * + * Defaults to the current timestamp, via JavaScript's `Date.now()` (the + * number of millisconds since the UNIX epoch). + */ + readonly networkId: { + type: number; + hasDefault: true; + } + + /** + * Date that the first block should start. Use this feature, along with the + * `evm_increaseTime` RPC, to test time-dependent code. + */ + readonly time: { + type: number | Date; + } + + /** + * Set the hardfork rules for the EVM. + */ + readonly hardfork: { + type: Hardfork; + hasDefault: true; + } + + /** + * Whether to report runtime errors from EVM code as RPC errors. + * + * Defaults to `false`. + */ + readonly vmErrorsOnRPCResponse: { + type: boolean; + hasDefault: true; + } + }, + exclusiveGroups: [] +} + +export const ChainOptions: Definitions = { + allowUnlimitedContractSize: { + normalize: rawInput => rawInput, + default: () => false + }, + asyncRequestProcessing: { + normalize: rawInput => rawInput, + default: () => true + }, + chainId: { + normalize: rawInput => rawInput, + default: () => 1337 + }, + networkId: { + normalize: rawInput => rawInput, + default: () => Date.now() + }, + time: { + normalize: rawInput => rawInput + }, + hardfork: { + normalize: rawInput => rawInput, + default: () => "muirGlacier" + }, + vmErrorsOnRPCResponse: { + normalize: rawInput => rawInput, + default: () => false + } +}; diff --git a/src/chains/ethereum/src/options/database-options.ts b/src/chains/ethereum/src/options/database-options.ts new file mode 100644 index 0000000000..6454199b56 --- /dev/null +++ b/src/chains/ethereum/src/options/database-options.ts @@ -0,0 +1,33 @@ +import { Definitions } from "@ganache/options"; + +export type DatabaseConfig = { + options: { + /** + * Specify an alternative database instance, for instance MemDOWN. + */ + readonly db: { + type: string | object; + } + /** + * Specify a path to a directory to save the chain database. If a database + * already exists, that chain will be initialized instead of creating a new + * one. + */ + readonly dbPath: { + type: string; + } + }, + exclusiveGroups: [ + ["db", "dbPath"] + ] +} + +export const DatabaseOptions: Definitions = { + db: { + normalize: rawInput => rawInput, + }, + dbPath: { + normalize: rawInput => rawInput, + legacyName: "db_path" + } +}; diff --git a/src/chains/ethereum/src/options/index.ts b/src/chains/ethereum/src/options/index.ts new file mode 100644 index 0000000000..d47e57f640 --- /dev/null +++ b/src/chains/ethereum/src/options/index.ts @@ -0,0 +1,36 @@ +import { ChainConfig, ChainOptions } from "./chain-options"; +import { DatabaseConfig, DatabaseOptions } from "./database-options"; +import { LoggingConfig, LoggingOptions } from "./logging-options"; +import { MinerConfig, MinerOptions } from "./miner-options"; +import { WalletConfig, WalletOptions } from "./wallet-options"; +import { Defaults, Definitions, ExternalConfig, InternalConfig, OptionsConfig } from "@ganache/options"; + +export type EthereumOptions = { + chain: ChainConfig; + database: DatabaseConfig; + logging: LoggingConfig; + miner: MinerConfig; + wallet: WalletConfig; +}; + +export type EthereumProviderOptions = Partial<{ + [K in keyof EthereumOptions]: ExternalConfig; +}> + +export type EthereumInternalOptions = { + [K in keyof EthereumOptions]: InternalConfig; +} + +export type EthereumDefaults = { + [K in keyof EthereumOptions]: Definitions; +}; + +export const ethereumDefaults: Defaults = { + chain: ChainOptions, + database: DatabaseOptions, + logging: LoggingOptions, + miner: MinerOptions, + wallet: WalletOptions +}; + +export const EthereumOptionsConfig = new OptionsConfig(ethereumDefaults); diff --git a/src/chains/ethereum/src/options/logging-options.ts b/src/chains/ethereum/src/options/logging-options.ts new file mode 100644 index 0000000000..bc3b1eb41c --- /dev/null +++ b/src/chains/ethereum/src/options/logging-options.ts @@ -0,0 +1,64 @@ +import { Definitions } from "@ganache/options"; + +export type LoggingConfig = { + options: { + /** + * Set to `true` to log EVM opcodes. + * + * Defaults to `false`. + */ + readonly debug: { + type: boolean; + hasDefault: true; + } + + /** + * An object, like `console`, that implements a `log` function. + * + * Defaults to `console` (logs to stdout). + * + * @example + * ```typescript + * { + * log: (message: any) => { + * // handle `message` + * } + * } + * ``` + */ + readonly logger: { + type: { + log(message?: any, ...optionalParams: any[]): void; + }; + hasDefault: true; + } + + /** + * Set to `true` to log all RPC requests and responses. + * + * Defaults to `false`. + */ + readonly verbose: { + type: boolean; + hasDefault: true; + } + }, + exclusiveGroups: [] +} + +const logger = { log: console.log.bind(console) }; + +export const LoggingOptions: Definitions = { + debug: { + normalize: rawInput => rawInput, + default: () => false + }, + logger: { + normalize: rawInput => rawInput, + default: () => logger + }, + verbose: { + normalize: rawInput => rawInput, + default: () => false + } +}; diff --git a/src/chains/ethereum/src/options/miner-options.ts b/src/chains/ethereum/src/options/miner-options.ts index 59eb5e7b79..17c38a7833 100644 --- a/src/chains/ethereum/src/options/miner-options.ts +++ b/src/chains/ethereum/src/options/miner-options.ts @@ -1,40 +1,93 @@ import { Quantity, utils } from "@ganache/utils"; -import { Definitions, ExclusiveGroupUnionAndUnconstrainedPlus } from "./helpers"; +import { Definitions } from "@ganache/options"; import Address from "../things/address"; -type MinerConfig = { +export type MinerConfig = { options: { - readonly blockTime: { + /** + * Sets the `blockTime` in seconds for automatic mining. A blockTime of `0` + * (default) enables "instamine mode", where new executable transactions + * will be mined instantly. + * + * Using the `blockTime` option is discouraged unless you have tests which + * require a specific mining interval. + * + * Defaults to `0` ("instamine mode"). + */ + blockTime: { type: number; hasDefault: true; } - readonly gasPrice: { + + /** + * Sets the default gas price in WEI for transactions if not otherwise specified. + * + * Defaults to `2_000_000`. + */ + gasPrice: { type: Quantity; rawType: string | number | bigint; hasDefault: true; } - readonly blockGasLimit: { + + /** + * Sets the block gas limit in WEI. + * + * Defaults to `12_000_000`. + */ + blockGasLimit: { type: Quantity; rawType: string | number | bigint; hasDefault: true; + legacyName: "gasLimit"; } - readonly transactionGasLimit: { + + /** + * Sets the _default_ transaction gas limit in WEI. + * + * Defaults to `9_000`. + */ + defaultTransactionGasLimit: { type: Quantity; rawType: string | number | bigint; hasDefault: true; } - readonly callGasLimit: { + + /** + * Sets the transaction gas limit in WEI for `eth_call` and + * eth_estimateGas` calls. + * + * Defaults to `9_007_199_254_740_991` (`2**53 - 1`). + */ + callGasLimit: { type: Quantity; rawType: string | number | bigint; hasDefault: true; } - readonly legacyInstamine: { + + /** + * Enables legacy instamine mode, where transactions are fully mined before + * the transaction's hash is returned to the caller. If `legacyInstamine` is + * `true`, `blockTime` must be `0` (default). + * + * Defaults to `false`. + */ + legacyInstamine: { type: boolean; hasDefault: true; } - readonly coinbase: { - rawType: string; - type: Address; + + /** + * Sets the address where mining rewards will go. + * + * * `{string}` hex-encoded address + * * `{number}` index of the account returned by `eth_getAccounts` + * + * Defaults to `0x0000000000000000000000000000000000000000`. + */ + coinbase: { + rawType: string | number; + type: string | number | Address; hasDefault: true; } }, @@ -43,47 +96,33 @@ type MinerConfig = { export const MinerOptions: Definitions = { blockTime: { - normalize(rawInput) { - return rawInput; - }, + normalize: rawInput => rawInput, default: () => 0 }, gasPrice: { - normalize(rawInput) { - return Quantity.from(rawInput); - }, + normalize: Quantity.from, default: () => Quantity.from(2_000_000_000) }, blockGasLimit: { - normalize(rawInput) { - return Quantity.from(rawInput); - }, - default: () => Quantity.from(12_000_000) + normalize: Quantity.from, + default: () => Quantity.from(12_000_000), + legacyName: "gasLimit" }, - transactionGasLimit: { - normalize(rawInput) { - return Quantity.from(rawInput); - }, + defaultTransactionGasLimit: { + normalize: Quantity.from, default: () => Quantity.from(90000) }, callGasLimit: { - normalize(rawInput) { - return Quantity.from(rawInput); - }, + normalize: Quantity.from, default: () => Quantity.from(Number.MAX_SAFE_INTEGER), }, coinbase: { - normalize(rawInput) { - return Address.from(rawInput); - }, + normalize: (rawInput) => rawInput, default: () => Address.from(utils.ACCOUNT_ZERO) }, legacyInstamine: { - normalize(rawInput) { - return rawInput; - }, + normalize: rawInput => rawInput, default: () => false } } -export type InternalMinerOptions = ExclusiveGroupUnionAndUnconstrainedPlus diff --git a/src/chains/ethereum/src/options/wallet-options.ts b/src/chains/ethereum/src/options/wallet-options.ts new file mode 100644 index 0000000000..88233bdaaf --- /dev/null +++ b/src/chains/ethereum/src/options/wallet-options.ts @@ -0,0 +1,160 @@ +import seedrandom from "seedrandom"; +import {entropyToMnemonic} from "bip39"; + +import { Quantity } from "@ganache/utils"; + +import { Definitions } from "@ganache/options"; + +const { alea } = seedrandom; + +function randomBytes(length: number, rng: () => number) { + const buf = Buffer.allocUnsafe(length); + for (let i = 0; i < length; i++) { + buf[i] = (rng() * 255) | 0; + } + return buf; +} + +const randomAlphaNumericString = (() => { + const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + const alphabetLength = alphabet.length; + return (length: number, rng: () => number) => { + let text = ""; + for (let i = 0; i < length; i++) { + text += alphabet[(rng() * alphabetLength) | 0]; + } + return text; + }; +})(); + +export type OptionsAccount = {balance: string | number | bigint | Buffer, secretKey?: string}; + +export type WalletConfig = { + options: { + /** + * Number of accounts to generate at startup. Defaults to `10`. + */ + totalAccounts: { + type: number; + hasDefault: true; + }; + + /** + * Array of Accounts. Each object should have a balance key with a hexadecimal + * value. The key secretKey can also be specified, which represents the + * account's private key. If no secretKey, the address is auto-generated with + * the given balance. If specified, the key is used to determine the account's + * address. + */ + accounts: { + type: OptionsAccount[]; + }; + + /** + * Seed to use to generate a mnemonic + */ + seed: { + type: string; + hasDefault: true; + }; + + /** + * Use a specific HD wallet mnemonic to generate initial addresses. + */ + mnemonic: { + type: string; + hasDefault: true; + }; + + /** + * Array of addresses or address indexes specifying which accounts should be unlocked. + */ + unlockedAccounts: { + type: Array; + } + + /** + * Lock available accounts by default (good for third party transaction signing). Defaults to `false`. + */ + secure: { + type: boolean; + hasDefault: true; + }; + + /** + * Specifies a file to save accounts and private keys to, for testing. + * + * Can be a filename or file descriptor. + * + * If specifying a filename, the directory path must already exist. + * + * See: https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options + */ + accountKeysPath: { + type: string | number; + } + + /** + * The default account balance, specified in ether. Defaults to `100` ether + */ + defaultBalance: { + type: number, + rawType: number; + hasDefault: true; + }, + + /** + * The hierarchical deterministic path to use when generating accounts. + * Default: "m/44'/60'/0'/0/" + */ + hdPath: { + type: string; + hasDefault: true; + } + }; + exclusiveGroups: [ + ["totalAccounts", "accounts"], + ["mnemonic", "seed"] + ]; +}; + +export const WalletOptions: Definitions = { + totalAccounts: { + normalize: rawInput => rawInput, + default: () => 10, + legacyName: "total_accounts" + }, + accounts: { + normalize: rawInput => rawInput + }, + seed: { + normalize: rawInput => rawInput, + default: () => randomAlphaNumericString(10, alea()) + }, + mnemonic: { + normalize: rawInput => rawInput, + default: (config) => entropyToMnemonic(randomBytes(16, seedrandom(config.seed))) + }, + unlockedAccounts: { + normalize: rawInput => rawInput, + legacyName: "unlocked_accounts" + }, + secure: { + normalize: rawInput => rawInput, + default: () => false + }, + accountKeysPath: { + normalize: rawInput => rawInput, + legacyName: "account_keys_path" + }, + defaultBalance: { + normalize: (rawInput) => rawInput, + default: () => 100, + legacyName: "default_balance_ether" + }, + hdPath: { + normalize: rawInput => rawInput, + default: () => "m/44'/60'/0'/0/", + legacyName: "hd_path" + } +}; diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index d667112676..8e6b7a554b 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -1,8 +1,7 @@ -import {ProviderOptions} from "@ganache/options"; import Emittery from "emittery"; import EthereumApi from "./api"; import {JsonRpcTypes} from "@ganache/utils"; -import EthereumOptions from "./options"; +import { EthereumProviderOptions, EthereumInternalOptions, EthereumOptionsConfig } from "./options"; import cloneDeep from "lodash.clonedeep"; import {PromiEvent, types, utils} from "@ganache/utils"; declare type RequestMethods = types.KnownKeys; @@ -23,16 +22,17 @@ const hasOwn = utils.hasOwn; export default class EthereumProvider extends Emittery.Typed<{message: any}, "connect" | "disconnect"> implements types.Provider { - #options: ProviderOptions; + #options: EthereumInternalOptions; #api: EthereumApi; #executor: utils.Executor; - constructor(providerOptions: ProviderOptions = null, executor: utils.Executor) { + constructor(options: EthereumProviderOptions = {}, executor: utils.Executor) { super(); - const _providerOptions = (this.#options = ProviderOptions.getDefault(providerOptions)); + const providerOptions = this.#options = EthereumOptionsConfig.normalize(options); + this.#executor = executor; - this.#api = new EthereumApi(_providerOptions as EthereumOptions, this); + this.#api = new EthereumApi(providerOptions, this); } /** @@ -155,7 +155,7 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co }); } const value = promise.catch((error: Error) => { - if (this.#options.vmErrorsOnRPCResponse) { + if (this.#options.chain.vmErrorsOnRPCResponse) { if (hasOwn(error, "result")) { // stringify the result here // TODO: not sure why the stringification is even needed. @@ -170,8 +170,8 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co #logRequest = (method: string, params: Parameters) => { const options = this.#options; - if (options.verbose) { - options.logger.log( + if (options.logging.verbose) { + options.logging.logger.log( ` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ") }` ); } @@ -187,7 +187,7 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co return Promise.all(payloads.map(this.#legacySendPayload)) .then(results => { let mainError: Error = null; - const responses = []; + const responses: (JsonRpcTypes.Response | JsonRpcTypes.Error)[] = []; results.forEach(({error, result}, i) => { responses.push(result); if (error) { @@ -207,7 +207,7 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co try { const result = await this.request({ method, params }); return { - error: null, + error: null as JsonRpcTypes.Error, result: JsonRpcTypes.Response(payload.id, JSON.parse(JSON.stringify(result))) }; } catch (error) { diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 60512c1515..fa813be574 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -210,8 +210,8 @@ class Transaction extends (EthereumJsTransaction as any) { * @param {Number} type The `Transaction.types` bit flag for this transaction * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ - constructor(data: any, options: {common: Common}, type: number = Transaction.types.none) { - super(void 0, options); + constructor(data: any, common: Common, type: number = Transaction.types.none) { + super(void 0, {common}); // EthereumJS-TX Transaction overwrites our `toJSON`, so we overwrite it back here: this.toJSON = Transaction.prototype.toJSON.bind(this); @@ -319,7 +319,7 @@ class Transaction extends (EthereumJsTransaction as any) { s: Data.from(json.s).toBuffer() }; - const tx = new Transaction(options, { common }, type); + const tx = new Transaction(options, common, type); tx._hash = json.hash ? Data.from(json.hash).toBuffer() : null; tx._from = json.from ? Data.from(json.from).toBuffer() : null; return tx; diff --git a/src/chains/ethereum/src/types/tuple-from-union.ts b/src/chains/ethereum/src/types/tuple-from-union.ts new file mode 100644 index 0000000000..c3d1708748 --- /dev/null +++ b/src/chains/ethereum/src/types/tuple-from-union.ts @@ -0,0 +1,22 @@ +type TuplePrepend = +[NewElement, ...Tuple] + +type Consumer = (value: Value) => void; + +type IntersectionFromUnion = +(Union extends unknown ? Consumer : never) extends (Consumer) +? ResultIntersection +: never; + +type OverloadedConsumerFromUnion = IntersectionFromUnion : never>; + +type UnionLast = OverloadedConsumerFromUnion extends ((a: infer A) => void) ? A : never; + +type UnionExcludingLast = Exclude>; + +type TupleFromUnionRec = +[RemainingUnion] extends [never] +? CurrentTuple +: TupleFromUnionRec, TuplePrepend>>; + +export type TupleFromUnion = TupleFromUnionRec; \ No newline at end of file diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 314252e6f6..8aa5ff7719 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -1,18 +1,18 @@ import { utils } from "@ganache/utils"; import { Data, Quantity } from "@ganache/utils"; import Address from "./things/address"; -import EthereumOptions from "./options"; import { privateToAddress } from "ethereumjs-util"; import Account from "./things/account"; import secp256k1 from "secp256k1"; -import { ProviderOptions } from "@ganache/options"; import { mnemonicToSeedSync } from "bip39"; import HDKey from "hdkey"; import { alea as rng } from "seedrandom"; import crypto from "crypto"; import createKeccakHash from "keccak"; import {writeFileSync} from "fs"; +import { EthereumInternalOptions } from "./options"; +//#region Constants const SCRYPT_PARAMS = { dklen: 32, n: 1024, // practically nothing @@ -21,6 +21,7 @@ const SCRYPT_PARAMS = { } as const; const CIPHER = "aes-128-ctr"; const WEI = utils.WEI; +//#endregion type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; type LastType]> = T extends [...infer _A, infer L] ? L : never; @@ -62,7 +63,7 @@ export default class Wallet { #hdKey: HDKey; - constructor(opts: EthereumOptions) { + constructor(opts: EthereumInternalOptions["wallet"]) { this.#hdKey = HDKey.fromMasterSeed(mnemonicToSeedSync(opts.mnemonic, null)); const initialAccounts = this.initialAccounts = this.#initializeAccounts(opts); @@ -71,7 +72,7 @@ export default class Wallet { const knownAccounts = this.knownAccounts; const unlockedAccounts = this.unlockedAccounts; //#region Unlocked Accounts - const givenUnlockedAccounts = opts.unlocked_accounts; + const givenUnlockedAccounts = opts.unlockedAccounts; if (givenUnlockedAccounts) { const ul = givenUnlockedAccounts.length; for (let i = 0; i < ul; i++) { @@ -89,7 +90,7 @@ export default class Wallet { // don't use parseInt because strings like `"123abc"` parse // to `123`, and there is probably an error on the user's side we'd // want to uncover. - const index = (arg as any) - 0; + const index = (arg as any as number) - 0; // if we don't have a valid number, or the number isn't a valid JS // integer (no bigints or decimals, please), throw an error. if (!Number.isSafeInteger(index)) { @@ -138,7 +139,7 @@ export default class Wallet { //#endregion //#region save accounts to disk - if (opts.account_keys_path != null) { + if (opts.accountKeysPath != null) { const fileData = { addresses: {} as {[address: string]: string}, private_keys: {} as {[address: string]: Data} @@ -147,7 +148,7 @@ export default class Wallet { fileData.addresses[address] = address; fileData.private_keys[address] = privateKey; }); - writeFileSync(opts.account_keys_path, JSON.stringify(fileData)); + writeFileSync(opts.accountKeysPath, JSON.stringify(fileData)); } //#endregion } @@ -166,9 +167,9 @@ export default class Wallet { return buf; } - #initializeAccounts = (opts: ProviderOptions): Account[] => { + #initializeAccounts = (options: EthereumInternalOptions["wallet"]): Account[] => { // convert a potentially fractional balance of Ether to WEI - const balanceParts = opts.default_balance_ether.toString().split(".", 2); + const balanceParts = options.defaultBalance.toString().split(".", 2); const significand = BigInt(balanceParts[0]); const fractionalStr = balanceParts[1] || "0"; const fractional = BigInt(fractionalStr); @@ -177,11 +178,11 @@ export default class Wallet { const etherInWei = Quantity.from(defaultBalanceInWei); let accounts: Account[]; - let givenAccounts = opts.accounts; + let givenAccounts = options.accounts; let accountsLength: number; if (givenAccounts && (accountsLength = givenAccounts.length) !== 0) { const hdKey = this.#hdKey; - const hdPath = opts.hdPath; + const hdPath = options.hdPath; accounts = Array(accountsLength); for (let i = 0; i < accountsLength; i++) { const account = givenAccounts[i]; @@ -200,10 +201,10 @@ export default class Wallet { } } } else { - const numerOfAccounts = opts.total_accounts; + const numerOfAccounts = options.totalAccounts; if (numerOfAccounts) { accounts = Array(numerOfAccounts); - const hdPath = opts.hdPath; + const hdPath = options.hdPath; const hdKey = this.#hdKey; for (let index = 0; index < numerOfAccounts; index++) { diff --git a/src/chains/tezos/src/index.ts b/src/chains/tezos/src/index.ts index f066ba11a3..b395a66d35 100644 --- a/src/chains/tezos/src/index.ts +++ b/src/chains/tezos/src/index.ts @@ -1,7 +1,6 @@ import Emittery from "emittery"; import {utils, types} from "@ganache/utils"; import Provider from "./provider"; -import {ProviderOptions} from "@ganache/options"; import TezosApi from "./api"; import { HttpRequest } from "uWebSockets.js"; @@ -13,7 +12,7 @@ export class TezosConnector extends Emittery.Typed provider: Provider; #api: TezosApi; - constructor(providerOptions: ProviderOptions, requestCoordinator: utils.Executor) { + constructor(providerOptions: any, requestCoordinator: utils.Executor) { super(); const api = (this.#api = new TezosApi()); @@ -37,7 +36,7 @@ export class TezosConnector extends Emittery.Typed }; close() { - return {} as any; + return {}; } } diff --git a/src/chains/tezos/src/provider.ts b/src/chains/tezos/src/provider.ts index cb27fbe9bf..25605f39ba 100644 --- a/src/chains/tezos/src/provider.ts +++ b/src/chains/tezos/src/provider.ts @@ -1,11 +1,10 @@ import {types} from "@ganache/utils"; import TezosApi from "./api"; import Emittery from "emittery"; -import {ProviderOptions} from "@ganache/options"; export default class TezosProvider extends Emittery.Typed<{request: types.RequestType}, "ready" | "close"> implements types.Provider { - constructor(providerOptions?: ProviderOptions) { + constructor(providerOptions?: any) { super(); this.emit("ready"); } diff --git a/src/packages/core/__tests__/connector.test.ts b/src/packages/core/__tests__/connector.test.ts index fceed295a2..8e082f327d 100644 --- a/src/packages/core/__tests__/connector.test.ts +++ b/src/packages/core/__tests__/connector.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; import Ganache from "../src"; -import { EthereumProvider } from "@ganache/ethereum"; +import { Provider as EthereumProvider } from "@ganache/ethereum"; describe("connector", () => { it("works without passing options", async () => { @@ -9,7 +9,7 @@ describe("connector", () => { it("it logs when `options.verbose` is `true`", async () => { const logger = {log: (_msg: string) => {}}; - const p = Ganache.provider({logger, verbose: true}) as EthereumProvider; + const p = Ganache.provider({logging: {logger, verbose: true}}); logger.log = msg => { assert.strictEqual(msg, " > net_version: undefined", "doesn't work when no params"); @@ -27,7 +27,7 @@ describe("connector", () => { }); it("it processes requests asyncronously when `asyncRequestProcessing` is default (true)", async () => { - const p = Ganache.provider() as EthereumProvider; + const p = Ganache.provider(); const accounts = await p.send("eth_accounts"); // `eth_accounts` should always be faster than eth_getBalance; eth_accounts // should return before eth_getBalance because of the @@ -40,7 +40,7 @@ describe("connector", () => { }); it("it processes requests syncronously when `asyncRequestProcessing` is `false`", async () => { - const p = Ganache.provider({asyncRequestProcessing: false}) as EthereumProvider; + const p = Ganache.provider({chain:{asyncRequestProcessing: false}}); const accounts = await p.send("eth_accounts"); // eth_getBalance should return first even though eth_accounts is faster; // eth_getBalance should return before eth_accounts because of the @@ -55,7 +55,7 @@ describe("connector", () => { // to make sure that 3rd party API implementations can't shoot themselves // in the foot on accident it.skip("TODO: allow 'injecting' our own engine or API into a provider!", async () => { - const p = Ganache.provider() as EthereumProvider; + const p = Ganache.provider(); // this won't work becase ganache uses _real_ private properties that can't // be duck punched. This test is supposed to ensure that _real_ non-function // own properties (and __proto__ properties) can't be executed. @@ -66,8 +66,8 @@ describe("connector", () => { }); it("rejects invalid rpc methods", async () => { - const p = Ganache.provider() as EthereumProvider; - + const p = Ganache.provider(); + const illegalMethodNames = [ "toString", "toValue", diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/__tests__/server.test.ts index cbb1f875bc..b7bd2b1af4 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -3,18 +3,17 @@ import * as assert from "assert"; import request from "superagent"; import WebSocket from "ws"; import Server, {Status} from "../src/server"; -import ServerOptions from "../src/options/server-options"; import http from "http"; import intoStream from "into-stream"; -import {EthereumProvider} from "@ganache/ethereum"; import { PromiEvent } from "@ganache/utils"; import {promisify} from "util"; +import { ServerOptions } from "../src/options"; const IS_WINDOWS = process.platform === "win32"; describe("server", () => { const port = 5234; - const network_id = "1234"; + const networkId = 1234; const jsonRpcJson: any = { jsonrpc: "2.0", id: "1", @@ -27,10 +26,14 @@ describe("server", () => { let s: Server; async function setup( - options = { - network_id, - logger - } as ServerOptions + options: ServerOptions = { + chain: { + networkId + }, + logging: { + logger + } + } ) { s = Ganache.server(options); return s.listen(port); @@ -49,7 +52,7 @@ describe("server", () => { assert.strictEqual(response.status, 200); const json = JSON.parse(response.text); - assert.strictEqual(json.result, network_id); + assert.strictEqual(json.result, `${networkId}`); return response; } @@ -89,8 +92,8 @@ describe("server", () => { it("returns the net_version over a legacy-style connection listener", done => { s = Ganache.server({ - network_id - } as ServerOptions); + chain: {networkId} + }); s.listen(port, async () => { try { await simpleTest(); @@ -242,9 +245,9 @@ describe("server", () => { }); it("does not start a websocket server when `ws` is false", async () => { - await setup({ + await setup({server:{ ws: false - } as ServerOptions); + }}); try { const ws = new WebSocket("ws://localhost:" + port); @@ -275,8 +278,8 @@ describe("server", () => { await new Promise((resolve, reject) => { req.on("response", response => { const json = JSON.parse(response.text); - assert.strictEqual(json.result, network_id); - resolve(); + assert.strictEqual(json.result, `${networkId}`); + resolve(void 0); }); req.on("error", () => { reject(); @@ -391,7 +394,7 @@ describe("server", () => { await setup(); try { - const provider = s.provider as EthereumProvider; + const provider = s.provider; const oldRequestRaw = provider.requestRaw; const req = request.post("http://localhost:" + port); const abortPromise = new Promise(resolve => { @@ -404,9 +407,9 @@ describe("server", () => { setImmediate(setImmediate, () => { // resolve the `provider.send` to make sure the server can // handle _not_ responding to a request that has been aborted: - innerResolve( {value: Promise.resolve() as any}); + innerResolve( {value: Promise.resolve()}); // and finally, resolve the `abort` promise: - resolve(); + resolve(void 0); }); }); }; @@ -537,7 +540,7 @@ describe("server", () => { ws.on("message", resolve); }); const json = JSON.parse(response); - assert.strictEqual(json.result, network_id); + assert.strictEqual(json.result, `${networkId}`); }); it("returns the net_version over a websocket as binary", async () => { @@ -551,7 +554,7 @@ describe("server", () => { }); assert.strictEqual(response.constructor, Buffer, "response doesn't seem to be a Buffer as expect"); const json = JSON.parse(response); - assert.strictEqual(json.result, network_id, "Binary data result is not as expected"); + assert.strictEqual(json.result, `${networkId}`, "Binary data result is not as expected"); }); it("doesn't crash when sending bad data over http", async () => { @@ -561,7 +564,7 @@ describe("server", () => { const response = await request.post("http://localhost:" + port).send(jsonRpcJson); const json = JSON.parse(response.text); - assert.strictEqual(json.result, network_id); + assert.strictEqual(json.result, `${networkId}`); }); it("doesn't crash when sending bad data over websocket", async () => { @@ -577,11 +580,11 @@ describe("server", () => { }); it("doesn't crash when the connection is closed while a request is in flight", async () => { - const provider = s.provider as EthereumProvider; + const provider = s.provider; provider.requestRaw = async () => { // close our websocket after intercepting the request await s.close(); - return {value: Promise.resolve(undefined) as any}; + return {value: Promise.resolve(void 0)}; }; const ws = new WebSocket("ws://localhost:" + port); @@ -604,7 +607,7 @@ describe("server", () => { }); it("handles PromiEvent messages", async () => { - const provider = s.provider as EthereumProvider; + const provider = s.provider; const message = "I hope you get this message"; const oldRequestRaw = provider.requestRaw.bind(provider); provider.requestRaw = async () => { @@ -613,7 +616,7 @@ describe("server", () => { resolve(subId); setImmediate(() => promiEvent.emit("message", {data: {subscription: subId, result: message}})); }); - return {value: promiEvent as any}; + return {value: promiEvent}; }; const ws = new WebSocket("ws://localhost:" + port); @@ -701,13 +704,13 @@ describe("server", () => { }); it("doesn't crash when the connection is closed while a subscription is in flight", async () => { - const provider = s.provider as EthereumProvider; + const provider = s.provider; let promiEvent: PromiEvent; provider.requestRaw = async () => { promiEvent = new PromiEvent(resolve => { resolve("0xsubscriptionId"); }); - return {value: promiEvent} as any; + return {value: promiEvent}; }; const ws = new WebSocket("ws://localhost:" + port); @@ -743,15 +746,14 @@ describe("server", () => { }); }); - // I can't get backpressure working on Windows. It's not super important because we - // don't actually handle backpressure anyway. - (IS_WINDOWS ? xit : it)("can handle backpressure", async () => { + // TODO: actually handle backpressure! + it.skip("can handle backpressure", async () => { { // create tons of data to force websocket backpressure const huge = {}; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; - (s.provider as EthereumProvider).requestRaw = async () => { - return {value: Promise.resolve(huge) as any}; + s.provider.requestRaw = async () => { + return {value: Promise.resolve(huge)}; }; } diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index 2d5c2274df..320467dd3b 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -1,26 +1,30 @@ import {utils} from "@ganache/utils"; -import {FlavorMap, DefaultFlavor} from "@ganache/flavors"; -import {ProviderOptions} from "@ganache/options"; +import {Connectors, DefaultFlavor} from "@ganache/flavors"; +import {Options as ProviderOptions} from "@ganache/flavors"; /** * Loads the connector specified by the given `flavor` */ export default { // TODO: set missing defaults automatically - initialize: (providerOptions: ProviderOptions = {flavor: DefaultFlavor, asyncRequestProcessing: true}) => { + initialize: (providerOptions: ProviderOptions = {flavor: DefaultFlavor, chain: {asyncRequestProcessing: true}}) => { const flavor = providerOptions.flavor || DefaultFlavor; // Set up our request coordinator to either use FIFO or or async request processing. // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it // for that (yet), instead of "all" (0) or just 1 as we are doing here: - const requestCoordinator = new utils.RequestCoordinator(providerOptions.asyncRequestProcessing ? 0 : 1); + providerOptions.chain = providerOptions.chain || {}; + if (providerOptions.chain.asyncRequestProcessing == null) { + providerOptions.chain.asyncRequestProcessing = true; + } + const requestCoordinator = new utils.RequestCoordinator(providerOptions.chain.asyncRequestProcessing ? 0 : 1); // The Executor is responsible for actually executing the method on the chain/API. // It performs some safety checks to ensure "safe" method execution before passing it // to a RequestCoordinator. const executor = new utils.Executor(requestCoordinator); - const connector = new FlavorMap[flavor](providerOptions, executor); + const connector = new Connectors[flavor](providerOptions, executor); // The request coordinator is initialized in a "paused" state, when the provider is ready we unpause // this lets us accept queue requests before we've even fully initialized. diff --git a/src/packages/core/src/index.ts b/src/packages/core/src/index.ts index 99058bea0f..8193d0afc7 100644 --- a/src/packages/core/src/index.ts +++ b/src/packages/core/src/index.ts @@ -1,6 +1,5 @@ import Connector from "./connector"; -import {ProviderOptions} from "@ganache/options"; -import ServerOptions from "./options/server-options"; +import {ProviderOptions, ServerOptions} from "./options"; import Server from "./server"; export default { diff --git a/src/packages/core/src/options/index.ts b/src/packages/core/src/options/index.ts new file mode 100644 index 0000000000..665e912ea1 --- /dev/null +++ b/src/packages/core/src/options/index.ts @@ -0,0 +1,27 @@ +import {Options as FlavorOptions} from "@ganache/flavors"; +import { ServerConfig, ServerOptions } from "./server-options"; +import { Defaults, Definitions, ExternalConfig, InternalConfig, OptionsConfig } from "@ganache/options"; + +export type ProviderOptions = FlavorOptions; + +export type Options = { + server: ServerConfig; +}; + +export type ServerOptions = Partial<{ + [K in keyof Options]: ExternalConfig; +}> & ProviderOptions; + +export type InternalOptions = { + [K in keyof Options]: InternalConfig; +} + +export type ServerDefaults = { + [K in keyof Options]: Definitions; +}; + +export const serverDefaults: Defaults = { + server: ServerOptions +}; + +export const serverOptionsConfig = new OptionsConfig(serverDefaults); diff --git a/src/packages/core/src/options/server-options.ts b/src/packages/core/src/options/server-options.ts index 3a102d5177..f03f0788a6 100644 --- a/src/packages/core/src/options/server-options.ts +++ b/src/packages/core/src/options/server-options.ts @@ -1,34 +1,49 @@ -import {ProviderOptions} from "@ganache/options"; -export {Apis, Flavors, FlavorMap} from "@ganache/flavors"; +import { Definitions} from "@ganache/options"; -export default interface ServerOptions extends ProviderOptions { - /** - * Port number to listen on when running as a server. Defaults to `8545` - */ - port: number; - - /** - * Enable a websocket server. This is `true` by default. - */ - ws: boolean; - - /** - * Wether or not websockets should response with binary data (ArrayBuffers) or - * strings. - * - * Default is "auto", which responds using the same format as the incoming - * message that triggered the response. - */ - wsBinary: "auto" | boolean; -} +export type ServerConfig = { + options: { + /** + * Port number to listen on when running as a server. Defaults to `8545` + */ + readonly port: { + type: number; + hasDefault: true; + }, -export const getDefault = (options?: ServerOptions) => { - return Object.assign( - { - port: 8545, - ws: true, - wsBinary: "auto" + /** + * Enable a websocket server. This is `true` by default. + */ + readonly ws: { + type: boolean; + hasDefault: true; }, - ProviderOptions.getDefault(options as ProviderOptions) - ) as ServerOptions; + + /** + * Wether or not websockets should response with binary data (ArrayBuffers) or + * strings. + * + * Default is "auto", which responds using the same format as the incoming + * message that triggered the response. + */ + readonly wsBinary: { + type: boolean | "auto"; + hasDefault: true; + } + }, + exclusiveGroups: [] }; + +export const ServerOptions: Definitions = { + port: { + normalize: rawInput => rawInput, + default: () => 8545 + }, + ws: { + normalize: rawInput => rawInput, + default: () => true + }, + wsBinary: { + normalize: rawInput => rawInput, + default: () => "auto" + } +} diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index e263dadfc9..087178aa12 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -1,12 +1,9 @@ -import ServerOptions, {getDefault as getDefaultServerOptions} from "./options/server-options"; +import {InternalOptions, ServerOptions, serverOptionsConfig} from "./options"; import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; import Connector from "./connector"; import WebsocketServer, { WebSocketCapableFlavor } from "./servers/ws-server"; import HttpServer from "./servers/http-server"; -import {Flavors} from "@ganache/flavors"; -import {TezosProvider} from "@ganache/tezos"; -import {EthereumProvider} from "@ganache/ethereum"; type Callback = (err: Error | null) => void @@ -40,11 +37,11 @@ export enum Status { closing = 12 } -export default class Server { +export default class Server { #app: TemplatedApp; #httpServer: HttpServer; #listenSocket?: us_listen_socket; - #options: ServerOptions; + #options: InternalOptions; #connector: Flavors; #status = Status.closed; #websocketServer: WebsocketServer | null = null; @@ -57,14 +54,14 @@ export default class Server { return this.#status; } - constructor(serverOptions?: T) { - const opts = (this.#options = getDefaultServerOptions(serverOptions)); - const connector = (this.#connector = Connector.initialize(opts)); + constructor(serverOptions: ServerOptions = {flavor: "ethereum"}) { + const opts = (this.#options = serverOptionsConfig.normalize(serverOptions)); + const connector = (this.#connector = Connector.initialize(serverOptions)); const _app = (this.#app = uWS.App()); - if (this.#options.ws) { - this.#websocketServer = new WebsocketServer(_app, connector as WebSocketCapableFlavor, opts); + if (this.#options.server.ws) { + this.#websocketServer = new WebsocketServer(_app, connector as WebSocketCapableFlavor, opts.server); } this.#httpServer = new HttpServer(_app, connector); } diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index c6dbbb0443..8a24d9c961 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -1,20 +1,27 @@ import uWS, {TemplatedApp, WebSocket} from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; -import ServerOptions, { FlavorMap } from "../options/server-options"; +import { ServerOptions } from "../options"; +import * as Flavors from "@ganache/flavors"; import { PromiEvent } from "@ganache/utils"; type MergePromiseT = Promise ? X : never>; +type HandlesWebSocketSignature= ((payload: any, connection: WebSocket) => any); + type WebSocketCapableFlavorMap = { - [k in keyof FlavorMap]: FlavorMap[k]["handle"] extends ((payload: any, connection: WebSocket) => any) ? FlavorMap[k] : never; + [k in keyof Flavors.Connectors]: + Flavors.Connectors[k]["handle"] extends HandlesWebSocketSignature + ? Flavors.Connectors[k] + : never; }; + export type WebSocketCapableFlavor = { [k in keyof WebSocketCapableFlavorMap]: WebSocketCapableFlavorMap[k]; }[keyof WebSocketCapableFlavorMap]; export type GanacheWebSocket = WebSocket & {closed?: boolean}; -export type WebsocketServerOptions = Pick +export type WebsocketServerOptions = Pick export default class WebsocketServer { #connections = new Map void>>(); @@ -86,7 +93,8 @@ export default class WebsocketServer { // This is there so tests can detect if a small amount of backpressure // is happening and that things will still work if it does. We actually // don't do anything to manage excessive backpressure. - options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); + // TODO: handle back pressure for real! + // options.logger.log("WebSocket backpressure: " + ws.getBufferedAmount()); }, close: (ws: GanacheWebSocket) => { diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts index 87f11af44d..6d0052e2bd 100644 --- a/src/packages/flavors/src/index.ts +++ b/src/packages/flavors/src/index.ts @@ -1,23 +1,21 @@ -import {types} from "@ganache/utils"; -import {TezosConnector} from "@ganache/tezos"; -import {EthereumConnector} from "@ganache/ethereum"; +// import {TezosConnector} from "@ganache/tezos"; +import * as Ethereum from "@ganache/ethereum"; -export const FlavorMap = { - //tezos: TezosConnector, - ethereum: EthereumConnector -}; +export const DefaultFlavor = Ethereum.FlavorName; -export type FlavorMap = { -// tezos: TezosConnector; - ethereum: EthereumConnector; -}; +export type Connectors = { + [Ethereum.FlavorName]: Ethereum.Connector, + // [Tezos.FlavorName]: Tezos.Connector +} -export type FlavorKeys = keyof FlavorMap; +export const Connectors = { + [Ethereum.FlavorName]: Ethereum.Connector, + // [Tezos.FlavorName]: Tezos.Connector +} -export const DefaultFlavor = "ethereum" as const; +export type Options = ( + ({flavor?: typeof Ethereum.FlavorName} & Ethereum.ProviderOptions) + // | [Tezos.FlavorName]: Tezos.ProviderOptions; +); -export type Flavors = { - [k in keyof FlavorMap]: FlavorMap[k]; -}[keyof FlavorMap]; - -export type Apis = T extends types.Connector ? R : never; +// export type Apis = T extends types.Connector ? R : never; diff --git a/src/chains/ethereum/src/options/helpers/base.ts b/src/packages/options/src/helpers/base.ts similarity index 100% rename from src/chains/ethereum/src/options/helpers/base.ts rename to src/packages/options/src/helpers/base.ts diff --git a/src/packages/options/src/helpers/create.ts b/src/packages/options/src/helpers/create.ts new file mode 100644 index 0000000000..4d3d7e37bd --- /dev/null +++ b/src/packages/options/src/helpers/create.ts @@ -0,0 +1,79 @@ +import { Definitions, ExternalConfig, InternalConfig } from "./definition"; +import { Base } from "./base"; +import { UnionToTuple } from "./exclusive"; + +import { utils } from "@ganache/utils"; + +const hasOwn = utils.hasOwn; + +export type Options = {[key: string] : Base.Config}; + +export type ProviderOptions = Partial<{ + [K in keyof O]: ExternalConfig; +}> + +export type InternalOptions = { + [K in keyof O]: InternalConfig; +} + +export type Defaults = { + [K in keyof O]: Definitions; +} + +function fill(defaults: any, options: any, target: any, namespace: any) { + const def = defaults[namespace]; + const config = target[namespace] = target[namespace] || {}; + + if (hasOwn(options, namespace)) { + const userOpts = options[namespace]; + + const keys = Object.keys(def); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + const defProp = def[key]; + if (hasOwn(userOpts, key)) { + config[key] = defProp.normalize(userOpts[key]); + } else { + const legacyName = defProp.legacyName || key; + if (hasOwn(options, legacyName)) { + config[key] = defProp.normalize(options[legacyName]); + } else if (hasOwn(defProp, "default")) { + config[key] = defProp.default(config); + } + } + } + } else { + const keys = Object.keys(def); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + const defProp = def[key]; + + const legacyName = defProp.legacyName || key; + if (hasOwn(options, legacyName)) { + config[key] = defProp.normalize(options[legacyName]); + } else if (hasOwn(defProp, "default")) { + config[key] = defProp.default(config); + } + } + } +} + +export class OptionsConfig { + #defaults: Defaults + #namespaces: UnionToTuple>; + + constructor(defaults: Defaults) { + this.#defaults = defaults; + this.#namespaces = Object.keys(defaults) as UnionToTuple>; + } + + normalize(options: ProviderOptions) { + const defaults = this.#defaults; + + const out = {} as InternalOptions; + this.#namespaces.forEach(namespace => { + fill(defaults, options, out, namespace as keyof Defaults); + }); + return out; + } +} diff --git a/src/chains/ethereum/src/options/helpers/definition.ts b/src/packages/options/src/helpers/definition.ts similarity index 54% rename from src/chains/ethereum/src/options/helpers/definition.ts rename to src/packages/options/src/helpers/definition.ts index 0d5b2625a1..ce127d4d73 100644 --- a/src/chains/ethereum/src/options/helpers/definition.ts +++ b/src/packages/options/src/helpers/definition.ts @@ -1,4 +1,5 @@ import {Base} from "./base"; +import { ExclusiveGroupUnionAndUnconstrainedPlus } from "./exclusive"; import { OptionHasDefault, OptionName, OptionRawType, OptionType } from "./getters"; //#region Definition helpers @@ -7,17 +8,22 @@ type Normalize< N extends OptionName = OptionName > = (rawInput: OptionRawType) => OptionType; -type InternalConfig< +export type ExternalConfig< C extends Base.Config, -> = {[N in OptionName]: OptionRawType}; +> = Partial>; + +export type InternalConfig< + C extends Base.Config, +> = ExclusiveGroupUnionAndUnconstrainedPlus; export type Definitions = { [N in OptionName]: { - normalize?: Normalize; + normalize: Normalize; + legacyName?: string; } & ( void extends OptionHasDefault ? {} - : { default: (config: InternalConfig) => OptionRawType } + : { default: (config: InternalConfig) => OptionType } ); } //#endregion Definition helpers \ No newline at end of file diff --git a/src/chains/ethereum/src/options/helpers/exclusive.ts b/src/packages/options/src/helpers/exclusive.ts similarity index 71% rename from src/chains/ethereum/src/options/helpers/exclusive.ts rename to src/packages/options/src/helpers/exclusive.ts index 099fcdd182..938621b3bd 100644 --- a/src/chains/ethereum/src/options/helpers/exclusive.ts +++ b/src/packages/options/src/helpers/exclusive.ts @@ -1,11 +1,12 @@ import {Base} from "./base"; -import {OptionName, Option, ExclusiveGroupIndex, ExclusiveGroups, Options, OptionType} from "./getters"; +import {OptionName, Option, ExclusiveGroupIndex, ExclusiveGroups, Options, OptionType, OptionRawType} from "./getters"; //#region options not part of exclusive groups -export type UnconstrainedOptions = Omit, ExclusiveGroupOptionName>; -export type UnconstrainedOptionRawTypes = {[N in UnconstrainedOptionName]: OptionType}; -export type UnconstrainedOptionName = string & keyof UnconstrainedOptions; +type UnconstrainedOptions = Omit, ExclusiveGroupOptionName>; +type UnconstrainedOptionName = string & keyof UnconstrainedOptions; +type UnconstrainedOptionsByType = + {[N in UnconstrainedOptionName]: T extends "type" ? OptionType : OptionRawType}; //#endregion options not part of exclusive groups @@ -30,7 +31,6 @@ type ExclusiveGroupOptionNameOption< N extends OptionName ? Option : never; - type PairsToMapping = T extends [] ? {} @@ -42,26 +42,30 @@ type PairsToMapping = type RequireOnly = Pick & Partial> -type ExclusiveGroupOptionalUnionByName, M extends OptionName> = +type ExclusiveGroupOptionalUnionByName, M extends OptionName, T extends "rawType" | "type"> = { - [K in keyof RequireOnly, M>] : K extends M ? OptionType - : never + [K in keyof RequireOnly, M>] : + K extends M + ? T extends "type" + ? OptionType + : OptionRawType + : never } -type Combine> = { +type Combine, T extends "rawType" | "type"> = { [N in keyof GRP]: GRP[N] extends OptionName ? { [ Key in keyof ( - & ExclusiveGroupOptionalUnionByName - & UnconstrainedOptionRawTypes + & ExclusiveGroupOptionalUnionByName + & UnconstrainedOptionsByType & O ) - ]: Key extends keyof ExclusiveGroupOptionalUnionByName - ? ExclusiveGroupOptionalUnionByName[Key] - : Key extends keyof UnconstrainedOptionRawTypes - ? UnconstrainedOptionRawTypes[Key] + ]: Key extends keyof ExclusiveGroupOptionalUnionByName + ? ExclusiveGroupOptionalUnionByName[Key] + : Key extends keyof UnconstrainedOptionsByType + ? UnconstrainedOptionsByType[Key] : Key extends keyof O ? O[Key] : never; @@ -70,24 +74,31 @@ type Combine = ExclusiveGroups, O extends unknown[] = []> = ( +type IsNeverType = [T] extends [never] ? true : never; +export type ExclusiveGroupUnionAndUnconstrainedPlus = ExclusiveGroups, O extends unknown[] = []> = ( GRPS extends [infer GRP, ...infer Rest] ? GRP extends ExclusiveGroup ? Rest extends any[] ? O extends [] // first time through - ? ExclusiveGroupUnionAndUnconstrainedPlus>> + ? ExclusiveGroupUnionAndUnconstrainedPlus>> // recurse - : ExclusiveGroupUnionAndUnconstrainedPlus makes it include only the indexes, but TypeScript will treat it as an object now, so we `UnionToTuple` + // Omit makes it include only the indexes, but + // TypeScript will treat it as an object now, so we `UnionToTuple` // to turn it back into a Tuple - [OK in keyof Omit]: Combine + [OK in keyof Omit]: Combine } extends {[n:number]: infer I} ? I : never>> : never : never - : O extends {[n:number]: infer I} ? I : never + : O extends {[n:number]: infer I} + // if there are no exclusiveGroups `I` is `never` so we return `C` + // directly + ? true extends IsNeverType + ? {[Key in keyof UnconstrainedOptionsByType]: UnconstrainedOptionsByType[Key]} + : I + : never ) //#region UnionToTuple diff --git a/src/chains/ethereum/src/options/helpers/getters.ts b/src/packages/options/src/helpers/getters.ts similarity index 100% rename from src/chains/ethereum/src/options/helpers/getters.ts rename to src/packages/options/src/helpers/getters.ts diff --git a/src/chains/ethereum/src/options/helpers/index.ts b/src/packages/options/src/helpers/index.ts similarity index 76% rename from src/chains/ethereum/src/options/helpers/index.ts rename to src/packages/options/src/helpers/index.ts index bd9618feb7..f97c0bf5d4 100644 --- a/src/chains/ethereum/src/options/helpers/index.ts +++ b/src/packages/options/src/helpers/index.ts @@ -1,3 +1,4 @@ export * from "./base"; export * from "./exclusive"; export * from "./definition"; +export * from "./create"; \ No newline at end of file diff --git a/src/packages/options/src/index.ts b/src/packages/options/src/index.ts index 5be496dacc..8b3e896db9 100644 --- a/src/packages/options/src/index.ts +++ b/src/packages/options/src/index.ts @@ -1,2 +1,3 @@ -export * from "./options"; -export * from "./provider-options"; +//export * from "./options"; +export * from "./helpers"; +//export * from "./provider-options"; diff --git a/src/packages/options/src/options.ts b/src/packages/options/src/old/options.ts.old similarity index 77% rename from src/packages/options/src/options.ts rename to src/packages/options/src/old/options.ts.old index 184f1468a7..ab0162a7a4 100644 --- a/src/packages/options/src/options.ts +++ b/src/packages/options/src/old/options.ts.old @@ -1,5 +1,4 @@ import {Quantity} from "@ganache/utils"; -import {types} from "@ganache/utils"; interface Logger { log(message?: any, ...optionalParams: any[]): void; @@ -11,7 +10,6 @@ interface Logger { type Account = {balance: string; secretKey?: string}; export interface Options { - api?: types.Api; /** * Array of Accounts. Each object should have a balance key with a hexadecimal * value. The key secretKey can also be specified, which represents the @@ -154,20 +152,20 @@ export interface Options { * Sets the default gas price for transactions if not otherwise specified. * Must be specified as a hex string in wei. Defaults to "0x77359400", or 2 gwei. */ - gasPrice?: Quantity; + gasPrice?: string | number | bigint; /** * Sets the block gas limit. Must be specified as a hex string. Defaults to * "0x6691b7". */ - gasLimit?: Quantity; + gasLimit?: string | number | bigint; - defaultTransactionGasLimit?: Quantity; + defaultTransactionGasLimit?: string | number | bigint; /** * Sets the transaction gas limit for `eth_call` and `eth_estimateGas` calls. Must be specified as a `hex` string. Defaults to `"0x1fffffffffffff"` (`Number.MAX_SAFE_INTEGER`) */ - callGasLimit?: Quantity + callGasLimit?: string | number | bigint; /** * @@ -211,39 +209,48 @@ export interface Options { etherbase?: string | number; }; +// const getDefault: (options?: Options) => Options = options => { +// const networkId = (options +// ? options.networkId || options.netVersion || options.network_id || options.net_version || Date.now() +// : Date.now() +// ).toString(); +// const chainId = options ? options.chainId || 1337 : 1337; +// const secure = options ? options.secure || options.locked || false : false; +// const coinbase = options ? options.coinbase || options.etherbase || "0x0000000000000000000000000000000000000000" : "0x0000000000000000000000000000000000000000"; +// const callGasLimit = options ? options.callGasLimit ? Quantity.from(options.callGasLimit as any) : Quantity.from(Number.MAX_SAFE_INTEGER) : Quantity.from(Number.MAX_SAFE_INTEGER); +// return Object.assign( +// { +// chainId, +// debug: false, +// logger: {log: () => {}}, +// default_balance_ether: 100n, +// total_accounts: 10n, +// networkId, +// vmErrorsOnRPCResponse: false, +// hdPath: "m/44'/60'/0'/0/", +// allowUnlimitedContractSize: false, +// gasPrice: new Quantity(2000000000), +// gasLimit: new Quantity(6721975), +// defaultTransactionGasLimit: new Quantity(90000), +// callGasLimit, +// verbose: false, +// asyncRequestProcessing: true, +// hardfork: "muirGlacier", +// secure, +// legacyInstamine: false, +// coinbase +// }, +// options +// ); +// } + +type Options = { + +} & EthereumOptions; + const getDefault: (options?: Options) => Options = options => { - const networkId = (options - ? options.networkId || options.netVersion || options.network_id || options.net_version || Date.now() - : Date.now() - ).toString(); - const chainId = options ? options.chainId || 1337 : 1337; - const secure = options ? options.secure || options.locked || false : false; - const coinbase = options ? options.coinbase || options.etherbase || "0x0000000000000000000000000000000000000000" : "0x0000000000000000000000000000000000000000"; - return Object.assign( - { - chainId, - debug: false, - logger: {log: () => {}}, - default_balance_ether: 100n, - total_accounts: 10n, - networkId, - vmErrorsOnRPCResponse: false, - hdPath: "m/44'/60'/0'/0/", - allowUnlimitedContractSize: false, - gasPrice: new Quantity(2000000000), - gasLimit: new Quantity(6721975), - defaultTransactionGasLimit: new Quantity(90000), - callGasLimit: new Quantity(Number.MAX_SAFE_INTEGER), - verbose: false, - asyncRequestProcessing: true, - hardfork: "muirGlacier", - secure, - legacyInstamine: false, - coinbase - }, - options - ); -} + +}; export const Options = { getDefault diff --git a/src/packages/options/src/provider-options.ts b/src/packages/options/src/old/provider-options.ts.old similarity index 100% rename from src/packages/options/src/provider-options.ts rename to src/packages/options/src/old/provider-options.ts.old diff --git a/src/packages/options/src/provider-options.ts.old b/src/packages/options/src/provider-options.ts.old new file mode 100644 index 0000000000..77dcd42a92 --- /dev/null +++ b/src/packages/options/src/provider-options.ts.old @@ -0,0 +1,3 @@ +// import { Options } from "./old/options"; + +// export interface ProviderOptions = Options \ No newline at end of file diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts index bed857b443..7156c26c2d 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts @@ -1,13 +1,6 @@ import {bigIntToBuffer} from "../../utils"; import {uintToBuffer} from "../../utils"; -export type IndexableJsonRpcType< - T extends number | bigint | string | Buffer = number | bigint | string | Buffer -> = string & { - new (value: T): IndexableJsonRpcType; - toString(): string; -}; - const EMPTY_BUFFER = Buffer.allocUnsafe(0); export const strCache = new WeakMap(); @@ -102,4 +95,4 @@ export class BaseJsonRpcType = BaseJsonRpcType & IndexableJsonRpcType; +export type JsonRpcType = BaseJsonRpcType; diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-data.ts b/src/packages/utils/src/things/json-rpc/json-rpc-data.ts index 86d6ca1bc8..44a24787d3 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-data.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-data.ts @@ -1,4 +1,4 @@ -import {BaseJsonRpcType, JsonRpcType, IndexableJsonRpcType} from "./json-rpc-base-types"; +import {BaseJsonRpcType} from "./json-rpc-base-types"; import {strCache, toStrings} from "./json-rpc-base-types"; function validateByteLength(byteLength?: number) { @@ -50,23 +50,6 @@ export class Data extends BaseJsonRpcType { } } public static from(value: T, byteLength?: number) { - return new _Data(value, byteLength); + return new Data(value, byteLength); } } -export type $ = { - new (value: T, byteLength?: number): _Data & JsonRpcType; - from(value: T, byteLength?: number): _Data & JsonRpcType; - toString(byteLength?: number): string; - toBuffer(): Buffer; -}; -export const _Data = Data as $; - -export interface _Data { - constructor(value: T, byteLength?: number): _Data; - from(value: T, byteLength?: number): _Data; - toString(byteLength?: number): string; - toBuffer(): Buffer; -} - -export type IndexableData = _Data & IndexableJsonRpcType; -export default _Data; diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index 4c619d5df2..0f449690a0 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -1,4 +1,3 @@ -import {JsonRpcType} from "."; import { BaseJsonRpcType } from "./json-rpc-base-types"; const toBigIntBE = require("bigint-buffer").toBigIntBE; @@ -6,7 +5,7 @@ export class Quantity extends BaseJsonRpcType { _nullable: boolean = false; public static from(value: number | bigint | string | Buffer, nullable = false) { if (value instanceof Quantity) return value; - const q = new _Quantity(value); + const q = new Quantity(value); q._nullable = nullable; return q; } @@ -82,25 +81,5 @@ export class Quantity extends BaseJsonRpcType { } } } -type $ = { - _nullable: boolean; - new (value: T): _Quantity & JsonRpcType; - from(value: T, nullable?: boolean): _Quantity & JsonRpcType; - toBigInt(): bigint; - toNumber(): number; - toBuffer(): Buffer; - valueOf(): bigint; -}; -const _Quantity = Quantity as $; -interface _Quantity { - _nullable: boolean; - constructor(value: T): _Quantity; - from(): _Quantity; - toBigInt(): bigint; - toNumber(): number; - toBuffer(): Buffer; - valueOf(): bigint; -} - -export default _Quantity; +export default Quantity; diff --git a/src/packages/utils/src/things/jsonrpc.ts b/src/packages/utils/src/things/jsonrpc.ts index b22999de35..0a8424deb6 100644 --- a/src/packages/utils/src/things/jsonrpc.ts +++ b/src/packages/utils/src/things/jsonrpc.ts @@ -47,7 +47,7 @@ namespace JsonRpc { const details = {message: error.message} as E; Object.getOwnPropertyNames(error).forEach(name => { if (typeof name === "string") { - (details as any)[name] = (error as any)[name]; + details[name] = error[name]; } }); if (typeof details.code !== "number") { From a4ec0748928969995d5e9d03e6f3d10fb742a9e3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 23 Sep 2020 21:24:47 -0400 Subject: [PATCH 528/691] + --- .../ethereum/src/components/transaction-pool.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index db5dfe721a..f73912e423 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -26,10 +26,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { this.#blockchain = blockchain; this.#options = options; } - public executables: Map - }> = new Map(); + public executables: Map> = new Map(); #origins: Map> = new Map(); #accountPromises = new Map>(); @@ -72,12 +69,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { let isExecutableTransaction = false; const executables = this.executables; - let executableOrigin = executables.get(origin); - let executableOriginTransactions: utils.Heap; - if (executableOrigin) { - highestNonce = executableOrigin.nonce; - executableOriginTransactions = executableOrigin.transactions; - } + let executableOriginTransactions = executables.get(origin); let length: number; if (executableOriginTransactions && (length = executableOriginTransactions.length)) { @@ -164,12 +156,11 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // if it is executable add it to the executables queue if (isExecutableTransaction) { if (executableOriginTransactions) { - executableOrigin.nonce = highestNonce; executableOriginTransactions.push(transaction); } else { // if we don't yet have a executables queue for this origin make one now executableOriginTransactions = utils.Heap.from(transaction, byNonce); - executables.set(origin, {nonce: highestNonce, transactions: executableOriginTransactions}); + executables.set(origin, executableOriginTransactions); } this.#drainQueued(origin, queuedOriginTransactions, executableOriginTransactions, transactionNonce); From 6a19a1cf5c4173f31ddc1db9f11594681cd0eda1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 24 Sep 2020 17:56:09 -0400 Subject: [PATCH 529/691] add clarifying comment --- src/chains/ethereum/src/blockchain.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 288a92687a..6d9be1445d 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -140,6 +140,8 @@ export default class Blockchain extends Emittery.Typed Date: Thu, 24 Sep 2020 17:56:35 -0400 Subject: [PATCH 530/691] remove unnecessary assigment --- src/chains/ethereum/src/blockchain.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 6d9be1445d..1fa0705e17 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -147,8 +147,6 @@ export default class Blockchain extends Emittery.Typed block); } } From 1d5bbd33952d6961e0ae3b83c48837af7755de66 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 24 Sep 2020 17:56:43 -0400 Subject: [PATCH 531/691] add clarifying comment --- src/chains/ethereum/src/blockchain.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 1fa0705e17..11cf17029c 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -171,10 +171,10 @@ export default class Blockchain extends Emittery.Typed this.#isPaused() ? null : this.mine(1); - if (instamine) { + if (instamine) { // insta mining // whenever the transaction pool is drained mine the txs into blocks this.transactions.transactionPool.on("drain", mineAll); - } else { + } else { // interval mining const wait = () => unref(setTimeout(mineNext, options.miner.blockTime * 1000)); const mineNext = () => mineAll().then(wait); wait(); From c9133eb712828106afed78ceb49d8039d134c2bf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 24 Sep 2020 17:58:45 -0400 Subject: [PATCH 532/691] refactor miner for clarity --- src/chains/ethereum/src/miner.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 147f9c262d..4f6279980e 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -169,15 +169,11 @@ export default class Miner extends Emittery { this.#currentlyExecutingPrice = Quantity.from(best.gasPrice).toBigInt(); - const runArgs = { - tx: best, - block - }; // Set a transaction-level checkpoint so we can undo state changes in // the case where the transaction is rejected by the VM. await this.#checkpoint(); - const result = await this.#runTx(runArgs, origin, pending); + const result = await this.#runTx(best, block, origin, pending); if (result !== null) { const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); if (blockGasLeft >= gasUsed) { @@ -189,9 +185,9 @@ export default class Miner extends Emittery { blockData.gasUsed += gasUsed; // calculate receipt and tx tries - const receipt = best.fillFromResult(result, blockData.gasUsed); const txKey = rlpEncode(numTransactions); promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); + const receipt = best.fillFromResult(result, blockData.gasUsed); promises.push(putInTrie(receiptTrie, txKey, receipt)); // update the block's bloom @@ -286,9 +282,9 @@ export default class Miner extends Emittery { return {block, transactions: blockTransactions}; } - #runTx = async (runArgs: any, origin: string, pending: Map>) => { + #runTx = async (tx: Transaction, block: Block, origin: string, pending: Map>) => { try { - return await this.#vm.runTx(runArgs); + return await this.#vm.runTx({tx, block} as any); } catch (err) { const errorMessage = err.message; if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { @@ -317,7 +313,7 @@ export default class Miner extends Emittery { } } - this.emit("transaction-failure", {txHash: runArgs.tx.hash(), errorMessage}); + this.emit("transaction-failure", {txHash: tx.hash(), errorMessage}); return null; } } From 076f7722eb4de2a8159d6ed203c6d8e61596f488 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 24 Sep 2020 17:58:56 -0400 Subject: [PATCH 533/691] add clarifying comment --- src/chains/ethereum/src/miner.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 4f6279980e..06f1d0cbca 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -244,6 +244,10 @@ export default class Miner extends Emittery { keepMining = priced.removeBest(); } } else { + // no result means the tranasction is an "always failing tx", so we + // revert it's changes here. + // Note: we don't clean up ()`removeBest`, etc) because `runTx`'s + // error handler does the clean up itself. await this.#revert(); } } From 163276e1939b711d69489b1ee13f0b6d6a93d92e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 24 Sep 2020 17:59:04 -0400 Subject: [PATCH 534/691] add clarifying comment --- src/chains/ethereum/src/miner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 06f1d0cbca..4531c4523c 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -231,7 +231,7 @@ export default class Miner extends Emittery { // next bext transaction sorted in our `priced` heap. keepMining = priced.removeBest(); } - } else { + } else { // didn't fit in the current block await this.#revert(); // unlock the transaction so the transaction pool can reconsider this From 430907cce4ff6fdfd15bae8e2ed75024236cbc7c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 24 Sep 2020 17:59:47 -0400 Subject: [PATCH 535/691] add clarifying comment --- src/chains/ethereum/src/components/transaction-pool.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index f73912e423..800d25c53d 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -153,8 +153,8 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { transaction.sign(secretKey.toBuffer()); } - // if it is executable add it to the executables queue if (isExecutableTransaction) { + // if it is executable add it to the executables queue if (executableOriginTransactions) { executableOriginTransactions.push(transaction); } else { @@ -166,6 +166,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { this.#drainQueued(origin, queuedOriginTransactions, executableOriginTransactions, transactionNonce); return true; } else { + // otherwise, put it in the future queue if (queuedOriginTransactions) { queuedOriginTransactions.push(transaction); } else { From fbdf45c01d5d7b2ef98e1ab09a5f6b3687d518ac Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 24 Sep 2020 18:00:06 -0400 Subject: [PATCH 536/691] make private and readonly things private and readonly --- src/chains/ethereum/src/components/transaction-pool.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/components/transaction-pool.ts index 800d25c53d..ec19d565ea 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/components/transaction-pool.ts @@ -18,7 +18,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { /** * Minimum price bump percentage to replace an already existing transaction (nonce) */ - public priceBump: bigint = 10n; + #priceBump: bigint = 10n; #blockchain: Blockchain; constructor(options: EthereumInternalOptions["miner"], blockchain: Blockchain) { @@ -26,9 +26,9 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { this.#blockchain = blockchain; this.#options = options; } - public executables: Map> = new Map(); - #origins: Map> = new Map(); - #accountPromises = new Map>(); + public readonly executables: Map> = new Map(); + readonly #origins: Map> = new Map(); + readonly #accountPromises = new Map>(); /** * Inserts a transaction into the pending queue, if executable, or future pool @@ -77,7 +77,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // executables queue already. Replace the matching transaction or throw this // new transaction away as neccessary. const pendingArray = executableOriginTransactions.array; - const priceBump = this.priceBump; + const priceBump = this.#priceBump; const newGasPrice = Quantity.from(transaction.gasPrice).toBigInt(); // Notice: we're iterating over the raw heap array, which isn't // neccessarily sorted From b8be167f702c18ca3a1a945ddb0cc80e652cb21e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 14 Oct 2020 17:43:29 -0400 Subject: [PATCH 537/691] fix: enforce param count in api methods --- .../__tests__/api/personal/personal.test.ts | 6 +- .../ethereum/__tests__/api/shh/shh.test.ts | 14 +- src/chains/ethereum/src/api.ts | 123 ++++++++++++++---- src/chains/ethereum/src/types/shh.ts | 1 + 4 files changed, 112 insertions(+), 32 deletions(-) create mode 100644 src/chains/ethereum/src/types/shh.ts diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/__tests__/api/personal/personal.test.ts index b47553aec4..e6e1490114 100644 --- a/src/chains/ethereum/__tests__/api/personal/personal.test.ts +++ b/src/chains/ethereum/__tests__/api/personal/personal.test.ts @@ -64,7 +64,7 @@ describe("api", () => { }; // make sure we can't use the account via personal_sendTransaction and no passphrase - await assert.rejects(provider.send("personal_sendTransaction", [transaction]), { + await assert.rejects(provider.send("personal_sendTransaction", [transaction, undefined]), { message: "could not decrypt key with given password" }, "personal_sendTransaction should have rejected due to locked from account without its passphrase"); @@ -182,7 +182,7 @@ describe("api", () => { // generate an account const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); - testLockedAccountWithPassphraseViaEth_SendTransaction(provider, newAccount, passphrase); + await testLockedAccountWithPassphraseViaEth_SendTransaction(provider, newAccount, passphrase); }); }); @@ -192,7 +192,7 @@ describe("api", () => { // generate an account const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); - testLockedAccountWithPassphraseViaPersonal_SendTransaction(provider, newAccount, passphrase); + await testLockedAccountWithPassphraseViaPersonal_SendTransaction(provider, newAccount, passphrase); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/shh/shh.test.ts b/src/chains/ethereum/__tests__/api/shh/shh.test.ts index 3d1658b2f1..2902897091 100644 --- a/src/chains/ethereum/__tests__/api/shh/shh.test.ts +++ b/src/chains/ethereum/__tests__/api/shh/shh.test.ts @@ -16,12 +16,12 @@ describe("api", () => { }); it("returns it's shh_hasIdentity status", async () => { - const result = await provider.send("shh_hasIdentity"); + const result = await provider.send("shh_hasIdentity", ["0x0"]); assert.strictEqual(result, false); }); it("returns false for shh_addToGroup", async () => { - const result = await provider.send("shh_addToGroup"); + const result = await provider.send("shh_addToGroup", ["0x0"]); assert.strictEqual(result, false); }); @@ -31,27 +31,27 @@ describe("api", () => { }); it("returns false for shh_newFilter", async () => { - const result = await provider.send("shh_newFilter"); + const result = await provider.send("shh_newFilter", ["0x0", []]); assert.strictEqual(result, false); }); it("returns false for shh_uninstallFilter", async () => { - const result = await provider.send("shh_uninstallFilter"); + const result = await provider.send("shh_uninstallFilter", ["0x0"]); assert.strictEqual(result, false); }); it("returns []] for shh_getFilterChanges", async () => { - const result = await provider.send("shh_getFilterChanges"); + const result = await provider.send("shh_getFilterChanges", ["0x0"]); assert.deepStrictEqual(result, []); }); it("returns false for shh_getMessages", async () => { - const result = await provider.send("shh_getMessages"); + const result = await provider.send("shh_getMessages", ["0x0"]); assert.strictEqual(result, false); }); it("returns false for shh_post", async () => { - const result = await provider.send("shh_post"); + const result = await provider.send("shh_post", [{}]); assert.strictEqual(result, false); }); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 0545e04dec..9c610aa6d7 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -22,6 +22,7 @@ import EthereumAccount from "ethereumjs-account"; import { Block } from "./components/block-manager"; import estimateGas from "./things/gas-estimator"; import CodedError, { ErrorCodes } from "./things/coded-error"; +import { WhisperPostObject } from "./types/shh"; //#endregion //#region Constants @@ -111,18 +112,23 @@ function assertExceptionalTransactions(transactions: Transaction[]) { } } -type UnknownFn = (this: unknown, ...args: unknown[]) => unknown; +type UnknownFn = (this: unknown, ...args: any[]) => unknown; type FunctionPropertyDescriptor = TypedPropertyDescriptor; function assertArgLength(min: number, max: number = min) { - return function(_target: any, _propertyKey: any, descriptor: FunctionPropertyDescriptor) { + return function(target: O, propertyKey: keyof O, descriptor: FunctionPropertyDescriptor) { const original = descriptor.value; - descriptor.value = function(this: any) { + descriptor.value = function(this: unknown) { const length = arguments.length; - if (length < min || length > max) throw new Error("Incorrect number of arguments."); + if (length < min || length > max) { + throw new Error(`Incorrect number of arguments. '${propertyKey}' requires ${ + min === max + ? `exactly ${min} ${min === 1 ? "argument" : "arguments"}.` + : `between ${min} and ${max} arguments.`}`); + } return Reflect.apply(original, this, arguments); - } as any; - return descriptor as TypedPropertyDescriptor; - } as MethodDecorator; + } as T; + return descriptor as FunctionPropertyDescriptor; + }; } export default class EthereumApi implements types.Api { @@ -202,6 +208,7 @@ export default class EthereumApi implements types.Api { * @param {String} value - String to store. * @returns returns true if the value was stored, otherwise false. */ + @assertArgLength(3) async db_putString(dbName: string, key: string, value: string) { return false; }; @@ -213,6 +220,7 @@ export default class EthereumApi implements types.Api { * @param {String} key - Key name. * @returns The previously stored string. */ + @assertArgLength(2) async db_getString(dbName: string, key: string) { return ""; }; @@ -225,6 +233,7 @@ export default class EthereumApi implements types.Api { * @param {DATA} data - Data to store. * @returns true if the value was stored, otherwise false. */ + @assertArgLength(3) async db_putHex(dbName: string, key: string, data: string) { return false; }; @@ -236,16 +245,19 @@ export default class EthereumApi implements types.Api { * @param {String} key - Key name. * @returns The previously stored data. */ + @assertArgLength(2) async db_getHex(dbName: string, key: string) { return "0x00"; }; //#endregion //#region bzz + @assertArgLength(0) async bzz_hive() { return []; } + @assertArgLength(0) async bzz_info() { return []; } @@ -270,6 +282,7 @@ export default class EthereumApi implements types.Api { return "0x0"; } + @assertArgLength(4) async evm_setStorageAt( address: string, position: bigint | number, @@ -343,6 +356,7 @@ export default class EthereumApi implements types.Api { * @param nonce * @returns true if it worked */ + @assertArgLength(2) async evm_setAccountNonce(address: string, nonce: string) { return new Promise((resolve, reject) => { const buffer = Address.from(address).toBuffer(); @@ -371,6 +385,7 @@ export default class EthereumApi implements types.Api { * @param seconds Must be greater than or equal to `0` * @returns Returns the total time adjustment, in seconds. */ + @assertArgLength(1) async evm_increaseTime(seconds: number) { return Math.floor(this.#blockchain.increaseTime(seconds * 1000) / 1000); } @@ -385,7 +400,8 @@ export default class EthereumApi implements types.Api { * @param timestamp JavaScript timestamp (millisecond precision) * @returns The amount of *seconds* between the given timestamp and now. */ - async evm_setTime(time?: Date | number) { + @assertArgLength(0, 1) + async evm_setTime(time: Date | number) { return Math.floor(this.#blockchain.setTime(+time) / 1000); } @@ -490,6 +506,7 @@ export default class EthereumApi implements types.Api { * @param threads * @returns true */ + @assertArgLength(0, 1) async miner_start(threads: number = 1) { if (this.#options.miner.legacyInstamine === true) { const transactions = await this.#blockchain.resume(threads); @@ -505,6 +522,7 @@ export default class EthereumApi implements types.Api { /** * Stop the CPU mining operation. */ + @assertArgLength(0) async miner_stop() { this.#blockchain.pause(); return true; @@ -516,6 +534,7 @@ export default class EthereumApi implements types.Api { * Any transactions that are below this limit are excluded from the mining * process. */ + @assertArgLength(1) async miner_setGasPrice(number: string) { this.#options.miner.gasPrice = Quantity.from(number); return true; @@ -525,6 +544,7 @@ export default class EthereumApi implements types.Api { * Sets the etherbase, where mining rewards will go. * @param address */ + @assertArgLength(1) async miner_setEtherbase(address: string) { this.#blockchain.coinbase = Address.from(address); return true; @@ -536,6 +556,7 @@ export default class EthereumApi implements types.Api { * Returns the current client version. * @returns The current client version. */ + @assertArgLength(0) async web3_clientVersion() { return CLIENT_VERSION; } @@ -545,6 +566,7 @@ export default class EthereumApi implements types.Api { * @param {data} the data to convert into a SHA3 hash. * @returns The SHA3 result of the given string. */ + @assertArgLength(1) async web3_sha3(data: string) { return Data.from(createKeccakHash("keccak256").update(data).digest()); } @@ -556,6 +578,7 @@ export default class EthereumApi implements types.Api { * @returns The current network id. This value should NOT be JSON-RPC * Quantity/Data encoded. */ + @assertArgLength(0) async net_version() { return this.#options.chain.networkId.toString(); } @@ -564,6 +587,7 @@ export default class EthereumApi implements types.Api { * Returns true if client is actively listening for network connections. * @returns true when listening, otherwise false. */ + @assertArgLength(0) async net_listening() { // TODO: this should return false when ganache isn't used with a server, or // or while the server is still initializing. @@ -574,6 +598,7 @@ export default class EthereumApi implements types.Api { * Returns number of peers currently connected to the client. * @returns integer of the number of connected peers. */ + @assertArgLength(0) async net_peerCount() { return RPCQUANTITY_ZERO; } @@ -590,6 +615,7 @@ export default class EthereumApi implements types.Api { * * @returns the amount of gas used. */ + @assertArgLength(1, 2) async eth_estimateGas(transaction: any, blockNumber: Buffer | Tag | string = Tag.LATEST) { const blockchain = this.#blockchain; const blocks = blockchain.blocks; @@ -643,6 +669,7 @@ export default class EthereumApi implements types.Api { * Returns the current ethereum protocol version. * @returns The current ethereum protocol version. */ + @assertArgLength(0) async eth_protocolVersion() { return PROTOCOL_VERSION; } @@ -655,6 +682,7 @@ export default class EthereumApi implements types.Api { * currentBlock: {bigint} - The current block, same as eth_blockNumber * highestBlock: {bigint} - The estimated highest block */ + @assertArgLength(0) async eth_syncing() { return false; } @@ -663,6 +691,7 @@ export default class EthereumApi implements types.Api { * Returns the client coinbase address. * @returns 20 bytes - the current coinbase address. */ + @assertArgLength(0) async eth_coinbase() { return this.#blockchain.coinbase; } @@ -673,6 +702,7 @@ export default class EthereumApi implements types.Api { * @param transactions Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions. * @returns the block, `null` if the block doesn't exist. */ + @assertArgLength(1, 2) async eth_getBlockByNumber(number: string | Buffer, transactions = false) { const block = await this.#blockchain.blocks.get(number).catch(_ => null); return block ? block.toJSON(transactions) : null; @@ -684,6 +714,7 @@ export default class EthereumApi implements types.Api { * @param transactions Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions. * @returns Block */ + @assertArgLength(1, 2) async eth_getBlockByHash(hash: string | Buffer, transactions = false) { const block = await this.#blockchain.blocks.getByHash(hash).catch(_ => null); return block ? block.toJSON(transactions) : null; @@ -693,6 +724,7 @@ export default class EthereumApi implements types.Api { * Returns the number of transactions in a block from a block matching the given block number. * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. */ + @assertArgLength(1) async eth_getBlockTransactionCountByNumber(number: string | Buffer) { const rawBlock = await this.#blockchain.blocks.getRaw(number); if (rawBlock) { @@ -707,6 +739,7 @@ export default class EthereumApi implements types.Api { * Returns the number of transactions in a block from a block matching the given block hash. * @param hash DATA, 32 Bytes - hash of a block. */ + @assertArgLength(1) async eth_getBlockTransactionCountByHash(hash: string | Buffer) { const number = await this.#blockchain.blocks.getNumberFromHash(hash); if (number) { @@ -716,6 +749,7 @@ export default class EthereumApi implements types.Api { } } + @assertArgLength(0) async eth_getCompilers() { return [] as string[]; } @@ -725,6 +759,7 @@ export default class EthereumApi implements types.Api { * @param hash DATA, 32 Bytes - hash of a block. * @param index QUANTITY - integer of the transaction index position. */ + @assertArgLength(2) async eth_getTransactionByBlockHashAndIndex(hash: string | Buffer, index: string) { const block = await this.eth_getBlockByHash(hash, true); if (block) { @@ -739,6 +774,7 @@ export default class EthereumApi implements types.Api { * @param number QUANTITY|TAG - a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. * @param index QUANTITY - integer of the transaction index position. */ + @assertArgLength(2) async eth_getTransactionByBlockNumberAndIndex(number: string | Buffer, index: string) { const block = await this.eth_getBlockByNumber(number, true); return block.transactions[parseInt(index, 10)]; @@ -748,6 +784,7 @@ export default class EthereumApi implements types.Api { * Returns the number of uncles in a block from a block matching the given block hash. * @param hash DATA, 32 Bytes - hash of a block. */ + @assertArgLength(1) async eth_getUncleCountByBlockHash(hash: string | Buffer) { return RPCQUANTITY_ZERO } @@ -756,6 +793,7 @@ export default class EthereumApi implements types.Api { * Returns the number of uncles in a block from a block matching the given block hash. * @param hash DATA, 32 Bytes - hash of a block. */ + @assertArgLength(1) async eth_getUncleCountByBlockNumber(number: string | Buffer) { return RPCQUANTITY_ZERO } @@ -766,6 +804,7 @@ export default class EthereumApi implements types.Api { * @param hash - hash of a block * @param index - the uncle's index position. */ + @assertArgLength(2) async eth_getUncleByBlockHashAndIndex(hash: Data, index: Quantity) { return null as ReturnType; } @@ -776,6 +815,7 @@ export default class EthereumApi implements types.Api { * @param blockNumber - a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. * @param uncleIndex - the uncle's index position. */ + @assertArgLength(2) async eth_getUncleByBlockNumberAndIndex(blockNumber: Buffer | Tag = Tag.LATEST, uncleIndex: Quantity) { return null as ReturnType; } @@ -789,6 +829,7 @@ export default class EthereumApi implements types.Api { * @param {QUANTITY} filterId - A filter id * @returns the hash of the current block, the seedHash, and the boundary condition to be met ("target"). */ + @assertArgLength(1) async eth_getWork(filterId: Quantity) { return [] as [string, string, string] | []; }; @@ -801,6 +842,7 @@ export default class EthereumApi implements types.Api { * @param {DATA, 32 Bytes} digest - The mix digest (256 bits) * @returns `true` if the provided solution is valid, otherwise `false`. */ + @assertArgLength(3) async eth_submitWork(nonce: Data, powHash: Data, digest: Data) { return false; }; @@ -812,6 +854,7 @@ export default class EthereumApi implements types.Api { * @param {String} clientID - A random hexadecimal(32 bytes) ID identifying the client * @returns `true` if submitting went through succesfully and `false` otherwise. */ + @assertArgLength(2) async eth_submitHashrate(hashRate: string, clientID: string) { return false; }; @@ -820,6 +863,7 @@ export default class EthereumApi implements types.Api { * Returns true if client is actively mining new blocks. * @returns returns true of the client is mining, otherwise false. */ + @assertArgLength(0) async eth_mining() { return this.#blockchain.isMining(); } @@ -828,6 +872,7 @@ export default class EthereumApi implements types.Api { * Returns the number of hashes per second that the node is mining with. * @returns number of hashes per second. */ + @assertArgLength(0) async eth_hashrate() { return RPCQUANTITY_ZERO; } @@ -836,6 +881,7 @@ export default class EthereumApi implements types.Api { * Returns the current price per gas in wei. * @returns integer of the current gas price in wei. */ + @assertArgLength(0) async eth_gasPrice() { return this.#options.miner.gasPrice; } @@ -844,6 +890,7 @@ export default class EthereumApi implements types.Api { * Returns a list of addresses owned by client. * @returns Array of 20 Bytes - addresses owned by the client. */ + @assertArgLength(0) async eth_accounts() { return this.#wallet.addresses; } @@ -852,6 +899,7 @@ export default class EthereumApi implements types.Api { * Returns the number of most recent block. * @returns integer of the current block number the client is on. */ + @assertArgLength(0) async eth_blockNumber() { const latest = await this.#blockchain.blocks.get(Tag.LATEST); return Quantity.from(latest.value.header.number); @@ -863,6 +911,7 @@ export default class EthereumApi implements types.Api { * @returns The chain id as a string. * @EIP [155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) */ + @assertArgLength(0) async eth_chainId() { return Quantity.from(this.#options.chain.chainId); } @@ -873,6 +922,7 @@ export default class EthereumApi implements types.Api { * @param blockNumber integer block number, or the string "latest", "earliest" * or "pending", see the default block parameter */ + @assertArgLength(1, 2) async eth_getBalance(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { const chain = this.#blockchain; const account = await chain.accounts.get(Address.from(address), blockNumber); @@ -886,6 +936,7 @@ export default class EthereumApi implements types.Api { * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter * @returns the code from the given address. */ + @assertArgLength(1, 2) async eth_getCode(address: Buffer, blockNumber: Buffer | Tag = Tag.LATEST) { const blockchain = this.#blockchain; const blockProm = blockchain.blocks.getRaw(blockNumber); @@ -939,6 +990,7 @@ export default class EthereumApi implements types.Api { * @param blockNumber integer block number, or the string "latest", "earliest" * or "pending", see the default block parameter */ + @assertArgLength(2, 3) async eth_getStorageAt( address: string, position: bigint | number, @@ -1001,6 +1053,7 @@ export default class EthereumApi implements types.Api { * * @param transactionHash 32 Bytes - hash of a transaction */ + @assertArgLength(1) async eth_getTransactionByHash(transactionHash: string) { const chain = this.#blockchain; const hashBuffer = Data.from(transactionHash).toBuffer(); @@ -1023,6 +1076,7 @@ export default class EthereumApi implements types.Api { * @param transactionHash 32 Bytes - hash of a transaction * @returns Returns the receipt of a transaction by transaction hash. */ + @assertArgLength(1) async eth_getTransactionReceipt(transactionHash: string) { const blockchain = this.#blockchain; const transactionPromise = blockchain.transactions.get(transactionHash); @@ -1041,6 +1095,7 @@ export default class EthereumApi implements types.Api { * @param transaction * @returns The transaction hash */ + @assertArgLength(1) async eth_sendTransaction(transaction: any) { let fromString = transaction.from; let from: Address; @@ -1106,6 +1161,7 @@ export default class EthereumApi implements types.Api { * @param transaction * @returns The transaction hash */ + @assertArgLength(1) async eth_sendRawTransaction(transaction: string) { const tx = new Transaction(transaction, this.#common, Transaction.types.signed); return this.#blockchain.queueTransaction(tx) @@ -1124,6 +1180,7 @@ export default class EthereumApi implements types.Api { * @param data message to sign * @returns Signature */ + @assertArgLength(2) async eth_sign(address: string | Buffer, message: string | Buffer) { const account = Address.from(address).toString().toLowerCase(); const wallet = this.#wallet; @@ -1149,6 +1206,7 @@ export default class EthereumApi implements types.Api { * that the `v` parameter includes the chain id as specified in [EIP-155](https://eips.ethereum.org/EIPS/eip-155). * @EIP [712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md) */ + @assertArgLength(2) async eth_signTypedData(address: string | Buffer, typedData: TypedData) { const account = Address.from(address).toString().toLowerCase(); @@ -1202,6 +1260,7 @@ export default class EthereumApi implements types.Api { * @returns A subscription id. */ eth_subscribe(subscriptionName: "logs", options: Pick): PromiEvent + @assertArgLength(1, 2) eth_subscribe(subscriptionName: "newHeads" | "newPendingTransactions" | "syncing" | "logs", options?: Pick) { const subscriptions = this.#subscriptions; switch (subscriptionName) { @@ -1294,7 +1353,7 @@ export default class EthereumApi implements types.Api { } } - + @assertArgLength(1) async eth_unsubscribe(subscriptionId: SubscriptionId) { const subscriptions = this.#subscriptions; const unsubscribe = subscriptions.get(subscriptionId); @@ -1313,6 +1372,7 @@ export default class EthereumApi implements types.Api { * * @returns A filter id. */ + @assertArgLength(0) async eth_newBlockFilter() { const unsubscribe = this.#blockchain.on("block", (block: Block) => { value.updates.push(Data.from(block.value.hash(), 32)); @@ -1329,6 +1389,7 @@ export default class EthereumApi implements types.Api { * * @returns A filter id. */ + @assertArgLength(0) async eth_newPendingTransactionFilter() { const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { value.updates.push(Data.from(transaction.hash(), 32)); @@ -1363,6 +1424,7 @@ export default class EthereumApi implements types.Api { * * @param filter The filter options */ + @assertArgLength(0, 1) async eth_newFilter(filter: FilterArgs = {}) { const blockchain = this.#blockchain; const { addresses, topics } = parseFilterDetails(filter); @@ -1392,6 +1454,7 @@ export default class EthereumApi implements types.Api { * @returns an array of logs, block hashes, or transactions hashes, depending * on the filter type, which occurred since last poll. */ + @assertArgLength(1) async eth_getFilterChanges(filterId: string) { const filter = this.#filters.get(filterId); if (filter) { @@ -1411,6 +1474,7 @@ export default class EthereumApi implements types.Api { * @returns `true` if the filter was successfully uninstalled, otherwise * `false`. */ + @assertArgLength(1) async eth_uninstallFilter(filterId: string) { const filter = this.#filters.get(filterId); if (!filter) return false; @@ -1423,6 +1487,7 @@ export default class EthereumApi implements types.Api { * * @returns Array of log objects, or an empty array. */ + @assertArgLength(1) async eth_getFilterLogs(filterId: string) { const filter = this.#filters.get(filterId); if (filter && filter.type === FilterTypes.log) { @@ -1438,6 +1503,7 @@ export default class EthereumApi implements types.Api { * @param filter The filter options * @returns Array of log objects, or an empty array. */ + @assertArgLength(1) async eth_getLogs(filter: FilterArgs) { const blockchain = this.#blockchain; const blockLogs = blockchain.blockLogs; @@ -1475,6 +1541,7 @@ export default class EthereumApi implements types.Api { * or "pending", see the default block parameter * @returns integer of the number of transactions sent from this address. */ + @assertArgLength(1, 2) async eth_getTransactionCount(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { const account = await this.#blockchain.accounts.get(Address.from(address), blockNumber); if (!account) return null; @@ -1490,6 +1557,7 @@ export default class EthereumApi implements types.Api { * * @returns the return value of executed contract. */ + @assertArgLength(1, 2) async eth_call(transaction: any, blockNumber: string | Buffer | Tag = Tag.LATEST) { const blockchain = this.#blockchain; const blocks = blockchain.blocks; @@ -1548,6 +1616,7 @@ export default class EthereumApi implements types.Api { * added. * @returns the Ethereum account addresses of all keys that have been added. */ + @assertArgLength(0) async personal_listAccounts() { return this.#wallet.addresses; }; @@ -1558,6 +1627,7 @@ export default class EthereumApi implements types.Api { * @param passphrase * @returns The new account's address */ + @assertArgLength(1) async personal_newAccount(passphrase: string) { if (typeof passphrase !== "string") { throw new Error("missing value for required argument `passphrase`"); @@ -1581,6 +1651,7 @@ export default class EthereumApi implements types.Api { * @param passphrase * @returnsReturns the address of the new account. */ + @assertArgLength(2) async personal_importRawKey(rawKey: string, passphrase: string) { if (typeof passphrase !== "string") { throw new Error("missing value for required argument `passphrase`"); @@ -1601,6 +1672,7 @@ export default class EthereumApi implements types.Api { * Locks the account. The account can no longer be used to send transactions. * @param address */ + @assertArgLength(1) async personal_lockAccount(address: string) { return this.#wallet.lockAccount(address.toLowerCase()); }; @@ -1620,6 +1692,7 @@ export default class EthereumApi implements types.Api { * should remain unlocked for. * @returns true if it worked. Throws an error if it did not. */ + @assertArgLength(2, 3) async personal_unlockAccount(address: string, passphrase: string, duration: number = 300) { return this.#wallet.unlockAccount(address.toLowerCase(), passphrase, duration); }; @@ -1636,6 +1709,7 @@ export default class EthereumApi implements types.Api { * @param txData * @param passphrase */ + @assertArgLength(2) async personal_sendTransaction(transaction: any, passphrase: string) { let fromString = transaction.from; let from: Address; @@ -1668,6 +1742,7 @@ export default class EthereumApi implements types.Api { //#endregion //#region rpc + @assertArgLength(0) async rpc_modules() { return RPC_MODULES; } @@ -1680,6 +1755,7 @@ export default class EthereumApi implements types.Api { * * @returns {DATA, 60 Bytes} result - the address of the new identiy. */ + @assertArgLength(0) async shh_newIdentity() { return "0x00"; }; @@ -1690,6 +1766,7 @@ export default class EthereumApi implements types.Api { * @param {DATA, 60 Bytes} address - The identity address to check. * @returns returns true if the client holds the privatekey for that identity, otherwise false. */ + @assertArgLength(1) async shh_hasIdentity(address: string) { return false; }; @@ -1699,6 +1776,7 @@ export default class EthereumApi implements types.Api { * * @returns the address of the new group. */ + @assertArgLength(0) async shh_newGroup() { return "0x00"; }; @@ -1709,6 +1787,7 @@ export default class EthereumApi implements types.Api { * @param {DATA, 60 Bytes} - The identity address to add to a group. * @returns true if the identity was successfully added to the group, otherwise false. */ + @assertArgLength(1) async shh_addToGroup(address: string) { return false; }; @@ -1722,6 +1801,7 @@ export default class EthereumApi implements types.Api { * @param {Array of DATA} topics - Array of DATA topics which the incoming message's topics should match. * @returns returns true if the identity was successfully added to the group, otherwise false. */ + @assertArgLength(2) async shh_newFilter(to: string, topics: any[]) { return false; }; @@ -1733,6 +1813,7 @@ export default class EthereumApi implements types.Api { * @param {QUANTITY} id - The filter id. Ex: "0x7" * @returns true if the filter was successfully uninstalled, otherwise false. */ + @assertArgLength(1) async shh_uninstallFilter(id: string) { return false; }; @@ -1743,6 +1824,7 @@ export default class EthereumApi implements types.Api { * @param {QUANTITY} id - The filter id. Ex: "0x7" * @returns More Info: https://github.com/ethereum/wiki/wiki/JSON-RPC#shh_getfilterchanges */ + @assertArgLength(1) async shh_getFilterChanges(id: string) { return []; }; @@ -1753,23 +1835,19 @@ export default class EthereumApi implements types.Api { * @param {QUANTITY} id - The filter id. Ex: "0x7" * @returns See: shh_getFilterChanges */ + @assertArgLength(1) async shh_getMessages(id: string) { return false; }; + /** - * Sends a whisper message. - * - * @param {DATA, 60 Bytes} from - (optional) The identity of the sender. - * @param {DATA, 60 Bytes} to - - * ^(optional) The identity of the receiver. When present whisper will encrypt the message so that - * only the receiver can decrypt it. - * @param {Array of DATA} topics - Array of DATA topics, for the receiver to identify messages. - * @param {DATA} payload - The payload of the message. - * @param {QUANTITY} priority - The integer of the priority in a range from ... (?). - * @param {QUANTITY} ttl - integer of the time to live in seconds. - * @returns returns true if the message was sent, otherwise false. - */ - async shh_post(from: string, to: string, topics: any[], payload: string, priority: string, ttl: string) { + * Creates a whisper message and injects it into the network for distribution. + * + * @param postData + * @returns returns true if the message was sent, otherwise false. + */ + @assertArgLength(1) + async shh_post(postData: WhisperPostObject) { return false; } @@ -1778,6 +1856,7 @@ export default class EthereumApi implements types.Api { * * @returns The current whisper protocol version */ + @assertArgLength(0) async shh_version() { return "2"; } diff --git a/src/chains/ethereum/src/types/shh.ts b/src/chains/ethereum/src/types/shh.ts new file mode 100644 index 0000000000..7d2ffdc19b --- /dev/null +++ b/src/chains/ethereum/src/types/shh.ts @@ -0,0 +1 @@ +export type WhisperPostObject = any; From c666057fab048c350f67ba1c842368b10af52440 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 14 Oct 2020 17:44:00 -0400 Subject: [PATCH 538/691] chore: update types per new options config --- src/packages/core/__tests__/server.test.ts | 18 +++++++++--------- src/packages/core/src/connector.ts | 4 ++-- src/packages/core/src/server.ts | 7 +++++-- src/packages/core/src/servers/http-server.ts | 6 +++--- src/packages/core/src/servers/ws-server.ts | 6 +++--- src/packages/flavors/__tests__/index.test.ts | 1 - src/packages/flavors/src/index.ts | 6 ++++-- 7 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/__tests__/server.test.ts index b7bd2b1af4..be87a947b6 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -407,7 +407,7 @@ describe("server", () => { setImmediate(setImmediate, () => { // resolve the `provider.send` to make sure the server can // handle _not_ responding to a request that has been aborted: - innerResolve( {value: Promise.resolve()}); + innerResolve( {value: Promise.resolve() as any}); // and finally, resolve the `abort` promise: resolve(void 0); }); @@ -581,11 +581,11 @@ describe("server", () => { it("doesn't crash when the connection is closed while a request is in flight", async () => { const provider = s.provider; - provider.requestRaw = async () => { + provider.requestRaw = (async () => { // close our websocket after intercepting the request await s.close(); return {value: Promise.resolve(void 0)}; - }; + }) as any; const ws = new WebSocket("ws://localhost:" + port); return new Promise((resolve, reject) => { @@ -610,14 +610,14 @@ describe("server", () => { const provider = s.provider; const message = "I hope you get this message"; const oldRequestRaw = provider.requestRaw.bind(provider); - provider.requestRaw = async () => { + provider.requestRaw = (async () => { const promiEvent = new PromiEvent(resolve => { const subId = "0xsubscriptionId"; resolve(subId); setImmediate(() => promiEvent.emit("message", {data: {subscription: subId, result: message}})); }); return {value: promiEvent}; - }; + }) as any; const ws = new WebSocket("ws://localhost:" + port); const result = await new Promise(resolve => { @@ -706,12 +706,12 @@ describe("server", () => { it("doesn't crash when the connection is closed while a subscription is in flight", async () => { const provider = s.provider; let promiEvent: PromiEvent; - provider.requestRaw = async () => { + provider.requestRaw = (async () => { promiEvent = new PromiEvent(resolve => { resolve("0xsubscriptionId"); }); return {value: promiEvent}; - }; + }) as any; const ws = new WebSocket("ws://localhost:" + port); return new Promise((resolve, reject) => { @@ -752,9 +752,9 @@ describe("server", () => { // create tons of data to force websocket backpressure const huge = {}; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; - s.provider.requestRaw = async () => { + s.provider.requestRaw = (async () => { return {value: Promise.resolve(huge)}; - }; + }) as any; } const ws = new WebSocket("ws://localhost:" + port); diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index 320467dd3b..ee43d9aee5 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -1,5 +1,5 @@ import {utils} from "@ganache/utils"; -import {Connectors, DefaultFlavor} from "@ganache/flavors"; +import {ConnectorsByName, DefaultFlavor} from "@ganache/flavors"; import {Options as ProviderOptions} from "@ganache/flavors"; /** @@ -24,7 +24,7 @@ export default { // to a RequestCoordinator. const executor = new utils.Executor(requestCoordinator); - const connector = new Connectors[flavor](providerOptions, executor); + const connector = new ConnectorsByName[flavor](providerOptions, executor); // The request coordinator is initialized in a "paused" state, when the provider is ready we unpause // this lets us accept queue requests before we've even fully initialized. diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index 087178aa12..b8bcaf55f9 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -1,10 +1,13 @@ import {InternalOptions, ServerOptions, serverOptionsConfig} from "./options"; import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; +import {Connectors} from "@ganache/flavors"; import Connector from "./connector"; import WebsocketServer, { WebSocketCapableFlavor } from "./servers/ws-server"; import HttpServer from "./servers/http-server"; +type Providers = Connectors["provider"]; + type Callback = (err: Error | null) => void /** @@ -42,11 +45,11 @@ export default class Server { #httpServer: HttpServer; #listenSocket?: us_listen_socket; #options: InternalOptions; - #connector: Flavors; + #connector: Connectors; #status = Status.closed; #websocketServer: WebsocketServer | null = null; - public get provider(): TezosProvider | EthereumProvider { + public get provider(): Providers { return this.#connector.provider; } diff --git a/src/packages/core/src/servers/http-server.ts b/src/packages/core/src/servers/http-server.ts index bba34de59a..a4e17defde 100644 --- a/src/packages/core/src/servers/http-server.ts +++ b/src/packages/core/src/servers/http-server.ts @@ -1,7 +1,7 @@ import {TemplatedApp, HttpResponse, HttpRequest, RecognizedString} from "uWebSockets.js"; import ContentTypes from "./utils/content-types"; import HttpResponseCodes from "./utils/http-response-codes"; -import {Flavors} from "../options/server-options"; +import {Connectors} from "@ganache/flavors"; type HttpMethods = "GET" | "OPTIONS" | "POST"; @@ -80,8 +80,8 @@ function sendResponse( } export default class HttpServer { - #connector: Flavors; - constructor(app: TemplatedApp, connector: Flavors) { + #connector: Connectors; + constructor(app: TemplatedApp, connector: Connectors) { this.#connector = connector; // JSON-RPC routes... diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index 8a24d9c961..d7bc4353c7 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -9,9 +9,9 @@ type MergePromiseT = Promise ? X : never>; type HandlesWebSocketSignature= ((payload: any, connection: WebSocket) => any); type WebSocketCapableFlavorMap = { - [k in keyof Flavors.Connectors]: - Flavors.Connectors[k]["handle"] extends HandlesWebSocketSignature - ? Flavors.Connectors[k] + [k in keyof Flavors.ConnectorsByName]: + Flavors.ConnectorsByName[k]["handle"] extends HandlesWebSocketSignature + ? Flavors.ConnectorsByName[k] : never; }; diff --git a/src/packages/flavors/__tests__/index.test.ts b/src/packages/flavors/__tests__/index.test.ts index a69df8b078..81945f1965 100644 --- a/src/packages/flavors/__tests__/index.test.ts +++ b/src/packages/flavors/__tests__/index.test.ts @@ -1,5 +1,4 @@ import assert from "assert"; -import { Flavors } from "../src/"; describe("@ganache/flavors", () => { it("needs tests"); diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts index 6d0052e2bd..261f038d49 100644 --- a/src/packages/flavors/src/index.ts +++ b/src/packages/flavors/src/index.ts @@ -3,16 +3,18 @@ import * as Ethereum from "@ganache/ethereum"; export const DefaultFlavor = Ethereum.FlavorName; -export type Connectors = { +export type ConnectorsByName = { [Ethereum.FlavorName]: Ethereum.Connector, // [Tezos.FlavorName]: Tezos.Connector } -export const Connectors = { +export const ConnectorsByName = { [Ethereum.FlavorName]: Ethereum.Connector, // [Tezos.FlavorName]: Tezos.Connector } +export type Connectors = {[K in keyof ConnectorsByName]: ConnectorsByName[K]}[keyof ConnectorsByName] + export type Options = ( ({flavor?: typeof Ethereum.FlavorName} & Ethereum.ProviderOptions) // | [Tezos.FlavorName]: Tezos.ProviderOptions; From 21002cc8a58708895236618b9484df30853bbc6e Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 14 Oct 2020 18:20:10 -0400 Subject: [PATCH 539/691] fix: listen on transaction finalization to resolve hanging txs --- src/chains/ethereum/src/blockchain.ts | 20 +++------- .../src/components/transaction-pool.ts | 25 ++++++++++--- src/chains/ethereum/src/miner.ts | 6 ++- .../ethereum/src/things/rejection-error.ts | 19 ---------- src/chains/ethereum/src/things/transaction.ts | 37 +++++++++++++++++++ 5 files changed, 66 insertions(+), 41 deletions(-) delete mode 100644 src/chains/ethereum/src/things/rejection-error.ts diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 11cf17029c..075d95ba85 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -22,7 +22,6 @@ import {Block as EthereumBlock} from "ethereumjs-block"; import VM from "ethereumjs-vm"; import Address from "./things/address"; import BlockLogManager from "./components/blocklog-manager"; -import RejectionError from "./things/rejection-error"; import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; import { VmError, ERROR } from "ethereumjs-vm/dist/exceptions"; import { EthereumInternalOptions } from "./options"; @@ -181,11 +180,6 @@ export default class Blockchain extends Emittery.Typed { - const txHash = Data.from(failureData.txHash, 32).toString(); - return this.emit("transaction:" + txHash as any, new RejectionError(txHash.toString(), failureData.errorMessage)); - }); - miner.on("block", async (blockData: any) => { await this.#processingBlock; const previousBlock = blocks.latest; @@ -262,18 +256,17 @@ export default class Blockchain extends Emittery.Typed { blocks.latest = block; - if (instamine && options.miner.legacyInstamine) { block.value.transactions.forEach(transaction => { const error = options.chain.vmErrorsOnRPCResponse ? transaction.execException : null - this.emit("transaction:" + Data.from(transaction.hash(), 32).toString() as any, error); + transaction.finalize("confirmed", error); }); // in legacy instamine mode we must delay the broadcast of new blocks process.nextTick(() => { - // emit the block once everything has been fully saved to the database this.emit("block", block); this.emit("blockLogs", blockLogs); }); @@ -520,7 +513,7 @@ export default class Blockchain extends Emittery.Typed { let transactorPromise = this.#accountPromises.get(origin); transactorPromise && await transactorPromise; + // we should _probably_ cache `highestNonce`, but it's actually a really hard thing to cache as the current highest + // nonce might be invalidated (like if the sender doesn't have enough funds), so we'd have to go back to the previous + // highest nonce... but what if that previous highest nonce was also invalidated?! we have to go back to the... you + // get the picture. + // So... we currently do things sub-optimally: + // if we currently have txs in `executableOriginTransactions`, we iterate over them to find the highest nonce + // and use that. Otherwise, we just fetch it from the database. + // Beware! There might still be race conditions here: + // * if the highest tx executes, which causes it to be removed from the `executableOriginTransactions` heap, + // then a new tx comes in _before_ the block is persisted to the database, the nonce might be of the second + // tx would be too low. + // * rough idea for a fix: transactions have a `finalize` method that is called _after_ the tx is saved. Maybe + // when tx's are executed their nonce is moved to a `highNonceByOrigin` map? We'd check this map in addition to the + // `executableOriginTransactions` map, always taking the highest of the two. let highestNonce = 0n; let isExecutableTransaction = false; @@ -80,7 +94,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { const priceBump = this.#priceBump; const newGasPrice = Quantity.from(transaction.gasPrice).toBigInt(); // Notice: we're iterating over the raw heap array, which isn't - // neccessarily sorted + // necessarily sorted for (let i = 0; i < length; i++) { const currentPendingTx = pendingArray[i]; const thisNonce = Quantity.from(currentPendingTx.nonce).toBigInt(); @@ -92,13 +106,14 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // oldPrice, throw out the old now. if (!currentPendingTx.locked && newGasPrice > thisPricePremium) { isExecutableTransaction = true; - // do an in-place replace without triggering a resort because we - // already known where this tranassction should go in this byNonce + // do an in-place replace without triggering a re-sort because we + // already know where this tranasaction should go in this "byNonce" // heap. pendingArray[i] = transaction; - // TODO: how to surface this to the caller?!? - console.error("The *old* transation was rejected"); + currentPendingTx.finalize("rejected", new CodedError( + "Transaction replaced by better transaction", ErrorCodes.TRANSACTION_REJECTED + )); } else { throw new CodedError("transaction rejected; gas price too low to replace existing transaction", ErrorCodes.TRANSACTION_REJECTED); } diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 4531c4523c..9ef3589fa2 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -9,6 +9,7 @@ import Block from "ethereumjs-block"; import VM from "ethereumjs-vm"; import {encode as rlpEncode} from "rlp"; import { EthereumInternalOptions } from "./options"; +import RuntimeError, { RETURN_TYPES } from "./things/runtime-error"; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); @@ -94,7 +95,7 @@ export default class Miner extends Emittery { // if there are more txs to mine, start mining them without awaiting their // result. - if (onlyOneBlock === true && maxTransactions !== 0 && this.#pending) { + if (onlyOneBlock === false && this.#pending) { const nextBlock = this.#createBlock(lastBlock); const pending = this.#pending; this.#pending = null; @@ -317,7 +318,8 @@ export default class Miner extends Emittery { } } - this.emit("transaction-failure", {txHash: tx.hash(), errorMessage}); + const e = {execResult: {runState: {programCounter: 0}, exceptionError: {error: errorMessage}, returnValue: Buffer.allocUnsafe(0)}} as any; + tx.finalize("rejected", new RuntimeError(tx.hash(), e, RETURN_TYPES.TRANSACTION_HASH)); return null; } } diff --git a/src/chains/ethereum/src/things/rejection-error.ts b/src/chains/ethereum/src/things/rejection-error.ts deleted file mode 100644 index 31261ed10d..0000000000 --- a/src/chains/ethereum/src/things/rejection-error.ts +++ /dev/null @@ -1,19 +0,0 @@ -import CodedError, { ErrorCodes } from "./coded-error"; - -export default class RejectionError extends CodedError { - public code: typeof ErrorCodes.INVALID_INPUT; - public data: { - result: string - } - constructor(result: string, message: string) { - super(message, ErrorCodes.INVALID_INPUT); - - Error.captureStackTrace(this, this.constructor); - - this.name = this.constructor.name; - - this.data = { - result - } - } -} \ No newline at end of file diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index fa813be574..9bc03a0be2 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -191,6 +191,8 @@ function initData(tx: Transaction, data: any) { //#endregion +type TransactionFinalization = {status: "confirmed", error?: Error} | {status: "rejected", error: Error}; + interface Transaction extends Omit {} // TODO fix the EthereumJsTransaction as any via some "fake" multi-inheritance: class Transaction extends (EthereumJsTransaction as any) { @@ -205,6 +207,8 @@ class Transaction extends (EthereumJsTransaction as any) { readonly from: Buffer; #receipt: TransactionReceipt; #logs: TransactionLog[]; + #finalizer: (eventData: TransactionFinalization) => void; + #finalized: Promise; /** * @param {Object} [data] The data for this Transaction. * @param {Number} type The `Transaction.types` bit flag for this transaction @@ -224,6 +228,13 @@ class Transaction extends (EthereumJsTransaction as any) { if (this.isFake()) { makeFake(this, data) } + + + let finalizer: (value: TransactionFinalization) => void; + this.#finalized = new Promise(resolve => { + finalizer = (...args: any[]) => process.nextTick(resolve, ...args); + }); + this.#finalizer = finalizer; } static get types() { @@ -242,6 +253,32 @@ class Transaction extends (EthereumJsTransaction as any) { ); } + /** + * Returns a Promise that is resolve with the confirmation status and, if + * appropriate, an error property. + * + * Note: it is possible to be confirmed AND + * + * @param event "finalized" + */ + once(event: "finalized") { + return this.#finalized; + }; + + /** + * Mark this transaction as finalized, notifying all past and future + * "finalized" event subscribers. + * + * Note: + * + * @param status + * @param error + */ + finalize(status: "confirmed" | "rejected", error: Error = null) { + // resolves the `#finalized` promise + this.#finalizer({status, error}); + } + /** * Compute the 'intrinsic gas' for a message with the given data. * @param data The transaction's data From 3e95e1fc0ef0c26162722ebb22ce74e5cf360336 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 14 Oct 2020 20:56:11 -0400 Subject: [PATCH 540/691] use emittery's mixin for promievent --- src/packages/utils/src/things/promievent.ts | 30 ++++++++++++--------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/packages/utils/src/things/promievent.ts b/src/packages/utils/src/things/promievent.ts index 43c7ac249f..5ea71bfb9b 100644 --- a/src/packages/utils/src/things/promievent.ts +++ b/src/packages/utils/src/things/promievent.ts @@ -24,10 +24,12 @@ declare var Promise: { resolve(): PromiEvent; } & PromiseConstructor; +const emitteryMethods = ["clearListeners", "once", "on", "emit", "onAny"] as const; + +@Emittery.mixin(Symbol.for("emittery") as any, emitteryMethods) class PromiEvent extends Promise { constructor (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) { super(executor); - this.init(); } /** @@ -73,24 +75,26 @@ class PromiEvent extends Promise { * method around detached from it's context. */ public dispose = () => { + if (!this.clearListeners) throw new Error("PromiEvent already disposed"); + this.clearListeners(); // Ensure that once disposed no listeners can be bound to this emitter. - this.anyEvent = this.events = this.bindMethods = this.once = this.on = this.onAny = () => {throw new Error("PromiEvent bound after dispose");}; + const fn = () => { + throw new Error("PromiEvent bound after dispose"); + }; + emitteryMethods.filter(m => m !== "emit").forEach(methodName => { + Object.defineProperty(this, methodName, { + enumerable: false, + value: fn + }); + }); } } -interface PromiEvent extends Promise, Emittery { -} -applyMixins(PromiEvent, [Emittery]); +interface PromiEvent extends Promise, Pick { + emittery: Emittery +} export default PromiEvent; - -function applyMixins(derivedCtor: any, baseCtors: any[]) { - baseCtors.forEach(baseCtor => { - Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => { - Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name)!); - }); - }); -} From c4915033b20b91fb1e90500b23663b7409ba3d53 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 15 Oct 2020 17:22:07 -0400 Subject: [PATCH 541/691] fix up create script and remove patch-package --- completions.sh | 35 +++ docs/README.md | 4 +- npm-shrinkwrap.json | 523 ++++++++++++++++++++++++++--------- package.json | 5 +- patches/emittery+0.7.1.patch | 28 -- scripts/create.ts | 69 ++++- 6 files changed, 490 insertions(+), 174 deletions(-) create mode 100644 completions.sh delete mode 100644 patches/emittery+0.7.1.patch diff --git a/completions.sh b/completions.sh new file mode 100644 index 0000000000..259e22d8fc --- /dev/null +++ b/completions.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +_npmScriptsCompletions() +{ + local cur_word args type_list first_arg + + cur_word="${COMP_WORDS[COMP_CWORD]}" + args=("${COMP_WORDS[@]}") + + if [ "${COMP_WORDS[1]}" == "run" ] && [ ${#COMP_WORDS[@]} == 3 ]; then + # get a list of all npm scripts and add them to the bash autocomplete reply + type_list=$(node -e "console.log(Object.keys(require('./package.json').scripts).join('\n'))") + COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) ) + else + if [ "${COMP_WORDS[1]}" == "run" ] && [ "${COMP_WORDS[2]}" == "create" ]; then + while [[ "$#" -gt 0 ]]; do + case $1 in + -l|--location) + type_list=$(ls src); shift ;; + -|--l|--lo|--loc|--loca|--locat|--locati|--locatio) + # autocomplete "-l" or "--location" (but only when we don't already have the full word) + if [[ ! " ${COMP_WORDS[@]} " =~ " --location " ]] && [[ ! " ${COMP_WORDS[@]} " =~ " -l " ]]; then + type_list="--location"; + fi + shift ;; + *) shift ;; + esac + done + + COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) ) + fi + fi + return 0 +} +complete -o default -F _npmScriptsCompletions npm diff --git a/docs/README.md b/docs/README.md index c98ba34909..f4d1caeb67 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,7 +10,7 @@ ## Solving node-gyp issues -I f installation fails due to a `node-gyp` issue you may need to perform some additional system configuration. +If installation fails due to a `node-gyp` issue you may need to perform some additional system configuration. ### on Linux (Ubuntu-based) @@ -127,6 +127,6 @@ These are guidelines, not rules. :-) * Use npm; do not use yarn. * Don't use web3, ethers, etc in ganache-core core code. (Tests are fine) * Ensure a smooth development experience on Windows, Mac, and Linux. - * Do not use bash scripts. + * Do not use bash scripts for critical development or configuration. * Do not use CLI commands in npm scripts or build scripts that aren't available by default on supported platforms. * Push your code often (at least every-other day!), even broken WIP code (to your own branch, of course). diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9e7446c250..595550a2e8 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -177,6 +177,34 @@ "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/parser": { @@ -185,16 +213,6 @@ "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", "dev": true }, - "@babel/runtime-corejs3": { - "version": "7.11.2", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.11.2.tgz", - "integrity": "sha512-qh5IR+8VgFz83VBa6OkaET6uN/mJOhHONuy3m1sgF0CV6mXdPSEBdA7e1eUbVvyNtANjMbg22JUv71BaDXLY6A==", - "dev": true, - "requires": { - "core-js-pure": "^3.0.0", - "regenerator-runtime": "^0.13.4" - } - }, "@babel/template": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", @@ -660,6 +678,34 @@ "chalk": "^2.3.1", "execa": "^1.0.0", "strong-log-transformer": "^2.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@lerna/clean": { @@ -753,6 +799,34 @@ "chalk": "^2.3.1", "figgy-pudding": "^3.5.1", "npmlog": "^4.1.2" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@lerna/collect-updates": { @@ -1271,6 +1345,34 @@ "@lerna/query-graph": "3.18.5", "chalk": "^2.3.1", "columnify": "^1.5.4" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@lerna/log-packed": { @@ -2002,11 +2104,37 @@ "write-json-file": "^3.2.0" }, "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -2378,12 +2506,6 @@ } } }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, "@types/cookiejar": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz", @@ -3339,14 +3461,39 @@ "dev": true }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } } }, "chardet": { @@ -3371,6 +3518,7 @@ "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", + "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -4598,6 +4746,12 @@ "es6-promise": "^4.0.3" } }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -5542,6 +5696,13 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -6166,9 +6327,9 @@ } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "has-symbols": { @@ -6512,6 +6673,23 @@ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -6555,6 +6733,15 @@ "dev": true } } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, @@ -7634,6 +7821,34 @@ "dev": true, "requires": { "chalk": "^2.4.2" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "loud-rejection": { @@ -8807,6 +9022,59 @@ "yargs": "^15.0.2" }, "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -8817,6 +9085,12 @@ "path-exists": "^4.0.0" } }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -8870,6 +9144,66 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, @@ -9665,12 +9999,6 @@ "strip-indent": "^3.0.0" } }, - "regenerator-runtime": { - "version": "0.13.7", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", - "dev": true - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -10711,12 +11039,12 @@ } }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } }, "tar": { @@ -11451,15 +11779,6 @@ "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", "dev": true }, - "xregexp": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.3.0.tgz", - "integrity": "sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==", - "dev": true, - "requires": { - "@babel/runtime-corejs3": "^7.8.3" - } - }, "xtend": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", @@ -11480,22 +11799,18 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "yargs": { - "version": "15.4.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.0.tgz", - "integrity": "sha512-D3fRFnZwLWp8jVAAhPZBsmeIHY8tTsb8ItV9KaAaopmC6wde2u6Yw29JBIZHXw14kgkRnYmDgmQU4FVMDlIsWw==", + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.0.3.tgz", + "integrity": "sha512-6+nLw8xa9uK1BOEOykaiYAJVh6/CjxWXK/q9b5FpRgNslt8s22F2xMBqVIKgCRjNgGvGPBy8Vog7WN7yh4amtA==", "dev": true, "requires": { - "cliui": "^6.0.0", - "decamelize": "^3.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.0", + "escalade": "^3.0.2", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "y18n": "^5.0.1", + "yargs-parser": "^20.0.0" }, "dependencies": { "ansi-regex": { @@ -11505,30 +11820,23 @@ "dev": true }, "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" } }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.2.tgz", + "integrity": "sha512-lhpKkuUj67j5JgZIPZxLe7nSa4MQoojzRVWQyzMqBp2hBg6gwRjUDAwC1YDeBaC3APDBKNnjWbv2mlDF4XgOSA==", "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "wrap-ansi": "^7.0.0" } }, "color-convert": { @@ -11546,61 +11854,18 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "decamelize": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", - "integrity": "sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==", - "dev": true, - "requires": { - "xregexp": "^4.2.4" - } - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -11622,9 +11887,9 @@ } }, "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", @@ -11632,23 +11897,17 @@ "strip-ansi": "^6.0.0" } }, + "y18n": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.2.tgz", + "integrity": "sha512-CkwaeZw6dQgqgPGeTWKMXCRmMcBgETFlTml1+ZOO+q7kGst8NREJ+eWwFNPVUQ4QGdAaklbqCZHH6Zuep1RjiA==", + "dev": true + }, "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - } - } + "version": "20.2.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.2.tgz", + "integrity": "sha512-XmrpXaTl6noDsf1dKpBuUNCOHqjs0g3jRMXf/ztRxdOmb+er8kE5z5b55Lz3p5u2T8KJ59ENBnASS8/iapVJ5g==", + "dev": true } } }, diff --git a/package.json b/package.json index 946ed494c3..4d88b0c9a2 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "clean": "npx shx rm -rf node_modules && npx lerna clean -y", "create": "ts-node ./scripts/create", "preview:docs": "lerna exec --no-bail npm run preview:docs", - "postinstall": "lerna bootstrap && npx patch-package", + "prepare": "lerna bootstrap && echo \"\n\\033[1;36m Tip:\\033[0;36m run \\033[1;2;33msource completions.sh\\033[0;36m to supply bash completions for npm scripts\\033[0m\"", "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm test", "tsc": "lerna exec -- npm run tsc" @@ -48,6 +48,7 @@ "@types/ws": "7.2.6", "@types/yargs": "15.0.5", "camelcase": "6.0.0", + "chalk": "4.1.0", "cross-env": "7.0.2", "fs-extra": "9.0.1", "into-stream": "5.1.1", @@ -63,7 +64,7 @@ "typescript": "4.1.0-beta", "utf-8-validate": "5.0.2", "ws": "7.3.0", - "yargs": "15.4.0" + "yargs": "16.0.3" }, "optionalDependencies": { "bigint-buffer": "1.1.5" diff --git a/patches/emittery+0.7.1.patch b/patches/emittery+0.7.1.patch deleted file mode 100644 index d9dedf8d5f..0000000000 --- a/patches/emittery+0.7.1.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/node_modules/emittery/index.d.ts b/node_modules/emittery/index.d.ts -index 690f3c7..bca8679 100644 ---- a/node_modules/emittery/index.d.ts -+++ b/node_modules/emittery/index.d.ts -@@ -82,6 +82,8 @@ declare class Emittery { - */ - static readonly listenerRemoved: unique symbol; - -+ init(){} -+ - /** - Subscribe to one or more events. - -diff --git a/node_modules/emittery/index.js b/node_modules/emittery/index.js -index d3f9bb3..e81e7a5 100644 ---- a/node_modules/emittery/index.js -+++ b/node_modules/emittery/index.js -@@ -190,6 +190,10 @@ class Emittery { - } - - constructor() { -+ this.init(); -+ } -+ -+ init() { - anyMap.set(this, new Set()); - eventsMap.set(this, new Map()); - producersMap.set(this, new Map()); diff --git a/scripts/create.ts b/scripts/create.ts index 582dfb7af1..ccdad699b0 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -5,22 +5,71 @@ import prettier from "prettier"; import {version} from "../lerna.json"; import camelCase from "camelcase"; import npa from "npm-package-arg"; +import { lstatSync as lstat, readdirSync as readDir } from "fs"; +import chalk from "chalk"; + +const isDir = (s: string) => lstat(s).isDirectory(); +const getDirectories = (s: string) => readDir(s).filter(n => isDir(join(s, n))); const COLORS = { - FgGreen: "\x1b[32m", + Bold: "\x1b[1m", Reset: "\x1b[0m", - FgRed: "\x1b[31m", - FgMagenta: "\x1b[35m", - BgBlack: "\x1b[40m" + FgRed: "\x1b[31m" }; -const argv = yargs.command("$0 ", "Package Name").demandCommand().help().argv; +const scopes = getDirectories(join(__dirname, "../../src")); +const argv = yargs + .command(`$0 --location`, `Create a new package in the given location with the provided name.`, (yargs) => { + return yargs + .usage( + chalk`{hex("#e4a663").bold Create a new package in the given location with the provided name.}\n\n` + + chalk`{bold Usage}\n {bold $} {dim <}name{dim >} {dim --}location {dim <}${scopes.join(chalk.dim(" | "))}{dim >}`) + .positional("", { + describe: ` The name of the new package`, + type: "string", + demandOption: true + }) + .alias("name", "") + .option("location", { + alias: "l", + default: "packages", + describe: `The location for the new package.`, + choices: scopes, + type: "string", + demandOption: true + }) + }) + .demandCommand() + .version(false) + .help(false) + .updateStrings({ + "Positionals:": chalk.bold("Options"), + "Options:": ` `, + "Not enough non-option arguments: got %s, need at least %s": { + "one": chalk`{red {bold ERROR! Not enough non-option arguments:}\n got %s, need at least %s}`, + "other": chalk`{red {bold ERROR! Not enough non-option arguments:}\n got %s, need at least %s}` + } as any, + "Invalid values:": `${COLORS.FgRed}${COLORS.Bold}ERROR! Invalid values:${COLORS.Reset}${COLORS.FgRed}` + }) + .fail((msg, err, yargs) => { + // we use a custom `fail` fn so that NPM doesn't print its own giant error message. + if (err) throw err; + + console.error(yargs.help().toString().replace("\n\n\n", "\n")); + console.error(); + console.error(msg); + process.exit(0); + }) +.argv; +process.stdout.write(`${COLORS.Reset}`); (async function () { - let name = argv.name as string; + let name = argv.name; + let location = argv.location; + try { const prettierConfig = await prettier.resolveConfig(process.cwd()); - name = npa(argv.name as string).name; + name = npa(name).name; const packageName = `@ganache/${name}`; @@ -83,7 +132,7 @@ describe("${packageName}", () => { export * from "./src/index"; `; - const dir = join("./src/packages", name); + const dir = join(__dirname, "../../src", location, name); const tests = join(dir, "__tests__"); const src = join(dir, "src"); @@ -132,13 +181,13 @@ export * from "./src/index"; console.log(pkgStr); console.log( - `${COLORS.FgGreen}success${COLORS.Reset} ${COLORS.FgMagenta}create${COLORS.Reset} New package ${COLORS.BgBlack}${name}${COLORS.Reset} created at ./packages/${name}.` + chalk`{green success} {magenta create} New package {bgBlack ${name} } created. New package created at ./src/packages/${name}.\n\n Entry point: {bold ${dir}/src/index.ts}` ); } catch (e) { console.error(e); console.log(""); console.log( - `${COLORS.FgRed}fail${COLORS.Reset} ${COLORS.FgMagenta}create${COLORS.Reset} New package ${COLORS.BgBlack}${name}${COLORS.Reset} not created. See error above.` + chalk`{red fail} {magenta create} New package {bgBlack ${name} } not created. See error above.` ); } })(); From 0beacba183490fb71622e44cbdfc84b57aaa3173 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 15 Oct 2020 17:34:01 -0400 Subject: [PATCH 542/691] update dev docs --- docs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/README.md b/docs/README.md index f4d1caeb67..995e75c020 100644 --- a/docs/README.md +++ b/docs/README.md @@ -56,9 +56,9 @@ Runs all tests: ## To create a new package - * `npm run create ` + * `npm run create --location ` -This will create a new package with Ganache defaults at `src/packages/`. +This will create a new package with Ganache defaults at `src//`. ## To add a module to a package: From 8303566b2e0fadf63ef8a8e76cbffbcd48acc801 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 15 Oct 2020 17:57:27 -0400 Subject: [PATCH 543/691] organize --- src/chains/ethereum/src/api.ts | 8 ++-- src/chains/ethereum/src/blockchain.ts | 12 +++--- .../account-manager.ts | 0 .../block-manager.ts | 0 .../blocklog-manager.ts | 0 .../{components => data-managers}/manager.ts | 0 .../transaction-manager.ts | 2 +- .../src/{things => errors}/coded-error.ts | 0 .../ethereum/src/{things => errors}/errors.ts | 0 .../src/{things => errors}/runtime-error.ts | 1 - .../src/{things => helpers}/gas-estimator.ts | 2 +- src/chains/ethereum/src/miner.ts | 6 +-- .../src/things/transaction-receipt.ts | 2 +- src/chains/ethereum/src/things/transaction.ts | 6 +-- .../src/{components => }/transaction-pool.ts | 41 +++---------------- 15 files changed, 25 insertions(+), 55 deletions(-) rename src/chains/ethereum/src/{components => data-managers}/account-manager.ts (100%) rename src/chains/ethereum/src/{components => data-managers}/block-manager.ts (100%) rename src/chains/ethereum/src/{components => data-managers}/blocklog-manager.ts (100%) rename src/chains/ethereum/src/{components => data-managers}/manager.ts (100%) rename src/chains/ethereum/src/{components => data-managers}/transaction-manager.ts (94%) rename src/chains/ethereum/src/{things => errors}/coded-error.ts (100%) rename src/chains/ethereum/src/{things => errors}/errors.ts (100%) rename src/chains/ethereum/src/{things => errors}/runtime-error.ts (97%) rename src/chains/ethereum/src/{things => helpers}/gas-estimator.ts (99%) rename src/chains/ethereum/src/{components => }/transaction-pool.ts (87%) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 9c610aa6d7..725cab1b0e 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -5,7 +5,7 @@ import { EthereumInternalOptions } from "./options"; import { types, Data, Quantity } from "@ganache/utils"; import Blockchain from "./blockchain"; import Tag from "./things/tags"; -import {VM_EXCEPTION, VM_EXCEPTIONS} from "./things/errors"; +import {VM_EXCEPTION, VM_EXCEPTIONS} from "./errors/errors"; import Address from "./things/address"; import Transaction from "./things/transaction"; import Wallet from "./wallet"; @@ -19,9 +19,9 @@ import Emittery from "emittery"; import Common from "ethereumjs-common"; import BlockLogs from "./things/blocklogs"; import EthereumAccount from "ethereumjs-account"; -import { Block } from "./components/block-manager"; -import estimateGas from "./things/gas-estimator"; -import CodedError, { ErrorCodes } from "./things/coded-error"; +import { Block } from "./data-managers/block-manager"; +import estimateGas from "./helpers/gas-estimator"; +import CodedError, { ErrorCodes } from "./errors/coded-error"; import { WhisperPostObject } from "./types/shh"; //#endregion diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 075d95ba85..0900c23fbb 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -1,27 +1,27 @@ -import RuntimeError, { RETURN_TYPES } from "./things/runtime-error"; +import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; import Miner from "./miner"; import Database from "./database"; import Emittery from "emittery"; -import BlockManager, {Block} from "./components/block-manager"; +import BlockManager, {Block} from "./data-managers/block-manager"; import BlockLogs from "./things/blocklogs"; -import TransactionManager from "./components/transaction-manager"; +import TransactionManager from "./data-managers/transaction-manager"; import CheckpointTrie from "merkle-patricia-tree"; import {BN} from "ethereumjs-util"; import Account from "./things/account"; import {promisify} from "util"; import {Quantity, Data} from "@ganache/utils"; import EthereumJsAccount from "ethereumjs-account"; -import AccountManager from "./components/account-manager"; +import AccountManager from "./data-managers/account-manager"; import {utils} from "@ganache/utils"; import Transaction from "./things/transaction"; -import Manager from "./components/manager"; +import Manager from "./data-managers/manager"; import TransactionReceipt from "./things/transaction-receipt"; import {encode as rlpEncode} from "rlp"; import Common from "ethereumjs-common"; import {Block as EthereumBlock} from "ethereumjs-block"; import VM from "ethereumjs-vm"; import Address from "./things/address"; -import BlockLogManager from "./components/blocklog-manager"; +import BlockLogManager from "./data-managers/blocklog-manager"; import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; import { VmError, ERROR } from "ethereumjs-vm/dist/exceptions"; import { EthereumInternalOptions } from "./options"; diff --git a/src/chains/ethereum/src/components/account-manager.ts b/src/chains/ethereum/src/data-managers/account-manager.ts similarity index 100% rename from src/chains/ethereum/src/components/account-manager.ts rename to src/chains/ethereum/src/data-managers/account-manager.ts diff --git a/src/chains/ethereum/src/components/block-manager.ts b/src/chains/ethereum/src/data-managers/block-manager.ts similarity index 100% rename from src/chains/ethereum/src/components/block-manager.ts rename to src/chains/ethereum/src/data-managers/block-manager.ts diff --git a/src/chains/ethereum/src/components/blocklog-manager.ts b/src/chains/ethereum/src/data-managers/blocklog-manager.ts similarity index 100% rename from src/chains/ethereum/src/components/blocklog-manager.ts rename to src/chains/ethereum/src/data-managers/blocklog-manager.ts diff --git a/src/chains/ethereum/src/components/manager.ts b/src/chains/ethereum/src/data-managers/manager.ts similarity index 100% rename from src/chains/ethereum/src/components/manager.ts rename to src/chains/ethereum/src/data-managers/manager.ts diff --git a/src/chains/ethereum/src/components/transaction-manager.ts b/src/chains/ethereum/src/data-managers/transaction-manager.ts similarity index 94% rename from src/chains/ethereum/src/components/transaction-manager.ts rename to src/chains/ethereum/src/data-managers/transaction-manager.ts index 6390f2cedf..72c9ecc0e3 100644 --- a/src/chains/ethereum/src/components/transaction-manager.ts +++ b/src/chains/ethereum/src/data-managers/transaction-manager.ts @@ -1,6 +1,6 @@ import Transaction from "../things/transaction"; import Manager from "./manager"; -import TransactionPool from "./transaction-pool"; +import TransactionPool from "../transaction-pool"; import { EthereumInternalOptions } from "../options"; import { LevelUp } from "levelup"; import Blockchain from "../blockchain"; diff --git a/src/chains/ethereum/src/things/coded-error.ts b/src/chains/ethereum/src/errors/coded-error.ts similarity index 100% rename from src/chains/ethereum/src/things/coded-error.ts rename to src/chains/ethereum/src/errors/coded-error.ts diff --git a/src/chains/ethereum/src/things/errors.ts b/src/chains/ethereum/src/errors/errors.ts similarity index 100% rename from src/chains/ethereum/src/things/errors.ts rename to src/chains/ethereum/src/errors/errors.ts diff --git a/src/chains/ethereum/src/things/runtime-error.ts b/src/chains/ethereum/src/errors/runtime-error.ts similarity index 97% rename from src/chains/ethereum/src/things/runtime-error.ts rename to src/chains/ethereum/src/errors/runtime-error.ts index 3ad39106e0..3080beb344 100644 --- a/src/chains/ethereum/src/things/runtime-error.ts +++ b/src/chains/ethereum/src/errors/runtime-error.ts @@ -1,5 +1,4 @@ import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; -import Transaction from "./transaction"; import { VM_EXCEPTION } from "./errors"; import { Data } from "@ganache/utils"; import { rawDecode } from "ethereumjs-abi"; diff --git a/src/chains/ethereum/src/things/gas-estimator.ts b/src/chains/ethereum/src/helpers/gas-estimator.ts similarity index 99% rename from src/chains/ethereum/src/things/gas-estimator.ts rename to src/chains/ethereum/src/helpers/gas-estimator.ts index 410ffc7e98..fa96983451 100644 --- a/src/chains/ethereum/src/things/gas-estimator.ts +++ b/src/chains/ethereum/src/helpers/gas-estimator.ts @@ -1,6 +1,6 @@ import { Quantity } from "@ganache/utils"; import { BN } from "ethereumjs-util"; -import RuntimeError, { RETURN_TYPES } from "./runtime-error"; +import RuntimeError, { RETURN_TYPES } from "../errors/runtime-error"; const bn = (val = 0) => new (BN as any)(val); const STIPEND = bn(2300); diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 9ef3589fa2..81a0129015 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -9,7 +9,7 @@ import Block from "ethereumjs-block"; import VM from "ethereumjs-vm"; import {encode as rlpEncode} from "rlp"; import { EthereumInternalOptions } from "./options"; -import RuntimeError, { RETURN_TYPES } from "./things/runtime-error"; +import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); @@ -21,7 +21,7 @@ function replaceFromHeap( const next = source.peek(); if (next) { // remove the current best priced transaction from this account and replace - // replace it with the account's next lowest nonce transaction: + // it with the account's next lowest nonce transaction: priced.replaceBest(next); next.locked = true; return true; @@ -137,7 +137,7 @@ export default class Miner extends Emittery { let numTransactions = 0; let blockGasLeft = this.#options.blockGasLimit.toBigInt(); - const promises: Promise[] = []; + const promises: Promise[] = []; // Set a block-level checkpoint so our unsaved trie doesn't update the // vm's "live" trie. diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index d5b6ac0579..8f3e26a778 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -1,5 +1,5 @@ import Transaction from "./transaction"; -import {Block} from "../components/block-manager"; +import {Block} from "../data-managers/block-manager"; import {encode as rlpEncode, decode as rlpDecode} from "rlp"; import {Data, Quantity} from "@ganache/utils"; import BlockLogs, { TransactionLog } from "./blocklogs"; diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 9bc03a0be2..ec9126d2ef 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -1,4 +1,5 @@ -import {INTRINSIC_GAS_TOO_LOW} from "./errors"; +import {INTRINSIC_GAS_TOO_LOW} from "../errors/errors"; +import RuntimeError, { RETURN_TYPES } from "../errors/runtime-error"; import {utils, Data, Quantity} from "@ganache/utils"; import params from "./params"; import {Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction} from "ethereumjs-tx"; @@ -6,12 +7,11 @@ import * as ethUtil from "ethereumjs-util"; import assert from "assert"; import {decode as rlpDecode} from "rlp"; import {RunTxResult} from "ethereumjs-vm/dist/runTx"; -import {Block} from "../components/block-manager"; +import {Block} from "../data-managers/block-manager"; import TransactionReceipt from "./transaction-receipt"; import Common from "ethereumjs-common"; import { TransactionLog } from "./blocklogs"; import Address from "./address"; -import RuntimeError, { RETURN_TYPES } from "./runtime-error"; type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; diff --git a/src/chains/ethereum/src/components/transaction-pool.ts b/src/chains/ethereum/src/transaction-pool.ts similarity index 87% rename from src/chains/ethereum/src/components/transaction-pool.ts rename to src/chains/ethereum/src/transaction-pool.ts index f0057e73b6..8de4564c25 100644 --- a/src/chains/ethereum/src/components/transaction-pool.ts +++ b/src/chains/ethereum/src/transaction-pool.ts @@ -1,12 +1,12 @@ -import Account from "../things/account"; +import Account from "./things/account"; import Emittery from "emittery"; -import Blockchain from "../blockchain"; +import Blockchain from "./blockchain"; import {utils} from "@ganache/utils"; -import Transaction from "../things/transaction"; +import Transaction from "./things/transaction"; import {Data, Quantity} from "@ganache/utils"; -import {GAS_LIMIT, INTRINSIC_GAS_TOO_LOW} from "../things/errors"; -import CodedError, { ErrorCodes } from "../things/coded-error"; -import { EthereumInternalOptions } from "../options"; +import {GAS_LIMIT, INTRINSIC_GAS_TOO_LOW} from "./errors/errors"; +import CodedError, { ErrorCodes } from "./errors/coded-error"; +import { EthereumInternalOptions } from "./options"; function byNonce(values: Transaction[], a: number, b: number) { return (Quantity.from(values[b].nonce).toBigInt() || 0n) > (Quantity.from(values[a].nonce).toBigInt() || 0n); @@ -160,8 +160,6 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { } } - // this.#assertValidTransactorBalance(transaction, transactor); - // now that we know we have a transaction nonce we can sign the transaction // (if we have the secret key) if (secretKey) { @@ -269,31 +267,4 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { return null; }; - - // /** - // * Returns the *live* executables map once all transactions that have started - // * insertion into the pool have been fully processed. - // * - // * This is neccessary as a transaction added via `eth_sendTransaction` - // * immediately followed by an `evm_mine` may not yet be in the executables - // * pool when `evm_mine` triggers the mine operation. - // */ - // getFutureExecutablesMap(){ - // // When transactions are pushed into the transactionPool they aren't always - // // instantly added to the executables pool, due to potential file IO, so we - // // must wait for any pending file IO to finish before we can get - // return Promise.all([...this.#accountPromises.values()]).then(() => this.#executables); - // } - - // getCurrentExecutablesMap() { - // return this.#executables; - // } - - #assertValidTransactorBalance = (transaction: Transaction, transactor: any): Error | null => { - // Transactor should have enough funds to cover the costs - if (transactor.balance.toBigInt() < transaction.cost()) { - return new Error("Account does not have enough funds to complete transaction"); - } - return null; - } } From 3cebb3779f05cd63220b6fbc68421b9e9be1a814 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 16 Oct 2020 11:40:53 -0400 Subject: [PATCH 544/691] add blockHash param to eth_getLogs --- .../ethereum/__tests__/api/eth/logs.test.ts | 44 +++- src/chains/ethereum/src/api.ts | 225 +++++++----------- .../src/data-managers/block-manager.ts | 8 +- .../ethereum/src/helpers/assert-arg-length.ts | 18 ++ .../ethereum/src/helpers/filter-parsing.ts | 49 ++++ src/chains/ethereum/src/things/transaction.ts | 3 +- .../src/types/extract-values-from-types.ts | 1 + src/chains/ethereum/src/types/filters.ts | 21 ++ .../ethereum/src/types/subscriptions.ts | 2 + 9 files changed, 229 insertions(+), 142 deletions(-) create mode 100644 src/chains/ethereum/src/helpers/assert-arg-length.ts create mode 100644 src/chains/ethereum/src/helpers/filter-parsing.ts create mode 100644 src/chains/ethereum/src/types/extract-values-from-types.ts create mode 100644 src/chains/ethereum/src/types/filters.ts create mode 100644 src/chains/ethereum/src/types/subscriptions.ts diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts index 2182e30247..a394f9c8b5 100644 --- a/src/chains/ethereum/__tests__/api/eth/logs.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -167,7 +167,7 @@ describe("api", () => { await testGetLogs("earliest", genesisBlockNumber, 0); await testGetLogs(genesisBlockNumber, "earliest", 0); - // test misc ranges not already tests + // test misc ranges not already tested await testGetLogs(genesisBlockNumber, deployBlockNumber, 1); await testGetLogs("earliest", deployBlockNumber, 1); await testGetLogs("earliest", "latest", numberOfLogs + 1); @@ -180,6 +180,48 @@ describe("api", () => { await testGetLogs(lastBlockNumber, "latest", 0); await testGetLogs("latest", lastBlockNumber, 0); }); + + it("should filter appropriately when using blockHash", async () => { + const genesisBlockNumber = "0x0"; + const deployBlockNumber = "0x1"; + const emptyBlockNumber = "0x2"; + await provider.send("evm_mine"); // 0x2 + + await provider.send("eth_subscribe", ["newHeads"]); + const numberOfLogs = 4; + const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [{ + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + }]); // 0x3 + await provider.once("message"); + const {blockHash} = await provider.send("eth_getTransactionReceipt", [txHash]); + + async function testGetLogs(blockHash: string, expected: number, address: string = contractAddress){ + const logs = await provider.send("eth_getLogs", [{address, blockHash}]); + assert.strictEqual(logs.length, expected, `there should be ${expected} log(s) at the ${blockHash} block`); + } + + // tests blockHash + let { hash: genesisBlockHash } = await provider.send("eth_getBlockByNumber", [genesisBlockNumber]); + await testGetLogs(blockHash, 4); + await testGetLogs(genesisBlockHash, 0); + let { hash: deployBlockHash } = await provider.send("eth_getBlockByNumber", [deployBlockNumber]); + await testGetLogs(deployBlockHash, 1, null); + let { hash: emptyBlockHash } = await provider.send("eth_getBlockByNumber", [emptyBlockNumber]); + await testGetLogs(emptyBlockHash, 0); + const invalidBlockHash = "0x123456789" + await testGetLogs(invalidBlockHash, 0); + + // mine an extra block + await provider.send("evm_mine"); + await provider.once("message"); + + // make sure we still get the right data + await testGetLogs(blockHash, 4); + }); }); describe("eth_newBlockFilter", () => { diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 725cab1b0e..00338f0919 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -23,6 +23,11 @@ import { Block } from "./data-managers/block-manager"; import estimateGas from "./helpers/gas-estimator"; import CodedError, { ErrorCodes } from "./errors/coded-error"; import { WhisperPostObject } from "./types/shh"; +import { BaseFilterArgs, Filter, FilterArgs, FilterTypes, RangeFilterArgs } from "./types/filters"; +import { assertArgLength } from "./helpers/assert-arg-length"; +import Account from "./things/account"; +import { SubscriptionId, SubscriptionName } from "./types/subscriptions"; +import { parseFilter, parseFilterDetails, parseFilterRange } from "./helpers/filter-parsing"; //#endregion //#region Constants @@ -33,59 +38,11 @@ const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0 const KNOWN_CHAINIDS = new Set([1, 3, 4, 5, 42]); //#endregion -//#region types -type SubscriptionId = string; - -type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; +//#region misc types type TypedData = Exclude[1]["data"], NotTypedData>; -enum FilterTypes { - log, - block, - pendingTransaction -}; -type Topic = string|string[]; -type FilterArgs = {address?: string | string[], topics?: Topic[], fromBlock?: string | Tag, toBlock?: string | Tag}; //#endregion //#region helpers -function parseFilterDetails(filter: Pick) { - // `filter.address` may be a single address or an array - const addresses = filter.address ? (Array.isArray(filter.address) ? filter.address : [filter.address]).map(a => Address.from(a.toLowerCase()).toBuffer()) : []; - const topics = filter.topics ? filter.topics : []; - return {addresses, topics}; -} -function parseFilterRange(filter: Pick, blockchain: Blockchain) { - const fromBlock = blockchain.blocks.getEffectiveNumber(filter.fromBlock || "latest"); - const latestBlockNumberBuffer = blockchain.blocks.latest.value.header.number; - const latestBlock = Quantity.from(latestBlockNumberBuffer); - const latestBlockNumber = latestBlock.toNumber(); - const toBlock = blockchain.blocks.getEffectiveNumber(filter.toBlock || "latest"); - let toBlockNumber: number; - // don't search after the "latest" block, unless it's "pending", of course. - if (toBlock > latestBlock) { - toBlockNumber = latestBlockNumber; - } else { - toBlockNumber = toBlock.toNumber(); - } - return { - fromBlock, - toBlock, - toBlockNumber - } -} -function parseFilter(filter: FilterArgs = {address: [], topics: []}, blockchain: Blockchain) { - const {addresses, topics} = parseFilterDetails(filter); - const {fromBlock, toBlock, toBlockNumber} = parseFilterRange(filter, blockchain); - - return { - addresses, - fromBlock, - toBlock, - toBlockNumber, - topics - }; -} - function assertExceptionalTransactions(transactions: Transaction[]) { let baseError: string = null; let errors: string[]; @@ -111,32 +68,32 @@ function assertExceptionalTransactions(transactions: Transaction[]) { throw err; } } - -type UnknownFn = (this: unknown, ...args: any[]) => unknown; -type FunctionPropertyDescriptor = TypedPropertyDescriptor; -function assertArgLength(min: number, max: number = min) { - return function(target: O, propertyKey: keyof O, descriptor: FunctionPropertyDescriptor) { - const original = descriptor.value; - descriptor.value = function(this: unknown) { - const length = arguments.length; - if (length < min || length > max) { - throw new Error(`Incorrect number of arguments. '${propertyKey}' requires ${ - min === max - ? `exactly ${min} ${min === 1 ? "argument" : "arguments"}.` - : `between ${min} and ${max} arguments.`}`); - } - return Reflect.apply(original, this, arguments); - } as T; - return descriptor as FunctionPropertyDescriptor; - }; -} +//#endregion helpers export default class EthereumApi implements types.Api { readonly [index: string]: (...args: any) => Promise; + readonly #parseCoinbaseAddress = (coinbase: string | number | Address, initialAccounts: Account[]) => { + switch (typeof coinbase) { + case "object": + return coinbase; + case "number": + const account = initialAccounts[coinbase]; + if (account) { + return account.address; + } else { + throw new Error(`invalid coinbase address index: ${coinbase}`); + } + case "string": + return Address.from(coinbase); + default: { + throw new Error(`coinbase address must be string or number, received: ${coinbase}`); + } + } + } readonly #getId = ((id) => () => Quantity.from(++id))(0); readonly #common: Common; - readonly #filters = new Map(); + readonly #filters = new Map(); readonly #subscriptions = new Map(); readonly #blockchain: Blockchain; readonly #options: EthereumInternalOptions; @@ -154,26 +111,7 @@ export default class EthereumApi implements types.Api { const {initialAccounts} = this.#wallet = new Wallet(opts.wallet); - let coinbaseAddress: Address; - switch (typeof options.miner.coinbase) { - case "object": - coinbaseAddress = options.miner.coinbase; - break; - case "number": - const account = initialAccounts[options.miner.coinbase]; - if (account) { - coinbaseAddress = account.address; - } else { - throw new Error(`invalid coinbase address index: ${options.miner.coinbase}`); - } - break; - case "string": - coinbaseAddress = Address.from(options.miner.coinbase); - break; - default: { - throw new Error(`coinbase address must be string or number, received: ${options.miner.coinbase}`); - } - } + const coinbaseAddress = this.#parseCoinbaseAddress(options.miner.coinbase, initialAccounts); const common = this.#common = Common.forCustomChain( // if we were given a chain id that matches a real chain, use it @@ -270,7 +208,7 @@ export default class EthereumApi implements types.Api { * Mines a block independent of whether or not mining is started or stopped. * Will mine an empty block if there are no available transactions to mine. * - * @param timestamp? the timestamp a block should setup as the mining time. + * @param timestamp the timestamp a block should setup as the mining time. */ @assertArgLength(0, 1) async evm_mine(timestamp?: number) { @@ -282,7 +220,7 @@ export default class EthereumApi implements types.Api { return "0x0"; } - @assertArgLength(4) + @assertArgLength(3, 4) async evm_setStorageAt( address: string, position: bigint | number, @@ -698,8 +636,10 @@ export default class EthereumApi implements types.Api { /** * Returns information about a block by block number. - * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in th e default block parameter. - * @param transactions Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions. + * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the + * default block parameter. + * @param transactions Boolean - If true it returns the full transaction objects, if false only the hashes of the + * transactions. * @returns the block, `null` if the block doesn't exist. */ @assertArgLength(1, 2) @@ -710,8 +650,10 @@ export default class EthereumApi implements types.Api { /** * Returns information about a block by block hash. - * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in th e default block parameter. - * @param transactions Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions. + * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the + * default block parameter. + * @param transactions Boolean - If true it returns the full transaction objects, if false only the hashes of the + * transactions. * @returns Block */ @assertArgLength(1, 2) @@ -722,7 +664,8 @@ export default class EthereumApi implements types.Api { /** * Returns the number of transactions in a block from a block matching the given block number. - * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. + * @param number QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the + * default block parameter. */ @assertArgLength(1) async eth_getBlockTransactionCountByNumber(number: string | Buffer) { @@ -771,7 +714,8 @@ export default class EthereumApi implements types.Api { /** * Returns information about a transaction by block number and transaction index position. - * @param number QUANTITY|TAG - a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. + * @param number QUANTITY|TAG - a block number, or the string "earliest", "latest" or "pending", as in the default + * block parameter. * @param index QUANTITY - integer of the transaction index position. */ @assertArgLength(2) @@ -812,11 +756,12 @@ export default class EthereumApi implements types.Api { /** * Returns information about a uncle of a block by hash and uncle index position. * - * @param blockNumber - a block number, or the string "earliest", "latest" or "pending", as in the default block parameter. + * @param blockNumber - a block number, or the string "earliest", "latest" or "pending", as in the default block + * parameter. * @param uncleIndex - the uncle's index position. */ @assertArgLength(2) - async eth_getUncleByBlockNumberAndIndex(blockNumber: Buffer | Tag = Tag.LATEST, uncleIndex: Quantity) { + async eth_getUncleByBlockNumberAndIndex(blockNumber: Buffer | Tag, uncleIndex: Quantity) { return null as ReturnType; } @@ -933,7 +878,8 @@ export default class EthereumApi implements types.Api { * Returns code at a given address. * * @param address 20 Bytes - address - * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block parameter + * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block + * parameter * @returns the code from the given address. */ @assertArgLength(1, 2) @@ -1124,12 +1070,7 @@ export default class EthereumApi implements types.Api { throw new Error(msg); } - let type: ExtractValuesFromType; - if (isKnownAccount) { - type = Transaction.types.none; - } else { - type = Transaction.types.fake; - } + const type = isKnownAccount ? Transaction.types.none : Transaction.types.fake; const tx = Transaction.fromJSON(transaction, this.#common, type); if (tx.gasLimit.length === 0) { @@ -1172,7 +1113,8 @@ export default class EthereumApi implements types.Api { * `sign(keccak256("\x19Ethereum Signed Message:\n" + message.length + message)))`. * * By adding a prefix to the message makes the calculated signature - * recognisable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim. + * recognizable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data + * (e.g. transaction) and use the signature to impersonate the victim. * * Note the address to sign with must be unlocked. * @@ -1246,7 +1188,7 @@ export default class EthereumApi implements types.Api { * @param subscriptionName * @returns A subscription id. */ - eth_subscribe(subscriptionName: "newHeads" | "newPendingTransactions" | "syncing" | "logs"): PromiEvent + eth_subscribe(subscriptionName: SubscriptionName): PromiEvent /** * Starts a subscription to a particular event. For every event that matches * the subscription a JSON-RPC notification with event details and @@ -1259,9 +1201,9 @@ export default class EthereumApi implements types.Api { * * `topics`, only logs which match the specified topics * @returns A subscription id. */ - eth_subscribe(subscriptionName: "logs", options: Pick): PromiEvent + eth_subscribe(subscriptionName: "logs", options: BaseFilterArgs): PromiEvent @assertArgLength(1, 2) - eth_subscribe(subscriptionName: "newHeads" | "newPendingTransactions" | "syncing" | "logs", options?: Pick) { + eth_subscribe(subscriptionName: SubscriptionName, options?: BaseFilterArgs) { const subscriptions = this.#subscriptions; switch (subscriptionName) { case "newHeads": { @@ -1377,7 +1319,7 @@ export default class EthereumApi implements types.Api { const unsubscribe = this.#blockchain.on("block", (block: Block) => { value.updates.push(Data.from(block.value.hash(), 32)); }); - const value = {updates: [] as Data[], unsubscribe, filter: null as FilterArgs, type: FilterTypes.block}; + const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.block}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1394,7 +1336,7 @@ export default class EthereumApi implements types.Api { const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { value.updates.push(Data.from(transaction.hash(), 32)); }); - const value = {updates: [] as Data[], unsubscribe, filter: null as FilterArgs, type: FilterTypes.pendingTransaction}; + const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.pendingTransaction}; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1425,7 +1367,7 @@ export default class EthereumApi implements types.Api { * @param filter The filter options */ @assertArgLength(0, 1) - async eth_newFilter(filter: FilterArgs = {}) { + async eth_newFilter(filter: RangeFilterArgs = {}) { const blockchain = this.#blockchain; const { addresses, topics } = parseFilterDetails(filter); const unsubscribe = blockchain.on("blockLogs", (blockLogs: BlockLogs) => { @@ -1447,11 +1389,11 @@ export default class EthereumApi implements types.Api { /** * Polling method for a filter, which returns an array of logs, block hashes, - * or transactions hashes, depending on the filter type, which occurred since + * or transaction hashes, depending on the filter type, which occurred since * last poll. * * @param filterId the filter id. - * @returns an array of logs, block hashes, or transactions hashes, depending + * @returns an array of logs, block hashes, or transaction hashes, depending * on the filter type, which occurred since last poll. */ @assertArgLength(1) @@ -1506,31 +1448,40 @@ export default class EthereumApi implements types.Api { @assertArgLength(1) async eth_getLogs(filter: FilterArgs) { const blockchain = this.#blockchain; - const blockLogs = blockchain.blockLogs; - const {addresses, topics, fromBlock, toBlockNumber} = parseFilter(filter, blockchain); - - const pendingLogsPromises: Promise[] = [blockLogs.get(fromBlock.toBuffer())]; - - const fromBlockNumber = fromBlock.toNumber(); - // if we have a range of blocks to search, do that here: - if (fromBlockNumber !== toBlockNumber) { - // fetch all the blockLogs in-between `fromBlock` and `toBlock` (excluding - // from, because we already started fetching that one) - for (let i = fromBlockNumber + 1, l = toBlockNumber + 1; i < l; i++) { - pendingLogsPromises.push(blockLogs.get(Quantity.from(i).toBuffer())); + if ("blockHash" in filter) { + const {addresses, topics} = parseFilterDetails(filter); + const blockNumber = await blockchain.blocks.getNumberFromHash(filter.blockHash); + if (!blockNumber) return []; + const blockLogs = blockchain.blockLogs; + const logs = await blockLogs.get(blockNumber); + return logs ? [...logs.filter(addresses, topics)] : []; + } else { + const {addresses, topics, fromBlock, toBlockNumber} = parseFilter(filter, blockchain); + + const blockLogs = blockchain.blockLogs; + const pendingLogsPromises: Promise[] = [blockLogs.get(fromBlock.toBuffer())]; + + const fromBlockNumber = fromBlock.toNumber(); + // if we have a range of blocks to search, do that here: + if (fromBlockNumber !== toBlockNumber) { + // fetch all the blockLogs in-between `fromBlock` and `toBlock` (excluding + // from, because we already started fetching that one) + for (let i = fromBlockNumber + 1, l = toBlockNumber + 1; i < l; i++) { + pendingLogsPromises.push(blockLogs.get(Quantity.from(i).toBuffer())); + } } - } - // now filter and compute all the blocks' blockLogs (in block order) - return Promise.all(pendingLogsPromises).then(blockLogsRange => { - const filteredBlockLogs: ReturnType[] = []; - blockLogsRange.forEach(blockLogs => { - // TODO(perf): this loops over all expectedAddresseses for every block. - // Make it loop only once. - if (blockLogs) filteredBlockLogs.push(...blockLogs.filter(addresses, topics)); + // now filter and compute all the blocks' blockLogs (in block order) + return Promise.all(pendingLogsPromises).then(blockLogsRange => { + const filteredBlockLogs: ReturnType[] = []; + blockLogsRange.forEach(blockLogs => { + // TODO(perf): this loops over all expectedAddresseses for every block. + // Make it loop only once. + if (blockLogs) filteredBlockLogs.push(...blockLogs.filter(addresses, topics)); + }); + return filteredBlockLogs; }); - return filteredBlockLogs; - }); + } } /** diff --git a/src/chains/ethereum/src/data-managers/block-manager.ts b/src/chains/ethereum/src/data-managers/block-manager.ts index 2fc2f901c6..7de39b712a 100644 --- a/src/chains/ethereum/src/data-managers/block-manager.ts +++ b/src/chains/ethereum/src/data-managers/block-manager.ts @@ -6,6 +6,7 @@ import {Quantity, Data} from "@ganache/utils"; import Transaction from "../things/transaction"; import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; +const NOTFOUND = 404; const EMPTY_BUFFER = Buffer.from([]); @@ -101,12 +102,15 @@ export default class BlockManager extends Manager { } async getNumberFromHash(hash: string | Buffer | Tag) { - return this.#blockIndexes.get(Data.from(hash).toBuffer()) as Promise; + return this.#blockIndexes.get(Data.from(hash).toBuffer()).catch(e => { + if (e.status === NOTFOUND) return null; + throw e; + }) as Promise; } async getByHash(hash: string | Buffer | Tag) { const number = await this.getNumberFromHash(hash); - return super.get(number); + return number ? super.get(number) : null; } async getRaw(tagOrBlockNumber: string | Buffer | Tag) { diff --git a/src/chains/ethereum/src/helpers/assert-arg-length.ts b/src/chains/ethereum/src/helpers/assert-arg-length.ts new file mode 100644 index 0000000000..9f0d850f1b --- /dev/null +++ b/src/chains/ethereum/src/helpers/assert-arg-length.ts @@ -0,0 +1,18 @@ +type UnknownFn = (this: unknown, ...args: any[]) => unknown; +type FunctionPropertyDescriptor = TypedPropertyDescriptor; +export function assertArgLength(min: number, max: number = min) { + return function(target: O, propertyKey: keyof O, descriptor: FunctionPropertyDescriptor) { + const original = descriptor.value; + descriptor.value = function(this: unknown) { + const length = arguments.length; + if (length < min || length > max) { + throw new Error(`Incorrect number of arguments. '${propertyKey}' requires ${ + min === max + ? `exactly ${min} ${min === 1 ? "argument" : "arguments"}.` + : `between ${min} and ${max} arguments.`}`); + } + return Reflect.apply(original, this, arguments); + } as T; + return descriptor as FunctionPropertyDescriptor; + }; +} diff --git a/src/chains/ethereum/src/helpers/filter-parsing.ts b/src/chains/ethereum/src/helpers/filter-parsing.ts new file mode 100644 index 0000000000..2f10e3d708 --- /dev/null +++ b/src/chains/ethereum/src/helpers/filter-parsing.ts @@ -0,0 +1,49 @@ +import { Quantity } from "@ganache/utils"; +import Blockchain from "../blockchain"; +import Address from "../things/address"; +import { FilterArgs, RangeFilterArgs } from "../types/filters"; + +export function parseFilterDetails(filter: Pick) { + // `filter.address` may be a single address or an array + const addresses = filter.address + ? ( + Array.isArray(filter.address) + ? filter.address + : [filter.address]).map(a => Address.from(a.toLowerCase()).toBuffer() + ) + : []; + const topics = filter.topics ? filter.topics : []; + return {addresses, topics}; +} + +export function parseFilterRange(filter: Omit, blockchain: Blockchain) { + const latestBlockNumberBuffer = blockchain.blocks.latest.value.header.number; + const latestBlock = Quantity.from(latestBlockNumberBuffer); + const fromBlock = blockchain.blocks.getEffectiveNumber(filter.fromBlock || "latest"); + const latestBlockNumber = latestBlock.toNumber(); + const toBlock = blockchain.blocks.getEffectiveNumber(filter.toBlock || "latest"); + let toBlockNumber: number; + // don't search after the "latest" block, unless it's "pending", of course. + if (toBlock > latestBlock) { + toBlockNumber = latestBlockNumber; + } else { + toBlockNumber = toBlock.toNumber(); + } + return { + fromBlock, + toBlock, + toBlockNumber + } +} +export function parseFilter(filter: RangeFilterArgs = {address: [], topics: []}, blockchain: Blockchain) { + const {addresses, topics} = parseFilterDetails(filter); + const {fromBlock, toBlock, toBlockNumber} = parseFilterRange(filter, blockchain); + + return { + addresses, + fromBlock, + toBlock, + toBlockNumber, + topics + }; +} \ No newline at end of file diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index ec9126d2ef..2b1c5f9262 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -12,8 +12,7 @@ import TransactionReceipt from "./transaction-receipt"; import Common from "ethereumjs-common"; import { TransactionLog } from "./blocklogs"; import Address from "./address"; - -type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; +import { ExtractValuesFromType } from "../types/extract-values-from-types"; const MAX_UINT64 = (1n << 64n) - 1n; const ZERO_BUFFER = Buffer.from([0]); diff --git a/src/chains/ethereum/src/types/extract-values-from-types.ts b/src/chains/ethereum/src/types/extract-values-from-types.ts new file mode 100644 index 0000000000..fd2f24be7d --- /dev/null +++ b/src/chains/ethereum/src/types/extract-values-from-types.ts @@ -0,0 +1 @@ +export type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; \ No newline at end of file diff --git a/src/chains/ethereum/src/types/filters.ts b/src/chains/ethereum/src/types/filters.ts new file mode 100644 index 0000000000..158eaa7faa --- /dev/null +++ b/src/chains/ethereum/src/types/filters.ts @@ -0,0 +1,21 @@ +import { Data } from "@ganache/utils"; +import Emittery from "emittery"; +import Tag from "../things/tags"; + +export enum FilterTypes { + log, + block, + pendingTransaction +}; +export type Topic = string|string[]; +export type BaseFilterArgs = {address?: string | string[], topics?: Topic[]}; +export type BlockHashFilterArgs = BaseFilterArgs & {blockHash?: string}; +export type RangeFilterArgs = BaseFilterArgs & {fromBlock?: string | Tag, toBlock?: string | Tag}; +export type FilterArgs = BlockHashFilterArgs | RangeFilterArgs; + +export type Filter = { + type: FilterTypes, + updates: Data[], + unsubscribe: Emittery.UnsubscribeFn, + filter: FilterArgs +}; \ No newline at end of file diff --git a/src/chains/ethereum/src/types/subscriptions.ts b/src/chains/ethereum/src/types/subscriptions.ts new file mode 100644 index 0000000000..fd6d567016 --- /dev/null +++ b/src/chains/ethereum/src/types/subscriptions.ts @@ -0,0 +1,2 @@ +export type SubscriptionId = string; +export type SubscriptionName = "newHeads" | "newPendingTransactions" | "syncing" | "logs"; From a079336cb8f8538b4dc5b56e9fbfee1c3ae70d46 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 16 Oct 2020 12:27:45 -0400 Subject: [PATCH 545/691] add evm_unlockUnknownAccount/evm_lockUnknownAccount --- .../ethereum/__tests__/api/evm/evm.test.ts | 76 +++++++++++++++++++ src/chains/ethereum/src/api.ts | 35 ++++++++- src/chains/ethereum/src/wallet.ts | 26 +++++++ 3 files changed, 136 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 884cc1ec5b..f2c0a137a6 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -1,6 +1,7 @@ import getProvider from "../../helpers/getProvider"; import assert from "assert"; import { Quantity } from "@ganache/utils"; +import EthereumProvider from "../../../src/provider"; function between(x: number, min: number, max: number) { return x >= min && x <= max; @@ -94,5 +95,80 @@ describe("api", () => { assert.strictEqual(afterCount, newCount.toNumber()); }) }); + + describe("evm_lockUnknownAccount/evm_unlockUnknownAccount", () => { + let accounts: string[], provider: EthereumProvider; + before(async() => { + provider = await getProvider(); + accounts = await provider.send("eth_accounts"); + }); + + it("should unlock any account after server has been started", async() => { + const address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"; + const result1 = await provider.send("evm_unlockUnknownAccount", [address]); + assert.strictEqual(result1, true); + + // should return `false` if account was already locked + const result2 = await provider.send("evm_unlockUnknownAccount", [address]); + assert.strictEqual(result2, false); + }); + + it("should not unlock any locked personal account", async() => { + const [address] = accounts; + await provider.send("personal_lockAccount", [address]); + try { + await assert.rejects( + provider.send("evm_unlockUnknownAccount", [{ + message: "cannot unlock known/personal account" + }]) + ); + } finally { + // unlock the account + await provider.send("personal_unlockAccount", [address, "", 0]); + } + }); + + it("should lock any unlocked unknown account via evm_lockUnknownAccount", async() => { + const address = "0x842d35Cc6634C0532925a3b844Bc454e4438f44f"; + const unlockResult = await provider.send("evm_unlockUnknownAccount", [address]); + assert.strictEqual(unlockResult, true); + + const lockResult1 = await provider.send("evm_lockUnknownAccount", [address]); + assert.strictEqual(lockResult1, true); + + // bonus: also make sure we return false when the account is already locked: + const lockResult2 = await provider.send("evm_lockUnknownAccount", [address]); + assert.strictEqual(lockResult2, false); + }); + + it("should not lock a known account via evm_lockUnknownAccount", async() => { + await assert.rejects( + provider.send("evm_lockUnknownAccount", [accounts[0]]), + { + message: "cannot lock known/personal account" + } + ) + }); + + it("should not lock a personal account via evm_lockUnknownAccount", async() => { + // create a new personal account + const address = await provider.send("personal_newAccount", ["password"]); + + // then explicitly unlock it + const result = await provider.send("personal_unlockAccount", [address, "password", 0]); + assert.strictEqual(result, true); + + // then try to lock it via evm_lockUnknownAccount + await assert.rejects(provider.send("evm_lockUnknownAccount", [address]), { + message: "cannot lock known/personal account" + }); + }); + + it("should return `false` upon lock if account isn't locked (unknown account)", async() => { + const address = "0x942d35Cc6634C0532925a3b844Bc454e4438f450"; + const result = await provider.send("evm_lockUnknownAccount", [address]); + assert.strictEqual(result, false); + }); + }); }); }); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 00338f0919..3efed3f721 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -434,6 +434,39 @@ export default class EthereumApi implements types.Api { return Quantity.from(this.#blockchain.snapshot()); } + /** + * Unlocks any unknown account. + * @param address address the address of the account to unlock + * @param duration (default: disabled) Duration in seconds how long the account + * should remain unlocked for. Set to 0 to disable automatic locking. + * @returns `true` if the account was unlocked successfully, `false` if the + * account was already unlocked. Throws an error if the account could not be + * unlocked. + */ + async evm_unlockUnknownAccount(address: string, duration: number = 0) { + return this.#wallet.unlockUnknownAccount(address.toLowerCase(), duration); + } + + /** + * Locks any unknown account. + * + * Note: accounts known to the `personal` namespace and accounts returned by + * `eth_accounts` cannot be locked using this method. + * + * @param address address the address of the account to lock + * @returns `true` if the account was locked successfully, `false` if the + * account was already locked. Throws an error if the account could not be + * locked. + */ + async evm_lockUnknownAccount(address: string) { + const lowerAddress = address.toLowerCase(); + // if this is a known account, don'we can't unlock it this way + if (this.#wallet.knownAccounts.has(lowerAddress)) { + throw new Error("cannot lock known/personal account"); + } + return this.#wallet.lockAccount(lowerAddress); + } + //#endregion evm //#region miner @@ -1640,7 +1673,7 @@ export default class EthereumApi implements types.Api { * @param address 20 Bytes - The address of the account to unlock. * @param passphrase Passphrase to unlock the account. * @param duration (default: 300) Duration in seconds how long the account - * should remain unlocked for. + * should remain unlocked for. Set to 0 to disable automatic locking. * @returns true if it worked. Throws an error if it did not. */ @assertArgLength(2, 3) diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 8aa5ff7719..08fda896da 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -332,6 +332,30 @@ export default class Wallet { return true; } + public async unlockUnknownAccount(lowerAddress: string, duration: number) { + if (this.unlockedAccounts.has(lowerAddress)) { + // already unlocked, return `false` since we didn't do anything + return false; + } + + // if we "know" about this account, it cannot be unlocked this way + if (this.knownAccounts.has(lowerAddress)) { + throw new Error("cannot unlock known/personal account"); + } + + // a duration <= 0 will remain unlocked + const durationMs = (duration * 1000) | 0; + if (durationMs > 0) { + const timeout = setTimeout(this.#lockAccount, durationMs, lowerAddress); + utils.unref(timeout); + this.lockTimers.set(lowerAddress, timeout); + } + + // otherwise, unlock it! + this.unlockedAccounts.set(lowerAddress, null); + return true; + } + #lockAccount = (lowerAddress: string) => { this.lockTimers.delete(lowerAddress); this.unlockedAccounts.delete(lowerAddress); @@ -339,6 +363,8 @@ export default class Wallet { } public lockAccount(lowerAddress: string) { + if (!this.unlockedAccounts.has(lowerAddress)) return false; + clearTimeout(this.lockTimers.get(lowerAddress) as number); return this.#lockAccount(lowerAddress); } From 4a081acfad686e2f94c49f6087df6bb9722d2d1d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 16 Oct 2020 14:11:33 -0400 Subject: [PATCH 546/691] fix typo --- src/packages/core/src/connector.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index ee43d9aee5..69eed67172 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -26,8 +26,8 @@ export default { const connector = new ConnectorsByName[flavor](providerOptions, executor); - // The request coordinator is initialized in a "paused" state, when the provider is ready we unpause - // this lets us accept queue requests before we've even fully initialized. + // The request coordinator is initialized in a "paused" state; when the provider is ready we unpause. + // This lets us accept queue requests before we've even fully initialized. connector.on("ready", requestCoordinator.resume); return connector; From 6127a24242538e387449f4dc2aaf0af4c2fb5395 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 16 Oct 2020 16:48:06 -0400 Subject: [PATCH 547/691] uninstall solc's unhandledRejection listener --- src/chains/ethereum/__tests__/helpers/compile.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/helpers/compile.ts b/src/chains/ethereum/__tests__/helpers/compile.ts index 484edf0106..d664532044 100644 --- a/src/chains/ethereum/__tests__/helpers/compile.ts +++ b/src/chains/ethereum/__tests__/helpers/compile.ts @@ -1,5 +1,11 @@ - import solc from "solc"; + +// Clean up after solc. Looks like this never really got fixed: +// https://github.com/chriseth/browser-solidity/issues/167 +var listeners = process.listeners("unhandledRejection"); +var solc_listener = listeners[listeners.length - 1]; +process.removeListener("unhandledRejection", solc_listener); + import { readFileSync } from "fs-extra"; import { parse } from "path"; From 61131b2230aa51fc7bbe33ede0154ce31f52ced6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 16 Oct 2020 16:48:22 -0400 Subject: [PATCH 548/691] clarify comments --- src/chains/ethereum/src/api.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 3efed3f721..7c48e263f7 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -555,13 +555,12 @@ export default class EthereumApi implements types.Api { } /** - * Returns true if client is actively listening for network connections. - * @returns true when listening, otherwise false. + * Returns `true` if client is actively listening for network connections. + * @returns `true` when listening, otherwise `false`. */ @assertArgLength(0) async net_listening() { - // TODO: this should return false when ganache isn't used with a server, or - // or while the server is still initializing. + // TODO: this should return false when ganache isn't used with a server. return true; } @@ -1508,8 +1507,8 @@ export default class EthereumApi implements types.Api { return Promise.all(pendingLogsPromises).then(blockLogsRange => { const filteredBlockLogs: ReturnType[] = []; blockLogsRange.forEach(blockLogs => { - // TODO(perf): this loops over all expectedAddresseses for every block. - // Make it loop only once. + // TODO(perf): this loops over all addresses for every block. + // Maybe make it loop only once? if (blockLogs) filteredBlockLogs.push(...blockLogs.filter(addresses, topics)); }); return filteredBlockLogs; From 6a78f36591544120005a3b72494d9e8462bff95d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 16 Oct 2020 16:48:59 -0400 Subject: [PATCH 549/691] enable logging in snapshot/revert --- src/chains/ethereum/src/blockchain.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 0900c23fbb..97231b2bce 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -420,8 +420,7 @@ export default class Blockchain extends Emittery.Typed Date: Tue, 20 Oct 2020 20:16:05 -0400 Subject: [PATCH 550/691] cleanup api a little bit --- src/chains/ethereum/src/api.ts | 89 +++++++++++++++++----------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 7c48e263f7..c3524f01cc 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -28,6 +28,7 @@ import { assertArgLength } from "./helpers/assert-arg-length"; import Account from "./things/account"; import { SubscriptionId, SubscriptionName } from "./types/subscriptions"; import { parseFilter, parseFilterDetails, parseFilterRange } from "./helpers/filter-parsing"; +import { Hardfork } from "./options/chain-options"; //#endregion //#region Constants @@ -68,29 +69,47 @@ function assertExceptionalTransactions(transactions: Transaction[]) { throw err; } } + +function parseCoinbaseAddress(coinbase: string | number | Address, initialAccounts: Account[]) { + switch (typeof coinbase) { + case "object": + return coinbase; + case "number": + const account = initialAccounts[coinbase]; + if (account) { + return account.address; + } else { + throw new Error(`invalid coinbase address index: ${coinbase}`); + } + case "string": + return Address.from(coinbase); + default: { + throw new Error(`coinbase address must be string or number, received: ${coinbase}`); + } + } +} + +function createCommon(chainId: number, networkId: number, hardfork: Hardfork) { + return Common.forCustomChain( + // if we were given a chain id that matches a real chain, use it + // NOTE: I don't think Common serves a purpose ther than instructing the + // VM what hardfork is in use. But just incase things change in the future + // its configured "more correctly" here. + KNOWN_CHAINIDS.has(chainId) ? chainId : 1, + { + name: "ganache", + networkId: networkId, + chainId: chainId, + comment: "Local test network" + }, + hardfork + ); +} //#endregion helpers export default class EthereumApi implements types.Api { readonly [index: string]: (...args: any) => Promise; - readonly #parseCoinbaseAddress = (coinbase: string | number | Address, initialAccounts: Account[]) => { - switch (typeof coinbase) { - case "object": - return coinbase; - case "number": - const account = initialAccounts[coinbase]; - if (account) { - return account.address; - } else { - throw new Error(`invalid coinbase address index: ${coinbase}`); - } - case "string": - return Address.from(coinbase); - default: { - throw new Error(`coinbase address must be string or number, received: ${coinbase}`); - } - } - } readonly #getId = ((id) => () => Quantity.from(++id))(0); readonly #common: Common; readonly #filters = new Map(); @@ -107,34 +126,16 @@ export default class EthereumApi implements types.Api { * @param ready Callback for when the API is fully initialized */ constructor(options: EthereumInternalOptions, emitter: Emittery.Typed<{message: any}, "connect" | "disconnect">) { - const opts = (this.#options = options); - - const {initialAccounts} = this.#wallet = new Wallet(opts.wallet); - - const coinbaseAddress = this.#parseCoinbaseAddress(options.miner.coinbase, initialAccounts); - - const common = this.#common = Common.forCustomChain( - // if we were given a chain id that matches a real chain, use it - // NOTE: I don't think Common serves a purpose ther than instructing the - // VM what hardfork is in use. But just incase things change in the future - // its configured "more correctly" here. - KNOWN_CHAINIDS.has(options.chain.chainId) ? options.chain.chainId : 1, - { - name: "ganache", - networkId: options.chain.networkId, - chainId: options.chain.chainId, - comment: "Local test network" - }, - options.chain.hardfork - ); + this.#options = options; + + const chain = options.chain; + const {initialAccounts} = this.#wallet = new Wallet(options.wallet); + const coinbaseAddress = parseCoinbaseAddress(options.miner.coinbase, initialAccounts); + const common = this.#common = createCommon(chain.chainId, chain.networkId, chain.hardfork); const blockchain = (this.#blockchain = new Blockchain(options, common, initialAccounts, coinbaseAddress)); - blockchain.on("start", () => { - emitter.emit("connect"); - }); - emitter.on("disconnect", () => { - return blockchain.stop(); - }); + blockchain.on("start", () => emitter.emit("connect")); + emitter.on("disconnect", blockchain.stop.bind(blockchain)); } //#region db From 1b90829319e8abfaf1ea51a214d229bc8d20885a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 11:28:06 -0400 Subject: [PATCH 551/691] fix tests --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 59841d2880..165c6c2a3c 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -85,15 +85,15 @@ describe("api", () => { assert.deepStrictEqual(result, "0x539"); }); - xit("should use the default chain id when signing transactions", async () => { + it("should use the default chain id when signing transactions", async () => { await provider.send("eth_subscribe", ["newHeads"]); const txHash = await provider.send("eth_sendTransaction", [{from: accounts[0], to: accounts[0]}]); await provider.once("message"); const tx = await provider.send("eth_getTransactionByHash", [txHash]); - assert.strictEqual(tx.v, "0xa96"); + assert.strictEqual(tx.v, "0xa95"); }); - it("should update the default chain id", async () => { + it("chainid option should change the chain id", async () => { const provider = await getProvider({chain: {chainId: 1234}}); const result = await provider.send("eth_chainId"); assert.deepStrictEqual(result, "0x4d2"); From fe51ff12e61121aa31bb7d5a1ef910cc53264853 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 11:28:13 -0400 Subject: [PATCH 552/691] disbale logger by default --- src/chains/ethereum/__tests__/helpers/getProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/helpers/getProvider.ts b/src/chains/ethereum/__tests__/helpers/getProvider.ts index 793b57f94c..a98c864c13 100644 --- a/src/chains/ethereum/__tests__/helpers/getProvider.ts +++ b/src/chains/ethereum/__tests__/helpers/getProvider.ts @@ -9,7 +9,7 @@ type Writeable = { -readonly [P in keyof T]: T[P] }; const getProvider = async (options: Writeable = {wallet: {mnemonic: mnemonic}}) => { options.chain = options.chain || {}; - options.logging = options.logging || {}; + options.logging = options.logging || {logger: {log: ()=>{}}}; // set `asyncRequestProcessing` to `true` by default const doAsync = options.chain.asyncRequestProcessing; From 16725e4e6da61aa79c9ddcab6bfaa297a0bf17b1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 12:17:50 -0400 Subject: [PATCH 553/691] optimize common account lookup fns --- src/chains/ethereum/src/api.ts | 8 ++--- .../src/data-managers/account-manager.ts | 35 +++++++++++++++++-- src/chains/ethereum/src/things/account.ts | 30 ++++++++-------- src/packages/utils/src/utils/constants.ts | 2 +- 4 files changed, 52 insertions(+), 23 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index c3524f01cc..22044c4dc3 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -902,9 +902,7 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1, 2) async eth_getBalance(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { - const chain = this.#blockchain; - const account = await chain.accounts.get(Address.from(address), blockNumber); - return account.balance; + return this.#blockchain.accounts.getBalance(Address.from(address), blockNumber); } /** @@ -1527,9 +1525,7 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1, 2) async eth_getTransactionCount(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { - const account = await this.#blockchain.accounts.get(Address.from(address), blockNumber); - if (!account) return null; - return account.nonce; + return this.#blockchain.accounts.getNonce(Address.from(address), blockNumber); } diff --git a/src/chains/ethereum/src/data-managers/account-manager.ts b/src/chains/ethereum/src/data-managers/account-manager.ts index 7d8250951e..806cb072a4 100644 --- a/src/chains/ethereum/src/data-managers/account-manager.ts +++ b/src/chains/ethereum/src/data-managers/account-manager.ts @@ -4,6 +4,9 @@ import Trie from "merkle-patricia-tree/baseTrie"; import Blockchain from "../blockchain"; import Tag from "../things/tags"; import {LevelUp} from "levelup"; +import { rlp } from "ethereumjs-util"; +import { Quantity } from "@ganache/utils"; +import { RPCQUANTITY_ZERO } from "@ganache/utils/lib/utils"; export default class AccountManager { #blockchain: Blockchain; @@ -13,15 +16,43 @@ export default class AccountManager { this.#trie = trie; } - public async get(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + public async getRaw(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { const blockchain = this.#blockchain; const block = await blockchain.blocks.get(blockNumber); const trieCopy = new Trie(this.#trie, block.value.header.stateRoot); return new Promise((resolve, reject) => { trieCopy.get(address.toBuffer(), (err, data) => { if (err) return reject(err); - resolve(new Account(data)); + resolve(data); }); }); } + + public async getNonce(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + return this.getRaw(address, blockNumber).then(data => { + if (data) { + const [nonce] = (rlp.decode(data) as any) as Buffer[]; + return nonce.length === 0 ? RPCQUANTITY_ZERO : Quantity.from(nonce); + } else { + return RPCQUANTITY_ZERO; + } + }); + } + + public async getBalance(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + return this.getRaw(address, blockNumber).then(data => { + if (data) { + const [, balance] = (rlp.decode(data) as any) as Buffer[]; + return balance.length === 0 ? RPCQUANTITY_ZERO : Quantity.from(balance) ; + } else { + return RPCQUANTITY_ZERO; + } + }); + } + + public async get(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + return this.getRaw(address, blockNumber).then(data => { + return Account.fromBuffer(data); + }); + } } diff --git a/src/chains/ethereum/src/things/account.ts b/src/chains/ethereum/src/things/account.ts index 2a77793ac8..5bcec2c505 100644 --- a/src/chains/ethereum/src/things/account.ts +++ b/src/chains/ethereum/src/things/account.ts @@ -1,6 +1,7 @@ import {Data, Quantity} from "@ganache/utils"; import Address from "./address"; import {rlp, KECCAK256_RLP, KECCAK256_NULL} from "ethereumjs-util"; +import { RPCQUANTITY_ZERO } from "@ganache/utils/lib/utils"; export default class Account { public address: Address; @@ -10,21 +11,22 @@ export default class Account { public stateRoot: Buffer = KECCAK256_RLP; public codeHash: Buffer = KECCAK256_NULL; - constructor(address: Address); - constructor(buffer: Buffer); - constructor(arg: Address | Buffer) { - if (Buffer.isBuffer(arg)) { - const arr = (rlp.decode(arg) as any) as Buffer[]; - this.nonce = Quantity.from(arr[0]); - this.balance = Quantity.from(arr[1]); - this.stateRoot = arr[2]; - this.codeHash = arr[3]; - } else { - this.address = arg; - this.balance = new Quantity(0n); - this.nonce = new Quantity(0n); - } + constructor(address: Address) { + this.address = address; + this.balance = RPCQUANTITY_ZERO; + this.nonce = RPCQUANTITY_ZERO; } + + public static fromBuffer(buffer: Buffer) { + const account = Object.create(Account); + const arr = (rlp.decode(buffer) as any) as [Buffer, Buffer, Buffer, Buffer]; + account.nonce = Quantity.from(arr[0]); + account.balance = Quantity.from(arr[1]); + account.stateRoot = arr[2]; + account.codeHash = arr[3]; + return account; + } + public serialize() { return rlp.encode(Buffer.concat([this.nonce.toBuffer(), this.balance.toBuffer(), this.stateRoot, this.codeHash])); } diff --git a/src/packages/utils/src/utils/constants.ts b/src/packages/utils/src/utils/constants.ts index 0ab1299c77..f7234d02fa 100644 --- a/src/packages/utils/src/utils/constants.ts +++ b/src/packages/utils/src/utils/constants.ts @@ -3,5 +3,5 @@ import { Quantity } from "../things/json-rpc/json-rpc-quantity"; export const ACCOUNT_ZERO = Buffer.allocUnsafe(20).fill(0); export const BUFFER_EMPTY = Buffer.allocUnsafe(0); export const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); -export const RPCQUANTITY_ZERO = Quantity.from("0x0"); +export const RPCQUANTITY_ZERO = Quantity.from(0n); export const WEI = 1000000000000000000n as const; \ No newline at end of file From ab89a021e870a7ee9a8cc4f25841220ca6ebe45f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 14:24:04 -0400 Subject: [PATCH 554/691] remove unused var --- src/chains/ethereum/__tests__/api/eth/eth.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 165c6c2a3c..bc679d2d1e 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -389,7 +389,7 @@ describe("api", () => { }); it("eth_getTransactionReceipt", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_subscribe", ["newHeads"]); const hash = await provider.send("eth_sendTransaction", [ { from: accounts[0], @@ -404,7 +404,7 @@ describe("api", () => { }); it("eth_getTransactionByHash", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + await provider.send("eth_subscribe", ["newHeads"]); const hash = await provider.send("eth_sendTransaction", [ { from: accounts[0], From edf295f8ffa8ceb81d35d17aac8860fb021cba87 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 14:26:55 -0400 Subject: [PATCH 555/691] remove extra whitespace --- src/chains/ethereum/src/data-managers/block-manager.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/data-managers/block-manager.ts b/src/chains/ethereum/src/data-managers/block-manager.ts index 7de39b712a..c1a31c4cf7 100644 --- a/src/chains/ethereum/src/data-managers/block-manager.ts +++ b/src/chains/ethereum/src/data-managers/block-manager.ts @@ -152,10 +152,10 @@ export default class BlockManager extends Manager { updateTaggedBlocks() { return new Promise((resolve, reject) => { this.base.createValueStream({limit: 1}) - .on("data", (data: Buffer) => { + .on("data", (data: Buffer) => { this.earliest = new Block(data, this.#common); }) - .on("error", (err: Error) => { + .on("error", (err: Error) => { reject(err); }) .on("end", () => { @@ -163,10 +163,10 @@ export default class BlockManager extends Manager { }); this.base.createValueStream({reverse: true, limit: 1}) - .on("data", (data: Buffer) => { + .on("data", (data: Buffer) => { this.latest = new Block(data, this.#common); }) - .on("error", (err: Error) => { + .on("error", (err: Error) => { reject(err); }) .on("end", () => { From ac664f34bfe928cb9f2be9474e8a0dd23494a96a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 15:35:06 -0400 Subject: [PATCH 556/691] add a promise queue --- src/packages/utils/src/utils/index.ts | 1 + src/packages/utils/src/utils/promise-queue.ts | 96 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 src/packages/utils/src/utils/promise-queue.ts diff --git a/src/packages/utils/src/utils/index.ts b/src/packages/utils/src/utils/index.ts index e2ab466a84..1edcca1923 100644 --- a/src/packages/utils/src/utils/index.ts +++ b/src/packages/utils/src/utils/index.ts @@ -6,3 +6,4 @@ export * from "./unref"; export * from "./has-own"; export * from "./uint-to-buffer"; export * from "./constants"; +export * from "./promise-queue"; diff --git a/src/packages/utils/src/utils/promise-queue.ts b/src/packages/utils/src/utils/promise-queue.ts new file mode 100644 index 0000000000..aa63b3a5c1 --- /dev/null +++ b/src/packages/utils/src/utils/promise-queue.ts @@ -0,0 +1,96 @@ +/** + * calls the callback when the promise is resolved or rejected. + * + * This is different than use just `finally` in that we handle promise rejection + * + * @param promise + * @param callback + */ +function settled(promise: Promise, callback: () => void){ + promise.then(callback, callback); +} + +/** + * Creates a FIFO queue to that ensures promises are _resolved_ in the order + * they were added. + * + * This is different than a FIFO queue that _executes_ functions that + * return promises; this queue is for the promises themselves. + * + * @example + * const queue = new PromiseQueue(); + * + * const prom1 = new Promise(resolve => setTimeout(resolve, 1000, "slow")); + * const prom2 = Promise.resolve("fast"); + * + * await Promise.race([ + * queue.add(prom1), + * queue.add(prom2) + * ]); // "slow" + * + * Additionally, the queued promise chain can be cleared via `queue.clear()`. + * This will cause the chain of promises to all resolve immediately with a value + * of `null`. * + * + * * note: whatever the promise starting doing when it was created will still + * happen, no promises are aborted; rather, they are ignored. + */ +export class PromiseQueue { + // TODO(perf): a singly linked list is probably a better option here + readonly #queue: { + value: Promise | null, + resolve: any, + resolved: boolean + }[] = []; + + add(promise: Promise) { + return new Promise(resolve => { + const element = {value: promise, resolve, resolved: false}; + const q = this.#queue; + q.push(element); + settled(promise, () => { + // if this is now the highest priority element, resolve the outer + // Promise then try resolving the rest + if (q[0] === element) { + q.shift(); + + // Note: element.promise might not be the original `promise` here; the + // `clear` method may have changed it! + resolve(element.value); + + this.#tryResolveChain(); + } else { + element.resolved = true; + } + }); + }); + } + + /** + * Clears all promises from the queue and sets their resolved values to `null` + */ + clear() { + let element = this.#queue.shift(); + + // remove all elements from the queue and mark them. + while (element) { + // override the value that gets returned with `null` + element.value = null; + + element = this.#queue.shift(); + } + } + + /** + * Removes all _resolved_ promises from the front of the chain of promises. + */ + #tryResolveChain = () => { + const q = this.#queue; + let first = q[0]; + while (first && first.resolved) { + q.shift(); + first.resolve(first.value); + first = q[0]; + } + } +} From f1ebd119189c64ab7faeecdb8eab6e6ceec559f1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 15:35:49 -0400 Subject: [PATCH 557/691] ensure `asyncRequestProcessing` is configured in tests --- src/chains/ethereum/__tests__/helpers/getProvider.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/__tests__/helpers/getProvider.ts b/src/chains/ethereum/__tests__/helpers/getProvider.ts index a98c864c13..5a589c0bde 100644 --- a/src/chains/ethereum/__tests__/helpers/getProvider.ts +++ b/src/chains/ethereum/__tests__/helpers/getProvider.ts @@ -12,8 +12,8 @@ const getProvider = async (options: Writeable = {wallet options.logging = options.logging || {logger: {log: ()=>{}}}; // set `asyncRequestProcessing` to `true` by default - const doAsync = options.chain.asyncRequestProcessing; - options.chain.asyncRequestProcessing = doAsync != null ? doAsync : true; + let doAsync = options.chain.asyncRequestProcessing; + doAsync = options.chain.asyncRequestProcessing = doAsync != null ? doAsync : true; // don't write to stdout in tests if (!options.logging.logger) { From 2c68ed2fd74763dd2be1991fa08c145340a6bba4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 15:36:05 -0400 Subject: [PATCH 558/691] fix evm_revert race conditions --- src/chains/ethereum/src/api.ts | 7 +- src/chains/ethereum/src/blockchain.ts | 230 +++++++++++------- .../src/data-managers/transaction-manager.ts | 74 +++++- src/chains/ethereum/src/miner.ts | 28 ++- src/chains/ethereum/src/transaction-pool.ts | 77 ++++-- src/chains/ethereum/src/types/snapshots.ts | 24 ++ 6 files changed, 310 insertions(+), 130 deletions(-) create mode 100644 src/chains/ethereum/src/types/snapshots.ts diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 22044c4dc3..dd3b2184b8 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -838,12 +838,13 @@ export default class EthereumApi implements types.Api { }; /** - * Returns true if client is actively mining new blocks. - * @returns returns true of the client is mining, otherwise false. + * Returns `true` if client is actively mining new blocks. + * @returns returns `true` if the client is mining, otherwise `false`. */ @assertArgLength(0) async eth_mining() { - return this.#blockchain.isMining(); + // we return the blockchain's started state + return this.#blockchain.isStarted(); } /** diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 97231b2bce..72fb20c7e6 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -25,7 +25,7 @@ import BlockLogManager from "./data-managers/blocklog-manager"; import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; import { VmError, ERROR } from "ethereumjs-vm/dist/exceptions"; import { EthereumInternalOptions } from "./options"; - +import { Snapshots } from "./types/snapshots"; type SimulationTransaction = { /** @@ -69,10 +69,26 @@ export enum Status { type BlockchainTypedEvents = {block: Block, blockLogs: BlockLogs, pendingTransaction: Transaction}; type BlockchainEvents = "start" | "stop" | "step"; +/** + * Sets the provided VM state manager's state root *without* first + * checking for checkpoints or flushing the existing cache. + * + * Useful if you know the state manager is not in a checkpoint and its internal + * cache is safe to discard. + * + * @param stateManager + * @param stateRoot + */ +function setStateRootSync(stateManager: VM["stateManager"], stateRoot: Buffer) { + stateManager._trie.root = stateRoot; + stateManager._cache.clear(); + stateManager._storageTries = {}; +} + export default class Blockchain extends Emittery.Typed { #state: Status = Status.starting; #miner: Miner; - #processingBlock: Promise<{block: Block, blockLogs: BlockLogs}>; + #blockBeingSavedPromise: Promise<{block: Block, blockLogs: BlockLogs}>; public blocks: BlockManager; public blockLogs: BlockLogManager; public transactions: TransactionManager; @@ -80,6 +96,7 @@ export default class Blockchain extends Emittery.Typed block); + this.#blockBeingSavedPromise = this.#initializeGenesisBlock(firstBlockTime, options.miner.blockGasLimit); + blocks.earliest = blocks.latest = await this.#blockBeingSavedPromise.then(({block}) => block); } } @@ -169,19 +186,19 @@ export default class Blockchain extends Emittery.Typed this.#isPaused() ? null : this.mine(1); + const mineAll = async (maxTransactions: number) => this.#isPaused() ? null : this.mine(maxTransactions); if (instamine) { // insta mining // whenever the transaction pool is drained mine the txs into blocks - this.transactions.transactionPool.on("drain", mineAll); + this.transactions.transactionPool.on("drain", mineAll.bind(null, 1)); } else { // interval mining const wait = () => unref(setTimeout(mineNext, options.miner.blockTime * 1000)); - const mineNext = () => mineAll().then(wait); + const mineNext = () => mineAll(-1).then(wait); wait(); } } miner.on("block", async (blockData: any) => { - await this.#processingBlock; + await this.#blockBeingSavedPromise; const previousBlock = blocks.latest; const previousHeader = previousBlock.value.header; const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; @@ -201,7 +218,7 @@ export default class Blockchain extends Emittery.Typed { + this.#blockBeingSavedPromise = database.batch(() => { const blockHash = value.hash(); const blockNumber = header.number; const blockNumberQ = Quantity.from(blockNumber); @@ -257,8 +274,7 @@ export default class Blockchain extends Emittery.Typed { - blocks.latest = block; + return this.#blockBeingSavedPromise.then(({block, blockLogs}) => { if (instamine && options.miner.legacyInstamine) { block.value.transactions.forEach(transaction => { const error = options.chain.vmErrorsOnRPCResponse ? transaction.execException : null @@ -298,12 +314,12 @@ export default class Blockchain extends Emittery.Typed { + isStarted = () => { return this.#state === Status.started; } mine = async (maxTransactions: number, timestamp?: number, onlyOneBlock: boolean = false) => { - await this.#processingBlock; + await this.#blockBeingSavedPromise; const nextBlock = this.#readyNextBlock(this.blocks.latest.value, timestamp); return this.#miner.mine(this.transactions.transactionPool.executables, nextBlock, maxTransactions, onlyOneBlock); } @@ -412,38 +428,59 @@ export default class Blockchain extends Emittery.Typed { + return this.#database.batch(() => { + const {blocks, transactions, transactionReceipts, blockLogs} = this; + blocksToDelete.forEach(({value}) => { + value.transactions.forEach(tx => { + const txHash = tx.hash(); + transactions.del(txHash); + transactionReceipts.del(txHash); + }); + blocks.del(value.header.number); + blocks.del(value.header.hash()); + blockLogs.del(value.header.number); + }); + }); + } - this.#options.logging.logger.log("Saved snapshot #" + this.#snapshots.length); + + // TODO(stability): this.#snapshots is a potential unbound memory suck. Caller + // could call `evm_snapshot` over and over to grow the snapshot stack + // indefinitely. `this.#snapshots.blocks` is even worse. To solve this we + // might need to store in the db. An unlikely real problem, but possible. + #snapshots: Snapshots = { + snaps: [], + blocks: null, + unsubscribeFromBlocks: null + }; + + public snapshot() { + const snapshots = this.#snapshots; + const snaps = snapshots.snaps; - return this.#snapshots.push({ - hash, - stateRoot, + // Subscription ids are based on the number of active snapshots. Weird? Yes. + // But it's the way it's been since the beginning so it just hasn't been + // changed. Feel free to change it so ids are unique if it bothers you + // enough. + const id = snaps.push({ + block: this.blocks.latest, timeAdjustment: this.#timeAdjustment }); - } - #deleteBlockData = (block: Block) => { - const blocks = this.blocks; - return this.#database.batch(() => { - blocks.del(block.value.header.number); - blocks.del(block.value.header.hash()); - this.blockLogs.del(block.value.header.number); - block.value.transactions.forEach(tx => { - const txHash = tx.hash(); - this.transactions.del(txHash); - this.transactionReceipts.del(txHash); + // start listening to new blocks if this is the first snapshot + if (id === 1) { + snapshots.unsubscribeFromBlocks = this.on("block", (block) => { + snapshots.blocks = {current: block.value.hash(), next: snapshots.blocks}; }); - }); + } + + this.#options.logging.logger.log("Saved snapshot #" + id); + + return id; } - public async revert(snapshotId: Quantity) { + public async revert(snapshotId: Quantity) { const rawValue = snapshotId.valueOf(); if (rawValue === null || rawValue === undefined) { throw new Error("invalid snapshotId"); @@ -451,72 +488,87 @@ export default class Blockchain extends Emittery.Typed, ...Promise[]]; - do { - promises.push(this.#deleteBlockData(nextBlock)); - const header = nextBlock.value.header - if (header.parentHash.equals(snapshotHash)) { - break; - } else { - nextBlock = await blocks.getByHash(header.parentHash); - } - } while(nextBlock); - - const [latest] = await Promise.all(promises); - this.blocks.latest = latest as Block; - // put our time back! - this.#timeAdjustment = snapshot.timeAdjustment; - // update our cached "latest" block - return true; + // remove this and all stored snapshots after this snapshot + snaps.splice(snapshotIndex); + + // if there are no more listeners, stop listening to new blocks + if (snaps.length === 0) { + snapshots.unsubscribeFromBlocks(); + } + + // if the snapshot's hash is different than the latest block's hash we've + // got new blocks to clean up. + if (!currentHash.equals(snapshotHash)) { + // if we've added blocks since we snapshotted we need to delete them and put + // some things back the way they were. + const blockPromises = []; + let blockList = snapshots.blocks; + while (blockList !== null) { + if (blockList.current.equals(snapshotHash)) break; + blockPromises.push(blocks.getByHash(blockList.current)); + blockList = blockList.next; + } + snapshots.blocks = blockList; + + await Promise.all(blockPromises).then(this.#deleteBlockData); + + setStateRootSync(this.vm.stateManager, snapshotHeader.stateRoot); + blocks.latest = snapshotBlock; } + + // put our time adjustment back + this.#timeAdjustment = snapshot.timeAdjustment; + + // resume processing transactions + this.transactions.resume(); + + return true; } public async queueTransaction(transaction: Transaction, secretKey?: Data) { - // NOTE: this.transactions.push *must* be awaited before returning the + // NOTE: this.transactions.add *must* be awaited before returning the // `transaction.hash()`, as the transactionPool may change the transaction // (and thus its hash!) // It may also throw Errors that must be returned to the caller. - if ( (await this.transactions.push(transaction, secretKey) === true) ) { + const isExecutable = await this.transactions.add(transaction, secretKey) === true; + if ( isExecutable ) { process.nextTick(this.emit.bind(this), "pendingTransaction", transaction); } diff --git a/src/chains/ethereum/src/data-managers/transaction-manager.ts b/src/chains/ethereum/src/data-managers/transaction-manager.ts index 72c9ecc0e3..c623afb684 100644 --- a/src/chains/ethereum/src/data-managers/transaction-manager.ts +++ b/src/chains/ethereum/src/data-managers/transaction-manager.ts @@ -4,22 +4,86 @@ import TransactionPool from "../transaction-pool"; import { EthereumInternalOptions } from "../options"; import { LevelUp } from "levelup"; import Blockchain from "../blockchain"; -import { Data } from "@ganache/utils"; +import { Data, utils } from "@ganache/utils"; import Common from "ethereumjs-common"; export default class TransactionManager extends Manager { public transactionPool: TransactionPool; + #queue = new utils.PromiseQueue(); + #paused = false; + #resumer: Promise; + #resolver: (value: void ) => void; + constructor(options: EthereumInternalOptions["miner"], common: Common, blockchain: Blockchain, base: LevelUp) { super(base, Transaction, common); this.transactionPool = new TransactionPool(options, blockchain); - this.transactionPool.on("drain", () => { - // TODO: create "pending" block? + } + + /** + * Adds the transaction to the transaction pool. + * + * Returns a promise that is only resolved in the order it was added. + * + * @param transaction + * @param secretKey + * @returns `true` if the `transaction` is immediately executable, `false` if + * it may be valid in the future. Throws if the transaction is invalid. + */ + public async add(transaction: Transaction, secretKey?: Data) { + if (this.#paused) { + await this.#resumer; + } + // Because ganache requires determinism, we can't allow varying IO times to + // potentially affect the order in which transactions are inserted into the + // pool, so we use a FIFO queue to _return_ transaction insertions in the + // order the were received. + const insertion = this.transactionPool.prepareTransaction(transaction, secretKey); + const result = await this.#queue.add(insertion); + if (result) { + this.transactionPool.drainQueued(result); + return true; + } else { + return false; + } + } + + /** + * Immediately ignores all transactions that were in the process of being + * added to the pool. These transactions' `push` promises will be resolved + * immediately with the value `false` and will _not_ be added to the pool. + * + * Also clears all transactions that were already added to the pool. + * + * Transactions that are currently in the process of being mined may still be + * mined. + */ + public clear() { + this.#queue.clear(); + this.transactionPool.clear(); + } + + /** + * Stop processing _new_ transactions; puts new requests in a queue. Has no + * affect if already paused. + */ + public pause() { + if (!this.#paused) return; + + this.#paused = true; + this.#resumer = new Promise(resolve => { + this.#resolver = resolve; }); } - public push(transaction: Transaction, secretKey?: Data) { - return this.transactionPool.insert(transaction, secretKey); + /** + * Resume processing transactions. Has no effect if not paused. + */ + public resume = () => { + if (!this.#paused) return; + + this.#paused = false; + this.#resolver(); } } diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 81a0129015..64718ed430 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -11,6 +11,14 @@ import {encode as rlpEncode} from "rlp"; import { EthereumInternalOptions } from "./options"; import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; +type BlockData = { + blockTransactions: Transaction[], + transactionsTrie: Trie, + receiptTrie: Trie, + gasUsed: bigint, + timestamp: Buffer +} + const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); function replaceFromHeap( @@ -35,11 +43,11 @@ function byPrice(values: Transaction[], a: number, b: number) { return Quantity.from(values[a].gasPrice) > Quantity.from(values[b].gasPrice); } -export default class Miner extends Emittery { +export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { #currentlyExecutingPrice = 0n; #origins = new Set(); #pending: Map>; - #isMining: boolean = false; + #isBusy: boolean = false; readonly #options: EthereumInternalOptions["miner"]; readonly #instamine: boolean; readonly #vm: VM; @@ -48,6 +56,10 @@ export default class Miner extends Emittery { readonly #revert: () => Promise; readonly #createBlock: (previousBlock: Block) => Block; + readonly isBusy = () => { + return this.#isBusy; + } + // create a Heap that sorts by gasPrice readonly #priced = new utils.Heap(byPrice); constructor(options: EthereumInternalOptions["miner"], instamine: boolean, vm: VM, createBlock: (previousBlock: Block) => Block) { @@ -80,7 +92,7 @@ export default class Miner extends Emittery { */ public async mine(pending: Map>, block: Block, maxTransactions: number = -1, onlyOneBlock = false) { // only allow mining a single block at a time (per miner) - if (this.#isMining) { + if (this.#isBusy) { // if we are currently mining a block, set the `pending` property // so the miner knows it can immediately start mining another block once // it is done with its current work. @@ -95,11 +107,13 @@ export default class Miner extends Emittery { // if there are more txs to mine, start mining them without awaiting their // result. - if (onlyOneBlock === false && this.#pending) { + if (!onlyOneBlock && this.#pending) { const nextBlock = this.#createBlock(lastBlock); const pending = this.#pending; this.#pending = null; await this.mine(pending, nextBlock, this.#instamine ? 1 : -1); + } else { + this.emit("idle"); } return transactions; } @@ -111,13 +125,13 @@ export default class Miner extends Emittery { let blockTransactions: Transaction[]; do { keepMining = false; - this.#isMining = true; + this.#isBusy = true; blockTransactions = []; const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); - const blockData = { + const blockData: BlockData = { blockTransactions, transactionsTrie, receiptTrie, @@ -327,7 +341,7 @@ export default class Miner extends Emittery { #reset = () => { this.#origins.clear(); this.#priced.clear(); - this.#isMining = false; + this.#isBusy = false; }; #setPricedHeap = (pending: Map>) => { diff --git a/src/chains/ethereum/src/transaction-pool.ts b/src/chains/ethereum/src/transaction-pool.ts index 8de4564c25..674fab1c7a 100644 --- a/src/chains/ethereum/src/transaction-pool.ts +++ b/src/chains/ethereum/src/transaction-pool.ts @@ -1,4 +1,3 @@ -import Account from "./things/account"; import Emittery from "emittery"; import Blockchain from "./blockchain"; import {utils} from "@ganache/utils"; @@ -28,7 +27,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { } public readonly executables: Map> = new Map(); readonly #origins: Map> = new Map(); - readonly #accountPromises = new Map>(); + readonly #accountPromises = new Map>(); /** * Inserts a transaction into the pending queue, if executable, or future pool @@ -36,12 +35,12 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { * * @param transaction * @param secretKey - * @returns `true` if the transaction is executable (pending), `false` if it is queued + * @returns data that can be used to drain the queue */ - public async insert(transaction: Transaction, secretKey?: Data) { + public async prepareTransaction(transaction: Transaction, secretKey?: Data) { let err: Error; - err = this.validateTransaction(transaction); + err = this.#validateTransaction(transaction); if (err != null) { throw err; } @@ -57,13 +56,20 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { const origin = from.toString(); const origins = this.#origins; - let queuedOriginTransactions = origins.get(origin); + const queuedOriginTransactions = origins.get(origin); - // Note: we need to lock on this async request to ensure we always process - // incoming requests in the order they were received! It is possible for - // the file IO performed by `accounts.get` to vary. - let transactorPromise = this.#accountPromises.get(origin); - transactorPromise && await transactorPromise; + // We await the `transactorNoncePromise` async request to ensure we process + // transactions in FIFO order *by account*. We look up accounts because + // ganache fills in missing nonces automatically, and we need to do it in + // order. + // The trick here is that we might actually get the next nonce from the + // account's pending executable transactions, not the account... + // But another transaction might currently be getting the nonce from the + // account, if it is, we need to wait for it to be done doing that. Hence: + let transactorNoncePromise = this.#accountPromises.get(origin); + if (transactorNoncePromise) { + await transactorNoncePromise; + } // we should _probably_ cache `highestNonce`, but it's actually a really hard thing to cache as the current highest // nonce might be invalidated (like if the sender doesn't have enough funds), so we'd have to go back to the previous @@ -135,16 +141,18 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { highestNonce = transactionNonce; } } else { - if (!transactorPromise) { - transactorPromise = this.#blockchain.accounts.get(from) - this.#accountPromises.set(origin, transactorPromise); - transactorPromise.then(() => { + // since we don't have any executable transactions at the moment, we need + // to find our nonce from the account itself... + if (!transactorNoncePromise) { + transactorNoncePromise = this.#blockchain.accounts.getNonce(from); + this.#accountPromises.set(origin, transactorNoncePromise); + transactorNoncePromise.then(() => { this.#accountPromises.delete(origin); }); } - const transactor = await transactorPromise; + const transactor = await transactorNoncePromise; - const transactorNonce = transactor.nonce.toBigInt() || 0n; + const transactorNonce = transactor ? transactor.toBigInt() : 0n; if (secretKey && transactionNonce === void 0) { // if we don't have a transactionNonce, just use the account's next // nonce and mark as executable @@ -171,26 +179,38 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { if (executableOriginTransactions) { executableOriginTransactions.push(transaction); } else { - // if we don't yet have a executables queue for this origin make one now + // if we don't yet have an executables queue for this origin make one now executableOriginTransactions = utils.Heap.from(transaction, byNonce); executables.set(origin, executableOriginTransactions); } - this.#drainQueued(origin, queuedOriginTransactions, executableOriginTransactions, transactionNonce); - return true; + return { + origin, + queuedOriginTransactions, + executableOriginTransactions, + transactionNonce + }; } else { // otherwise, put it in the future queue if (queuedOriginTransactions) { queuedOriginTransactions.push(transaction); } else { - queuedOriginTransactions = utils.Heap.from(transaction, byNonce); - origins.set(origin, queuedOriginTransactions); + origins.set(origin, utils.Heap.from(transaction, byNonce)); } - return false; + + return null; } } + public clear(){ + this.#origins.clear(); + this.#accountPromises.clear(); + this.executables.clear(); + } + /** + * TODO(perf): this looks super slow, doesn't it? + * * Returns the transaction matching the given hash * @param transactionHash */ @@ -214,12 +234,17 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { return null; } - #drainQueued = ( + readonly drainQueued = ({ + origin, + queuedOriginTransactions, + executableOriginTransactions, + transactionNonce + }: { origin: string, queuedOriginTransactions: utils.Heap, executableOriginTransactions: utils.Heap, transactionNonce: bigint - ) => { + }) => { // Now we need to drain any queued transacions that were previously // not executable due to nonce gaps into the origin's queue... if (queuedOriginTransactions) { @@ -253,7 +278,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { this.emit("drain"); }; - validateTransaction = (transaction: Transaction): Error => { + readonly #validateTransaction = (transaction: Transaction): Error => { // Check the transaction doesn't exceed the current block limit gas. if (Quantity.from(transaction.gasLimit) > this.#options.blockGasLimit) { return new CodedError(GAS_LIMIT, ErrorCodes.INVALID_INPUT); diff --git a/src/chains/ethereum/src/types/snapshots.ts b/src/chains/ethereum/src/types/snapshots.ts new file mode 100644 index 0000000000..cf9c030786 --- /dev/null +++ b/src/chains/ethereum/src/types/snapshots.ts @@ -0,0 +1,24 @@ +import Emittery from "emittery"; +import {Block} from "../data-managers/block-manager"; + +type SinglyLinkedList = {current: T, next: SinglyLinkedList}; + +export type Snapshot = { + block: Block, + timeAdjustment: number +}; + +export type Snapshots = { + readonly snaps: Snapshot[]; + + /** + * This is a rudimentary Singly Linked List Node. SLL implementation is up to + * you. + */ + blocks: SinglyLinkedList; + + /** + * Function that should be used to remove the "block" listener + */ + unsubscribeFromBlocks: Emittery.UnsubscribeFn | null; +} From b0a0f6019d1938b9e90e0bd18b03b3dae53ea9f4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 17:54:54 -0400 Subject: [PATCH 559/691] update emittery to 0.7.2 --- npm-shrinkwrap.json | 6 +++--- package.json | 2 +- src/packages/utils/src/things/promievent.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 595550a2e8..ecc1a8f021 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4555,9 +4555,9 @@ } }, "emittery": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.1.tgz", - "integrity": "sha512-d34LN4L6h18Bzz9xpoku2nPwKxCPlPMr3EEKTkoEBi+1/+b0lcRkRJ1UVyyZaKNeqGR3swcGl6s390DNO4YVgQ==" + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", + "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==" }, "emoji-regex": { "version": "7.0.3", diff --git a/package.json b/package.json index 4d88b0c9a2..ee81a17d9e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "bip39": "3.0.2", - "emittery": "0.7.1", + "emittery": "0.7.2", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.2", "ethereumjs-common": "1.5.1", diff --git a/src/packages/utils/src/things/promievent.ts b/src/packages/utils/src/things/promievent.ts index 5ea71bfb9b..df1bf0e7ef 100644 --- a/src/packages/utils/src/things/promievent.ts +++ b/src/packages/utils/src/things/promievent.ts @@ -26,7 +26,7 @@ declare var Promise: { const emitteryMethods = ["clearListeners", "once", "on", "emit", "onAny"] as const; -@Emittery.mixin(Symbol.for("emittery") as any, emitteryMethods) +@Emittery.mixin(Symbol.for("emittery"), emitteryMethods) class PromiEvent extends Promise { constructor (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) { super(executor); From 1f9fb4a1e29fed3a5357980a243656d0b03e0499 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 22 Oct 2020 17:55:15 -0400 Subject: [PATCH 560/691] fix bad import --- src/chains/ethereum/src/data-managers/account-manager.ts | 5 +++-- src/chains/ethereum/src/things/account.ts | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/data-managers/account-manager.ts b/src/chains/ethereum/src/data-managers/account-manager.ts index 806cb072a4..2ae8502627 100644 --- a/src/chains/ethereum/src/data-managers/account-manager.ts +++ b/src/chains/ethereum/src/data-managers/account-manager.ts @@ -5,8 +5,9 @@ import Blockchain from "../blockchain"; import Tag from "../things/tags"; import {LevelUp} from "levelup"; import { rlp } from "ethereumjs-util"; -import { Quantity } from "@ganache/utils"; -import { RPCQUANTITY_ZERO } from "@ganache/utils/lib/utils"; +import { utils, Quantity } from "@ganache/utils"; + +const RPCQUANTITY_ZERO = utils.RPCQUANTITY_ZERO; export default class AccountManager { #blockchain: Blockchain; diff --git a/src/chains/ethereum/src/things/account.ts b/src/chains/ethereum/src/things/account.ts index 5bcec2c505..a4bfe75203 100644 --- a/src/chains/ethereum/src/things/account.ts +++ b/src/chains/ethereum/src/things/account.ts @@ -1,7 +1,9 @@ import {Data, Quantity} from "@ganache/utils"; import Address from "./address"; import {rlp, KECCAK256_RLP, KECCAK256_NULL} from "ethereumjs-util"; -import { RPCQUANTITY_ZERO } from "@ganache/utils/lib/utils"; +import { utils } from "@ganache/utils"; + +const RPCQUANTITY_ZERO = utils.RPCQUANTITY_ZERO; export default class Account { public address: Address; From bd1235c47568d6295bb215896b21f543592b1843 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 11:14:36 -0400 Subject: [PATCH 561/691] fix bad import --- src/chains/ethereum/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index e65895c701..0b0c59a0c5 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -3,7 +3,7 @@ import EthereumApi from "./api"; import {JsonRpcTypes, types, utils} from "@ganache/utils"; import EthereumProvider from "./provider"; import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; -import CodedError, { ErrorCodes } from "./things/coded-error"; +import CodedError, { ErrorCodes } from "./errors/coded-error"; import { EthereumProviderOptions } from "./options"; function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest { From 4a11e62e424c94f84266a14da0a1f519789e5760 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 12:35:12 -0400 Subject: [PATCH 562/691] fix create and update deps --- npm-shrinkwrap.json | 784 +++++++++--------- package.json | 43 +- scripts/create.ts | 13 +- .../__tests__/api/eth/contracts/GetCode.sol | 3 +- .../api/eth/contracts/GetStorageAt.sol | 3 +- .../__tests__/api/eth/contracts/Logs.sol | 5 +- .../__tests__/api/eth/contracts/Reverts.sol | 3 +- .../ethereum/__tests__/api/evm/snapshot.sol | 3 +- .../__tests__/contracts/HelloWorld.sol | 5 +- src/chains/ethereum/npm-shrinkwrap.json | 251 ++++++ 10 files changed, 698 insertions(+), 415 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ecc1a8f021..d26f4a9fd9 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2507,9 +2507,9 @@ } }, "@types/cookiejar": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.1.tgz", - "integrity": "sha512-aRnpPa7ysx3aNW60hTiCtLHlQaIFsXFCgQlpakNgDNVFzbtusSY8PwjAQgRWfSk0ekNoBjO51eQRB6upA9uuyw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", "dev": true }, "@types/events": { @@ -2519,9 +2519,9 @@ "dev": true }, "@types/fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.1.tgz", - "integrity": "sha512-B42Sxuaz09MhC3DDeW5kubRcQ5by4iuVQ0cRRWM2lggLzAa/KVom0Aft/208NgMvNQQZ86s5rVcqDdn/SH0/mg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.2.tgz", + "integrity": "sha512-jp0RI6xfZpi5JL8v7WQwpBEQTq63RqW2kxwTZt+m27LcJqQdPVU1yGnT1ZI4EtCDynQQJtIGyQahkiCGCS7e+A==", "dev": true, "requires": { "@types/node": "*" @@ -2565,15 +2565,15 @@ "dev": true }, "@types/mocha": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", - "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.0.3.tgz", + "integrity": "sha512-vyxR57nv8NfcU0GZu8EUXZLTbCMupIUwy95LJ6lllN+JRPG25CwMHoB1q5xKh8YKhQnHYRAn4yW2yuHbf/5xgg==", "dev": true }, "@types/node": { - "version": "14.0.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.14.tgz", - "integrity": "sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ==", + "version": "14.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.2.tgz", + "integrity": "sha512-jeYJU2kl7hL9U5xuI/BhKPZ4vqGM/OmK6whiFAXVhlstzZhVamWhDSmHyGLIp+RVyuF9/d0dqr2P85aFj4BvJg==", "dev": true }, "@types/normalize-package-data": { @@ -2604,9 +2604,9 @@ } }, "@types/prettier": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.1.tgz", - "integrity": "sha512-boy4xPNEtiw6N3abRhBi/e7hNvy3Tt8E9ZRAQrwAGzoCGZS/1wjo9KY7JHhnfnEsG5wSjDbymCozUM9a3ea7OQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz", + "integrity": "sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==", "dev": true }, "@types/secp256k1": { @@ -2631,9 +2631,9 @@ "dev": true }, "@types/superagent": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.8.tgz", - "integrity": "sha512-iol9KxQ7SLHatBJUiZ4uABrS4VS1frLjqPednxZz82eoCzo3Uy3TOH0p0ZIBbfBj8E/xqOtvizjBs9h7xi/l2g==", + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.10.tgz", + "integrity": "sha512-xAgkb2CMWUMCyVc/3+7iQfOEBE75NvuZeezvmixbUw3nmENf2tCnQkW5yQLTYqvXUQ+R6EXxdqKKbal2zM5V/g==", "dev": true, "requires": { "@types/cookiejar": "*", @@ -2651,18 +2651,18 @@ } }, "@types/ws": { - "version": "7.2.6", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.6.tgz", - "integrity": "sha512-Q07IrQUSNpr+cXU4E4LtkSIBPie5GLZyyMC1QtQYRLWz701+XcoVygGUZgvLqElq1nU4ICldMYPnexlBsg3dqQ==", + "version": "7.2.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.7.tgz", + "integrity": "sha512-UUFC/xxqFLP17hTva8/lVT0SybLUrfSD9c+iapKb0fEiC8uoDbA+xuZ3pAN603eW+bY8ebSMLm9jXdIPnD0ZgA==", "dev": true, "requires": { "@types/node": "*" } }, "@types/yargs": { - "version": "15.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.5.tgz", - "integrity": "sha512-Dk/IDOPtOgubt/IaevIUbTgV7doaKkoorvOyYM2CMwuDyP89bekI7H4xLIwunNYiK9jhCkmc6pUrJk3cj2AB9w==", + "version": "15.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.9.tgz", + "integrity": "sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -2674,6 +2674,12 @@ "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", "dev": true }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, "@zkochan/cmd-shim": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", @@ -2940,18 +2946,6 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, - "array.prototype.map": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", - "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "es-array-method-boxes-properly": "^1.0.0", - "is-string": "^1.0.4" - } - }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -3430,9 +3424,9 @@ "dev": true }, "camelcase": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", - "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz", + "integrity": "sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==", "dev": true }, "camelcase-keys": { @@ -3511,9 +3505,9 @@ } }, "chokidar": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", - "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", + "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", "dev": true, "requires": { "anymatch": "~3.1.1", @@ -3523,7 +3517,7 @@ "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.3.0" + "readdirp": "~3.5.0" }, "dependencies": { "braces": { @@ -3620,6 +3614,185 @@ "restore-cursor": "^2.0.0" } }, + "cli-highlight": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.4.tgz", + "integrity": "sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "highlight.js": "^9.6.0", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^5.1.1", + "yargs": "^15.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "cli-width": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", @@ -4686,35 +4859,6 @@ } } }, - "es-array-method-boxes-properly": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", - "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", - "dev": true - }, - "es-get-iterator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", - "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", - "dev": true, - "requires": { - "es-abstract": "^1.17.4", - "has-symbols": "^1.0.1", - "is-arguments": "^1.0.4", - "is-map": "^2.0.1", - "is-set": "^2.0.1", - "is-string": "^1.0.5", - "isarray": "^2.0.5" - }, - "dependencies": { - "isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - } - } - }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -4895,9 +5039,9 @@ } }, "ethereumjs-common": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", - "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", + "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==" }, "ethereumjs-tx": { "version": "2.1.2", @@ -4925,17 +5069,16 @@ } }, "ethereumjs-util": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.2.tgz", - "integrity": "sha512-ATAP02eJLpAlWGfiKQddNrRfZpwXiTFhRN2EM/yLXMCdBW/xjKYblNKcx8GLzzrjXg0ymotck+lam1nuV90arQ==", + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz", + "integrity": "sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==", "requires": { "@types/bn.js": "^4.11.3", "bn.js": "^5.1.2", "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", "ethjs-util": "0.1.6", - "keccak": "^3.0.0", - "rlp": "^2.2.4", - "secp256k1": "^4.0.1" + "rlp": "^2.2.4" }, "dependencies": { "bn.js": { @@ -5449,21 +5592,10 @@ } }, "flat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", - "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", - "dev": true, - "requires": { - "is-buffer": "~2.0.3" - }, - "dependencies": { - "is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", - "dev": true - } - } + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true }, "flow-stoplight": { "version": "1.0.0", @@ -5518,6 +5650,12 @@ } } }, + "follow-redirects": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", + "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", + "dev": true + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -6434,6 +6572,12 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, + "highlight.js": { + "version": "9.18.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.3.tgz", + "integrity": "sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ==", + "dev": true + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -6746,9 +6890,9 @@ } }, "into-stream": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-5.1.1.tgz", - "integrity": "sha512-krrAJ7McQxGGmvaYbB7Q1mcA+cRwg9Ij2RfWIeVesNBgVDZmzY/Fa4IpZUT3bmdRzMzdf/mzltCG2Dq99IZGBA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz", + "integrity": "sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==", "dev": true, "requires": { "from2": "^2.3.0", @@ -6791,12 +6935,6 @@ } } }, - "is-arguments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", - "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", - "dev": true - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -6923,12 +7061,6 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, - "is-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", - "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", - "dev": true - }, "is-negated-glob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", @@ -6998,12 +7130,6 @@ "is-unc-path": "^1.0.0" } }, - "is-set": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", - "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", - "dev": true - }, "is-ssh": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz", @@ -7019,12 +7145,6 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, - "is-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", - "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", - "dev": true - }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -7249,22 +7369,6 @@ "istanbul-lib-report": "^3.0.0" } }, - "iterate-iterator": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", - "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==", - "dev": true - }, - "iterate-value": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", - "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", - "dev": true, - "requires": { - "es-get-iterator": "^1.0.2", - "iterate-iterator": "^1.0.1" - } - }, "js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", @@ -7815,40 +7919,12 @@ "dev": true }, "log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", "dev": true, "requires": { - "chalk": "^2.4.2" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "chalk": "^4.0.0" } }, "loud-rejection": { @@ -8384,36 +8460,36 @@ } }, "mocha": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.1.tgz", - "integrity": "sha512-p7FuGlYH8t7gaiodlFreseLxEmxTgvyG9RgPHODFPySNhwUehu8NIb0vdSt3WFckSneswZ0Un5typYcWElk7HQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.2.0.tgz", + "integrity": "sha512-lEWEMq2LMfNJMKeuEwb5UELi+OgFDollXaytR5ggQcHpzG3NP/R7rvixAvF+9/lLsTWhWG+4yD2M70GsM06nxw==", "dev": true, "requires": { + "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.1", - "debug": "3.2.6", + "chokidar": "3.4.3", + "debug": "4.2.0", "diff": "4.0.2", - "escape-string-regexp": "1.0.5", - "find-up": "4.1.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", "glob": "7.1.6", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", + "js-yaml": "3.14.0", + "log-symbols": "4.0.0", "minimatch": "3.0.4", "ms": "2.1.2", - "object.assign": "4.1.0", - "promise.allsettled": "1.0.2", - "serialize-javascript": "4.0.0", - "strip-json-comments": "3.0.1", - "supports-color": "7.1.0", + "nanoid": "3.1.12", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "7.2.0", "which": "2.0.2", "wide-align": "1.1.3", - "workerpool": "6.0.0", + "workerpool": "6.0.2", "yargs": "13.3.2", "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.1" + "yargs-unparser": "2.0.0" }, "dependencies": { "ansi-regex": { @@ -8429,80 +8505,61 @@ "dev": true }, "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" } }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "p-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "p-try": "^2.0.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" } }, "path-exists": { @@ -8531,15 +8588,6 @@ "ansi-regex": "^4.1.0" } }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, "yargs": { "version": "13.3.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", @@ -8577,6 +8625,15 @@ "path-exists": "^3.0.0" } }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, "p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", @@ -8672,6 +8729,12 @@ "thenify-all": "^1.0.0" } }, + "nanoid": { + "version": "3.1.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.12.tgz", + "integrity": "sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==", + "dev": true + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -8866,20 +8929,20 @@ "dev": true }, "npm-package-arg": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.0.1.tgz", - "integrity": "sha512-/h5Fm6a/exByzFSTm7jAyHbgOqErl9qSNJDQF32Si/ZzgwT2TERVxRxn3Jurw1wflgyVVAxnFR4fRHPM7y1ClQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.0.tgz", + "integrity": "sha512-/ep6QDxBkm9HvOhOg0heitSd7JHA1U7y1qhhlRlteYYAi9Pdb/ZV7FW5aHpkrpM8+P+4p/jjR8zCyKPBMBjSig==", "dev": true, "requires": { - "hosted-git-info": "^3.0.2", + "hosted-git-info": "^3.0.6", "semver": "^7.0.0", "validate-npm-package-name": "^3.0.0" }, "dependencies": { "hosted-git-info": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.5.tgz", - "integrity": "sha512-i4dpK6xj9BIpVOTboXIlKG9+8HMKggcrMX7WA24xZtKwX0TPelq/rbaS5rCKeNX8sJXZJGdSxpnEGtta+wismQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz", + "integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -9559,6 +9622,21 @@ "protocols": "^1.4.0" } }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true + }, + "parse5-htmlparser2-tree-adapter": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz", + "integrity": "sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw==", + "dev": true, + "requires": { + "parse5": "^5.1.1" + } + }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -9672,9 +9750,9 @@ "dev": true }, "prettier": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", - "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", + "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", "dev": true }, "process-nextick-args": { @@ -9707,19 +9785,6 @@ "retry": "^0.10.0" } }, - "promise.allsettled": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", - "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", - "dev": true, - "requires": { - "array.prototype.map": "^1.0.1", - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1", - "function-bind": "^1.1.1", - "iterate-value": "^1.0.0" - } - }, "promzard": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", @@ -9981,12 +10046,12 @@ } }, "readdirp": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", - "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", "dev": true, "requires": { - "picomatch": "^2.0.7" + "picomatch": "^2.2.1" } }, "redent": { @@ -10237,9 +10302,9 @@ "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" }, "secp256k1": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.1.tgz", - "integrity": "sha512-iGRjbGAKfXMqhtdkkuNxsgJQfJO8Oo78Rm7DAvsG3XKngq+nJIOGqrCSXcQqIVsmCj0wFanE5uTKFxV3T9j2wg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", "requires": { "elliptic": "^6.5.2", "node-addon-api": "^2.0.0", @@ -10262,9 +10327,9 @@ "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -10515,13 +10580,14 @@ } }, "solc": { - "version": "0.6.10", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.10.tgz", - "integrity": "sha512-+oHwIvNjg3bxXvL9yua/Z4ZFEdkCkgRSh7aIGGb+mf/gzoA8PRKiKGYDsjMaj0CJLH1BTBOUpNFeYhhnUFfjRg==", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.4.tgz", + "integrity": "sha512-IVLqAfUkJqgTS0JIgFPeC50ehUeBXu2eE+iU+rqb6UeOyf6w/BB/EsNcTSTpjtUti8BTG/sCd2qVhrWVYy7p0g==", "dev": true, "requires": { "command-exists": "^1.2.8", "commander": "3.0.2", + "follow-redirects": "^1.12.1", "fs-extra": "^0.30.0", "js-sha3": "0.8.0", "memorystream": "^0.3.1", @@ -10865,9 +10931,9 @@ } }, "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "strong-log-transformer": { @@ -10986,9 +11052,9 @@ } }, "superagent": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-5.2.2.tgz", - "integrity": "sha512-pMWBUnIllK4ZTw7p/UaobiQPwAO5w/1NRRTDpV0FTVNmECztsxKspj3ZWEordVEaqpZtmOQJJna4yTLyC/q7PQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", + "integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==", "dev": true, "requires": { "component-emitter": "^1.3.0", @@ -10996,12 +11062,12 @@ "debug": "^4.1.1", "fast-safe-stringify": "^2.0.7", "form-data": "^3.0.0", - "formidable": "^1.2.1", + "formidable": "^1.2.2", "methods": "^1.1.2", - "mime": "^2.4.4", - "qs": "^6.9.1", - "readable-stream": "^3.4.0", - "semver": "^6.3.0" + "mime": "^2.4.6", + "qs": "^6.9.4", + "readable-stream": "^3.6.0", + "semver": "^7.3.2" }, "dependencies": { "debug": { @@ -11031,9 +11097,9 @@ "dev": true }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true } } @@ -11281,20 +11347,20 @@ "dev": true }, "ts-morph": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.1.2.tgz", - "integrity": "sha512-0ggF46muGv3v09Yf8Ce5ykTLiQ8I6hGvdB5ID/3+K4J11nCHo/vTaucqTvdFprJzQALpwQx+9bKi31mTxO0+tw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.3.0.tgz", + "integrity": "sha512-BUKSoz7AFSKPcYTZODbICW2mOthAN4vc5juD6FL1lD/dLwZ0WvrC3zqBM3/X6f5gHxq3yaz+HmanHGaWm0ddbQ==", "dev": true, "requires": { "@dsherret/to-absolute-glob": "^2.0.2", - "@ts-morph/common": "~0.5.1", + "@ts-morph/common": "~0.5.2", "code-block-writer": "^10.1.0" } }, "ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", + "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", "dev": true, "requires": { "arg": "^4.1.0", @@ -11643,9 +11709,9 @@ "dev": true }, "workerpool": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", - "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.2.tgz", + "integrity": "sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q==", "dev": true }, "wrap-ansi": { @@ -11774,9 +11840,9 @@ } }, "ws": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz", - "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", + "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", "dev": true }, "xtend": { @@ -11799,18 +11865,18 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "yargs": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.0.3.tgz", - "integrity": "sha512-6+nLw8xa9uK1BOEOykaiYAJVh6/CjxWXK/q9b5FpRgNslt8s22F2xMBqVIKgCRjNgGvGPBy8Vog7WN7yh4amtA==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.1.0.tgz", + "integrity": "sha512-upWFJOmDdHN0syLuESuvXDmrRcWd1QafJolHskzaw79uZa7/x53gxQKiR07W59GWY1tFhhU/Th9DrtSfpS782g==", "dev": true, "requires": { - "cliui": "^7.0.0", - "escalade": "^3.0.2", + "cliui": "^7.0.2", + "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", - "y18n": "^5.0.1", - "yargs-parser": "^20.0.0" + "y18n": "^5.0.2", + "yargs-parser": "^20.2.2" }, "dependencies": { "ansi-regex": { @@ -11829,9 +11895,9 @@ } }, "cliui": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.2.tgz", - "integrity": "sha512-lhpKkuUj67j5JgZIPZxLe7nSa4MQoojzRVWQyzMqBp2hBg6gwRjUDAwC1YDeBaC3APDBKNnjWbv2mlDF4XgOSA==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.3.tgz", + "integrity": "sha512-Gj3QHTkVMPKqwP3f7B4KPkBZRMR9r4rfi5bXFpg1a+Svvj8l7q5CnkBkVQzfxT5DFSsGk2+PascOgL0JYkL2kw==", "dev": true, "requires": { "string-width": "^4.2.0", @@ -11898,15 +11964,15 @@ } }, "y18n": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.2.tgz", - "integrity": "sha512-CkwaeZw6dQgqgPGeTWKMXCRmMcBgETFlTml1+ZOO+q7kGst8NREJ+eWwFNPVUQ4QGdAaklbqCZHH6Zuep1RjiA==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.4.tgz", + "integrity": "sha512-deLOfD+RvFgrpAmSZgfGdWYE+OKyHcVHaRQ7NphG/63scpRvTHHeQMAxGGvaLVGJ+HYVcCXlzcTK0ZehFf+eHQ==", "dev": true }, "yargs-parser": { - "version": "20.2.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.2.tgz", - "integrity": "sha512-XmrpXaTl6noDsf1dKpBuUNCOHqjs0g3jRMXf/ztRxdOmb+er8kE5z5b55Lz3p5u2T8KJ59ENBnASS8/iapVJ5g==", + "version": "20.2.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.3.tgz", + "integrity": "sha512-emOFRT9WVHw03QSvN5qor9QQT9+sw5vwxfYweivSMHTcAXPefwVae2FjO7JJjj8hCE4CzPOPeFM83VwT29HCww==", "dev": true } } @@ -11930,74 +11996,28 @@ } }, "yargs-unparser": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.1.tgz", - "integrity": "sha512-qZV14lK9MWsGCmcr7u5oXGH0dbGqZAIxTDrWXZDo5zUr6b6iUmelNKO6x6R1dQT24AH3LgRxJpr8meWy2unolA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "requires": { - "camelcase": "^5.3.1", - "decamelize": "^1.2.0", - "flat": "^4.1.0", - "is-plain-obj": "^1.1.0", - "yargs": "^14.2.3" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "yargs": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", - "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^15.0.1" - } } } }, diff --git a/package.json b/package.json index ee81a17d9e..5c444f75c2 100644 --- a/package.json +++ b/package.json @@ -20,14 +20,14 @@ "emittery": "0.7.2", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.2", - "ethereumjs-common": "1.5.1", + "ethereumjs-common": "1.5.2", "ethereumjs-tx": "2.1.2", - "ethereumjs-util": "7.0.2", + "ethereumjs-util": "7.0.7", "ethereumjs-vm": "4.2.0", "hdkey": "2.0.1", "leveldown": "5.6.0", "lodash.clonedeep": "4.5.0", - "secp256k1": "4.0.1", + "secp256k1": "4.0.2", "seedrandom": "3.0.5", "subleveldown": "5.0.1", "tmp-promise": "3.0.2", @@ -35,36 +35,37 @@ }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "1.0.1", - "@types/fs-extra": "9.0.1", + "@types/fs-extra": "9.0.2", "@types/lodash.clonedeep": "4.5.6", - "@types/mocha": "7.0.2", - "@types/node": "14.0.14", + "@types/mocha": "8.0.3", + "@types/node": "14.14.2", "@types/npm-package-arg": "6.1.0", - "@types/prettier": "2.0.1", + "@types/prettier": "2.1.5", "@types/secp256k1": "4.0.1", "@types/seedrandom": "2.4.28", - "@types/superagent": "4.1.8", + "@types/superagent": "4.1.10", "@types/uws": "0.13.2", - "@types/ws": "7.2.6", - "@types/yargs": "15.0.5", - "camelcase": "6.0.0", + "@types/ws": "7.2.7", + "@types/yargs": "15.0.9", + "camelcase": "6.1.0", "chalk": "4.1.0", + "cli-highlight": "2.1.4", "cross-env": "7.0.2", "fs-extra": "9.0.1", - "into-stream": "5.1.1", + "into-stream": "6.0.0", "lerna": "3.22.1", - "mocha": "8.1.1", - "npm-package-arg": "8.0.1", + "mocha": "8.2.0", + "npm-package-arg": "8.1.0", "nyc": "15.1.0", - "prettier": "2.0.5", - "solc": "0.6.10", - "superagent": "5.2.2", - "ts-morph": "7.1.2", - "ts-node": "8.10.2", + "prettier": "2.1.2", + "solc": "0.7.4", + "superagent": "6.1.0", + "ts-morph": "7.3.0", + "ts-node": "9.0.0", "typescript": "4.1.0-beta", "utf-8-validate": "5.0.2", - "ws": "7.3.0", - "yargs": "16.0.3" + "ws": "7.3.1", + "yargs": "16.1.0" }, "optionalDependencies": { "bigint-buffer": "1.1.5" diff --git a/scripts/create.ts b/scripts/create.ts index ccdad699b0..74f03ddae4 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -7,6 +7,7 @@ import camelCase from "camelcase"; import npa from "npm-package-arg"; import { lstatSync as lstat, readdirSync as readDir } from "fs"; import chalk from "chalk"; +import { highlight } from "cli-highlight"; const isDir = (s: string) => lstat(s).isDirectory(); const getDirectories = (s: string) => readDir(s).filter(n => isDir(join(s, n))); @@ -17,7 +18,7 @@ const COLORS = { FgRed: "\x1b[31m" }; -const scopes = getDirectories(join(__dirname, "../../src")); +const scopes = getDirectories(join(__dirname, "../src")); const argv = yargs .command(`$0 --location`, `Create a new package in the given location with the provided name.`, (yargs) => { return yargs @@ -132,7 +133,7 @@ describe("${packageName}", () => { export * from "./src/index"; `; - const dir = join(__dirname, "../../src", location, name); + const dir = join(__dirname, "../src", location, name); const tests = join(dir, "__tests__"); const src = join(dir, "src"); @@ -178,7 +179,13 @@ export * from "./src/index"; writeFile(join(dir, "npm-shrinkwrap.json"), JSON.stringify(shrinkwrap) + "\n") ]); - console.log(pkgStr); + console.log(highlight(pkgStr, { + language: "json", + theme: { + attr: chalk.hex("#3FE0C5"), + string: chalk.hex("#e4a663") + } + })); console.log( chalk`{green success} {magenta create} New package {bgBlack ${name} } created. New package created at ./src/packages/${name}.\n\n Entry point: {bold ${dir}/src/index.ts}` diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol b/src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol index b804e1dfab..49edc1c3cb 100644 --- a/src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol +++ b/src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol @@ -1,3 +1,4 @@ -pragma solidity ^0.6.1; +// SPDX-License-Identifier: MIT +pragma solidity ^0.7.4; contract GetCode {} diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol b/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol index 1d500fb70f..abe0bd50a8 100644 --- a/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol +++ b/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol @@ -1,4 +1,5 @@ -pragma solidity ^0.6.1; +// SPDX-License-Identifier: MIT +pragma solidity ^0.7.4; contract GetStorageAt { uint256 public intValue1 = 123; diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol b/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol index 47e9a69da7..1bdb8c4676 100644 --- a/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol +++ b/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol @@ -1,8 +1,9 @@ -pragma solidity ^0.6.1; +// SPDX-License-Identifier: MIT +pragma solidity ^0.7.4; contract Logs { event Event(uint indexed first, uint indexed second); - constructor() public { + constructor() { emit Event(1, 2); } diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol b/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol index d4d0d47a69..d5008e50b4 100644 --- a/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol +++ b/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol @@ -1,6 +1,5 @@ // SPDX-License-Identifier: MIT - -pragma solidity ^0.6.1; +pragma solidity ^0.7.4; contract Reverts { diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.sol b/src/chains/ethereum/__tests__/api/evm/snapshot.sol index e5383ace5f..0124d11e09 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.sol +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.sol @@ -1,4 +1,5 @@ -pragma solidity ^0.6.1; +// SPDX-License-Identifier: MIT +pragma solidity ^0.7.4; contract snapshot { uint public n = 42; diff --git a/src/chains/ethereum/__tests__/contracts/HelloWorld.sol b/src/chains/ethereum/__tests__/contracts/HelloWorld.sol index c6fd50bc2f..f0bbafad69 100644 --- a/src/chains/ethereum/__tests__/contracts/HelloWorld.sol +++ b/src/chains/ethereum/__tests__/contracts/HelloWorld.sol @@ -1,11 +1,12 @@ -pragma solidity ^0.6.1; +// SPDX-License-Identifier: MIT +pragma solidity ^0.7.4; contract HelloWorld { uint public value; event ValueSet(uint); - constructor() public payable { + constructor() payable { value = 5; } diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 8853170ebd..28ee30cfba 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -188,6 +188,12 @@ "array-back": "^4.0.0" } }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -455,6 +461,94 @@ "safe-buffer": "^5.0.1" } }, + "cli-highlight": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.4.tgz", + "integrity": "sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "highlight.js": "^9.6.0", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^5.1.1", + "yargs": "^15.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "highlight.js": { + "version": "9.18.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.3.tgz", + "integrity": "sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ==", + "dev": true + }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -812,6 +906,12 @@ "minimalistic-crypto-utils": "^1.0.0" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -1519,6 +1619,12 @@ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, "get-stdin": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", @@ -1813,6 +1919,12 @@ "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", "dev": true }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, "is-generator-function": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", @@ -1884,6 +1996,16 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, + "json-colorizer": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/json-colorizer/-/json-colorizer-2.2.2.tgz", + "integrity": "sha512-56oZtwV1piXrQnRNTtJeqRv+B9Y/dXAYLqBBaYl/COcUdoZxgLBLAO88+CnkbT6MxNs0c5E9mPBIb2sFcNz3vw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "lodash.get": "^4.4.2" + } + }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -2484,6 +2606,12 @@ "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", "dev": true }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, "lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", @@ -3158,6 +3286,23 @@ "@types/node": "*" } }, + "parse5-htmlparser2-tree-adapter": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz", + "integrity": "sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw==", + "dev": true, + "requires": { + "parse5": "^5.1.1" + }, + "dependencies": { + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true + } + } + }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -3355,6 +3500,18 @@ "integrity": "sha512-eczl8wAYBxJ6Egl6I1ECIF+8z6sHu+KE7BzaEDZTpPXKXfy9SUDQlVYwkRcNTjJLC3Iakxbhss50KuT/R6SYfg==", "dev": true }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -3508,6 +3665,12 @@ } } }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -3658,6 +3821,17 @@ } } }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, "string.prototype.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", @@ -3684,6 +3858,15 @@ "safe-buffer": "~5.2.0" } }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", @@ -3949,6 +4132,12 @@ "integrity": "sha512-kudCA8PXVQfrqv2mFTG72vDBRi8BKWxGgFLwPpzHcpZnSwZk93WMwUDVcLHWNsnm+Y0AC4Vb6MUNRgaHfyV2DQ==", "dev": true }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -3979,6 +4168,43 @@ } } }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -3993,11 +4219,36 @@ "object-keys": "~0.4.0" } }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, "yargs-parser": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", From 337e581261e407cf284c1040605e3c15ba88d490 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 12:44:09 -0400 Subject: [PATCH 563/691] more revert fixes, make promise queue its own package --- src/chains/ethereum/npm-shrinkwrap.json | 251 ------------------ src/chains/ethereum/package.json | 1 + src/chains/ethereum/src/blockchain.ts | 18 +- .../src/data-managers/transaction-manager.ts | 20 +- src/chains/ethereum/src/miner.ts | 26 +- src/chains/ethereum/src/transaction-pool.ts | 77 +++--- src/packages/promise-queue/.npmignore | 1 + src/packages/promise-queue/README.md | 3 + .../promise-queue/__tests__/index.test.ts | 6 + src/packages/promise-queue/index.ts | 5 + src/packages/promise-queue/package.json | 27 ++ src/packages/promise-queue/src/entry.ts | 25 ++ src/packages/promise-queue/src/index.ts | 106 ++++++++ src/packages/promise-queue/tsconfig.json | 9 + src/packages/utils/src/utils/index.ts | 1 - src/packages/utils/src/utils/promise-queue.ts | 96 ------- 16 files changed, 261 insertions(+), 411 deletions(-) create mode 100644 src/packages/promise-queue/.npmignore create mode 100644 src/packages/promise-queue/README.md create mode 100644 src/packages/promise-queue/__tests__/index.test.ts create mode 100644 src/packages/promise-queue/index.ts create mode 100644 src/packages/promise-queue/package.json create mode 100644 src/packages/promise-queue/src/entry.ts create mode 100644 src/packages/promise-queue/src/index.ts create mode 100644 src/packages/promise-queue/tsconfig.json delete mode 100644 src/packages/utils/src/utils/promise-queue.ts diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 28ee30cfba..8853170ebd 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -188,12 +188,6 @@ "array-back": "^4.0.0" } }, - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -461,94 +455,6 @@ "safe-buffer": "^5.0.1" } }, - "cli-highlight": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.4.tgz", - "integrity": "sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "highlight.js": "^9.6.0", - "mz": "^2.4.0", - "parse5": "^5.1.1", - "parse5-htmlparser2-tree-adapter": "^5.1.1", - "yargs": "^15.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "highlight.js": { - "version": "9.18.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.3.tgz", - "integrity": "sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ==", - "dev": true - }, - "parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -906,12 +812,6 @@ "minimalistic-crypto-utils": "^1.0.0" } }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -1619,12 +1519,6 @@ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, "get-stdin": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", @@ -1919,12 +1813,6 @@ "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "is-generator-function": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", @@ -1996,16 +1884,6 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "json-colorizer": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/json-colorizer/-/json-colorizer-2.2.2.tgz", - "integrity": "sha512-56oZtwV1piXrQnRNTtJeqRv+B9Y/dXAYLqBBaYl/COcUdoZxgLBLAO88+CnkbT6MxNs0c5E9mPBIb2sFcNz3vw==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "lodash.get": "^4.4.2" - } - }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -2606,12 +2484,6 @@ "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", "dev": true }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, "lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", @@ -3286,23 +3158,6 @@ "@types/node": "*" } }, - "parse5-htmlparser2-tree-adapter": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz", - "integrity": "sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw==", - "dev": true, - "requires": { - "parse5": "^5.1.1" - }, - "dependencies": { - "parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", - "dev": true - } - } - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -3500,18 +3355,6 @@ "integrity": "sha512-eczl8wAYBxJ6Egl6I1ECIF+8z6sHu+KE7BzaEDZTpPXKXfy9SUDQlVYwkRcNTjJLC3Iakxbhss50KuT/R6SYfg==", "dev": true }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -3665,12 +3508,6 @@ } } }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -3821,17 +3658,6 @@ } } }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, "string.prototype.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", @@ -3858,15 +3684,6 @@ "safe-buffer": "~5.2.0" } }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", @@ -4132,12 +3949,6 @@ "integrity": "sha512-kudCA8PXVQfrqv2mFTG72vDBRi8BKWxGgFLwPpzHcpZnSwZk93WMwUDVcLHWNsnm+Y0AC4Vb6MUNRgaHfyV2DQ==", "dev": true }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -4168,43 +3979,6 @@ } } }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4219,36 +3993,11 @@ "object-keys": "~0.4.0" } }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, "yargs-parser": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 21cfa82b92..ae6a530f91 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -35,6 +35,7 @@ }, "dependencies": { "@ganache/options": "^2.2.1", + "@ganache/promise-queue": "^2.2.1", "@ganache/utils": "^2.2.1", "@types/keccak": "3.0.1", "eth-sig-util": "2.5.3", diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 72fb20c7e6..08a750e585 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -503,15 +503,12 @@ export default class Blockchain extends Emittery.Typed { public transactionPool: TransactionPool; - #queue = new utils.PromiseQueue(); + #queue = new PromiseQueue(); #paused = false; #resumer: Promise; #resolver: (value: void ) => void; @@ -42,7 +43,7 @@ export default class TransactionManager extends Manager { const insertion = this.transactionPool.prepareTransaction(transaction, secretKey); const result = await this.#queue.add(insertion); if (result) { - this.transactionPool.drainQueued(result); + this.transactionPool.drain(); return true; } else { return false; @@ -60,7 +61,7 @@ export default class TransactionManager extends Manager { * mined. */ public clear() { - this.#queue.clear(); + this.#queue.clear(false); this.transactionPool.clear(); } @@ -68,13 +69,20 @@ export default class TransactionManager extends Manager { * Stop processing _new_ transactions; puts new requests in a queue. Has no * affect if already paused. */ - public pause() { - if (!this.#paused) return; + public async pause() { + if (this.#paused) return; + // stop processing new transactions immediately this.#paused = true; this.#resumer = new Promise(resolve => { this.#resolver = resolve; }); + + // then wait until all async things we were already processing are done + // before returning + if (this.#queue.isBusy()) { + await this.#queue.emit("idle"); + } } /** diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 64718ed430..b1a810d81b 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -48,6 +48,9 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { #origins = new Set(); #pending: Map>; #isBusy: boolean = false; + #paused: boolean = false; + #resumer: Promise; + #resolver: (value: void ) => void; readonly #options: EthereumInternalOptions["miner"]; readonly #instamine: boolean; readonly #vm: VM; @@ -56,8 +59,24 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { readonly #revert: () => Promise; readonly #createBlock: (previousBlock: Block) => Block; - readonly isBusy = () => { - return this.#isBusy; + public async pause(){ + if (this.#paused) return; + + this.#paused = true; + this.#resumer = new Promise(resolve => { + this.#resolver = resolve; + }); + + if (this.#isBusy) { + await this.once("idle"); + } + } + + public resume() { + if (!this.#paused) return; + + this.#paused = false; + this.#resolver(); } // create a Heap that sorts by gasPrice @@ -91,6 +110,9 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { * @returns the transactions mined */ public async mine(pending: Map>, block: Block, maxTransactions: number = -1, onlyOneBlock = false) { + if (this.#paused) { + await this.#resumer; + } // only allow mining a single block at a time (per miner) if (this.#isBusy) { // if we are currently mining a block, set the `pending` property diff --git a/src/chains/ethereum/src/transaction-pool.ts b/src/chains/ethereum/src/transaction-pool.ts index 674fab1c7a..cdb7375fbb 100644 --- a/src/chains/ethereum/src/transaction-pool.ts +++ b/src/chains/ethereum/src/transaction-pool.ts @@ -184,12 +184,33 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { executables.set(origin, executableOriginTransactions); } - return { - origin, - queuedOriginTransactions, - executableOriginTransactions, - transactionNonce - }; + // Now we need to drain any queued transacions that were previously + // not executable due to nonce gaps into the origin's queue... + if (queuedOriginTransactions) { + let nextExpectedNonce = transactionNonce + 1n; + while (true) { + const nextTx = queuedOriginTransactions.peek(); + const nextTxNonce = Quantity.from(nextTx.nonce).toBigInt() || 0n; + if (nextTxNonce !== nextExpectedNonce) { + break; + } + + // we've got a an executable nonce! Put it in the executables queue. + executableOriginTransactions.push(nextTx); + + // And then remove this transaction from its origin's queue + if (!queuedOriginTransactions.removeBest()) { + // removeBest() returns `false` when there are no more items after + // the removed item. Let's do some cleanup when that happens. + origins.delete(origin); + break; + } + + nextExpectedNonce += 1n; + } + } + + return true; } else { // otherwise, put it in the future queue if (queuedOriginTransactions) { @@ -198,11 +219,11 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { origins.set(origin, utils.Heap.from(transaction, byNonce)); } - return null; + return false; } } - public clear(){ + public clear() { this.#origins.clear(); this.#accountPromises.clear(); this.executables.clear(); @@ -234,45 +255,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { return null; } - readonly drainQueued = ({ - origin, - queuedOriginTransactions, - executableOriginTransactions, - transactionNonce - }: { - origin: string, - queuedOriginTransactions: utils.Heap, - executableOriginTransactions: utils.Heap, - transactionNonce: bigint - }) => { - // Now we need to drain any queued transacions that were previously - // not executable due to nonce gaps into the origin's queue... - if (queuedOriginTransactions) { - const origins = this.#origins; - - let nextExpectedNonce = transactionNonce + 1n; - while (true) { - const nextTx = queuedOriginTransactions.peek(); - const nextTxNonce = Quantity.from(nextTx.nonce).toBigInt() || 0n; - if (nextTxNonce !== nextExpectedNonce) { - break; - } - - // we've got a an executable nonce! Put it in the executables queue. - executableOriginTransactions.push(nextTx); - - // And then remove this transaction from its origin's queue - if (!queuedOriginTransactions.removeBest()) { - // removeBest() returns `false` when there are no more items after - // the removed item. Let's do some cleanup when that happens. - origins.delete(origin); - break; - } - - nextExpectedNonce += 1n; - } - } - + readonly drain = () => { // notify listeners (the blockchain, then the miner, eventually) that we // have executable transactions ready this.emit("drain"); diff --git a/src/packages/promise-queue/.npmignore b/src/packages/promise-queue/.npmignore new file mode 100644 index 0000000000..a8ca347bfb --- /dev/null +++ b/src/packages/promise-queue/.npmignore @@ -0,0 +1 @@ +./index.ts diff --git a/src/packages/promise-queue/README.md b/src/packages/promise-queue/README.md new file mode 100644 index 0000000000..d86dd5c991 --- /dev/null +++ b/src/packages/promise-queue/README.md @@ -0,0 +1,3 @@ +# @ganache/promise-queue + +> TODO: description diff --git a/src/packages/promise-queue/__tests__/index.test.ts b/src/packages/promise-queue/__tests__/index.test.ts new file mode 100644 index 0000000000..6c41468626 --- /dev/null +++ b/src/packages/promise-queue/__tests__/index.test.ts @@ -0,0 +1,6 @@ +import assert from "assert"; +import promiseQueue from "../src/"; + +describe("@ganache/promise-queue", () => { + it("needs tests"); +}); diff --git a/src/packages/promise-queue/index.ts b/src/packages/promise-queue/index.ts new file mode 100644 index 0000000000..f9c66395b9 --- /dev/null +++ b/src/packages/promise-queue/index.ts @@ -0,0 +1,5 @@ +// ************************************************************************* // +// This file is necessary to "trick" typescript into using our ./src/**/*.ts // +// files when developing, debugging, and running tests // +// ************************************************************************* // +export * from "./src/index"; diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json new file mode 100644 index 0000000000..f482f486cf --- /dev/null +++ b/src/packages/promise-queue/package.json @@ -0,0 +1,27 @@ +{ + "name": "@ganache/promise-queue", + "version": "2.2.1", + "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "license": "MIT", + "main": "src/index.ts", + "typings": "src/index.ts", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/trufflesuite/ganache-core.git" + }, + "scripts": { + "tsc": "ts-node ../../../scripts/compile", + "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + } +} diff --git a/src/packages/promise-queue/src/entry.ts b/src/packages/promise-queue/src/entry.ts new file mode 100644 index 0000000000..cd7a717c7e --- /dev/null +++ b/src/packages/promise-queue/src/entry.ts @@ -0,0 +1,25 @@ +export default class Entry { + public readonly promise: Promise; + public resolve: (value: T | PromiseLike) => void; + + public value: T | Promise; + public queue: Entry[] + + public resolved = false; + public onSetteled: (queue: Entry[], entry: Entry) => void; + + constructor( + promise: Promise, + queue: Entry[], + onSetteled: (queue: Entry[], entry: Entry) => void + ) { + this.value = promise; + this.queue = queue; + this.onSetteled = onSetteled; + const _onSetteled = () => this.onSetteled(this.queue, this) + promise.then(_onSetteled, _onSetteled); + this.promise = new Promise(resolve => { + this.resolve = resolve; + }); + } +} diff --git a/src/packages/promise-queue/src/index.ts b/src/packages/promise-queue/src/index.ts new file mode 100644 index 0000000000..2496c6cfa9 --- /dev/null +++ b/src/packages/promise-queue/src/index.ts @@ -0,0 +1,106 @@ +import Emittery from "emittery"; +import Entry from "./entry"; + +const emitteryMethods = ["emit", "once"] as const; + +/** + * Creates a FIFO queue to that ensures promises are _resolved_ in the order + * they were added. + * + * This is different than a FIFO queue that _executes_ functions that + * return promises; this queue is for the promises themselves. + * + * @example + * const queue = new PromiseQueue(); + * + * const slow = new Promise(resolve => setTimeout(resolve, 1000, "slow")); + * const fast = Promise.resolve("fast"); + * + * await Promise.race([ + * queue.add(slow), + * queue.add(fast) + * ]); // returns "slow" + * + * Additionally, the queued promise chain can be cleared via `queue.clear(value)`. + * This will cause the chain of promises to all resolve immediately with the + * given value. * + * + * * note: whatever the promise starting doing when it was created will still + * happen, no promises are aborted; rather, the return value is ignored. + */ +@Emittery.mixin(Symbol.for("emittery"), emitteryMethods) +class PromiseQueue { + + /** + * Returns true if there are promises pending in the queue + */ + public isBusy(){ + return this.#queue.length !== 0; + } + + // TODO(perf): a singly linked list is probably a better option here + readonly #queue: Entry[] = []; + + #tryResolve = (queue: Entry[], entry: Entry) => { + // if this is now the highest priority entry, resolve the outer + // Promise + if (entry === queue[0]) { + queue.shift(); + entry.resolve(entry.value); + // then try resolving the rest + this.#tryResolveChain(queue); + } else { + entry.resolved = true; + } + } + + /** + * Adds the promise to the end of the queue. + * @param promise + * @returns a promise that resolves with the given promise's result. If the + * queue was `clear`ed before the promise could be shifted off the return + * value will be the `value` passed to `clear`. + */ + add(promise: Promise) { + const queue = this.#queue; + const entry: Entry = new Entry(promise, queue, this.#tryResolve); + queue.push(entry); + return entry.promise; + } + + /** + * Clears all promises from the queue and sets their resolved values to the + * given value. + */ + clear(value: T) { + // remove all entrys from the queue and mark them. + const cancelledQueue = this.#queue.splice(0); + cancelledQueue.forEach(entry => { + entry.queue = cancelledQueue; + entry.value = value; + }); + } + + /** + * Removes all _resolved_ promises from the front of the chain of promises. + */ + #tryResolveChain = (queue: Entry[]) => { + let first = queue[0]; + while (first && first.resolved) { + queue.shift(); + first.resolve(first.value); + first = queue[0]; + } + + // if there is nothing left to do emit `"idle"` + if (queue.length === 0) { + this.emit("idle"); + } + } +} + +interface PromiseQueue extends Pick { + emittery: Emittery +} + +export default PromiseQueue; diff --git a/src/packages/promise-queue/tsconfig.json b/src/packages/promise-queue/tsconfig.json new file mode 100644 index 0000000000..7ae8200b28 --- /dev/null +++ b/src/packages/promise-queue/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": [ + "src" + ] +} diff --git a/src/packages/utils/src/utils/index.ts b/src/packages/utils/src/utils/index.ts index 1edcca1923..e2ab466a84 100644 --- a/src/packages/utils/src/utils/index.ts +++ b/src/packages/utils/src/utils/index.ts @@ -6,4 +6,3 @@ export * from "./unref"; export * from "./has-own"; export * from "./uint-to-buffer"; export * from "./constants"; -export * from "./promise-queue"; diff --git a/src/packages/utils/src/utils/promise-queue.ts b/src/packages/utils/src/utils/promise-queue.ts deleted file mode 100644 index aa63b3a5c1..0000000000 --- a/src/packages/utils/src/utils/promise-queue.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * calls the callback when the promise is resolved or rejected. - * - * This is different than use just `finally` in that we handle promise rejection - * - * @param promise - * @param callback - */ -function settled(promise: Promise, callback: () => void){ - promise.then(callback, callback); -} - -/** - * Creates a FIFO queue to that ensures promises are _resolved_ in the order - * they were added. - * - * This is different than a FIFO queue that _executes_ functions that - * return promises; this queue is for the promises themselves. - * - * @example - * const queue = new PromiseQueue(); - * - * const prom1 = new Promise(resolve => setTimeout(resolve, 1000, "slow")); - * const prom2 = Promise.resolve("fast"); - * - * await Promise.race([ - * queue.add(prom1), - * queue.add(prom2) - * ]); // "slow" - * - * Additionally, the queued promise chain can be cleared via `queue.clear()`. - * This will cause the chain of promises to all resolve immediately with a value - * of `null`. * - * - * * note: whatever the promise starting doing when it was created will still - * happen, no promises are aborted; rather, they are ignored. - */ -export class PromiseQueue { - // TODO(perf): a singly linked list is probably a better option here - readonly #queue: { - value: Promise | null, - resolve: any, - resolved: boolean - }[] = []; - - add(promise: Promise) { - return new Promise(resolve => { - const element = {value: promise, resolve, resolved: false}; - const q = this.#queue; - q.push(element); - settled(promise, () => { - // if this is now the highest priority element, resolve the outer - // Promise then try resolving the rest - if (q[0] === element) { - q.shift(); - - // Note: element.promise might not be the original `promise` here; the - // `clear` method may have changed it! - resolve(element.value); - - this.#tryResolveChain(); - } else { - element.resolved = true; - } - }); - }); - } - - /** - * Clears all promises from the queue and sets their resolved values to `null` - */ - clear() { - let element = this.#queue.shift(); - - // remove all elements from the queue and mark them. - while (element) { - // override the value that gets returned with `null` - element.value = null; - - element = this.#queue.shift(); - } - } - - /** - * Removes all _resolved_ promises from the front of the chain of promises. - */ - #tryResolveChain = () => { - const q = this.#queue; - let first = q[0]; - while (first && first.resolved) { - q.shift(); - first.resolve(first.value); - first = q[0]; - } - } -} From a3836f1f5e92fe0bc86c2abbcd6593d26134fece Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 13:34:16 -0400 Subject: [PATCH 564/691] update evm_increaseTime to allow hex string arg --- src/chains/ethereum/__tests__/api/evm/evm.test.ts | 9 ++++++++- src/chains/ethereum/src/api.ts | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index f2c0a137a6..9b34c80b6f 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -29,12 +29,19 @@ describe("api", () => { }); describe("evm_increaseTime", () => { - it("should return the `timeAdjustment` value via `evm_increaseTime`", async () => { + it("should return the `timeAdjustment` value via `evm_increaseTime` when provided as a number", async () => { const provider = await getProvider(); const seconds = 10; const timeAdjustment = await provider.send("evm_increaseTime", [seconds]); assert.strictEqual(timeAdjustment, seconds); }); + + it("should return the `timeAdjustment` value via `evm_increaseTime` when provided as hex string", async () => { + const provider = await getProvider(); + const seconds = 10; + const timeAdjustment = await provider.send("evm_increaseTime", [`0x${seconds.toString(16)}`]); + assert.strictEqual(timeAdjustment, seconds); + }); }); describe("evm_mine", () => { diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index dd3b2184b8..49388dd800 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -325,8 +325,9 @@ export default class EthereumApi implements types.Api { * @returns Returns the total time adjustment, in seconds. */ @assertArgLength(1) - async evm_increaseTime(seconds: number) { - return Math.floor(this.#blockchain.increaseTime(seconds * 1000) / 1000); + async evm_increaseTime(seconds: number | string) { + const milliseconds = (typeof seconds === "number" ? seconds : Quantity.from(seconds).toNumber()) * 1000; + return Math.floor(this.#blockchain.increaseTime(milliseconds) / 1000); } /** From 3e350a8bbec88ce95ed40bddb5b2adeefffef95f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 13:49:40 -0400 Subject: [PATCH 565/691] `evm_setTime` should also take a hex strings --- .../ethereum/__tests__/api/evm/evm.test.ts | 26 +++++++++++++++++++ src/chains/ethereum/src/api.ts | 16 ++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 9b34c80b6f..2b0adc0589 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -26,6 +26,32 @@ describe("api", () => { const baseLineOffset = Math.floor((newTime - now) / 1000); assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); }); + + it("should set the time correctly when given as a hex string", async () => { + const provider = await getProvider(); + const now = Date.now(); + // fast forward time by 10 seconds (plus 2 seconds in case testing is slow) + const newTime = now + 10000 + 2000; + + const timeAdjustment = await provider.send("evm_setTime", [`0x${newTime.toString(16)}`]); + + // it should return `newTime - now`, floored to the nearest second + const baseLineOffset = Math.floor((newTime - now) / 1000); + assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); + }); + + it("should set the time correctly when given as a Date", async () => { + const provider = await getProvider(); + const now = Date.now(); + // fast forward time by 10 seconds (plus 2 seconds in case testing is slow), then create a new Date object + const newTime = new Date(now + 10000 + 2000); + + const timeAdjustment = await provider.send("evm_setTime", [newTime]); + + // it should return `newTime.getTime() - now`, floored to the nearest second + const baseLineOffset = Math.floor((newTime.getTime() - now) / 1000); + assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); + }); }); describe("evm_increaseTime", () => { diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 49388dd800..c7f7dd04af 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -341,8 +341,20 @@ export default class EthereumApi implements types.Api { * @returns The amount of *seconds* between the given timestamp and now. */ @assertArgLength(0, 1) - async evm_setTime(time: Date | number) { - return Math.floor(this.#blockchain.setTime(+time) / 1000); + async evm_setTime(time: string | Date | number) { + let t: number; + switch (typeof time) { + case "object": + t = time.getTime(); + break; + case "number": + t = time; + break; + default: + t = Quantity.from(time).toNumber(); + break; + } + return Math.floor(this.#blockchain.setTime(t) / 1000); } /** From 88c8573f6e8ff4e5bbd2e32b98ddb302ed986929 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 15:50:05 -0400 Subject: [PATCH 566/691] fix create, tsconfigs, and update new promise-queue to match --- npm-shrinkwrap.json | 282 +++++++++++++++-------- scripts/create.ts | 2 +- src/packages/flavors/tsconfig.json | 4 +- src/packages/options/tsconfig.json | 4 +- src/packages/promise-queue/package.json | 2 +- src/packages/promise-queue/tsconfig.json | 4 +- src/packages/utils/tsconfig.json | 3 +- 7 files changed, 187 insertions(+), 114 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d26f4a9fd9..36c70d7140 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -5002,6 +5002,88 @@ "rlp": "^2.0.0", "safe-buffer": "^5.1.1" } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -5123,6 +5205,102 @@ "ethjs-util": "0.1.6", "rlp": "^2.2.3" } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" } } }, @@ -7471,9 +7649,9 @@ } }, "keccak": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", - "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", + "integrity": "sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==", "requires": { "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0" @@ -7797,27 +7975,6 @@ } } }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, "lines-and-columns": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", @@ -8202,83 +8359,6 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "ethereumjs-util": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", - "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - } - } - }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", diff --git a/scripts/create.ts b/scripts/create.ts index 74f03ddae4..3e7e8913f1 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -79,7 +79,7 @@ process.stdout.write(`${COLORS.Reset}`); version: version, homepage: "https://github.com/trufflesuite/ganache-core#readme", license: "MIT", - main: "src/index.ts", + main: "lib/index.js", typings: "src/index.ts", directories: { lib: "lib", diff --git a/src/packages/flavors/tsconfig.json b/src/packages/flavors/tsconfig.json index 7ae8200b28..62676b00a1 100644 --- a/src/packages/flavors/tsconfig.json +++ b/src/packages/flavors/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/src/packages/options/tsconfig.json b/src/packages/options/tsconfig.json index 7ae8200b28..62676b00a1 100644 --- a/src/packages/options/tsconfig.json +++ b/src/packages/options/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index f482f486cf..c083b6ca3c 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -3,7 +3,7 @@ "version": "2.2.1", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", - "main": "src/index.ts", + "main": "lib/index.js", "typings": "src/index.ts", "directories": { "lib": "lib", diff --git a/src/packages/promise-queue/tsconfig.json b/src/packages/promise-queue/tsconfig.json index 7ae8200b28..62676b00a1 100644 --- a/src/packages/promise-queue/tsconfig.json +++ b/src/packages/promise-queue/tsconfig.json @@ -3,7 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/src/packages/utils/tsconfig.json b/src/packages/utils/tsconfig.json index 94c51b7a57..62676b00a1 100644 --- a/src/packages/utils/tsconfig.json +++ b/src/packages/utils/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../tsconfig.json", "compilerOptions": { - "outDir": "lib", - "target": "ES2020" + "outDir": "lib" }, "include": ["src"] } From 426773bcaf024f27047f085970050dc4c3d762cd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 15:50:09 -0400 Subject: [PATCH 567/691] indentation --- .../utils/src/utils/request-coordinator.ts | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/packages/utils/src/utils/request-coordinator.ts b/src/packages/utils/src/utils/request-coordinator.ts index 137a71cb14..1c45bd78e9 100644 --- a/src/packages/utils/src/utils/request-coordinator.ts +++ b/src/packages/utils/src/utils/request-coordinator.ts @@ -73,19 +73,18 @@ export class RequestCoordinator { */ public queue = unknown>(fn: T, thisArgument: any, argumentsList: Parameters) => { return new Promise<{value: ReturnType}>((resolve, reject) => { - // const executor is `async` to force the return value into a Promise. - const executor = async () => { - try { - const value = Reflect.apply(fn, thisArgument, argumentsList || []) as ReturnType; - resolve({value}); - return value; - } catch(e) { - reject(e); - } + // const executor is `async` to force the return value into a Promise. + const executor = async () => { + try { + const value = Reflect.apply(fn, thisArgument, argumentsList || []) as ReturnType; + resolve({value}); + return value; + } catch(e) { + reject(e); } - this.pending.push(executor); - this.#process(); } - ); + this.pending.push(executor); + this.#process(); + }); }; } From 0f3f5a813abfc61cca3a04b8228f9e7130a2d7fe Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 15:50:29 -0400 Subject: [PATCH 568/691] temp hack for miner timings --- src/chains/ethereum/src/miner.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index b1a810d81b..f57fff00b7 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -133,6 +133,10 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { const nextBlock = this.#createBlock(lastBlock); const pending = this.#pending; this.#pending = null; + if (this.#paused) { + this.emit("idle"); + await this.#resumer; + } await this.mine(pending, nextBlock, this.#instamine ? 1 : -1); } else { this.emit("idle"); From 08e28f29f44e1dafbb8fe9702df37a06a77ed157 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 18:29:50 -0400 Subject: [PATCH 569/691] Create an "inbetween" cache of transactions that were in executables, but aren't yet saved. --- src/chains/ethereum/src/blockchain.ts | 20 +++--- src/chains/ethereum/src/miner.ts | 65 ++++++++++++-------- src/chains/ethereum/src/transaction-pool.ts | 27 ++++++-- src/chains/ethereum/src/types/executables.ts | 7 +++ 4 files changed, 80 insertions(+), 39 deletions(-) create mode 100644 src/chains/ethereum/src/types/executables.ts diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 08a750e585..af5f4ebe4e 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -183,7 +183,13 @@ export default class Blockchain extends Emittery.Typed this.#isPaused() ? null : this.mine(maxTransactions); @@ -275,12 +281,12 @@ export default class Blockchain extends Emittery.Typed { + block.value.transactions.forEach(transaction => { + const error = options.chain.vmErrorsOnRPCResponse ? transaction.execException : null + transaction.finalize("confirmed", error); + }); + if (instamine && options.miner.legacyInstamine) { - block.value.transactions.forEach(transaction => { - const error = options.chain.vmErrorsOnRPCResponse ? transaction.execException : null - transaction.finalize("confirmed", error); - }); - // in legacy instamine mode we must delay the broadcast of new blocks process.nextTick(() => { this.emit("block", block); @@ -321,7 +327,7 @@ export default class Blockchain extends Emittery.Typed { await this.#blockBeingSavedPromise; const nextBlock = this.#readyNextBlock(this.blocks.latest.value, timestamp); - return this.#miner.mine(this.transactions.transactionPool.executables, nextBlock, maxTransactions, onlyOneBlock); + return this.#miner.mine(nextBlock, maxTransactions, onlyOneBlock); } #isPaused = () => { diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index f57fff00b7..fb8e34d7f0 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -10,6 +10,7 @@ import VM from "ethereumjs-vm"; import {encode as rlpEncode} from "rlp"; import { EthereumInternalOptions } from "./options"; import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; +import { Executables } from "./types/executables"; type BlockData = { blockTransactions: Transaction[], @@ -46,11 +47,12 @@ function byPrice(values: Transaction[], a: number, b: number) { export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { #currentlyExecutingPrice = 0n; #origins = new Set(); - #pending: Map>; + #pending: boolean; #isBusy: boolean = false; #paused: boolean = false; #resumer: Promise; #resolver: (value: void ) => void; + readonly #executables: Executables; readonly #options: EthereumInternalOptions["miner"]; readonly #instamine: boolean; readonly #vm: VM; @@ -81,12 +83,18 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { // create a Heap that sorts by gasPrice readonly #priced = new utils.Heap(byPrice); - constructor(options: EthereumInternalOptions["miner"], instamine: boolean, vm: VM, createBlock: (previousBlock: Block) => Block) { + /* + * @param executables A live Map of pending transactions from the transaction + * pool. The miner will update this Map by removing the best transactions + * and putting them in new blocks. + */ + constructor(options: EthereumInternalOptions["miner"], executables: Executables, instamine: boolean, vm: VM, createBlock: (previousBlock: Block) => Block) { super(); const stateManager = vm.stateManager; this.#vm = vm; this.#options = options; + this.#executables = executables; this.#instamine = instamine; this.#checkpoint = promisify(stateManager.checkpoint.bind(stateManager)); this.#commit = promisify(stateManager.commit.bind(stateManager)); @@ -98,18 +106,13 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { } /** - * - * @param pending A live Map of pending transactions from the transaction - * pool. The miner will update this Map by removing the best transactions - * and putting them in new blocks. - * * @param maxTransactions: maximum number of transactions per block. If `-1`, * unlimited. * @param onlyOneBlock: set to `true` if only 1 block should be mined. * - * @returns the transactions mined + * @returns the transactions mined in the _first_ block */ - public async mine(pending: Map>, block: Block, maxTransactions: number = -1, onlyOneBlock = false) { + public async mine(block: Block, maxTransactions: number = -1, onlyOneBlock = false) { if (this.#paused) { await this.#resumer; } @@ -118,33 +121,35 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { // if we are currently mining a block, set the `pending` property // so the miner knows it can immediately start mining another block once // it is done with its current work. - this.#pending = pending; - this.#updatePricedHeap(pending); + this.#pending = true; + this.#updatePricedHeap(); return; } else { - this.#setPricedHeap(pending); + this.#setPricedHeap(); } - const {block: lastBlock, transactions} = await this.#mineTxs(pending, block, maxTransactions, onlyOneBlock); + const result = await this.#mine(block, maxTransactions, onlyOneBlock); + this.emit("idle"); + return result; + } + + #mine = async (block: Block, maxTransactions: number = -1, onlyOneBlock = false) => { + const {block: lastBlock, transactions} = await this.#mineTxs(block, maxTransactions, onlyOneBlock); // if there are more txs to mine, start mining them without awaiting their // result. if (!onlyOneBlock && this.#pending) { + this.#setPricedHeap(); + this.#pending = false; const nextBlock = this.#createBlock(lastBlock); - const pending = this.#pending; - this.#pending = null; - if (this.#paused) { - this.emit("idle"); - await this.#resumer; - } - await this.mine(pending, nextBlock, this.#instamine ? 1 : -1); - } else { - this.emit("idle"); + await this.#mine(nextBlock, this.#instamine ? 1 : -1); } return transactions; } - #mineTxs = async (pending: Map>, block: Block, maxTransactions: number, onlyOneBlock: boolean) => { + #mineTxs = async (block: Block, maxTransactions: number, onlyOneBlock: boolean) => { + const {pending, inProgress} = this.#executables; + let keepMining = true; const priced = this.#priced; const legacyInstamine = this.#options.legacyInstamine; @@ -243,6 +248,12 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { // since this transaction was successful, remove it from the "pending" // transaction pool. keepMining = pendingOrigin.removeBest(); + inProgress.add(best); + best.once("finalized").then(() => { + // it is in the database (or thrown out) so delete it from the + // `inProgress` Set + inProgress.delete(best); + }); // if we: // * don't have enough gas left for even the smallest of transactions @@ -310,7 +321,7 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { break; } else { this.#currentlyExecutingPrice = 0n; - this.#updatePricedHeap(pending); + this.#updatePricedHeap(); if (priced.length !== 0) { maxTransactions = this.#instamine ? 1 : -1; @@ -370,7 +381,8 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { this.#isBusy = false; }; - #setPricedHeap = (pending: Map>) => { + #setPricedHeap = () => { + const {pending} = this.#executables; const origins = this.#origins; const priced = this.#priced; @@ -386,7 +398,8 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { } }; - #updatePricedHeap = (pending: Map>) => { + #updatePricedHeap = () => { + const {pending} = this.#executables; const origins = this.#origins; const priced = this.#priced; // Note: the `pending` Map passed here is "live", meaning it is constantly diff --git a/src/chains/ethereum/src/transaction-pool.ts b/src/chains/ethereum/src/transaction-pool.ts index cdb7375fbb..d220212398 100644 --- a/src/chains/ethereum/src/transaction-pool.ts +++ b/src/chains/ethereum/src/transaction-pool.ts @@ -6,6 +6,7 @@ import {Data, Quantity} from "@ganache/utils"; import {GAS_LIMIT, INTRINSIC_GAS_TOO_LOW} from "./errors/errors"; import CodedError, { ErrorCodes } from "./errors/coded-error"; import { EthereumInternalOptions } from "./options"; +import { Executables } from "./types/executables"; function byNonce(values: Transaction[], a: number, b: number) { return (Quantity.from(values[b].nonce).toBigInt() || 0n) > (Quantity.from(values[a].nonce).toBigInt() || 0n); @@ -25,7 +26,10 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { this.#blockchain = blockchain; this.#options = options; } - public readonly executables: Map> = new Map(); + public readonly executables: Executables = { + inProgress: new Set(), + pending: new Map() + } readonly #origins: Map> = new Map(); readonly #accountPromises = new Map>(); @@ -88,7 +92,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { let highestNonce = 0n; let isExecutableTransaction = false; - const executables = this.executables; + const executables = this.executables.pending; let executableOriginTransactions = executables.get(origin); let length: number; @@ -226,7 +230,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { public clear() { this.#origins.clear(); this.#accountPromises.clear(); - this.executables.clear(); + this.executables.pending.clear(); } /** @@ -236,7 +240,11 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { * @param transactionHash */ public find(transactionHash: Buffer) { - for (let [_, transactions] of this.executables) { + const {pending, inProgress} = this.executables; + + // first search pending transactions + for (let [_, transactions] of this.#origins) { + if (transactions === undefined) continue; for (let tx of transactions.array) { if (tx.hash().equals(transactionHash)) { return tx; @@ -244,14 +252,21 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { } } - for (let [_, transactions] of this.#origins) { - if (transactions === undefined) continue; + // then transactions eligible for execution + for (let [_, transactions] of pending) { for (let tx of transactions.array) { if (tx.hash().equals(transactionHash)) { return tx; } } } + + // and finally transactions that have just been processed, but not yet saved + for (let tx of inProgress) { + if (tx.hash().equals(transactionHash)) { + return tx; + } + } return null; } diff --git a/src/chains/ethereum/src/types/executables.ts b/src/chains/ethereum/src/types/executables.ts new file mode 100644 index 0000000000..ebf1e76073 --- /dev/null +++ b/src/chains/ethereum/src/types/executables.ts @@ -0,0 +1,7 @@ +import { utils } from "@ganache/utils"; +import Transaction from "../things/transaction"; + +export type Executables = { + inProgress: Set, + pending: Map> +} From eeffaabe878a3af6e80dd39ab2fdb73f7013e61f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 18:33:11 -0400 Subject: [PATCH 570/691] search pending txs first in `eth_getTransactionByHash` --- src/chains/ethereum/src/api.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index c7f7dd04af..b92e98873d 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1048,14 +1048,17 @@ export default class EthereumApi implements types.Api { async eth_getTransactionByHash(transactionHash: string) { const chain = this.#blockchain; const hashBuffer = Data.from(transactionHash).toBuffer(); - const transaction = await chain.transactions.get(hashBuffer); + + // check pending transactions first, since this is super fast due to it + // being in memory + const transaction = chain.transactions.transactionPool.find(hashBuffer); + if (transaction == null) { - // maybe it is pending? - const tx = chain.transactions.transactionPool.find(hashBuffer); - if (tx === null) return null; - return tx.toJSON(null); + // if we can't find it in the list of pending transactions, check the db! + const tx = await chain.transactions.get(hashBuffer); + return tx ? tx.toJSON() : null; } else { - return transaction.toJSON(); + return transaction.toJSON(null); } } From 39198e575b98236375dc7a87b752a4e9fa2a767d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 18:33:57 -0400 Subject: [PATCH 571/691] fix test logic --- src/chains/ethereum/__tests__/api/evm/snapshot.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 9de5f675a7..f367a3e644 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -2,7 +2,6 @@ const assert = require("assert"); import { join } from "path"; import getProvider from "../../helpers/getProvider"; import compile from "../../helpers/compile"; -import { Quantity } from "@ganache/utils"; const eth = "0x" + (1000000000000000000n).toString(16); @@ -13,7 +12,7 @@ describe("api", function() { let startingBalance; let snapshotId; - before("Set up provider and deploy a contract", async function() { + beforeEach("Set up provider and deploy a contract", async function() { const contract = compile(join(__dirname, "./snapshot.sol")); const p = await getProvider({ @@ -61,7 +60,7 @@ describe("api", function() { } }); - before("send a transaction then make a checkpoint", async function() { + beforeEach("send a transaction then make a checkpoint", async function() { const { accounts, send, provider } = context await send("eth_sendTransaction",[{ From 15513d119ac95830db64a3b84caa0ffd5c7c0106 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 21:27:07 -0400 Subject: [PATCH 572/691] implements precise evm_revert --- .../__tests__/api/evm/snapshot.test.ts | 244 +++++++++++++++++- src/chains/ethereum/src/api.ts | 15 +- src/chains/ethereum/src/transaction-pool.ts | 5 +- 3 files changed, 254 insertions(+), 10 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index f367a3e644..1b1bb97e75 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -1,4 +1,4 @@ -const assert = require("assert"); +import assert from "assert"; import { join } from "path"; import getProvider from "../../helpers/getProvider"; import compile from "../../helpers/compile"; @@ -177,6 +177,248 @@ describe("api", function() { const promises = ids.map((id) => send("evm_revert", [id]).then(result => assert.strictEqual(result, false))); await Promise.all(promises); }); + + it("removes transactions that are already in processing at the start of evm_revert", async() => { + const { send, accounts: [from, to] } = context; + + const snapShotId = await send("evm_snapshot"); + + // increment value for each transaction so the hashes always differ + let value = 1; + + // send some transactions + const inFlightTxs = [ + send("eth_sendTransaction", [{from, to, value: value++}]), + send("eth_sendTransaction", [{from, to, value: value++}]) + ]; + // wait for the tx hashes to be returned; this is confirmation that + // they've been accepted by the transaction pool. + const txHashes = await Promise.all(inFlightTxs); + + const getReceipt = (hash: string) => send("eth_getTransactionReceipt", [hash]); + const getTx = (hash: string) => send("eth_getTransactionByHash", [hash]); + + const receiptsProm = Promise.all(txHashes.map(getReceipt)); + const transactionsProm = Promise.all(txHashes.map(getTx)); + const [receipts, transactions] = await Promise.all([ + receiptsProm, + transactionsProm + ]); + + // verify that we don't yet have a receipt + receipts.forEach(receipt => { + assert.strictEqual(receipt, null, "Receipt should be null"); + }); + + // and that the transations were all accepted + transactions.forEach(transaction => { + assert.notStrictEqual(transaction, null, "Transaction should not be null"); + }); + + // revert while these transactions are being mined + await send("evm_revert", [snapShotId]); + + const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); + const finalTransactionsProm = Promise.all(txHashes.map(getTx)); + const [finalReceipts, finalTransactions] = await Promise.all([ + finalReceiptsProm, + finalTransactionsProm + ]); + + // verify that we don't have any receipts + finalReceipts.forEach(receipt => { + assert.strictEqual(receipt, null, "Receipt should be null"); + }); + + // and we don't have any transactions + finalTransactions.forEach(transaction => { + assert.strictEqual(transaction, null, "Transaction should be null"); + }); + }); + + it("removes transactions that are in pending transactions at the start of evm_revert", async() => { + const { provider, send, accounts: [from, to] } = context; + + const snapShotId = await send("evm_snapshot"); + + // increment value for each transaction so the hashes always differ + let value = 1; + + // send some transactions + const accountNonce = parseInt(await send("eth_getTransactionCount", [from]), 16); + const inFlightTxs = [ + send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce + 1}]), + send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce + 2}]) + ]; + // wait for the tx hashes to be returned; this is confirmation that + // they've been accepted by the transaction pool. + const txHashes = await Promise.all(inFlightTxs); + + const getReceipt = (hash: string) => send("eth_getTransactionReceipt", [hash]); + const getTx = (hash: string) => send("eth_getTransactionByHash", [hash]); + + const transactions = await Promise.all(txHashes.map(getTx)); + + // and that the transations were all accepted + transactions.forEach(transaction => { + assert.notStrictEqual(transaction, null, "Transaction should not be null"); + }); + + // revert while these transactions are pending + await send("evm_revert", [snapShotId]); + + // mine a transaction to fill in the nonce gap (this would normally cause the pending transactions to be mined) + await send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce}]); + await provider.once("message"); + + // and mine one more block just to force the any transactions to be immediately mined + await send("evm_mine"); + + const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); + const finalTransactionsProm = Promise.all(txHashes.map(getTx)); + const [finalReceipts, finalTransactions] = await Promise.all([ + finalReceiptsProm, + finalTransactionsProm + ]); + + // verify that we don't have any receipts + finalReceipts.forEach(receipt => { + assert.strictEqual(receipt, null, "Receipt should be null"); + }); + + // and we don't have any transactions + finalTransactions.forEach(transaction => { + assert.strictEqual(transaction, null, "Transaction should be null"); + }); + }); + + it("doesn't revert transactions that were added *after* the start of evm_revert", async() => { + const { provider, send, accounts: [from, to] } = context; + + const accountNonce = parseInt(await send("eth_getTransactionCount", [from]), 16); + + const snapShotId = await send("evm_snapshot"); + + // increment value for each transaction so the hashes always differ + let value = 1; + + // send a transaction so we have something to revert + const revertedTx = await send("eth_sendTransaction", [{from, to, value: value++}]); + await provider.once("message"); + + // revert while these transactions are being mined + const revertPromise = send("evm_revert", [snapShotId]); + + // send some transactions + const inFlightTxs = [ + send("eth_sendTransaction", [{from, to, value: value++}]), + send("eth_sendTransaction", [{from, to, value: value++}]), + ]; + + // these two transactions have nonces that are too high to be executed immediately + const laterTxs = [ + send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce + 3}]), + send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce + 3}]), + ]; + const txsMinedProm = new Promise(resolve => { + let count = 0; + const unsub = provider.on("message", () => { + if (++count === 2) { + unsub(); + resolve(null); + } + }); + }); + + // wait for the tx hashes to be returned; this is confirmation that + // they've been accepted by the transaction pool. + const txHashPromises = Promise.all(inFlightTxs); + + const getReceipt = (hash: string) => send("eth_getTransactionReceipt", [hash]); + const getTx = (hash: string) => send("eth_getTransactionByHash", [hash]); + + // wait for the revert to finish up + const result = await Promise.race([revertPromise, txHashPromises]); + assert.strictEqual(result, true, "evm_revert should finish before the transaction hashes are returned"); + + // wait for the inFlightTxs to be mined + await txsMinedProm; + const txHashes = await txHashPromises; + const laterHashes = await Promise.all(laterTxs); + + // and mine one more block just to force the any executable transactions + // to be immediately mined + await send("evm_mine"); + + const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); + const finalTransactionsProm = Promise.all(txHashes.map(getTx)); + const [finalReceipts, finalTransactions] = await Promise.all([ + finalReceiptsProm, + finalTransactionsProm + ]); + + // verify that we do have the receipts + finalReceipts.forEach(receipt => { + assert.notStrictEqual(receipt, null, "Receipt should not be null"); + }); + + // and we do have the transactions + finalTransactions.forEach(transaction => { + assert.notStrictEqual(transaction, null, "Transaction should not be null"); + }); + + const laterTxsReceiptsProm = Promise.all(laterHashes.map(getReceipt)); + const laterTxsTransactionsProm = Promise.all(laterHashes.map(getTx)); + const [laterTxsReceipts, laterTxsTransactions] = await Promise.all([ + laterTxsReceiptsProm, + laterTxsTransactionsProm + ]); + + // verify that we do NOT have the receipts + laterTxsReceipts.forEach(receipt => { + assert.strictEqual(receipt, null, "Receipt should be null"); + }); + + // and we DO have the transactions + laterTxsTransactions.forEach(transaction => { + assert.notStrictEqual(transaction, null, "Transaction should not be null"); + }); + + // send one more transaction to fill in the gap + send("eth_sendTransaction", [{from, to, value: value++}]); + + await new Promise(resolve => { + let count = 0; + const unsub = provider.on("message", () => { + if (++count === 3) { + unsub(); + resolve(null); + } + }); + }); + + const finalLaterTxsReceiptsProm = Promise.all(txHashes.map(getReceipt)); + const finalLaterTxsTransactionsProm = Promise.all(txHashes.map(getTx)); + const [finalLaterTxsReceipts, finalLaterTxsTransactions] = await Promise.all([ + finalLaterTxsReceiptsProm, + finalLaterTxsTransactionsProm + ]); + + // verify that we do have the receipts + finalLaterTxsReceipts.forEach(receipt => { + assert.notStrictEqual(receipt, null, "Receipt should not be null"); + }); + + // and we do have the transactions + finalLaterTxsTransactions.forEach(transaction => { + assert.notStrictEqual(transaction, null, "Transaction should not be null"); + }); + + const revertedTxReceipt = await getReceipt(revertedTx); + const revertedTxTransactions = await getTx(revertedTx); + assert.strictEqual(revertedTxReceipt, null, "First transaction should not have a receipt"); + assert.strictEqual(revertedTxTransactions, null, "First transaction should not have a tx"); + }); }); }); }); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index b92e98873d..f5e0d7d597 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1049,16 +1049,17 @@ export default class EthereumApi implements types.Api { const chain = this.#blockchain; const hashBuffer = Data.from(transactionHash).toBuffer(); - // check pending transactions first, since this is super fast due to it - // being in memory - const transaction = chain.transactions.transactionPool.find(hashBuffer); + // we must check the database before checking the pending cache, because the + // cache is updated _after_ the transaction is already in the database, and + // the database contains block info whereas the pending cache doesn't. + const transaction = await chain.transactions.get(hashBuffer); - if (transaction == null) { + if (transaction === null) { // if we can't find it in the list of pending transactions, check the db! - const tx = await chain.transactions.get(hashBuffer); - return tx ? tx.toJSON() : null; + const tx = chain.transactions.transactionPool.find(hashBuffer); + return tx ? tx.toJSON(null) : null; } else { - return transaction.toJSON(null); + return transaction.toJSON(); } } diff --git a/src/chains/ethereum/src/transaction-pool.ts b/src/chains/ethereum/src/transaction-pool.ts index d220212398..f5d38c47f2 100644 --- a/src/chains/ethereum/src/transaction-pool.ts +++ b/src/chains/ethereum/src/transaction-pool.ts @@ -59,8 +59,6 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { } const origin = from.toString(); - const origins = this.#origins; - const queuedOriginTransactions = origins.get(origin); // We await the `transactorNoncePromise` async request to ensure we process // transactions in FIFO order *by account*. We look up accounts because @@ -91,6 +89,9 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // `executableOriginTransactions` map, always taking the highest of the two. let highestNonce = 0n; + const origins = this.#origins; + const queuedOriginTransactions = origins.get(origin); + let isExecutableTransaction = false; const executables = this.executables.pending; let executableOriginTransactions = executables.get(origin); From 66e15966cec3af35323ea2495988b16f86e2cf4f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 21:30:11 -0400 Subject: [PATCH 573/691] add node 15 to ci --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 34ddeb14c3..cc58144346 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] + node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x] os: [windows-2019, ubuntu-16.04, ubuntu-18.04, macos-10.15] runs-on: ${{ matrix.os }} From 965fb4feed9e6013d57d79fb65fea23e461d4b6f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 21:52:26 -0400 Subject: [PATCH 574/691] fix some build issues --- npm-shrinkwrap.json | 6 +++--- package.json | 2 +- src/chains/ethereum/package.json | 2 +- src/packages/promise-queue/__tests__/index.test.ts | 2 +- src/packages/promise-queue/index.ts | 4 +++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 36c70d7140..da9a84d3ad 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -5121,9 +5121,9 @@ } }, "ethereumjs-common": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", - "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==" + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", + "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" }, "ethereumjs-tx": { "version": "2.1.2", diff --git a/package.json b/package.json index 5c444f75c2..6dbefa840d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "emittery": "0.7.2", "ethereumjs-account": "3.0.0", "ethereumjs-block": "2.2.2", - "ethereumjs-common": "1.5.2", + "ethereumjs-common": "1.5.1", "ethereumjs-tx": "2.1.2", "ethereumjs-util": "7.0.7", "ethereumjs-vm": "4.2.0", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index ae6a530f91..96dfcf52db 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -39,7 +39,7 @@ "@ganache/utils": "^2.2.1", "@types/keccak": "3.0.1", "eth-sig-util": "2.5.3", - "ethereumjs-abi": "^0.6.8", + "ethereumjs-abi": "0.6.8", "ethereumjs-vm": "4.2.0", "keccak": "3.0.0", "levelup": "4.4.0", diff --git a/src/packages/promise-queue/__tests__/index.test.ts b/src/packages/promise-queue/__tests__/index.test.ts index 6c41468626..103ef1c2f6 100644 --- a/src/packages/promise-queue/__tests__/index.test.ts +++ b/src/packages/promise-queue/__tests__/index.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import promiseQueue from "../src/"; +import PromiseQueue from "../src/"; describe("@ganache/promise-queue", () => { it("needs tests"); diff --git a/src/packages/promise-queue/index.ts b/src/packages/promise-queue/index.ts index f9c66395b9..7cf1638089 100644 --- a/src/packages/promise-queue/index.ts +++ b/src/packages/promise-queue/index.ts @@ -2,4 +2,6 @@ // This file is necessary to "trick" typescript into using our ./src/**/*.ts // // files when developing, debugging, and running tests // // ************************************************************************* // -export * from "./src/index"; +import PromiseQueue from "./src/index"; + +export default PromiseQueue; From 3077688e14ecd0ea8334b208d2a867f71a82a100 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 21:53:45 -0400 Subject: [PATCH 575/691] add ubuntu-20.04 to CI --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index cc58144346..62e59a1bca 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x] - os: [windows-2019, ubuntu-16.04, ubuntu-18.04, macos-10.15] + os: [windows-2019, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15] runs-on: ${{ matrix.os }} From a7615cdd0dfde0264cd71b5d78466a4c786b99e0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 22:21:00 -0400 Subject: [PATCH 576/691] remove test script from promise-queue for now --- src/packages/promise-queue/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index c083b6ca3c..04101d70e2 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -18,7 +18,6 @@ }, "scripts": { "tsc": "ts-node ../../../scripts/compile", - "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" }, "bugs": { From 6c6d4e5d06e02b60de3863a67e7425d4386f3fed Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 22:41:17 -0400 Subject: [PATCH 577/691] bump supported versions --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6dbefa840d..1d8e680216 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "root", "private": true, "engines": { - "node": ">=10.7.0 <=14.11.0", + "node": ">=10.7.0 <=15.0.1", "npm": ">=6.1.0" }, "scripts": { From 09a353306b22fbb7be11f789ae8509e90fb3a40c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 22:41:28 -0400 Subject: [PATCH 578/691] temp work around failling tests in node 14+ --- src/chains/ethereum/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 96dfcf52db..d23e00eddc 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -27,7 +27,8 @@ "post-process:docs": "node ./scripts/post-process-docs.js", "preview:docs": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", - "test": "nyc --reporter lcov npm run mocha -- --throw-deprecation --trace-warnings", + "dosnt-always-work-test": "nyc --reporter lcov npm run mocha -- --throw-deprecation --trace-warnings", + "test": "npm run mocha", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" }, "bugs": { From 584e54e0e8b8102d76748fea37d37d8a52d33bb3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 23 Oct 2020 23:33:31 -0400 Subject: [PATCH 579/691] change to info --- src/chains/ethereum/src/blockchain.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index af5f4ebe4e..6ed832f65e 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -120,16 +120,16 @@ export default class Blockchain extends Emittery.Typed Date: Fri, 23 Oct 2020 23:34:21 -0400 Subject: [PATCH 580/691] another workaround attempt --- package.json | 2 +- src/chains/ethereum/package.json | 2 +- src/packages/core/package.json | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1d8e680216..2f4f3341c2 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "preview:docs": "lerna exec --no-bail npm run preview:docs", "prepare": "lerna bootstrap && echo \"\n\\033[1;36m Tip:\\033[0;36m run \\033[1;2;33msource completions.sh\\033[0;36m to supply bash completions for npm scripts\\033[0m\"", "reinstall": "npm run clean && npm install", - "test": "lerna exec -- npm test", + "test": "lerna exec --concurrency 1 -- npm test", "tsc": "lerna exec -- npm run tsc" }, "dependencies": { diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index d23e00eddc..84dabe5c2c 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -28,7 +28,7 @@ "preview:docs": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", "dosnt-always-work-test": "nyc --reporter lcov npm run mocha -- --throw-deprecation --trace-warnings", - "test": "npm run mocha", + "test": "npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" }, "bugs": { diff --git a/src/packages/core/package.json b/src/packages/core/package.json index e8f7063fce..122a9dd1fb 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -24,7 +24,8 @@ }, "scripts": { "tsc": "ts-node ../../../scripts/compile", - "test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", + "doesnt-always-work0test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", + "test": "npm run mocha -- --throw-deprecation --trace-warnings", "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" }, "bugs": { From 646461440fe49bd2adf7e9177d0f702859c577cb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 24 Oct 2020 17:23:14 -0400 Subject: [PATCH 581/691] remove node 15 testing --- .github/workflows/nodejs.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 62e59a1bca..6a3977a0d8 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x] + node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] os: [windows-2019, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15] runs-on: ${{ matrix.os }} diff --git a/package.json b/package.json index 2f4f3341c2..24d92279c5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "root", "private": true, "engines": { - "node": ">=10.7.0 <=15.0.1", + "node": ">=10.7.0 <=14.14.0", "npm": ">=6.1.0" }, "scripts": { From b0d10fb936cfd4fbe6358b5965f6e7eaba3e1454 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 24 Oct 2020 17:23:41 -0400 Subject: [PATCH 582/691] add new line after prepare tip --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 24d92279c5..40f39cdfe6 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "clean": "npx shx rm -rf node_modules && npx lerna clean -y", "create": "ts-node ./scripts/create", "preview:docs": "lerna exec --no-bail npm run preview:docs", - "prepare": "lerna bootstrap && echo \"\n\\033[1;36m Tip:\\033[0;36m run \\033[1;2;33msource completions.sh\\033[0;36m to supply bash completions for npm scripts\\033[0m\"", + "prepare": "lerna bootstrap && echo \"\n\\033[1;36m Tip:\\033[0;36m run \\033[1;2;33msource completions.sh\\033[0;36m to supply bash completions for npm scripts\\033[0m\n\"", "reinstall": "npm run clean && npm install", "test": "lerna exec --concurrency 1 -- npm test", "tsc": "lerna exec -- npm run tsc" From 0d01cd91b95d775741489fe588007811655de897 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 24 Oct 2020 17:27:07 -0400 Subject: [PATCH 583/691] a slightly more future proof solc listener clean up --- src/chains/ethereum/__tests__/helpers/compile.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/__tests__/helpers/compile.ts b/src/chains/ethereum/__tests__/helpers/compile.ts index d664532044..d0c9aaecd5 100644 --- a/src/chains/ethereum/__tests__/helpers/compile.ts +++ b/src/chains/ethereum/__tests__/helpers/compile.ts @@ -1,10 +1,16 @@ import solc from "solc"; -// Clean up after solc. Looks like this never really got fixed: -// https://github.com/chriseth/browser-solidity/issues/167 -var listeners = process.listeners("unhandledRejection"); -var solc_listener = listeners[listeners.length - 1]; -process.removeListener("unhandledRejection", solc_listener); +{ + // Clean up after solc. Looks like this never really got fixed: + // https://github.com/chriseth/browser-solidity/issues/167 + const listeners = process.listeners("unhandledRejection"); + const solcListener = listeners[listeners.length - 1]; + if (solcListener && solcListener.name === "abort") { + process.removeListener("unhandledRejection", solcListener); + } else { + throw new Error("Looks like either the solc listener was finally removed, or they changed the name. Check it!"); + } +} import { readFileSync } from "fs-extra"; import { parse } from "path"; From 14884a22544dbd65340562a5ff302cdf3e742816 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 24 Oct 2020 17:29:46 -0400 Subject: [PATCH 584/691] use --exit mocha flag to work around hanging tests --- package.json | 2 +- src/chains/ethereum/package.json | 5 ++--- src/packages/core/__tests__/server.test.ts | 3 ++- src/packages/core/package.json | 5 ++--- src/packages/promise-queue/package.json | 3 ++- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 40f39cdfe6..ecb07b37f9 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "preview:docs": "lerna exec --no-bail npm run preview:docs", "prepare": "lerna bootstrap && echo \"\n\\033[1;36m Tip:\\033[0;36m run \\033[1;2;33msource completions.sh\\033[0;36m to supply bash completions for npm scripts\\033[0m\n\"", "reinstall": "npm run clean && npm install", - "test": "lerna exec --concurrency 1 -- npm test", + "test": "lerna exec -- npm test", "tsc": "lerna exec -- npm run tsc" }, "dependencies": { diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 84dabe5c2c..ef72f4431d 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -27,9 +27,8 @@ "post-process:docs": "node ./scripts/post-process-docs.js", "preview:docs": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", - "dosnt-always-work-test": "nyc --reporter lcov npm run mocha -- --throw-deprecation --trace-warnings", - "test": "npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --require source-map-support/register --recursive --check-leaks '__tests__/**/*.test.ts'" + "test": "nyc --reporter lcov npm run mocha", + "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register --require source-map-support/register '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/__tests__/server.test.ts index be87a947b6..f5780eeec4 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -4,7 +4,8 @@ import request from "superagent"; import WebSocket from "ws"; import Server, {Status} from "../src/server"; import http from "http"; -import intoStream from "into-stream"; +// https://github.com/sindresorhus/into-stream/releases/tag/v6.0.0 +import intoStream = require("into-stream"); import { PromiEvent } from "@ganache/utils"; import {promisify} from "util"; import { ServerOptions } from "../src/options"; diff --git a/src/packages/core/package.json b/src/packages/core/package.json index 122a9dd1fb..a996af0eb7 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -24,9 +24,8 @@ }, "scripts": { "tsc": "ts-node ../../../scripts/compile", - "doesnt-always-work0test": "nyc npm run mocha -- --throw-deprecation --trace-warnings", - "test": "npm run mocha -- --throw-deprecation --trace-warnings", - "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" + "test": "nyc npm run mocha", + "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register --recursive '__tests__/**.ts'", }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index 04101d70e2..a85be02e00 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -18,7 +18,8 @@ }, "scripts": { "tsc": "ts-node ../../../scripts/compile", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" + "test": "nyc npm run mocha", + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'", }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" From d643900fcacf77e048dc1d2f4d4b77071b2b76c2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 24 Oct 2020 21:18:13 -0400 Subject: [PATCH 585/691] remove unsused blockhash var --- src/chains/ethereum/src/database.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index 493bd5504c..f0ffd8ca33 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -22,7 +22,6 @@ export default class Database extends Emittery { public blocks: LevelUp; public blockIndexes: LevelUp; public blockLogs: LevelUp; - public blockHashes: LevelUp; public transactions: LevelUp; public transactionReceipts: LevelUp; public trie: LevelUp; @@ -150,7 +149,14 @@ export default class Database extends Emittery { if (err) return void reject(err); resolve(void 0); }))); - await Promise.all([this.blocks.close(), this.transactions.close(), this.trie.close()]); + await Promise.all([ + this.blocks.close(), + this.blockIndexes.close(), + this.blockIndexes.close(), + this.transactionReceipts.close(), + this.transactions.close(), + this.trie.close() + ]); } return this.#cleanupDirectory(); }; From fbdd5c04313f72e16cdeaa9329422c84d872b93a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 24 Oct 2020 21:32:15 -0400 Subject: [PATCH 586/691] this should fail --- src/chains/ethereum/package.json | 2 +- src/packages/core/package.json | 2 +- src/packages/promise-queue/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index ef72f4431d..ed2714e16e 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -28,7 +28,7 @@ "preview:docs": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", "test": "nyc --reporter lcov npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register --require source-map-support/register '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_FILES=true mocha --check-leaks --throw-deprecation --trace-warnings --require ts-node/register --require source-map-support/register '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/core/package.json b/src/packages/core/package.json index a996af0eb7..332ca3ca2f 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -25,7 +25,7 @@ "scripts": { "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register --recursive '__tests__/**.ts'", + "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --throw-deprecation --trace-warnings --check-leaks --require ts-node/register --recursive '__tests__/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index a85be02e00..b99b6011a4 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -19,7 +19,7 @@ "scripts": { "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'", + "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" From 6fad850ea8f9bb196f4e3378d88c18cb5d93fbe8 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 24 Oct 2020 21:37:34 -0400 Subject: [PATCH 587/691] this shouldn't (mostly) --- src/chains/ethereum/package.json | 2 +- src/packages/core/package.json | 2 +- src/packages/promise-queue/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index ed2714e16e..d2e6d55f4d 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -28,7 +28,7 @@ "preview:docs": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", "test": "nyc --reporter lcov npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true mocha --check-leaks --throw-deprecation --trace-warnings --require ts-node/register --require source-map-support/register '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register --require source-map-support/register '__tests__/**/bzz.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/core/package.json b/src/packages/core/package.json index 332ca3ca2f..09dc411c98 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -25,7 +25,7 @@ "scripts": { "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --throw-deprecation --trace-warnings --check-leaks --require ts-node/register --recursive '__tests__/**.ts'" + "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register --recursive '__tests__/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index b99b6011a4..0df12d2b71 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -19,7 +19,7 @@ "scripts": { "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" + "mocha": "cross-env TS_NODE_FILES=true mocha --exit --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" From 7b999f152e86fd5ef5327c2ddba5224144f4f45b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sun, 25 Oct 2020 13:35:51 -0400 Subject: [PATCH 588/691] add --exit flag to create script's mocha command --- scripts/create.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/create.ts b/scripts/create.ts index 3e7e8913f1..d990c48f65 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -92,8 +92,8 @@ process.stdout.write(`${COLORS.Reset}`); }, scripts: { tsc: "ts-node ../../../scripts/compile", - test: "nyc npm run mocha -- --throw-deprecation --trace-warnings", - mocha: "cross-env TS_NODE_FILES=true mocha --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" + test: "nyc npm run mocha", + mocha: "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**.ts'" }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" From eb39350978b45b2288734b0dbc68f253bce6f71b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 26 Oct 2020 12:54:24 -0400 Subject: [PATCH 589/691] development should use 10.7.0 (for now) --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..a63bb50634 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v10.7.0 From e9aa7213d38ff8e5d557853d743683561216d471 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 15:47:50 -0400 Subject: [PATCH 590/691] re-enable all eth tests --- src/chains/ethereum/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index d2e6d55f4d..ef72f4431d 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -28,7 +28,7 @@ "preview:docs": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", "test": "nyc --reporter lcov npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register --require source-map-support/register '__tests__/**/bzz.test.ts'" + "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register --require source-map-support/register '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" From 2825ac6472e0b24e1ec3f2e95b02947c473f1aa3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 16:44:26 -0400 Subject: [PATCH 591/691] compute block size --- .../src/data-managers/block-manager.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/data-managers/block-manager.ts b/src/chains/ethereum/src/data-managers/block-manager.ts index c1a31c4cf7..9e249de617 100644 --- a/src/chains/ethereum/src/data-managers/block-manager.ts +++ b/src/chains/ethereum/src/data-managers/block-manager.ts @@ -144,8 +144,10 @@ export default class BlockManager extends Manager { key = Buffer.from([0]); } const secondaryKey = header.hash(); - const value = blockValue.serialize(true); - await Promise.all([this.#blockIndexes.put(secondaryKey, key), super.set(key, value)]); + await Promise.all([ + this.#blockIndexes.put(secondaryKey, key), + super.set(key, block.serialize()) + ]); return block; } @@ -180,6 +182,7 @@ export class Block { public readonly value: EthereumJsBlock; constructor(raw: Buffer, common: Common) { if (raw) { + this.size = raw.length; const data = (rlpDecode(raw) as any) as [Buffer[], Buffer[], Buffer[]]; this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, {common}); const rawTransactions = data[1]; @@ -191,9 +194,18 @@ export class Block { } } else { this.value = new EthereumJsBlock(null, {common}); + this.size = 0; } } + size: number; + + serialize() { + const serialized = this.value.serialize(true); + this.size = serialized.length; + return serialized; + } + getTxFn = (include = false): ((tx: Transaction) => {[key: string]: string | Data | Quantity} | Data) => { if (include) { return (tx: Transaction) => tx.toJSON(this); @@ -219,7 +231,7 @@ export class Block { difficulty: Quantity.from(header.difficulty), totalDifficulty: Quantity.from(header.difficulty), // TODO: Figure out what to do here. extraData: Data.from(header.extraData), - size: Quantity.from(1000), // TODO: Do something better here + size: Quantity.from(this.size), gasLimit: Quantity.from(header.gasLimit), gasUsed: Quantity.from(header.gasUsed), timestamp: Quantity.from(header.timestamp), From df95da2a0adbcae5c05455e41032484029cc04ab Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 16:44:38 -0400 Subject: [PATCH 592/691] update runtx error handling --- src/chains/ethereum/src/miner.ts | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index fb8e34d7f0..8626fc3fe3 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -188,7 +188,6 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { // vm's "live" trie. await this.#checkpoint(); - // TODO: get a real block? const blockBloom = block.header.bloom; // Run until we run out of items, or until the inner loop stops us. @@ -343,30 +342,14 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { return await this.#vm.runTx({tx, block} as any); } catch (err) { const errorMessage = err.message; - if (errorMessage.startsWith("the tx doesn't have the correct nonce. account has nonce of: ")) { - // a race condition between the pool and the miner could potentially - // cause this issue. - // We do NOT want to re-run this transaction. - // Update the `priced` heap with the next best transaction from this - // account - const pendingOrigin = pending.get(origin) - if (pendingOrigin.removeBest()) { - replaceFromHeap(this.#priced, pendingOrigin); - } else { - this.#priced.removeBest(); - } + // We do NOT want to re-run this transaction. + // Update the `priced` heap with the next best transaction from this + // account + const pendingOrigin = pending.get(origin) + if (pendingOrigin.removeBest()) { + replaceFromHeap(this.#priced, pendingOrigin); } else { - // TODO: handle other errors? Maybe there are some that allow this tx to - // be run again later? For now, just remove it so stuff works. - - // Update the `priced` heap with the next best transaction from this - // account - const pendingOrigin = pending.get(origin) - if (pendingOrigin.removeBest()) { - replaceFromHeap(this.#priced, pendingOrigin); - } else { - this.#priced.removeBest(); - } + this.#priced.removeBest(); } const e = {execResult: {runState: {programCounter: 0}, exceptionError: {error: errorMessage}, returnValue: Buffer.allocUnsafe(0)}} as any; From dd4c7257642cac2eaac0199a05e14b3cb05eb946 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 16:45:40 -0400 Subject: [PATCH 593/691] clean up tx data storage --- src/chains/ethereum/src/blockchain.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 6ed832f65e..c2ae494a76 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -232,9 +232,9 @@ export default class Blockchain extends Emittery.Typed { const hash = tx.hash(); - // TODO: clean up transaction extra data stuffs because this is gross: - const extraData = [...tx.raw, blockHash, blockNumber, Quantity.from(i).toBuffer(), Buffer.from([tx.type]), tx.from]; - const encodedTx = rlpEncode(extraData); + const index = Quantity.from(i).toBuffer(); + const txAndExtraData = [...tx.raw, blockHash, blockNumber, index, Buffer.from([tx.type]), tx.from]; + const encodedTx = rlpEncode(txAndExtraData); this.transactions.set(hash, encodedTx); const receipt = tx.getReceipt(); @@ -243,7 +243,7 @@ export default class Blockchain extends Emittery.Typed { blockLogs.append( - Quantity.from(i).toBuffer(), + index, hash, log ); From 64f6ad503a8c70a2140cadc2bb7bdf64077bee19 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 16:46:40 -0400 Subject: [PATCH 594/691] update reorg-related commment --- src/chains/ethereum/src/things/blocklogs.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index a4adf85abc..fe947fb9af 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -68,12 +68,12 @@ export default class BlockLogs { */ public append(/*removed: boolean, */transactionIndex: Buffer, transactionHash: Buffer, log: TransactionLog) { this[_raw][1].push([ - utils.BUFFER_ZERO, // `removed`, TODO: this is used for uncles, but we don't support them yet - transactionIndex, // transactionIndex - transactionHash, // transactionHash - log[0], // `address` - log[1], // `topics` - log[2] // `data` + utils.BUFFER_ZERO, // `removed`, TODO: this is used for reorgs, but we don't support them yet + transactionIndex, // transactionIndex + transactionHash, // transactionHash + log[0], // `address` + log[1], // `topics` + log[2] // `data` ]) } From 93f60e29fa1b9c7cfac1eca4f6be33c2018f6d59 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 16:49:00 -0400 Subject: [PATCH 595/691] remove bad TODO --- src/chains/ethereum/src/things/transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 2b1c5f9262..f3dc7a3ce7 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -438,7 +438,7 @@ class Transaction extends (EthereumJsTransaction as any) { value: Quantity.from(this.value), gas: Quantity.from(this.gasLimit), gasPrice: Quantity.from(this.gasPrice), - input: Data.from(this.data), // TODO: this output format probably needs the 0x stripped. + input: Data.from(this.data), v: Quantity.from(this.v), r: Quantity.from(this.r), s: Quantity.from(this.s) From 3bef02800eaf8181b5fa32dd6fa0f7eeed2aab2b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 16:53:28 -0400 Subject: [PATCH 596/691] verify test --- src/packages/core/__tests__/server.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/__tests__/server.test.ts index f5780eeec4..67da49e62e 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -306,8 +306,6 @@ describe("server", () => { params: [] }; try { - // TODO: should we expect a 200 OK response with an `error` property - // in a json rpc body? Probably, because we _do_ already send one. :-/ const response = await request.post("http://localhost:" + port).send(jsonRpcJson); assert.strictEqual(response.status, 200); assert.strictEqual(JSON.parse(response.text).error.message, "notifications not supported"); From d0d46287e55c7c440e116245ec56209d6211996c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 16:56:02 -0400 Subject: [PATCH 597/691] chains initialize their own options --- src/packages/core/src/connector.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index 69eed67172..86641ce756 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -6,7 +6,6 @@ import {Options as ProviderOptions} from "@ganache/flavors"; * Loads the connector specified by the given `flavor` */ export default { - // TODO: set missing defaults automatically initialize: (providerOptions: ProviderOptions = {flavor: DefaultFlavor, chain: {asyncRequestProcessing: true}}) => { const flavor = providerOptions.flavor || DefaultFlavor; From d9e810e5d11e9fdb699e2b0430c95d60f1732bbc Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 17:00:55 -0400 Subject: [PATCH 598/691] update .gitignore to better reflect latest repo --- .gitignore | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.gitignore b/.gitignore index 9918f5fd46..ef45fb5aaf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,7 @@ node_modules -TODO -*.log -.eslintrc.js -.tern-project .DS_Store -.tern-port .vscode -build -dist .nyc_output -test/testdb/* lerna-debug.log npm-debug.log src/**/*/lib From 810d5e639999339e9790bc175c26ddac630bd2a1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 17:30:50 -0400 Subject: [PATCH 599/691] add comment about total_difficulty and forking --- src/chains/ethereum/src/data-managers/block-manager.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/data-managers/block-manager.ts b/src/chains/ethereum/src/data-managers/block-manager.ts index 9e249de617..51c6f2d482 100644 --- a/src/chains/ethereum/src/data-managers/block-manager.ts +++ b/src/chains/ethereum/src/data-managers/block-manager.ts @@ -6,6 +6,9 @@ import {Quantity, Data} from "@ganache/utils"; import Transaction from "../things/transaction"; import {decode as rlpDecode} from "rlp"; import Common from "ethereumjs-common"; +import { utils } from "@ganache/utils"; + +const RPCQUANTITY_ZERO = utils.RPCQUANTITY_ZERO; const NOTFOUND = 404; const EMPTY_BUFFER = Buffer.from([]); @@ -229,7 +232,9 @@ export class Block { receiptsRoot: Data.from(header.receiptTrie), miner: Data.from(header.coinbase), difficulty: Quantity.from(header.difficulty), - totalDifficulty: Quantity.from(header.difficulty), // TODO: Figure out what to do here. + // TODO(forking): since ganache's difficulty is always 0, `totalDifficulty` for new blocks + // should just be the forked block's `difficulty`. See https://ethereum.stackexchange.com/a/7102/44640 + totalDifficulty: RPCQUANTITY_ZERO, extraData: Data.from(header.extraData), size: Quantity.from(this.size), gasLimit: Quantity.from(header.gasLimit), From 288adc36e2f71675bea6e208d662bd70eec4002f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 17:38:25 -0400 Subject: [PATCH 600/691] Add package.json descriptions to ethereum and tezos --- src/chains/ethereum/package.json | 2 +- src/chains/tezos/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index ef72f4431d..d4c5037d42 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -1,7 +1,7 @@ { "name": "@ganache/ethereum", "version": "2.2.1", - "description": "> TODO: description", + "description": "ganache-core's Ethereum client implementation", "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index fbcb994e25..3e72bd815f 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -1,7 +1,7 @@ { "name": "@ganache/tezos", "version": "2.2.1", - "description": "> TODO: description", + "description": "ganache-core's Tezos client implementation", "author": "David Murdoch ", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", From fcb866daf2fbbc2106b5b4eb8bce1ef6aab0a405 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 17:42:41 -0400 Subject: [PATCH 601/691] update .npmignore files --- .npmignore | 14 -------------- scripts/create.ts | 10 +++++++++- src/chains/ethereum/.npmignore | 7 +++++++ src/chains/tezos/.npmignore | 7 +++++++ src/packages/core/.npmignore | 7 +++++++ src/packages/flavors/.npmignore | 7 +++++++ src/packages/options/.npmignore | 7 +++++++ src/packages/promise-queue/.npmignore | 7 +++++++ src/packages/utils/.npmignore | 7 +++++++ 9 files changed, 58 insertions(+), 15 deletions(-) delete mode 100644 .npmignore diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 706a8bde7b..0000000000 --- a/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -.npmignore -.tern-project -.tern-port -.dockerignore -.eslintrc.js -.github/ -*.log -Dockerfile -ISSUE_TEMPLATE.md -.vscode/ -build/ -webpack/ -perf/ -scripts/ diff --git a/scripts/create.ts b/scripts/create.ts index d990c48f65..347054a73b 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -143,7 +143,15 @@ export * from "./src/index"; function initRootIndex() { return Promise.all([ - writeFile(join(dir, ".npmignore"), "./index.ts\n"), + writeFile(join(dir, ".npmignore"), `./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json +`), writeFile(join(dir, "index.ts"), prettier.format(rootIndexFile, {...prettierConfig, parser: "typescript"})), ]); } diff --git a/src/chains/ethereum/.npmignore b/src/chains/ethereum/.npmignore index a8ca347bfb..b1e1059b5c 100644 --- a/src/chains/ethereum/.npmignore +++ b/src/chains/ethereum/.npmignore @@ -1 +1,8 @@ ./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/chains/tezos/.npmignore b/src/chains/tezos/.npmignore index a8ca347bfb..b1e1059b5c 100644 --- a/src/chains/tezos/.npmignore +++ b/src/chains/tezos/.npmignore @@ -1 +1,8 @@ ./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/packages/core/.npmignore b/src/packages/core/.npmignore index a8ca347bfb..b1e1059b5c 100644 --- a/src/packages/core/.npmignore +++ b/src/packages/core/.npmignore @@ -1 +1,8 @@ ./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/packages/flavors/.npmignore b/src/packages/flavors/.npmignore index a8ca347bfb..b1e1059b5c 100644 --- a/src/packages/flavors/.npmignore +++ b/src/packages/flavors/.npmignore @@ -1 +1,8 @@ ./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/packages/options/.npmignore b/src/packages/options/.npmignore index a8ca347bfb..b1e1059b5c 100644 --- a/src/packages/options/.npmignore +++ b/src/packages/options/.npmignore @@ -1 +1,8 @@ ./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/packages/promise-queue/.npmignore b/src/packages/promise-queue/.npmignore index a8ca347bfb..b1e1059b5c 100644 --- a/src/packages/promise-queue/.npmignore +++ b/src/packages/promise-queue/.npmignore @@ -1 +1,8 @@ ./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/packages/utils/.npmignore b/src/packages/utils/.npmignore index a8ca347bfb..b1e1059b5c 100644 --- a/src/packages/utils/.npmignore +++ b/src/packages/utils/.npmignore @@ -1 +1,8 @@ ./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json From da9af6db4f5b866e8356ba6a9e3f931d3a1ab0d6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 17:42:48 -0400 Subject: [PATCH 602/691] add licenses to all packages --- src/chains/ethereum/LICENSE | 23 +++++++++++++++++++++++ src/chains/tezos/LICENSE | 23 +++++++++++++++++++++++ src/packages/core/LICENSE | 23 +++++++++++++++++++++++ src/packages/flavors/LICENSE | 23 +++++++++++++++++++++++ src/packages/options/LICENSE | 23 +++++++++++++++++++++++ src/packages/promise-queue/LICENSE | 23 +++++++++++++++++++++++ src/packages/utils/LICENSE | 23 +++++++++++++++++++++++ 7 files changed, 161 insertions(+) create mode 100644 src/chains/ethereum/LICENSE create mode 100644 src/chains/tezos/LICENSE create mode 100644 src/packages/core/LICENSE create mode 100644 src/packages/flavors/LICENSE create mode 100644 src/packages/options/LICENSE create mode 100644 src/packages/promise-queue/LICENSE create mode 100644 src/packages/utils/LICENSE diff --git a/src/chains/ethereum/LICENSE b/src/chains/ethereum/LICENSE new file mode 100644 index 0000000000..89ab9cf5a7 --- /dev/null +++ b/src/chains/ethereum/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2015 Iuri Matias + +Copyright (c) 2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/chains/tezos/LICENSE b/src/chains/tezos/LICENSE new file mode 100644 index 0000000000..89ab9cf5a7 --- /dev/null +++ b/src/chains/tezos/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2015 Iuri Matias + +Copyright (c) 2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/packages/core/LICENSE b/src/packages/core/LICENSE new file mode 100644 index 0000000000..89ab9cf5a7 --- /dev/null +++ b/src/packages/core/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2015 Iuri Matias + +Copyright (c) 2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/packages/flavors/LICENSE b/src/packages/flavors/LICENSE new file mode 100644 index 0000000000..89ab9cf5a7 --- /dev/null +++ b/src/packages/flavors/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2015 Iuri Matias + +Copyright (c) 2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/packages/options/LICENSE b/src/packages/options/LICENSE new file mode 100644 index 0000000000..89ab9cf5a7 --- /dev/null +++ b/src/packages/options/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2015 Iuri Matias + +Copyright (c) 2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/packages/promise-queue/LICENSE b/src/packages/promise-queue/LICENSE new file mode 100644 index 0000000000..89ab9cf5a7 --- /dev/null +++ b/src/packages/promise-queue/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2015 Iuri Matias + +Copyright (c) 2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/packages/utils/LICENSE b/src/packages/utils/LICENSE new file mode 100644 index 0000000000..89ab9cf5a7 --- /dev/null +++ b/src/packages/utils/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2015 Iuri Matias + +Copyright (c) 2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From f7dfd0cba70d6d27e18e4142448cb1188331e84b Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 17:52:02 -0400 Subject: [PATCH 603/691] some more template tweaks --- scripts/create.ts | 13 ++++++++++--- src/packages/core/package.json | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/create.ts b/scripts/create.ts index 347054a73b..e587c6f06e 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -5,9 +5,11 @@ import prettier from "prettier"; import {version} from "../lerna.json"; import camelCase from "camelcase"; import npa from "npm-package-arg"; -import { lstatSync as lstat, readdirSync as readDir } from "fs"; +import { lstatSync as lstat, readdirSync as readDir, readFileSync as readFile } from "fs"; import chalk from "chalk"; import { highlight } from "cli-highlight"; +import { promisify } from "util"; + const isDir = (s: string) => lstat(s).isDirectory(); const getDirectories = (s: string) => readDir(s).filter(n => isDir(join(s, n))); @@ -69,7 +71,11 @@ process.stdout.write(`${COLORS.Reset}`); let location = argv.location; try { + const workspaceDir = join(__dirname, "../"); + const LICENSE = readFile(join(workspaceDir, "LICENSE"), "utf-8"); + const prettierConfig = await prettier.resolveConfig(process.cwd()); + name = npa(name).name; const packageName = `@ganache/${name}`; @@ -93,7 +99,7 @@ process.stdout.write(`${COLORS.Reset}`); scripts: { tsc: "ts-node ../../../scripts/compile", test: "nyc npm run mocha", - mocha: "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**.ts'" + mocha: "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" @@ -133,7 +139,7 @@ describe("${packageName}", () => { export * from "./src/index"; `; - const dir = join(__dirname, "../src", location, name); + const dir = join(workspaceDir, "src", location, name); const tests = join(dir, "__tests__"); const src = join(dir, "src"); @@ -153,6 +159,7 @@ tsconfig.json typedoc.json `), writeFile(join(dir, "index.ts"), prettier.format(rootIndexFile, {...prettierConfig, parser: "typescript"})), + writeFile(join(dir, "LICENSE"), LICENSE) ]); } diff --git a/src/packages/core/package.json b/src/packages/core/package.json index 09dc411c98..cb47e841b3 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -25,7 +25,7 @@ "scripts": { "tsc": "ts-node ../../../scripts/compile", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register --recursive '__tests__/**.ts'" + "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" From f6face0976b1ebf72ceff9f6930c6f597c9ec1cf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 18:11:06 -0400 Subject: [PATCH 604/691] update dev docs --- completions.sh | 1 + docs/README.md | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/completions.sh b/completions.sh index 259e22d8fc..0d6683ca87 100644 --- a/completions.sh +++ b/completions.sh @@ -12,6 +12,7 @@ _npmScriptsCompletions() type_list=$(node -e "console.log(Object.keys(require('./package.json').scripts).join('\n'))") COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) ) else + # if the command if the create command (npm run create) get its completion values if [ "${COMP_WORDS[1]}" == "run" ] && [ "${COMP_WORDS[2]}" == "create" ]; then while [[ "$#" -gt 0 ]]; do case $1 in diff --git a/docs/README.md b/docs/README.md index 995e75c020..90342659dc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,6 +7,7 @@ * `git clone git@github.com:trufflesuite/ganache-core.git` * `cd ganache-core` * `npm install` + * On Unix systems: run `source completions.sh` to enable npm script autocomplete ## Solving node-gyp issues @@ -114,7 +115,7 @@ These are guidelines, not rules. :-) `Number.MAX_SAFE_INTEGER`. * Write tests. * Do not use "Optional Chaining" (`obj?.prop`). I'd love to enable this, but TypeScript makes it hard to use bigint - literals and optional chaining together. + literals and optional chaining together. If you figure it out, delete this rule! * Prefer using a single loop to functional chaining. * Prefer performant code over your own developer experience. * Document complex code. Explain why the code does what it does. @@ -122,7 +123,7 @@ These are guidelines, not rules. :-) too. * Add JSDoc comments to public class members where it makes sense. * Before adding an external dependency check its code for quality, its # of external dependencies, its node version - support, and make sure it absolutely necessary. + support, and make sure it's absolutely necessary. * Pin all dependencies, even dev dependencies. * Use npm; do not use yarn. * Don't use web3, ethers, etc in ganache-core core code. (Tests are fine) From 84c60eed1cd09cf51c5170030f677fb466f9f797 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 18:37:23 -0400 Subject: [PATCH 605/691] add some helpful npm defaults --- .npmrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.npmrc b/.npmrc index 682648b40b..eb29e2d5fe 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,6 @@ engine-strict=true save-exact=true +sign-git-commit=true sign-git-tag=true +loglevel=error +fund=false From 1f477f2e446af101473ef541cdc9bafb16d8d025 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 18:37:31 -0400 Subject: [PATCH 606/691] make clean clean more things --- npm-shrinkwrap.json | 36 ++++++++++++++++++++++++++++++++++++ package.json | 6 ++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index da9a84d3ad..00f2796b2e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -7067,6 +7067,12 @@ } } }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true + }, "into-stream": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz", @@ -10134,6 +10140,15 @@ "picomatch": "^2.2.1" } }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, "redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -10482,6 +10497,27 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "shx": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.3.tgz", + "integrity": "sha512-nZJ3HFWVoTSyyB+evEKjJ1STiixGztlqwKLTUNV5KqMWtGey9fTd4KU1gdZ1X9BV6215pswQ/Jew9NsuS/fNDA==", + "dev": true, + "requires": { + "minimist": "^1.2.3", + "shelljs": "^0.8.4" + } + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", diff --git a/package.json b/package.json index ecb07b37f9..059779534c 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,14 @@ }, "scripts": { "build:docs": "lerna exec --no-bail npm run build:docs", - "clean": "npx shx rm -rf node_modules && npx lerna clean -y", + "clean": "npx shx rm -rf node_modules && npx lerna clean -y && npm run tsc:clean", "create": "ts-node ./scripts/create", "preview:docs": "lerna exec --no-bail npm run preview:docs", "prepare": "lerna bootstrap && echo \"\n\\033[1;36m Tip:\\033[0;36m run \\033[1;2;33msource completions.sh\\033[0;36m to supply bash completions for npm scripts\\033[0m\n\"", "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm test", - "tsc": "lerna exec -- npm run tsc" + "tsc": "lerna exec -- npm run tsc", + "tsc:clean": "lerna exec -- npx shx rm -rf lib" }, "dependencies": { "bip39": "3.0.2", @@ -58,6 +59,7 @@ "npm-package-arg": "8.1.0", "nyc": "15.1.0", "prettier": "2.1.2", + "shx": "0.3.3", "solc": "0.7.4", "superagent": "6.1.0", "ts-morph": "7.3.0", From ae5d1c17f82b33993c8c74cea3b7d9a9064211cf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 18:37:50 -0400 Subject: [PATCH 607/691] update docs about what `npm run clean` does --- docs/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/README.md b/docs/README.md index 90342659dc..f0cd7cd263 100644 --- a/docs/README.md +++ b/docs/README.md @@ -39,6 +39,9 @@ Which just runs these commands for you: * `npm run clean` * `npm install` + This deletes all `node_modules` folders, as well as all generated `lib` + directories. + ## VSCode On Windows (10) * Enable "Developer Mode" by going to Settings -> Developer Settings -> Then select Developer Mode. From c29eca8726d74938c5954f409d43b33efd4e6cbd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 18:48:49 -0400 Subject: [PATCH 608/691] source completion.sh choked on commands that contains a colon, change those commands --- package.json | 8 ++++---- src/chains/ethereum/package.json | 6 +++--- src/chains/tezos/package.json | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 059779534c..bd7296a939 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,15 @@ "npm": ">=6.1.0" }, "scripts": { - "build:docs": "lerna exec --no-bail npm run build:docs", - "clean": "npx shx rm -rf node_modules && npx lerna clean -y && npm run tsc:clean", + "docs.build": "lerna exec --no-bail npm run docs.build", + "docs.preview": "lerna exec --no-bail npm run docs.preview", + "clean": "npx shx rm -rf node_modules && npx lerna clean -y && npm run tsc.clean", "create": "ts-node ./scripts/create", - "preview:docs": "lerna exec --no-bail npm run preview:docs", "prepare": "lerna bootstrap && echo \"\n\\033[1;36m Tip:\\033[0;36m run \\033[1;2;33msource completions.sh\\033[0;36m to supply bash completions for npm scripts\\033[0m\n\"", "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm test", "tsc": "lerna exec -- npm run tsc", - "tsc:clean": "lerna exec -- npx shx rm -rf lib" + "tsc.clean": "lerna exec -- npx shx rm -rf lib" }, "dependencies": { "bip39": "3.0.2", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index d4c5037d42..6dcb01a1b1 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -23,9 +23,9 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run post-process:docs", - "post-process:docs": "node ./scripts/post-process-docs.js", - "preview:docs": "ws --open --port 3010 --directory ./lib/docs", + "docs.build": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run docs.post-process", + "docs.post-process": "node ./scripts/post-process-docs.js", + "docs.preview": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", "test": "nyc --reporter lcov npm run mocha", "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register --require source-map-support/register '__tests__/**/*.test.ts'" diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 3e72bd815f..67defbb5a5 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -23,9 +23,9 @@ "url": "git+https://github.com/trufflesuite/ganache-core.git" }, "scripts": { - "build:docs": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run post-process:docs", - "post-process:docs": "node ./scripts/post-process-docs.js", - "preview:docs": "ws --open --port 3011 --directory ./lib/docs", + "docs.build": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run docs.post-process", + "docs.post-process": "node ./scripts/post-process-docs.js", + "docs.preview": "ws --open --port 3011 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile" }, "bugs": { From 5b8198c6349dbd68ddfc0b100e63f8b6ea3cb8e0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 19:03:47 -0400 Subject: [PATCH 609/691] improve launch.json example --- docs/launch.json | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/docs/launch.json b/docs/launch.json index 65b7050dfe..2a2aa9e6f2 100644 --- a/docs/launch.json +++ b/docs/launch.json @@ -12,27 +12,21 @@ "env": { "TS_NODE_FILES": "true" }, - "runtimeArgs": [ - "--throw-deprecation", - "--trace-warnings" - ], // 10.7.0 is the earliest version of Node.js that we support, and is the first version to support BigInt literals. "runtimeVersion": "10.7.0", "args": [ "${workspaceFolder}/node_modules/mocha/bin/_mocha", - "--timeout", - "999999", + "--throw-deprecation", + "--trace-warnings", + "--check-leaks", + "--no-timeout", "--colors", "--require", "ts-node/register", - "--watch-extensions", - "ts", - "--recursive", - "--check-leaks", - "${workspaceFolder}/src/**/__tests__/**/*.test.ts" + "${workspaceFolder}/src/**/_tests__/**/*.test.ts" ], "skipFiles": [ - "/**/*.js" + "/**" ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen" From 67e58d3f1d7dde26149c627ec8bba74b4d282486 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 27 Oct 2020 19:07:19 -0400 Subject: [PATCH 610/691] improve docs --- docs/README.md | 31 +++++++++++++++++-------------- docs/launch.json | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/docs/README.md b/docs/README.md index f0cd7cd263..183e3b8241 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,12 +2,15 @@ ## Getting set up - * Use Node.js v10.7.0, this is the earliest version we support. - * Why v10.7.0? Because this is the first version that supports with BigInt literals (the `n` in `100n`). - * `git clone git@github.com:trufflesuite/ganache-core.git` - * `cd ganache-core` - * `npm install` - * On Unix systems: run `source completions.sh` to enable npm script autocomplete +* Use Node.js v10.7.0, this is the earliest version we support. + * Why v10.7.0? Because this is the first version that supports BigInt literals (the `n` in `100n`). + * recommendation: use [nvm](https://github.com/nvm-sh/nvm) on Linux and macOS, and [nvm-windows](https://github.com/coreybutler/nvm-windows) on + Windows, to configure your node version. + * On Linux and macOS, if you have `nvm` installed, just run `nvm use` switch to Node.js v10.7.0. +* `git clone git@github.com:trufflesuite/ganache-core.git` +* `cd ganache-core` +* `npm install` (use npm v6) +* On Linux and macOS: run `source completions.sh` to enable npm script autocomplete ## Solving node-gyp issues @@ -40,7 +43,7 @@ Which just runs these commands for you: * `npm install` This deletes all `node_modules` folders, as well as all generated `lib` - directories. + directories, then reinstalls all modules. ## VSCode On Windows (10) @@ -95,18 +98,18 @@ example to debug only test files in the ethereum package: ```diff diff --git a/.vscode/launch.json b/.vscode/launch.json -index 688d3d4..815e111 100644 +index 2a2aa9e..57cbf21 100644 --- a/.vscode/launch.json -+++ b/.vscode/launch.json -@@ -28,7 +28,7 @@ - "ts", - "--recursive", - "--check-leaks", ++++ b/.vscode/launch.json +@@ -23,7 +23,7 @@ + "--colors", + "--require", + "ts-node/register", - "${workspaceFolder}/src/**/__tests__/**/*.test.ts" + "${workspaceFolder}/src/chains/ethereum/__tests__/**/*.test.ts" ], "skipFiles": [ - "/**/*.js" + "/**" ``` ## Code Conventions diff --git a/docs/launch.json b/docs/launch.json index 2a2aa9e6f2..cfd06fdc21 100644 --- a/docs/launch.json +++ b/docs/launch.json @@ -23,7 +23,7 @@ "--colors", "--require", "ts-node/register", - "${workspaceFolder}/src/**/_tests__/**/*.test.ts" + "${workspaceFolder}/src/**/__tests__/**/*.test.ts" ], "skipFiles": [ "/**" From 8cabcd3a0a061d22820776ae55ea203b34f22755 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 11:26:14 -0400 Subject: [PATCH 611/691] make sure `tsc.clean` script works after a `clean` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bd7296a939..e70b4617d8 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm test", "tsc": "lerna exec -- npm run tsc", - "tsc.clean": "lerna exec -- npx shx rm -rf lib" + "tsc.clean": "npx lerna exec -- npx shx rm -rf lib" }, "dependencies": { "bip39": "3.0.2", From 0118153695039a3750479d06a84bd82c21ddb067 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 11:27:15 -0400 Subject: [PATCH 612/691] marking this as a won't fix --- src/chains/ethereum/src/api.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index f5e0d7d597..82d0dd76b1 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -574,7 +574,6 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(0) async net_listening() { - // TODO: this should return false when ganache isn't used with a server. return true; } From 8cd8c8b4c125288c37d3b9cf440d0be1f09d8698 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 11:47:01 -0400 Subject: [PATCH 613/691] eth_subscribe doesn't emit pending blocks --- src/chains/ethereum/src/api.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 82d0dd76b1..ba4f1fae8f 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1262,16 +1262,16 @@ export default class EthereumApi implements types.Api { const value = block.value; const header = value.header; const result = { - "logsBloom": Data.from(header.bloom, 256), // TODO: pending block + "logsBloom": Data.from(header.bloom, 256), "miner": Address.from(header.coinbase), "difficulty": Quantity.from(header.difficulty), "extraData": Data.from(header.extraData), "gasLimit": Quantity.from(header.gasLimit), "gasUsed": Quantity.from(header.gasUsed), - "hash": Data.from(value.hash(), 32), // TODO: pending block + "hash": Data.from(value.hash(), 32), "mixHash": Data.from(header.mixHash, 32), - "nonce": Data.from(header.nonce, 8), // TODO: pending block - "number": Quantity.from(header.number, true), // TODO: pending block + "nonce": Data.from(header.nonce, 8), + "number": Quantity.from(header.number, true), "parentHash": Data.from(header.parentHash, 32), "receiptsRoot": Data.from(header.receiptTrie, 32), "stateRoot": Data.from(header.stateRoot, 32), @@ -1331,7 +1331,7 @@ export default class EthereumApi implements types.Api { return promiEvent; } case "syncing": { - // TODO: ? + // ganache doesn't sync, so doing nothing is perfectly valid. const subscription = this.#getId(); const promiEvent = PromiEvent.resolve(subscription); From d4e0d50d4d7245439f607ddeac9adf41a71f62cb Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 16:19:53 -0400 Subject: [PATCH 614/691] update package.json and licenses --- LICENSE | 4 +- npm-shrinkwrap.json | 88 +++++++++++++++++++++++++ package.json | 3 + scripts/create.ts | 11 ++-- src/chains/ethereum/LICENSE | 4 +- src/chains/ethereum/package.json | 2 +- src/chains/tezos/LICENSE | 4 +- src/chains/tezos/package.json | 2 +- src/packages/core/LICENSE | 4 +- src/packages/core/package.json | 2 +- src/packages/flavors/LICENSE | 4 +- src/packages/flavors/package.json | 2 + src/packages/options/LICENSE | 4 +- src/packages/options/package.json | 2 + src/packages/promise-queue/LICENSE | 4 +- src/packages/promise-queue/package.json | 4 +- src/packages/utils/LICENSE | 4 +- src/packages/utils/package.json | 2 +- 18 files changed, 117 insertions(+), 33 deletions(-) diff --git a/LICENSE b/LICENSE index 89ab9cf5a7..39f3b14498 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Iuri Matias - -Copyright (c) 2020 Truffle Blockchain Group +Copyright (c) 2019-2020 Truffle Blockchain Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 00f2796b2e..84bfbd500a 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -5936,6 +5936,12 @@ "integrity": "sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==", "dev": true }, + "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=", + "dev": true + }, "fs-extra": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", @@ -6282,6 +6288,28 @@ "assert-plus": "^1.0.0" } }, + "git-config-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", + "integrity": "sha1-bTP37WPbDQ4RgTFQO6s6ykfVRmQ=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "homedir-polyfill": "^1.0.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "git-raw-commits": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", @@ -6520,6 +6548,28 @@ "git-up": "^4.0.0" } }, + "git-user-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-user-name/-/git-user-name-2.0.0.tgz", + "integrity": "sha512-1DC8rUNm2I5V9v4eIpK6PSjKCp9bI0t6Wl05WSk+xEMS8GhR8GWzxM3aGZfPrfuqEfWxSbui5/pQJryJFXqCzQ==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "git-config-path": "^1.0.1", + "parse-git-config": "^1.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "gitconfiglocal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", @@ -6766,6 +6816,15 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, "hosted-git-info": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", @@ -9670,6 +9729,29 @@ } } }, + "parse-git-config": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", + "integrity": "sha1-06mYQxcTL1c5hxK7pDjhKVkN34w=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "git-config-path": "^1.0.1", + "ini": "^1.3.4" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "parse-github-repo-url": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", @@ -9686,6 +9768,12 @@ "json-parse-better-errors": "^1.0.1" } }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, "parse-path": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.2.tgz", diff --git a/package.json b/package.json index e70b4617d8..b2b9ec9e37 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,7 @@ { "name": "root", + "description": "> TODO: description", + "author": "David Murdoch (https://davidmurdoch.com)", "private": true, "engines": { "node": ">=10.7.0 <=14.14.0", @@ -53,6 +55,7 @@ "cli-highlight": "2.1.4", "cross-env": "7.0.2", "fs-extra": "9.0.1", + "git-user-name": "2.0.0", "into-stream": "6.0.0", "lerna": "3.22.1", "mocha": "8.2.0", diff --git a/scripts/create.ts b/scripts/create.ts index e587c6f06e..c47f3c5519 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -1,3 +1,5 @@ +// TODO: make this its own package? + import {mkdir, mkdirSync, writeFile} from "fs-extra"; import yargs from "yargs"; import {join, resolve} from "path"; @@ -8,8 +10,7 @@ import npa from "npm-package-arg"; import { lstatSync as lstat, readdirSync as readDir, readFileSync as readFile } from "fs"; import chalk from "chalk"; import { highlight } from "cli-highlight"; -import { promisify } from "util"; - +import userName from "git-user-name"; const isDir = (s: string) => lstat(s).isDirectory(); const getDirectories = (s: string) => readDir(s).filter(n => isDir(join(s, n))); @@ -79,14 +80,16 @@ process.stdout.write(`${COLORS.Reset}`); name = npa(name).name; const packageName = `@ganache/${name}`; + let packageAuthor = userName(); const pkg = { name: packageName, version: version, + author: packageAuthor || require("../package.json").author, homepage: "https://github.com/trufflesuite/ganache-core#readme", license: "MIT", main: "lib/index.js", - typings: "src/index.ts", + types: "src/index.ts", directories: { lib: "lib", test: "__tests__" @@ -203,7 +206,7 @@ typedoc.json })); console.log( - chalk`{green success} {magenta create} New package {bgBlack ${name} } created. New package created at ./src/packages/${name}.\n\n Entry point: {bold ${dir}/src/index.ts}` + chalk`{green success} {magenta create} New package {bgBlack ${name} } created. New package created at ./src/packages/${name}.\n\n package.json: {bold ${dir}/package.json}` ); } catch (e) { console.error(e); diff --git a/src/chains/ethereum/LICENSE b/src/chains/ethereum/LICENSE index 89ab9cf5a7..39f3b14498 100644 --- a/src/chains/ethereum/LICENSE +++ b/src/chains/ethereum/LICENSE @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Iuri Matias - -Copyright (c) 2020 Truffle Blockchain Group +Copyright (c) 2019-2020 Truffle Blockchain Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 6dcb01a1b1..bc4f1812bd 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -2,7 +2,7 @@ "name": "@ganache/ethereum", "version": "2.2.1", "description": "ganache-core's Ethereum client implementation", - "author": "David Murdoch ", + "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", diff --git a/src/chains/tezos/LICENSE b/src/chains/tezos/LICENSE index 89ab9cf5a7..39f3b14498 100644 --- a/src/chains/tezos/LICENSE +++ b/src/chains/tezos/LICENSE @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Iuri Matias - -Copyright (c) 2020 Truffle Blockchain Group +Copyright (c) 2019-2020 Truffle Blockchain Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 67defbb5a5..ae461d6618 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -2,7 +2,7 @@ "name": "@ganache/tezos", "version": "2.2.1", "description": "ganache-core's Tezos client implementation", - "author": "David Murdoch ", + "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", diff --git a/src/packages/core/LICENSE b/src/packages/core/LICENSE index 89ab9cf5a7..39f3b14498 100644 --- a/src/packages/core/LICENSE +++ b/src/packages/core/LICENSE @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Iuri Matias - -Copyright (c) 2020 Truffle Blockchain Group +Copyright (c) 2019-2020 Truffle Blockchain Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/packages/core/package.json b/src/packages/core/package.json index cb47e841b3..c888b2b917 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -2,7 +2,7 @@ "name": "@ganache/core", "version": "2.2.1", "description": "> TODO: description", - "author": "David Murdoch ", + "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", diff --git a/src/packages/flavors/LICENSE b/src/packages/flavors/LICENSE index 89ab9cf5a7..39f3b14498 100644 --- a/src/packages/flavors/LICENSE +++ b/src/packages/flavors/LICENSE @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Iuri Matias - -Copyright (c) 2020 Truffle Blockchain Group +Copyright (c) 2019-2020 Truffle Blockchain Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/packages/flavors/package.json b/src/packages/flavors/package.json index 96ca1c50b4..aa25313963 100644 --- a/src/packages/flavors/package.json +++ b/src/packages/flavors/package.json @@ -1,6 +1,8 @@ { "name": "@ganache/flavors", "version": "2.2.1", + "description": "> TODO: description", + "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", diff --git a/src/packages/options/LICENSE b/src/packages/options/LICENSE index 89ab9cf5a7..39f3b14498 100644 --- a/src/packages/options/LICENSE +++ b/src/packages/options/LICENSE @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Iuri Matias - -Copyright (c) 2020 Truffle Blockchain Group +Copyright (c) 2019-2020 Truffle Blockchain Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/packages/options/package.json b/src/packages/options/package.json index 0e2f62ab5b..60b13c4b6e 100644 --- a/src/packages/options/package.json +++ b/src/packages/options/package.json @@ -1,6 +1,8 @@ { "name": "@ganache/options", "version": "2.2.1", + "description": "> TODO: description", + "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", diff --git a/src/packages/promise-queue/LICENSE b/src/packages/promise-queue/LICENSE index 89ab9cf5a7..39f3b14498 100644 --- a/src/packages/promise-queue/LICENSE +++ b/src/packages/promise-queue/LICENSE @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Iuri Matias - -Copyright (c) 2020 Truffle Blockchain Group +Copyright (c) 2019-2020 Truffle Blockchain Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index 0df12d2b71..df5e3ff746 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -1,10 +1,12 @@ { "name": "@ganache/promise-queue", "version": "2.2.1", + "description": "> TODO: description", + "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", - "typings": "src/index.ts", + "types": "src/index.ts", "directories": { "lib": "lib", "test": "__tests__" diff --git a/src/packages/utils/LICENSE b/src/packages/utils/LICENSE index 89ab9cf5a7..39f3b14498 100644 --- a/src/packages/utils/LICENSE +++ b/src/packages/utils/LICENSE @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Iuri Matias - -Copyright (c) 2020 Truffle Blockchain Group +Copyright (c) 2019-2020 Truffle Blockchain Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index 540d125f14..8e8c4b497a 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -2,7 +2,7 @@ "name": "@ganache/utils", "version": "2.2.1", "description": "> TODO: description", - "author": "David Murdoch ", + "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", "main": "lib/index.js", From ab4a49420afbd2b27e315784c5c4d4d2950966ec Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 17:55:40 -0400 Subject: [PATCH 615/691] enable prettier --- .gitattributes | 4 +- .github/workflows/nodejs.yml | 86 ++-- .npmrc | 1 + .prettierignore | 8 + .prettierrc | 5 +- README.md | 3 +- completions.sh | 58 +-- docs/README.md | 120 +++--- docs/launch.json | 6 +- lerna.json | 5 +- npm-shrinkwrap.json | 388 ++++++++++++++++++ package.json | 11 +- scripts/compile.ts | 18 +- scripts/create.ts | 84 ++-- .../ethereum/__tests__/@types/solc/index.d.ts | 290 ++++++------- .../ethereum/__tests__/api/bzz/bzz.test.ts | 1 - .../ethereum/__tests__/api/db/db.test.ts | 1 - .../api/eth/contracts/GetStorageAt.sol | 4 +- .../__tests__/api/eth/contracts/Logs.sol | 17 +- .../__tests__/api/eth/contracts/Reverts.sol | 22 +- .../ethereum/__tests__/api/eth/eth.test.ts | 151 +++---- .../__tests__/api/eth/getCode.test.ts | 27 +- .../__tests__/api/eth/getStorageAt.test.ts | 27 +- .../api/eth/legacyInstamining.test.ts | 42 +- .../ethereum/__tests__/api/eth/logs.test.ts | 206 ++++++---- .../api/eth/sendRawTransaction.test.ts | 22 +- .../__tests__/api/eth/sendTransaction.test.ts | 23 +- .../ethereum/__tests__/api/eth/sign.test.ts | 30 +- .../__tests__/api/eth/signTypedData.test.ts | 24 +- .../__tests__/api/eth/subscribe.test.ts | 81 ++-- .../ethereum/__tests__/api/eth/uncles.test.ts | 5 +- .../ethereum/__tests__/api/evm/evm.test.ts | 73 ++-- .../ethereum/__tests__/api/evm/snapshot.sol | 2 +- .../__tests__/api/evm/snapshot.test.ts | 155 +++---- .../__tests__/api/miner/miner.test.ts | 18 +- .../ethereum/__tests__/api/net/net.test.ts | 2 +- .../__tests__/api/personal/personal.test.ts | 127 ++++-- .../__tests__/api/rpc/modules.test.ts | 10 +- .../ethereum/__tests__/api/shh/shh.test.ts | 1 - .../ethereum/__tests__/api/web3/web3.test.ts | 1 - .../__tests__/contracts/HelloWorld.sol | 24 +- .../ethereum/__tests__/helpers/compile.ts | 4 +- .../ethereum/__tests__/helpers/getProvider.ts | 12 +- .../ethereum/__tests__/provider.test.ts | 32 +- .../ethereum/__tests__/temp-tests.test.ts | 85 ++-- .../ethereum/scripts/post-process-docs.js | 27 +- .../src/@types/ethereumjs-block/header.d.ts | 4 +- .../src/@types/ethereumjs-block/index.d.ts | 2 +- .../src/@types/ethereumjs-util/index.d.ts | 4 +- .../ethereum/src/@types/hdkey/index.d.ts | 2 +- .../ethereum/src/@types/levelup/index.d.ts | 30 +- .../@types/merkle-patricia-tree/index.d.ts | 6 +- .../@types/merkle-patricia-tree/readStream.ts | 2 +- src/chains/ethereum/src/api.ts | 361 ++++++++-------- src/chains/ethereum/src/blockchain.ts | 173 ++++---- .../src/data-managers/account-manager.ts | 4 +- .../src/data-managers/block-manager.ts | 29 +- .../ethereum/src/data-managers/manager.ts | 6 +- .../src/data-managers/transaction-manager.ts | 18 +- src/chains/ethereum/src/database.ts | 18 +- src/chains/ethereum/src/errors/coded-error.ts | 6 +- .../ethereum/src/errors/runtime-error.ts | 12 +- .../ethereum/src/helpers/assert-arg-length.ts | 19 +- .../ethereum/src/helpers/filter-parsing.ts | 20 +- .../ethereum/src/helpers/gas-estimator.ts | 352 ++++++++-------- src/chains/ethereum/src/index.ts | 69 ++-- src/chains/ethereum/src/miner.ts | 95 +++-- .../ethereum/src/options/chain-options.ts | 32 +- .../ethereum/src/options/database-options.ts | 14 +- src/chains/ethereum/src/options/index.ts | 10 +- .../ethereum/src/options/logging-options.ts | 20 +- .../ethereum/src/options/miner-options.ts | 45 +- .../ethereum/src/options/wallet-options.ts | 32 +- src/chains/ethereum/src/provider.ts | 80 ++-- src/chains/ethereum/src/things/account.ts | 4 +- src/chains/ethereum/src/things/address.ts | 6 +- src/chains/ethereum/src/things/blocklogs.ts | 63 +-- src/chains/ethereum/src/things/params.ts | 11 +- .../src/things/transaction-receipt.ts | 37 +- src/chains/ethereum/src/things/transaction.ts | 92 +++-- src/chains/ethereum/src/transaction-pool.ts | 42 +- src/chains/ethereum/src/types/executables.ts | 6 +- .../src/types/extract-values-from-types.ts | 2 +- src/chains/ethereum/src/types/filters.ts | 21 +- src/chains/ethereum/src/types/snapshots.ts | 10 +- .../ethereum/src/types/tuple-from-union.ts | 23 +- src/chains/ethereum/src/wallet.ts | 45 +- src/chains/ethereum/typedoc.json | 7 +- src/chains/tezos/__tests__/index.test.ts | 8 +- src/chains/tezos/scripts/post-process-docs.js | 27 +- src/chains/tezos/src/api.ts | 2 +- src/chains/tezos/src/index.ts | 12 +- src/chains/tezos/src/provider.ts | 9 +- src/chains/tezos/typedoc.json | 7 +- src/packages/core/__tests__/connector.test.ts | 20 +- .../core/__tests__/helpers/getProvider.ts | 6 +- src/packages/core/__tests__/server.test.ts | 132 +++--- src/packages/core/src/connector.ts | 17 +- src/packages/core/src/index.ts | 2 +- src/packages/core/src/options/index.ts | 15 +- .../core/src/options/server-options.ts | 16 +- src/packages/core/src/server.ts | 12 +- src/packages/core/src/servers/http-server.ts | 17 +- .../servers/utils/websocket-close-codes.ts | 2 +- src/packages/core/src/servers/ws-server.ts | 33 +- src/packages/core/tsconfig.json | 2 +- src/packages/flavors/src/index.ts | 20 +- src/packages/options/src/helpers/base.ts | 4 +- src/packages/options/src/helpers/create.ts | 18 +- .../options/src/helpers/definition.ts | 27 +- src/packages/options/src/helpers/exclusive.ts | 236 +++++------ src/packages/options/src/helpers/getters.ts | 37 +- src/packages/options/src/helpers/index.ts | 2 +- src/packages/promise-queue/src/entry.ts | 10 +- src/packages/promise-queue/src/index.ts | 23 +- src/packages/utils/__tests__/utils.test.ts | 8 +- .../utils/src/things/json-rpc/index.ts | 2 +- .../things/json-rpc/json-rpc-base-types.ts | 12 +- .../src/things/json-rpc/json-rpc-data.ts | 4 +- .../src/things/json-rpc/json-rpc-quantity.ts | 7 +- src/packages/utils/src/things/jsonrpc.ts | 12 +- src/packages/utils/src/things/promievent.ts | 31 +- src/packages/utils/src/types/connector.ts | 15 +- src/packages/utils/src/types/index.ts | 4 +- src/packages/utils/src/types/provider.ts | 4 +- .../utils/src/utils/bigint-to-buffer.ts | 6 +- src/packages/utils/src/utils/constants.ts | 2 +- src/packages/utils/src/utils/executor.ts | 12 +- src/packages/utils/src/utils/has-own.ts | 15 +- src/packages/utils/src/utils/heap.ts | 1 - .../utils/src/utils/request-coordinator.ts | 16 +- .../utils/src/utils/uint-to-buffer.ts | 61 ++- src/packages/utils/src/utils/unref.ts | 3 +- 133 files changed, 2921 insertions(+), 2187 deletions(-) create mode 100644 .prettierignore diff --git a/.gitattributes b/.gitattributes index 8794813076..2fafdb93a2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ -docs/launch.json linguist-language=JSON5 \ No newline at end of file +docs/launch.json linguist-language=JSON5 +.nycrc linguist-language=JSON +.prettierrc linguist-language=JSON \ No newline at end of file diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 6a3977a0d8..84aa6c4cdc 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,43 +1,43 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI - -on: [push,pull_request] - -jobs: - build: - strategy: - fail-fast: false - matrix: - node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] - os: [windows-2019, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - name: Add msbuild to PATH - if: matrix.os == 'windows-2019' - uses: microsoft/setup-msbuild@v1.0.1 - - name: install node tools - if: matrix.os == 'windows-2019' - # windows-build-tools@5.2.2 failed to install, so we use 4.0.0 - run: npm install --global --production windows-build-tools@4.0.0 - - name: install node-gyp - if: matrix.os == 'windows-2019' - run: npm install --global node-gyp@latest - - name: Set node config to use python2.7 - if: matrix.os == 'windows-2019' - run: npm config set python python2.7 - - name: Set node config to set msvs_version to 2015 - if: matrix.os == 'windows-2019' - run: npm config set msvs_version 2015 - - run: npm ci - - run: npm test - env: - FORCE_COLOR: 1 \ No newline at end of file +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: [push, pull_request] + +jobs: + build: + strategy: + fail-fast: false + matrix: + node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] + os: [windows-2019, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: Add msbuild to PATH + if: matrix.os == 'windows-2019' + uses: microsoft/setup-msbuild@v1.0.1 + - name: install node tools + if: matrix.os == 'windows-2019' + # windows-build-tools@5.2.2 failed to install, so we use 4.0.0 + run: npm install --global --production windows-build-tools@4.0.0 + - name: install node-gyp + if: matrix.os == 'windows-2019' + run: npm install --global node-gyp@latest + - name: Set node config to use python2.7 + if: matrix.os == 'windows-2019' + run: npm config set python python2.7 + - name: Set node config to set msvs_version to 2015 + if: matrix.os == 'windows-2019' + run: npm config set msvs_version 2015 + - run: npm ci + - run: npm test + env: + FORCE_COLOR: 1 diff --git a/.npmrc b/.npmrc index eb29e2d5fe..e9d11a868d 100644 --- a/.npmrc +++ b/.npmrc @@ -4,3 +4,4 @@ sign-git-commit=true sign-git-tag=true loglevel=error fund=false +format-package-lock=false diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..43ecbd0792 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,8 @@ +.DS_Store +.vscode +.nyc_output +lerna-debug.log +npm-debug.log +src/**/*/lib +coverage +npm-shrinkwrap.json diff --git a/.prettierrc b/.prettierrc index 1c4ad36d29..8b767f3018 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,5 @@ { - "trailingComma": "none", - "printWidth": 120, "arrowParens": "avoid", - "bracketSpacing": false + "printWidth": 120, + "trailingComma": "none" } diff --git a/README.md b/README.md index 697f6107a1..5bdb24d4e9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ # JUST FOR EXPERIMENTS - -[Developer Documentation](./docs/README.md); \ No newline at end of file +[Developer Documentation](./docs/README.md); diff --git a/completions.sh b/completions.sh index 0d6683ca87..98b265cf29 100644 --- a/completions.sh +++ b/completions.sh @@ -1,36 +1,38 @@ #!/bin/bash -_npmScriptsCompletions() -{ - local cur_word args type_list first_arg +_npmScriptsCompletions() { + local cur_word args type_list first_arg - cur_word="${COMP_WORDS[COMP_CWORD]}" - args=("${COMP_WORDS[@]}") + cur_word="${COMP_WORDS[COMP_CWORD]}" + args=("${COMP_WORDS[@]}") - if [ "${COMP_WORDS[1]}" == "run" ] && [ ${#COMP_WORDS[@]} == 3 ]; then - # get a list of all npm scripts and add them to the bash autocomplete reply - type_list=$(node -e "console.log(Object.keys(require('./package.json').scripts).join('\n'))") - COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) ) - else - # if the command if the create command (npm run create) get its completion values - if [ "${COMP_WORDS[1]}" == "run" ] && [ "${COMP_WORDS[2]}" == "create" ]; then - while [[ "$#" -gt 0 ]]; do - case $1 in - -l|--location) - type_list=$(ls src); shift ;; - -|--l|--lo|--loc|--loca|--locat|--locati|--locatio) - # autocomplete "-l" or "--location" (but only when we don't already have the full word) - if [[ ! " ${COMP_WORDS[@]} " =~ " --location " ]] && [[ ! " ${COMP_WORDS[@]} " =~ " -l " ]]; then - type_list="--location"; - fi - shift ;; - *) shift ;; - esac - done + if [ "${COMP_WORDS[1]}" == "run" ] && [ ${#COMP_WORDS[@]} == 3 ]; then + # get a list of all npm scripts and add them to the bash autocomplete reply + type_list=$(node -e "console.log(Object.keys(require('./package.json').scripts).join('\n'))") + COMPREPLY=($(compgen -W "${type_list}" -- ${cur_word})) + else + # if the command if the create command (npm run create) get its completion values + if [ "${COMP_WORDS[1]}" == "run" ] && [ "${COMP_WORDS[2]}" == "create" ]; then + while [[ "$#" -gt 0 ]]; do + case $1 in + -l | --location) + type_list=$(ls src) + shift + ;; + - | --l | --lo | --loc | --loca | --locat | --locati | --locatio) + # autocomplete "-l" or "--location" (but only when we don't already have the full word) + if [[ ! " ${COMP_WORDS[@]} " =~ " --location " ]] && [[ ! " ${COMP_WORDS[@]} " =~ " -l " ]]; then + type_list="--location" + fi + shift + ;; + *) shift ;; + esac + done - COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) ) - fi + COMPREPLY=($(compgen -W "${type_list}" -- ${cur_word})) fi - return 0 + fi + return 0 } complete -o default -F _npmScriptsCompletions npm diff --git a/docs/README.md b/docs/README.md index 183e3b8241..95229dd77e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,15 +2,15 @@ ## Getting set up -* Use Node.js v10.7.0, this is the earliest version we support. - * Why v10.7.0? Because this is the first version that supports BigInt literals (the `n` in `100n`). - * recommendation: use [nvm](https://github.com/nvm-sh/nvm) on Linux and macOS, and [nvm-windows](https://github.com/coreybutler/nvm-windows) on - Windows, to configure your node version. - * On Linux and macOS, if you have `nvm` installed, just run `nvm use` switch to Node.js v10.7.0. -* `git clone git@github.com:trufflesuite/ganache-core.git` -* `cd ganache-core` -* `npm install` (use npm v6) -* On Linux and macOS: run `source completions.sh` to enable npm script autocomplete +- Use Node.js v10.7.0, this is the earliest version we support. + - Why v10.7.0? Because this is the first version that supports BigInt literals (the `n` in `100n`). + - recommendation: use [nvm](https://github.com/nvm-sh/nvm) on Linux and macOS, and [nvm-windows](https://github.com/coreybutler/nvm-windows) on + Windows, to configure your node version. + - On Linux and macOS, if you have `nvm` installed, just run `nvm use` to switch to Node.js v10.7.0. +- `git clone git@github.com:trufflesuite/ganache-core.git` +- `cd ganache-core` +- `npm install` (use npm v6) +- On Linux and macOS: run `source completions.sh` to enable autocomplete for npm scripts. ## Solving node-gyp issues @@ -18,60 +18,56 @@ If installation fails due to a `node-gyp` issue you may need to perform some add ### on Linux (Ubuntu-based) - * Determine if you have Python 2.7 installed - * example: `which python2.7` - * If you do not have python2.7 installed, you need to install it - * example: `sudo apt update && sudo apt install python2.7` - * Finally, run `npm config set python python2.7` +- Determine if you have Python 2.7 installed + - example: `which python2.7` +- If you do not have Python 2.7 installed, you need to install it + - example: `sudo apt update && sudo apt install python2.7` +- Finally, run `npm config set python python2.7` ### on Windows - * Install [https://www.npmjs.com/package/windows-build-tools](Windows-Build-Tools) - * `npm install --global windows-build-tools` +- Install [https://www.npmjs.com/package/windows-build-tools](Windows-Build-Tools) + - `npm install --global windows-build-tools` ### On macOS - * I have no idea. +- I have no idea. ## Clean install - * `npm run reinstall` +- `npm run reinstall` Which just runs these commands for you: - * `npm run clean` - * `npm install` +- `npm run clean` +- `npm install` - This deletes all `node_modules` folders, as well as all generated `lib` - directories, then reinstalls all modules. - -## VSCode On Windows (10) - - * Enable "Developer Mode" by going to Settings -> Developer Settings -> Then select Developer Mode. +This deletes all `node_modules` folders, as well as all generated `lib` +directories, then reinstalls all modules. ## To build Builds all packages: - * `npm run tsc` +- `npm run tsc` ## To test Runs all tests: - * `npm test` (or the shorthand, `npm t`) +- `npm test` (or the shorthand, `npm t`) ## To create a new package - * `npm run create --location ` +- `npm run create --location ` This will create a new package with Ganache defaults at `src//`. ## To add a module to a package: - * `npx lerna add [@version] -E [--dev] [--peer] --scope=` +- `npx lerna add [@version] -E [--dev] [--peer] --scope=` -Where `` is the npm-module you want to add and `` is where you want to add it. See +Where `` is the npm-module you want to add and `` is where you want to add it. See [@lerna/add documentation](https://github.com/lerna/lerna/tree/master/commands/add) for more details. Example: @@ -86,15 +82,25 @@ will add our local `@ganache/options` package to the `@ganache/filecoin` package `cd` to the package and then run `npm uninstall ` -## To debug tests in VS Code +## Editor Integrations + +### Automated Code Formatting + +- See: https://prettier.io/docs/en/editors.html + +### VSCode On Windows (10) + +- Enable "Developer Mode" by going to Settings -> Developer Settings -> Then select Developer Mode. + +### To debug tests in VS Code - * Copy the [`launch.json`](./launch.json) file into a folder named `.vscode` in root of the project. - * Set breakpoints by clicking the margin to the left of the line numbers (you can set conditional breakpoints or - logpoints by right-clicking instead) - * Press F5 (or select `Run` 🡺 `Start Debugging` from the menu bar) to automatically start debugging. +- Copy the [`launch.json`](./launch.json) file into a folder named `.vscode` in root of the project. +- Set breakpoints by clicking the margin to the left of the line numbers (you can set conditional breakpoints or + logpoints by right-clicking instead) +- Press F5 (or select `Run` 🡺 `Start Debugging` from the menu bar) to automatically start debugging. -To change which files are debugged update your `.vscode/launch.json` file glob to match your target files. Here is an -example to debug only test files in the ethereum package: +To change which files are debugged update your `.vscode/launch.json` file glob to match your target files. Here is an +example to debug only test files in the `@ganache/ethereum` package: ```diff diff --git a/.vscode/launch.json b/.vscode/launch.json @@ -108,32 +114,32 @@ index 2a2aa9e..57cbf21 100644 - "${workspaceFolder}/src/**/__tests__/**/*.test.ts" + "${workspaceFolder}/src/chains/ethereum/__tests__/**/*.test.ts" ], - "skipFiles": [ - "/**" + "skipFiles": ["/**"], + "console": "integratedTerminal", ``` ## Code Conventions These are guidelines, not rules. :-) - * Use Node.js v10.7.0 for most local development. - * Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed +- Use Node.js v10.7.0 for most local development. +- Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed `Number.MAX_SAFE_INTEGER`. - * Write tests. - * Do not use "Optional Chaining" (`obj?.prop`). I'd love to enable this, but TypeScript makes it hard to use bigint +- Write tests. +- Do not use "Optional Chaining" (`obj?.prop`). I'd love to enable this, but TypeScript makes it hard to use bigint literals and optional chaining together. If you figure it out, delete this rule! - * Prefer using a single loop to functional chaining. - * Prefer performant code over your own developer experience. - * Document complex code. Explain why the code does what it does. - * Feel free to be clever, just document _why_ you're being clever. If it's hard to read, comment _what_ the code does, +- Prefer using a single loop to functional chaining. +- Prefer performant code over your own developer experience. +- Document complex code. Explain why the code does what it does. +- Feel free to be clever, just document _why_ you're being clever. If it's hard to read, comment _what_ the code does, too. - * Add JSDoc comments to public class members where it makes sense. - * Before adding an external dependency check its code for quality, its # of external dependencies, its node version +- Add JSDoc comments to public class members where it makes sense. +- Before adding an external dependency check its code for quality, its # of external dependencies, its node version support, and make sure it's absolutely necessary. - * Pin all dependencies, even dev dependencies. - * Use npm; do not use yarn. - * Don't use web3, ethers, etc in ganache-core core code. (Tests are fine) - * Ensure a smooth development experience on Windows, Mac, and Linux. - * Do not use bash scripts for critical development or configuration. - * Do not use CLI commands in npm scripts or build scripts that aren't available by default on supported platforms. - * Push your code often (at least every-other day!), even broken WIP code (to your own branch, of course). +- Pin all dependencies, even dev dependencies. +- Use npm; do not use yarn. +- Don't use web3, ethers, etc in ganache-core core code. (Tests are fine) +- Ensure a smooth development experience on Windows, Mac, and Linux. +- Do not use bash scripts for critical development or configuration. +- Do not use CLI commands in npm scripts or build scripts that aren't available by default on supported platforms. +- Push your code often (at least every-other day!), even broken WIP code (to your own branch, of course). diff --git a/docs/launch.json b/docs/launch.json index cfd06fdc21..bcf2efe2ba 100644 --- a/docs/launch.json +++ b/docs/launch.json @@ -25,11 +25,9 @@ "ts-node/register", "${workspaceFolder}/src/**/__tests__/**/*.test.ts" ], - "skipFiles": [ - "/**" - ], + "skipFiles": ["/**"], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen" } ] -} \ No newline at end of file +} diff --git a/lerna.json b/lerna.json index e9e2fef347..80afc5f80a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,4 @@ { - "packages": [ - "src/packages/*", - "src/chains/*" - ], + "packages": ["src/packages/*", "src/chains/*"], "version": "2.2.1" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 84bfbd500a..904007b0c2 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2588,6 +2588,12 @@ "integrity": "sha512-vbt5fb0y1svMhu++1lwtKmZL76d0uPChFlw7kEzyUmTwfmpHRcFb8i0R8ElT69q/L+QLgK2hgECivIAvaEDwag==", "dev": true }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, "@types/pbkdf2": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", @@ -3962,6 +3968,12 @@ } } }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -5769,6 +5781,15 @@ "locate-path": "^3.0.0" } }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, "flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", @@ -6874,6 +6895,12 @@ "debug": "^3.1.0" } }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, "humanize-ms": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", @@ -6883,6 +6910,116 @@ "ms": "^2.0.0" } }, + "husky": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.0.tgz", + "integrity": "sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^7.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "cosmiconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + } + } + }, "iconv-lite": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", @@ -8418,6 +8555,12 @@ } } }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -8839,6 +8982,12 @@ } } }, + "mri": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", + "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==", + "dev": true + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -9555,6 +9704,12 @@ "mimic-fn": "^1.0.0" } }, + "opencollective-postinstall": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", + "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", + "dev": true + }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -9729,6 +9884,23 @@ } } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, "parse-git-config": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", @@ -9917,6 +10089,15 @@ "find-up": "^3.0.0" } }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^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", @@ -9929,6 +10110,183 @@ "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", "dev": true }, + "pretty-quick": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.1.0.tgz", + "integrity": "sha512-DtxIxksaUWCgPFN7E1ZZk4+Aav3CCuRdhrDSFZENb404sYMtuo9Zka823F+Mgeyt8Zt3bUiCjFzzWYE9LYqkmQ==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "execa": "^4.0.0", + "find-up": "^4.1.0", + "ignore": "^5.1.4", + "mri": "^1.1.5", + "multimatch": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -10509,6 +10867,18 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, "serialize-javascript": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", @@ -11117,6 +11487,12 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", @@ -11888,6 +12264,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", @@ -12068,6 +12450,12 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true + }, "yargs": { "version": "16.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.1.0.tgz", diff --git a/package.json b/package.json index b2b9ec9e37..99602a356b 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "create": "ts-node ./scripts/create", "prepare": "lerna bootstrap && echo \"\n\\033[1;36m Tip:\\033[0;36m run \\033[1;2;33msource completions.sh\\033[0;36m to supply bash completions for npm scripts\\033[0m\n\"", "reinstall": "npm run clean && npm install", - "test": "lerna exec -- npm test", + "test": "lerna exec -- npm run test", "tsc": "lerna exec -- npm run tsc", "tsc.clean": "npx lerna exec -- npx shx rm -rf lib" }, @@ -56,12 +56,14 @@ "cross-env": "7.0.2", "fs-extra": "9.0.1", "git-user-name": "2.0.0", + "husky": "4.3.0", "into-stream": "6.0.0", "lerna": "3.22.1", "mocha": "8.2.0", "npm-package-arg": "8.1.0", "nyc": "15.1.0", "prettier": "2.1.2", + "pretty-quick": "3.1.0", "shx": "0.3.3", "solc": "0.7.4", "superagent": "6.1.0", @@ -75,5 +77,10 @@ "optionalDependencies": { "bigint-buffer": "1.1.5" }, - "license": "MIT" + "license": "MIT", + "husky": { + "hooks": { + "pre-commit": "pretty-quick --staged" + } + } } diff --git a/scripts/compile.ts b/scripts/compile.ts index d67149027a..9da73ca152 100644 --- a/scripts/compile.ts +++ b/scripts/compile.ts @@ -1,6 +1,6 @@ -import {ts, Project, SourceFile} from "ts-morph"; -import {resolve, dirname} from "path"; -import {NodeFlags} from "typescript"; +import { ts, Project, SourceFile } from "ts-morph"; +import { resolve, dirname } from "path"; +import { NodeFlags } from "typescript"; function trimQuote(path: string) { return path.slice(1, path.length - 1); @@ -37,8 +37,8 @@ function serializeToAst(v: any): ts.Expression { return ts.createObjectLiteral( keys.map(k => ts.createPropertyAssignment(ts.createStringLiteral(k), serializeToAst(v[k]))) ); - default: - throw new Error(`Can't serializeToAst ${typeof v}`); + default: + throw new Error(`Can't serializeToAst ${typeof v}`); } } @@ -60,13 +60,7 @@ function serializeToTypeAst(v: any): ts.TypeNode { const keys = Object.keys(v); return ts.createTypeLiteralNode( keys.map(k => - ts.createPropertySignature( - void 0, - ts.createStringLiteral(k), - void 0, - serializeToTypeAst(v[k]), - void 0 - ) + ts.createPropertySignature(void 0, ts.createStringLiteral(k), void 0, serializeToTypeAst(v[k]), void 0) ) ); default: diff --git a/scripts/create.ts b/scripts/create.ts index c47f3c5519..3626bce892 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -1,16 +1,16 @@ // TODO: make this its own package? -import {mkdir, mkdirSync, writeFile} from "fs-extra"; +import chalk from "chalk"; import yargs from "yargs"; -import {join, resolve} from "path"; import prettier from "prettier"; -import {version} from "../lerna.json"; import camelCase from "camelcase"; import npa from "npm-package-arg"; -import { lstatSync as lstat, readdirSync as readDir, readFileSync as readFile } from "fs"; -import chalk from "chalk"; -import { highlight } from "cli-highlight"; import userName from "git-user-name"; +import { join, resolve } from "path"; +import { version } from "../lerna.json"; +import { highlight } from "cli-highlight"; +import { mkdir, mkdirSync, writeFile } from "fs-extra"; +import { lstatSync as lstat, readdirSync as readDir, readFileSync as readFile } from "fs"; const isDir = (s: string) => lstat(s).isDirectory(); const getDirectories = (s: string) => readDir(s).filter(n => isDir(join(s, n))); @@ -23,11 +23,14 @@ const COLORS = { const scopes = getDirectories(join(__dirname, "../src")); const argv = yargs - .command(`$0 --location`, `Create a new package in the given location with the provided name.`, (yargs) => { + .command(`$0 --location`, `Create a new package in the given location with the provided name.`, yargs => { return yargs .usage( chalk`{hex("#e4a663").bold Create a new package in the given location with the provided name.}\n\n` + - chalk`{bold Usage}\n {bold $} {dim <}name{dim >} {dim --}location {dim <}${scopes.join(chalk.dim(" | "))}{dim >}`) + chalk`{bold Usage}\n {bold $} {dim <}name{dim >} {dim --}location {dim <}${scopes.join( + chalk.dim(" | ") + )}{dim >}` + ) .positional("", { describe: ` The name of the new package`, type: "string", @@ -41,7 +44,7 @@ const argv = yargs choices: scopes, type: "string", demandOption: true - }) + }); }) .demandCommand() .version(false) @@ -50,10 +53,10 @@ const argv = yargs "Positionals:": chalk.bold("Options"), "Options:": ` `, "Not enough non-option arguments: got %s, need at least %s": { - "one": chalk`{red {bold ERROR! Not enough non-option arguments:}\n got %s, need at least %s}`, - "other": chalk`{red {bold ERROR! Not enough non-option arguments:}\n got %s, need at least %s}` - } as any, - "Invalid values:": `${COLORS.FgRed}${COLORS.Bold}ERROR! Invalid values:${COLORS.Reset}${COLORS.FgRed}` + one: chalk`{red {bold ERROR! Not enough non-option arguments:}\n got %s, need at least %s}`, + other: chalk`{red {bold ERROR! Not enough non-option arguments:}\n got %s, need at least %s}` + } as any, + "Invalid values:": `${COLORS.FgRed}${COLORS.Bold}ERROR! Invalid values:${COLORS.Reset}${COLORS.FgRed}` }) .fail((msg, err, yargs) => { // we use a custom `fail` fn so that NPM doesn't print its own giant error message. @@ -63,8 +66,7 @@ const argv = yargs console.error(); console.error(msg); process.exit(0); - }) -.argv; + }).argv; process.stdout.write(`${COLORS.Reset}`); (async function () { @@ -102,7 +104,8 @@ process.stdout.write(`${COLORS.Reset}`); scripts: { tsc: "ts-node ../../../scripts/compile", test: "nyc npm run mocha", - mocha: "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" + mocha: + "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" @@ -147,12 +150,14 @@ export * from "./src/index"; const src = join(dir, "src"); function initSrc() { - return writeFile(join(src, "index.ts"), prettier.format(indexFile, {...prettierConfig, parser: "typescript"})); + return writeFile(join(src, "index.ts"), prettier.format(indexFile, { ...prettierConfig, parser: "typescript" })); } function initRootIndex() { return Promise.all([ - writeFile(join(dir, ".npmignore"), `./index.ts + writeFile( + join(dir, ".npmignore"), + `./index.ts __tests__ .nyc_output coverage @@ -160,8 +165,15 @@ scripts src tsconfig.json typedoc.json -`), - writeFile(join(dir, "index.ts"), prettier.format(rootIndexFile, {...prettierConfig, parser: "typescript"})), +` + ), + writeFile( + join(dir, "index.ts"), + prettier.format(rootIndexFile, { + ...prettierConfig, + parser: "typescript" + }) + ), writeFile(join(dir, "LICENSE"), LICENSE) ]); } @@ -169,7 +181,7 @@ typedoc.json function initTests() { return writeFile( join(tests, "index.test.ts"), - prettier.format(testFile, {...prettierConfig, parser: "typescript"}) + prettier.format(testFile, { ...prettierConfig, parser: "typescript" }) ); } @@ -185,25 +197,27 @@ typedoc.json initRootIndex(), mkdir(tests).then(initTests), mkdir(src).then(initSrc), - writeFile( - join(dir, "tsconfig.json"), - JSON.stringify(tsConfig, null, 2) + "\n" - ), + writeFile(join(dir, "tsconfig.json"), JSON.stringify(tsConfig, null, 2) + "\n"), writeFile( join(dir, "README.md"), - prettier.format(`# ${packageName}\n> TODO: description`, {...prettierConfig, parser: "markdown"}) + prettier.format(`# ${packageName}\n> TODO: description`, { + ...prettierConfig, + parser: "markdown" + }) ), writeFile(pkgPath, pkgStr), writeFile(join(dir, "npm-shrinkwrap.json"), JSON.stringify(shrinkwrap) + "\n") ]); - console.log(highlight(pkgStr, { - language: "json", - theme: { - attr: chalk.hex("#3FE0C5"), - string: chalk.hex("#e4a663") - } - })); + console.log( + highlight(pkgStr, { + language: "json", + theme: { + attr: chalk.hex("#3FE0C5"), + string: chalk.hex("#e4a663") + } + }) + ); console.log( chalk`{green success} {magenta create} New package {bgBlack ${name} } created. New package created at ./src/packages/${name}.\n\n package.json: {bold ${dir}/package.json}` @@ -211,8 +225,6 @@ typedoc.json } catch (e) { console.error(e); console.log(""); - console.log( - chalk`{red fail} {magenta create} New package {bgBlack ${name} } not created. See error above.` - ); + console.log(chalk`{red fail} {magenta create} New package {bgBlack ${name} } not created. See error above.`); } })(); diff --git a/src/chains/ethereum/__tests__/@types/solc/index.d.ts b/src/chains/ethereum/__tests__/@types/solc/index.d.ts index 4534dc9881..6b94b3df2c 100644 --- a/src/chains/ethereum/__tests__/@types/solc/index.d.ts +++ b/src/chains/ethereum/__tests__/@types/solc/index.d.ts @@ -1,156 +1,158 @@ declare module "solc" { - export type Primitive = - 'bool' | - 'string' | - 'address' | - 'uint8' | - 'uint16' | - 'uint32' | - 'uint64' | - 'uint128' | - 'uint256' | - 'int8' | - 'int16' | - 'int32' | - 'int64' | - 'int128' | - 'int256' | - 'bytes' | - 'bytes20' | - 'bytes32' | - 'bool[]' | - 'string[]' | - 'address[]' | - 'uint8[]' | - 'uint16[]' | - 'uint32[]' | - 'uint64[]' | - 'uint128[]' | - 'uint256[]' | - 'int8[]' | - 'int16[]' | - 'int32[]' | - 'int64[]' | - 'int128[]' | - 'int256[]' | - 'bytes[]' | - 'bytes20[]' | - 'bytes32[]'; + export type Primitive = + | "bool" + | "string" + | "address" + | "uint8" + | "uint16" + | "uint32" + | "uint64" + | "uint128" + | "uint256" + | "int8" + | "int16" + | "int32" + | "int64" + | "int128" + | "int256" + | "bytes" + | "bytes20" + | "bytes32" + | "bool[]" + | "string[]" + | "address[]" + | "uint8[]" + | "uint16[]" + | "uint32[]" + | "uint64[]" + | "uint128[]" + | "uint256[]" + | "int8[]" + | "int16[]" + | "int32[]" + | "int64[]" + | "int128[]" + | "int256[]" + | "bytes[]" + | "bytes20[]" + | "bytes32[]"; - export interface AbiParameter { - name: string, - type: Primitive, - } + export interface AbiParameter { + name: string; + type: Primitive; + } - export interface AbiEventParameter extends AbiParameter { - indexed: boolean, - } + export interface AbiEventParameter extends AbiParameter { + indexed: boolean; + } - export interface AbiFunction { - name: string, - type: 'function' | 'constructor' | 'fallback', - stateMutability: 'pure' | 'view' | 'payable' | 'nonpayable', - constant: boolean, - payable: boolean, - inputs: Array, - outputs: Array, - } + export interface AbiFunction { + name: string; + type: "function" | "constructor" | "fallback"; + stateMutability: "pure" | "view" | "payable" | "nonpayable"; + constant: boolean; + payable: boolean; + inputs: Array; + outputs: Array; + } - export interface AbiEvent { - name: string, - type: 'event', - inputs: Array, - anonymous: boolean, - } + export interface AbiEvent { + name: string; + type: "event"; + inputs: Array; + anonymous: boolean; + } - export type Abi = Array; + export type Abi = Array; - interface CompilerInputSourceFile { - keccak256?: string; - urls: string[]; - } - interface CompilerInputSourceCode { - keccak256?: string; - content: string; - } - interface CompilerInput { - language: "Solidity" | "serpent" | "lll" | "assembly"; - settings?: any, - sources: { - [globalName: string]: CompilerInputSourceFile | CompilerInputSourceCode, + interface CompilerInputSourceFile { + keccak256?: string; + urls: string[]; + } + interface CompilerInputSourceCode { + keccak256?: string; + content: string; + } + interface CompilerInput { + language: "Solidity" | "serpent" | "lll" | "assembly"; + settings?: any; + sources: { + [globalName: string]: CompilerInputSourceFile | CompilerInputSourceCode; + }; + } + interface CompilerOutputError { + sourceLocation?: { + file: string; + start: number; + end: number; + }; + type: "TypeError" | "InternalCompilerError" | "Exception"; + component: "general" | "ewasm"; + severity: "error" | "warning"; + message: string; + formattedMessage?: string; + } + interface CompilerOutputEvmBytecode { + object?: string; + opcodes?: string; + sourceMap?: string; + linkReferences?: + | {} + | { + [globalName: string]: { + [name: string]: { start: number; length: number }[]; + }; }; - } - interface CompilerOutputError { - sourceLocation?: { - file: string; - start: number; - end: number; - }; - type: "TypeError" | "InternalCompilerError" | "Exception"; - component: "general" | "ewasm"; - severity: "error" | "warning"; - message: string; - formattedMessage?: string; - } - interface CompilerOutputEvmBytecode { - object?: string; - opcodes?: string; - sourceMap?: string; - linkReferences?: {} | { - [globalName: string]: { - [name: string]: { start: number, length: number }[]; + } + interface CompilerOutputSources { + [globalName: string]: { + id: number; + ast?: any; + legacyAST?: any; + }; + } + interface CompilerOutputContracts { + [globalName: string]: { + [contractName: string]: { + abi?: Abi; + metadata?: string; + userdoc?: any; + devdoc?: any; + ir?: string; + evm?: { + assembly?: string; + legacyAssembly?: any; + bytecode: CompilerOutputEvmBytecode; + deployedBytecode?: CompilerOutputEvmBytecode; + methodIdentifiers?: { + [methodName: string]: string; + }; + gasEstimates?: { + creation: { + codeDepositCost: string; + executionCost: string; + totalCost: string; + }; + external: { + [functionSignature: string]: string; + }; + internal: { + [functionSignature: string]: string; }; + }; }; - } - interface CompilerOutputSources { - [globalName: string]: { - id: number; - ast?: any; - legacyAST?: any; - }, - } - interface CompilerOutputContracts { - [globalName: string]: { - [contractName: string]: { - abi?: Abi; - metadata?: string; - userdoc?: any; - devdoc?: any; - ir?: string; - evm?: { - assembly?: string; - legacyAssembly?: any; - bytecode: CompilerOutputEvmBytecode; - deployedBytecode?: CompilerOutputEvmBytecode; - methodIdentifiers?: { - [methodName: string]: string; - }; - gasEstimates?: { - creation: { - codeDepositCost: string; - executionCost: string; - totalCost: string; - }; - external: { - [functionSignature: string]: string; - }; - internal: { - [functionSignature: string]: string; - }; - }; - }; - ewasm: { - wast?: string; - wasm?: string; - } - } + ewasm: { + wast?: string; + wasm?: string; }; - } - interface CompilerOutput { - errors: CompilerOutputError[]; - sources: CompilerOutputSources; - contracts: CompilerOutputContracts; - } - type ReadCallback = (path: string) => { contents?: string, error?: string }; - function compile(input: string): string; + }; + }; + } + interface CompilerOutput { + errors: CompilerOutputError[]; + sources: CompilerOutputSources; + contracts: CompilerOutputContracts; + } + type ReadCallback = (path: string) => { contents?: string; error?: string }; + function compile(input: string): string; } diff --git a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts index 60bdba232d..f98366479a 100644 --- a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts +++ b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts @@ -1,4 +1,3 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; diff --git a/src/chains/ethereum/__tests__/api/db/db.test.ts b/src/chains/ethereum/__tests__/api/db/db.test.ts index f07432c70b..26a0489706 100644 --- a/src/chains/ethereum/__tests__/api/db/db.test.ts +++ b/src/chains/ethereum/__tests__/api/db/db.test.ts @@ -1,4 +1,3 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol b/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol index abe0bd50a8..2d27d6a107 100644 --- a/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol +++ b/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol @@ -2,6 +2,6 @@ pragma solidity ^0.7.4; contract GetStorageAt { - uint256 public intValue1 = 123; - address public self = address(0x01); + uint256 public intValue1 = 123; + address public self = address(0x01); } diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol b/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol index 1bdb8c4676..b1aa9045fb 100644 --- a/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol +++ b/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol @@ -2,14 +2,15 @@ pragma solidity ^0.7.4; contract Logs { - event Event(uint indexed first, uint indexed second); - constructor() { - emit Event(1, 2); - } + event Event(uint256 indexed first, uint256 indexed second); - function logNTimes (uint8 n) public { - for (uint8 i = 0; i < n; i++){ - emit Event(i, i); + constructor() { + emit Event(1, 2); + } + + function logNTimes(uint8 n) public { + for (uint8 i = 0; i < n; i++) { + emit Event(i, i); + } } - } } diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol b/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol index d5008e50b4..14879bbf76 100644 --- a/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol +++ b/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol @@ -2,15 +2,17 @@ pragma solidity ^0.7.4; contract Reverts { - - function invalidRevertReason() public pure { - assembly { - // revert reason code - mstore(0x80, 0x0000000000000000000000000000000000000000000000000000000008c379a0) - // invalid data - mstore(0xA0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0) - // trigger revert, returning the mstore values set above - revert(0x9C /* mem start */, 0x24 /* mem length */) + function invalidRevertReason() public pure { + assembly { + // revert reason code + mstore(0x80, 0x0000000000000000000000000000000000000000000000000000000008c379a0) + // invalid data + mstore(0xA0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0) + // trigger revert, returning the mstore values set above + revert( + 0x9C, /* mem start */ + 0x24 /* mem length */ + ) + } } - } } diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index bc679d2d1e..11be558aa9 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -16,29 +16,29 @@ describe("api", () => { accounts = await provider.send("eth_accounts"); }); - describe("eth_coinbase", function() { - it("should return correct address", async function() { + describe("eth_coinbase", () => { + it("should return correct address", async () => { const coinbase = await provider.send("eth_coinbase"); assert.strictEqual(coinbase, "0x" + "0".repeat(40)); }); }); - describe("eth_mining", function() { + describe("eth_mining", () => { it("should return true", async () => { const result = await provider.send("eth_mining"); assert.strictEqual(result, true); }); }); - describe("eth_syncing", function() { + describe("eth_syncing", () => { it("should return true", async () => { const result = await provider.send("eth_syncing"); assert.strictEqual(result, false); }); }); - describe("eth_hashrate", function() { - it("should return hashrate of zero", async function() { + describe("eth_hashrate", () => { + it("should return hashrate of zero", async () => { const result = await provider.send("eth_hashrate"); assert.deepStrictEqual(result, "0x0"); }); @@ -87,33 +87,33 @@ describe("api", () => { it("should use the default chain id when signing transactions", async () => { await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendTransaction", [{from: accounts[0], to: accounts[0]}]); + const txHash = await provider.send("eth_sendTransaction", [{ from: accounts[0], to: accounts[0] }]); await provider.once("message"); const tx = await provider.send("eth_getTransactionByHash", [txHash]); assert.strictEqual(tx.v, "0xa95"); }); it("chainid option should change the chain id", async () => { - const provider = await getProvider({chain: {chainId: 1234}}); + const provider = await getProvider({ chain: { chainId: 1234 } }); const result = await provider.send("eth_chainId"); assert.deepStrictEqual(result, "0x4d2"); }); }); describe("eth_getBalance", () => { - it("should return initial balance", async() => { + it("should return initial balance", async () => { const balance = await provider.send("eth_getBalance", [accounts[0]]); assert.strictEqual(balance, "0x56bc75e2d63100000"); }); - it("should return 0 for non-existent account", async() => { + it("should return 0 for non-existent account", async () => { const balance = await provider.send("eth_getBalance", ["0x1234567890123456789012345678901234567890"]); assert.strictEqual(balance, "0x0"); }); }); describe("eth_getTransactionCount", () => { - it("should get the tranasction count of the block", async function() { + it("should get the tranasction count of the block", async () => { const tx = { from: accounts[0], to: accounts[1], @@ -130,17 +130,17 @@ describe("api", () => { // send one tx, then check the count await provider.send("miner_stop"); - await provider.send("eth_sendTransaction", [{...tx}]); + await provider.send("eth_sendTransaction", [{ ...tx }]); await provider.send("miner_start"); const message1 = await provider.once("message"); const txCount3 = await provider.send("eth_getTransactionCount", [accounts[0], message1.data.result.number]); assert.strictEqual(txCount3, "0x1"); - + // send two txs, then check the count await provider.send("miner_stop"); - await provider.send("eth_sendTransaction", [{...tx}]); - await provider.send("eth_sendTransaction", [{...tx}]); + await provider.send("eth_sendTransaction", [{ ...tx }]); + await provider.send("eth_sendTransaction", [{ ...tx }]); await provider.send("miner_start"); const message2 = await provider.once("message"); @@ -167,49 +167,50 @@ describe("api", () => { }); describe("eth_blockNumber", () => { - it("should return initial block number of zero", async function() { + it("should return initial block number of zero", async () => { const blockNumber = await provider.send("eth_blockNumber"); assert.strictEqual(parseInt(blockNumber, 10), 0); }); - it("should increment the block number after a transaction", async function() { + it("should increment the block number after a transaction", async () => { const tx = { from: accounts[0], to: accounts[1], value: 1 - } + }; const startingBlockNumber = parseInt(await provider.send("eth_blockNumber")); await provider.send("eth_subscribe", ["newHeads"]); - await provider.send("eth_sendTransaction", [{...tx}]); + await provider.send("eth_sendTransaction", [{ ...tx }]); await provider.once("message"); const blockx1 = await provider.send("eth_blockNumber"); assert.strictEqual(+blockx1, startingBlockNumber + 1); - const awaitFor = (count) => new Promise(resolve => { - let counter = 0; - const off = provider.on("message", ((_block: any) => { - counter++; - if (counter === count) { - off(); - resolve(void 0); - } - })); - }); + const awaitFor = count => + new Promise(resolve => { + let counter = 0; + const off = provider.on("message", (_block: any) => { + counter++; + if (counter === count) { + off(); + resolve(void 0); + } + }); + }); let wait = awaitFor(4); await Promise.all([ - provider.send("eth_sendTransaction", [{...tx}]), - provider.send("eth_sendTransaction", [{...tx}]), - provider.send("eth_sendTransaction", [{...tx}]), - provider.send("eth_sendTransaction", [{...tx}]) + provider.send("eth_sendTransaction", [{ ...tx }]), + provider.send("eth_sendTransaction", [{ ...tx }]), + provider.send("eth_sendTransaction", [{ ...tx }]), + provider.send("eth_sendTransaction", [{ ...tx }]) ]); await Promise.all([ - provider.send("eth_sendTransaction", [{...tx}]), - provider.send("eth_sendTransaction", [{...tx}]), - provider.send("eth_sendTransaction", [{...tx}]), - provider.send("eth_sendTransaction", [{...tx}]) + provider.send("eth_sendTransaction", [{ ...tx }]), + provider.send("eth_sendTransaction", [{ ...tx }]), + provider.send("eth_sendTransaction", [{ ...tx }]), + provider.send("eth_sendTransaction", [{ ...tx }]) ]); await wait; wait = awaitFor(4); @@ -295,48 +296,56 @@ describe("api", () => { }); it("eth_sendTransaction bad data (tiny gas limit)", async () => { - await provider.send("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - gas: "0x01" - } - ]) - .catch(e => { - assert.strictEqual(e.code, -32000); - assert.strictEqual(e.message, "intrinsic gas too low"); - }) + await provider + .send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + gas: "0x01" + } + ]) + .catch(e => { + assert.strictEqual(e.code, -32000); + assert.strictEqual(e.message, "intrinsic gas too low"); + }); }); it("eth_sendTransaction bad data (huge gas limit)", async () => { - await provider.send("eth_sendTransaction", [ - { - from: accounts[0], - to: accounts[1], - gas: "0xfffffffff" - } - ]) - .catch(e => { - assert.strictEqual(e.code, -32000); - assert.strictEqual(e.message, "exceeds block gas limit"); - }) + await provider + .send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + gas: "0xfffffffff" + } + ]) + .catch(e => { + assert.strictEqual(e.code, -32000); + assert.strictEqual(e.message, "exceeds block gas limit"); + }); }); - it("handles block gas limit errors, callback style", (done) => { - provider.send({ - jsonrpc:"2.0", - id: "1", - method: "eth_sendTransaction", - params: [{ - from: accounts[0], - to: accounts[1], - gas: "0xfffffffff" // generates an "exceeds block gas limit" error - }]}, (e, r) => { + it("handles block gas limit errors, callback style", done => { + provider.send( + { + jsonrpc: "2.0", + id: "1", + method: "eth_sendTransaction", + params: [ + { + from: accounts[0], + to: accounts[1], + gas: "0xfffffffff" // generates an "exceeds block gas limit" error + } + ] + }, + (e, r) => { assert.strictEqual(e.message, "exceeds block gas limit"); assert.strictEqual((r as any).error.code, -32000); assert.strictEqual((r as any).error.message, e.message); - done() - }); + done(); + } + ); }); it("eth_getTransactionByBlockNumberAndIndex", async () => { diff --git a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts index d755b41fd9..1192e8006f 100644 --- a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts @@ -16,7 +16,7 @@ describe("api", () => { }); after(async () => { - provider && await provider.disconnect(); + provider && (await provider.disconnect()); }); it("should return 0x for null address", async () => { @@ -48,26 +48,31 @@ describe("api", () => { provider = await getProvider(); accounts = await provider.send("eth_accounts"); await provider.send("eth_subscribe", ["newHeads"]); - const transactionHash = await provider.send("eth_sendTransaction", [{ - from: accounts[0], - data: contract.code, - gas: 3141592 - }]); + const transactionHash = await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + data: contract.code, + gas: 3141592 + } + ]); await provider.once("message"); const transactionReceipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); contractAddress = transactionReceipt.contractAddress; assert(contractAddress !== null, "Contract wasn't deployed as expected"); - - blockNumber = Quantity.from(transactionReceipt.blockNumber); + + blockNumber = Quantity.from(transactionReceipt.blockNumber); }); - it("should return the code at the deployed block number", async function() { + it("should return the code at the deployed block number", async () => { const code = await provider.send("eth_getCode", [contractAddress, blockNumber.toString()]); assert.strictEqual(code, `0x${contract.contract.evm.deployedBytecode.object}`); }); - it("should return the no code at the previous block number", async function() { - const code = await provider.send("eth_getCode", [contractAddress, Quantity.from(blockNumber.toBigInt() - 1n).toString()]); + it("should return the no code at the previous block number", async () => { + const code = await provider.send("eth_getCode", [ + contractAddress, + Quantity.from(blockNumber.toBigInt() - 1n).toString() + ]); assert.strictEqual(code, "0x"); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts index 866435c7d1..c6d551fae3 100644 --- a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts @@ -1,4 +1,3 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; @@ -16,9 +15,8 @@ describe("api", () => { let contractMethods: any; beforeEach(async () => { - provider = await getProvider({ - miner: {defaultTransactionGasLimit: 6721975} + miner: { defaultTransactionGasLimit: 6721975 } }); const accounts = await provider.send("eth_accounts"); const from = accounts[0]; @@ -41,26 +39,29 @@ describe("api", () => { }); it("returns the value at the hex position", async () => { - const result = await provider.send("eth_getStorageAt", [contractAddress, "0x0"]) + const result = await provider.send("eth_getStorageAt", [contractAddress, "0x0"]); assert.strictEqual(BigInt(result), 123n); - const result2 = await provider.send("eth_getStorageAt", [contractAddress, "0x1"]) + const result2 = await provider.send("eth_getStorageAt", [contractAddress, "0x1"]); assert.strictEqual(result2, "0x01"); }); it("returns the value at the 32-byte hex position", async () => { - const result = await provider.send("eth_getStorageAt", [contractAddress, "0x" + THIRTY_TWO_BYES]) + const result = await provider.send("eth_getStorageAt", [contractAddress, "0x" + THIRTY_TWO_BYES]); assert.strictEqual(BigInt(result), 123n); - const result2 = await provider.send("eth_getStorageAt", [contractAddress, "0x" + THIRTY_TWO_BYES.slice(-1) + "1"]) + const result2 = await provider.send("eth_getStorageAt", [ + contractAddress, + "0x" + THIRTY_TWO_BYES.slice(-1) + "1" + ]); assert.strictEqual(result2, "0x01"); }); it("returns the value even when hex positions exceeds 32-bytes", async () => { - const thirtyThreeBytePosition = "0x1" + THIRTY_TWO_BYES; - const result = await provider.send("eth_getStorageAt", [contractAddress, thirtyThreeBytePosition]); - assert.strictEqual(BigInt(result), 123n); - const thirtyThreeBytePosition2 = "0x" + THIRTY_TWO_BYES + "1"; - const result2 = await provider.send("eth_getStorageAt", [contractAddress, thirtyThreeBytePosition2]); - assert.strictEqual(result2, "0x01"); + const thirtyThreeBytePosition = "0x1" + THIRTY_TWO_BYES; + const result = await provider.send("eth_getStorageAt", [contractAddress, thirtyThreeBytePosition]); + assert.strictEqual(BigInt(result), 123n); + const thirtyThreeBytePosition2 = "0x" + THIRTY_TWO_BYES + "1"; + const result2 = await provider.send("eth_getStorageAt", [contractAddress, thirtyThreeBytePosition2]); + assert.strictEqual(result2, "0x01"); }); it("rejects when the block doesn't exist", async () => { diff --git a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts index c5b81b2072..7ad2780ccb 100644 --- a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts @@ -1,4 +1,3 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; @@ -6,7 +5,9 @@ describe("api", () => { describe("eth", () => { describe("legacy", () => { it("when not in legacy mode, does not mine before returning the tx hash", async () => { - const provider = await getProvider({miner: {legacyInstamine: false}}); + const provider = await getProvider({ + miner: { legacyInstamine: false } + }); const accounts = await provider.send("eth_accounts"); const hash = await provider.send("eth_sendTransaction", [ @@ -21,7 +22,9 @@ describe("api", () => { }); it("when in legacy mode, mines before returns in the tx hash", async () => { - const provider = await getProvider({miner:{legacyInstamine: true}}); + const provider = await getProvider({ + miner: { legacyInstamine: true } + }); const accounts = await provider.send("eth_accounts"); const hash = await provider.send("eth_sendTransaction", [ @@ -35,25 +38,34 @@ describe("api", () => { assert.notStrictEqual(receipt, null); }); - it("handles transaction balance errors, callback style", (done) => { - getProvider({miner: {legacyInstamine: true}, chain: {vmErrorsOnRPCResponse: true}}).then(async (provider) => { + it("handles transaction balance errors, callback style", done => { + getProvider({ + miner: { legacyInstamine: true }, + chain: { vmErrorsOnRPCResponse: true } + }).then(async provider => { const accounts = await provider.send("eth_accounts"); - provider.send({ - jsonrpc:"2.0", - id: "1", - method: "eth_sendTransaction", - params: [{ - from: accounts[0], - to: accounts[1], - value: "0x76bc75e2d63100000" - }]}, (e, r) => { + provider.send( + { + jsonrpc: "2.0", + id: "1", + method: "eth_sendTransaction", + params: [ + { + from: accounts[0], + to: accounts[1], + value: "0x76bc75e2d63100000" + } + ] + }, + (e, r) => { assert(e.message.includes("sender doesn't have enough funds to send tx")); assert.strictEqual(e.message, (r as any).error.message); assert.strictEqual((r as any).error.code, -32000); assert.strictEqual(typeof (r as any).error.data.result, "string"); done(); - }); + } + ); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts index a394f9c8b5..f73aa8d48b 100644 --- a/src/chains/ethereum/__tests__/api/eth/logs.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -1,4 +1,3 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; @@ -20,11 +19,13 @@ describe("api", () => { accounts = await provider.send("eth_accounts"); const subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); - const transactionHash = await provider.send("eth_sendTransaction", [{ - from: accounts[0], - data: contract.code, - gas: 3141592 - }]); + const transactionHash = await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + data: contract.code, + gas: 3141592 + } + ]); await provider.once("message"); const transactionReceipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); contractAddress = transactionReceipt.contractAddress; @@ -33,15 +34,15 @@ describe("api", () => { describe("eth_subscribe", () => { describe("logs", () => { - const onceMessageFor = (subId) => { + const onceMessageFor = subId => { return new Promise(resolve => { - provider.on("message", (message) => { + provider.on("message", message => { if (message.data.subscription === subId) { resolve(message); } }); - }) - } + }); + }; it("subscribes and unsubscribes", async () => { const subscriptionId = await provider.send("eth_subscribe", ["logs"]); @@ -54,10 +55,13 @@ describe("api", () => { // trigger a log event, we should get two events const numberOfLogs = 4; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const tx = {from: accounts[0], to: contractAddress, data}; + const data = + "0x" + + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + + numberOfLogs.toString().padStart(64, "0"); + const tx = { from: accounts[0], to: contractAddress, data }; const subs = [onceMessageFor(subscriptionId), onceMessageFor(subscriptionId2)]; - const txHash = await provider.send("eth_sendTransaction", [{...tx}]); + const txHash = await provider.send("eth_sendTransaction", [{ ...tx }]); const [message1, message2] = await Promise.all(subs); assert.deepStrictEqual(message1.data.result, message2.data.result); @@ -66,7 +70,7 @@ describe("api", () => { const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); assert.strictEqual(unsubResult, true); - await provider.send("eth_sendTransaction", [{...tx}]); + await provider.send("eth_sendTransaction", [{ ...tx }]); const message = await Promise.race([onceMessageFor(subscriptionId), onceMessageFor(subscriptionId2)]); assert.strictEqual(message.data.subscription, subscriptionId2, "unsubscribe didn't work"); }); @@ -75,41 +79,53 @@ describe("api", () => { describe("getLogs", () => { it("should return a log for the constructor transaction", async () => { - const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); + const logs = await provider.send("eth_getLogs", [{ address: contractAddress }]); assert.strictEqual(logs.length, 1); }); it("should return the logs", async () => { await provider.send("eth_subscribe", ["newHeads"]); const numberOfLogs = 4; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const txHash = await provider.send("eth_sendTransaction", [{ - from: accounts[0], - to: contractAddress, - gas: 3141592, - data: data - }]); + const data = + "0x" + + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + } + ]); await provider.once("message"); const txReceipt = await provider.send("eth_getTransactionReceipt", [txHash]); assert.deepStrictEqual(txReceipt.logs.length, numberOfLogs); - const logs = await provider.send("eth_getLogs", [{address: contractAddress}]); + const logs = await provider.send("eth_getLogs", [{ address: contractAddress }]); assert.deepStrictEqual(logs, txReceipt.logs); }); it("should filter out other blocks when using `latest`", async () => { await provider.send("eth_subscribe", ["newHeads"]); const numberOfLogs = 4; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - await provider.send("eth_sendTransaction", [{ - from: accounts[0], - to: contractAddress, - gas: 3141592, - data: data - }]); + const data = + "0x" + + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + + numberOfLogs.toString().padStart(64, "0"); + await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + } + ]); await provider.once("message"); await provider.send("evm_mine"); await provider.once("message"); - const logs = await provider.send("eth_getLogs", [{address: contractAddress, toBlock: "latest", fromBlock: "latest"}]); + const logs = await provider.send("eth_getLogs", [ + { address: contractAddress, toBlock: "latest", fromBlock: "latest" } + ]); assert.strictEqual(logs.length, 0); }); @@ -121,19 +137,33 @@ describe("api", () => { await provider.send("eth_subscribe", ["newHeads"]); const numberOfLogs = 4; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const txHash = await provider.send("eth_sendTransaction", [{ - from: accounts[0], - to: contractAddress, - gas: 3141592, - data: data - }]); // 0x3 + const data = + "0x" + + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + } + ]); // 0x3 await provider.once("message"); - const {blockNumber} = await provider.send("eth_getTransactionReceipt", [txHash]); - - async function testGetLogs(fromBlock: string, toBlock: string, expected: number, address: string = contractAddress){ - const logs = await provider.send("eth_getLogs", [{address, fromBlock, toBlock}]); - assert.strictEqual(logs.length, expected, `there should be ${expected} log(s) between the ${fromBlock} block and the ${toBlock} block`); + const { blockNumber } = await provider.send("eth_getTransactionReceipt", [txHash]); + + async function testGetLogs( + fromBlock: string, + toBlock: string, + expected: number, + address: string = contractAddress + ) { + const logs = await provider.send("eth_getLogs", [{ address, fromBlock, toBlock }]); + assert.strictEqual( + logs.length, + expected, + `there should be ${expected} log(s) between the ${fromBlock} block and the ${toBlock} block` + ); } // tests ranges up to latest/blockNumber @@ -180,7 +210,7 @@ describe("api", () => { await testGetLogs(lastBlockNumber, "latest", 0); await testGetLogs("latest", lastBlockNumber, 0); }); - + it("should filter appropriately when using blockHash", async () => { const genesisBlockNumber = "0x0"; const deployBlockNumber = "0x1"; @@ -189,18 +219,23 @@ describe("api", () => { await provider.send("eth_subscribe", ["newHeads"]); const numberOfLogs = 4; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const txHash = await provider.send("eth_sendTransaction", [{ - from: accounts[0], - to: contractAddress, - gas: 3141592, - data: data - }]); // 0x3 + const data = + "0x" + + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + + numberOfLogs.toString().padStart(64, "0"); + const txHash = await provider.send("eth_sendTransaction", [ + { + from: accounts[0], + to: contractAddress, + gas: 3141592, + data: data + } + ]); // 0x3 await provider.once("message"); - const {blockHash} = await provider.send("eth_getTransactionReceipt", [txHash]); + const { blockHash } = await provider.send("eth_getTransactionReceipt", [txHash]); - async function testGetLogs(blockHash: string, expected: number, address: string = contractAddress){ - const logs = await provider.send("eth_getLogs", [{address, blockHash}]); + async function testGetLogs(blockHash: string, expected: number, address: string = contractAddress) { + const logs = await provider.send("eth_getLogs", [{ address, blockHash }]); assert.strictEqual(logs.length, expected, `there should be ${expected} log(s) at the ${blockHash} block`); } @@ -212,7 +247,7 @@ describe("api", () => { await testGetLogs(deployBlockHash, 1, null); let { hash: emptyBlockHash } = await provider.send("eth_getBlockByNumber", [emptyBlockNumber]); await testGetLogs(emptyBlockHash, 0); - const invalidBlockHash = "0x123456789" + const invalidBlockHash = "0x123456789"; await testGetLogs(invalidBlockHash, 0); // mine an extra block @@ -227,22 +262,25 @@ describe("api", () => { describe("eth_newBlockFilter", () => { it("returns new blocks", async () => { await provider.send("eth_subscribe", ["newHeads"]); - async function assertNoChanges(){ + async function assertNoChanges() { const noChanges = await provider.send("eth_getFilterChanges", [filterId]); assert.strictEqual(noChanges.length, 0); } const filterId = await provider.send("eth_newBlockFilter"); await assertNoChanges(); - await provider.send("evm_mine"); await provider.once("message"); + await provider.send("evm_mine"); + await provider.once("message"); const changes1 = await provider.send("eth_getFilterChanges", [filterId]); let blockNum = await provider.send("eth_blockNumber"); let { hash } = await provider.send("eth_getBlockByNumber", [blockNum]); assert.strictEqual(changes1[0], hash); await assertNoChanges(); - await provider.send("evm_mine"); await provider.once("message"); + await provider.send("evm_mine"); + await provider.once("message"); blockNum = await provider.send("eth_blockNumber"); let { hash: hash2 } = await provider.send("eth_getBlockByNumber", [blockNum]); - await provider.send("evm_mine"); await provider.once("message"); + await provider.send("evm_mine"); + await provider.once("message"); blockNum = await provider.send("eth_blockNumber"); let { hash: hash3 } = await provider.send("eth_getBlockByNumber", [blockNum]); @@ -250,85 +288,91 @@ describe("api", () => { assert.strictEqual(changes2[0], hash2); assert.strictEqual(changes2[1], hash3); await assertNoChanges(); - }) + }); }); describe("eth_newPendingTransactionFilter", () => { it("returns new pending transactions", async () => { await provider.send("eth_subscribe", ["newPendingTransactions"]); - async function assertNoChanges(){ + async function assertNoChanges() { const noChanges = await provider.send("eth_getFilterChanges", [filterId]); assert.strictEqual(noChanges.length, 0); } const filterId = await provider.send("eth_newPendingTransactionFilter"); - const tx = {from: accounts[0], to: accounts[0]}; + const tx = { from: accounts[0], to: accounts[0] }; await assertNoChanges(); - provider.send("eth_sendTransaction", [{...tx}]); + provider.send("eth_sendTransaction", [{ ...tx }]); let hash = await provider.once("message"); const changes1 = await provider.send("eth_getFilterChanges", [filterId]); assert.strictEqual(changes1[0], hash.data.result); await assertNoChanges(); - provider.send("eth_sendTransaction", [{...tx}]); + provider.send("eth_sendTransaction", [{ ...tx }]); let hash2 = await provider.once("message"); - provider.send("eth_sendTransaction", [{...tx}]); + provider.send("eth_sendTransaction", [{ ...tx }]); let hash3 = await provider.once("message"); const changes2 = await provider.send("eth_getFilterChanges", [filterId]); assert.strictEqual(changes2[0], hash2.data.result); assert.strictEqual(changes2[1], hash3.data.result); await assertNoChanges(); - }) + }); }); describe("eth_newFilter", () => { it("returns new logs", async () => { await provider.send("eth_subscribe", ["newHeads"]); - async function assertNoChanges(){ + async function assertNoChanges() { const noChanges = await provider.send("eth_getFilterChanges", [filterId]); assert.strictEqual(noChanges.length, 0); } const filterId = await provider.send("eth_newFilter"); const numberOfLogs = 1; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const tx = {from: accounts[0], to: contractAddress, data}; + const data = + "0x" + + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + + numberOfLogs.toString().padStart(64, "0"); + const tx = { from: accounts[0], to: contractAddress, data }; await assertNoChanges(); - provider.send("eth_sendTransaction", [{...tx}]); + provider.send("eth_sendTransaction", [{ ...tx }]); let hash = await provider.once("message"); const changes1 = await provider.send("eth_getFilterChanges", [filterId]); assert.strictEqual(changes1.length, 1); await assertNoChanges(); - provider.send("eth_sendTransaction", [{...tx}]); + provider.send("eth_sendTransaction", [{ ...tx }]); let hash2 = await provider.once("message"); - provider.send("eth_sendTransaction", [{...tx}]); + provider.send("eth_sendTransaction", [{ ...tx }]); let hash3 = await provider.once("message"); const changes2 = await provider.send("eth_getFilterChanges", [filterId]); assert.strictEqual(changes2.length, 2); await assertNoChanges(); - }) + }); }); describe("eth_newFilter", () => { it("returns new logs", async () => { await provider.send("eth_subscribe", ["newHeads"]); - async function assertNoChanges(){ + async function assertNoChanges() { const noChanges = await provider.send("eth_getFilterChanges", [filterId]); assert.strictEqual(noChanges.length, 0); } const currentBlockNumber = "0x" + (parseInt(await provider.send("eth_blockNumber")) + 1).toString(16); - const filterId = await provider.send("eth_newFilter", [{fromBlock: currentBlockNumber, toBlock:"0x99"}]); + const filterId = await provider.send("eth_newFilter", [{ fromBlock: currentBlockNumber, toBlock: "0x99" }]); const numberOfLogs = 1; - const data = "0x" + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); - const tx = {from: accounts[0], to: contractAddress, data}; + const data = + "0x" + + contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + + numberOfLogs.toString().padStart(64, "0"); + const tx = { from: accounts[0], to: contractAddress, data }; await assertNoChanges(); - provider.send("eth_sendTransaction", [{...tx}]); + provider.send("eth_sendTransaction", [{ ...tx }]); let hash = await provider.once("message"); const changes1 = await provider.send("eth_getFilterChanges", [filterId]); assert.strictEqual(changes1.length, 1); await assertNoChanges(); - provider.send("eth_sendTransaction", [{...tx}]); + provider.send("eth_sendTransaction", [{ ...tx }]); let hash2 = await provider.once("message"); - provider.send("eth_sendTransaction", [{...tx}]); + provider.send("eth_sendTransaction", [{ ...tx }]); let hash3 = await provider.once("message"); const changes2 = await provider.send("eth_getFilterChanges", [filterId]); @@ -337,7 +381,7 @@ describe("api", () => { const allChanges = await provider.send("eth_getFilterLogs", [filterId]); assert.deepStrictEqual(allChanges, [...changes1, ...changes2]); - }) + }); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts index c6ebf49a93..6f4a9257b4 100644 --- a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts @@ -1,4 +1,3 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; @@ -26,29 +25,32 @@ describe("api", () => { provider = await getProvider({ wallet: { mnemonic: "sweet treat", - accounts: [{secretKey, balance: "0xffffff"}] + accounts: [{ secretKey, balance: "0xffffff" }] } }); accounts = await provider.send("eth_accounts"); }); it("processes a signed transaction", async () => { - const transaction = new Transaction({ - value: "0xff", - gasLimit: "0x33450", - to: accounts[0] - }, {common}); - + const transaction = new Transaction( + { + value: "0xff", + gasLimit: "0x33450", + to: accounts[0] + }, + { common } + ); + const secretKeyBuffer = Buffer.from(secretKey.substr(2), "hex"); transaction.sign(secretKeyBuffer); - + await provider.send("eth_subscribe", ["newHeads"]); const txHash = await provider.send("eth_sendRawTransaction", [transaction.serialize()]); await provider.once("message"); const receipt = await provider.send("eth_getTransactionReceipt", [txHash]); assert.strictEqual(receipt.transactionHash, txHash); - }) + }); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts index 7dc7f6f9a2..34db5b90ff 100644 --- a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts @@ -10,7 +10,6 @@ describe("api", () => { describe("sendTransaction", () => { describe("contracts", () => { describe("revert", () => { - async function deployContract(provider: EthereumProvider, accounts: string[]) { const contract = compile(join(__dirname, "./contracts/Reverts.sol")); @@ -42,25 +41,33 @@ describe("api", () => { async function test(opts: EthereumProviderOptions) { const provider = await getProvider(opts); const accounts = await provider.send("eth_accounts"); - const {contract, contractAddress} = await deployContract(provider, accounts); + const { contract, contractAddress } = await deployContract(provider, accounts); const contractMethods = contract.contract.evm.methodIdentifiers; const prom = provider.send("eth_call", [ - {from: accounts[0], to: contractAddress, data: "0x" + contractMethods["invalidRevertReason()"]} + { + from: accounts[0], + to: contractAddress, + data: "0x" + contractMethods["invalidRevertReason()"] + } ]); - const revertString = "0x08c379a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0" + const revertString = "0x08c379a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0"; if (opts.chain.vmErrorsOnRPCResponse) { - const result = await prom.catch(e =>e); + const result = await prom.catch(e => e); assert.strictEqual(result.code, -32000, "Error code should be -32000"); assert.strictEqual(result.data.reason, null, "The reason is undecodable, and thus should be null"); - assert.strictEqual(result.data.message, "revert", "The message should not have a reason string included"); + assert.strictEqual( + result.data.message, + "revert", + "The message should not have a reason string included" + ); assert.strictEqual(result.data.result, revertString, "The revert reason should be encoded as hex"); } else { assert.strictEqual(await prom, revertString, "The revert reason should be encoded as hex"); } } - await test({chain:{vmErrorsOnRPCResponse: false}}); - await test({chain:{vmErrorsOnRPCResponse: true}}); + await test({ chain: { vmErrorsOnRPCResponse: false } }); + await test({ chain: { vmErrorsOnRPCResponse: true } }); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/sign.test.ts b/src/chains/ethereum/__tests__/api/eth/sign.test.ts index ca171f254f..bc3340e238 100644 --- a/src/chains/ethereum/__tests__/api/eth/sign.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sign.test.ts @@ -5,12 +5,12 @@ import { Data } from "@ganache/utils"; describe("api", () => { describe("eth", () => { - describe("sign", function () { + describe("sign", () => { let accounts; let provider; - + // Load account. - before(async function () { + before(async () => { // This account produces an edge case signature when it signs the hex-encoded buffer: // '0x07091653daf94aafce9acf09e22dbde1ddf77f740f9844ac1f0ab790334f0627'. (See Issue #190) const acc = { @@ -21,18 +21,18 @@ describe("api", () => { wallet: { accounts: [acc] } - }) + }); accounts = await provider.send("eth_accounts"); }); - - it("should produce a signature whose signer can be recovered", async function() { + + it("should produce a signature whose signer can be recovered", async () => { const msg = Buffer.from("0xffffffffff"); const msgHash = hashPersonalMessage(msg); - + const address = accounts[0]; let sgn = await provider.send("eth_sign", [address, Data.from(msg).toString()]); sgn = sgn.slice(2); - + const r = Buffer.from(sgn.slice(0, 64), "hex"); const s = Buffer.from(sgn.slice(64, 128), "hex"); const v = parseInt(sgn.slice(128, 130), 16) + 27; @@ -41,17 +41,17 @@ describe("api", () => { const strAddr = "0x" + addr.toString("hex"); assert.strictEqual(strAddr, accounts[0].toLowerCase()); }); - - it("should work if ecsign produces 'r' or 's' components that start with 0", async function() { + + it("should work if ecsign produces 'r' or 's' components that start with 0", async () => { // This message produces a zero prefixed 'r' component when signed by // ecsign w/ the account set in this test's 'before' block. const msgHex = "0x07091653daf94aafce9acf09e22dbde1ddf77f740f9844ac1f0ab790334f0627"; const edgeCaseMsg = Data.from(msgHex).toBuffer(); const msgHash = hashPersonalMessage(edgeCaseMsg); - + let sgn = await provider.send("eth_sign", [accounts[0], msgHex]); sgn = sgn.slice(2); - + const r = Buffer.from(sgn.slice(0, 64), "hex"); const s = Buffer.from(sgn.slice(64, 128), "hex"); const v = parseInt(sgn.slice(128, 130), 16) + 27; @@ -60,10 +60,10 @@ describe("api", () => { const strAddr = "0x" + addr.toString("hex"); assert.deepStrictEqual(strAddr, accounts[0].toLowerCase()); }); - + after("shutdown", async () => { - provider && await provider.disconnect(); + provider && (await provider.disconnect()); }); }); }); -}); \ No newline at end of file +}); diff --git a/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts b/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts index 8ebec6ae3f..9ec6e1814e 100644 --- a/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts @@ -4,26 +4,26 @@ import getProvider from "../../helpers/getProvider"; describe("api", () => { describe("eth", () => { - describe("signTypedData", function () { + describe("signTypedData", () => { let accounts; let provider; // Load account. - before(async function () { + before(async () => { // Account based on https://github.com/ethereum/EIPs/blob/master/assets/eip-712/Example.js const acc = { balance: "0x0", secretKey: createKeccakHash("keccak256").update("cow").digest() }; provider = await getProvider({ - wallet:{ + wallet: { accounts: [acc] } - }) + }); accounts = await provider.send("eth_accounts"); }); - it("should produce a signature whose signer can be recovered", async function () { + it("should produce a signature whose signer can be recovered", async () => { const typedData = { types: { EIP712Domain: [ @@ -50,8 +50,14 @@ describe("api", () => { verifyingContract: "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" }, message: { - from: { name: "Cow", wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826" }, - to: { name: "Bob", wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB" }, + from: { + name: "Cow", + wallet: "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826" + }, + to: { + name: "Bob", + wallet: "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB" + }, contents: "Hello, Bob!" } }; @@ -63,7 +69,7 @@ describe("api", () => { ); }); - it("should produce a signature whose signer can be recovered (for arrays)", async function () { + it("should produce a signature whose signer can be recovered (for arrays)", async () => { const typedData = { types: { EIP712Domain: [ @@ -120,4 +126,4 @@ describe("api", () => { }); }); }); -}); \ No newline at end of file +}); diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index da031fbd3d..bf7b02d4af 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -14,10 +14,12 @@ describe("api", () => { beforeEach(async () => { provider = await getProvider({ chain: { - time: now, - }, miner: { - blockGasLimit: gasLimit, - }, wallet: { + time: now + }, + miner: { + blockGasLimit: gasLimit + }, + wallet: { mnemonic: "sweet treat" } }); @@ -40,7 +42,7 @@ describe("api", () => { await provider.send("evm_mine", [timestamp]); let counter = 0; - const message = await new Promise((resolve) => { + const message = await new Promise(resolve => { let firstMessage; provider.on("message", (message: any) => { counter++; @@ -58,22 +60,22 @@ describe("api", () => { type: "eth_subscription", data: { result: { - "difficulty": "0x0", - "extraData": "0x", - "gasLimit": gasLimit, - "gasUsed": "0x0", - "hash": "0xf821422e084d82d550019e555b656b9113c9af45c4c03fad670caaa9b5d8acde", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "miner": `0x${"0".repeat(40)}`, - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x0000000000000000", - "number": Quantity.from(startingBlockNumber + 1).toString(), - "parentHash": "0x746144f35cfbcc1bb8ea1dcd540b674c81cc25ffec8fa1ec42d444cba9678cc2", - "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "stateRoot": "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", - "timestamp": Quantity.from(timestamp).toString(), - "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + difficulty: "0x0", + extraData: "0x", + gasLimit: gasLimit, + gasUsed: "0x0", + hash: "0xf821422e084d82d550019e555b656b9113c9af45c4c03fad670caaa9b5d8acde", + logsBloom: `0x${"0".repeat(512)}`, + miner: `0x${"0".repeat(40)}`, + mixHash: `0x${"0".repeat(64)}`, + nonce: "0x0000000000000000", + number: Quantity.from(startingBlockNumber + 1).toString(), + parentHash: "0x746144f35cfbcc1bb8ea1dcd540b674c81cc25ffec8fa1ec42d444cba9678cc2", + receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + stateRoot: "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", + timestamp: Quantity.from(timestamp).toString(), + transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" }, subscription: subscriptionId } @@ -83,18 +85,20 @@ describe("api", () => { const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); assert.strictEqual(unsubResult, true); await provider.send("evm_mine", [timestamp]); - await assert.doesNotReject(new Promise((resolve, reject) => { - provider.on("message", async (message: any) => { - if (subscriptionId2 === message.data.subscription) { - const blockNumber = parseInt(await provider.send("eth_blockNumber")); - assert.strictEqual(blockNumber, startingBlockNumber + 2); - - resolve(void 0); - } else { - reject(new Error("Unsubscribe didn't work!")); - } - }); - })); + await assert.doesNotReject( + new Promise((resolve, reject) => { + provider.on("message", async (message: any) => { + if (subscriptionId2 === message.data.subscription) { + const blockNumber = parseInt(await provider.send("eth_blockNumber")); + assert.strictEqual(blockNumber, startingBlockNumber + 2); + + resolve(void 0); + } else { + reject(new Error("Unsubscribe didn't work!")); + } + }); + }) + ); }); }); @@ -108,7 +112,7 @@ describe("api", () => { // subscribe again const subscriptionId2 = await provider.send("eth_subscribe", ["newPendingTransactions"]); - let messagePromise = new Promise((resolve) => { + let messagePromise = new Promise(resolve => { let firstMessage; provider.on("message", (message: any) => { counter++; @@ -123,8 +127,8 @@ describe("api", () => { }); // trigger a pendingTransaction, we should get two events - const tx = {from: accounts[0], to: accounts[0]}; - const txHash = await provider.send("eth_sendTransaction", [{...tx}]); + const tx = { from: accounts[0], to: accounts[0] }; + const txHash = await provider.send("eth_sendTransaction", [{ ...tx }]); let counter = 0; const message = await messagePromise; @@ -151,15 +155,14 @@ describe("api", () => { } }); }); - const txHash2 = await provider.send("eth_sendTransaction", [{...tx}]); + const txHash2 = await provider.send("eth_sendTransaction", [{ ...tx }]); await assert.doesNotReject(messagePromise); - }); }); it("returns false for unsubscribe with bad id", async () => { const unsubResult = await provider.send("eth_unsubscribe", ["0xffff"]); - assert.strictEqual(unsubResult, false) + assert.strictEqual(unsubResult, false); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts index 77c7d8e309..9347f6da38 100644 --- a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts @@ -1,4 +1,3 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; @@ -58,7 +57,7 @@ describe("api", () => { const block = await provider.send("eth_getBlockByNumber", ["0x1"]); const result = await provider.send("eth_getUncleByBlockHashAndIndex", [block.hash, "0x0"]); - assert.deepStrictEqual(result, null) + assert.deepStrictEqual(result, null); }); it("eth_getUncleByBlockNumberAndIndex", async () => { @@ -73,7 +72,7 @@ describe("api", () => { await provider.once("message"); const result = await provider.send("eth_getUncleByBlockNumberAndIndex", ["0x1", "0x0"]); - assert.deepStrictEqual(result, null) + assert.deepStrictEqual(result, null); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index 2b0adc0589..da2d88e629 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -15,13 +15,13 @@ describe("api", () => { // bitwise tricks since those won't work on numbers greater than 2**31. const provider = await getProvider(); - const bin32 = 2**31; + const bin32 = 2 ** 31; const now = Date.now(); // fast forward time by bin32, plus 2 seconds, in case testing is slow const newTime = bin32 + now + 2; const timeAdjustment = await provider.send("evm_setTime", [newTime]); - + // it should return `newTime - now`, floored to the nearest second const baseLineOffset = Math.floor((newTime - now) / 1000); assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); @@ -34,7 +34,7 @@ describe("api", () => { const newTime = now + 10000 + 2000; const timeAdjustment = await provider.send("evm_setTime", [`0x${newTime.toString(16)}`]); - + // it should return `newTime - now`, floored to the nearest second const baseLineOffset = Math.floor((newTime - now) / 1000); assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); @@ -47,7 +47,7 @@ describe("api", () => { const newTime = new Date(now + 10000 + 2000); const timeAdjustment = await provider.send("evm_setTime", [newTime]); - + // it should return `newTime.getTime() - now`, floored to the nearest second const baseLineOffset = Math.floor((newTime.getTime() - now) / 1000); assert(between(timeAdjustment, baseLineOffset - 2, baseLineOffset + 2)); @@ -81,8 +81,8 @@ describe("api", () => { it("should mine a block on demand at the specified timestamp", async () => { const startDate = new Date(2019, 3, 15); - const miningTimestamp = Math.floor((new Date(2020, 3, 15).getTime() / 1000)); - const provider = await getProvider({chain:{time: startDate}}); + const miningTimestamp = Math.floor(new Date(2020, 3, 15).getTime() / 1000); + const provider = await getProvider({ chain: { time: startDate } }); await provider.send("evm_mine", [miningTimestamp]); const currentBlock = await provider.send("eth_getBlockByNumber", ["latest"]); assert.strictEqual(parseInt(currentBlock.timestamp), miningTimestamp); @@ -98,7 +98,7 @@ describe("api", () => { }); it("should mine a block when in interval mode", async () => { - const provider = await getProvider({miner:{blockTime: 1000}}); + const provider = await getProvider({ miner: { blockTime: 1000 } }); const initialBlock = parseInt(await provider.send("eth_blockNumber")); await provider.send("evm_mine"); const currentBlock = parseInt(await provider.send("eth_blockNumber")); @@ -106,7 +106,7 @@ describe("api", () => { }); it("should mine a block when in interval mode even when mining is stopped", async () => { - const provider = await getProvider({miner:{blockTime: 1000}}); + const provider = await getProvider({ miner: { blockTime: 1000 } }); const initialBlock = parseInt(await provider.send("eth_blockNumber")); await provider.send("miner_stop"); await provider.send("evm_mine"); @@ -126,78 +126,77 @@ describe("api", () => { assert.strictEqual(status, true); const afterCount = parseInt(await provider.send("eth_getTransactionCount", [account])); assert.strictEqual(afterCount, newCount.toNumber()); - }) + }); }); describe("evm_lockUnknownAccount/evm_unlockUnknownAccount", () => { let accounts: string[], provider: EthereumProvider; - before(async() => { + before(async () => { provider = await getProvider(); accounts = await provider.send("eth_accounts"); }); - - it("should unlock any account after server has been started", async() => { + + it("should unlock any account after server has been started", async () => { const address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"; const result1 = await provider.send("evm_unlockUnknownAccount", [address]); assert.strictEqual(result1, true); - + // should return `false` if account was already locked const result2 = await provider.send("evm_unlockUnknownAccount", [address]); assert.strictEqual(result2, false); }); - - it("should not unlock any locked personal account", async() => { + + it("should not unlock any locked personal account", async () => { const [address] = accounts; await provider.send("personal_lockAccount", [address]); try { await assert.rejects( - provider.send("evm_unlockUnknownAccount", [{ - message: "cannot unlock known/personal account" - }]) + provider.send("evm_unlockUnknownAccount", [ + { + message: "cannot unlock known/personal account" + } + ]) ); } finally { // unlock the account await provider.send("personal_unlockAccount", [address, "", 0]); } }); - - it("should lock any unlocked unknown account via evm_lockUnknownAccount", async() => { + + it("should lock any unlocked unknown account via evm_lockUnknownAccount", async () => { const address = "0x842d35Cc6634C0532925a3b844Bc454e4438f44f"; const unlockResult = await provider.send("evm_unlockUnknownAccount", [address]); assert.strictEqual(unlockResult, true); - + const lockResult1 = await provider.send("evm_lockUnknownAccount", [address]); assert.strictEqual(lockResult1, true); - + // bonus: also make sure we return false when the account is already locked: const lockResult2 = await provider.send("evm_lockUnknownAccount", [address]); assert.strictEqual(lockResult2, false); }); - - it("should not lock a known account via evm_lockUnknownAccount", async() => { - await assert.rejects( - provider.send("evm_lockUnknownAccount", [accounts[0]]), - { - message: "cannot lock known/personal account" - } - ) - }); - - it("should not lock a personal account via evm_lockUnknownAccount", async() => { + + it("should not lock a known account via evm_lockUnknownAccount", async () => { + await assert.rejects(provider.send("evm_lockUnknownAccount", [accounts[0]]), { + message: "cannot lock known/personal account" + }); + }); + + it("should not lock a personal account via evm_lockUnknownAccount", async () => { // create a new personal account const address = await provider.send("personal_newAccount", ["password"]); - + // then explicitly unlock it const result = await provider.send("personal_unlockAccount", [address, "password", 0]); assert.strictEqual(result, true); - + // then try to lock it via evm_lockUnknownAccount await assert.rejects(provider.send("evm_lockUnknownAccount", [address]), { message: "cannot lock known/personal account" }); }); - - it("should return `false` upon lock if account isn't locked (unknown account)", async() => { + + it("should return `false` upon lock if account isn't locked (unknown account)", async () => { const address = "0x942d35Cc6634C0532925a3b844Bc454e4438f450"; const result = await provider.send("evm_lockUnknownAccount", [address]); assert.strictEqual(result, false); diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.sol b/src/chains/ethereum/__tests__/api/evm/snapshot.sol index 0124d11e09..158cf5414d 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.sol +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.sol @@ -2,7 +2,7 @@ pragma solidity ^0.7.4; contract snapshot { - uint public n = 42; + uint256 public n = 42; function inc() public { n += 1; diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 1b1bb97e75..3b4133a4d6 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -3,20 +3,20 @@ import { join } from "path"; import getProvider from "../../helpers/getProvider"; import compile from "../../helpers/compile"; -const eth = "0x" + (1000000000000000000n).toString(16); +const eth = "0x" + 1000000000000000000n.toString(16); -describe("api", function() { - describe("evm", function() { - describe("snapshot / revert", function() { +describe("api", () => { + describe("evm", () => { + describe("snapshot / revert", () => { let context = {} as any; let startingBalance; let snapshotId; - beforeEach("Set up provider and deploy a contract", async function() { + beforeEach("Set up provider and deploy a contract", async () => { const contract = compile(join(__dirname, "./snapshot.sol")); const p = await getProvider({ - miner: {defaultTransactionGasLimit: 6721975} + miner: { defaultTransactionGasLimit: 6721975 } }); const accounts = await p.send("eth_accounts"); const from = accounts[3]; @@ -24,12 +24,12 @@ describe("api", function() { await p.send("eth_subscribe", ["newHeads"]); const transactionHash = await p.send("eth_sendTransaction", [ - { - from, - data: contract.code - } + { + from, + data: contract.code + } ]); - + await p.once("message"); const receipt = await p.send("eth_getTransactionReceipt", [transactionHash]); @@ -46,29 +46,31 @@ describe("api", function() { const tx = { to, data: "0x" + methods["n()"] - } + }; return p.send("eth_call", [tx]); }, inc: async (tx: any) => { tx.from ||= accounts[0]; - tx.to = to + tx.to = to; tx.data = "0x" + methods["inc()"]; const hash = await p.send("eth_sendTransaction", [tx]); await p.once("message"); return await p.send("eth_getTransactionByHash", [hash]); } - } + }; }); - beforeEach("send a transaction then make a checkpoint", async function() { - const { accounts, send, provider } = context + beforeEach("send a transaction then make a checkpoint", async () => { + const { accounts, send, provider } = context; - await send("eth_sendTransaction",[{ - from: accounts[0], - to: accounts[1], - value: eth, - gas: 90000 - }]); + await send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: eth, + gas: 90000 + } + ]); await provider.once("message"); @@ -84,16 +86,18 @@ describe("api", function() { snapshotId = await send("evm_snapshot"); }); - it("rolls back successfully", async() => { + it("rolls back successfully", async () => { const { accounts, send, provider } = context; // Send another transaction, check the balance, then roll it back to the old one and check the balance again. - const transactionHash = await send("eth_sendTransaction",[{ - from: accounts[0], - to: accounts[1], - value: eth, - gas: 90000 - }]); + const transactionHash = await send("eth_sendTransaction", [ + { + from: accounts[0], + to: accounts[1], + value: eth, + gas: 90000 + } + ]); await provider.once("message"); @@ -116,7 +120,7 @@ describe("api", function() { assert.strictEqual(oldReceipt, null, "Receipt should be null as it should have been removed"); }); - it("returns false when reverting a snapshot that doesn't exist", async() => { + it("returns false when reverting a snapshot that doesn't exist", async () => { const { send } = context; const snapShotId1 = await send("evm_snapshot"); @@ -131,7 +135,7 @@ describe("api", function() { assert.strictEqual(response4, false, "Reverting a snapshot that has never existed does not work"); }); - it("checkpoints and reverts without persisting contract storage", async() => { + it("checkpoints and reverts without persisting contract storage", async () => { const { accounts, instance, send } = context; const snapShotId = await send("evm_snapshot"); @@ -153,43 +157,52 @@ describe("api", function() { assert.strictEqual(parseInt(n4), 43, "n is not 43 after calling `inc` again"); }); - it("evm_revert rejects invalid subscriptionId types without crashing", async() => { + it("evm_revert rejects invalid subscriptionId types without crashing", async () => { const { send } = context; const ids = [{ foo: "bar" }, true, false, 0.5, Infinity, -Infinity]; await Promise.all( - ids.map((id) => assert.rejects(send("evm_revert", [id]), /Cannot wrap a .+? as a json-rpc type/, "evm_revert did not reject as expected")) + ids.map(id => + assert.rejects( + send("evm_revert", [id]), + /Cannot wrap a .+? as a json-rpc type/, + "evm_revert did not reject as expected" + ) + ) ); }); - it("evm_revert rejects null/undefined subscriptionId values", async() => { + it("evm_revert rejects null/undefined subscriptionId values", async () => { const { send } = context; const ids = [null, undefined]; await Promise.all( - ids.map((id) => + ids.map(id => assert.rejects(send("evm_revert", [id]), /invalid snapshotId/, "evm_revert did not reject as expected") ) ); }); - it("evm_revert returns false for out-of-range subscriptionId values", async() => { + it("evm_revert returns false for out-of-range subscriptionId values", async () => { const { send } = context; const ids = [-1, Buffer.from([0])]; - const promises = ids.map((id) => send("evm_revert", [id]).then(result => assert.strictEqual(result, false))); + const promises = ids.map(id => send("evm_revert", [id]).then(result => assert.strictEqual(result, false))); await Promise.all(promises); }); - it("removes transactions that are already in processing at the start of evm_revert", async() => { - const { send, accounts: [from, to] } = context; + it("removes transactions that are already in processing at the start of evm_revert", async () => { + const { + send, + accounts: [from, to] + } = context; const snapShotId = await send("evm_snapshot"); // increment value for each transaction so the hashes always differ let value = 1; - + // send some transactions const inFlightTxs = [ - send("eth_sendTransaction", [{from, to, value: value++}]), - send("eth_sendTransaction", [{from, to, value: value++}]) + send("eth_sendTransaction", [{ from, to, value: value++ }]), + send("eth_sendTransaction", [{ from, to, value: value++ }]) ]; // wait for the tx hashes to be returned; this is confirmation that // they've been accepted by the transaction pool. @@ -200,10 +213,7 @@ describe("api", function() { const receiptsProm = Promise.all(txHashes.map(getReceipt)); const transactionsProm = Promise.all(txHashes.map(getTx)); - const [receipts, transactions] = await Promise.all([ - receiptsProm, - transactionsProm - ]); + const [receipts, transactions] = await Promise.all([receiptsProm, transactionsProm]); // verify that we don't yet have a receipt receipts.forEach(receipt => { @@ -220,10 +230,7 @@ describe("api", function() { const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalTransactionsProm = Promise.all(txHashes.map(getTx)); - const [finalReceipts, finalTransactions] = await Promise.all([ - finalReceiptsProm, - finalTransactionsProm - ]); + const [finalReceipts, finalTransactions] = await Promise.all([finalReceiptsProm, finalTransactionsProm]); // verify that we don't have any receipts finalReceipts.forEach(receipt => { @@ -236,19 +243,23 @@ describe("api", function() { }); }); - it("removes transactions that are in pending transactions at the start of evm_revert", async() => { - const { provider, send, accounts: [from, to] } = context; + it("removes transactions that are in pending transactions at the start of evm_revert", async () => { + const { + provider, + send, + accounts: [from, to] + } = context; const snapShotId = await send("evm_snapshot"); // increment value for each transaction so the hashes always differ let value = 1; - + // send some transactions const accountNonce = parseInt(await send("eth_getTransactionCount", [from]), 16); const inFlightTxs = [ - send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce + 1}]), - send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce + 2}]) + send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce + 1 }]), + send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce + 2 }]) ]; // wait for the tx hashes to be returned; this is confirmation that // they've been accepted by the transaction pool. @@ -268,7 +279,7 @@ describe("api", function() { await send("evm_revert", [snapShotId]); // mine a transaction to fill in the nonce gap (this would normally cause the pending transactions to be mined) - await send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce}]); + await send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce }]); await provider.once("message"); // and mine one more block just to force the any transactions to be immediately mined @@ -276,10 +287,7 @@ describe("api", function() { const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalTransactionsProm = Promise.all(txHashes.map(getTx)); - const [finalReceipts, finalTransactions] = await Promise.all([ - finalReceiptsProm, - finalTransactionsProm - ]); + const [finalReceipts, finalTransactions] = await Promise.all([finalReceiptsProm, finalTransactionsProm]); // verify that we don't have any receipts finalReceipts.forEach(receipt => { @@ -292,8 +300,12 @@ describe("api", function() { }); }); - it("doesn't revert transactions that were added *after* the start of evm_revert", async() => { - const { provider, send, accounts: [from, to] } = context; + it("doesn't revert transactions that were added *after* the start of evm_revert", async () => { + const { + provider, + send, + accounts: [from, to] + } = context; const accountNonce = parseInt(await send("eth_getTransactionCount", [from]), 16); @@ -303,22 +315,22 @@ describe("api", function() { let value = 1; // send a transaction so we have something to revert - const revertedTx = await send("eth_sendTransaction", [{from, to, value: value++}]); + const revertedTx = await send("eth_sendTransaction", [{ from, to, value: value++ }]); await provider.once("message"); - + // revert while these transactions are being mined const revertPromise = send("evm_revert", [snapShotId]); // send some transactions const inFlightTxs = [ - send("eth_sendTransaction", [{from, to, value: value++}]), - send("eth_sendTransaction", [{from, to, value: value++}]), + send("eth_sendTransaction", [{ from, to, value: value++ }]), + send("eth_sendTransaction", [{ from, to, value: value++ }]) ]; // these two transactions have nonces that are too high to be executed immediately const laterTxs = [ - send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce + 3}]), - send("eth_sendTransaction", [{from, to, value: value++, nonce: accountNonce + 3}]), + send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce + 3 }]), + send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce + 3 }]) ]; const txsMinedProm = new Promise(resolve => { let count = 0; @@ -352,10 +364,7 @@ describe("api", function() { const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalTransactionsProm = Promise.all(txHashes.map(getTx)); - const [finalReceipts, finalTransactions] = await Promise.all([ - finalReceiptsProm, - finalTransactionsProm - ]); + const [finalReceipts, finalTransactions] = await Promise.all([finalReceiptsProm, finalTransactionsProm]); // verify that we do have the receipts finalReceipts.forEach(receipt => { @@ -385,7 +394,7 @@ describe("api", function() { }); // send one more transaction to fill in the gap - send("eth_sendTransaction", [{from, to, value: value++}]); + send("eth_sendTransaction", [{ from, to, value: value++ }]); await new Promise(resolve => { let count = 0; diff --git a/src/chains/ethereum/__tests__/api/miner/miner.test.ts b/src/chains/ethereum/__tests__/api/miner/miner.test.ts index f1a6d07c04..423a55623f 100644 --- a/src/chains/ethereum/__tests__/api/miner/miner.test.ts +++ b/src/chains/ethereum/__tests__/api/miner/miner.test.ts @@ -27,7 +27,7 @@ describe("api", () => { // send a transaction, and make sure it does *not* get mined await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendTransaction", [{from: account, to: account, value: 1}]); + const txHash = await provider.send("eth_sendTransaction", [{ from: account, to: account, value: 1 }]); const fail = () => assert.fail("No message should have been received while mining was stopped"); provider.on("message", fail); await new Promise(resolve => setTimeout(resolve, 2000)); @@ -60,7 +60,7 @@ describe("api", () => { }).timeout(3000); it("should stop mining, then mine when started", async () => { - const provider = await getProvider({miner:{blockTime: 1}}); + const provider = await getProvider({ miner: { blockTime: 1 } }); await testStopStartMining(provider); }).timeout(4000); }); @@ -74,18 +74,18 @@ describe("api", () => { assert.strictEqual(coinbase, accounts[1]); await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendTransaction", [{from: accounts[0], to: accounts[0]}]); + const txHash = await provider.send("eth_sendTransaction", [{ from: accounts[0], to: accounts[0] }]); await provider.once("message"); - const {status, blockNumber} = await provider.send("eth_getTransactionReceipt", [txHash]); + const { status, blockNumber } = await provider.send("eth_getTransactionReceipt", [txHash]); assert.strictEqual(status, 1); - const {miner} = await provider.send("eth_getBlockByNumber", [blockNumber]); + const { miner } = await provider.send("eth_getBlockByNumber", [blockNumber]); assert.strictEqual(miner, accounts[1]); }); }); describe("miner_setGasPrice", () => { it("sets the gasPrice and uses it as the default price in tranactions", async () => { - const newGasPrice = "0xffff" + const newGasPrice = "0xffff"; const setState = await provider.send("miner_setGasPrice", [newGasPrice]); assert.strictEqual(setState, true); @@ -93,12 +93,12 @@ describe("api", () => { assert.strictEqual(ethGasPrice, newGasPrice); await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendTransaction", [{from: accounts[0], to: accounts[0]}]); + const txHash = await provider.send("eth_sendTransaction", [{ from: accounts[0], to: accounts[0] }]); await provider.once("message"); - const {gasPrice} = await provider.send("eth_getTransactionByHash", [txHash]); + const { gasPrice } = await provider.send("eth_getTransactionByHash", [txHash]); assert.strictEqual(gasPrice, newGasPrice); }); - }) + }); }); }); diff --git a/src/chains/ethereum/__tests__/api/net/net.test.ts b/src/chains/ethereum/__tests__/api/net/net.test.ts index 8ffdd04961..02d6cc4970 100644 --- a/src/chains/ethereum/__tests__/api/net/net.test.ts +++ b/src/chains/ethereum/__tests__/api/net/net.test.ts @@ -2,7 +2,7 @@ import assert from "assert"; import getProvider from "../../helpers/getProvider"; describe("api", () => { - describe("net", () => {; + describe("net", () => { it("net_version", async () => { const roundedTo5Seconds = (num: number) => Math.round(num / 5000) * 5000; const nowIsh = roundedTo5Seconds(Date.now()); diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/__tests__/api/personal/personal.test.ts index e6e1490114..d3000112c4 100644 --- a/src/chains/ethereum/__tests__/api/personal/personal.test.ts +++ b/src/chains/ethereum/__tests__/api/personal/personal.test.ts @@ -7,14 +7,18 @@ describe("api", () => { describe("personal", () => { describe("listAccounts", () => { it("matches eth_accounts", async () => { - const provider = await getProvider({wallet:{ seed: "temet nosce" }}); + const provider = await getProvider({ wallet: { seed: "temet nosce" } }); const accounts = await provider.send("eth_accounts"); const personalAccounts = await provider.send("personal_listAccounts"); assert.deepStrictEqual(personalAccounts, accounts); }); }); - async function testLockedAccountWithPassphraseViaEth_SendTransaction(provider: EthereumProvider, newAccount: string, passphrase: string) { + async function testLockedAccountWithPassphraseViaEth_SendTransaction( + provider: EthereumProvider, + newAccount: string, + passphrase: string + ) { const transaction = { from: newAccount, to: newAccount, @@ -25,9 +29,13 @@ describe("api", () => { }; // make sure we can't use the account via eth_sendTransaction - await assert.rejects(provider.send("eth_sendTransaction", [transaction]), { - message: "authentication needed: password or unlock" - }, "eth_sendTransaction should have rejected due to locked from account without its passphrase"); + await assert.rejects( + provider.send("eth_sendTransaction", [transaction]), + { + message: "authentication needed: password or unlock" + }, + "eth_sendTransaction should have rejected due to locked from account without its passphrase" + ); // unlock the account indefinitely const unlocked = await provider.send("personal_unlockAccount", [newAccount, passphrase, 0]); @@ -48,12 +56,20 @@ describe("api", () => { assert.strictEqual(accountLocked, true); // make sure it is locked - await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { - message: "authentication needed: password or unlock" - }, "personal_lockAccount didn't work"); + await assert.rejects( + provider.send("eth_sendTransaction", [Object.assign({}, transaction, { nonce: 1 })]), + { + message: "authentication needed: password or unlock" + }, + "personal_lockAccount didn't work" + ); } - async function testLockedAccountWithPassphraseViaPersonal_SendTransaction(provider: EthereumProvider, newAccount: string, passphrase: string){ + async function testLockedAccountWithPassphraseViaPersonal_SendTransaction( + provider: EthereumProvider, + newAccount: string, + passphrase: string + ) { const transaction = { from: newAccount, to: newAccount, @@ -64,37 +80,64 @@ describe("api", () => { }; // make sure we can't use the account via personal_sendTransaction and no passphrase - await assert.rejects(provider.send("personal_sendTransaction", [transaction, undefined]), { - message: "could not decrypt key with given password" - }, "personal_sendTransaction should have rejected due to locked from account without its passphrase"); + await assert.rejects( + provider.send("personal_sendTransaction", [transaction, undefined]), + { + message: "could not decrypt key with given password" + }, + "personal_sendTransaction should have rejected due to locked from account without its passphrase" + ); // make sure we can't use the account with bad passphrases - const invalidPassphrases = ["this is not my passphrase", null, undefined, Buffer.allocUnsafe(0), 1, 0, Infinity, NaN]; - await Promise.all(invalidPassphrases.map(invalidPassphrase => { - return assert.rejects(provider.send("personal_sendTransaction", [transaction, invalidPassphrase as any]), { - message: "could not decrypt key with given password" - }, "Transaction should have rejected due to locked from account with wrong passphrase") - })); + const invalidPassphrases = [ + "this is not my passphrase", + null, + undefined, + Buffer.allocUnsafe(0), + 1, + 0, + Infinity, + NaN + ]; + await Promise.all( + invalidPassphrases.map(invalidPassphrase => { + return assert.rejects( + provider.send("personal_sendTransaction", [transaction, invalidPassphrase as any]), + { + message: "could not decrypt key with given password" + }, + "Transaction should have rejected due to locked from account with wrong passphrase" + ); + }) + ); // use personal_sendTransaction with the valid passphrase await provider.send("eth_subscribe", ["newHeads"]); const transactionHashPromise = provider.send("personal_sendTransaction", [transaction, passphrase]); const msgPromise = transactionHashPromise.then(() => provider.once("message")); - await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { - message: "authentication needed: password or unlock" - }, "personal_sendTransaction should not unlock the while transaction is bring processed"); + await assert.rejects( + provider.send("eth_sendTransaction", [Object.assign({}, transaction, { nonce: 1 })]), + { + message: "authentication needed: password or unlock" + }, + "personal_sendTransaction should not unlock the while transaction is bring processed" + ); - const transactionHash = await transactionHashPromise + const transactionHash = await transactionHashPromise; await msgPromise; const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); assert.strictEqual(receipt.status, 1, "Transaction failed when it should have succeeded"); // ensure the account is still locked - await assert.rejects(provider.send("eth_sendTransaction", [Object.assign({}, transaction, {nonce: 1})]), { - message: "authentication needed: password or unlock" - }, "personal_sendTransaction should still be locked the after the transaction is processed"); + await assert.rejects( + provider.send("eth_sendTransaction", [Object.assign({}, transaction, { nonce: 1 })]), + { + message: "authentication needed: password or unlock" + }, + "personal_sendTransaction should still be locked the after the transaction is processed" + ); } describe("newAccount", () => { @@ -108,7 +151,7 @@ describe("api", () => { it("generates different accounts based on the `seed` option", async () => { const controlProvider = await getProvider(); - const provider = await getProvider({wallet:{ seed: "temet nosce" }}); + const provider = await getProvider({ wallet: { seed: "temet nosce" } }); const newAccount = await provider.send("personal_newAccount", [""]); const controlAccount = await controlProvider.send("personal_newAccount", [""]); assert.notStrictEqual(newAccount, controlAccount); @@ -116,7 +159,9 @@ describe("api", () => { it("generates different accounts based on the `mnemonic` option", async () => { const controlProvider = await getProvider(); - const provider = await getProvider({wallet:{ mnemonic: "sweet treat" }}); + const provider = await getProvider({ + wallet: { mnemonic: "sweet treat" } + }); const newAccount = await provider.send("personal_newAccount", [""]); const controlAccount = await controlProvider.send("personal_newAccount", [""]); assert.notStrictEqual(newAccount, controlAccount); @@ -131,20 +176,28 @@ describe("api", () => { it("generates different accounts on successive calls based on the seed", async () => { const controlProvider = await getProvider(); - const provider = await getProvider({wallet:{ seed: "temet nosce" }}); + const provider = await getProvider({ wallet: { seed: "temet nosce" } }); const firstNewAccount = await provider.send("personal_newAccount", [""]); const secondNewAccount = await provider.send("personal_newAccount", [""]); await provider.send("personal_newAccount", [""]); const controlSecondNewAccount = await controlProvider.send("personal_newAccount", [""]); - assert.notStrictEqual(firstNewAccount, secondNewAccount, "First and second generated accounts are the same when they shouldn't be"); - assert.notStrictEqual(secondNewAccount, controlSecondNewAccount, "Second account is identical to control's second account when it shouldn't be"); + assert.notStrictEqual( + firstNewAccount, + secondNewAccount, + "First and second generated accounts are the same when they shouldn't be" + ); + assert.notStrictEqual( + secondNewAccount, + controlSecondNewAccount, + "Second account is identical to control's second account when it shouldn't be" + ); }); describe("personal_unlockAccount ➡ eth_sendTransaction ➡ personal_lockAccount", () => { it("generates locked accounts with passphrase", async () => { - const provider = await getProvider({miner:{gasPrice: 0}}); + const provider = await getProvider({ miner: { gasPrice: 0 } }); const passphrase = "this is my passphrase"; // generate an account const newAccount = await provider.send("personal_newAccount", [passphrase]); @@ -155,7 +208,7 @@ describe("api", () => { describe("personal_sendTransaction", () => { it("generates locked accounts with passphrase", async () => { - const provider = await getProvider({miner:{gasPrice: 0}}); + const provider = await getProvider({ miner: { gasPrice: 0 } }); const passphrase = "this is my passphrase"; // generate an account const newAccount = await provider.send("personal_newAccount", [passphrase]); @@ -172,12 +225,16 @@ describe("api", () => { it("should return the known account address", async () => { const provider = await getProvider(); const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); - assert.strictEqual(newAccount, "0x14791697260e4c9a71f18484c9f997b308e59325", "Raw account not imported correctly"); + assert.strictEqual( + newAccount, + "0x14791697260e4c9a71f18484c9f997b308e59325", + "Raw account not imported correctly" + ); }); describe("personal_unlockAccount ➡ eth_sendTransaction ➡ personal_lockAccount", () => { it("generates locked accounts with passphrase", async () => { - const provider = await getProvider({miner:{gasPrice: 0}}); + const provider = await getProvider({ miner: { gasPrice: 0 } }); const passphrase = "this is my passphrase"; // generate an account const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); @@ -188,7 +245,7 @@ describe("api", () => { describe("personal_sendTransaction", () => { it("generates locked accounts with passphrase", async () => { - const provider = await getProvider({miner:{gasPrice: 0}}); + const provider = await getProvider({ miner: { gasPrice: 0 } }); // generate an account const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); diff --git a/src/chains/ethereum/__tests__/api/rpc/modules.test.ts b/src/chains/ethereum/__tests__/api/rpc/modules.test.ts index 8d4c32b2cd..d4fe8f4c1b 100644 --- a/src/chains/ethereum/__tests__/api/rpc/modules.test.ts +++ b/src/chains/ethereum/__tests__/api/rpc/modules.test.ts @@ -1,8 +1,14 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; -const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; +const RPC_MODULES = { + eth: "1.0", + net: "1.0", + rpc: "1.0", + web3: "1.0", + evm: "1.0", + personal: "1.0" +} as const; describe("api", () => { describe("rpc", () => { diff --git a/src/chains/ethereum/__tests__/api/shh/shh.test.ts b/src/chains/ethereum/__tests__/api/shh/shh.test.ts index 2902897091..51e8053178 100644 --- a/src/chains/ethereum/__tests__/api/shh/shh.test.ts +++ b/src/chains/ethereum/__tests__/api/shh/shh.test.ts @@ -1,4 +1,3 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; diff --git a/src/chains/ethereum/__tests__/api/web3/web3.test.ts b/src/chains/ethereum/__tests__/api/web3/web3.test.ts index db673fa169..13846b6235 100644 --- a/src/chains/ethereum/__tests__/api/web3/web3.test.ts +++ b/src/chains/ethereum/__tests__/api/web3/web3.test.ts @@ -1,4 +1,3 @@ - import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; diff --git a/src/chains/ethereum/__tests__/contracts/HelloWorld.sol b/src/chains/ethereum/__tests__/contracts/HelloWorld.sol index f0bbafad69..59e7b6f1d5 100644 --- a/src/chains/ethereum/__tests__/contracts/HelloWorld.sol +++ b/src/chains/ethereum/__tests__/contracts/HelloWorld.sol @@ -2,20 +2,20 @@ pragma solidity ^0.7.4; contract HelloWorld { - uint public value; + uint256 public value; - event ValueSet(uint); + event ValueSet(uint256); - constructor() payable { - value = 5; - } + constructor() payable { + value = 5; + } - function setValue(uint val) public { - value = val; - emit ValueSet(val); - } + function setValue(uint256 val) public { + value = val; + emit ValueSet(val); + } - function getConstVal() public pure returns (uint8) { - return 123; - } + function getConstVal() public pure returns (uint8) { + return 123; + } } diff --git a/src/chains/ethereum/__tests__/helpers/compile.ts b/src/chains/ethereum/__tests__/helpers/compile.ts index d0c9aaecd5..dca78d5f52 100644 --- a/src/chains/ethereum/__tests__/helpers/compile.ts +++ b/src/chains/ethereum/__tests__/helpers/compile.ts @@ -17,7 +17,7 @@ import { parse } from "path"; export default function compile(contractPath: string, contractName?: string) { const parsedPath = parse(contractPath); - const content = readFileSync(contractPath, {encoding: "utf8"}); + const content = readFileSync(contractPath, { encoding: "utf8" }); const globalName = parsedPath.base; contractName ||= parsedPath.name; @@ -46,4 +46,4 @@ export default function compile(contractPath: string, contractName?: string) { code: "0x" + contract.evm.bytecode.object, contract }; -} \ No newline at end of file +} diff --git a/src/chains/ethereum/__tests__/helpers/getProvider.ts b/src/chains/ethereum/__tests__/helpers/getProvider.ts index 5a589c0bde..5fbfb837c2 100644 --- a/src/chains/ethereum/__tests__/helpers/getProvider.ts +++ b/src/chains/ethereum/__tests__/helpers/getProvider.ts @@ -7,9 +7,13 @@ const mnemonic = "into trim cross then helmet popular suit hammer cart shrug ova type Writeable = { -readonly [P in keyof T]: T[P] }; -const getProvider = async (options: Writeable = {wallet: {mnemonic: mnemonic}}) => { +const getProvider = async ( + options: Writeable = { + wallet: { mnemonic: mnemonic } + } +) => { options.chain = options.chain || {}; - options.logging = options.logging || {logger: {log: ()=>{}}}; + options.logging = options.logging || { logger: { log: () => {} } }; // set `asyncRequestProcessing` to `true` by default let doAsync = options.chain.asyncRequestProcessing; @@ -17,7 +21,7 @@ const getProvider = async (options: Writeable = {wallet // don't write to stdout in tests if (!options.logging.logger) { - options.logging.logger = {log:()=>{}}; + options.logging.logger = { log: () => {} }; } const requestCoordinator = new RequestCoordinator(doAsync ? 0 : 1); @@ -30,6 +34,6 @@ const getProvider = async (options: Writeable = {wallet }); }); return provider; -} +}; export default getProvider; diff --git a/src/chains/ethereum/__tests__/provider.test.ts b/src/chains/ethereum/__tests__/provider.test.ts index b58da4334b..61b3519414 100644 --- a/src/chains/ethereum/__tests__/provider.test.ts +++ b/src/chains/ethereum/__tests__/provider.test.ts @@ -1,13 +1,13 @@ import assert from "assert"; import EthereumProvider from "../src/provider"; import getProvider from "./helpers/getProvider"; -import {JsonRpcTypes} from "@ganache/utils"; +import { JsonRpcTypes } from "@ganache/utils"; import EthereumApi from "../src/api"; describe("provider", () => { describe("options", () => { it("generates predictable accounts when given a seed", async () => { - const provider = await getProvider({wallet:{seed: "temet nosce"}}); + const provider = await getProvider({ wallet: { seed: "temet nosce" } }); const accounts = await provider.send("eth_accounts"); assert.strictEqual(accounts[0], "0x59ef313e6ee26bab6bcb1b5694e59613debd88da"); }); @@ -18,7 +18,7 @@ describe("provider", () => { let provider: EthereumProvider; beforeEach(async () => { - provider = await getProvider({chain:{ networkId }}); + provider = await getProvider({ chain: { networkId } }); }); it("returns things via EIP-1193", async () => { @@ -32,17 +32,21 @@ describe("provider", () => { method: "net_version" }; const methods = ["send", "sendAsync"] as const; - return Promise.all(methods.map(method => { - return new Promise((resolve, reject) => { - provider[method](jsonRpcRequest, (err: Error, {result}): void => { - if(err) return reject(err); - assert.strictEqual(result, `${networkId}`); - resolve(void 0); - }); - }); - }).map(async prom => { - assert.strictEqual(await prom, void 0); - })); + return Promise.all( + methods + .map(method => { + return new Promise((resolve, reject) => { + provider[method](jsonRpcRequest, (err: Error, { result }): void => { + if (err) return reject(err); + assert.strictEqual(result, `${networkId}`); + resolve(void 0); + }); + }); + }) + .map(async prom => { + assert.strictEqual(await prom, void 0); + }) + ); }); }); }); diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index 368ed52d69..0a585698a5 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -15,7 +15,7 @@ describe("Random tests that are temporary!", () => { const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; it("should respect the BIP99 mnemonic", async () => { - const options = {wallet:{mnemonic}}; + const options = { wallet: { mnemonic } }; const p = await getProvider(options); const accounts = await p.send("eth_accounts"); @@ -23,7 +23,7 @@ describe("Random tests that are temporary!", () => { }); it("eth_sendTransaction", async () => { - const options = {wallet:{mnemonic}}; + const options = { wallet: { mnemonic } }; const p = await getProvider(options); const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); @@ -48,7 +48,7 @@ describe("Random tests that are temporary!", () => { }); it("shouldn't allow initialization without accounts", async () => { - const options = {wallet: {totalAccounts: 0}} as any; + const options = { wallet: { totalAccounts: 0 } } as any; await assert.rejects(getProvider(options), { message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" }); @@ -61,15 +61,17 @@ describe("Random tests that are temporary!", () => { it("sets up accounts", async () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); - const p = await getProvider({wallet: { - accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }}); + const p = await getProvider({ + wallet: { + accounts: [{ balance: "0x123", secretKey: "0x" + privateKey.toString("hex") }, { balance: "0x456" }] + } + }); const accounts = await p.send("eth_accounts"); assert.strictEqual(accounts.length, 2); }); it("sets errors when unlocked_accounts index is too high", async () => { - await assert.rejects(getProvider({wallet: {unlockedAccounts: [99]}}), { + await assert.rejects(getProvider({ wallet: { unlockedAccounts: [99] } }), { message: "Account at index 99 not found. Max index available is 9." }); }); @@ -77,9 +79,11 @@ describe("Random tests that are temporary!", () => { it("sets errors when unlocked_accounts index is a (big) bigint", async () => { const bigNumber = BigInt(Number.MAX_SAFE_INTEGER) + 1n; await assert.rejects( - getProvider({wallet:{ - unlockedAccounts: [bigNumber.toString()] - }}), + getProvider({ + wallet: { + unlockedAccounts: [bigNumber.toString()] + } + }), { message: `Invalid value in unlocked_accounts: ${bigNumber}` } @@ -87,11 +91,13 @@ describe("Random tests that are temporary!", () => { }); it("unlocks accounts via unlock_accounts (both string and numbered numbers)", async () => { - const p = await getProvider({wallet: { - mnemonic, - secure: true, - unlockedAccounts: ["0", 1] - }}); + const p = await getProvider({ + wallet: { + mnemonic, + secure: true, + unlockedAccounts: ["0", 1] + } + }); const accounts = await p.send("eth_accounts"); const balance1_1 = await p.send("eth_getBalance", [accounts[1]]); @@ -140,7 +146,7 @@ describe("Random tests that are temporary!", () => { const contract = compile(join(__dirname, "./contracts/HelloWorld.sol")); const p = await getProvider({ - miner: {defaultTransactionGasLimit: 6721975} + miner: { defaultTransactionGasLimit: 6721975 } }); const accounts = await p.send("eth_accounts"); const from = accounts[3]; @@ -161,17 +167,13 @@ describe("Random tests that are temporary!", () => { const to = receipt.contractAddress; const methods = contract.contract.evm.methodIdentifiers; - - const value = await p.send("eth_call", [ - {from, to, data: "0x" + methods["value()"]} - ]); + + const value = await p.send("eth_call", [{ from, to, data: "0x" + methods["value()"] }]); const x5 = "0x0000000000000000000000000000000000000000000000000000000000000005"; assert.strictEqual(value, x5); - const constVal = await p.send("eth_call", [ - {from, to, data: "0x" + methods["getConstVal()"]} - ]); + const constVal = await p.send("eth_call", [{ from, to, data: "0x" + methods["getConstVal()"] }]); const x123 = "0x000000000000000000000000000000000000000000000000000000000000007b"; assert.strictEqual(constVal, x123); @@ -181,16 +183,12 @@ describe("Random tests that are temporary!", () => { const raw25 = "0000000000000000000000000000000000000000000000000000000000000019"; const x25 = "0x" + raw25; - const hash = await p.send("eth_sendTransaction", [ - {from, to, data: "0x" + methods["setValue(uint256)"] + raw25} - ]); + const hash = await p.send("eth_sendTransaction", [{ from, to, data: "0x" + methods["setValue(uint256)"] + raw25 }]); await p.once("message"); const txReceipt = await p.send("eth_getTransactionReceipt", [hash]); assert.strictEqual(txReceipt.blockNumber, "0x2"); - const getValueAgain = await p.send("eth_call", [ - {from, to, data: "0x" + methods["value()"]} - ]); + const getValueAgain = await p.send("eth_call", [{ from, to, data: "0x" + methods["value()"] }]); assert.strictEqual(getValueAgain, x25); @@ -199,7 +197,7 @@ describe("Random tests that are temporary!", () => { }); it("transfers value", async () => { - const p = await getProvider({miner:{gasPrice: 0}}); + const p = await getProvider({ miner: { gasPrice: 0 } }); const accounts = await p.send("eth_accounts"); const ONE_ETHER = 1000000000000000000n; const startingBalance = 100n * ONE_ETHER; @@ -213,27 +211,28 @@ describe("Random tests that are temporary!", () => { ]); await p.once("message"); - const balances = (await Promise.all([ - p.send("eth_getBalance", [accounts[1]]), - p.send("eth_getBalance", [accounts[2]]) - ])).map(BigInt); + const balances = ( + await Promise.all([p.send("eth_getBalance", [accounts[1]]), p.send("eth_getBalance", [accounts[2]])]) + ).map(BigInt); assert.strictEqual(balances[0], startingBalance - ONE_ETHER); assert.strictEqual(balances[1], startingBalance + ONE_ETHER); }); it("runs eth_call", async () => { const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); - const p = await getProvider({wallet:{ - accounts: [{balance: "0x123", secretKey: "0x" + privateKey.toString("hex")}, {balance: "0x456"}] - }}); + const p = await getProvider({ + wallet: { + accounts: [{ balance: "0x123", secretKey: "0x" + privateKey.toString("hex") }, { balance: "0x456" }] + } + }); const accounts = await p.send("eth_accounts"); - const result = await p.send("eth_call", [{from: accounts[0], to: accounts[0], value: "0x1"}]); + const result = await p.send("eth_call", [{ from: accounts[0], to: accounts[0], value: "0x1" }]); assert(result, "0x"); }); describe("options:account_keys_path", () => { const fileName = join(os.tmpdir(), "/ganache-core-test-accounts.json"); - + function cleanUp() { try { fs.unlinkSync(fileName); @@ -245,15 +244,15 @@ describe("Random tests that are temporary!", () => { cleanUp(); }); it("should create the file by name", async () => { - await getProvider({wallet:{ accountKeysPath: fileName }}); + await getProvider({ wallet: { accountKeysPath: fileName } }); assert.strictEqual(fs.existsSync(fileName), true, "The account_keys file doesn't exist."); }); it("should populate the file by descriptor", async () => { - const fd = fs.openSync(fileName, "w") + const fd = fs.openSync(fileName, "w"); try { - await getProvider({wallet: { accountKeysPath: fd }}); + await getProvider({ wallet: { accountKeysPath: fd } }); assert.strictEqual(fs.existsSync(fileName), true, "The account_keys file doesn't exist."); - } finally{ + } finally { fs.closeSync(fd); } }); diff --git a/src/chains/ethereum/scripts/post-process-docs.js b/src/chains/ethereum/scripts/post-process-docs.js index 7287c32203..8ee831f249 100644 --- a/src/chains/ethereum/scripts/post-process-docs.js +++ b/src/chains/ethereum/scripts/post-process-docs.js @@ -1,16 +1,21 @@ -const cheerio = require('cheerio'); +const cheerio = require("cheerio"); const { readFileSync, writeFileSync } = require("fs"); -const { randomBytes } = require('crypto'); +const { randomBytes } = require("crypto"); const $ = cheerio.load(readFileSync("./lib/docs/classes/_api_.ethereumapi.html")); -$(`.tsd-page-title`).after(``) +$(`.tsd-page-title`).after(``); -$('.runkit-example').each(function() { - const sanitizedCode = $(this).text().replace(/;(\s+)/gi, ";\n").trim(); - $(this).text("") - const id = randomBytes(4).toString('hex'); - $(this).attr("id", id).html() - $(this).prepend(``) - }); +$(".runkit-example").each(function () { + const sanitizedCode = $(this) + .text() + .replace(/;(\s+)/gi, ";\n") + .trim(); + $(this).text(""); + const id = randomBytes(4).toString("hex"); + $(this).attr("id", id).html(); + $(this).prepend( + `` + ); +}); -writeFileSync("./lib/docs/classes/_api_.ethereumapi.html", $.html()) +writeFileSync("./lib/docs/classes/_api_.ethereumapi.html", $.html()); diff --git a/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts b/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts index 3c2ff7bada..4014380bed 100644 --- a/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts +++ b/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts @@ -1,7 +1,7 @@ declare module "ethereumjs-block/header" { import BN from "bn.js"; - import {Block} from "ethereumjs-block"; - import {Blockchain} from "ethereumjs-blockchain"; + import { Block } from "ethereumjs-block"; + import { Blockchain } from "ethereumjs-blockchain"; type LargeNumber = string | Buffer | BN; type Callback = (err: Error | null, result: T) => void; diff --git a/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts b/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts index 5ed0bca68c..e9eac23952 100644 --- a/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts +++ b/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts @@ -1,6 +1,6 @@ declare module "ethereumjs-block" { import BN from "bn.js"; - import {Blockchain} from "ethereumjs-blockchain"; + import { Blockchain } from "ethereumjs-blockchain"; import Transaction from "ethereumjs-tx"; import BlockHeader from "ethereumjs-block/header"; import Trie from "merkle-patricia-tree/baseTrie"; diff --git a/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts b/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts index 988c2050c9..0345eb30c1 100644 --- a/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts +++ b/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts @@ -1,5 +1,5 @@ -import "ethereumjs-util" +import "ethereumjs-util"; declare module "ethereumjs-util" { export declare const publicToAddress: (pubKey: Buffer, sanitize?: boolean) => Buffer; -} \ No newline at end of file +} diff --git a/src/chains/ethereum/src/@types/hdkey/index.d.ts b/src/chains/ethereum/src/@types/hdkey/index.d.ts index 9989759de2..63344e6789 100644 --- a/src/chains/ethereum/src/@types/hdkey/index.d.ts +++ b/src/chains/ethereum/src/@types/hdkey/index.d.ts @@ -3,7 +3,7 @@ declare module "hdkey" { xpriv: string; xpub: string; }; - type HDKeyVersions = {private: number; public: number}; + type HDKeyVersions = { private: number; public: number }; export default class HDKey { public versions: HDKeyVersions; public depth: number; diff --git a/src/chains/ethereum/src/@types/levelup/index.d.ts b/src/chains/ethereum/src/@types/levelup/index.d.ts index 2881ca2f39..041437a954 100644 --- a/src/chains/ethereum/src/@types/levelup/index.d.ts +++ b/src/chains/ethereum/src/@types/levelup/index.d.ts @@ -1,7 +1,7 @@ /// declare module "levelup" { - import {AbstractLevelDOWN} from "abstract-leveldown"; + import { AbstractLevelDOWN } from "abstract-leveldown"; export = levelup; @@ -32,33 +32,41 @@ declare module "levelup" { put(key: any, value: any): Promise; put(key: any, value: any, callback: (error: any) => any): void; - put(key: any, value: any, options: {sync?: boolean}): Promise; - put(key: any, value: any, options: {sync?: boolean}, callback: (error: any) => any): void; + put(key: any, value: any, options: { sync?: boolean }): Promise; + put(key: any, value: any, options: { sync?: boolean }, callback: (error: any) => any): void; get(key: any): Promise; get(key: any, callback: (error: any, value: any) => any): void; - get(key: any, options: {keyEncoding?: Encoding; fillCache?: boolean}): Promise; + get(key: any, options: { keyEncoding?: Encoding; fillCache?: boolean }): Promise; get( key: any, - options: {keyEncoding?: Encoding; fillCache?: boolean}, + options: { keyEncoding?: Encoding; fillCache?: boolean }, callback: (error: any, value: any) => any ): void; del(key: any): Promise; del(key: any, callback: (error: any) => any): void; - del(key: any, options: {keyEncoding?: Encoding; sync?: boolean}): Promise; - del(key: any, options: {keyEncoding?: Encoding; sync?: boolean}, callback: (error: any) => any): void; + del(key: any, options: { keyEncoding?: Encoding; sync?: boolean }): Promise; + del(key: any, options: { keyEncoding?: Encoding; sync?: boolean }, callback: (error: any) => any): void; batch(): LevelUpChain; batch(array: BatchType[]): Promise; batch(array: BatchType[], callback: (error?: any) => any): void; batch( array: BatchType[], - options: {keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean} + options: { + keyEncoding?: Encoding; + valueEncoding?: Encoding; + sync?: boolean; + } ): Promise; batch( array: BatchType[], - options: {keyEncoding?: Encoding; valueEncoding?: Encoding; sync?: boolean}, + options: { + keyEncoding?: Encoding; + valueEncoding?: Encoding; + sync?: boolean; + }, callback: (error?: any) => any ): void; @@ -73,9 +81,9 @@ declare module "levelup" { interface LevelUpChain { put(key: any, value: any): LevelUpChain; - put(key: any, value: any, options?: {sync?: boolean}): LevelUpChain; + put(key: any, value: any, options?: { sync?: boolean }): LevelUpChain; del(key: any): LevelUpChain; - del(key: any, options?: {keyEncoding?: Encoding; sync?: boolean}): LevelUpChain; + del(key: any, options?: { keyEncoding?: Encoding; sync?: boolean }): LevelUpChain; clear(): LevelUpChain; write(): Promise; write(callback?: (error?: any) => any): void; diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts index 1de14ec272..7b6bc6c5b3 100644 --- a/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts +++ b/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts @@ -1,8 +1,8 @@ declare module "merkle-patricia-tree" { import BN from "bn.js"; - import {Readable} from "stream"; + import { Readable } from "stream"; - import {Trie, Database} from "merkle-patricia-tree/baseTrie"; + import { Trie, Database } from "merkle-patricia-tree/baseTrie"; import TrieNode from "merkle-patricia-tree/trieNode"; type MerkleProof = TrieNode[]; @@ -21,7 +21,7 @@ declare module "merkle-patricia-tree" { get(key: LargeNumber, cb: Callback): void; put(key: LargeNumber, value: LargeNumber, cb: Callback): void; copy(): Trie; - + checkpoint(): void; commit(cb: Callback): void; revert(cb: Callback): void; diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.ts index ed00cbabdd..3972b94c62 100644 --- a/src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.ts +++ b/src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.ts @@ -1,6 +1,6 @@ declare module "merkle-patricia-tree/readStream" { import Trie from "merkle-patricia-tree/baseTrie"; - import {Readable} from "stream"; + import { Readable } from "stream"; export class TrieReadStream extends Readable { constructor(trie: Trie); diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index ba4f1fae8f..bc60f90745 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -5,7 +5,7 @@ import { EthereumInternalOptions } from "./options"; import { types, Data, Quantity } from "@ganache/utils"; import Blockchain from "./blockchain"; import Tag from "./things/tags"; -import {VM_EXCEPTION, VM_EXCEPTIONS} from "./errors/errors"; +import { VM_EXCEPTION, VM_EXCEPTIONS } from "./errors/errors"; import Address from "./things/address"; import Transaction from "./things/transaction"; import Wallet from "./wallet"; @@ -35,7 +35,14 @@ import { Hardfork } from "./options/chain-options"; const RPCQUANTITY_ZERO = utils.RPCQUANTITY_ZERO; const CLIENT_VERSION = `Ganache/v${version}`; const PROTOCOL_VERSION = Data.from("0x3f"); -const RPC_MODULES = { eth: "1.0", net: "1.0", rpc: "1.0", web3: "1.0", evm: "1.0", personal: "1.0" } as const; +const RPC_MODULES = { + eth: "1.0", + net: "1.0", + rpc: "1.0", + web3: "1.0", + evm: "1.0", + personal: "1.0" +} as const; const KNOWN_CHAINIDS = new Set([1, 3, 4, 5, 42]); //#endregion @@ -57,7 +64,7 @@ function assertExceptionalTransactions(transactions: Transaction[]) { data[transaction.execException.data.hash] = transaction.execException.data; } else { baseError = VM_EXCEPTION; - errors = [ transaction.execException.message ]; + errors = [transaction.execException.message]; data[transaction.execException.data.hash] = transaction.execException.data; } } @@ -65,7 +72,7 @@ function assertExceptionalTransactions(transactions: Transaction[]) { if (baseError) { const err = new Error(baseError + errors.join("\n")); - (err as any).data = data + (err as any).data = data; throw err; } } @@ -110,7 +117,7 @@ function createCommon(chainId: number, networkId: number, hardfork: Hardfork) { export default class EthereumApi implements types.Api { readonly [index: string]: (...args: any) => Promise; - readonly #getId = ((id) => () => Quantity.from(++id))(0); + readonly #getId = (id => () => Quantity.from(++id))(0); readonly #common: Common; readonly #filters = new Map(); readonly #subscriptions = new Map(); @@ -125,14 +132,14 @@ export default class EthereumApi implements types.Api { * @param options * @param ready Callback for when the API is fully initialized */ - constructor(options: EthereumInternalOptions, emitter: Emittery.Typed<{message: any}, "connect" | "disconnect">) { + constructor(options: EthereumInternalOptions, emitter: Emittery.Typed<{ message: any }, "connect" | "disconnect">) { this.#options = options; const chain = options.chain; - const {initialAccounts} = this.#wallet = new Wallet(options.wallet); + const { initialAccounts } = (this.#wallet = new Wallet(options.wallet)); const coinbaseAddress = parseCoinbaseAddress(options.miner.coinbase, initialAccounts); - const common = this.#common = createCommon(chain.chainId, chain.networkId, chain.hardfork); - + const common = (this.#common = createCommon(chain.chainId, chain.networkId, chain.hardfork)); + const blockchain = (this.#blockchain = new Blockchain(options, common, initialAccounts, coinbaseAddress)); blockchain.on("start", () => emitter.emit("connect")); emitter.on("disconnect", blockchain.stop.bind(blockchain)); @@ -140,17 +147,17 @@ export default class EthereumApi implements types.Api { //#region db /** - * Stores a string in the local database. - * - * @param {String} dbName - Database name. - * @param {String} key - Key name. - * @param {String} value - String to store. - * @returns returns true if the value was stored, otherwise false. - */ - @assertArgLength(3) + * Stores a string in the local database. + * + * @param {String} dbName - Database name. + * @param {String} key - Key name. + * @param {String} value - String to store. + * @returns returns true if the value was stored, otherwise false. + */ + @assertArgLength(3) async db_putString(dbName: string, key: string, value: string) { return false; - }; + } /** * Returns string from the local database @@ -162,7 +169,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(2) async db_getString(dbName: string, key: string) { return ""; - }; + } /** * Stores binary data in the local database. @@ -175,7 +182,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(3) async db_putHex(dbName: string, key: string, data: string) { return false; - }; + } /** * Returns binary data from the local database @@ -187,7 +194,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(2) async db_getHex(dbName: string, key: string) { return "0x00"; - }; + } //#endregion //#region bzz @@ -205,10 +212,10 @@ export default class EthereumApi implements types.Api { //#region evm /** * Force a single block to be mined. - * + * * Mines a block independent of whether or not mining is started or stopped. * Will mine an empty block if there are no available transactions to mine. - * + * * @param timestamp the timestamp a block should setup as the mining time. */ @assertArgLength(0, 1) @@ -278,8 +285,8 @@ export default class EthereumApi implements types.Api { ])[2]; return new Promise((resolve, reject) => { - this.#blockchain.trie.put(paddedPosBuff, storage, (err) => { - if(err) return reject(err); + this.#blockchain.trie.put(paddedPosBuff, storage, err => { + if (err) return reject(err); resolve(void 0); }); }); @@ -288,14 +295,14 @@ export default class EthereumApi implements types.Api { /** * Sets the given account's nonce to the specified value. Mines a new block * before returning. - * + * * Warning: this will result in an invalid state tree. - * - * @param address + * + * @param address * @param nonce * @returns true if it worked - */ - @assertArgLength(2) + */ + @assertArgLength(2) async evm_setAccountNonce(address: string, nonce: string) { return new Promise((resolve, reject) => { const buffer = Address.from(address).toBuffer(); @@ -312,7 +319,7 @@ export default class EthereumApi implements types.Api { reject(err); return; } - + blockchain.mine(0).then(() => resolve(true), reject); }); }); @@ -332,11 +339,11 @@ export default class EthereumApi implements types.Api { /** * Sets the internal clock time to the given timestamp. - * + * * Warning: This will allow you to move *backwards* in time, which may cause - * new blocks to appear to be mined before old blocks. This is will result in + * new blocks to appear to be mined before old blocks. This is will result in * an invalid state. - * + * * @param timestamp JavaScript timestamp (millisecond precision) * @returns The amount of *seconds* between the given timestamp and now. */ @@ -358,12 +365,12 @@ export default class EthereumApi implements types.Api { } /** - * Revert the state of the blockchain to a previous snapshot. Takes a single - * parameter, which is the snapshot id to revert to. This deletes the given - * snapshot, as well as any snapshots taken after (Ex: reverting to id 0x1 - * will delete snapshots with ids 0x1, 0x2, etc... If no snapshot id is + * Revert the state of the blockchain to a previous snapshot. Takes a single + * parameter, which is the snapshot id to revert to. This deletes the given + * snapshot, as well as any snapshots taken after (Ex: reverting to id 0x1 + * will delete snapshots with ids 0x1, 0x2, etc... If no snapshot id is * passed it will revert to the latest snapshot. - * + * * @param snapshotId the snapshot id to revert * @returns `true` if a snapshot was reverted, otherwise `false` * @@ -372,29 +379,29 @@ export default class EthereumApi implements types.Api { * const snapshotId = await provider.send("evm_snapshot"); * const isReverted = await provider.send("evm_revert", [snapshotId]); * - * + * * @example *
* const provider = ganache.provider(); * const [from, to] = await provider.send("eth_accounts"); * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); - * + * * // take a snapshot * const snapshotId = await provider.send("evm_snapshot"); - * + * * // send value to another account (over-simplified example) * await provider.send("eth_subscribe", ["newHeads"]); * await provider.send("eth_sendTransaction", [{from, to, value: "0xffff"}]); * await provider.once("message"); // Note: `await provider.once` is non-standard - * + * * // ensure balance has updated * const newBalance = await provider.send("eth_getBalance", [from]); * assert(BigInt(newBalance) < startingBalance); - * + * * // revert the snapshot * const isReverted = await provider.send("evm_revert", [snapshotId]); * assert(isReverted); - * + * * const endingBalance = await provider.send("eth_getBalance", [from]); * assert.strictEqual(BigInt(endingBalance), startingBalance); *
@@ -406,40 +413,40 @@ export default class EthereumApi implements types.Api { /** * Snapshot the state of the blockchain at the current block. Takes no - * parameters. Returns the id of the snapshot that was created. A snapshot can - * only be reverted once. After a successful `evm_revert`, the same snapshot - * id cannot be used again. Consider creating a new snapshot after each + * parameters. Returns the id of the snapshot that was created. A snapshot can + * only be reverted once. After a successful `evm_revert`, the same snapshot + * id cannot be used again. Consider creating a new snapshot after each * `evm_revert` if you need to revert to the same point multiple times. - * + * * @returns The hex-encoded identifier for this snapshot - * + * * @example *
* const snapshotId = await provider.send("evm_snapshot"); *
- * + * * @example *
* const provider = ganache.provider(); * const [from, to] = await provider.send("eth_accounts"); * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); - * + * * // take a snapshot * const snapshotId = await provider.send("evm_snapshot"); - * + * * // send value to another account (over-simplified example) * await provider.send("eth_subscribe", ["newHeads"]); * await provider.send("eth_sendTransaction", [{from, to, value: "0xffff"}]); * await provider.once("message"); // Note: `await provider.once` is non-standard - * + * * // ensure balance has updated * const newBalance = await provider.send("eth_getBalance", [from]); * assert(BigInt(newBalance) < startingBalance); - * + * * // revert the snapshot * const isReverted = await provider.send("evm_revert", [snapshotId]); * assert(isReverted); - * + * * const endingBalance = await provider.send("eth_getBalance", [from]); * assert.strictEqual(BigInt(endingBalance), startingBalance); *
@@ -451,7 +458,7 @@ export default class EthereumApi implements types.Api { /** * Unlocks any unknown account. * @param address address the address of the account to unlock - * @param duration (default: disabled) Duration in seconds how long the account + * @param duration (default: disabled) Duration in seconds how long the account * should remain unlocked for. Set to 0 to disable automatic locking. * @returns `true` if the account was unlocked successfully, `false` if the * account was already unlocked. Throws an error if the account could not be @@ -463,10 +470,10 @@ export default class EthereumApi implements types.Api { /** * Locks any unknown account. - * + * * Note: accounts known to the `personal` namespace and accounts returned by * `eth_accounts` cannot be locked using this method. - * + * * @param address address the address of the account to lock * @returns `true` if the account was locked successfully, `false` if the * account was already locked. Throws an error if the account could not be @@ -486,9 +493,9 @@ export default class EthereumApi implements types.Api { //#region miner /** * Resume the CPU mining process with the given number of threads. - * + * * Note: `threads` is ignored. - * @param threads + * @param threads * @returns true */ @assertArgLength(0, 1) @@ -514,9 +521,9 @@ export default class EthereumApi implements types.Api { } /** - * + * * @param number Sets the minimal accepted gas price when mining transactions. - * Any transactions that are below this limit are excluded from the mining + * Any transactions that are below this limit are excluded from the mining * process. */ @assertArgLength(1) @@ -527,7 +534,7 @@ export default class EthereumApi implements types.Api { /** * Sets the etherbase, where mining rewards will go. - * @param address + * @param address */ @assertArgLength(1) async miner_setEtherbase(address: string) { @@ -595,7 +602,7 @@ export default class EthereumApi implements types.Api { * blockchain. Note that the estimate may be significantly more than the * amount of gas actually used by the transaction, for a variety of reasons * including EVM mechanics and node performance. - * + * * @returns the amount of gas used. */ @assertArgLength(1, 2) @@ -641,7 +648,7 @@ export default class EthereumApi implements types.Api { skipNonce: true }; estimateGas(generateVM, runArgs, (err: Error, result: any) => { - if(err) return reject(err); + if (err) return reject(err); resolve(Quantity.from(result.gasEstimate.toBuffer())); }); }); @@ -775,7 +782,7 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1) async eth_getUncleCountByBlockHash(hash: string | Buffer) { - return RPCQUANTITY_ZERO + return RPCQUANTITY_ZERO; } /** @@ -784,7 +791,7 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1) async eth_getUncleCountByBlockNumber(number: string | Buffer) { - return RPCQUANTITY_ZERO + return RPCQUANTITY_ZERO; } /** @@ -822,7 +829,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(1) async eth_getWork(filterId: Quantity) { return [] as [string, string, string] | []; - }; + } /** * Used for submitting a proof-of-work solution @@ -835,7 +842,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(3) async eth_submitWork(nonce: Data, powHash: Data, digest: Data) { return false; - }; + } /** * Used for submitting mining hashrate. @@ -847,7 +854,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(2) async eth_submitHashrate(hashRate: string, clientID: string) { return false; - }; + } /** * Returns `true` if client is actively mining new blocks. @@ -920,7 +927,7 @@ export default class EthereumApi implements types.Api { /** * Returns code at a given address. - * + * * @param address 20 Bytes - address * @param blockNumber integer block number, or the string "latest", "earliest" or "pending", see the default block * parameter @@ -970,7 +977,7 @@ export default class EthereumApi implements types.Api { if (err) return void reject(err); resolve(Data.from(data)); }); - }) + }); } /** @@ -981,11 +988,7 @@ export default class EthereumApi implements types.Api { * or "pending", see the default block parameter */ @assertArgLength(2, 3) - async eth_getStorageAt( - address: string, - position: bigint | number, - blockNumber: string | Buffer | Tag = Tag.LATEST - ) { + async eth_getStorageAt(address: string, position: bigint | number, blockNumber: string | Buffer | Tag = Tag.LATEST) { const blockProm = this.#blockchain.blocks.getRaw(blockNumber); const trie = this.#blockchain.trie.copy(); @@ -1047,9 +1050,9 @@ export default class EthereumApi implements types.Api { async eth_getTransactionByHash(transactionHash: string) { const chain = this.#blockchain; const hashBuffer = Data.from(transactionHash).toBuffer(); - + // we must check the database before checking the pending cache, because the - // cache is updated _after_ the transaction is already in the database, and + // cache is updated _after_ the transaction is already in the database, and // the database contains block info whereas the pending cache doesn't. const transaction = await chain.transactions.get(hashBuffer); @@ -1153,19 +1156,19 @@ export default class EthereumApi implements types.Api { @assertArgLength(1) async eth_sendRawTransaction(transaction: string) { const tx = new Transaction(transaction, this.#common, Transaction.types.signed); - return this.#blockchain.queueTransaction(tx) + return this.#blockchain.queueTransaction(tx); } /** * The sign method calculates an Ethereum specific signature with: * `sign(keccak256("\x19Ethereum Signed Message:\n" + message.length + message)))`. - * - * By adding a prefix to the message makes the calculated signature + * + * By adding a prefix to the message makes the calculated signature * recognizable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data * (e.g. transaction) and use the signature to impersonate the victim. - * + * * Note the address to sign with must be unlocked. - * + * * @param account address * @param data message to sign * @returns Signature @@ -1185,14 +1188,14 @@ export default class EthereumApi implements types.Api { } /** - * + * * @param address Address of the account that will sign the messages. * @param typedData Typed structured data to be signed. * @returns Signature. As in `eth_sign`, it is a hex encoded 129 byte array * starting with `0x`. It encodes the `r`, `s`, and `v` parameters from * appendix F of the [yellow paper](https://ethereum.github.io/yellowpaper/paper.pdf) * in big-endian format. Bytes 0...64 contain the `r` parameter, bytes - * 64...128 the `s` parameter, and the last byte the `v` parameter. Note + * 64...128 the `s` parameter, and the last byte the `v` parameter. Note * that the `v` parameter includes the chain id as specified in [EIP-155](https://eips.ethereum.org/EIPS/eip-155). * @EIP [712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md) */ @@ -1230,26 +1233,26 @@ export default class EthereumApi implements types.Api { /** * Starts a subscription to a particular event. For every event that matches - * the subscription a JSON-RPC notification with event details and + * the subscription a JSON-RPC notification with event details and * subscription ID will be sent to a client. - * - * @param subscriptionName + * + * @param subscriptionName * @returns A subscription id. */ - eth_subscribe(subscriptionName: SubscriptionName): PromiEvent + eth_subscribe(subscriptionName: SubscriptionName): PromiEvent; /** * Starts a subscription to a particular event. For every event that matches - * the subscription a JSON-RPC notification with event details and + * the subscription a JSON-RPC notification with event details and * subscription ID will be sent to a client. - * - * @param subscriptionName + * + * @param subscriptionName * @param options Filter options: * * `address`: either an address or an array of addresses. Only logs that * are created from these addresses are returned * * `topics`, only logs which match the specified topics * @returns A subscription id. */ - eth_subscribe(subscriptionName: "logs", options: BaseFilterArgs): PromiEvent + eth_subscribe(subscriptionName: "logs", options: BaseFilterArgs): PromiEvent; @assertArgLength(1, 2) eth_subscribe(subscriptionName: SubscriptionName, options?: BaseFilterArgs) { const subscriptions = this.#subscriptions; @@ -1262,22 +1265,22 @@ export default class EthereumApi implements types.Api { const value = block.value; const header = value.header; const result = { - "logsBloom": Data.from(header.bloom, 256), - "miner": Address.from(header.coinbase), - "difficulty": Quantity.from(header.difficulty), - "extraData": Data.from(header.extraData), - "gasLimit": Quantity.from(header.gasLimit), - "gasUsed": Quantity.from(header.gasUsed), - "hash": Data.from(value.hash(), 32), - "mixHash": Data.from(header.mixHash, 32), - "nonce": Data.from(header.nonce, 8), - "number": Quantity.from(header.number, true), - "parentHash": Data.from(header.parentHash, 32), - "receiptsRoot": Data.from(header.receiptTrie, 32), - "stateRoot": Data.from(header.stateRoot, 32), - "timestamp": Quantity.from(header.timestamp), - "transactionsRoot": Data.from(header.transactionsTrie, 32), - "sha3Uncles": Data.from(header.uncleHash, 32) + logsBloom: Data.from(header.bloom, 256), + miner: Address.from(header.coinbase), + difficulty: Quantity.from(header.difficulty), + extraData: Data.from(header.extraData), + gasLimit: Quantity.from(header.gasLimit), + gasUsed: Quantity.from(header.gasUsed), + hash: Data.from(value.hash(), 32), + mixHash: Data.from(header.mixHash, 32), + nonce: Data.from(header.nonce, 8), + number: Quantity.from(header.number, true), + parentHash: Data.from(header.parentHash, 32), + receiptsRoot: Data.from(header.receiptTrie, 32), + stateRoot: Data.from(header.stateRoot, 32), + timestamp: Quantity.from(header.timestamp), + transactionsRoot: Data.from(header.transactionsTrie, 32), + sha3Uncles: Data.from(header.uncleHash, 32) }; // TODO: move the JSON stringification closer to where the message @@ -1297,10 +1300,10 @@ export default class EthereumApi implements types.Api { const subscription = this.#getId(); const promiEvent = PromiEvent.resolve(subscription); - const { addresses, topics } = options ? parseFilterDetails(options) : {addresses: [], topics: []}; + const { addresses, topics } = options ? parseFilterDetails(options) : { addresses: [], topics: [] }; const unsubscribe = this.#blockchain.on("blockLogs", (blockLogs: BlockLogs) => { - // TODO: move the JSON stringification closer to where the message - // is actually sent to the listener + // TODO: move the JSON stringification closer to where the message + // is actually sent to the listener const result = JSON.parse(JSON.stringify([...blockLogs.filter(addresses, topics)])); promiEvent.emit("message", { type: "eth_subscription", @@ -1334,7 +1337,7 @@ export default class EthereumApi implements types.Api { // ganache doesn't sync, so doing nothing is perfectly valid. const subscription = this.#getId(); const promiEvent = PromiEvent.resolve(subscription); - + this.#subscriptions.set(subscription.toString(), () => {}); return promiEvent; } @@ -1359,7 +1362,7 @@ export default class EthereumApi implements types.Api { /** * Creates a filter in the node, to notify when a new block arrives. To check * if the state has changed, call `eth_getFilterChanges`. - * + * * @returns A filter id. */ @assertArgLength(0) @@ -1367,7 +1370,12 @@ export default class EthereumApi implements types.Api { const unsubscribe = this.#blockchain.on("block", (block: Block) => { value.updates.push(Data.from(block.value.hash(), 32)); }); - const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.block}; + const value = { + updates: [], + unsubscribe, + filter: null, + type: FilterTypes.block + }; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1376,7 +1384,7 @@ export default class EthereumApi implements types.Api { /** * Creates a filter in the node, to notify when new pending transactions * arrive. To check if the state has changed, call `eth_getFilterChanges`. - * + * * @returns A filter id. */ @assertArgLength(0) @@ -1384,7 +1392,12 @@ export default class EthereumApi implements types.Api { const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { value.updates.push(Data.from(transaction.hash(), 32)); }); - const value = {updates: [], unsubscribe, filter: null, type: FilterTypes.pendingTransaction}; + const value = { + updates: [], + unsubscribe, + filter: null, + type: FilterTypes.pendingTransaction + }; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1394,12 +1407,12 @@ export default class EthereumApi implements types.Api { * Creates a filter object, based on filter options, to notify when the state * changes (logs). To check if the state has changed, call * `eth_getFilterChanges`. - * - * If the from `fromBlock` or `toBlock` option are equal to "latest" the + * + * If the from `fromBlock` or `toBlock` option are equal to "latest" the * filter continually append logs for whatever block is seen as latest at the * time the block was mined, not just for the block that was "latest" when the * filter was created. - * + * * ### A note on specifying topic filters: * Topics are order-dependent. A transaction with a log with topics [A, B] * will be matched by the following topic filters: @@ -1411,7 +1424,7 @@ export default class EthereumApi implements types.Api { * after)” * * `[[A, B], [A, B]]` “(A OR B) in first position AND (A OR B) in second * position (and anything after)” - * + * * @param filter The filter options */ @assertArgLength(0, 1) @@ -1422,14 +1435,14 @@ export default class EthereumApi implements types.Api { const blockNumber = blockLogs.blockNumber; // everytime we get a blockLogs message we re-check what the filter's // range is. We do this because "latest" isn't the latest block at the - // time the filter was set up, rather it is the actual latest *mined* + // time the filter was set up, rather it is the actual latest *mined* // block (that is: not pending) - const {fromBlock, toBlock} = parseFilterRange(filter, blockchain); + const { fromBlock, toBlock } = parseFilterRange(filter, blockchain); if (fromBlock <= blockNumber && toBlock >= blockNumber) { value.updates.push(...blockLogs.filter(addresses, topics)); } }); - const value = {updates: [], unsubscribe, filter, type: FilterTypes.log}; + const value = { updates: [], unsubscribe, filter, type: FilterTypes.log }; const filterId = this.#getId(); this.#filters.set(filterId.toString(), value); return filterId; @@ -1439,7 +1452,7 @@ export default class EthereumApi implements types.Api { * Polling method for a filter, which returns an array of logs, block hashes, * or transaction hashes, depending on the filter type, which occurred since * last poll. - * + * * @param filterId the filter id. * @returns an array of logs, block hashes, or transaction hashes, depending * on the filter type, which occurred since last poll. @@ -1459,7 +1472,7 @@ export default class EthereumApi implements types.Api { /** * Uninstalls a filter with given id. Should always be called when watch is * no longer needed. - * + * * @param filterId the filter id. * @returns `true` if the filter was successfully uninstalled, otherwise * `false`. @@ -1474,7 +1487,7 @@ export default class EthereumApi implements types.Api { /** * Returns an array of all logs matching filter with given id. - * + * * @returns Array of log objects, or an empty array. */ @assertArgLength(1) @@ -1489,7 +1502,7 @@ export default class EthereumApi implements types.Api { /** * Returns an array of all logs matching a given filter object. - * + * * @param filter The filter options * @returns Array of log objects, or an empty array. */ @@ -1497,15 +1510,15 @@ export default class EthereumApi implements types.Api { async eth_getLogs(filter: FilterArgs) { const blockchain = this.#blockchain; if ("blockHash" in filter) { - const {addresses, topics} = parseFilterDetails(filter); + const { addresses, topics } = parseFilterDetails(filter); const blockNumber = await blockchain.blocks.getNumberFromHash(filter.blockHash); if (!blockNumber) return []; const blockLogs = blockchain.blockLogs; const logs = await blockLogs.get(blockNumber); return logs ? [...logs.filter(addresses, topics)] : []; } else { - const {addresses, topics, fromBlock, toBlockNumber} = parseFilter(filter, blockchain); - + const { addresses, topics, fromBlock, toBlockNumber } = parseFilter(filter, blockchain); + const blockLogs = blockchain.blockLogs; const pendingLogsPromises: Promise[] = [blockLogs.get(fromBlock.toBuffer())]; @@ -1534,7 +1547,7 @@ export default class EthereumApi implements types.Api { /** * Returns the number of transactions sent from an address. - * + * * @param address * @param blockNumber integer block number, or the string "latest", "earliest" * or "pending", see the default block parameter @@ -1545,13 +1558,12 @@ export default class EthereumApi implements types.Api { return this.#blockchain.accounts.getNonce(Address.from(address), blockNumber); } - /** * Executes a new message call immediately without creating a transaction on the block chain. - * + * * @param transaction * @param blockNumber - * + * * @returns the return value of executed contract. */ @assertArgLength(1, 2) @@ -1564,25 +1576,24 @@ export default class EthereumApi implements types.Api { let gas: Quantity; if (typeof transaction.gasLimit === "undefined") { - if (typeof transaction.gas !== "undefined"){ + if (typeof transaction.gas !== "undefined") { gas = Quantity.from(transaction.gas); } else { // eth_call isn't subject to regular transaction gas limits by default gas = options.miner.callGasLimit; } - } - else { - gas = Quantity.from(transaction.gasLimit) + } else { + gas = Quantity.from(transaction.gasLimit); } - let data:Data; + let data: Data; if (typeof transaction.data === "undefined") { if (typeof transaction.input === "undefined") { data = Data.from(transaction.input); } - } else { - data = Data.from(transaction.data); - } + } else { + data = Data.from(transaction.data); + } const block = blocks.createBlock({ number: parentHeader.number, @@ -1602,7 +1613,7 @@ export default class EthereumApi implements types.Api { data, block }; - + return blockchain.simulateTransaction(simulatedTransaction, parentBlock); } //#endregion @@ -1616,7 +1627,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(0) async personal_listAccounts() { return this.#wallet.addresses; - }; + } /** * Generates a new account with private key. Returns the address of the new @@ -1639,11 +1650,11 @@ export default class EthereumApi implements types.Api { wallet.addresses.push(strAddress); wallet.knownAccounts.add(strAddress); return newAccount.address; - }; + } /** * Imports the given unencrypted private key (hex string) into the key store, encrypting it with the passphrase. - * + * * @param rawKey * @param passphrase * @returnsReturns the address of the new account. @@ -1663,48 +1674,48 @@ export default class EthereumApi implements types.Api { wallet.addresses.push(strAddress); wallet.knownAccounts.add(strAddress); return newAccount.address; - }; + } /** * Locks the account. The account can no longer be used to send transactions. - * @param address + * @param address */ @assertArgLength(1) async personal_lockAccount(address: string) { return this.#wallet.lockAccount(address.toLowerCase()); - }; + } /** * Unlocks the account for use. - * + * * The unencrypted key will be held in memory until the unlock duration * expires. The unlock duration defaults to 300 seconds. An explicit duration * of zero seconds unlocks the key until geth exits. - * - * The account can be used with eth_sign and eth_sendTransaction while it is + * + * The account can be used with eth_sign and eth_sendTransaction while it is * unlocked. * @param address 20 Bytes - The address of the account to unlock. * @param passphrase Passphrase to unlock the account. - * @param duration (default: 300) Duration in seconds how long the account + * @param duration (default: 300) Duration in seconds how long the account * should remain unlocked for. Set to 0 to disable automatic locking. * @returns true if it worked. Throws an error if it did not. */ @assertArgLength(2, 3) async personal_unlockAccount(address: string, passphrase: string, duration: number = 300) { return this.#wallet.unlockAccount(address.toLowerCase(), passphrase, duration); - }; + } /** * Validate the given passphrase and submit transaction. - * - * The transaction is the same argument as for eth_sendTransaction and - * contains the from address. If the passphrase can be used to decrypt the - * private key belogging to tx.from the transaction is verified, signed and - * send onto the network. The account is not unlocked globally in the node + * + * The transaction is the same argument as for eth_sendTransaction and + * contains the from address. If the passphrase can be used to decrypt the + * private key belogging to tx.from the transaction is verified, signed and + * send onto the network. The account is not unlocked globally in the node * and cannot be used in other RPC calls. - * - * @param txData - * @param passphrase + * + * @param txData + * @param passphrase */ @assertArgLength(2) async personal_sendTransaction(transaction: any, passphrase: string) { @@ -1735,7 +1746,7 @@ export default class EthereumApi implements types.Api { } return this.#blockchain.queueTransaction(tx); - }; + } //#endregion //#region rpc @@ -1755,7 +1766,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(0) async shh_newIdentity() { return "0x00"; - }; + } /** * Checks if the client hold the private keys for a given identity. @@ -1766,7 +1777,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(1) async shh_hasIdentity(address: string) { return false; - }; + } /** * Creates a new group. @@ -1776,7 +1787,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(0) async shh_newGroup() { return "0x00"; - }; + } /** * Adds a whisper identity to the group @@ -1787,7 +1798,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(1) async shh_addToGroup(address: string) { return false; - }; + } /** * Creates filter to notify, when client receives whisper message matching the filter options. @@ -1801,7 +1812,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(2) async shh_newFilter(to: string, topics: any[]) { return false; - }; + } /** * Uninstalls a filter with given id. Should always be called when watch is no longer needed. @@ -1813,7 +1824,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(1) async shh_uninstallFilter(id: string) { return false; - }; + } /** * Polling method for whisper filters. Returns new messages since the last call of this method. @@ -1824,7 +1835,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(1) async shh_getFilterChanges(id: string) { return []; - }; + } /** * Get all messages matching a filter. Unlike shh_getFilterChanges this returns all messages. @@ -1835,7 +1846,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(1) async shh_getMessages(id: string) { return false; - }; + } /** * Creates a whisper message and injects it into the network for distribution. @@ -1850,7 +1861,7 @@ export default class EthereumApi implements types.Api { /** * Returns the current whisper protocol version. - * + * * @returns The current whisper protocol version */ @assertArgLength(0) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index c2ae494a76..e9960f859f 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -2,23 +2,23 @@ import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; import Miner from "./miner"; import Database from "./database"; import Emittery from "emittery"; -import BlockManager, {Block} from "./data-managers/block-manager"; +import BlockManager, { Block } from "./data-managers/block-manager"; import BlockLogs from "./things/blocklogs"; import TransactionManager from "./data-managers/transaction-manager"; import CheckpointTrie from "merkle-patricia-tree"; -import {BN} from "ethereumjs-util"; +import { BN } from "ethereumjs-util"; import Account from "./things/account"; -import {promisify} from "util"; -import {Quantity, Data} from "@ganache/utils"; +import { promisify } from "util"; +import { Quantity, Data } from "@ganache/utils"; import EthereumJsAccount from "ethereumjs-account"; import AccountManager from "./data-managers/account-manager"; -import {utils} from "@ganache/utils"; +import { utils } from "@ganache/utils"; import Transaction from "./things/transaction"; import Manager from "./data-managers/manager"; import TransactionReceipt from "./things/transaction-receipt"; -import {encode as rlpEncode} from "rlp"; +import { encode as rlpEncode } from "rlp"; import Common from "ethereumjs-common"; -import {Block as EthereumBlock} from "ethereumjs-block"; +import { Block as EthereumBlock } from "ethereumjs-block"; import VM from "ethereumjs-vm"; import Address from "./things/address"; import BlockLogManager from "./data-managers/blocklog-manager"; @@ -31,51 +31,55 @@ type SimulationTransaction = { /** * The address the transaction is sent from. */ - from: Address, + from: Address; /** * The address the transaction is directed to. */ - to?: Address, + to?: Address; /** * Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. */ - gas: Quantity, + gas: Quantity; /** * Integer of the gasPrice used for each paid gas */ - gasPrice: Quantity, + gasPrice: Quantity; /** * Integer of the value sent with this transaction */ - value?: Quantity, + value?: Quantity; /** * Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation */ - data?: Data, - block: Block -} + data?: Data; + block: Block; +}; const unref = utils.unref; export enum Status { // Flags - started = 1, // 0000 0001 - starting = 2, // 0000 0010 - stopped = 4, // 0000 0100 - stopping = 8, // 0000 1000 - paused = 16 // 0001 0000 + started = 1, // 0000 0001 + starting = 2, // 0000 0010 + stopped = 4, // 0000 0100 + stopping = 8, // 0000 1000 + paused = 16 // 0001 0000 } -type BlockchainTypedEvents = {block: Block, blockLogs: BlockLogs, pendingTransaction: Transaction}; +type BlockchainTypedEvents = { + block: Block; + blockLogs: BlockLogs; + pendingTransaction: Transaction; +}; type BlockchainEvents = "start" | "stop" | "step"; /** * Sets the provided VM state manager's state root *without* first * checking for checkpoints or flushing the existing cache. - * + * * Useful if you know the state manager is not in a checkpoint and its internal * cache is safe to discard. - * + * * @param stateManager * @param stateRoot */ @@ -88,7 +92,7 @@ function setStateRootSync(stateManager: VM["stateManager"], stateRoot: Buffer) { export default class Blockchain extends Emittery.Typed { #state: Status = Status.starting; #miner: Miner; - #blockBeingSavedPromise: Promise<{block: Block, blockLogs: BlockLogs}>; + #blockBeingSavedPromise: Promise<{ block: Block; blockLogs: BlockLogs }>; public blocks: BlockManager; public blockLogs: BlockLogManager; public transactions: TransactionManager; @@ -115,12 +119,15 @@ export default class Blockchain extends Emittery.Typed { - const blocks = this.blocks = await BlockManager.initialize(common, database.blockIndexes, database.blocks); + const blocks = (this.blocks = await BlockManager.initialize(common, database.blockIndexes, database.blocks)); // if we have a latest block, use it to set up the trie. const latest = blocks.latest; if (latest) { - this.#blockBeingSavedPromise = Promise.resolve({block: latest, blockLogs: null}); + this.#blockBeingSavedPromise = Promise.resolve({ + block: latest, + blockLogs: null + }); this.trie = new CheckpointTrie(database.trie, latest.value.header.stateRoot); } else { this.trie = new CheckpointTrie(database.trie, null); } - + this.blockLogs = new BlockLogManager(database.blockLogs); this.transactions = new TransactionManager(options.miner, common, this, database.transactions); - this.transactionReceipts = new Manager( - database.transactionReceipts, - TransactionReceipt - ); + this.transactionReceipts = new Manager(database.transactionReceipts, TransactionReceipt); this.accounts = new AccountManager(this, database.trie); this.coinbase = coinbaseAddress; @@ -163,7 +172,8 @@ export default class Blockchain extends Emittery.Typed block); + blocks.earliest = blocks.latest = await this.#blockBeingSavedPromise.then(({ block }) => block); } } - { // configure and start miner + { + // configure and start miner const logger = options.logging.logger; - const miner = this.#miner = new Miner( + const miner = (this.#miner = new Miner( options.miner, this.transactions.transactionPool.executables, instamine, this.vm, this.#readyNextBlock - ); + )); - { // automatic mining - const mineAll = async (maxTransactions: number) => this.#isPaused() ? null : this.mine(maxTransactions); - if (instamine) { // insta mining + { + // automatic mining + const mineAll = async (maxTransactions: number) => (this.#isPaused() ? null : this.mine(maxTransactions)); + if (instamine) { + // insta mining // whenever the transaction pool is drained mine the txs into blocks this.transactions.transactionPool.on("drain", mineAll.bind(null, 1)); - } else { // interval mining + } else { + // interval mining const wait = () => unref(setTimeout(mineNext, options.miner.blockTime * 1000)); const mineNext = () => mineAll(-1).then(wait); wait(); @@ -242,11 +256,7 @@ export default class Blockchain extends Emittery.Typed { - blockLogs.append( - index, - hash, - log - ); + blockLogs.append(index, hash, log); }); logger.log(""); @@ -276,16 +286,16 @@ export default class Blockchain extends Emittery.Typed { + return this.#blockBeingSavedPromise.then(({ block, blockLogs }) => { block.value.transactions.forEach(transaction => { - const error = options.chain.vmErrorsOnRPCResponse ? transaction.execException : null + const error = options.chain.vmErrorsOnRPCResponse ? transaction.execException : null; transaction.finalize("confirmed", error); }); - + if (instamine && options.miner.legacyInstamine) { // in legacy instamine mode we must delay the broadcast of new blocks process.nextTick(() => { @@ -315,24 +325,24 @@ export default class Blockchain extends Emittery.Typed { return this.#state === Status.started; - } + }; mine = async (maxTransactions: number, timestamp?: number, onlyOneBlock: boolean = false) => { await this.#blockBeingSavedPromise; const nextBlock = this.#readyNextBlock(this.blocks.latest.value, timestamp); return this.#miner.mine(nextBlock, maxTransactions, onlyOneBlock); - } + }; #isPaused = () => { return (this.#state & Status.paused) !== 0; - } + }; pause() { this.#state |= Status.paused; @@ -357,7 +367,7 @@ export default class Blockchain extends Emittery.Typed null); return block ? block.value : null; } @@ -403,7 +413,10 @@ export default class Blockchain extends Emittery.Typed ({block, blockLogs: BlockLogs.create(block.value.hash())})); + return this.blocks.putBlock(genesis).then(block => ({ + block, + blockLogs: BlockLogs.create(block.value.hash()) + })); }; #timeAdjustment: number = 0; @@ -423,21 +436,21 @@ export default class Blockchain extends Emittery.Typed { return this.#database.batch(() => { - const {blocks, transactions, transactionReceipts, blockLogs} = this; - blocksToDelete.forEach(({value}) => { + const { blocks, transactions, transactionReceipts, blockLogs } = this; + blocksToDelete.forEach(({ value }) => { value.transactions.forEach(tx => { const txHash = tx.hash(); transactions.del(txHash); @@ -448,8 +461,7 @@ export default class Blockchain extends Emittery.Typed { - snapshots.blocks = {current: block.value.hash(), next: snapshots.blocks}; + snapshots.unsubscribeFromBlocks = this.on("block", block => { + snapshots.blocks = { + current: block.value.hash(), + next: snapshots.blocks + }; }); } @@ -565,8 +580,6 @@ export default class Blockchain extends Emittery.Typed { if (data) { const [, balance] = (rlp.decode(data) as any) as Buffer[]; - return balance.length === 0 ? RPCQUANTITY_ZERO : Quantity.from(balance) ; + return balance.length === 0 ? RPCQUANTITY_ZERO : Quantity.from(balance); } else { return RPCQUANTITY_ZERO; } diff --git a/src/chains/ethereum/src/data-managers/block-manager.ts b/src/chains/ethereum/src/data-managers/block-manager.ts index 51c6f2d482..8cde3ad7cb 100644 --- a/src/chains/ethereum/src/data-managers/block-manager.ts +++ b/src/chains/ethereum/src/data-managers/block-manager.ts @@ -2,9 +2,9 @@ import EthereumJsBlock from "ethereumjs-block"; import Manager from "./manager"; import Tag from "../things/tags"; import { LevelUp } from "levelup"; -import {Quantity, Data} from "@ganache/utils"; +import { Quantity, Data } from "@ganache/utils"; import Transaction from "../things/transaction"; -import {decode as rlpDecode} from "rlp"; +import { decode as rlpDecode } from "rlp"; import Common from "ethereumjs-common"; import { utils } from "@ganache/utils"; @@ -78,12 +78,12 @@ export default class BlockManager extends Manager { } } - getEffectiveNumber(tagOrBlockNumber: string | Buffer | Tag = Tag.LATEST ) { + getEffectiveNumber(tagOrBlockNumber: string | Buffer | Tag = Tag.LATEST) { if (typeof tagOrBlockNumber === "string") { const block = this.getBlockByTag(tagOrBlockNumber as Tag); if (block) { - const blockNumber = block.value.header.number;; - if (blockNumber.length === 0){ + const blockNumber = block.value.header.number; + if (blockNumber.length === 0) { return Quantity.from(Buffer.from([0])); } else { return Quantity.from(blockNumber); @@ -147,16 +147,14 @@ export default class BlockManager extends Manager { key = Buffer.from([0]); } const secondaryKey = header.hash(); - await Promise.all([ - this.#blockIndexes.put(secondaryKey, key), - super.set(key, block.serialize()) - ]); + await Promise.all([this.#blockIndexes.put(secondaryKey, key), super.set(key, block.serialize())]); return block; } updateTaggedBlocks() { return new Promise((resolve, reject) => { - this.base.createValueStream({limit: 1}) + this.base + .createValueStream({ limit: 1 }) .on("data", (data: Buffer) => { this.earliest = new Block(data, this.#common); }) @@ -167,7 +165,8 @@ export default class BlockManager extends Manager { resolve(void 0); }); - this.base.createValueStream({reverse: true, limit: 1}) + this.base + .createValueStream({ reverse: true, limit: 1 }) .on("data", (data: Buffer) => { this.latest = new Block(data, this.#common); }) @@ -177,7 +176,7 @@ export default class BlockManager extends Manager { .on("end", () => { resolve(void 0); }); - }) + }); } } @@ -187,7 +186,7 @@ export class Block { if (raw) { this.size = raw.length; const data = (rlpDecode(raw) as any) as [Buffer[], Buffer[], Buffer[]]; - this.value = new EthereumJsBlock({header: data[0], uncleHeaders: data[2]}, {common}); + this.value = new EthereumJsBlock({ header: data[0], uncleHeaders: data[2] }, { common }); const rawTransactions = data[1]; // parse transactions so we can use our own transaction class @@ -196,7 +195,7 @@ export class Block { this.value.transactions.push(tx); } } else { - this.value = new EthereumJsBlock(null, {common}); + this.value = new EthereumJsBlock(null, { common }); this.size = 0; } } @@ -209,7 +208,7 @@ export class Block { return serialized; } - getTxFn = (include = false): ((tx: Transaction) => {[key: string]: string | Data | Quantity} | Data) => { + getTxFn = (include = false): ((tx: Transaction) => { [key: string]: string | Data | Quantity } | Data) => { if (include) { return (tx: Transaction) => tx.toJSON(this); } else { diff --git a/src/chains/ethereum/src/data-managers/manager.ts b/src/chains/ethereum/src/data-managers/manager.ts index c8c5ba4989..765e8c79a8 100644 --- a/src/chains/ethereum/src/data-managers/manager.ts +++ b/src/chains/ethereum/src/data-managers/manager.ts @@ -1,9 +1,9 @@ -import {LevelUp} from "levelup"; -import {Data} from "@ganache/utils"; +import { LevelUp } from "levelup"; +import { Data } from "@ganache/utils"; import Tag from "../things/tags"; const NOTFOUND = 404; -export type Instantiable = {new (...args: any[]): T}; +export type Instantiable = { new (...args: any[]): T }; export default class Manager { #Type: Instantiable; diff --git a/src/chains/ethereum/src/data-managers/transaction-manager.ts b/src/chains/ethereum/src/data-managers/transaction-manager.ts index 83524bdf99..575270e54f 100644 --- a/src/chains/ethereum/src/data-managers/transaction-manager.ts +++ b/src/chains/ethereum/src/data-managers/transaction-manager.ts @@ -14,7 +14,7 @@ export default class TransactionManager extends Manager { #queue = new PromiseQueue(); #paused = false; #resumer: Promise; - #resolver: (value: void ) => void; + #resolver: (value: void) => void; constructor(options: EthereumInternalOptions["miner"], common: Common, blockchain: Blockchain, base: LevelUp) { super(base, Transaction, common); @@ -24,11 +24,11 @@ export default class TransactionManager extends Manager { /** * Adds the transaction to the transaction pool. - * + * * Returns a promise that is only resolved in the order it was added. - * - * @param transaction - * @param secretKey + * + * @param transaction + * @param secretKey * @returns `true` if the `transaction` is immediately executable, `false` if * it may be valid in the future. Throws if the transaction is invalid. */ @@ -54,9 +54,9 @@ export default class TransactionManager extends Manager { * Immediately ignores all transactions that were in the process of being * added to the pool. These transactions' `push` promises will be resolved * immediately with the value `false` and will _not_ be added to the pool. - * + * * Also clears all transactions that were already added to the pool. - * + * * Transactions that are currently in the process of being mined may still be * mined. */ @@ -90,8 +90,8 @@ export default class TransactionManager extends Manager { */ public resume = () => { if (!this.#paused) return; - + this.#paused = false; this.#resolver(); - } + }; } diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index f0ffd8ca33..9c5bd2d7cd 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -1,6 +1,6 @@ -import {AbstractLevelDOWN} from "abstract-leveldown"; +import { AbstractLevelDOWN } from "abstract-leveldown"; import Emittery from "emittery"; -import {dir, setGracefulCleanup} from "tmp-promise"; +import { dir, setGracefulCleanup } from "tmp-promise"; import levelup, { LevelUp } from "levelup"; import Blockchain from "./blockchain"; import { EthereumInternalOptions } from "./options"; @@ -9,7 +9,7 @@ const sub = require("subleveldown"); const encode = require("encoding-down"); setGracefulCleanup(); -const tmpOptions = {prefix: "ganache-core_", unsafeCleanup: true}; +const tmpOptions = { prefix: "ganache-core_", unsafeCleanup: true }; const noop = () => Promise.resolve(); export default class Database extends Emittery { @@ -45,7 +45,7 @@ export default class Database extends Emittery { } #initialize = async () => { - const levelupOptions: any = {valueEncoding: "binary"}; + const levelupOptions: any = { valueEncoding: "binary" }; const store = this.#options.db; let db: levelup.LevelUp; if (store) { @@ -145,10 +145,12 @@ export default class Database extends Emittery { #cleanup = async () => { const db = this.db; if (db) { - await new Promise((resolve, reject) => db.close((err => { - if (err) return void reject(err); - resolve(void 0); - }))); + await new Promise((resolve, reject) => + db.close(err => { + if (err) return void reject(err); + resolve(void 0); + }) + ); await Promise.all([ this.blocks.close(), this.blockIndexes.close(), diff --git a/src/chains/ethereum/src/errors/coded-error.ts b/src/chains/ethereum/src/errors/coded-error.ts index 2f7a9ec9e9..569f924155 100644 --- a/src/chains/ethereum/src/errors/coded-error.ts +++ b/src/chains/ethereum/src/errors/coded-error.ts @@ -4,7 +4,7 @@ export const ErrorCodes = { * An error occurred on the server while parsing the JSON text. */ PARSE_ERROR: -32700, - + /** * The JSON sent is not a valid Request object. */ @@ -47,8 +47,8 @@ export const ErrorCodes = { } as const; export default class CodedError extends Error { - code: number - constructor(message: string, code: number){ + code: number; + constructor(message: string, code: number) { super(message); Error.captureStackTrace(this, this.constructor); diff --git a/src/chains/ethereum/src/errors/runtime-error.ts b/src/chains/ethereum/src/errors/runtime-error.ts index 3080beb344..a7e03d0876 100644 --- a/src/chains/ethereum/src/errors/runtime-error.ts +++ b/src/chains/ethereum/src/errors/runtime-error.ts @@ -14,12 +14,12 @@ export enum RETURN_TYPES { export default class RuntimeError extends CodedError { public code: typeof ErrorCodes.INVALID_INPUT; public data: { - hash: string, - programCounter: number, - result: string, - reason?: string, - message: string - } + hash: string; + programCounter: number; + result: string; + reason?: string; + message: string; + }; constructor(transactionHash: Buffer, result: EVMResult, returnType: RETURN_TYPES) { const execResult = result.execResult; const error = execResult.exceptionError.error; diff --git a/src/chains/ethereum/src/helpers/assert-arg-length.ts b/src/chains/ethereum/src/helpers/assert-arg-length.ts index 9f0d850f1b..8553b5b884 100644 --- a/src/chains/ethereum/src/helpers/assert-arg-length.ts +++ b/src/chains/ethereum/src/helpers/assert-arg-length.ts @@ -1,15 +1,22 @@ type UnknownFn = (this: unknown, ...args: any[]) => unknown; type FunctionPropertyDescriptor = TypedPropertyDescriptor; export function assertArgLength(min: number, max: number = min) { - return function(target: O, propertyKey: keyof O, descriptor: FunctionPropertyDescriptor) { + return function ( + target: O, + propertyKey: keyof O, + descriptor: FunctionPropertyDescriptor + ) { const original = descriptor.value; - descriptor.value = function(this: unknown) { + descriptor.value = function (this: unknown) { const length = arguments.length; if (length < min || length > max) { - throw new Error(`Incorrect number of arguments. '${propertyKey}' requires ${ - min === max - ? `exactly ${min} ${min === 1 ? "argument" : "arguments"}.` - : `between ${min} and ${max} arguments.`}`); + throw new Error( + `Incorrect number of arguments. '${propertyKey}' requires ${ + min === max + ? `exactly ${min} ${min === 1 ? "argument" : "arguments"}.` + : `between ${min} and ${max} arguments.` + }` + ); } return Reflect.apply(original, this, arguments); } as T; diff --git a/src/chains/ethereum/src/helpers/filter-parsing.ts b/src/chains/ethereum/src/helpers/filter-parsing.ts index 2f10e3d708..eb1c0b8f93 100644 --- a/src/chains/ethereum/src/helpers/filter-parsing.ts +++ b/src/chains/ethereum/src/helpers/filter-parsing.ts @@ -6,14 +6,12 @@ import { FilterArgs, RangeFilterArgs } from "../types/filters"; export function parseFilterDetails(filter: Pick) { // `filter.address` may be a single address or an array const addresses = filter.address - ? ( - Array.isArray(filter.address) - ? filter.address - : [filter.address]).map(a => Address.from(a.toLowerCase()).toBuffer() - ) + ? (Array.isArray(filter.address) ? filter.address : [filter.address]).map(a => + Address.from(a.toLowerCase()).toBuffer() + ) : []; const topics = filter.topics ? filter.topics : []; - return {addresses, topics}; + return { addresses, topics }; } export function parseFilterRange(filter: Omit, blockchain: Blockchain) { @@ -33,11 +31,11 @@ export function parseFilterRange(filter: Omit new (BN as any)(val); const STIPEND = bn(2300); const MULTIPLE = 64 / 63; -const check = (set) => (opname) => set.has(opname); +const check = set => opname => set.has(opname); const isCall = check(new Set(["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"])); const isCallOrCallcode = check(new Set(["CALL", "CALLCODE"])); const isCreate = check(new Set(["CREATE", "CREATE2"])); @@ -19,7 +19,7 @@ const stepTracker = () => { let preCompileCheck = false; let precompileCallDepth = 0; return { - collect: (info) => { + collect: info => { if (preCompileCheck) { if (info.depth === precompileCallDepth) { // If the current depth is unchanged. @@ -30,208 +30,216 @@ const stepTracker = () => { preCompileCheck = false; } if (isCall(info.opcode.name)) { - info.stack = info.stack.map((val) => val.clone()); + info.stack = info.stack.map(val => val.clone()); preCompileCheck = true; precompileCallDepth = info.depth; - sysOps.push({ index: allOps.length, depth: info.depth, name: info.opcode.name }); + sysOps.push({ + index: allOps.length, + depth: info.depth, + name: info.opcode.name + }); } else if (isCreate(info.opcode.name) || isTerminator(info.opcode.name)) { - sysOps.push({ index: allOps.length, depth: info.depth, name: info.opcode.name }); + sysOps.push({ + index: allOps.length, + depth: info.depth, + name: info.opcode.name + }); } // This goes last so we can use the length for the index ^ allOps.push(info); }, - isPrecompile: (index) => preCompile.has(index), + isPrecompile: index => preCompile.has(index), done: () => !allOps.length || sysOps.length < 2 || !isTerminator(allOps[allOps.length - 1].opcode.name), ops: allOps, systemOps: sysOps - } -} + }; +}; - const estimateGas = (generateVM, runArgs, callback) => { - exactimate(generateVM(), runArgs, (err, result) => { +const estimateGas = (generateVM, runArgs, callback) => { + exactimate(generateVM(), runArgs, (err, result) => { + if (err) return callback(err); + binSearch(generateVM, runArgs, result, (err, result) => { if (err) return callback(err); - binSearch(generateVM, runArgs, result, (err, result) => { - if (err) return callback(err); - callback(null, result); - }) - }) + callback(null, result); + }); + }); +}; + +const binSearch = async (generateVM, runArgs, result, callback) => { + const MAX = Quantity.from(runArgs.block.header.gasLimit).toBigInt(); + const gasRefund = result.execResult.gasRefund; + const startingGas = gasRefund ? result.gasEstimate.add(gasRefund) : result.gasEstimate; + const range = { lo: startingGas, hi: startingGas }; + const isEnoughGas = async gas => { + const vm = generateVM(); // Generate fresh VM + runArgs.tx.gasLimit = gas.toBuffer(); + const result = await vm.runTx(runArgs).catch(vmerr => ({ vmerr })); + return !result.vmerr && !result.execResult.exceptionError; }; - const binSearch = async (generateVM, runArgs, result, callback) => { - const MAX = Quantity.from(runArgs.block.header.gasLimit).toBigInt(); - const gasRefund = result.execResult.gasRefund; - const startingGas = gasRefund ? result.gasEstimate.add(gasRefund) : result.gasEstimate; - const range = { lo: startingGas, hi: startingGas }; - const isEnoughGas = async(gas) => { - const vm = generateVM(); // Generate fresh VM - runArgs.tx.gasLimit = gas.toBuffer(); - const result = await vm.runTx(runArgs).catch((vmerr) => ({ vmerr })); - return !result.vmerr && !result.execResult.exceptionError; - }; - - if (!(await isEnoughGas(range.hi))) { - do { - range.hi = range.hi.muln(MULTIPLE); - } while (!(await isEnoughGas(range.hi))); - while (range.lo.addn(1).lt(range.hi)) { - const mid = range.lo.add(range.hi).divn(2); - if (await isEnoughGas(mid)) { - range.hi = mid; - } else { - range.lo = mid; - } + if (!(await isEnoughGas(range.hi))) { + do { + range.hi = range.hi.muln(MULTIPLE); + } while (!(await isEnoughGas(range.hi))); + while (range.lo.addn(1).lt(range.hi)) { + const mid = range.lo.add(range.hi).divn(2); + if (await isEnoughGas(mid)) { + range.hi = mid; + } else { + range.lo = mid; } - if (range.hi.gte(MAX)) { - if (!(await isEnoughGas(range.hi))) { - return callback(new Error("gas required exceeds allowance or always failing transaction")); - } + } + if (range.hi.gte(MAX)) { + if (!(await isEnoughGas(range.hi))) { + return callback(new Error("gas required exceeds allowance or always failing transaction")); } } - - result.gasEstimate = range.hi; - callback(null, result); - }; + } - const exactimate = async (vm, runArgs, callback) => { - const steps = stepTracker(); - vm.on("step", steps.collect); + result.gasEstimate = range.hi; + callback(null, result); +}; - const Context = (index: number, fee?: BN) => { - const base = index === 0; - let start = index; - let stop = 0; - const cost = bn(); - let sixtyFloorths = bn(); - const op = steps.ops[index]; - const next = steps.ops[index + 1]; - const intermediateCost = op.gasLeft.sub(next.gasLeft); - const callingFee = fee || bn(); - let compositeContext = false; +const exactimate = async (vm, runArgs, callback) => { + const steps = stepTracker(); + vm.on("step", steps.collect); - function addGas(val) { - // Add to our current context, but accounted for in sixtyfloorths - if (sixtyFloorths.gtn(0)) { - if (val.gte(sixtyFloorths)) { - sixtyFloorths = bn(); - } else { - sixtyFloorths.isub(val); - } + const Context = (index: number, fee?: BN) => { + const base = index === 0; + let start = index; + let stop = 0; + const cost = bn(); + let sixtyFloorths = bn(); + const op = steps.ops[index]; + const next = steps.ops[index + 1]; + const intermediateCost = op.gasLeft.sub(next.gasLeft); + const callingFee = fee || bn(); + let compositeContext = false; + + function addGas(val) { + // Add to our current context, but accounted for in sixtyfloorths + if (sixtyFloorths.gtn(0)) { + if (val.gte(sixtyFloorths)) { + sixtyFloorths = bn(); + } else { + sixtyFloorths.isub(val); } - cost.iadd(val); } + cost.iadd(val); + } - return { - start: () => start, - stop: () => stop, - setStart: (val) => { - start = val; - compositeContext = true; - }, - setStop: (val) => { - stop = val; - }, - getCost: () => ({ cost, sixtyFloorths }), - transfer: (ctx) => { - const values = ctx.getCost(); - addGas(values.cost); - sixtyFloorths.iadd(values.sixtyFloorths); - }, - addSixtyFloorth: (sixtyFloorth) => { - sixtyFloorths.iadd(sixtyFloorth); - }, - addRange: (fee = bn()) => { - // only occurs on stack increasing ops - addGas(steps.ops[base || compositeContext ? start : start + 1].gasLeft.sub(steps.ops[stop].gasLeft).add(fee)); - }, - finalizeRange: () => { - let range; - // if we have a composite context and we are NOT at the final terminator - if (compositeContext && stop !== steps.ops.length - 1) { - range = steps.ops[start].gasLeft.sub(steps.ops[stop - 1].gasLeft); - addGas(range); - const tail = steps.ops[stop - 1].gasLeft.sub(steps.ops[stop].gasLeft); - range = tail.add(intermediateCost); - } else { - range = steps.ops[start].gasLeft.sub(steps.ops[stop].gasLeft); - } - range.isub(callingFee); + return { + start: () => start, + stop: () => stop, + setStart: val => { + start = val; + compositeContext = true; + }, + setStop: val => { + stop = val; + }, + getCost: () => ({ cost, sixtyFloorths }), + transfer: ctx => { + const values = ctx.getCost(); + addGas(values.cost); + sixtyFloorths.iadd(values.sixtyFloorths); + }, + addSixtyFloorth: sixtyFloorth => { + sixtyFloorths.iadd(sixtyFloorth); + }, + addRange: (fee = bn()) => { + // only occurs on stack increasing ops + addGas(steps.ops[base || compositeContext ? start : start + 1].gasLeft.sub(steps.ops[stop].gasLeft).add(fee)); + }, + finalizeRange: () => { + let range; + // if we have a composite context and we are NOT at the final terminator + if (compositeContext && stop !== steps.ops.length - 1) { + range = steps.ops[start].gasLeft.sub(steps.ops[stop - 1].gasLeft); addGas(range); - if (isCallOrCallcode(op.opcode.name) && !op.stack[op.stack.length - 3].isZero()) { - cost.iadd(sixtyFloorths); - const innerCost = next.gasLeft.sub(steps.ops[stop - 1].gasLeft); - if (innerCost.gt(STIPEND)) { - sixtyFloorths = cost.divn(63); - } else if (innerCost.lte(STIPEND)) { - sixtyFloorths = STIPEND.sub(innerCost); - } - } else if (stop !== steps.ops.length - 1) { - cost.iadd(sixtyFloorths); + const tail = steps.ops[stop - 1].gasLeft.sub(steps.ops[stop].gasLeft); + range = tail.add(intermediateCost); + } else { + range = steps.ops[start].gasLeft.sub(steps.ops[stop].gasLeft); + } + range.isub(callingFee); + addGas(range); + if (isCallOrCallcode(op.opcode.name) && !op.stack[op.stack.length - 3].isZero()) { + cost.iadd(sixtyFloorths); + const innerCost = next.gasLeft.sub(steps.ops[stop - 1].gasLeft); + if (innerCost.gt(STIPEND)) { sixtyFloorths = cost.divn(63); + } else if (innerCost.lte(STIPEND)) { + sixtyFloorths = STIPEND.sub(innerCost); } + } else if (stop !== steps.ops.length - 1) { + cost.iadd(sixtyFloorths); + sixtyFloorths = cost.divn(63); } - }; + } }; + }; - const getTotal = () => { - const sysops = steps.systemOps; - const ops = steps.ops; - const opIndex = (cursor) => sysops[cursor].index; - const stack = []; - let cursor = 0; - let context = Context(0); - while (cursor < sysops.length) { - const currentIndex = opIndex(cursor); - const current = ops[currentIndex]; - const name = current.opcode.name; - if (isCall(name) || isCreate(name)) { - if (steps.isPrecompile(currentIndex)) { - context.setStop(currentIndex + 1); - context.addRange(); - context.setStart(currentIndex + 1); - context.addSixtyFloorth(STIPEND); - } else { - context.setStop(currentIndex); - context.addRange(bn(current.opcode.fee)); - stack.push(context); - context = Context(currentIndex, bn(current.opcode.fee)); // setup next context - } - } else if (isTerminator(name)) { - // only on the last operation - context.setStop(currentIndex + 1 < steps.ops.length ? currentIndex + 1 : currentIndex); - context.finalizeRange(); - const ctx = stack.pop(); - if (ctx) { - ctx.transfer(context); - context = ctx; - context.setStart(currentIndex + 1); - } else { - break; - } + const getTotal = () => { + const sysops = steps.systemOps; + const ops = steps.ops; + const opIndex = cursor => sysops[cursor].index; + const stack = []; + let cursor = 0; + let context = Context(0); + while (cursor < sysops.length) { + const currentIndex = opIndex(cursor); + const current = ops[currentIndex]; + const name = current.opcode.name; + if (isCall(name) || isCreate(name)) { + if (steps.isPrecompile(currentIndex)) { + context.setStop(currentIndex + 1); + context.addRange(); + context.setStart(currentIndex + 1); + context.addSixtyFloorth(STIPEND); } else { - throw new Error("INVALID OPCODE"); + context.setStop(currentIndex); + context.addRange(bn(current.opcode.fee)); + stack.push(context); + context = Context(currentIndex, bn(current.opcode.fee)); // setup next context } - cursor++; + } else if (isTerminator(name)) { + // only on the last operation + context.setStop(currentIndex + 1 < steps.ops.length ? currentIndex + 1 : currentIndex); + context.finalizeRange(); + const ctx = stack.pop(); + if (ctx) { + ctx.transfer(context); + context = ctx; + context.setStart(currentIndex + 1); + } else { + break; + } + } else { + throw new Error("INVALID OPCODE"); } - const gas = context.getCost(); - return gas.cost.add(gas.sixtyFloorths); - }; - - const result = await vm.runTx(runArgs).catch((vmerr) => ({ vmerr })); - const vmerr = result.vmerr; - if (vmerr) { - return callback(vmerr); - } else if (result.execResult.exceptionError) { - const error = new RuntimeError(runArgs.tx.hash(), result, RETURN_TYPES.RETURN_VALUE); - return callback(error, result); - } else if (steps.done()) { - const estimate = result.gasUsed; - result.gasEstimate = estimate; - } else { - const actualUsed = steps.ops[0].gasLeft.sub(steps.ops[steps.ops.length - 1].gasLeft); - const sixtyFloorths = getTotal().sub(actualUsed); - result.gasEstimate = result.gasUsed.add(sixtyFloorths); + cursor++; } - callback(vmerr, result); + const gas = context.getCost(); + return gas.cost.add(gas.sixtyFloorths); + }; + + const result = await vm.runTx(runArgs).catch(vmerr => ({ vmerr })); + const vmerr = result.vmerr; + if (vmerr) { + return callback(vmerr); + } else if (result.execResult.exceptionError) { + const error = new RuntimeError(runArgs.tx.hash(), result, RETURN_TYPES.RETURN_VALUE); + return callback(error, result); + } else if (steps.done()) { + const estimate = result.gasUsed; + result.gasEstimate = estimate; + } else { + const actualUsed = steps.ops[0].gasLeft.sub(steps.ops[steps.ops.length - 1].gasLeft); + const sixtyFloorths = getTotal().sub(actualUsed); + result.gasEstimate = result.gasUsed.add(sixtyFloorths); } + callback(vmerr, result); +}; - export default estimateGas; \ No newline at end of file +export default estimateGas; diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 0b0c59a0c5..6fd4008fe2 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -1,24 +1,29 @@ import Emittery from "emittery"; import EthereumApi from "./api"; -import {JsonRpcTypes, types, utils} from "@ganache/utils"; +import { JsonRpcTypes, types, utils } from "@ganache/utils"; import EthereumProvider from "./provider"; -import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; +import { RecognizedString, WebSocket, HttpRequest } from "uWebSockets.js"; import CodedError, { ErrorCodes } from "./errors/coded-error"; import { EthereumProviderOptions } from "./options"; function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest { - return connection.constructor.name === "uWS.HttpRequest" + return connection.constructor.name === "uWS.HttpRequest"; } export type ProviderOptions = EthereumProviderOptions; export const Provider = EthereumProvider; export const FlavorName = "ethereum" as const; -export class Connector extends Emittery.Typed - implements types.Connector | JsonRpcTypes.Request[], JsonRpcTypes.Response> { - +export class Connector + extends Emittery.Typed + implements + types.Connector< + EthereumApi, + JsonRpcTypes.Request | JsonRpcTypes.Request[], + JsonRpcTypes.Response + > { #provider: EthereumProvider; - + get provider() { return this.#provider; } @@ -26,7 +31,7 @@ export class Connector extends Emittery.Typed constructor(providerOptions: ProviderOptions = null, executor: utils.Executor) { super(); - const provider = this.#provider = new EthereumProvider(providerOptions, executor); + const provider = (this.#provider = new EthereumProvider(providerOptions, executor)); provider.on("connect", () => { // tell the consumer (like a `ganache-core` server/connector) everything is ready this.emit("ready"); @@ -36,17 +41,23 @@ export class Connector extends Emittery.Typed parse(message: Buffer) { try { return JSON.parse(message) as JsonRpcTypes.Request; - } catch(e) { + } catch (e) { throw new CodedError(e.message, ErrorCodes.PARSE_ERROR); } } - handle(payload: JsonRpcTypes.Request | JsonRpcTypes.Request[], connection: HttpRequest | WebSocket) { + handle( + payload: JsonRpcTypes.Request | JsonRpcTypes.Request[], + connection: HttpRequest | WebSocket + ) { if (Array.isArray(payload)) { // handle batch transactions - const promises = payload.map(payload => this.#handle(payload, connection) - .then(({value}) => value).catch(e => e)); - return Promise.resolve({value: Promise.all(promises)}); + const promises = payload.map(payload => + this.#handle(payload, connection) + .then(({ value }) => value) + .catch(e => e) + ); + return Promise.resolve({ value: Promise.all(promises) }); } else { return this.#handle(payload, connection); } @@ -59,34 +70,38 @@ export class Connector extends Emittery.Typed } } const params = payload.params as Parameters; - return this.#provider.requestRaw({method, params}); - } + return this.#provider.requestRaw({ method, params }); + }; format(result: any, payload: JsonRpcTypes.Request): RecognizedString; format(results: any[], payloads: JsonRpcTypes.Request[]): RecognizedString; - format(results: any | any[], payload: JsonRpcTypes.Request | JsonRpcTypes.Request[]): RecognizedString { + format( + results: any | any[], + payload: JsonRpcTypes.Request | JsonRpcTypes.Request[] + ): RecognizedString { if (Array.isArray(payload)) { - return JSON.stringify(payload.map((payload, i) => { - const result = results[i] - if (result instanceof Error) { - return JsonRpcTypes.Error(payload.id, result as any); - } else { - return JsonRpcTypes.Response(payload.id, result); - } - })); + return JSON.stringify( + payload.map((payload, i) => { + const result = results[i]; + if (result instanceof Error) { + return JsonRpcTypes.Error(payload.id, result as any); + } else { + return JsonRpcTypes.Response(payload.id, result); + } + }) + ); } else { const json = JsonRpcTypes.Response(payload.id, results); return JSON.stringify(json); } } - formatError(error: Error & {code: number}, payload: JsonRpcTypes.Request): RecognizedString { + formatError(error: Error & { code: number }, payload: JsonRpcTypes.Request): RecognizedString { const json = JsonRpcTypes.Error(payload && payload.id ? payload.id : null, error); return JSON.stringify(json); } - - close(){ + close() { return this.#provider.disconnect(); } } diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 8626fc3fe3..0577f92dfb 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -1,31 +1,28 @@ import params from "./things/params"; -import {utils} from "@ganache/utils"; +import { utils } from "@ganache/utils"; import Transaction from "./things/transaction"; -import {Quantity, Data} from "@ganache/utils"; -import {promisify} from "util"; +import { Quantity, Data } from "@ganache/utils"; +import { promisify } from "util"; import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; import Block from "ethereumjs-block"; import VM from "ethereumjs-vm"; -import {encode as rlpEncode} from "rlp"; +import { encode as rlpEncode } from "rlp"; import { EthereumInternalOptions } from "./options"; import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; import { Executables } from "./types/executables"; type BlockData = { - blockTransactions: Transaction[], - transactionsTrie: Trie, - receiptTrie: Trie, - gasUsed: bigint, - timestamp: Buffer -} + blockTransactions: Transaction[]; + transactionsTrie: Trie; + receiptTrie: Trie; + gasUsed: bigint; + timestamp: Buffer; +}; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); -function replaceFromHeap( - priced: utils.Heap, - source: utils.Heap -) { +function replaceFromHeap(priced: utils.Heap, source: utils.Heap) { // get the next best for this account, removing from the source Heap: const next = source.peek(); if (next) { @@ -44,14 +41,14 @@ function byPrice(values: Transaction[], a: number, b: number) { return Quantity.from(values[a].gasPrice) > Quantity.from(values[b].gasPrice); } -export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { +export default class Miner extends Emittery.Typed<{ block: BlockData }, "idle"> { #currentlyExecutingPrice = 0n; #origins = new Set(); #pending: boolean; #isBusy: boolean = false; #paused: boolean = false; #resumer: Promise; - #resolver: (value: void ) => void; + #resolver: (value: void) => void; readonly #executables: Executables; readonly #options: EthereumInternalOptions["miner"]; readonly #instamine: boolean; @@ -61,7 +58,7 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { readonly #revert: () => Promise; readonly #createBlock: (previousBlock: Block) => Block; - public async pause(){ + public async pause() { if (this.#paused) return; this.#paused = true; @@ -76,7 +73,7 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { public resume() { if (!this.#paused) return; - + this.#paused = false; this.#resolver(); } @@ -84,11 +81,17 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { // create a Heap that sorts by gasPrice readonly #priced = new utils.Heap(byPrice); /* - * @param executables A live Map of pending transactions from the transaction - * pool. The miner will update this Map by removing the best transactions - * and putting them in new blocks. - */ - constructor(options: EthereumInternalOptions["miner"], executables: Executables, instamine: boolean, vm: VM, createBlock: (previousBlock: Block) => Block) { + * @param executables A live Map of pending transactions from the transaction + * pool. The miner will update this Map by removing the best transactions + * and putting them in new blocks. + */ + constructor( + options: EthereumInternalOptions["miner"], + executables: Executables, + instamine: boolean, + vm: VM, + createBlock: (previousBlock: Block) => Block + ) { super(); const stateManager = vm.stateManager; @@ -109,7 +112,7 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { * @param maxTransactions: maximum number of transactions per block. If `-1`, * unlimited. * @param onlyOneBlock: set to `true` if only 1 block should be mined. - * + * * @returns the transactions mined in the _first_ block */ public async mine(block: Block, maxTransactions: number = -1, onlyOneBlock = false) { @@ -134,7 +137,7 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { } #mine = async (block: Block, maxTransactions: number = -1, onlyOneBlock = false) => { - const {block: lastBlock, transactions} = await this.#mineTxs(block, maxTransactions, onlyOneBlock); + const { block: lastBlock, transactions } = await this.#mineTxs(block, maxTransactions, onlyOneBlock); // if there are more txs to mine, start mining them without awaiting their // result. @@ -145,10 +148,10 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { await this.#mine(nextBlock, this.#instamine ? 1 : -1); } return transactions; - } + }; #mineTxs = async (block: Block, maxTransactions: number, onlyOneBlock: boolean) => { - const {pending, inProgress} = this.#executables; + const { pending, inProgress } = this.#executables; let keepMining = true; const priced = this.#priced; @@ -176,7 +179,7 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { await this.#commit(); this.emit("block", blockData); this.#reset(); - return {block, transactions: []}; + return { block, transactions: [] }; } let numTransactions = 0; @@ -225,10 +228,10 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { // if the transaction will fit in the block, commit it! await this.#commit(); blockTransactions[numTransactions] = best; - + blockGasLeft -= gasUsed; blockData.gasUsed += gasUsed; - + // calculate receipt and tx tries const txKey = rlpEncode(numTransactions); promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); @@ -271,7 +274,7 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { } break; } - + if (keepMining) { // remove the newest (`best`) tx from this account's pending queue // as we know we can fit another transaction in the block. Stick @@ -282,7 +285,8 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { // next bext transaction sorted in our `priced` heap. keepMining = priced.removeBest(); } - } else { // didn't fit in the current block + } else { + // didn't fit in the current block await this.#revert(); // unlock the transaction so the transaction pool can reconsider this @@ -331,32 +335,37 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { this.#reset(); } } - } - while (keepMining); - - return {block, transactions: blockTransactions}; - } + } while (keepMining); + + return { block, transactions: blockTransactions }; + }; #runTx = async (tx: Transaction, block: Block, origin: string, pending: Map>) => { try { - return await this.#vm.runTx({tx, block} as any); + return await this.#vm.runTx({ tx, block } as any); } catch (err) { const errorMessage = err.message; // We do NOT want to re-run this transaction. // Update the `priced` heap with the next best transaction from this // account - const pendingOrigin = pending.get(origin) + const pendingOrigin = pending.get(origin); if (pendingOrigin.removeBest()) { replaceFromHeap(this.#priced, pendingOrigin); } else { this.#priced.removeBest(); } - const e = {execResult: {runState: {programCounter: 0}, exceptionError: {error: errorMessage}, returnValue: Buffer.allocUnsafe(0)}} as any; + const e = { + execResult: { + runState: { programCounter: 0 }, + exceptionError: { error: errorMessage }, + returnValue: Buffer.allocUnsafe(0) + } + } as any; tx.finalize("rejected", new RuntimeError(tx.hash(), e, RETURN_TYPES.TRANSACTION_HASH)); return null; } - } + }; #reset = () => { this.#origins.clear(); @@ -365,7 +374,7 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { }; #setPricedHeap = () => { - const {pending} = this.#executables; + const { pending } = this.#executables; const origins = this.#origins; const priced = this.#priced; @@ -382,7 +391,7 @@ export default class Miner extends Emittery.Typed<{block: BlockData}, "idle"> { }; #updatePricedHeap = () => { - const {pending} = this.#executables; + const { pending } = this.#executables; const origins = this.#origins; const priced = this.#priced; // Note: the `pending` Map passed here is "live", meaning it is constantly diff --git a/src/chains/ethereum/src/options/chain-options.ts b/src/chains/ethereum/src/options/chain-options.ts index f2ff052b18..6c8eb47972 100644 --- a/src/chains/ethereum/src/options/chain-options.ts +++ b/src/chains/ethereum/src/options/chain-options.ts @@ -11,41 +11,41 @@ export type ChainConfig = { * is bypassed. Setting this to `true` will cause ganache to behave * differently than production environments. You should only set this to * `true` during local debugging. - * + * * Default is `false`. */ readonly allowUnlimitedContractSize: { type: boolean; hasDefault: true; - } - + }; + readonly asyncRequestProcessing: { type: boolean; hasDefault: true; - } + }; /** * The currently configured chain id, a value used in replay-protected * transaction signing as introduced by * [EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md). - * + * * Defaults to `1337`. */ readonly chainId: { type: number; hasDefault: true; - } + }; /** * The id of the network returned by the RPC method `net_version`. - * - * Defaults to the current timestamp, via JavaScript's `Date.now()` (the + * + * Defaults to the current timestamp, via JavaScript's `Date.now()` (the * number of millisconds since the UNIX epoch). */ readonly networkId: { type: number; hasDefault: true; - } + }; /** * Date that the first block should start. Use this feature, along with the @@ -53,7 +53,7 @@ export type ChainConfig = { */ readonly time: { type: number | Date; - } + }; /** * Set the hardfork rules for the EVM. @@ -61,20 +61,20 @@ export type ChainConfig = { readonly hardfork: { type: Hardfork; hasDefault: true; - } + }; /** * Whether to report runtime errors from EVM code as RPC errors. - * + * * Defaults to `false`. */ readonly vmErrorsOnRPCResponse: { type: boolean; hasDefault: true; - } - }, - exclusiveGroups: [] -} + }; + }; + exclusiveGroups: []; +}; export const ChainOptions: Definitions = { allowUnlimitedContractSize: { diff --git a/src/chains/ethereum/src/options/database-options.ts b/src/chains/ethereum/src/options/database-options.ts index 6454199b56..26a17981ed 100644 --- a/src/chains/ethereum/src/options/database-options.ts +++ b/src/chains/ethereum/src/options/database-options.ts @@ -7,7 +7,7 @@ export type DatabaseConfig = { */ readonly db: { type: string | object; - } + }; /** * Specify a path to a directory to save the chain database. If a database * already exists, that chain will be initialized instead of creating a new @@ -15,16 +15,14 @@ export type DatabaseConfig = { */ readonly dbPath: { type: string; - } - }, - exclusiveGroups: [ - ["db", "dbPath"] - ] -} + }; + }; + exclusiveGroups: [["db", "dbPath"]]; +}; export const DatabaseOptions: Definitions = { db: { - normalize: rawInput => rawInput, + normalize: rawInput => rawInput }, dbPath: { normalize: rawInput => rawInput, diff --git a/src/chains/ethereum/src/options/index.ts b/src/chains/ethereum/src/options/index.ts index d47e57f640..7b574aa8cf 100644 --- a/src/chains/ethereum/src/options/index.ts +++ b/src/chains/ethereum/src/options/index.ts @@ -13,13 +13,15 @@ export type EthereumOptions = { wallet: WalletConfig; }; -export type EthereumProviderOptions = Partial<{ - [K in keyof EthereumOptions]: ExternalConfig; -}> +export type EthereumProviderOptions = Partial< + { + [K in keyof EthereumOptions]: ExternalConfig; + } +>; export type EthereumInternalOptions = { [K in keyof EthereumOptions]: InternalConfig; -} +}; export type EthereumDefaults = { [K in keyof EthereumOptions]: Definitions; diff --git a/src/chains/ethereum/src/options/logging-options.ts b/src/chains/ethereum/src/options/logging-options.ts index bc3b1eb41c..668dbbfafd 100644 --- a/src/chains/ethereum/src/options/logging-options.ts +++ b/src/chains/ethereum/src/options/logging-options.ts @@ -4,19 +4,19 @@ export type LoggingConfig = { options: { /** * Set to `true` to log EVM opcodes. - * + * * Defaults to `false`. */ readonly debug: { type: boolean; hasDefault: true; - } + }; /** * An object, like `console`, that implements a `log` function. - * + * * Defaults to `console` (logs to stdout). - * + * * @example * ```typescript * { @@ -31,20 +31,20 @@ export type LoggingConfig = { log(message?: any, ...optionalParams: any[]): void; }; hasDefault: true; - } + }; /** * Set to `true` to log all RPC requests and responses. - * + * * Defaults to `false`. */ readonly verbose: { type: boolean; hasDefault: true; - } - }, - exclusiveGroups: [] -} + }; + }; + exclusiveGroups: []; +}; const logger = { log: console.log.bind(console) }; diff --git a/src/chains/ethereum/src/options/miner-options.ts b/src/chains/ethereum/src/options/miner-options.ts index 17c38a7833..b902f7a30e 100644 --- a/src/chains/ethereum/src/options/miner-options.ts +++ b/src/chains/ethereum/src/options/miner-options.ts @@ -8,31 +8,31 @@ export type MinerConfig = { * Sets the `blockTime` in seconds for automatic mining. A blockTime of `0` * (default) enables "instamine mode", where new executable transactions * will be mined instantly. - * + * * Using the `blockTime` option is discouraged unless you have tests which * require a specific mining interval. - * + * * Defaults to `0` ("instamine mode"). */ blockTime: { type: number; hasDefault: true; - } + }; /** * Sets the default gas price in WEI for transactions if not otherwise specified. - * + * * Defaults to `2_000_000`. */ gasPrice: { type: Quantity; rawType: string | number | bigint; hasDefault: true; - } + }; /** * Sets the block gas limit in WEI. - * + * * Defaults to `12_000_000`. */ blockGasLimit: { @@ -40,59 +40,59 @@ export type MinerConfig = { rawType: string | number | bigint; hasDefault: true; legacyName: "gasLimit"; - } + }; /** * Sets the _default_ transaction gas limit in WEI. - * + * * Defaults to `9_000`. */ defaultTransactionGasLimit: { type: Quantity; rawType: string | number | bigint; hasDefault: true; - } + }; /** * Sets the transaction gas limit in WEI for `eth_call` and * eth_estimateGas` calls. - * + * * Defaults to `9_007_199_254_740_991` (`2**53 - 1`). */ callGasLimit: { type: Quantity; rawType: string | number | bigint; hasDefault: true; - } + }; /** * Enables legacy instamine mode, where transactions are fully mined before * the transaction's hash is returned to the caller. If `legacyInstamine` is * `true`, `blockTime` must be `0` (default). - * + * * Defaults to `false`. */ legacyInstamine: { type: boolean; hasDefault: true; - } + }; /** * Sets the address where mining rewards will go. - * + * * * `{string}` hex-encoded address * * `{number}` index of the account returned by `eth_getAccounts` - * + * * Defaults to `0x0000000000000000000000000000000000000000`. */ coinbase: { rawType: string | number; type: string | number | Address; hasDefault: true; - } - }, - exclusiveGroups: [] -} + }; + }; + exclusiveGroups: []; +}; export const MinerOptions: Definitions = { blockTime: { @@ -114,15 +114,14 @@ export const MinerOptions: Definitions = { }, callGasLimit: { normalize: Quantity.from, - default: () => Quantity.from(Number.MAX_SAFE_INTEGER), + default: () => Quantity.from(Number.MAX_SAFE_INTEGER) }, coinbase: { - normalize: (rawInput) => rawInput, + normalize: rawInput => rawInput, default: () => Address.from(utils.ACCOUNT_ZERO) }, legacyInstamine: { normalize: rawInput => rawInput, default: () => false } -} - +}; diff --git a/src/chains/ethereum/src/options/wallet-options.ts b/src/chains/ethereum/src/options/wallet-options.ts index 88233bdaaf..0715844f04 100644 --- a/src/chains/ethereum/src/options/wallet-options.ts +++ b/src/chains/ethereum/src/options/wallet-options.ts @@ -1,5 +1,5 @@ import seedrandom from "seedrandom"; -import {entropyToMnemonic} from "bip39"; +import { entropyToMnemonic } from "bip39"; import { Quantity } from "@ganache/utils"; @@ -27,7 +27,10 @@ const randomAlphaNumericString = (() => { }; })(); -export type OptionsAccount = {balance: string | number | bigint | Buffer, secretKey?: string}; +export type OptionsAccount = { + balance: string | number | bigint | Buffer; + secretKey?: string; +}; export type WalletConfig = { options: { @@ -71,7 +74,7 @@ export type WalletConfig = { */ unlockedAccounts: { type: Array; - } + }; /** * Lock available accounts by default (good for third party transaction signing). Defaults to `false`. @@ -83,25 +86,25 @@ export type WalletConfig = { /** * Specifies a file to save accounts and private keys to, for testing. - * + * * Can be a filename or file descriptor. - * + * * If specifying a filename, the directory path must already exist. - * + * * See: https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options */ accountKeysPath: { type: string | number; - } + }; /** * The default account balance, specified in ether. Defaults to `100` ether */ defaultBalance: { - type: number, + type: number; rawType: number; hasDefault: true; - }, + }; /** * The hierarchical deterministic path to use when generating accounts. @@ -110,12 +113,9 @@ export type WalletConfig = { hdPath: { type: string; hasDefault: true; - } + }; }; - exclusiveGroups: [ - ["totalAccounts", "accounts"], - ["mnemonic", "seed"] - ]; + exclusiveGroups: [["totalAccounts", "accounts"], ["mnemonic", "seed"]]; }; export const WalletOptions: Definitions = { @@ -133,7 +133,7 @@ export const WalletOptions: Definitions = { }, mnemonic: { normalize: rawInput => rawInput, - default: (config) => entropyToMnemonic(randomBytes(16, seedrandom(config.seed))) + default: config => entropyToMnemonic(randomBytes(16, seedrandom(config.seed))) }, unlockedAccounts: { normalize: rawInput => rawInput, @@ -148,7 +148,7 @@ export const WalletOptions: Definitions = { legacyName: "account_keys_path" }, defaultBalance: { - normalize: (rawInput) => rawInput, + normalize: rawInput => rawInput, default: () => 100, legacyName: "default_balance_ether" }, diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 8e6b7a554b..230a93dbbc 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -1,9 +1,9 @@ import Emittery from "emittery"; import EthereumApi from "./api"; -import {JsonRpcTypes} from "@ganache/utils"; +import { JsonRpcTypes } from "@ganache/utils"; import { EthereumProviderOptions, EthereumInternalOptions, EthereumOptionsConfig } from "./options"; import cloneDeep from "lodash.clonedeep"; -import {PromiEvent, types, utils} from "@ganache/utils"; +import { PromiEvent, types, utils } from "@ganache/utils"; declare type RequestMethods = types.KnownKeys; type mergePromiseGenerics = Promise ? X : never>; @@ -14,21 +14,21 @@ interface Callback { type RequestParams = { readonly method: Method; - readonly params: Parameters | undefined + readonly params: Parameters | undefined; }; const hasOwn = utils.hasOwn; -export default class EthereumProvider extends Emittery.Typed<{message: any}, "connect" | "disconnect"> - implements types.Provider - { +export default class EthereumProvider + extends Emittery.Typed<{ message: any }, "connect" | "disconnect"> + implements types.Provider { #options: EthereumInternalOptions; #api: EthereumApi; #executor: utils.Executor; constructor(options: EthereumProviderOptions = {}, executor: utils.Executor) { super(); - const providerOptions = this.#options = EthereumOptionsConfig.normalize(options); + const providerOptions = (this.#options = EthereumOptionsConfig.normalize(options)); this.#executor = executor; @@ -52,7 +52,7 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co * @param callback * @deprecated Use the `request` method */ - public send(payload: JsonRpcTypes.Request, callback?: Callback) : undefined; + public send(payload: JsonRpcTypes.Request, callback?: Callback): undefined; /** * Legacy callback style API * @param payload JSON-RPC payload @@ -60,14 +60,17 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co * @deprecated Batch transactions have been deprecated. Send payloads * individually via the `request` method. */ - public send(payloads: JsonRpcTypes.Request[], callback?: Callback) : undefined; + public send(payloads: JsonRpcTypes.Request[], callback?: Callback): undefined; /** * @param method * @param params * @ignore Non standard! Do not use. */ - public send(method: RequestMethods, params?: Parameters) : any; - public send(arg1: RequestMethods | JsonRpcTypes.Request | JsonRpcTypes.Request[], arg2?: Callback | any[]) { + public send(method: RequestMethods, params?: Parameters): any; + public send( + arg1: RequestMethods | JsonRpcTypes.Request | JsonRpcTypes.Request[], + arg2?: Callback | any[] + ) { let method: RequestMethods; let params: any; let response: Promise<{}> | undefined; @@ -76,22 +79,19 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co // we should probably remove it, but I really like it so I haven't yet. method = arg1; params = arg2 as Parameters; - response = this.request({method, params}); - + response = this.request({ method, params }); } else if (typeof arg2 === "function") { // handle backward compatibility with callback-style ganache-core const callback = arg2 as Callback; if (Array.isArray(arg1)) { - this.#legacySendPayloads(arg1).then(({error, result}) => { + this.#legacySendPayloads(arg1).then(({ error, result }) => { process.nextTick(callback, error, result); }); } else { - this.#legacySendPayload(arg1).then(({error, result}) => { + this.#legacySendPayload(arg1).then(({ error, result }) => { process.nextTick(callback, error, result); }); } - - } else { throw new Error( "No callback provided to provider's send function. As of web3 1.0, provider.send " + @@ -118,14 +118,18 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co * @returns A Promise that resolves with the method's result or rejects with a CodedError * @EIP [1193](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md) */ - public async request(args: Parameters["length"] extends 0 ? Pick, "method"> : never): mergePromiseGenerics>; + public async request( + args: Parameters["length"] extends 0 ? Pick, "method"> : never + ): mergePromiseGenerics>; /** * EIP-1193 style request method * @param args * @returns A Promise that resolves with the method's result or rejects with a CodedError * @EIP [1193](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md) */ - public async request(args: RequestParams): mergePromiseGenerics>; + public async request( + args: RequestParams + ): mergePromiseGenerics>; public async request(args: RequestParams) { const rawResult = await this.requestRaw(args); const value = await rawResult.value; @@ -137,21 +141,24 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co * otherwise be flattened into a regular Promise through the Promise chain. * @param request */ - public async requestRaw({method, params}: RequestParams) { + public async requestRaw({ method, params }: RequestParams) { this.#logRequest(method, params); const result = await this.#executor.execute(this.#api, method, params); - const promise = (result.value as mergePromiseGenerics); + const promise = result.value as mergePromiseGenerics; if (promise instanceof PromiEvent) { - promise.on("message", (data) => { + promise.on("message", data => { // EIP-1193 - this.emit(("message" as never), (data as never)); + this.emit("message" as never, data as never); // legacy - this.emit(("data" as never), ({ - jsonrpc: "2.0", - method: "eth_subscription", - params: (data as any).data - } as never)); + this.emit( + "data" as never, + { + jsonrpc: "2.0", + method: "eth_subscription", + params: (data as any).data + } as never + ); }); } const value = promise.catch((error: Error) => { @@ -172,10 +179,10 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co const options = this.#options; if (options.logging.verbose) { options.logging.logger.log( - ` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ") }` + ` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}` ); } - } + }; public disconnect = async () => { await this.emit("disconnect"); @@ -184,22 +191,21 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co //#region legacy #legacySendPayloads = (payloads: JsonRpcTypes.Request[]) => { - return Promise.all(payloads.map(this.#legacySendPayload)) - .then(results => { + return Promise.all(payloads.map(this.#legacySendPayload)).then(results => { let mainError: Error = null; const responses: (JsonRpcTypes.Response | JsonRpcTypes.Error)[] = []; - results.forEach(({error, result}, i) => { + results.forEach(({ error, result }, i) => { responses.push(result); if (error) { if (mainError == null) { - mainError = new Error("Batch error:") as Error & {errors: []}; + mainError = new Error("Batch error:") as Error & { errors: [] }; } (mainError as any).errors[i] = error; } }); - return {error: mainError, result: responses}; + return { error: mainError, result: responses }; }); - } + }; #legacySendPayload = async (payload: JsonRpcTypes.Request) => { const method = payload.method as RequestMethods; @@ -221,6 +227,6 @@ export default class EthereumProvider extends Emittery.Typed<{message: any}, "co } return { error, result: JsonRpcTypes.Error(payload.id, error, result) }; } - } + }; //#endregion } diff --git a/src/chains/ethereum/src/things/account.ts b/src/chains/ethereum/src/things/account.ts index a4bfe75203..a035e7ccdc 100644 --- a/src/chains/ethereum/src/things/account.ts +++ b/src/chains/ethereum/src/things/account.ts @@ -1,6 +1,6 @@ -import {Data, Quantity} from "@ganache/utils"; +import { Data, Quantity } from "@ganache/utils"; import Address from "./address"; -import {rlp, KECCAK256_RLP, KECCAK256_NULL} from "ethereumjs-util"; +import { rlp, KECCAK256_RLP, KECCAK256_NULL } from "ethereumjs-util"; import { utils } from "@ganache/utils"; const RPCQUANTITY_ZERO = utils.RPCQUANTITY_ZERO; diff --git a/src/chains/ethereum/src/things/address.ts b/src/chains/ethereum/src/things/address.ts index 02eef73790..57576409b1 100644 --- a/src/chains/ethereum/src/things/address.ts +++ b/src/chains/ethereum/src/things/address.ts @@ -1,8 +1,8 @@ -import {Data} from "@ganache/utils"; +import { Data } from "@ganache/utils"; class Address extends Data { /** - * + * * @param value * @param byteLength the exact length the value represents when encoded as * Ethereum JSON-RPC DATA. @@ -12,4 +12,4 @@ class Address extends Data { } } -export default Address +export default Address; diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index fe947fb9af..5e4d14031b 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -1,10 +1,17 @@ import { encode as rlpEncode, decode as rlpDecode } from "rlp"; import { Data, Quantity } from "@ganache/utils"; import Address from "./address"; -import {utils} from "@ganache/utils"; - -export type TransactionLog = [address: Buffer, topics: Buffer[], data: Buffer|Buffer[]] -export type BlockLog = [removed: Buffer, transactionIndex: Buffer, transactionHash: Buffer, address: TransactionLog[0], topics: TransactionLog[1], data: TransactionLog[2]]; +import { utils } from "@ganache/utils"; + +export type TransactionLog = [address: Buffer, topics: Buffer[], data: Buffer | Buffer[]]; +export type BlockLog = [ + removed: Buffer, + transactionIndex: Buffer, + transactionHash: Buffer, + address: TransactionLog[0], + topics: TransactionLog[1], + data: TransactionLog[2] +]; const _raw = Symbol("raw"); const _logs = Symbol("logs"); @@ -30,20 +37,20 @@ const filterByTopic = (expectedTopics: (string | string[])[], logTopics: Buffer[ // "OR" logic, e.g., [[A, B]] means log topic in the first position matching either "A" OR "B": return expectedTopicSet.some(expectedTopic => logTopic.equals(Data.from(expectedTopic).toBuffer())); }); -} +}; export default class BlockLogs { [_raw]: [blockHash: Buffer, blockLog: BlockLog[]]; constructor(data: Buffer) { if (data) { - const decoded = rlpDecode(data) as unknown as [Buffer, BlockLog[]]; + const decoded = (rlpDecode(data) as unknown) as [Buffer, BlockLog[]]; this[_raw] = decoded; } } /** - * + * * @param blockHash Creates an BlogLogs entity with an empty internal logs * array. */ @@ -62,19 +69,19 @@ export default class BlockLogs { /** * Appends the data to the internal logs array - * @param transactionIndex - * @param transactionHash - * @param log + * @param transactionIndex + * @param transactionHash + * @param log */ - public append(/*removed: boolean, */transactionIndex: Buffer, transactionHash: Buffer, log: TransactionLog) { + public append(/*removed: boolean, */ transactionIndex: Buffer, transactionHash: Buffer, log: TransactionLog) { this[_raw][1].push([ utils.BUFFER_ZERO, // `removed`, TODO: this is used for reorgs, but we don't support them yet - transactionIndex, // transactionIndex - transactionHash, // transactionHash - log[0], // `address` - log[1], // `topics` - log[2] // `data` - ]) + transactionIndex, // transactionIndex + transactionHash, // transactionHash + log[0], // `address` + log[1], // `topics` + log[2] // `data` + ]); } /** @@ -104,22 +111,26 @@ export default class BlockLogs { yield BlockLogs.logToJSON(logs[i], Quantity.from(i), blockHash, blockNumber); } } - } + }; }, *[Symbol.iterator]() { for (let i = 0; i < l; i++) { const log = logs[i]; const address = log[3]; const topics = log[4]; - yield { address, topics, toJSON: () => BlockLogs.logToJSON(log, Quantity.from(i), blockHash, blockNumber) }; + yield { + address, + topics, + toJSON: () => BlockLogs.logToJSON(log, Quantity.from(i), blockHash, blockNumber) + }; } } - } + }; } /** - * - * @param log + * + * @param log * @param logIndex The index this log appears in the block * @param blockHash The hash of the block * @param blockNumber The block number @@ -143,7 +154,7 @@ export default class BlockLogs { /** * Note: you must set `this.blockNumber: Quantity` first! - * + * * Topics are order-dependent. A transaction with a log with topics [A, B] will be matched by the following topic * filters: * ▸ [] "anything" @@ -151,11 +162,11 @@ export default class BlockLogs { * ▸ [null, B] "anything in first position AND B in second position (and anything after)" * ▸ [A, B] "A" in first position AND B in second position (and anything after)" * ▸ [[A, B], [A, B]] "(A OR B) in first position AND (A OR B) in second position (and anything after)" - * @param expectedAddresses - * @param expectedTopics + * @param expectedAddresses + * @param expectedTopics * @returns JSON representation of the filtered logs */ - * filter(expectedAddresses: Buffer[], expectedTopics: (string | string[])[]) { + *filter(expectedAddresses: Buffer[], expectedTopics: (string | string[])[]) { const logs = this[_logs](); if (expectedAddresses.length !== 0) { if (expectedTopics.length === 0) { diff --git a/src/chains/ethereum/src/things/params.ts b/src/chains/ethereum/src/things/params.ts index 2c9bc274bb..728ba674ea 100644 --- a/src/chains/ethereum/src/things/params.ts +++ b/src/chains/ethereum/src/things/params.ts @@ -10,7 +10,16 @@ export default { /** * Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions. */ - TRANSACTION_DATA_NON_ZERO_GAS: new Map<"constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier", bigint>([["constantinople", 68n], ["byzantium", 68n], ["petersburg", 68n], ["istanbul", 68n], ["muirGlacier", 16n]]), + TRANSACTION_DATA_NON_ZERO_GAS: new Map< + "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier", + bigint + >([ + ["constantinople", 68n], + ["byzantium", 68n], + ["petersburg", 68n], + ["istanbul", 68n], + ["muirGlacier", 16n] + ]), /** * Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index 8f3e26a778..cf82e9d4d5 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -1,11 +1,18 @@ import Transaction from "./transaction"; -import {Block} from "../data-managers/block-manager"; -import {encode as rlpEncode, decode as rlpDecode} from "rlp"; -import {Data, Quantity} from "@ganache/utils"; +import { Block } from "../data-managers/block-manager"; +import { encode as rlpEncode, decode as rlpDecode } from "rlp"; +import { Data, Quantity } from "@ganache/utils"; import BlockLogs, { TransactionLog } from "./blocklogs"; type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; -type FullRawReceipt = [status: Buffer, cumulativeGasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], gasUsed: Buffer, contractAddress: Buffer | null]; +type FullRawReceipt = [ + status: Buffer, + cumulativeGasUsed: Buffer, + logsBloom: Buffer, + logs: Buffer[], + gasUsed: Buffer, + contractAddress: Buffer | null +]; type RawReceipt = OmitLastType>; export default class TransactionReceipt { @@ -19,13 +26,27 @@ export default class TransactionReceipt { this.#init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4], decoded[5]); } } - #init = (status: Buffer, cumulativeGasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], gasUsed: Buffer, contractAddress: Buffer = null) => { + #init = ( + status: Buffer, + cumulativeGasUsed: Buffer, + logsBloom: Buffer, + logs: Buffer[], + gasUsed: Buffer, + contractAddress: Buffer = null + ) => { this.raw = [status, cumulativeGasUsed, logsBloom, logs]; this.contractAddress = contractAddress; this.#gasUsed = gasUsed; - } + }; - static fromValues(status: Buffer, cumulativeGasUsed: Buffer, logsBloom: Buffer, logs: Buffer[], gasUsed: Buffer, contractAddress: Buffer) { + static fromValues( + status: Buffer, + cumulativeGasUsed: Buffer, + logsBloom: Buffer, + logs: Buffer[], + gasUsed: Buffer, + contractAddress: Buffer + ) { const receipt = new TransactionReceipt(); receipt.#init(status, cumulativeGasUsed, logsBloom, logs, contractAddress, gasUsed); return receipt; @@ -46,7 +67,7 @@ export default class TransactionReceipt { const contractAddress = this.contractAddress.length === 0 ? null : Data.from(this.contractAddress); const blockLog = BlockLogs.create(block.value.hash()); blockLog.blockNumber = Quantity.from(block.value.header.number); - (raw[3] as any as TransactionLog[]).forEach(log => { + ((raw[3] as any) as TransactionLog[]).forEach(log => { blockLog.append(transaction._index, transaction.hash(), log); }); const logs = [...blockLog.toJSON()]; diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index f3dc7a3ce7..904d2ca397 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -1,13 +1,13 @@ -import {INTRINSIC_GAS_TOO_LOW} from "../errors/errors"; +import { INTRINSIC_GAS_TOO_LOW } from "../errors/errors"; import RuntimeError, { RETURN_TYPES } from "../errors/runtime-error"; -import {utils, Data, Quantity} from "@ganache/utils"; +import { utils, Data, Quantity } from "@ganache/utils"; import params from "./params"; -import {Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction} from "ethereumjs-tx"; +import { Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction } from "ethereumjs-tx"; import * as ethUtil from "ethereumjs-util"; import assert from "assert"; -import {decode as rlpDecode} from "rlp"; -import {RunTxResult} from "ethereumjs-vm/dist/runTx"; -import {Block} from "../data-managers/block-manager"; +import { decode as rlpDecode } from "rlp"; +import { RunTxResult } from "ethereumjs-vm/dist/runTx"; +import { Block } from "../data-managers/block-manager"; import TransactionReceipt from "./transaction-receipt"; import Common from "ethereumjs-common"; import { TransactionLog } from "./blocklogs"; @@ -28,7 +28,7 @@ const fakeHash = function (this: Transaction) { if (this._hash != null) { return this._hash; } - return EthereumJsFakeTransaction.prototype.hash.apply(this, arguments as unknown as [(boolean | undefined)?]); + return EthereumJsFakeTransaction.prototype.hash.apply(this, (arguments as unknown) as [(boolean | undefined)?]); }; function configZeroableField(tx: any, fieldName: string, fieldLength = 32) { @@ -88,7 +88,7 @@ function fixProps(tx: any, data: any) { }); } -function makeFake(tx: any, data: any){ +function makeFake(tx: any, data: any) { if (tx.isFake()) { /** * @prop {Buffer} from (read/write) Set from address to bypass transaction @@ -123,11 +123,14 @@ function makeFake(tx: any, data: any){ function initData(tx: Transaction, data: any) { if (data) { let parts: Buffer[]; - if (typeof data === "string") { //hex - parts = rlpDecode(Data.from(data).toBuffer()) as any as Buffer[]; - } else if (Buffer.isBuffer(data)) { // Buffer - parts = rlpDecode(data) as any as Buffer[]; - } else if (data.type === "Buffer") { // wire Buffer + if (typeof data === "string") { + //hex + parts = (rlpDecode(Data.from(data).toBuffer()) as any) as Buffer[]; + } else if (Buffer.isBuffer(data)) { + // Buffer + parts = (rlpDecode(data) as any) as Buffer[]; + } else if (data.type === "Buffer") { + // wire Buffer // handle case where a Buffer is sent as `{data: "Buffer", data: number[]}` // like if someone does `web3.eth.sendRawTransaction(tx.serialize())` const obj = data.data; @@ -136,10 +139,12 @@ function initData(tx: Transaction, data: any) { for (let i = 0; i < length; i++) { buf[i] = obj[i]; } - parts = rlpDecode(buf) as any as Buffer[]; - } else if (Array.isArray(data)) { // rlpdecoded data + parts = (rlpDecode(buf) as any) as Buffer[]; + } else if (Array.isArray(data)) { + // rlpdecoded data parts = data; - } else if (typeof data === "object") { // JSON + } else if (typeof data === "object") { + // JSON const keys = Object.keys(data); tx._fields.forEach((field: any) => { if (keys.indexOf(field) !== -1) { @@ -190,7 +195,7 @@ function initData(tx: Transaction, data: any) { //#endregion -type TransactionFinalization = {status: "confirmed", error?: Error} | {status: "rejected", error: Error}; +type TransactionFinalization = { status: "confirmed"; error?: Error } | { status: "rejected"; error: Error }; interface Transaction extends Omit {} // TODO fix the EthereumJsTransaction as any via some "fake" multi-inheritance: @@ -214,7 +219,7 @@ class Transaction extends (EthereumJsTransaction as any) { * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ constructor(data: any, common: Common, type: number = Transaction.types.none) { - super(void 0, {common}); + super(void 0, { common }); // EthereumJS-TX Transaction overwrites our `toJSON`, so we overwrite it back here: this.toJSON = Transaction.prototype.toJSON.bind(this); @@ -225,10 +230,9 @@ class Transaction extends (EthereumJsTransaction as any) { initData(this, data); if (this.isFake()) { - makeFake(this, data) + makeFake(this, data); } - let finalizer: (value: TransactionFinalization) => void; this.#finalized = new Promise(resolve => { finalizer = (...args: any[]) => process.nextTick(resolve, ...args); @@ -253,29 +257,29 @@ class Transaction extends (EthereumJsTransaction as any) { } /** - * Returns a Promise that is resolve with the confirmation status and, if + * Returns a Promise that is resolve with the confirmation status and, if * appropriate, an error property. - * + * * Note: it is possible to be confirmed AND - * + * * @param event "finalized" */ once(event: "finalized") { return this.#finalized; - }; - + } + /** * Mark this transaction as finalized, notifying all past and future * "finalized" event subscribers. - * + * * Note: - * - * @param status - * @param error + * + * @param status + * @param error */ finalize(status: "confirmed" | "rejected", error: Error = null) { // resolves the `#finalized` promise - this.#finalizer({status, error}); + this.#finalizer({ status, error }); } /** @@ -283,7 +287,10 @@ class Transaction extends (EthereumJsTransaction as any) { * @param data The transaction's data * @param hardfork The hardfork use to determine gas costs */ - public static calculateIntrinsicGas(data: Buffer | null, hardfork: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier") { + public static calculateIntrinsicGas( + data: Buffer | null, + hardfork: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier" + ) { // Set the starting gas for the raw transaction let gas = params.TRANSACTION_GAS; if (data) { @@ -291,7 +298,7 @@ class Transaction extends (EthereumJsTransaction as any) { const dataLength = data.byteLength; if (dataLength > 0) { const TRANSACTION_DATA_NON_ZERO_GAS = params.TRANSACTION_DATA_NON_ZERO_GAS.get(hardfork); - const TRANSACTION_DATA_ZERO_GAS = params.TRANSACTION_DATA_ZERO_GAS + const TRANSACTION_DATA_ZERO_GAS = params.TRANSACTION_DATA_ZERO_GAS; // Zero and non-zero bytes are priced differently let nonZeroBytes: bigint = 0n; @@ -319,7 +326,7 @@ class Transaction extends (EthereumJsTransaction as any) { * Compute the 'intrinsic gas' for a message with the given data. */ public calculateIntrinsicGas(): bigint { - return Transaction.calculateIntrinsicGas(this.data, this._common._hardfork) + return Transaction.calculateIntrinsicGas(this.data, this._common._hardfork); } /** @@ -447,10 +454,10 @@ class Transaction extends (EthereumJsTransaction as any) { /** * Initializes the receipt and logs - * @param result + * @param result * @returns RLP encoded data for use in a transaction trie */ - fillFromResult (result: RunTxResult, cumulativeGasUsed: bigint) { + fillFromResult(result: RunTxResult, cumulativeGasUsed: bigint) { const vmResult = result.execResult; const execException = vmResult.exceptionError; let status: Buffer; @@ -461,24 +468,25 @@ class Transaction extends (EthereumJsTransaction as any) { status = ONE_BUFFER; } - const receipt = this.#receipt = TransactionReceipt.fromValues( - status, Quantity.from(cumulativeGasUsed).toBuffer(), + const receipt = (this.#receipt = TransactionReceipt.fromValues( + status, + Quantity.from(cumulativeGasUsed).toBuffer(), result.bloom.bitvector, - (this.#logs = vmResult.logs || [] as TransactionLog[]), + (this.#logs = vmResult.logs || ([] as TransactionLog[])), result.createdAddress, result.gasUsed.toBuffer() - ); + )); return receipt.serialize(false); - }; + } getReceipt() { return this.#receipt; - }; + } getLogs() { return this.#logs; - }; + } public execException: RuntimeError = null; } diff --git a/src/chains/ethereum/src/transaction-pool.ts b/src/chains/ethereum/src/transaction-pool.ts index f5d38c47f2..e974feb55c 100644 --- a/src/chains/ethereum/src/transaction-pool.ts +++ b/src/chains/ethereum/src/transaction-pool.ts @@ -1,9 +1,9 @@ import Emittery from "emittery"; import Blockchain from "./blockchain"; -import {utils} from "@ganache/utils"; +import { utils } from "@ganache/utils"; import Transaction from "./things/transaction"; -import {Data, Quantity} from "@ganache/utils"; -import {GAS_LIMIT, INTRINSIC_GAS_TOO_LOW} from "./errors/errors"; +import { Data, Quantity } from "@ganache/utils"; +import { GAS_LIMIT, INTRINSIC_GAS_TOO_LOW } from "./errors/errors"; import CodedError, { ErrorCodes } from "./errors/coded-error"; import { EthereumInternalOptions } from "./options"; import { Executables } from "./types/executables"; @@ -29,16 +29,16 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { public readonly executables: Executables = { inProgress: new Set(), pending: new Map() - } + }; readonly #origins: Map> = new Map(); readonly #accountPromises = new Map>(); /** * Inserts a transaction into the pending queue, if executable, or future pool * if not. - * - * @param transaction - * @param secretKey + * + * @param transaction + * @param secretKey * @returns data that can be used to drain the queue */ public async prepareTransaction(transaction: Transaction, secretKey?: Data) { @@ -85,7 +85,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // then a new tx comes in _before_ the block is persisted to the database, the nonce might be of the second // tx would be too low. // * rough idea for a fix: transactions have a `finalize` method that is called _after_ the tx is saved. Maybe - // when tx's are executed their nonce is moved to a `highNonceByOrigin` map? We'd check this map in addition to the + // when tx's are executed their nonce is moved to a `highNonceByOrigin` map? We'd check this map in addition to the // `executableOriginTransactions` map, always taking the highest of the two. let highestNonce = 0n; @@ -122,11 +122,15 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // heap. pendingArray[i] = transaction; - currentPendingTx.finalize("rejected", new CodedError( - "Transaction replaced by better transaction", ErrorCodes.TRANSACTION_REJECTED - )); + currentPendingTx.finalize( + "rejected", + new CodedError("Transaction replaced by better transaction", ErrorCodes.TRANSACTION_REJECTED) + ); } else { - throw new CodedError("transaction rejected; gas price too low to replace existing transaction", ErrorCodes.TRANSACTION_REJECTED); + throw new CodedError( + "transaction rejected; gas price too low to replace existing transaction", + ErrorCodes.TRANSACTION_REJECTED + ); } } if (thisNonce > highestNonce) { @@ -156,7 +160,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { }); } const transactor = await transactorNoncePromise; - + const transactorNonce = transactor ? transactor.toBigInt() : 0n; if (secretKey && transactionNonce === void 0) { // if we don't have a transactionNonce, just use the account's next @@ -167,7 +171,9 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { transaction.nonce = Quantity.from(transactionNonce).toBuffer(); } else if (transactionNonce < transactorNonce) { // it's an error if the transaction's nonce is <= the persisted nonce - throw new Error(`the tx doesn't have the correct nonce. account has nonce of: ${transactorNonce} tx has nonce of: ${transactionNonce}`); + throw new Error( + `the tx doesn't have the correct nonce. account has nonce of: ${transactorNonce} tx has nonce of: ${transactionNonce}` + ); } else if (transactionNonce === transactorNonce) { isExecutableTransaction = true; } @@ -236,12 +242,12 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { /** * TODO(perf): this looks super slow, doesn't it? - * + * * Returns the transaction matching the given hash - * @param transactionHash + * @param transactionHash */ public find(transactionHash: Buffer) { - const {pending, inProgress} = this.executables; + const { pending, inProgress } = this.executables; // first search pending transactions for (let [_, transactions] of this.#origins) { @@ -272,7 +278,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { } readonly drain = () => { - // notify listeners (the blockchain, then the miner, eventually) that we + // notify listeners (the blockchain, then the miner, eventually) that we // have executable transactions ready this.emit("drain"); }; diff --git a/src/chains/ethereum/src/types/executables.ts b/src/chains/ethereum/src/types/executables.ts index ebf1e76073..7a9bcae406 100644 --- a/src/chains/ethereum/src/types/executables.ts +++ b/src/chains/ethereum/src/types/executables.ts @@ -2,6 +2,6 @@ import { utils } from "@ganache/utils"; import Transaction from "../things/transaction"; export type Executables = { - inProgress: Set, - pending: Map> -} + inProgress: Set; + pending: Map>; +}; diff --git a/src/chains/ethereum/src/types/extract-values-from-types.ts b/src/chains/ethereum/src/types/extract-values-from-types.ts index fd2f24be7d..e584aa2302 100644 --- a/src/chains/ethereum/src/types/extract-values-from-types.ts +++ b/src/chains/ethereum/src/types/extract-values-from-types.ts @@ -1 +1 @@ -export type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; \ No newline at end of file +export type ExtractValuesFromType = { [I in keyof T]: T[I] }[keyof T]; diff --git a/src/chains/ethereum/src/types/filters.ts b/src/chains/ethereum/src/types/filters.ts index 158eaa7faa..06dde6fd35 100644 --- a/src/chains/ethereum/src/types/filters.ts +++ b/src/chains/ethereum/src/types/filters.ts @@ -6,16 +6,19 @@ export enum FilterTypes { log, block, pendingTransaction +} +export type Topic = string | string[]; +export type BaseFilterArgs = { address?: string | string[]; topics?: Topic[] }; +export type BlockHashFilterArgs = BaseFilterArgs & { blockHash?: string }; +export type RangeFilterArgs = BaseFilterArgs & { + fromBlock?: string | Tag; + toBlock?: string | Tag; }; -export type Topic = string|string[]; -export type BaseFilterArgs = {address?: string | string[], topics?: Topic[]}; -export type BlockHashFilterArgs = BaseFilterArgs & {blockHash?: string}; -export type RangeFilterArgs = BaseFilterArgs & {fromBlock?: string | Tag, toBlock?: string | Tag}; export type FilterArgs = BlockHashFilterArgs | RangeFilterArgs; export type Filter = { - type: FilterTypes, - updates: Data[], - unsubscribe: Emittery.UnsubscribeFn, - filter: FilterArgs -}; \ No newline at end of file + type: FilterTypes; + updates: Data[]; + unsubscribe: Emittery.UnsubscribeFn; + filter: FilterArgs; +}; diff --git a/src/chains/ethereum/src/types/snapshots.ts b/src/chains/ethereum/src/types/snapshots.ts index cf9c030786..05215ad169 100644 --- a/src/chains/ethereum/src/types/snapshots.ts +++ b/src/chains/ethereum/src/types/snapshots.ts @@ -1,11 +1,11 @@ import Emittery from "emittery"; -import {Block} from "../data-managers/block-manager"; +import { Block } from "../data-managers/block-manager"; -type SinglyLinkedList = {current: T, next: SinglyLinkedList}; +type SinglyLinkedList = { current: T; next: SinglyLinkedList }; export type Snapshot = { - block: Block, - timeAdjustment: number + block: Block; + timeAdjustment: number; }; export type Snapshots = { @@ -21,4 +21,4 @@ export type Snapshots = { * Function that should be used to remove the "block" listener */ unsubscribeFromBlocks: Emittery.UnsubscribeFn | null; -} +}; diff --git a/src/chains/ethereum/src/types/tuple-from-union.ts b/src/chains/ethereum/src/types/tuple-from-union.ts index c3d1708748..3cc254329f 100644 --- a/src/chains/ethereum/src/types/tuple-from-union.ts +++ b/src/chains/ethereum/src/types/tuple-from-union.ts @@ -1,22 +1,21 @@ -type TuplePrepend = -[NewElement, ...Tuple] +type TuplePrepend = [NewElement, ...Tuple]; type Consumer = (value: Value) => void; -type IntersectionFromUnion = -(Union extends unknown ? Consumer : never) extends (Consumer) -? ResultIntersection -: never; +type IntersectionFromUnion = (Union extends unknown ? Consumer : never) extends Consumer< + infer ResultIntersection +> + ? ResultIntersection + : never; type OverloadedConsumerFromUnion = IntersectionFromUnion : never>; -type UnionLast = OverloadedConsumerFromUnion extends ((a: infer A) => void) ? A : never; +type UnionLast = OverloadedConsumerFromUnion extends (a: infer A) => void ? A : never; type UnionExcludingLast = Exclude>; -type TupleFromUnionRec = -[RemainingUnion] extends [never] -? CurrentTuple -: TupleFromUnionRec, TuplePrepend>>; +type TupleFromUnionRec = [RemainingUnion] extends [never] + ? CurrentTuple + : TupleFromUnionRec, TuplePrepend>>; -export type TupleFromUnion = TupleFromUnionRec; \ No newline at end of file +export type TupleFromUnion = TupleFromUnionRec; diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 08fda896da..1e5030ec13 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -9,7 +9,7 @@ import HDKey from "hdkey"; import { alea as rng } from "seedrandom"; import crypto from "crypto"; import createKeccakHash from "keccak"; -import {writeFileSync} from "fs"; +import { writeFileSync } from "fs"; import { EthereumInternalOptions } from "./options"; //#region Constants @@ -44,13 +44,17 @@ const uncompressedPublicKeyToAddress = (uncompressedPublicKey: Buffer) => { const hasher = createKeccakHash("keccak256"); (hasher as any)._state.absorb(compresedPublicKey); return Address.from(hasher.digest().slice(-20)); -} +}; const asUUID = (uuid: Buffer | { length: 16 }) => { - return `${uuid.toString("hex", 0, 4)}-${uuid.toString("hex", 4, 6)}-${uuid.toString("hex", 6, 8)}-${uuid.toString("hex", 8, 10)}-${uuid.toString("hex", 10)}`; -} + return `${uuid.toString("hex", 0, 4)}-${uuid.toString("hex", 4, 6)}-${uuid.toString("hex", 6, 8)}-${uuid.toString( + "hex", + 8, + 10 + )}-${uuid.toString("hex", 10)}`; +}; -type ThenArg = T extends PromiseLike ? U : T +type ThenArg = T extends PromiseLike ? U : T; type EncryptType = ThenArg>; export default class Wallet { @@ -66,7 +70,7 @@ export default class Wallet { constructor(opts: EthereumInternalOptions["wallet"]) { this.#hdKey = HDKey.fromMasterSeed(mnemonicToSeedSync(opts.mnemonic, null)); - const initialAccounts = this.initialAccounts = this.#initializeAccounts(opts); + const initialAccounts = (this.initialAccounts = this.#initializeAccounts(opts)); const l = initialAccounts.length; const knownAccounts = this.knownAccounts; @@ -90,7 +94,7 @@ export default class Wallet { // don't use parseInt because strings like `"123abc"` parse // to `123`, and there is probably an error on the user's side we'd // want to uncover. - const index = (arg as any as number) - 0; + const index = ((arg as any) as number) - 0; // if we don't have a valid number, or the number isn't a valid JS // integer (no bigints or decimals, please), throw an error. if (!Number.isSafeInteger(index)) { @@ -137,12 +141,12 @@ export default class Wallet { unlockedAccounts.set(strAddress, account.privateKey); } //#endregion - + //#region save accounts to disk if (opts.accountKeysPath != null) { const fileData = { - addresses: {} as {[address: string]: string}, - private_keys: {} as {[address: string]: Data} + addresses: {} as { [address: string]: string }, + private_keys: {} as { [address: string]: Data } }; unlockedAccounts.forEach((privateKey, address) => { fileData.addresses[address] = address; @@ -165,7 +169,7 @@ export default class Wallet { buf[i] = (rand() * 255) | 0; } return buf; - } + }; #initializeAccounts = (options: EthereumInternalOptions["wallet"]): Account[] => { // convert a potentially fractional balance of Ether to WEI @@ -174,7 +178,7 @@ export default class Wallet { const fractionalStr = balanceParts[1] || "0"; const fractional = BigInt(fractionalStr); const magnitude = 10n ** BigInt(fractionalStr.length); - const defaultBalanceInWei = (WEI * significand) + (fractional * (WEI / magnitude)); + const defaultBalanceInWei = WEI * significand + fractional * (WEI / magnitude); const etherInWei = Quantity.from(defaultBalanceInWei); let accounts: Account[]; @@ -196,7 +200,7 @@ export default class Wallet { accounts[i] = Wallet.createAccount(Quantity.from(account.balance), privateKey, address); } else { privateKey = Data.from(secretKey); - const a = accounts[i] = Wallet.createAccountFromPrivateKey(privateKey); + const a = (accounts[i] = Wallet.createAccountFromPrivateKey(privateKey)); a.balance = Quantity.from(account.balance); } } @@ -226,10 +230,15 @@ export default class Wallet { const iv = random.slice(32, 32 + 16); // next 16 bytes const uuid = random.slice(32 + 16); // last 16 bytes - const derivedKey = await scrypt(passphrase, salt, SCRYPT_PARAMS.dklen, { ...SCRYPT_PARAMS, N: SCRYPT_PARAMS.n }); + const derivedKey = await scrypt(passphrase, salt, SCRYPT_PARAMS.dklen, { + ...SCRYPT_PARAMS, + N: SCRYPT_PARAMS.n + }); const cipher = crypto.createCipheriv(CIPHER, derivedKey.slice(0, 16), iv); const ciphertext = Buffer.concat([cipher.update(privateKey.toBuffer()), cipher.final()]); - const mac = createKeccakHash("keccak256").update(Buffer.concat([derivedKey.slice(16, 32), ciphertext])).digest(); + const mac = createKeccakHash("keccak256") + .update(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) + .digest(); return { crypto: { cipher: CIPHER, @@ -269,7 +278,9 @@ export default class Wallet { if (passphrase != null) { try { derivedKey = await scrypt(passphrase, salt.toBuffer(), kdfParams.dklen, { ...kdfParams, N: kdfParams.n }); - localMac = createKeccakHash("keccak256").update(Buffer.concat([derivedKey.slice(16, 32), ciphertext])).digest(); + localMac = createKeccakHash("keccak256") + .update(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) + .digest(); } catch { localMac = null; } @@ -360,7 +371,7 @@ export default class Wallet { this.lockTimers.delete(lowerAddress); this.unlockedAccounts.delete(lowerAddress); return true; - } + }; public lockAccount(lowerAddress: string) { if (!this.unlockedAccounts.has(lowerAddress)) return false; diff --git a/src/chains/ethereum/typedoc.json b/src/chains/ethereum/typedoc.json index 426b583eba..2b106fd177 100644 --- a/src/chains/ethereum/typedoc.json +++ b/src/chains/ethereum/typedoc.json @@ -7,10 +7,7 @@ "ignoreCompilerErrors": true, "preserveConstEnums": true, "excludeExternals": true, - "categoryOrder": [ - ], - "exclude": [ - "**/test/*" - ], + "categoryOrder": [], + "exclude": ["**/test/*"], "target": "ES6" } diff --git a/src/chains/tezos/__tests__/index.test.ts b/src/chains/tezos/__tests__/index.test.ts index 46b373c464..6ea406bc78 100644 --- a/src/chains/tezos/__tests__/index.test.ts +++ b/src/chains/tezos/__tests__/index.test.ts @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; -const tezos = require('..'); +const tezos = require(".."); -describe('@ganache/tezos', () => { - it('needs tests'); +describe("@ganache/tezos", () => { + it("needs tests"); }); diff --git a/src/chains/tezos/scripts/post-process-docs.js b/src/chains/tezos/scripts/post-process-docs.js index d755f158fe..ee20d63e8e 100644 --- a/src/chains/tezos/scripts/post-process-docs.js +++ b/src/chains/tezos/scripts/post-process-docs.js @@ -1,16 +1,21 @@ -const cheerio = require('cheerio'); +const cheerio = require("cheerio"); const { readFileSync, writeFileSync } = require("fs"); -const { randomBytes } = require('crypto'); +const { randomBytes } = require("crypto"); const $ = cheerio.load(readFileSync("./lib/docs/classes/_api_.tezosapi.html")); -$(`.tsd-page-title`).after(``) +$(`.tsd-page-title`).after(``); -$('.runkit-example').each(function() { - const sanitizedCode = $(this).text().replace(/;(\s+)/gi, ";\n").trim(); - $(this).text("") - const id = randomBytes(4).toString('hex'); - $(this).attr("id", id).html() - $(this).prepend(``) - }); +$(".runkit-example").each(function () { + const sanitizedCode = $(this) + .text() + .replace(/;(\s+)/gi, ";\n") + .trim(); + $(this).text(""); + const id = randomBytes(4).toString("hex"); + $(this).attr("id", id).html(); + $(this).prepend( + `` + ); +}); -writeFileSync("./lib/docs/classes/_api_.tezosapi.html", $.html()) +writeFileSync("./lib/docs/classes/_api_.tezosapi.html", $.html()); diff --git a/src/chains/tezos/src/api.ts b/src/chains/tezos/src/api.ts index af4f0bff58..9133b66e63 100644 --- a/src/chains/tezos/src/api.ts +++ b/src/chains/tezos/src/api.ts @@ -1,4 +1,4 @@ -import {types} from "@ganache/utils"; +import { types } from "@ganache/utils"; export default class TezosApi implements types.Api { readonly [index: string]: (...args: any) => Promise; diff --git a/src/chains/tezos/src/index.ts b/src/chains/tezos/src/index.ts index b395a66d35..2e56ae6710 100644 --- a/src/chains/tezos/src/index.ts +++ b/src/chains/tezos/src/index.ts @@ -1,5 +1,5 @@ import Emittery from "emittery"; -import {utils, types} from "@ganache/utils"; +import { utils, types } from "@ganache/utils"; import Provider from "./provider"; import TezosApi from "./api"; import { HttpRequest } from "uWebSockets.js"; @@ -7,7 +7,8 @@ import { HttpRequest } from "uWebSockets.js"; export type TezosProvider = Provider; export const TezosProvider = Provider; -export class TezosConnector extends Emittery.Typed +export class TezosConnector + extends Emittery.Typed implements types.Connector { provider: Provider; #api: TezosApi; @@ -29,14 +30,13 @@ export class TezosConnector extends Emittery.Typed parse(message: Buffer) { return JSON.parse(message); - }; + } - handle (payload: any, _connection: HttpRequest): Promise { + handle(payload: any, _connection: HttpRequest): Promise { return Promise.resolve(123); - }; + } close() { return {}; } } - diff --git a/src/chains/tezos/src/provider.ts b/src/chains/tezos/src/provider.ts index 25605f39ba..bb0c110513 100644 --- a/src/chains/tezos/src/provider.ts +++ b/src/chains/tezos/src/provider.ts @@ -1,14 +1,15 @@ -import {types} from "@ganache/utils"; +import { types } from "@ganache/utils"; import TezosApi from "./api"; import Emittery from "emittery"; -export default class TezosProvider extends Emittery.Typed<{request: types.RequestType}, "ready" | "close"> +export default class TezosProvider + extends Emittery.Typed<{ request: types.RequestType }, "ready" | "close"> implements types.Provider { constructor(providerOptions?: any) { super(); this.emit("ready"); } - public async close () { + public async close() { this.emit("close"); - }; + } } diff --git a/src/chains/tezos/typedoc.json b/src/chains/tezos/typedoc.json index c07aaf5144..e38eaed876 100644 --- a/src/chains/tezos/typedoc.json +++ b/src/chains/tezos/typedoc.json @@ -7,10 +7,7 @@ "ignoreCompilerErrors": true, "preserveConstEnums": true, "excludeExternals": true, - "categoryOrder": [ - ], - "exclude": [ - "**/test/*" - ], + "categoryOrder": [], + "exclude": ["**/test/*"], "target": "ES6" } diff --git a/src/packages/core/__tests__/connector.test.ts b/src/packages/core/__tests__/connector.test.ts index 8e082f327d..1b0e81e58a 100644 --- a/src/packages/core/__tests__/connector.test.ts +++ b/src/packages/core/__tests__/connector.test.ts @@ -8,8 +8,8 @@ describe("connector", () => { }); it("it logs when `options.verbose` is `true`", async () => { - const logger = {log: (_msg: string) => {}}; - const p = Ganache.provider({logging: {logger, verbose: true}}); + const logger = { log: (_msg: string) => {} }; + const p = Ganache.provider({ logging: { logger, verbose: true } }); logger.log = msg => { assert.strictEqual(msg, " > net_version: undefined", "doesn't work when no params"); @@ -40,7 +40,7 @@ describe("connector", () => { }); it("it processes requests syncronously when `asyncRequestProcessing` is `false`", async () => { - const p = Ganache.provider({chain:{asyncRequestProcessing: false}}); + const p = Ganache.provider({ chain: { asyncRequestProcessing: false } }); const accounts = await p.send("eth_accounts"); // eth_getBalance should return first even though eth_accounts is faster; // eth_getBalance should return before eth_accounts because of the @@ -78,11 +78,13 @@ describe("connector", () => { " ", "constructor" ] as const; - await Promise.all(illegalMethodNames.map(methodName => { - assert.rejects(() => p.send(methodName as any), { - message: `The method ${methodName} does not exist/is not available` - }); - })); + await Promise.all( + illegalMethodNames.map(methodName => { + assert.rejects(() => p.send(methodName as any), { + message: `The method ${methodName} does not exist/is not available` + }); + }) + ); // make sure we reject non-strings over the classical send interface const circular: any = {}; @@ -95,7 +97,7 @@ describe("connector", () => { void 0, {}, [], - {foo: "bar"}, + { foo: "bar" }, [1, 2], new Date(), Infinity, diff --git a/src/packages/core/__tests__/helpers/getProvider.ts b/src/packages/core/__tests__/helpers/getProvider.ts index 4b8895d7c9..ca4814a987 100644 --- a/src/packages/core/__tests__/helpers/getProvider.ts +++ b/src/packages/core/__tests__/helpers/getProvider.ts @@ -1,9 +1,9 @@ import Ganache from "../../src/"; -import {ProviderOptions} from "@ganache/options"; -import {EthereumProvider} from "@ganache/ethereum"; +import { ProviderOptions } from "@ganache/options"; +import { EthereumProvider } from "@ganache/ethereum"; const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; -const getProvider = (options: ProviderOptions = {flavor: "ethereum", mnemonic}) => { +const getProvider = (options: ProviderOptions = { flavor: "ethereum", mnemonic }) => { return Ganache.provider(options) as EthereumProvider; }; diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/__tests__/server.test.ts index 67da49e62e..b637e594ea 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -2,12 +2,12 @@ import Ganache from "../src"; import * as assert from "assert"; import request from "superagent"; import WebSocket from "ws"; -import Server, {Status} from "../src/server"; +import Server, { Status } from "../src/server"; import http from "http"; // https://github.com/sindresorhus/into-stream/releases/tag/v6.0.0 import intoStream = require("into-stream"); import { PromiEvent } from "@ganache/utils"; -import {promisify} from "util"; +import { promisify } from "util"; import { ServerOptions } from "../src/options"; const IS_WINDOWS = process.platform === "win32"; @@ -93,7 +93,7 @@ describe("server", () => { it("returns the net_version over a legacy-style connection listener", done => { s = Ganache.server({ - chain: {networkId} + chain: { networkId } }); s.listen(port, async () => { try { @@ -246,9 +246,11 @@ describe("server", () => { }); it("does not start a websocket server when `ws` is false", async () => { - await setup({server:{ - ws: false - }}); + await setup({ + server: { + ws: false + } + }); try { const ws = new WebSocket("ws://localhost:" + port); @@ -296,7 +298,6 @@ describe("server", () => { } }); - it("returns 200/OK for RPC errors over HTTP", async () => { await setup(); const jsonRpcJson: any = { @@ -316,22 +317,26 @@ describe("server", () => { it("handles batched json-rpc requests/responses", async () => { await setup(); - const jsonRpcJson: any = [{ - jsonrpc: "2.0", - id: "1", - method: "net_version", - params: [] - }, { - jsonrpc: "2.0", - id: "2", - method: "eth_chainId", - params: [] - }, { - jsonrpc: "2.0", - id: "3", - method: "eth_subscribe", // this one fails over HTTP - params: ["newHeads"] - }]; + const jsonRpcJson: any = [ + { + jsonrpc: "2.0", + id: "1", + method: "net_version", + params: [] + }, + { + jsonrpc: "2.0", + id: "2", + method: "eth_chainId", + params: [] + }, + { + jsonrpc: "2.0", + id: "3", + method: "eth_subscribe", // this one fails over HTTP + params: ["newHeads"] + } + ]; try { const response = await request.post("http://localhost:" + port).send(jsonRpcJson); const json = JSON.parse(response.text); @@ -367,16 +372,7 @@ describe("server", () => { it("returns 404 for bad routes", async () => { await setup(); - const methods = [ - "get", - "post", - "head", - "options", - "put", - "delete", - "patch", - "trace" - ] as const; + const methods = ["get", "post", "head", "options", "put", "delete", "patch", "trace"] as const; try { const requests = methods.map(async method => { const result = await request[method]("http://localhost:" + port + "/there-is-no-spoon").catch((e: any) => e); @@ -406,7 +402,7 @@ describe("server", () => { setImmediate(setImmediate, () => { // resolve the `provider.send` to make sure the server can // handle _not_ responding to a request that has been aborted: - innerResolve( {value: Promise.resolve() as any}); + innerResolve({ value: Promise.resolve() as any }); // and finally, resolve the `abort` promise: resolve(void 0); }); @@ -443,7 +439,11 @@ describe("server", () => { }); describe("CORS", () => { - const optionsHeaders = ["Access-Control-Allow-Methods", "Access-Control-Allow-Headers", "Access-Control-Max-Age"] as const; + const optionsHeaders = [ + "Access-Control-Allow-Methods", + "Access-Control-Allow-Headers", + "Access-Control-Max-Age" + ] as const; const baseHeaders = ["Access-Control-Allow-Credentials", "Access-Control-Allow-Origin"] as const; const allCorsHeaders = [...optionsHeaders, ...baseHeaders] as const; @@ -583,7 +583,7 @@ describe("server", () => { provider.requestRaw = (async () => { // close our websocket after intercepting the request await s.close(); - return {value: Promise.resolve(void 0)}; + return { value: Promise.resolve(void 0) }; }) as any; const ws = new WebSocket("ws://localhost:" + port); @@ -613,16 +613,20 @@ describe("server", () => { const promiEvent = new PromiEvent(resolve => { const subId = "0xsubscriptionId"; resolve(subId); - setImmediate(() => promiEvent.emit("message", {data: {subscription: subId, result: message}})); + setImmediate(() => + promiEvent.emit("message", { + data: { subscription: subId, result: message } + }) + ); }); - return {value: promiEvent}; + return { value: promiEvent }; }) as any; const ws = new WebSocket("ws://localhost:" + port); const result = await new Promise(resolve => { ws.on("open", () => { ws.on("message", data => { - const {result, params} = JSON.parse(data.toString()); + const { result, params } = JSON.parse(data.toString()); // ignore the initial response if (result === "0xsubscriptionId") return; @@ -645,22 +649,26 @@ describe("server", () => { }); it("handles batched json-rpc requests/responses", async () => { - const jsonRpcJson: any = [{ - jsonrpc: "2.0", - id: "1", - method: "net_version", - params: [] - }, { - jsonrpc: "2.0", - id: "2", - method: "eth_chainId", - params: [] - }, { - jsonrpc: "2.0", - id: "3", - method: "eth_subscribe", // this one works here in WS-land - params: ["newHeads"] - }]; + const jsonRpcJson: any = [ + { + jsonrpc: "2.0", + id: "1", + method: "net_version", + params: [] + }, + { + jsonrpc: "2.0", + id: "2", + method: "eth_chainId", + params: [] + }, + { + jsonrpc: "2.0", + id: "3", + method: "eth_subscribe", // this one works here in WS-land + params: ["newHeads"] + } + ]; const ws = new WebSocket("ws://localhost:" + port); const response: any = await new Promise(resolve => { @@ -677,11 +685,13 @@ describe("server", () => { jsonrpc: "2.0", id: "1", result: "1234" - }, { + }, + { jsonrpc: "2.0", id: "2", result: "0x539" - }, { + }, + { jsonrpc: "2.0", id: "3", result: "0x1" @@ -695,7 +705,7 @@ describe("server", () => { ws.on("open", () => { ws.send(JSON.stringify(null)); }); - ws.on("message", (data) => { + ws.on("message", data => { resolve(JSON.parse(data.toString())); }); }); @@ -709,7 +719,7 @@ describe("server", () => { promiEvent = new PromiEvent(resolve => { resolve("0xsubscriptionId"); }); - return {value: promiEvent}; + return { value: promiEvent }; }) as any; const ws = new WebSocket("ws://localhost:" + port); @@ -750,9 +760,9 @@ describe("server", () => { { // create tons of data to force websocket backpressure const huge = {}; - for (let i = 0; i < 1e6; i++) huge["prop_" + i] = {i}; + for (let i = 0; i < 1e6; i++) huge["prop_" + i] = { i }; s.provider.requestRaw = (async () => { - return {value: Promise.resolve(huge)}; + return { value: Promise.resolve(huge) }; }) as any; } diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index 86641ce756..1f0bf91a99 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -1,14 +1,19 @@ -import {utils} from "@ganache/utils"; -import {ConnectorsByName, DefaultFlavor} from "@ganache/flavors"; -import {Options as ProviderOptions} from "@ganache/flavors"; +import { utils } from "@ganache/utils"; +import { ConnectorsByName, DefaultFlavor } from "@ganache/flavors"; +import { Options as ProviderOptions } from "@ganache/flavors"; /** * Loads the connector specified by the given `flavor` */ export default { - initialize: (providerOptions: ProviderOptions = {flavor: DefaultFlavor, chain: {asyncRequestProcessing: true}}) => { + initialize: ( + providerOptions: ProviderOptions = { + flavor: DefaultFlavor, + chain: { asyncRequestProcessing: true } + } + ) => { const flavor = providerOptions.flavor || DefaultFlavor; - + // Set up our request coordinator to either use FIFO or or async request processing. // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it // for that (yet), instead of "all" (0) or just 1 as we are doing here: @@ -17,7 +22,7 @@ export default { providerOptions.chain.asyncRequestProcessing = true; } const requestCoordinator = new utils.RequestCoordinator(providerOptions.chain.asyncRequestProcessing ? 0 : 1); - + // The Executor is responsible for actually executing the method on the chain/API. // It performs some safety checks to ensure "safe" method execution before passing it // to a RequestCoordinator. diff --git a/src/packages/core/src/index.ts b/src/packages/core/src/index.ts index 8193d0afc7..b812252b10 100644 --- a/src/packages/core/src/index.ts +++ b/src/packages/core/src/index.ts @@ -1,5 +1,5 @@ import Connector from "./connector"; -import {ProviderOptions, ServerOptions} from "./options"; +import { ProviderOptions, ServerOptions } from "./options"; import Server from "./server"; export default { diff --git a/src/packages/core/src/options/index.ts b/src/packages/core/src/options/index.ts index 665e912ea1..7fdd0b840d 100644 --- a/src/packages/core/src/options/index.ts +++ b/src/packages/core/src/options/index.ts @@ -1,6 +1,6 @@ -import {Options as FlavorOptions} from "@ganache/flavors"; +import { Options as FlavorOptions } from "@ganache/flavors"; import { ServerConfig, ServerOptions } from "./server-options"; -import { Defaults, Definitions, ExternalConfig, InternalConfig, OptionsConfig } from "@ganache/options"; +import { Defaults, Definitions, ExternalConfig, InternalConfig, OptionsConfig } from "@ganache/options"; export type ProviderOptions = FlavorOptions; @@ -8,13 +8,16 @@ export type Options = { server: ServerConfig; }; -export type ServerOptions = Partial<{ - [K in keyof Options]: ExternalConfig; -}> & ProviderOptions; +export type ServerOptions = Partial< + { + [K in keyof Options]: ExternalConfig; + } +> & + ProviderOptions; export type InternalOptions = { [K in keyof Options]: InternalConfig; -} +}; export type ServerDefaults = { [K in keyof Options]: Definitions; diff --git a/src/packages/core/src/options/server-options.ts b/src/packages/core/src/options/server-options.ts index f03f0788a6..27c8358045 100644 --- a/src/packages/core/src/options/server-options.ts +++ b/src/packages/core/src/options/server-options.ts @@ -1,4 +1,4 @@ -import { Definitions} from "@ganache/options"; +import { Definitions } from "@ganache/options"; export type ServerConfig = { options: { @@ -8,7 +8,7 @@ export type ServerConfig = { readonly port: { type: number; hasDefault: true; - }, + }; /** * Enable a websocket server. This is `true` by default. @@ -16,21 +16,21 @@ export type ServerConfig = { readonly ws: { type: boolean; hasDefault: true; - }, + }; /** * Wether or not websockets should response with binary data (ArrayBuffers) or * strings. - * + * * Default is "auto", which responds using the same format as the incoming * message that triggered the response. */ readonly wsBinary: { type: boolean | "auto"; hasDefault: true; - } - }, - exclusiveGroups: [] + }; + }; + exclusiveGroups: []; }; export const ServerOptions: Definitions = { @@ -46,4 +46,4 @@ export const ServerOptions: Definitions = { normalize: rawInput => rawInput, default: () => "auto" } -} +}; diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index b8bcaf55f9..b102e69a90 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -1,18 +1,18 @@ -import {InternalOptions, ServerOptions, serverOptionsConfig} from "./options"; +import { InternalOptions, ServerOptions, serverOptionsConfig } from "./options"; -import uWS, {TemplatedApp, us_listen_socket} from "uWebSockets.js"; -import {Connectors} from "@ganache/flavors"; +import uWS, { TemplatedApp, us_listen_socket } from "uWebSockets.js"; +import { Connectors } from "@ganache/flavors"; import Connector from "./connector"; import WebsocketServer, { WebSocketCapableFlavor } from "./servers/ws-server"; import HttpServer from "./servers/http-server"; type Providers = Connectors["provider"]; -type Callback = (err: Error | null) => void +type Callback = (err: Error | null) => void; /** * Server ready state constants. - * + * * These are bit flags. This means that you can check if the status is: * * open: `status === Status.open` * * opening: `status === Status.opening` @@ -57,7 +57,7 @@ export default class Server { return this.#status; } - constructor(serverOptions: ServerOptions = {flavor: "ethereum"}) { + constructor(serverOptions: ServerOptions = { flavor: "ethereum" }) { const opts = (this.#options = serverOptionsConfig.normalize(serverOptions)); const connector = (this.#connector = Connector.initialize(serverOptions)); diff --git a/src/packages/core/src/servers/http-server.ts b/src/packages/core/src/servers/http-server.ts index a4e17defde..d48a3b4210 100644 --- a/src/packages/core/src/servers/http-server.ts +++ b/src/packages/core/src/servers/http-server.ts @@ -1,7 +1,7 @@ -import {TemplatedApp, HttpResponse, HttpRequest, RecognizedString} from "uWebSockets.js"; +import { TemplatedApp, HttpResponse, HttpRequest, RecognizedString } from "uWebSockets.js"; import ContentTypes from "./utils/content-types"; import HttpResponseCodes from "./utils/http-response-codes"; -import {Connectors} from "@ganache/flavors"; +import { Connectors } from "@ganache/flavors"; type HttpMethods = "GET" | "OPTIONS" | "POST"; @@ -137,7 +137,7 @@ export default class HttpServer { connector .handle(payload, request) - .then(({value}) => value) + .then(({ value }) => value) .then(result => { if (aborted) { // if the request has been aborted don't try sending (it'll @@ -146,20 +146,15 @@ export default class HttpServer { } const data = connector.format(result, payload); sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); - }).catch(error => { + }) + .catch(error => { if (aborted) { // if the request has been aborted don't try sending (it'll // cause an `Unhandled promise rejection` if we try) return; } const data = connector.formatError(error, payload); - sendResponse( - response, - HttpResponseCodes.OK, - ContentTypes.JSON, - data, - writeHeaders - ); + sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); }); } else { if (buffer) { diff --git a/src/packages/core/src/servers/utils/websocket-close-codes.ts b/src/packages/core/src/servers/utils/websocket-close-codes.ts index 0aff503256..f4fac84005 100644 --- a/src/packages/core/src/servers/utils/websocket-close-codes.ts +++ b/src/packages/core/src/servers/utils/websocket-close-codes.ts @@ -4,7 +4,7 @@ enum WebSocketCloseCodes { * Indicates that an endpoint is "going away", such as a server going down or * a browser having navigated away from a page. */ - CLOSE_GOING_AWAY = 1001, + CLOSE_GOING_AWAY = 1001 // CLOSE_PROTOCOL_ERROR = 1002, // CLOSE_ABNORMAL = 1006 } diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index d7bc4353c7..1fe2fdfc7b 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -1,4 +1,4 @@ -import uWS, {TemplatedApp, WebSocket} from "uWebSockets.js"; +import uWS, { TemplatedApp, WebSocket } from "uWebSockets.js"; import WebSocketCloseCodes from "./utils/websocket-close-codes"; import { ServerOptions } from "../options"; import * as Flavors from "@ganache/flavors"; @@ -6,25 +6,24 @@ import { PromiEvent } from "@ganache/utils"; type MergePromiseT = Promise ? X : never>; -type HandlesWebSocketSignature= ((payload: any, connection: WebSocket) => any); +type HandlesWebSocketSignature = (payload: any, connection: WebSocket) => any; type WebSocketCapableFlavorMap = { - [k in keyof Flavors.ConnectorsByName]: - Flavors.ConnectorsByName[k]["handle"] extends HandlesWebSocketSignature - ? Flavors.ConnectorsByName[k] - : never; + [k in keyof Flavors.ConnectorsByName]: Flavors.ConnectorsByName[k]["handle"] extends HandlesWebSocketSignature + ? Flavors.ConnectorsByName[k] + : never; }; export type WebSocketCapableFlavor = { [k in keyof WebSocketCapableFlavorMap]: WebSocketCapableFlavorMap[k]; }[keyof WebSocketCapableFlavorMap]; -export type GanacheWebSocket = WebSocket & {closed?: boolean}; +export type GanacheWebSocket = WebSocket & { closed?: boolean }; -export type WebsocketServerOptions = Pick +export type WebsocketServerOptions = Pick; export default class WebsocketServer { - #connections = new Map void>>(); + #connections = new Map void>>(); constructor(app: TemplatedApp, connector: WebSocketCapableFlavor, options: WebsocketServerOptions) { const connections = this.#connections; const wsBinary = options.wsBinary; @@ -53,10 +52,10 @@ export default class WebsocketServer { } let response: uWS.RecognizedString; - + try { - const {value} = await connector.handle(payload, ws); - + const { value } = await connector.handle(payload, ws); + // The socket may have closed while we were waiting for the response // Don't bother trying to send to it if it was. if (ws.closed) return; @@ -66,20 +65,24 @@ export default class WebsocketServer { if (ws.closed) return; response = connector.format(result, payload); - + // if the result is an emitter listen to its `"message"` event if (resultEmitter instanceof PromiEvent) { resultEmitter.on("message", (result: any) => { // note: we _don't_ need to check if `ws.closed` here because when // `ws.closed` is set we remove this event handler anyway. - const message = JSON.stringify({jsonrpc: "2.0", method: result.type, params: result.data}); + const message = JSON.stringify({ + jsonrpc: "2.0", + method: result.type, + params: result.data + }); ws.send(message, isBinary, true); }); // keep track of listeners to dispose off when the ws disconnects connections.get(ws).add(resultEmitter.dispose); } - } catch(err) { + } catch (err) { // ensure the connector's `handle` fn doesn't throw outside of a Promise if (ws.closed) return; diff --git a/src/packages/core/tsconfig.json b/src/packages/core/tsconfig.json index 09ab4f3659..62676b00a1 100644 --- a/src/packages/core/tsconfig.json +++ b/src/packages/core/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"], + "include": ["src"] } diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts index 261f038d49..7f52f25426 100644 --- a/src/packages/flavors/src/index.ts +++ b/src/packages/flavors/src/index.ts @@ -4,20 +4,22 @@ import * as Ethereum from "@ganache/ethereum"; export const DefaultFlavor = Ethereum.FlavorName; export type ConnectorsByName = { - [Ethereum.FlavorName]: Ethereum.Connector, + [Ethereum.FlavorName]: Ethereum.Connector; // [Tezos.FlavorName]: Tezos.Connector -} +}; export const ConnectorsByName = { - [Ethereum.FlavorName]: Ethereum.Connector, + [Ethereum.FlavorName]: Ethereum.Connector // [Tezos.FlavorName]: Tezos.Connector -} +}; -export type Connectors = {[K in keyof ConnectorsByName]: ConnectorsByName[K]}[keyof ConnectorsByName] +export type Connectors = { + [K in keyof ConnectorsByName]: ConnectorsByName[K]; +}[keyof ConnectorsByName]; -export type Options = ( - ({flavor?: typeof Ethereum.FlavorName} & Ethereum.ProviderOptions) - // | [Tezos.FlavorName]: Tezos.ProviderOptions; -); +export type Options = { + flavor?: typeof Ethereum.FlavorName; +} & Ethereum.ProviderOptions; +// | [Tezos.FlavorName]: Tezos.ProviderOptions; // export type Apis = T extends types.Connector ? R : never; diff --git a/src/packages/options/src/helpers/base.ts b/src/packages/options/src/helpers/base.ts index 790946fcce..01d1c11dd5 100644 --- a/src/packages/options/src/helpers/base.ts +++ b/src/packages/options/src/helpers/base.ts @@ -3,7 +3,7 @@ export namespace Base { rawType?: any; type: any; hasDefault?: true; - } + }; export type ExclusiveGroupOptionName = string; export type ExclusiveGroup = ExclusiveGroupOptionName[]; @@ -14,5 +14,5 @@ export namespace Base { }; exclusiveGroups: ExclusiveGroup[]; - } + }; } diff --git a/src/packages/options/src/helpers/create.ts b/src/packages/options/src/helpers/create.ts index 4d3d7e37bd..60c94a3421 100644 --- a/src/packages/options/src/helpers/create.ts +++ b/src/packages/options/src/helpers/create.ts @@ -6,23 +6,25 @@ import { utils } from "@ganache/utils"; const hasOwn = utils.hasOwn; -export type Options = {[key: string] : Base.Config}; +export type Options = { [key: string]: Base.Config }; -export type ProviderOptions = Partial<{ - [K in keyof O]: ExternalConfig; -}> +export type ProviderOptions = Partial< + { + [K in keyof O]: ExternalConfig; + } +>; export type InternalOptions = { [K in keyof O]: InternalConfig; -} +}; export type Defaults = { [K in keyof O]: Definitions; -} +}; function fill(defaults: any, options: any, target: any, namespace: any) { const def = defaults[namespace]; - const config = target[namespace] = target[namespace] || {}; + const config = (target[namespace] = target[namespace] || {}); if (hasOwn(options, namespace)) { const userOpts = options[namespace]; @@ -59,7 +61,7 @@ function fill(defaults: any, options: any, target: any, namespace: any) { } export class OptionsConfig { - #defaults: Defaults + #defaults: Defaults; #namespaces: UnionToTuple>; constructor(defaults: Defaults) { diff --git a/src/packages/options/src/helpers/definition.ts b/src/packages/options/src/helpers/definition.ts index ce127d4d73..2f1e0fb6a8 100644 --- a/src/packages/options/src/helpers/definition.ts +++ b/src/packages/options/src/helpers/definition.ts @@ -1,29 +1,20 @@ -import {Base} from "./base"; +import { Base } from "./base"; import { ExclusiveGroupUnionAndUnconstrainedPlus } from "./exclusive"; import { OptionHasDefault, OptionName, OptionRawType, OptionType } from "./getters"; //#region Definition helpers -type Normalize< - C extends Base.Config, - N extends OptionName = OptionName -> = (rawInput: OptionRawType) => OptionType; +type Normalize = OptionName> = ( + rawInput: OptionRawType +) => OptionType; -export type ExternalConfig< - C extends Base.Config, -> = Partial>; +export type ExternalConfig = Partial>; -export type InternalConfig< - C extends Base.Config, -> = ExclusiveGroupUnionAndUnconstrainedPlus; +export type InternalConfig = ExclusiveGroupUnionAndUnconstrainedPlus; export type Definitions = { [N in OptionName]: { normalize: Normalize; legacyName?: string; - } & ( - void extends OptionHasDefault - ? {} - : { default: (config: InternalConfig) => OptionType } - ); -} -//#endregion Definition helpers \ No newline at end of file + } & (void extends OptionHasDefault ? {} : { default: (config: InternalConfig) => OptionType }); +}; +//#endregion Definition helpers diff --git a/src/packages/options/src/helpers/exclusive.ts b/src/packages/options/src/helpers/exclusive.ts index 938621b3bd..3dc5fb5fa1 100644 --- a/src/packages/options/src/helpers/exclusive.ts +++ b/src/packages/options/src/helpers/exclusive.ts @@ -1,160 +1,160 @@ -import {Base} from "./base"; -import {OptionName, Option, ExclusiveGroupIndex, ExclusiveGroups, Options, OptionType, OptionRawType} from "./getters"; - +import { Base } from "./base"; +import { + OptionName, + Option, + ExclusiveGroupIndex, + ExclusiveGroups, + Options, + OptionType, + OptionRawType +} from "./getters"; //#region options not part of exclusive groups type UnconstrainedOptions = Omit, ExclusiveGroupOptionName>; type UnconstrainedOptionName = string & keyof UnconstrainedOptions; -type UnconstrainedOptionsByType = - {[N in UnconstrainedOptionName]: T extends "type" ? OptionType : OptionRawType}; +type UnconstrainedOptionsByType = { + [N in UnconstrainedOptionName]: T extends "type" ? OptionType : OptionRawType; +}; //#endregion options not part of exclusive groups - //#region exclusive group options helpers -type ExclusiveGroupOptionPairs< +type ExclusiveGroupOptionPairs = G extends [] + ? [] + : G extends [infer N, ...infer R] + ? [[N, ExclusiveGroupOptionNameOption], ...ExclusiveGroupOptionPairs] + : never; + +type ExclusiveGroupOptionNameOption = N extends OptionName ? Option : never; +type PairsToMapping = T extends [] + ? {} + : T extends [[infer N, infer O], ...infer R] + ? { + [N_ in string & N]: O; + } & + PairsToMapping + : never; + +type RequireOnly = Pick & Partial>; + +type ExclusiveGroupOptionalUnionByName< C extends Base.Config, - G extends unknown[] -> = - G extends [] - ? [] - : G extends [infer N, ...infer R] - ? [ - [N, ExclusiveGroupOptionNameOption], - ...ExclusiveGroupOptionPairs - ] - : never; - -type ExclusiveGroupOptionNameOption< - C extends Base.Config, - N -> = - N extends OptionName - ? Option + GRP extends ExclusiveGroup, + M extends OptionName, + T extends "rawType" | "type" +> = { + [K in keyof RequireOnly, M>]: K extends M + ? T extends "type" + ? OptionType + : OptionRawType : never; -type PairsToMapping = - T extends [] - ? {} - : T extends [[infer N, infer O], ...infer R] - ? { - [N_ in string & N]: O; - } & PairsToMapping - : never; - -type RequireOnly = Pick & Partial> - -type ExclusiveGroupOptionalUnionByName, M extends OptionName, T extends "rawType" | "type"> = -{ - [K in keyof RequireOnly, M>] : - K extends M - ? T extends "type" - ? OptionType - : OptionRawType - : never -} +}; type Combine, T extends "rawType" | "type"> = { - [N in keyof GRP]: - GRP[N] extends OptionName - ? { - [ - Key in keyof ( - & ExclusiveGroupOptionalUnionByName - & UnconstrainedOptionsByType - & O - ) - ]: Key extends keyof ExclusiveGroupOptionalUnionByName - ? ExclusiveGroupOptionalUnionByName[Key] - : Key extends keyof UnconstrainedOptionsByType - ? UnconstrainedOptionsByType[Key] - : Key extends keyof O - ? O[Key] - : never; - - } - : never; - } extends {[n:number]: infer I} ? I : never; + [N in keyof GRP]: GRP[N] extends OptionName + ? { + [Key in keyof (ExclusiveGroupOptionalUnionByName & + UnconstrainedOptionsByType & + O)]: Key extends keyof ExclusiveGroupOptionalUnionByName + ? ExclusiveGroupOptionalUnionByName[Key] + : Key extends keyof UnconstrainedOptionsByType + ? UnconstrainedOptionsByType[Key] + : Key extends keyof O + ? O[Key] + : never; + } + : never; +} extends { [n: number]: infer I } + ? I + : never; type IsNeverType = [T] extends [never] ? true : never; -export type ExclusiveGroupUnionAndUnconstrainedPlus = ExclusiveGroups, O extends unknown[] = []> = ( - GRPS extends [infer GRP, ...infer Rest] - ? GRP extends ExclusiveGroup - ? Rest extends any[] - ? O extends [] - // first time through - ? ExclusiveGroupUnionAndUnconstrainedPlus>> - // recurse - : ExclusiveGroupUnionAndUnconstrainedPlus makes it include only the indexes, but - // TypeScript will treat it as an object now, so we `UnionToTuple` - // to turn it back into a Tuple - [OK in keyof Omit]: Combine - } extends {[n:number]: infer I} ? I : never>> - : never - : never - : O extends {[n:number]: infer I} - // if there are no exclusiveGroups `I` is `never` so we return `C` - // directly - ? true extends IsNeverType - ? {[Key in keyof UnconstrainedOptionsByType]: UnconstrainedOptionsByType[Key]} - : I +export type ExclusiveGroupUnionAndUnconstrainedPlus< + C extends Base.Config, + T extends "rawType" | "type", + GRPS extends ExclusiveGroups = ExclusiveGroups, + O extends unknown[] = [] +> = GRPS extends [infer GRP, ...infer Rest] + ? GRP extends ExclusiveGroup + ? Rest extends any[] + ? O extends [] + ? // first time through + ExclusiveGroupUnionAndUnconstrainedPlus>> + : // recurse + ExclusiveGroupUnionAndUnconstrainedPlus< + C, + T, + Rest, + UnionToTuple< + { + // iterate over each object in the O tuple. + // Omit makes it include only the indexes, but + // TypeScript will treat it as an object now, so we `UnionToTuple` + // to turn it back into a Tuple + [OK in keyof Omit]: Combine; + } extends { [n: number]: infer I } + ? I + : never + > + > : never -) + : never + : O extends { [n: number]: infer I } + ? // if there are no exclusiveGroups `I` is `never` so we return `C` + // directly + true extends IsNeverType + ? { + [Key in keyof UnconstrainedOptionsByType]: UnconstrainedOptionsByType[Key]; + } + : I + : never; //#region UnionToTuple -type TuplePrepend = -[NewElement, ...Tuple] +type TuplePrepend = [NewElement, ...Tuple]; type Consumer = (value: Value) => void; -type IntersectionFromUnion = -(Union extends unknown ? Consumer : never) extends (Consumer) -? ResultIntersection -: never; +type IntersectionFromUnion = (Union extends unknown ? Consumer : never) extends Consumer< + infer ResultIntersection +> + ? ResultIntersection + : never; type OverloadedConsumerFromUnion = IntersectionFromUnion : never>; -type UnionLast = OverloadedConsumerFromUnion extends ((a: infer A) => void) ? A : never; +type UnionLast = OverloadedConsumerFromUnion extends (a: infer A) => void ? A : never; type UnionExcludingLast = Exclude>; -type TupleFromUnionRec = -[RemainingUnion] extends [never] -? CurrentTuple -: TupleFromUnionRec, TuplePrepend>>; +type TupleFromUnionRec = [RemainingUnion] extends [never] + ? CurrentTuple + : TupleFromUnionRec, TuplePrepend>>; export type UnionToTuple = TupleFromUnionRec; //#endregion //#endregion exclusive group options helpers - - //#region exclusive groups -type ExclusiveGroup< - C extends Base.Config, - K extends ExclusiveGroupIndex = ExclusiveGroupIndex -> = ExclusiveGroups[K]; +type ExclusiveGroup = ExclusiveGroupIndex> = ExclusiveGroups< + C +>[K]; type ExclusiveGroupOptionName< C extends Base.Config, K extends ExclusiveGroupIndex = ExclusiveGroupIndex > = Extract, DeepTupleToUnion>>; -type DeepTupleToUnion = - T extends [] // empty tuple case (base case) - ? never - : T extends [infer N, ...infer R] // inductive case - ? N extends unknown[] - ? DeepTupleToUnion | DeepTupleToUnion - : N | DeepTupleToUnion - : never; // we should never hit this case +type DeepTupleToUnion = T extends [] // empty tuple case (base case) + ? never + : T extends [infer N, ...infer R] // inductive case + ? N extends unknown[] + ? DeepTupleToUnion | DeepTupleToUnion + : N | DeepTupleToUnion + : never; // we should never hit this case //#endregion exclusive groups - //#region options separated by exclusive group -type ExclusiveGroupOptionsByGroup< - C extends Base.Config, - G extends ExclusiveGroup -> = PairsToMapping>; +type ExclusiveGroupOptionsByGroup> = PairsToMapping< + ExclusiveGroupOptionPairs +>; //#endregion diff --git a/src/packages/options/src/helpers/getters.ts b/src/packages/options/src/helpers/getters.ts index 7bc574075b..067d61d1c5 100644 --- a/src/packages/options/src/helpers/getters.ts +++ b/src/packages/options/src/helpers/getters.ts @@ -1,38 +1,31 @@ -import {Base} from "./base"; +import { Base } from "./base"; //#region getters for buckets export type Options = C["options"]; export type ExclusiveGroups = C["exclusiveGroups"]; //#endregion - //#region getters for keys export type OptionName = string & keyof Options; export type ExclusiveGroupIndex = number & keyof ExclusiveGroups; //#endregion - //#region getters for individual things -export type Option< - C extends Base.Config, - N extends OptionName = OptionName -> = Options[N]; +export type Option = OptionName> = Options[N]; //#endregion - //#region getters for option -export type OptionRawType< - C extends Base.Config, - N extends OptionName = OptionName -> = void extends Option["rawType"] ? Option["type"] : Option["rawType"]; - -export type OptionType< - C extends Base.Config, - N extends OptionName = OptionName -> = Option["type"]; - -export type OptionHasDefault< - C extends Base.Config, - N extends OptionName = OptionName -> = Option["hasDefault"]; +export type OptionRawType = OptionName> = void extends Option< + C, + N +>["rawType"] + ? Option["type"] + : Option["rawType"]; + +export type OptionType = OptionName> = Option["type"]; + +export type OptionHasDefault = OptionName> = Option< + C, + N +>["hasDefault"]; //#endregion getters for option diff --git a/src/packages/options/src/helpers/index.ts b/src/packages/options/src/helpers/index.ts index f97c0bf5d4..8b1d1d6c91 100644 --- a/src/packages/options/src/helpers/index.ts +++ b/src/packages/options/src/helpers/index.ts @@ -1,4 +1,4 @@ export * from "./base"; export * from "./exclusive"; export * from "./definition"; -export * from "./create"; \ No newline at end of file +export * from "./create"; diff --git a/src/packages/promise-queue/src/entry.ts b/src/packages/promise-queue/src/entry.ts index cd7a717c7e..74dadbe098 100644 --- a/src/packages/promise-queue/src/entry.ts +++ b/src/packages/promise-queue/src/entry.ts @@ -3,20 +3,16 @@ export default class Entry { public resolve: (value: T | PromiseLike) => void; public value: T | Promise; - public queue: Entry[] + public queue: Entry[]; public resolved = false; public onSetteled: (queue: Entry[], entry: Entry) => void; - constructor( - promise: Promise, - queue: Entry[], - onSetteled: (queue: Entry[], entry: Entry) => void - ) { + constructor(promise: Promise, queue: Entry[], onSetteled: (queue: Entry[], entry: Entry) => void) { this.value = promise; this.queue = queue; this.onSetteled = onSetteled; - const _onSetteled = () => this.onSetteled(this.queue, this) + const _onSetteled = () => this.onSetteled(this.queue, this); promise.then(_onSetteled, _onSetteled); this.promise = new Promise(resolve => { this.resolve = resolve; diff --git a/src/packages/promise-queue/src/index.ts b/src/packages/promise-queue/src/index.ts index 2496c6cfa9..499e869e14 100644 --- a/src/packages/promise-queue/src/index.ts +++ b/src/packages/promise-queue/src/index.ts @@ -6,38 +6,37 @@ const emitteryMethods = ["emit", "once"] as const; /** * Creates a FIFO queue to that ensures promises are _resolved_ in the order * they were added. - * + * * This is different than a FIFO queue that _executes_ functions that * return promises; this queue is for the promises themselves. - * + * * @example * const queue = new PromiseQueue(); - * + * * const slow = new Promise(resolve => setTimeout(resolve, 1000, "slow")); * const fast = Promise.resolve("fast"); - * + * * await Promise.race([ * queue.add(slow), * queue.add(fast) * ]); // returns "slow" - * + * * Additionally, the queued promise chain can be cleared via `queue.clear(value)`. * This will cause the chain of promises to all resolve immediately with the * given value. * - * + * * * note: whatever the promise starting doing when it was created will still * happen, no promises are aborted; rather, the return value is ignored. */ @Emittery.mixin(Symbol.for("emittery"), emitteryMethods) class PromiseQueue { - /** * Returns true if there are promises pending in the queue */ - public isBusy(){ + public isBusy() { return this.#queue.length !== 0; } - + // TODO(perf): a singly linked list is probably a better option here readonly #queue: Entry[] = []; @@ -52,7 +51,7 @@ class PromiseQueue { } else { entry.resolved = true; } - } + }; /** * Adds the promise to the end of the queue. @@ -96,11 +95,11 @@ class PromiseQueue { if (queue.length === 0) { this.emit("idle"); } - } + }; } interface PromiseQueue extends Pick { - emittery: Emittery + emittery: Emittery; } export default PromiseQueue; diff --git a/src/packages/utils/__tests__/utils.test.ts b/src/packages/utils/__tests__/utils.test.ts index 8eac9026b5..b56cab343c 100644 --- a/src/packages/utils/__tests__/utils.test.ts +++ b/src/packages/utils/__tests__/utils.test.ts @@ -1,7 +1,7 @@ -'use strict'; +"use strict"; -const utils = require('..'); +const utils = require(".."); -describe('@ganache/utils', () => { - it('needs tests'); +describe("@ganache/utils", () => { + it("needs tests"); }); diff --git a/src/packages/utils/src/things/json-rpc/index.ts b/src/packages/utils/src/things/json-rpc/index.ts index 10d266c132..d7dd7bea53 100644 --- a/src/packages/utils/src/things/json-rpc/index.ts +++ b/src/packages/utils/src/things/json-rpc/index.ts @@ -1 +1 @@ -export {JsonRpcType} from "./json-rpc-base-types"; \ No newline at end of file +export { JsonRpcType } from "./json-rpc-base-types"; diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts index 7156c26c2d..02b3a3dd33 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts @@ -1,5 +1,5 @@ -import {bigIntToBuffer} from "../../utils"; -import {uintToBuffer} from "../../utils"; +import { bigIntToBuffer } from "../../utils"; +import { uintToBuffer } from "../../utils"; const EMPTY_BUFFER = Buffer.allocUnsafe(0); @@ -12,7 +12,7 @@ const inspect = Symbol.for("nodejs.util.inspect.custom"); export class BaseJsonRpcType { public [Symbol.toStringTag]: string; - + protected value: T; // used to make console.log debugging a little easier private [inspect](_depth: number, _options: any): T { @@ -28,7 +28,7 @@ export class BaseJsonRpcType (value as number).toString(16)); @@ -50,7 +50,9 @@ export class BaseJsonRpcType(json: any): Request => { return { @@ -40,11 +40,11 @@ namespace JsonRpc { result }; }; - export const Error = (id: string, error: T, result?: unknown): Error => { - type E = {[K in keyof T]: K extends string ? T[K] : never}; + export const Error = (id: string, error: T, result?: unknown): Error => { + type E = { [K in keyof T]: K extends string ? T[K] : never }; // Error objects are weird, `message` isn't included in the property names, // so it is pulled out separately. - const details = {message: error.message} as E; + const details = { message: error.message } as E; Object.getOwnPropertyNames(error).forEach(name => { if (typeof name === "string") { details[name] = error[name]; diff --git a/src/packages/utils/src/things/promievent.ts b/src/packages/utils/src/things/promievent.ts index df1bf0e7ef..25755a145c 100644 --- a/src/packages/utils/src/things/promievent.ts +++ b/src/packages/utils/src/things/promievent.ts @@ -8,8 +8,10 @@ declare var Promise: { * @param onrejected The callback to execute when the Promise is rejected. * @returns A Promise for the completion of the callback. */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): PromiEvent; - + catch( + onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null + ): PromiEvent; + /** * Creates a new resolved promievent for the provided value. * @param value A promise. @@ -28,7 +30,7 @@ const emitteryMethods = ["clearListeners", "once", "on", "emit", "onAny"] as con @Emittery.mixin(Symbol.for("emittery"), emitteryMethods) class PromiEvent extends Promise { - constructor (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) { + constructor(executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) { super(executor); } @@ -40,7 +42,7 @@ class PromiEvent extends Promise { catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null) { const prom = new PromiEvent((resolve, reject) => { this.onAny((eventName, eventData) => { - return prom.emit(eventName, eventData); + return prom.emit(eventName, eventData); }); const p = super.catch(onrejected); p.then(resolve, reject); @@ -68,9 +70,9 @@ class PromiEvent extends Promise { /** * Used to immediately clear all event listeners on the instance and prevent * any additional binding or emission from the Emitter. - * + * * Once disposed no listeners can be bound to this emitter. - * + * * Note: `dispose` is pre-bound to the `this`, making it possible to pass the * method around detached from it's context. */ @@ -83,18 +85,19 @@ class PromiEvent extends Promise { const fn = () => { throw new Error("PromiEvent bound after dispose"); }; - emitteryMethods.filter(m => m !== "emit").forEach(methodName => { - Object.defineProperty(this, methodName, { - enumerable: false, - value: fn + emitteryMethods + .filter(m => m !== "emit") + .forEach(methodName => { + Object.defineProperty(this, methodName, { + enumerable: false, + value: fn + }); }); - }); - } + }; } - interface PromiEvent extends Promise, Pick { - emittery: Emittery + emittery: Emittery; } export default PromiEvent; diff --git a/src/packages/utils/src/types/connector.ts b/src/packages/utils/src/types/connector.ts index 581760c8f4..06f5800650 100644 --- a/src/packages/utils/src/types/connector.ts +++ b/src/packages/utils/src/types/connector.ts @@ -1,5 +1,5 @@ -import {Provider} from "./provider"; -import {RecognizedString, WebSocket, HttpRequest} from "uWebSockets.js"; +import { Provider } from "./provider"; +import { RecognizedString, WebSocket, HttpRequest } from "uWebSockets.js"; import { Api } from "./api"; import { KnownKeys } from "../types"; import Emittery from "emittery"; @@ -7,7 +7,8 @@ import Emittery from "emittery"; /** * Connects an arbitrary public chain provider to ganache-core */ -export interface Connector extends Emittery.Typed { +export interface Connector + extends Emittery.Typed { provider: Provider; /** @@ -21,10 +22,10 @@ export interface Connector Promise<{value: ReturnType]>}>) - | ((payload: RequestFormat[], connection: HttpRequest) => Promise<{value: ReturnType]>[]}>) - | ((payload: RequestFormat, connection: WebSocket) => Promise<{value: ReturnType]>}>) - | ((payload: RequestFormat[], connection: WebSocket) => Promise<{value: ReturnType]>[]}>); + | ((payload: RequestFormat, connection: HttpRequest) => Promise<{ value: ReturnType]> }>) + | ((payload: RequestFormat[], connection: HttpRequest) => Promise<{ value: ReturnType]>[] }>) + | ((payload: RequestFormat, connection: WebSocket) => Promise<{ value: ReturnType]> }>) + | ((payload: RequestFormat[], connection: WebSocket) => Promise<{ value: ReturnType]>[] }>); /** * Formats the response (returned from `handle`) diff --git a/src/packages/utils/src/types/index.ts b/src/packages/utils/src/types/index.ts index 1069eb798d..4e5c3e9163 100644 --- a/src/packages/utils/src/types/index.ts +++ b/src/packages/utils/src/types/index.ts @@ -6,7 +6,7 @@ import { Api } from "./api"; export type KnownKeys = { [K in keyof T]: string extends K ? never : number extends K ? never : K; -} extends {[_ in keyof T]: infer U} +} extends { [_ in keyof T]: infer U } ? U : never; @@ -18,6 +18,6 @@ export type RequestType = (eventDetails: { declare global { interface JSON { - parse(text: Buffer, reviver?: (key: any, value: any) => any): any; + parse(text: Buffer, reviver?: (key: any, value: any) => any): any; } } diff --git a/src/packages/utils/src/types/provider.ts b/src/packages/utils/src/types/provider.ts index 5fda7bd3b5..09a872400e 100644 --- a/src/packages/utils/src/types/provider.ts +++ b/src/packages/utils/src/types/provider.ts @@ -1,5 +1,3 @@ import { Api } from "./api"; -export interface Provider { - -} +export interface Provider {} diff --git a/src/packages/utils/src/utils/bigint-to-buffer.ts b/src/packages/utils/src/utils/bigint-to-buffer.ts index 28d6b54016..49ea2e9ddf 100644 --- a/src/packages/utils/src/utils/bigint-to-buffer.ts +++ b/src/packages/utils/src/utils/bigint-to-buffer.ts @@ -8,9 +8,9 @@ let _bigIntToBuffer: (val: bigint) => Buffer; * Returns the number of bytes contained in this given `value`. * @param value */ -function bigIntByteLength(value: bigint){ +function bigIntByteLength(value: bigint) { let length = 1; - while (value >>= 8n) length++; + while ((value >>= 8n)) length++; return length; } @@ -24,7 +24,7 @@ try { const size = bigIntByteLength(value); return toBufferBE(value, size); } - } + }; } catch (e) { _bigIntToBuffer = (value: bigint): Buffer => { if (value <= MAX_SAFE_INTEGER) { diff --git a/src/packages/utils/src/utils/constants.ts b/src/packages/utils/src/utils/constants.ts index f7234d02fa..b4098c49b5 100644 --- a/src/packages/utils/src/utils/constants.ts +++ b/src/packages/utils/src/utils/constants.ts @@ -4,4 +4,4 @@ export const ACCOUNT_ZERO = Buffer.allocUnsafe(20).fill(0); export const BUFFER_EMPTY = Buffer.allocUnsafe(0); export const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); export const RPCQUANTITY_ZERO = Quantity.from(0n); -export const WEI = 1000000000000000000n as const; \ No newline at end of file +export const WEI = 1000000000000000000n as const; diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index ba286dafd7..e9304c1033 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -1,9 +1,9 @@ import { hasOwn } from "./has-own"; import { KnownKeys, Api } from "../types"; -import {RequestCoordinator} from "./request-coordinator"; +import { RequestCoordinator } from "./request-coordinator"; export class Executor { - #requestCoordinator: RequestCoordinator + #requestCoordinator: RequestCoordinator; /** * The Executor handles execution of methods on the given API @@ -17,11 +17,7 @@ export class Executor { * @param methodName The name of the JSON-RPC method to execute. * @param params The params to pass to the JSON-RPC method. */ - public execute >( - api: T, - methodName: M, - params: Parameters - ) { + public execute>(api: T, methodName: M, params: Parameters) { // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { @@ -47,5 +43,5 @@ export class Executor { } throw new Error(`The method ${methodName} does not exist/is not available`); - }; + } } diff --git a/src/packages/utils/src/utils/has-own.ts b/src/packages/utils/src/utils/has-own.ts index 60b46e6097..c3ca01e149 100644 --- a/src/packages/utils/src/utils/has-own.ts +++ b/src/packages/utils/src/utils/has-own.ts @@ -1,16 +1,17 @@ /** * /** * Determines whether an object has a property with the specified name. - * + * * Safe for use on user-supplied data. - * + * * @param obj The object that will be checked. * @param v A property name. * @returns `true` if the object has a property with the specified name, * otherwise false. */ -export const hasOwn: < - X extends unknown, - Y extends string | number | symbol ->(obj: X, prop: Y) => obj is X extends Record ? X & Required> : never - = ({}).hasOwnProperty.call.bind(({}).hasOwnProperty) as any; \ No newline at end of file +export const hasOwn: ( + obj: X, + prop: Y +) => obj is X extends Record ? X & Required> : never = {}.hasOwnProperty.call.bind( + {}.hasOwnProperty +) as any; diff --git a/src/packages/utils/src/utils/heap.ts b/src/packages/utils/src/utils/heap.ts index f6c35e0cef..e09d35f7d1 100644 --- a/src/packages/utils/src/utils/heap.ts +++ b/src/packages/utils/src/utils/heap.ts @@ -208,4 +208,3 @@ export class Heap { return heap; } } - diff --git a/src/packages/utils/src/utils/request-coordinator.ts b/src/packages/utils/src/utils/request-coordinator.ts index 1c45bd78e9..563e87f0b4 100644 --- a/src/packages/utils/src/utils/request-coordinator.ts +++ b/src/packages/utils/src/utils/request-coordinator.ts @@ -64,25 +64,29 @@ export class RequestCoordinator { .finally(() => { this.runningTasks--; this.#process(); - }) + }); } }; /** * Insert a new function into the queue. */ - public queue = unknown>(fn: T, thisArgument: any, argumentsList: Parameters) => { - return new Promise<{value: ReturnType}>((resolve, reject) => { + public queue = unknown>( + fn: T, + thisArgument: any, + argumentsList: Parameters + ) => { + return new Promise<{ value: ReturnType }>((resolve, reject) => { // const executor is `async` to force the return value into a Promise. const executor = async () => { try { const value = Reflect.apply(fn, thisArgument, argumentsList || []) as ReturnType; - resolve({value}); + resolve({ value }); return value; - } catch(e) { + } catch (e) { reject(e); } - } + }; this.pending.push(executor); this.#process(); }); diff --git a/src/packages/utils/src/utils/uint-to-buffer.ts b/src/packages/utils/src/utils/uint-to-buffer.ts index 46619e60c1..69288622be 100644 --- a/src/packages/utils/src/utils/uint-to-buffer.ts +++ b/src/packages/utils/src/utils/uint-to-buffer.ts @@ -5,21 +5,21 @@ const MAX_UINT32 = 0xffffffff; * draw attention to it. It is much faster the `Buffer.alloc(size)` because it * doesn't initialize its memory first. It's safe for us to use below because we * guarantee that we will fill every octet ourselves. - * + * * Allocates a new buffer of {size} octets, leaving memory not initialized, so - * the contents of the newly created Buffer are unknown and may contain + * the contents of the newly created Buffer are unknown and may contain * sensitive data. - * + * * @param {number} size count of octets to allocate */ const allocUnsafe = Buffer.allocUnsafe; /** - * Converts positive whole numbers that are 32 bits of fewer to a Buffer. Any + * Converts positive whole numbers that are 32 bits of fewer to a Buffer. Any * more bits and who knows what will happen!?!1?! - * + * * @param num A positive whole number less than 33 bits wide, i.e. a uint32. - * @returns an optimally sized buffer holding `num` in big-endian order (LSB is + * @returns an optimally sized buffer holding `num` in big-endian order (LSB is * the _last_ value in the Buffer) */ function uint32ToBuf(num: number) { @@ -32,21 +32,18 @@ function uint32ToBuf(num: number) { // shift the first 8 least signficant bits off current num, if it's non-zero // our value contains at least 2 bytes! - if (num >>>= 8) { - + if ((num >>>= 8)) { /** `second` now holds the second most least significant byte in its * "first" (right most) 8 bits */ const second = num; // shift the next 8 least signficant bits off current num, if it's non-zero // our value contains at least 3 bytes! - if (num >>>= 8) { - + if ((num >>>= 8)) { /** `third` now holds the third most least significant byte in its - * "first" (right most) 8 bits */ + * "first" (right most) 8 bits */ const third = num; - if (num >>>= 8) { - + if ((num >>>= 8)) { // since we have all 4 bytes, create a 4 byte Buffer and fill it with // our values! buf = allocUnsafe(4); @@ -86,14 +83,14 @@ function uint32ToBuf(num: number) { * Converts positive whole numbers less than or equal to * `Number.MAX_SAFE_INTEGER` to a Buffer. If your value is less than 2**32 you * should use `uint32ToBuf` instead. - * + * * @param num A positive whole number <= `Number.MAX_SAFE_INTEGER` - * @returns an optimally sized buffer holding `num` in big-endian order (LSB is + * @returns an optimally sized buffer holding `num` in big-endian order (LSB is * the _last_ value in the Buffer) */ function uintWideToBuf(num: number) { // This function is similar to `uint32ToBuf`, but splits the number into its - // 32 lowest bits and its 32 highest bits. We have to do this because numeric + // 32 lowest bits and its 32 highest bits. We have to do this because numeric // Bitwise operations can only operate on 32 bit-wide values. // There are some differences, but if you first grasp `uint32ToBuf`, you can // handle this just fine. @@ -111,11 +108,11 @@ function uintWideToBuf(num: number) { // the high bits determine the size of the Buffer, so we compute the high bits // first - if (hi >>>= 8) { + if ((hi >>>= 8)) { const six = hi; - if (hi >>>= 8) { + if ((hi >>>= 8)) { const five = hi; - if (hi >>>= 8) { + if ((hi >>>= 8)) { buf = allocUnsafe(8); buf[0] = hi; // msb buf[1] = five; @@ -144,24 +141,24 @@ function uintWideToBuf(num: number) { // set the low bytes: let lo = num & MAX_UINT32; const lsb = lo; - if (lo >>>= 8) { + if ((lo >>>= 8)) { const two = lo; - if (lo >>>= 8) { + if ((lo >>>= 8)) { const one = lo; - buf[offset-3] = (lo >>>= 8); - buf[offset-2] = one; - buf[offset-1] = two; + buf[offset - 3] = lo >>>= 8; + buf[offset - 2] = one; + buf[offset - 1] = two; buf[offset] = lsb; } else { - buf[offset-3] = 0; - buf[offset-2] = 0; - buf[offset-1] = two; + buf[offset - 3] = 0; + buf[offset - 2] = 0; + buf[offset - 1] = two; buf[offset] = lsb; } } else { - buf[offset-3] = 0; - buf[offset-2] = 0; - buf[offset-1] = 0; + buf[offset - 3] = 0; + buf[offset - 2] = 0; + buf[offset - 1] = 0; buf[offset] = lsb; } return buf; @@ -170,11 +167,11 @@ function uintWideToBuf(num: number) { /** * Converts a JavaScript number, treated as a Whole Number (0, 1, 2, 3, 4, ...) * less than 64 bits wide, to a Buffer. - * + * * Numbers that are negative, fractional, or greater than 64 bits wide will * return very unexpected results. Numbers that are greater than * `Number.MAX_SAFE_INTEGER` will return unexpected results. - * + * * @param num A positive whole number <= `Number.MAX_SAFE_INTEGER` */ export function uintToBuffer(num: number) { diff --git a/src/packages/utils/src/utils/unref.ts b/src/packages/utils/src/utils/unref.ts index 2baab8ef21..30d50e2b55 100644 --- a/src/packages/utils/src/utils/unref.ts +++ b/src/packages/utils/src/utils/unref.ts @@ -1,4 +1,3 @@ - /** * In node, calling `unref(timer)` on a running timer ensures that the timer * does not require that the Node.js event remain active. If there is no other @@ -14,4 +13,4 @@ export function unref(timer: NodeJS.Timeout | number): timer is NodeJS.Timeout { } else { return false; } -} \ No newline at end of file +} From a9f5602b67b7df2e47e71dfeca1f90a79666864a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 18:25:10 -0400 Subject: [PATCH 616/691] change to an 80 char printWidth --- .github/workflows/nodejs.yml | 3 +- .prettierrc | 1 - scripts/compile.ts | 57 ++- scripts/create.ts | 75 ++-- .../ethereum/__tests__/api/eth/eth.test.ts | 97 ++++-- .../__tests__/api/eth/getCode.test.ts | 28 +- .../__tests__/api/eth/getStorageAt.test.ts | 38 +- .../api/eth/legacyInstamining.test.ts | 14 +- .../ethereum/__tests__/api/eth/logs.test.ts | 186 +++++++--- .../api/eth/sendRawTransaction.test.ts | 11 +- .../__tests__/api/eth/sendTransaction.test.ts | 45 ++- .../ethereum/__tests__/api/eth/sign.test.ts | 18 +- .../__tests__/api/eth/signTypedData.test.ts | 15 +- .../__tests__/api/eth/subscribe.test.ts | 68 +++- .../ethereum/__tests__/api/eth/uncles.test.ts | 18 +- .../ethereum/__tests__/api/evm/evm.test.ts | 81 +++-- .../__tests__/api/evm/snapshot.test.ts | 206 ++++++++--- .../__tests__/api/miner/miner.test.ts | 51 ++- .../__tests__/api/personal/personal.test.ts | 154 +++++++-- .../ethereum/__tests__/api/web3/web3.test.ts | 5 +- .../ethereum/__tests__/helpers/compile.ts | 4 +- .../ethereum/__tests__/helpers/getProvider.ts | 6 +- .../ethereum/__tests__/provider.test.ts | 7 +- .../ethereum/__tests__/temp-tests.test.ts | 96 ++++-- .../ethereum/scripts/post-process-docs.js | 4 +- .../src/@types/ethereumjs-block/header.d.ts | 11 +- .../src/@types/ethereumjs-block/index.d.ts | 5 +- .../src/@types/ethereumjs-util/index.d.ts | 5 +- .../ethereum/src/@types/hdkey/index.d.ts | 10 +- .../ethereum/src/@types/levelup/index.d.ts | 39 ++- .../@types/merkle-patricia-tree/baseTrie.ts | 7 +- .../@types/merkle-patricia-tree/index.d.ts | 7 +- .../@types/merkle-patricia-tree/trieNode.ts | 6 +- src/chains/ethereum/src/api.ts | 325 +++++++++++++----- src/chains/ethereum/src/blockchain.ts | 211 ++++++++---- .../src/data-managers/account-manager.ts | 20 +- .../src/data-managers/block-manager.ts | 26 +- .../ethereum/src/data-managers/manager.ts | 6 +- .../src/data-managers/transaction-manager.ts | 12 +- src/chains/ethereum/src/database.ts | 5 +- src/chains/ethereum/src/errors/errors.ts | 3 +- .../ethereum/src/errors/runtime-error.ts | 16 +- .../ethereum/src/helpers/assert-arg-length.ts | 4 +- .../ethereum/src/helpers/filter-parsing.ts | 34 +- .../ethereum/src/helpers/gas-estimator.ts | 48 ++- src/chains/ethereum/src/index.ts | 54 ++- src/chains/ethereum/src/miner.ts | 54 ++- .../ethereum/src/options/chain-options.ts | 7 +- src/chains/ethereum/src/options/index.ts | 8 +- .../ethereum/src/options/wallet-options.ts | 6 +- src/chains/ethereum/src/provider.ts | 72 +++- src/chains/ethereum/src/things/account.ts | 9 +- src/chains/ethereum/src/things/blocklogs.ts | 52 ++- .../src/things/transaction-receipt.ts | 36 +- src/chains/ethereum/src/things/transaction.ts | 51 ++- src/chains/ethereum/src/transaction-pool.ts | 20 +- .../ethereum/src/types/subscriptions.ts | 6 +- .../ethereum/src/types/tuple-from-union.ts | 31 +- src/chains/ethereum/src/wallet.ts | 121 +++++-- src/chains/tezos/src/provider.ts | 5 +- src/packages/core/__tests__/connector.test.ts | 9 +- .../core/__tests__/helpers/getProvider.ts | 7 +- src/packages/core/__tests__/server.test.ts | 156 ++++++--- .../core/src/@types/uWebsockets.js.ts | 6 +- src/packages/core/src/connector.ts | 4 +- src/packages/core/src/index.ts | 3 +- src/packages/core/src/options/index.ts | 8 +- src/packages/core/src/server.ts | 32 +- src/packages/core/src/servers/http-server.ts | 52 ++- src/packages/core/src/servers/ws-server.ts | 16 +- .../options/src/helpers/definition.ts | 26 +- src/packages/options/src/helpers/exclusive.ts | 103 ++++-- src/packages/options/src/helpers/getters.ts | 29 +- src/packages/promise-queue/src/entry.ts | 6 +- src/packages/promise-queue/src/index.ts | 3 +- .../things/json-rpc/json-rpc-base-types.ts | 12 +- .../src/things/json-rpc/json-rpc-data.ts | 5 +- .../src/things/json-rpc/json-rpc-quantity.ts | 9 +- src/packages/utils/src/things/jsonrpc.ts | 6 +- src/packages/utils/src/things/promievent.ts | 31 +- src/packages/utils/src/types/connector.ts | 27 +- src/packages/utils/src/utils/executor.ts | 11 +- src/packages/utils/src/utils/has-own.ts | 6 +- .../utils/src/utils/request-coordinator.ts | 12 +- 84 files changed, 2453 insertions(+), 746 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 84aa6c4cdc..ebaf020102 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -11,7 +11,8 @@ jobs: fail-fast: false matrix: node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] - os: [windows-2019, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15] + os: + [windows-2019, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15] runs-on: ${{ matrix.os }} diff --git a/.prettierrc b/.prettierrc index 8b767f3018..1f5e5d140d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,4 @@ { "arrowParens": "avoid", - "printWidth": 120, "trailingComma": "none" } diff --git a/scripts/compile.ts b/scripts/compile.ts index 9da73ca152..3f277eecd0 100644 --- a/scripts/compile.ts +++ b/scripts/compile.ts @@ -35,7 +35,12 @@ function serializeToAst(v: any): ts.Expression { } const keys = Object.keys(v); return ts.createObjectLiteral( - keys.map(k => ts.createPropertyAssignment(ts.createStringLiteral(k), serializeToAst(v[k]))) + keys.map(k => + ts.createPropertyAssignment( + ts.createStringLiteral(k), + serializeToAst(v[k]) + ) + ) ); default: throw new Error(`Can't serializeToAst ${typeof v}`); @@ -60,7 +65,13 @@ function serializeToTypeAst(v: any): ts.TypeNode { const keys = Object.keys(v); return ts.createTypeLiteralNode( keys.map(k => - ts.createPropertySignature(void 0, ts.createStringLiteral(k), void 0, serializeToTypeAst(v[k]), void 0) + ts.createPropertySignature( + void 0, + ts.createStringLiteral(k), + void 0, + serializeToTypeAst(v[k]), + void 0 + ) ) ); default: @@ -68,15 +79,28 @@ function serializeToTypeAst(v: any): ts.TypeNode { } } -function resolveJsonImportFromNode(node: ts.ImportDeclaration, sf: SourceFile): string { +function resolveJsonImportFromNode( + node: ts.ImportDeclaration, + sf: SourceFile +): string { const jsonPath = trimQuote(node.moduleSpecifier.getText()); - return jsonPath && resolveJsonImport(resolve(dirname(sf.getFilePath()), jsonPath)); + return ( + jsonPath && resolveJsonImport(resolve(dirname(sf.getFilePath()), jsonPath)) + ); } const parseConfigHost: ts.ParseConfigHost = ts.sys; -const configFileName = ts.findConfigFile("./", ts.sys.fileExists, "tsconfig.json") as string; +const configFileName = ts.findConfigFile( + "./", + ts.sys.fileExists, + "tsconfig.json" +) as string; const configFile = ts.readConfigFile(configFileName, ts.sys.readFile); -const compilerOptions = ts.parseJsonConfigFileContent(configFile.config, parseConfigHost, "./"); +const compilerOptions = ts.parseJsonConfigFileContent( + configFile.config, + parseConfigHost, + "./" +); const project = new Project({ compilerOptions: compilerOptions.options }); @@ -86,17 +110,30 @@ sources.forEach(sourceFile => { sourceFile.transform(traversal => { const node = traversal.visitChildren(); let jsonPath: string; - if (ts.isImportDeclaration(node) && (jsonPath = resolveJsonImportFromNode(node, sourceFile)) && node.importClause) { + if ( + ts.isImportDeclaration(node) && + (jsonPath = resolveJsonImportFromNode(node, sourceFile)) && + node.importClause + ) { const namedBindings = node.importClause.namedBindings; if (namedBindings && "elements" in namedBindings) { const jsonFile = require(jsonPath); const json = namedBindings.elements.map(element => { const name = element.name.text; - const propertyName = element.propertyName ? element.propertyName.text : name; + const propertyName = element.propertyName + ? element.propertyName.text + : name; const value = jsonFile[propertyName]; - return ts.createVariableDeclaration(name, serializeToTypeAst(value), serializeToAst(value)); + return ts.createVariableDeclaration( + name, + serializeToTypeAst(value), + serializeToAst(value) + ); }); - return ts.createVariableStatement([], ts.createVariableDeclarationList(json, NodeFlags.Const)); + return ts.createVariableStatement( + [], + ts.createVariableDeclarationList(json, NodeFlags.Const) + ); } } diff --git a/scripts/create.ts b/scripts/create.ts index 3626bce892..3672b5defb 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -10,7 +10,11 @@ import { join, resolve } from "path"; import { version } from "../lerna.json"; import { highlight } from "cli-highlight"; import { mkdir, mkdirSync, writeFile } from "fs-extra"; -import { lstatSync as lstat, readdirSync as readDir, readFileSync as readFile } from "fs"; +import { + lstatSync as lstat, + readdirSync as readDir, + readFileSync as readFile +} from "fs"; const isDir = (s: string) => lstat(s).isDirectory(); const getDirectories = (s: string) => readDir(s).filter(n => isDir(join(s, n))); @@ -23,29 +27,33 @@ const COLORS = { const scopes = getDirectories(join(__dirname, "../src")); const argv = yargs - .command(`$0 --location`, `Create a new package in the given location with the provided name.`, yargs => { - return yargs - .usage( - chalk`{hex("#e4a663").bold Create a new package in the given location with the provided name.}\n\n` + - chalk`{bold Usage}\n {bold $} {dim <}name{dim >} {dim --}location {dim <}${scopes.join( - chalk.dim(" | ") - )}{dim >}` - ) - .positional("", { - describe: ` The name of the new package`, - type: "string", - demandOption: true - }) - .alias("name", "") - .option("location", { - alias: "l", - default: "packages", - describe: `The location for the new package.`, - choices: scopes, - type: "string", - demandOption: true - }); - }) + .command( + `$0 --location`, + `Create a new package in the given location with the provided name.`, + yargs => { + return yargs + .usage( + chalk`{hex("#e4a663").bold Create a new package in the given location with the provided name.}\n\n` + + chalk`{bold Usage}\n {bold $} {dim <}name{dim >} {dim --}location {dim <}${scopes.join( + chalk.dim(" | ") + )}{dim >}` + ) + .positional("", { + describe: ` The name of the new package`, + type: "string", + demandOption: true + }) + .alias("name", "") + .option("location", { + alias: "l", + default: "packages", + describe: `The location for the new package.`, + choices: scopes, + type: "string", + demandOption: true + }); + } + ) .demandCommand() .version(false) .help(false) @@ -150,7 +158,10 @@ export * from "./src/index"; const src = join(dir, "src"); function initSrc() { - return writeFile(join(src, "index.ts"), prettier.format(indexFile, { ...prettierConfig, parser: "typescript" })); + return writeFile( + join(src, "index.ts"), + prettier.format(indexFile, { ...prettierConfig, parser: "typescript" }) + ); } function initRootIndex() { @@ -197,7 +208,10 @@ typedoc.json initRootIndex(), mkdir(tests).then(initTests), mkdir(src).then(initSrc), - writeFile(join(dir, "tsconfig.json"), JSON.stringify(tsConfig, null, 2) + "\n"), + writeFile( + join(dir, "tsconfig.json"), + JSON.stringify(tsConfig, null, 2) + "\n" + ), writeFile( join(dir, "README.md"), prettier.format(`# ${packageName}\n> TODO: description`, { @@ -206,7 +220,10 @@ typedoc.json }) ), writeFile(pkgPath, pkgStr), - writeFile(join(dir, "npm-shrinkwrap.json"), JSON.stringify(shrinkwrap) + "\n") + writeFile( + join(dir, "npm-shrinkwrap.json"), + JSON.stringify(shrinkwrap) + "\n" + ) ]); console.log( @@ -225,6 +242,8 @@ typedoc.json } catch (e) { console.error(e); console.log(""); - console.log(chalk`{red fail} {magenta create} New package {bgBlack ${name} } not created. See error above.`); + console.log( + chalk`{red fail} {magenta create} New package {bgBlack ${name} } not created. See error above.` + ); } })(); diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 11be558aa9..745c4a796e 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -60,7 +60,11 @@ describe("api", () => { describe("eth_submitWork", () => { it("should get compilers list", async () => { - const result = await provider.send("eth_submitWork", [hex(8), hex(32), hex(32)]); + const result = await provider.send("eth_submitWork", [ + hex(8), + hex(32), + hex(32) + ]); assert.deepStrictEqual(result, false); }); }); @@ -74,7 +78,10 @@ describe("api", () => { describe("eth_submitHashrate", () => { it("should return the status of eth_submitHashrate", async () => { - const result = await provider.send("eth_submitHashrate", [hex(32), hex(32)]); + const result = await provider.send("eth_submitHashrate", [ + hex(32), + hex(32) + ]); assert.deepStrictEqual(result, false); }); }); @@ -87,7 +94,9 @@ describe("api", () => { it("should use the default chain id when signing transactions", async () => { await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendTransaction", [{ from: accounts[0], to: accounts[0] }]); + const txHash = await provider.send("eth_sendTransaction", [ + { from: accounts[0], to: accounts[0] } + ]); await provider.once("message"); const tx = await provider.send("eth_getTransactionByHash", [txHash]); assert.strictEqual(tx.v, "0xa95"); @@ -107,7 +116,9 @@ describe("api", () => { }); it("should return 0 for non-existent account", async () => { - const balance = await provider.send("eth_getBalance", ["0x1234567890123456789012345678901234567890"]); + const balance = await provider.send("eth_getBalance", [ + "0x1234567890123456789012345678901234567890" + ]); assert.strictEqual(balance, "0x0"); }); }); @@ -120,10 +131,15 @@ describe("api", () => { value: 1 }; - const txCount1 = await provider.send("eth_getTransactionCount", [accounts[0]]); + const txCount1 = await provider.send("eth_getTransactionCount", [ + accounts[0] + ]); assert.strictEqual(txCount1, "0x0"); const initialBlockNumber = await provider.send("eth_blockNumber"); - const txCount2 = await provider.send("eth_getTransactionCount", [accounts[0], initialBlockNumber]); + const txCount2 = await provider.send("eth_getTransactionCount", [ + accounts[0], + initialBlockNumber + ]); assert.strictEqual(txCount2, "0x0"); await provider.send("eth_subscribe", ["newHeads"]); @@ -134,7 +150,10 @@ describe("api", () => { await provider.send("miner_start"); const message1 = await provider.once("message"); - const txCount3 = await provider.send("eth_getTransactionCount", [accounts[0], message1.data.result.number]); + const txCount3 = await provider.send("eth_getTransactionCount", [ + accounts[0], + message1.data.result.number + ]); assert.strictEqual(txCount3, "0x1"); // send two txs, then check the count @@ -144,24 +163,41 @@ describe("api", () => { await provider.send("miner_start"); const message2 = await provider.once("message"); - const txCount4 = await provider.send("eth_getTransactionCount", [accounts[0], message2.data.result.number]); + const txCount4 = await provider.send("eth_getTransactionCount", [ + accounts[0], + message2.data.result.number + ]); assert.strictEqual(txCount4, "0x3"); // the check the count at different block numbers... - const txCount5 = await provider.send("eth_getTransactionCount", [accounts[0], message1.data.result.number]); + const txCount5 = await provider.send("eth_getTransactionCount", [ + accounts[0], + message1.data.result.number + ]); assert.strictEqual(txCount5, txCount3); - const txCount6 = await provider.send("eth_getTransactionCount", [accounts[0], initialBlockNumber]); + const txCount6 = await provider.send("eth_getTransactionCount", [ + accounts[0], + initialBlockNumber + ]); assert.strictEqual(txCount6, "0x0"); - const txCount7 = await provider.send("eth_getTransactionCount", [accounts[0]]); + const txCount7 = await provider.send("eth_getTransactionCount", [ + accounts[0] + ]); assert.strictEqual(txCount7, txCount4); - const txCount8 = await provider.send("eth_getTransactionCount", [accounts[0], "earliest"]); + const txCount8 = await provider.send("eth_getTransactionCount", [ + accounts[0], + "earliest" + ]); assert.strictEqual(txCount8, "0x0"); - const txCount9 = await provider.send("eth_getTransactionCount", [accounts[0], "latest"]); + const txCount9 = await provider.send("eth_getTransactionCount", [ + accounts[0], + "latest" + ]); assert.strictEqual(txCount9, txCount4); }); }); @@ -179,7 +215,9 @@ describe("api", () => { value: 1 }; - const startingBlockNumber = parseInt(await provider.send("eth_blockNumber")); + const startingBlockNumber = parseInt( + await provider.send("eth_blockNumber") + ); await provider.send("eth_subscribe", ["newHeads"]); await provider.send("eth_sendTransaction", [{ ...tx }]); await provider.once("message"); @@ -223,7 +261,9 @@ describe("api", () => { }); it("eth_getBlockByNumber", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + const _subscriptionId = await provider.send("eth_subscribe", [ + "newHeads" + ]); await provider.send("eth_sendTransaction", [ { from: accounts[0], @@ -240,7 +280,9 @@ describe("api", () => { }); it("eth_getBlockByHash", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + const _subscriptionId = await provider.send("eth_subscribe", [ + "newHeads" + ]); await provider.send("eth_sendTransaction", [ { from: accounts[0], @@ -265,7 +307,9 @@ describe("api", () => { }); it("eth_getBlockTransactionCountByHash", async () => { - const _subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + const _subscriptionId = await provider.send("eth_subscribe", [ + "newHeads" + ]); await provider.send("eth_sendTransaction", [ { from: accounts[0], @@ -276,7 +320,9 @@ describe("api", () => { const _message = await provider.once("message"); const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - const count = await provider.send("eth_getBlockTransactionCountByHash", [block.hash]); + const count = await provider.send("eth_getBlockTransactionCountByHash", [ + block.hash + ]); assert(count, "1"); }); @@ -291,7 +337,10 @@ describe("api", () => { ]); await provider.once("message"); - const count = await provider.send("eth_getBlockTransactionCountByNumber", ["0x1"]); + const count = await provider.send( + "eth_getBlockTransactionCountByNumber", + ["0x1"] + ); assert.strictEqual(count, "0x1"); }); @@ -359,7 +408,10 @@ describe("api", () => { ]); await provider.once("message"); - const tx = await provider.send("eth_getTransactionByBlockNumberAndIndex", ["0x1", "0x0"]); + const tx = await provider.send( + "eth_getTransactionByBlockNumberAndIndex", + ["0x1", "0x0"] + ); assert.strictEqual( tx.hash, "0xab338178ffd130f1b7724a687ef20afcc75d44020184f82127ab1bc59f17d7e2", @@ -384,7 +436,10 @@ describe("api", () => { const _message = await provider.once("message"); const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - const tx = await provider.send("eth_getTransactionByBlockHashAndIndex", [block.hash, "0x0"]); + const tx = await provider.send("eth_getTransactionByBlockHashAndIndex", [ + block.hash, + "0x0" + ]); assert.strictEqual( tx.hash, "0xab338178ffd130f1b7724a687ef20afcc75d44020184f82127ab1bc59f17d7e2", diff --git a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts index 1192e8006f..7e8fc14d96 100644 --- a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/getCode.test.ts @@ -20,12 +20,16 @@ describe("api", () => { }); it("should return 0x for null address", async () => { - const code = await provider.send("eth_getCode", ["0x0000000000000000000000000000000000000000"]); + const code = await provider.send("eth_getCode", [ + "0x0000000000000000000000000000000000000000" + ]); assert.strictEqual(code, "0x"); }); it("should return 0x for un-initialized address", async () => { - const code = await provider.send("eth_getCode", ["0xabcdefg012345678abcdefg012345678abcdefg0"]); + const code = await provider.send("eth_getCode", [ + "0xabcdefg012345678abcdefg012345678abcdefg0" + ]); assert.strictEqual(code, "0x"); }); @@ -56,16 +60,28 @@ describe("api", () => { } ]); await provider.once("message"); - const transactionReceipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + const transactionReceipt = await provider.send( + "eth_getTransactionReceipt", + [transactionHash] + ); contractAddress = transactionReceipt.contractAddress; - assert(contractAddress !== null, "Contract wasn't deployed as expected"); + assert( + contractAddress !== null, + "Contract wasn't deployed as expected" + ); blockNumber = Quantity.from(transactionReceipt.blockNumber); }); it("should return the code at the deployed block number", async () => { - const code = await provider.send("eth_getCode", [contractAddress, blockNumber.toString()]); - assert.strictEqual(code, `0x${contract.contract.evm.deployedBytecode.object}`); + const code = await provider.send("eth_getCode", [ + contractAddress, + blockNumber.toString() + ]); + assert.strictEqual( + code, + `0x${contract.contract.evm.deployedBytecode.object}` + ); }); it("should return the no code at the previous block number", async () => { diff --git a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts index c6d551fae3..c2afdd2522 100644 --- a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts @@ -32,21 +32,32 @@ describe("api", () => { await provider.once("message"); - const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + const receipt = await provider.send("eth_getTransactionReceipt", [ + transactionHash + ]); contractAddress = receipt.contractAddress; contractMethods = contract.contract.evm.methodIdentifiers; }); it("returns the value at the hex position", async () => { - const result = await provider.send("eth_getStorageAt", [contractAddress, "0x0"]); + const result = await provider.send("eth_getStorageAt", [ + contractAddress, + "0x0" + ]); assert.strictEqual(BigInt(result), 123n); - const result2 = await provider.send("eth_getStorageAt", [contractAddress, "0x1"]); + const result2 = await provider.send("eth_getStorageAt", [ + contractAddress, + "0x1" + ]); assert.strictEqual(result2, "0x01"); }); it("returns the value at the 32-byte hex position", async () => { - const result = await provider.send("eth_getStorageAt", [contractAddress, "0x" + THIRTY_TWO_BYES]); + const result = await provider.send("eth_getStorageAt", [ + contractAddress, + "0x" + THIRTY_TWO_BYES + ]); assert.strictEqual(BigInt(result), 123n); const result2 = await provider.send("eth_getStorageAt", [ contractAddress, @@ -57,17 +68,26 @@ describe("api", () => { it("returns the value even when hex positions exceeds 32-bytes", async () => { const thirtyThreeBytePosition = "0x1" + THIRTY_TWO_BYES; - const result = await provider.send("eth_getStorageAt", [contractAddress, thirtyThreeBytePosition]); + const result = await provider.send("eth_getStorageAt", [ + contractAddress, + thirtyThreeBytePosition + ]); assert.strictEqual(BigInt(result), 123n); const thirtyThreeBytePosition2 = "0x" + THIRTY_TWO_BYES + "1"; - const result2 = await provider.send("eth_getStorageAt", [contractAddress, thirtyThreeBytePosition2]); + const result2 = await provider.send("eth_getStorageAt", [ + contractAddress, + thirtyThreeBytePosition2 + ]); assert.strictEqual(result2, "0x01"); }); it("rejects when the block doesn't exist", async () => { - await assert.rejects(provider.send("eth_getStorageAt", [contractAddress, "0x0", "0x2"]), { - message: "header not found" - }); + await assert.rejects( + provider.send("eth_getStorageAt", [contractAddress, "0x0", "0x2"]), + { + message: "header not found" + } + ); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts index 7ad2780ccb..f7de64d197 100644 --- a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts @@ -17,7 +17,9 @@ describe("api", () => { value: 1 } ]); - const receipt = await provider.send("eth_getTransactionReceipt", [hash]); + const receipt = await provider.send("eth_getTransactionReceipt", [ + hash + ]); assert.strictEqual(receipt, null); }); @@ -34,7 +36,9 @@ describe("api", () => { value: 1 } ]); - const receipt = await provider.send("eth_getTransactionReceipt", [hash]); + const receipt = await provider.send("eth_getTransactionReceipt", [ + hash + ]); assert.notStrictEqual(receipt, null); }); @@ -59,7 +63,11 @@ describe("api", () => { ] }, (e, r) => { - assert(e.message.includes("sender doesn't have enough funds to send tx")); + assert( + e.message.includes( + "sender doesn't have enough funds to send tx" + ) + ); assert.strictEqual(e.message, (r as any).error.message); assert.strictEqual((r as any).error.code, -32000); assert.strictEqual(typeof (r as any).error.data.result, "string"); diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/__tests__/api/eth/logs.test.ts index f73aa8d48b..45e91fc742 100644 --- a/src/chains/ethereum/__tests__/api/eth/logs.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/logs.test.ts @@ -18,7 +18,9 @@ describe("api", () => { provider = await getProvider(); accounts = await provider.send("eth_accounts"); - const subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + const subscriptionId = await provider.send("eth_subscribe", [ + "newHeads" + ]); const transactionHash = await provider.send("eth_sendTransaction", [ { from: accounts[0], @@ -27,7 +29,10 @@ describe("api", () => { } ]); await provider.once("message"); - const transactionReceipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + const transactionReceipt = await provider.send( + "eth_getTransactionReceipt", + [transactionHash] + ); contractAddress = transactionReceipt.contractAddress; await provider.send("eth_unsubscribe", [subscriptionId]); }); @@ -45,13 +50,17 @@ describe("api", () => { }; it("subscribes and unsubscribes", async () => { - const subscriptionId = await provider.send("eth_subscribe", ["logs"]); + const subscriptionId = await provider.send("eth_subscribe", [ + "logs" + ]); assert(subscriptionId != null); assert.notStrictEqual(subscriptionId, false); // subscribe again - const subscriptionId2 = await provider.send("eth_subscribe", ["logs"]); + const subscriptionId2 = await provider.send("eth_subscribe", [ + "logs" + ]); // trigger a log event, we should get two events const numberOfLogs = 4; @@ -60,26 +69,42 @@ describe("api", () => { contract.contract.evm.methodIdentifiers["logNTimes(uint8)"] + numberOfLogs.toString().padStart(64, "0"); const tx = { from: accounts[0], to: contractAddress, data }; - const subs = [onceMessageFor(subscriptionId), onceMessageFor(subscriptionId2)]; - const txHash = await provider.send("eth_sendTransaction", [{ ...tx }]); + const subs = [ + onceMessageFor(subscriptionId), + onceMessageFor(subscriptionId2) + ]; + const txHash = await provider.send("eth_sendTransaction", [ + { ...tx } + ]); const [message1, message2] = await Promise.all(subs); assert.deepStrictEqual(message1.data.result, message2.data.result); assert.strictEqual(message1.data.result.length, numberOfLogs); - const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); + const unsubResult = await provider.send("eth_unsubscribe", [ + subscriptionId + ]); assert.strictEqual(unsubResult, true); await provider.send("eth_sendTransaction", [{ ...tx }]); - const message = await Promise.race([onceMessageFor(subscriptionId), onceMessageFor(subscriptionId2)]); - assert.strictEqual(message.data.subscription, subscriptionId2, "unsubscribe didn't work"); + const message = await Promise.race([ + onceMessageFor(subscriptionId), + onceMessageFor(subscriptionId2) + ]); + assert.strictEqual( + message.data.subscription, + subscriptionId2, + "unsubscribe didn't work" + ); }); }); }); describe("getLogs", () => { it("should return a log for the constructor transaction", async () => { - const logs = await provider.send("eth_getLogs", [{ address: contractAddress }]); + const logs = await provider.send("eth_getLogs", [ + { address: contractAddress } + ]); assert.strictEqual(logs.length, 1); }); @@ -99,9 +124,13 @@ describe("api", () => { } ]); await provider.once("message"); - const txReceipt = await provider.send("eth_getTransactionReceipt", [txHash]); + const txReceipt = await provider.send("eth_getTransactionReceipt", [ + txHash + ]); assert.deepStrictEqual(txReceipt.logs.length, numberOfLogs); - const logs = await provider.send("eth_getLogs", [{ address: contractAddress }]); + const logs = await provider.send("eth_getLogs", [ + { address: contractAddress } + ]); assert.deepStrictEqual(logs, txReceipt.logs); }); @@ -150,7 +179,9 @@ describe("api", () => { } ]); // 0x3 await provider.once("message"); - const { blockNumber } = await provider.send("eth_getTransactionReceipt", [txHash]); + const { + blockNumber + } = await provider.send("eth_getTransactionReceipt", [txHash]); async function testGetLogs( fromBlock: string, @@ -158,7 +189,9 @@ describe("api", () => { expected: number, address: string = contractAddress ) { - const logs = await provider.send("eth_getLogs", [{ address, fromBlock, toBlock }]); + const logs = await provider.send("eth_getLogs", [ + { address, fromBlock, toBlock } + ]); assert.strictEqual( logs.length, expected, @@ -188,7 +221,9 @@ describe("api", () => { // mine an extra block await provider.send("evm_mine"); // 0x3 - const lastBlockNumber = `0x${(parseInt(blockNumber) + 1).toString(16)}`; + const lastBlockNumber = `0x${(parseInt(blockNumber) + 1).toString( + 16 + )}`; await provider.once("message"); // test variations of `earliest` and `0x0` @@ -204,8 +239,16 @@ describe("api", () => { await testGetLogs(genesisBlockNumber, "latest", numberOfLogs + 1); await testGetLogs(deployBlockNumber, "latest", numberOfLogs + 1); // test variations involving the last block number - await testGetLogs(genesisBlockNumber, lastBlockNumber, numberOfLogs + 1); - await testGetLogs(deployBlockNumber, lastBlockNumber, numberOfLogs + 1); + await testGetLogs( + genesisBlockNumber, + lastBlockNumber, + numberOfLogs + 1 + ); + await testGetLogs( + deployBlockNumber, + lastBlockNumber, + numberOfLogs + 1 + ); await testGetLogs(emptyBlockNumber, lastBlockNumber, numberOfLogs); await testGetLogs(lastBlockNumber, "latest", 0); await testGetLogs("latest", lastBlockNumber, 0); @@ -232,20 +275,39 @@ describe("api", () => { } ]); // 0x3 await provider.once("message"); - const { blockHash } = await provider.send("eth_getTransactionReceipt", [txHash]); + const { blockHash } = await provider.send( + "eth_getTransactionReceipt", + [txHash] + ); - async function testGetLogs(blockHash: string, expected: number, address: string = contractAddress) { - const logs = await provider.send("eth_getLogs", [{ address, blockHash }]); - assert.strictEqual(logs.length, expected, `there should be ${expected} log(s) at the ${blockHash} block`); + async function testGetLogs( + blockHash: string, + expected: number, + address: string = contractAddress + ) { + const logs = await provider.send("eth_getLogs", [ + { address, blockHash } + ]); + assert.strictEqual( + logs.length, + expected, + `there should be ${expected} log(s) at the ${blockHash} block` + ); } // tests blockHash - let { hash: genesisBlockHash } = await provider.send("eth_getBlockByNumber", [genesisBlockNumber]); + let { + hash: genesisBlockHash + } = await provider.send("eth_getBlockByNumber", [genesisBlockNumber]); await testGetLogs(blockHash, 4); await testGetLogs(genesisBlockHash, 0); - let { hash: deployBlockHash } = await provider.send("eth_getBlockByNumber", [deployBlockNumber]); + let { + hash: deployBlockHash + } = await provider.send("eth_getBlockByNumber", [deployBlockNumber]); await testGetLogs(deployBlockHash, 1, null); - let { hash: emptyBlockHash } = await provider.send("eth_getBlockByNumber", [emptyBlockNumber]); + let { + hash: emptyBlockHash + } = await provider.send("eth_getBlockByNumber", [emptyBlockNumber]); await testGetLogs(emptyBlockHash, 0); const invalidBlockHash = "0x123456789"; await testGetLogs(invalidBlockHash, 0); @@ -263,28 +325,40 @@ describe("api", () => { it("returns new blocks", async () => { await provider.send("eth_subscribe", ["newHeads"]); async function assertNoChanges() { - const noChanges = await provider.send("eth_getFilterChanges", [filterId]); + const noChanges = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(noChanges.length, 0); } const filterId = await provider.send("eth_newBlockFilter"); await assertNoChanges(); await provider.send("evm_mine"); await provider.once("message"); - const changes1 = await provider.send("eth_getFilterChanges", [filterId]); + const changes1 = await provider.send("eth_getFilterChanges", [ + filterId + ]); let blockNum = await provider.send("eth_blockNumber"); - let { hash } = await provider.send("eth_getBlockByNumber", [blockNum]); + let { hash } = await provider.send("eth_getBlockByNumber", [ + blockNum + ]); assert.strictEqual(changes1[0], hash); await assertNoChanges(); await provider.send("evm_mine"); await provider.once("message"); blockNum = await provider.send("eth_blockNumber"); - let { hash: hash2 } = await provider.send("eth_getBlockByNumber", [blockNum]); + let { hash: hash2 } = await provider.send("eth_getBlockByNumber", [ + blockNum + ]); await provider.send("evm_mine"); await provider.once("message"); blockNum = await provider.send("eth_blockNumber"); - let { hash: hash3 } = await provider.send("eth_getBlockByNumber", [blockNum]); + let { hash: hash3 } = await provider.send("eth_getBlockByNumber", [ + blockNum + ]); - const changes2 = await provider.send("eth_getFilterChanges", [filterId]); + const changes2 = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(changes2[0], hash2); assert.strictEqual(changes2[1], hash3); await assertNoChanges(); @@ -295,15 +369,21 @@ describe("api", () => { it("returns new pending transactions", async () => { await provider.send("eth_subscribe", ["newPendingTransactions"]); async function assertNoChanges() { - const noChanges = await provider.send("eth_getFilterChanges", [filterId]); + const noChanges = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(noChanges.length, 0); } - const filterId = await provider.send("eth_newPendingTransactionFilter"); + const filterId = await provider.send( + "eth_newPendingTransactionFilter" + ); const tx = { from: accounts[0], to: accounts[0] }; await assertNoChanges(); provider.send("eth_sendTransaction", [{ ...tx }]); let hash = await provider.once("message"); - const changes1 = await provider.send("eth_getFilterChanges", [filterId]); + const changes1 = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(changes1[0], hash.data.result); await assertNoChanges(); provider.send("eth_sendTransaction", [{ ...tx }]); @@ -311,7 +391,9 @@ describe("api", () => { provider.send("eth_sendTransaction", [{ ...tx }]); let hash3 = await provider.once("message"); - const changes2 = await provider.send("eth_getFilterChanges", [filterId]); + const changes2 = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(changes2[0], hash2.data.result); assert.strictEqual(changes2[1], hash3.data.result); await assertNoChanges(); @@ -322,7 +404,9 @@ describe("api", () => { it("returns new logs", async () => { await provider.send("eth_subscribe", ["newHeads"]); async function assertNoChanges() { - const noChanges = await provider.send("eth_getFilterChanges", [filterId]); + const noChanges = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(noChanges.length, 0); } const filterId = await provider.send("eth_newFilter"); @@ -335,7 +419,9 @@ describe("api", () => { await assertNoChanges(); provider.send("eth_sendTransaction", [{ ...tx }]); let hash = await provider.once("message"); - const changes1 = await provider.send("eth_getFilterChanges", [filterId]); + const changes1 = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(changes1.length, 1); await assertNoChanges(); provider.send("eth_sendTransaction", [{ ...tx }]); @@ -343,7 +429,9 @@ describe("api", () => { provider.send("eth_sendTransaction", [{ ...tx }]); let hash3 = await provider.once("message"); - const changes2 = await provider.send("eth_getFilterChanges", [filterId]); + const changes2 = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(changes2.length, 2); await assertNoChanges(); }); @@ -353,11 +441,17 @@ describe("api", () => { it("returns new logs", async () => { await provider.send("eth_subscribe", ["newHeads"]); async function assertNoChanges() { - const noChanges = await provider.send("eth_getFilterChanges", [filterId]); + const noChanges = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(noChanges.length, 0); } - const currentBlockNumber = "0x" + (parseInt(await provider.send("eth_blockNumber")) + 1).toString(16); - const filterId = await provider.send("eth_newFilter", [{ fromBlock: currentBlockNumber, toBlock: "0x99" }]); + const currentBlockNumber = + "0x" + + (parseInt(await provider.send("eth_blockNumber")) + 1).toString(16); + const filterId = await provider.send("eth_newFilter", [ + { fromBlock: currentBlockNumber, toBlock: "0x99" } + ]); const numberOfLogs = 1; const data = "0x" + @@ -367,7 +461,9 @@ describe("api", () => { await assertNoChanges(); provider.send("eth_sendTransaction", [{ ...tx }]); let hash = await provider.once("message"); - const changes1 = await provider.send("eth_getFilterChanges", [filterId]); + const changes1 = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(changes1.length, 1); await assertNoChanges(); provider.send("eth_sendTransaction", [{ ...tx }]); @@ -375,11 +471,15 @@ describe("api", () => { provider.send("eth_sendTransaction", [{ ...tx }]); let hash3 = await provider.once("message"); - const changes2 = await provider.send("eth_getFilterChanges", [filterId]); + const changes2 = await provider.send("eth_getFilterChanges", [ + filterId + ]); assert.strictEqual(changes2.length, 2); await assertNoChanges(); - const allChanges = await provider.send("eth_getFilterLogs", [filterId]); + const allChanges = await provider.send("eth_getFilterLogs", [ + filterId + ]); assert.deepStrictEqual(allChanges, [...changes1, ...changes2]); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts index 6f4a9257b4..ec60545620 100644 --- a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts @@ -7,7 +7,8 @@ import Common from "ethereumjs-common"; describe("api", () => { describe("eth", () => { describe("eth_sendRawTransaction*", () => { - let secretKey = "0x4c3fc38239e503913706205746ef2dcc54a5ea9971988bfcac136b43e3190841"; + let secretKey = + "0x4c3fc38239e503913706205746ef2dcc54a5ea9971988bfcac136b43e3190841"; let provider: EthereumProvider; let accounts: string[]; const common = Common.forCustomChain( @@ -45,10 +46,14 @@ describe("api", () => { transaction.sign(secretKeyBuffer); await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendRawTransaction", [transaction.serialize()]); + const txHash = await provider.send("eth_sendRawTransaction", [ + transaction.serialize() + ]); await provider.once("message"); - const receipt = await provider.send("eth_getTransactionReceipt", [txHash]); + const receipt = await provider.send("eth_getTransactionReceipt", [ + txHash + ]); assert.strictEqual(receipt.transactionHash, txHash); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts index 34db5b90ff..50c518b3c6 100644 --- a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts @@ -10,8 +10,13 @@ describe("api", () => { describe("sendTransaction", () => { describe("contracts", () => { describe("revert", () => { - async function deployContract(provider: EthereumProvider, accounts: string[]) { - const contract = compile(join(__dirname, "./contracts/Reverts.sol")); + async function deployContract( + provider: EthereumProvider, + accounts: string[] + ) { + const contract = compile( + join(__dirname, "./contracts/Reverts.sol") + ); const from = accounts[0]; @@ -27,7 +32,9 @@ describe("api", () => { await provider.once("message"); - const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); + const receipt = await provider.send("eth_getTransactionReceipt", [ + transactionHash + ]); assert.strictEqual(receipt.blockNumber, "0x1"); const contractAddress = receipt.contractAddress; @@ -41,7 +48,10 @@ describe("api", () => { async function test(opts: EthereumProviderOptions) { const provider = await getProvider(opts); const accounts = await provider.send("eth_accounts"); - const { contract, contractAddress } = await deployContract(provider, accounts); + const { contract, contractAddress } = await deployContract( + provider, + accounts + ); const contractMethods = contract.contract.evm.methodIdentifiers; const prom = provider.send("eth_call", [ { @@ -51,19 +61,36 @@ describe("api", () => { } ]); - const revertString = "0x08c379a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0"; + const revertString = + "0x08c379a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0"; if (opts.chain.vmErrorsOnRPCResponse) { const result = await prom.catch(e => e); - assert.strictEqual(result.code, -32000, "Error code should be -32000"); - assert.strictEqual(result.data.reason, null, "The reason is undecodable, and thus should be null"); + assert.strictEqual( + result.code, + -32000, + "Error code should be -32000" + ); + assert.strictEqual( + result.data.reason, + null, + "The reason is undecodable, and thus should be null" + ); assert.strictEqual( result.data.message, "revert", "The message should not have a reason string included" ); - assert.strictEqual(result.data.result, revertString, "The revert reason should be encoded as hex"); + assert.strictEqual( + result.data.result, + revertString, + "The revert reason should be encoded as hex" + ); } else { - assert.strictEqual(await prom, revertString, "The revert reason should be encoded as hex"); + assert.strictEqual( + await prom, + revertString, + "The revert reason should be encoded as hex" + ); } } await test({ chain: { vmErrorsOnRPCResponse: false } }); diff --git a/src/chains/ethereum/__tests__/api/eth/sign.test.ts b/src/chains/ethereum/__tests__/api/eth/sign.test.ts index bc3340e238..f9ab5ff051 100644 --- a/src/chains/ethereum/__tests__/api/eth/sign.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sign.test.ts @@ -1,5 +1,10 @@ import assert from "assert"; -import { ecrecover, pubToAddress, fromSigned, hashPersonalMessage } from "ethereumjs-util"; +import { + ecrecover, + pubToAddress, + fromSigned, + hashPersonalMessage +} from "ethereumjs-util"; import getProvider from "../../helpers/getProvider"; import { Data } from "@ganache/utils"; @@ -15,7 +20,8 @@ describe("api", () => { // '0x07091653daf94aafce9acf09e22dbde1ddf77f740f9844ac1f0ab790334f0627'. (See Issue #190) const acc = { balance: "0x0", - secretKey: "0xe6d66f02cd45a13982b99a5abf3deab1f67cf7be9fee62f0a072cb70896342e4" + secretKey: + "0xe6d66f02cd45a13982b99a5abf3deab1f67cf7be9fee62f0a072cb70896342e4" }; provider = await getProvider({ wallet: { @@ -30,7 +36,10 @@ describe("api", () => { const msgHash = hashPersonalMessage(msg); const address = accounts[0]; - let sgn = await provider.send("eth_sign", [address, Data.from(msg).toString()]); + let sgn = await provider.send("eth_sign", [ + address, + Data.from(msg).toString() + ]); sgn = sgn.slice(2); const r = Buffer.from(sgn.slice(0, 64), "hex"); @@ -45,7 +54,8 @@ describe("api", () => { it("should work if ecsign produces 'r' or 's' components that start with 0", async () => { // This message produces a zero prefixed 'r' component when signed by // ecsign w/ the account set in this test's 'before' block. - const msgHex = "0x07091653daf94aafce9acf09e22dbde1ddf77f740f9844ac1f0ab790334f0627"; + const msgHex = + "0x07091653daf94aafce9acf09e22dbde1ddf77f740f9844ac1f0ab790334f0627"; const edgeCaseMsg = Data.from(msgHex).toBuffer(); const msgHash = hashPersonalMessage(edgeCaseMsg); diff --git a/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts b/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts index 9ec6e1814e..8463e12088 100644 --- a/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts @@ -62,7 +62,10 @@ describe("api", () => { } }; - const result = await provider.send("eth_signTypedData", [accounts[0], typedData]); + const result = await provider.send("eth_signTypedData", [ + accounts[0], + typedData + ]); assert.strictEqual( result, "0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c" @@ -102,7 +105,10 @@ describe("api", () => { message: { from: { name: "Cow", - wallets: ["0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", "0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF"] + wallets: [ + "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", + "0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF" + ] }, to: [ { @@ -118,7 +124,10 @@ describe("api", () => { } }; - const result = await provider.send("eth_signTypedData", [accounts[0], typedData]); + const result = await provider.send("eth_signTypedData", [ + accounts[0], + typedData + ]); assert.strictEqual( result, "0x65cbd956f2fae28a601bebc9b906cea0191744bd4c4247bcd27cd08f8eb6b71c78efdf7a31dc9abee78f492292721f362d296cf86b4538e07b51303b67f749061b" diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts index bf7b02d4af..460d87dd77 100644 --- a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts @@ -29,14 +29,20 @@ describe("api", () => { describe("newHeads", () => { it("subscribes and unsubscribes", async () => { const timestamp = ((+now / 1000) | 0) + 1; - const startingBlockNumber = parseInt(await provider.send("eth_blockNumber")); - const subscriptionId = await provider.send("eth_subscribe", ["newHeads"]); + const startingBlockNumber = parseInt( + await provider.send("eth_blockNumber") + ); + const subscriptionId = await provider.send("eth_subscribe", [ + "newHeads" + ]); assert(subscriptionId != null); assert.notStrictEqual(subscriptionId, false); // subscribe again - const subscriptionId2 = await provider.send("eth_subscribe", ["newHeads"]); + const subscriptionId2 = await provider.send("eth_subscribe", [ + "newHeads" + ]); // trigger a mine, we should get two events await provider.send("evm_mine", [timestamp]); @@ -50,7 +56,10 @@ describe("api", () => { firstMessage = message; } if (counter === 2) { - assert.deepStrictEqual(firstMessage.data.result, message.data.result); + assert.deepStrictEqual( + firstMessage.data.result, + message.data.result + ); resolve(firstMessage); } }); @@ -64,32 +73,42 @@ describe("api", () => { extraData: "0x", gasLimit: gasLimit, gasUsed: "0x0", - hash: "0xf821422e084d82d550019e555b656b9113c9af45c4c03fad670caaa9b5d8acde", + hash: + "0xf821422e084d82d550019e555b656b9113c9af45c4c03fad670caaa9b5d8acde", logsBloom: `0x${"0".repeat(512)}`, miner: `0x${"0".repeat(40)}`, mixHash: `0x${"0".repeat(64)}`, nonce: "0x0000000000000000", number: Quantity.from(startingBlockNumber + 1).toString(), - parentHash: "0x746144f35cfbcc1bb8ea1dcd540b674c81cc25ffec8fa1ec42d444cba9678cc2", - receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - stateRoot: "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", + parentHash: + "0x746144f35cfbcc1bb8ea1dcd540b674c81cc25ffec8fa1ec42d444cba9678cc2", + receiptsRoot: + "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + sha3Uncles: + "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + stateRoot: + "0x8281cb204e0242d2d9178e392b60eaf4563ae5ffc4897c9c6cf6e99a4d35aff3", timestamp: Quantity.from(timestamp).toString(), - transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + transactionsRoot: + "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" }, subscription: subscriptionId } }); // trigger a mine... we should only get a _single_ message this time - const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); + const unsubResult = await provider.send("eth_unsubscribe", [ + subscriptionId + ]); assert.strictEqual(unsubResult, true); await provider.send("evm_mine", [timestamp]); await assert.doesNotReject( new Promise((resolve, reject) => { provider.on("message", async (message: any) => { if (subscriptionId2 === message.data.subscription) { - const blockNumber = parseInt(await provider.send("eth_blockNumber")); + const blockNumber = parseInt( + await provider.send("eth_blockNumber") + ); assert.strictEqual(blockNumber, startingBlockNumber + 2); resolve(void 0); @@ -104,13 +123,17 @@ describe("api", () => { describe("newPendingTransactions", () => { it("subscribes and unsubscribes", async () => { - const subscriptionId = await provider.send("eth_subscribe", ["newPendingTransactions"]); + const subscriptionId = await provider.send("eth_subscribe", [ + "newPendingTransactions" + ]); assert(subscriptionId != null); assert.notStrictEqual(subscriptionId, false); // subscribe again - const subscriptionId2 = await provider.send("eth_subscribe", ["newPendingTransactions"]); + const subscriptionId2 = await provider.send("eth_subscribe", [ + "newPendingTransactions" + ]); let messagePromise = new Promise(resolve => { let firstMessage; @@ -120,7 +143,10 @@ describe("api", () => { firstMessage = message; } if (counter === 2) { - assert.deepStrictEqual(firstMessage.data.result, message.data.result); + assert.deepStrictEqual( + firstMessage.data.result, + message.data.result + ); resolve(firstMessage); } }); @@ -128,7 +154,9 @@ describe("api", () => { // trigger a pendingTransaction, we should get two events const tx = { from: accounts[0], to: accounts[0] }; - const txHash = await provider.send("eth_sendTransaction", [{ ...tx }]); + const txHash = await provider.send("eth_sendTransaction", [ + { ...tx } + ]); let counter = 0; const message = await messagePromise; @@ -142,7 +170,9 @@ describe("api", () => { }); // trigger a mine... we should only get a _single_ message this time - const unsubResult = await provider.send("eth_unsubscribe", [subscriptionId]); + const unsubResult = await provider.send("eth_unsubscribe", [ + subscriptionId + ]); assert.strictEqual(unsubResult, true); messagePromise = new Promise((resolve, reject) => { provider.on("message", async (message: any) => { @@ -155,7 +185,9 @@ describe("api", () => { } }); }); - const txHash2 = await provider.send("eth_sendTransaction", [{ ...tx }]); + const txHash2 = await provider.send("eth_sendTransaction", [ + { ...tx } + ]); await assert.doesNotReject(messagePromise); }); }); diff --git a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts index 9347f6da38..5ee221542a 100644 --- a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/uncles.test.ts @@ -25,7 +25,9 @@ describe("api", () => { await provider.once("message"); const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - const count = await provider.send("eth_getUncleCountByBlockHash", [block.hash]); + const count = await provider.send("eth_getUncleCountByBlockHash", [ + block.hash + ]); assert.strictEqual(count, "0x0"); }); @@ -40,7 +42,9 @@ describe("api", () => { ]); await provider.once("message"); - const count = await provider.send("eth_getUncleCountByBlockNumber", ["0x1"]); + const count = await provider.send("eth_getUncleCountByBlockNumber", [ + "0x1" + ]); assert.strictEqual(count, "0x0"); }); @@ -56,7 +60,10 @@ describe("api", () => { await provider.once("message"); const block = await provider.send("eth_getBlockByNumber", ["0x1"]); - const result = await provider.send("eth_getUncleByBlockHashAndIndex", [block.hash, "0x0"]); + const result = await provider.send("eth_getUncleByBlockHashAndIndex", [ + block.hash, + "0x0" + ]); assert.deepStrictEqual(result, null); }); @@ -71,7 +78,10 @@ describe("api", () => { ]); await provider.once("message"); - const result = await provider.send("eth_getUncleByBlockNumberAndIndex", ["0x1", "0x0"]); + const result = await provider.send( + "eth_getUncleByBlockNumberAndIndex", + ["0x1", "0x0"] + ); assert.deepStrictEqual(result, null); }); }); diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/__tests__/api/evm/evm.test.ts index da2d88e629..0b824229ee 100644 --- a/src/chains/ethereum/__tests__/api/evm/evm.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/evm.test.ts @@ -33,7 +33,9 @@ describe("api", () => { // fast forward time by 10 seconds (plus 2 seconds in case testing is slow) const newTime = now + 10000 + 2000; - const timeAdjustment = await provider.send("evm_setTime", [`0x${newTime.toString(16)}`]); + const timeAdjustment = await provider.send("evm_setTime", [ + `0x${newTime.toString(16)}` + ]); // it should return `newTime - now`, floored to the nearest second const baseLineOffset = Math.floor((newTime - now) / 1000); @@ -58,14 +60,18 @@ describe("api", () => { it("should return the `timeAdjustment` value via `evm_increaseTime` when provided as a number", async () => { const provider = await getProvider(); const seconds = 10; - const timeAdjustment = await provider.send("evm_increaseTime", [seconds]); + const timeAdjustment = await provider.send("evm_increaseTime", [ + seconds + ]); assert.strictEqual(timeAdjustment, seconds); }); it("should return the `timeAdjustment` value via `evm_increaseTime` when provided as hex string", async () => { const provider = await getProvider(); const seconds = 10; - const timeAdjustment = await provider.send("evm_increaseTime", [`0x${seconds.toString(16)}`]); + const timeAdjustment = await provider.send("evm_increaseTime", [ + `0x${seconds.toString(16)}` + ]); assert.strictEqual(timeAdjustment, seconds); }); }); @@ -81,10 +87,14 @@ describe("api", () => { it("should mine a block on demand at the specified timestamp", async () => { const startDate = new Date(2019, 3, 15); - const miningTimestamp = Math.floor(new Date(2020, 3, 15).getTime() / 1000); + const miningTimestamp = Math.floor( + new Date(2020, 3, 15).getTime() / 1000 + ); const provider = await getProvider({ chain: { time: startDate } }); await provider.send("evm_mine", [miningTimestamp]); - const currentBlock = await provider.send("eth_getBlockByNumber", ["latest"]); + const currentBlock = await provider.send("eth_getBlockByNumber", [ + "latest" + ]); assert.strictEqual(parseInt(currentBlock.timestamp), miningTimestamp); }); @@ -120,11 +130,18 @@ describe("api", () => { const provider = await getProvider(); const [account] = await provider.send("eth_accounts"); const newCount = Quantity.from(1000); - const initialCount = parseInt(await provider.send("eth_getTransactionCount", [account])); + const initialCount = parseInt( + await provider.send("eth_getTransactionCount", [account]) + ); assert.strictEqual(initialCount, 0); - const status = await provider.send("evm_setAccountNonce", [account, newCount.toString()]); + const status = await provider.send("evm_setAccountNonce", [ + account, + newCount.toString() + ]); assert.strictEqual(status, true); - const afterCount = parseInt(await provider.send("eth_getTransactionCount", [account])); + const afterCount = parseInt( + await provider.send("eth_getTransactionCount", [account]) + ); assert.strictEqual(afterCount, newCount.toNumber()); }); }); @@ -138,11 +155,15 @@ describe("api", () => { it("should unlock any account after server has been started", async () => { const address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"; - const result1 = await provider.send("evm_unlockUnknownAccount", [address]); + const result1 = await provider.send("evm_unlockUnknownAccount", [ + address + ]); assert.strictEqual(result1, true); // should return `false` if account was already locked - const result2 = await provider.send("evm_unlockUnknownAccount", [address]); + const result2 = await provider.send("evm_unlockUnknownAccount", [ + address + ]); assert.strictEqual(result2, false); }); @@ -165,35 +186,53 @@ describe("api", () => { it("should lock any unlocked unknown account via evm_lockUnknownAccount", async () => { const address = "0x842d35Cc6634C0532925a3b844Bc454e4438f44f"; - const unlockResult = await provider.send("evm_unlockUnknownAccount", [address]); + const unlockResult = await provider.send("evm_unlockUnknownAccount", [ + address + ]); assert.strictEqual(unlockResult, true); - const lockResult1 = await provider.send("evm_lockUnknownAccount", [address]); + const lockResult1 = await provider.send("evm_lockUnknownAccount", [ + address + ]); assert.strictEqual(lockResult1, true); // bonus: also make sure we return false when the account is already locked: - const lockResult2 = await provider.send("evm_lockUnknownAccount", [address]); + const lockResult2 = await provider.send("evm_lockUnknownAccount", [ + address + ]); assert.strictEqual(lockResult2, false); }); it("should not lock a known account via evm_lockUnknownAccount", async () => { - await assert.rejects(provider.send("evm_lockUnknownAccount", [accounts[0]]), { - message: "cannot lock known/personal account" - }); + await assert.rejects( + provider.send("evm_lockUnknownAccount", [accounts[0]]), + { + message: "cannot lock known/personal account" + } + ); }); it("should not lock a personal account via evm_lockUnknownAccount", async () => { // create a new personal account - const address = await provider.send("personal_newAccount", ["password"]); + const address = await provider.send("personal_newAccount", [ + "password" + ]); // then explicitly unlock it - const result = await provider.send("personal_unlockAccount", [address, "password", 0]); + const result = await provider.send("personal_unlockAccount", [ + address, + "password", + 0 + ]); assert.strictEqual(result, true); // then try to lock it via evm_lockUnknownAccount - await assert.rejects(provider.send("evm_lockUnknownAccount", [address]), { - message: "cannot lock known/personal account" - }); + await assert.rejects( + provider.send("evm_lockUnknownAccount", [address]), + { + message: "cannot lock known/personal account" + } + ); }); it("should return `false` upon lock if account isn't locked (unknown account)", async () => { diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 3b4133a4d6..a2f91dbc62 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -32,7 +32,9 @@ describe("api", () => { await p.once("message"); - const receipt = await p.send("eth_getTransactionReceipt", [transactionHash]); + const receipt = await p.send("eth_getTransactionReceipt", [ + transactionHash + ]); assert.strictEqual(receipt.blockNumber, "0x1"); const to = receipt.contractAddress; @@ -79,7 +81,9 @@ describe("api", () => { balance = BigInt(balance); // Assert the starting balance is where we think it is, including tx costs. - assert(balance > 98900000000000000000 && balance < 99000000000000000000); + assert( + balance > 98900000000000000000 && balance < 99000000000000000000 + ); startingBalance = balance; // Now checkpoint. @@ -105,7 +109,9 @@ describe("api", () => { balance = BigInt(balance); // Assert the starting balance is where we think it is, including tx costs. - assert(balance > 97900000000000000000n && balance < 98000000000000000000n); + assert( + balance > 97900000000000000000n && balance < 98000000000000000000n + ); const status = await send("evm_revert", [snapshotId]); @@ -114,10 +120,19 @@ describe("api", () => { let revertedBalance = await send("eth_getBalance", [accounts[0]]); revertedBalance = BigInt(revertedBalance); - assert(revertedBalance === startingBalance, "Should have reverted back to the starting balance"); + assert( + revertedBalance === startingBalance, + "Should have reverted back to the starting balance" + ); - const oldReceipt = await send("eth_getTransactionReceipt", [transactionHash]); - assert.strictEqual(oldReceipt, null, "Receipt should be null as it should have been removed"); + const oldReceipt = await send("eth_getTransactionReceipt", [ + transactionHash + ]); + assert.strictEqual( + oldReceipt, + null, + "Receipt should be null as it should have been removed" + ); }); it("returns false when reverting a snapshot that doesn't exist", async () => { @@ -126,13 +141,29 @@ describe("api", () => { const snapShotId1 = await send("evm_snapshot"); const snapShotId2 = await send("evm_snapshot"); const response1 = await send("evm_revert", [snapShotId1]); - assert.strictEqual(response1, true, "Reverting a snapshot that exists does not work"); + assert.strictEqual( + response1, + true, + "Reverting a snapshot that exists does not work" + ); const response2 = await send("evm_revert", [snapShotId2]); - assert.strictEqual(response2, false, "Reverting a snapshot that no longer exists does not work"); + assert.strictEqual( + response2, + false, + "Reverting a snapshot that no longer exists does not work" + ); const response3 = await send("evm_revert", [snapShotId1]); - assert.strictEqual(response3, false, "Reverting a snapshot that hasn't already been reverted does not work"); + assert.strictEqual( + response3, + false, + "Reverting a snapshot that hasn't already been reverted does not work" + ); const response4 = await send("evm_revert", [999]); - assert.strictEqual(response4, false, "Reverting a snapshot that has never existed does not work"); + assert.strictEqual( + response4, + false, + "Reverting a snapshot that has never existed does not work" + ); }); it("checkpoints and reverts without persisting contract storage", async () => { @@ -144,17 +175,29 @@ describe("api", () => { await instance.inc({ from: accounts[0] }); const n2 = await instance.n(); - assert.strictEqual(parseInt(n2), 43, "n is not 43 after first call to `inc`"); + assert.strictEqual( + parseInt(n2), + 43, + "n is not 43 after first call to `inc`" + ); await send("evm_revert", [snapShotId]); const n3 = await instance.n(); - assert.strictEqual(parseInt(n3), 42, "n is not 42 after reverting snapshot"); + assert.strictEqual( + parseInt(n3), + 42, + "n is not 42 after reverting snapshot" + ); // this is the real test. what happened was that the vm's contract storage // trie cache wasn't cleared when the vm's stateManager cache was cleared. await instance.inc({ from: accounts[0] }); const n4 = await instance.n(); - assert.strictEqual(parseInt(n4), 43, "n is not 43 after calling `inc` again"); + assert.strictEqual( + parseInt(n4), + 43, + "n is not 43 after calling `inc` again" + ); }); it("evm_revert rejects invalid subscriptionId types without crashing", async () => { @@ -176,7 +219,11 @@ describe("api", () => { const ids = [null, undefined]; await Promise.all( ids.map(id => - assert.rejects(send("evm_revert", [id]), /invalid snapshotId/, "evm_revert did not reject as expected") + assert.rejects( + send("evm_revert", [id]), + /invalid snapshotId/, + "evm_revert did not reject as expected" + ) ) ); }); @@ -184,7 +231,11 @@ describe("api", () => { it("evm_revert returns false for out-of-range subscriptionId values", async () => { const { send } = context; const ids = [-1, Buffer.from([0])]; - const promises = ids.map(id => send("evm_revert", [id]).then(result => assert.strictEqual(result, false))); + const promises = ids.map(id => + send("evm_revert", [id]).then(result => + assert.strictEqual(result, false) + ) + ); await Promise.all(promises); }); @@ -208,12 +259,17 @@ describe("api", () => { // they've been accepted by the transaction pool. const txHashes = await Promise.all(inFlightTxs); - const getReceipt = (hash: string) => send("eth_getTransactionReceipt", [hash]); - const getTx = (hash: string) => send("eth_getTransactionByHash", [hash]); + const getReceipt = (hash: string) => + send("eth_getTransactionReceipt", [hash]); + const getTx = (hash: string) => + send("eth_getTransactionByHash", [hash]); const receiptsProm = Promise.all(txHashes.map(getReceipt)); const transactionsProm = Promise.all(txHashes.map(getTx)); - const [receipts, transactions] = await Promise.all([receiptsProm, transactionsProm]); + const [receipts, transactions] = await Promise.all([ + receiptsProm, + transactionsProm + ]); // verify that we don't yet have a receipt receipts.forEach(receipt => { @@ -222,7 +278,11 @@ describe("api", () => { // and that the transations were all accepted transactions.forEach(transaction => { - assert.notStrictEqual(transaction, null, "Transaction should not be null"); + assert.notStrictEqual( + transaction, + null, + "Transaction should not be null" + ); }); // revert while these transactions are being mined @@ -230,7 +290,10 @@ describe("api", () => { const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalTransactionsProm = Promise.all(txHashes.map(getTx)); - const [finalReceipts, finalTransactions] = await Promise.all([finalReceiptsProm, finalTransactionsProm]); + const [finalReceipts, finalTransactions] = await Promise.all([ + finalReceiptsProm, + finalTransactionsProm + ]); // verify that we don't have any receipts finalReceipts.forEach(receipt => { @@ -256,30 +319,45 @@ describe("api", () => { let value = 1; // send some transactions - const accountNonce = parseInt(await send("eth_getTransactionCount", [from]), 16); + const accountNonce = parseInt( + await send("eth_getTransactionCount", [from]), + 16 + ); const inFlightTxs = [ - send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce + 1 }]), - send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce + 2 }]) + send("eth_sendTransaction", [ + { from, to, value: value++, nonce: accountNonce + 1 } + ]), + send("eth_sendTransaction", [ + { from, to, value: value++, nonce: accountNonce + 2 } + ]) ]; // wait for the tx hashes to be returned; this is confirmation that // they've been accepted by the transaction pool. const txHashes = await Promise.all(inFlightTxs); - const getReceipt = (hash: string) => send("eth_getTransactionReceipt", [hash]); - const getTx = (hash: string) => send("eth_getTransactionByHash", [hash]); + const getReceipt = (hash: string) => + send("eth_getTransactionReceipt", [hash]); + const getTx = (hash: string) => + send("eth_getTransactionByHash", [hash]); const transactions = await Promise.all(txHashes.map(getTx)); // and that the transations were all accepted transactions.forEach(transaction => { - assert.notStrictEqual(transaction, null, "Transaction should not be null"); + assert.notStrictEqual( + transaction, + null, + "Transaction should not be null" + ); }); // revert while these transactions are pending await send("evm_revert", [snapShotId]); // mine a transaction to fill in the nonce gap (this would normally cause the pending transactions to be mined) - await send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce }]); + await send("eth_sendTransaction", [ + { from, to, value: value++, nonce: accountNonce } + ]); await provider.once("message"); // and mine one more block just to force the any transactions to be immediately mined @@ -287,7 +365,10 @@ describe("api", () => { const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalTransactionsProm = Promise.all(txHashes.map(getTx)); - const [finalReceipts, finalTransactions] = await Promise.all([finalReceiptsProm, finalTransactionsProm]); + const [finalReceipts, finalTransactions] = await Promise.all([ + finalReceiptsProm, + finalTransactionsProm + ]); // verify that we don't have any receipts finalReceipts.forEach(receipt => { @@ -307,7 +388,10 @@ describe("api", () => { accounts: [from, to] } = context; - const accountNonce = parseInt(await send("eth_getTransactionCount", [from]), 16); + const accountNonce = parseInt( + await send("eth_getTransactionCount", [from]), + 16 + ); const snapShotId = await send("evm_snapshot"); @@ -315,7 +399,9 @@ describe("api", () => { let value = 1; // send a transaction so we have something to revert - const revertedTx = await send("eth_sendTransaction", [{ from, to, value: value++ }]); + const revertedTx = await send("eth_sendTransaction", [ + { from, to, value: value++ } + ]); await provider.once("message"); // revert while these transactions are being mined @@ -329,8 +415,12 @@ describe("api", () => { // these two transactions have nonces that are too high to be executed immediately const laterTxs = [ - send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce + 3 }]), - send("eth_sendTransaction", [{ from, to, value: value++, nonce: accountNonce + 3 }]) + send("eth_sendTransaction", [ + { from, to, value: value++, nonce: accountNonce + 3 } + ]), + send("eth_sendTransaction", [ + { from, to, value: value++, nonce: accountNonce + 3 } + ]) ]; const txsMinedProm = new Promise(resolve => { let count = 0; @@ -346,12 +436,18 @@ describe("api", () => { // they've been accepted by the transaction pool. const txHashPromises = Promise.all(inFlightTxs); - const getReceipt = (hash: string) => send("eth_getTransactionReceipt", [hash]); - const getTx = (hash: string) => send("eth_getTransactionByHash", [hash]); + const getReceipt = (hash: string) => + send("eth_getTransactionReceipt", [hash]); + const getTx = (hash: string) => + send("eth_getTransactionByHash", [hash]); // wait for the revert to finish up const result = await Promise.race([revertPromise, txHashPromises]); - assert.strictEqual(result, true, "evm_revert should finish before the transaction hashes are returned"); + assert.strictEqual( + result, + true, + "evm_revert should finish before the transaction hashes are returned" + ); // wait for the inFlightTxs to be mined await txsMinedProm; @@ -364,7 +460,10 @@ describe("api", () => { const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalTransactionsProm = Promise.all(txHashes.map(getTx)); - const [finalReceipts, finalTransactions] = await Promise.all([finalReceiptsProm, finalTransactionsProm]); + const [finalReceipts, finalTransactions] = await Promise.all([ + finalReceiptsProm, + finalTransactionsProm + ]); // verify that we do have the receipts finalReceipts.forEach(receipt => { @@ -373,7 +472,11 @@ describe("api", () => { // and we do have the transactions finalTransactions.forEach(transaction => { - assert.notStrictEqual(transaction, null, "Transaction should not be null"); + assert.notStrictEqual( + transaction, + null, + "Transaction should not be null" + ); }); const laterTxsReceiptsProm = Promise.all(laterHashes.map(getReceipt)); @@ -390,7 +493,11 @@ describe("api", () => { // and we DO have the transactions laterTxsTransactions.forEach(transaction => { - assert.notStrictEqual(transaction, null, "Transaction should not be null"); + assert.notStrictEqual( + transaction, + null, + "Transaction should not be null" + ); }); // send one more transaction to fill in the gap @@ -408,7 +515,10 @@ describe("api", () => { const finalLaterTxsReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalLaterTxsTransactionsProm = Promise.all(txHashes.map(getTx)); - const [finalLaterTxsReceipts, finalLaterTxsTransactions] = await Promise.all([ + const [ + finalLaterTxsReceipts, + finalLaterTxsTransactions + ] = await Promise.all([ finalLaterTxsReceiptsProm, finalLaterTxsTransactionsProm ]); @@ -420,13 +530,25 @@ describe("api", () => { // and we do have the transactions finalLaterTxsTransactions.forEach(transaction => { - assert.notStrictEqual(transaction, null, "Transaction should not be null"); + assert.notStrictEqual( + transaction, + null, + "Transaction should not be null" + ); }); const revertedTxReceipt = await getReceipt(revertedTx); const revertedTxTransactions = await getTx(revertedTx); - assert.strictEqual(revertedTxReceipt, null, "First transaction should not have a receipt"); - assert.strictEqual(revertedTxTransactions, null, "First transaction should not have a tx"); + assert.strictEqual( + revertedTxReceipt, + null, + "First transaction should not have a receipt" + ); + assert.strictEqual( + revertedTxTransactions, + null, + "First transaction should not have a tx" + ); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/miner/miner.test.ts b/src/chains/ethereum/__tests__/api/miner/miner.test.ts index 423a55623f..9d418e2e28 100644 --- a/src/chains/ethereum/__tests__/api/miner/miner.test.ts +++ b/src/chains/ethereum/__tests__/api/miner/miner.test.ts @@ -14,7 +14,9 @@ describe("api", () => { describe("miner_stop/eth_mining/miner_start", () => { async function testStopStartMining(provider) { - const initialBlockNumber = parseInt(await provider.send("eth_blockNumber")); + const initialBlockNumber = parseInt( + await provider.send("eth_blockNumber") + ); const [account] = await provider.send("eth_accounts"); // stop the miner @@ -27,14 +29,21 @@ describe("api", () => { // send a transaction, and make sure it does *not* get mined await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendTransaction", [{ from: account, to: account, value: 1 }]); - const fail = () => assert.fail("No message should have been received while mining was stopped"); + const txHash = await provider.send("eth_sendTransaction", [ + { from: account, to: account, value: 1 } + ]); + const fail = () => + assert.fail( + "No message should have been received while mining was stopped" + ); provider.on("message", fail); await new Promise(resolve => setTimeout(resolve, 2000)); provider.off("message", fail); // let's relaly make sure it wasn't mined by checking for a receipt - let receipt = await provider.send("eth_getTransactionReceipt", [txHash]); + let receipt = await provider.send("eth_getTransactionReceipt", [ + txHash + ]); assert.strictEqual(receipt, null); // now start the miner back up @@ -51,7 +60,10 @@ describe("api", () => { receipt = await provider.send("eth_getTransactionReceipt", [txHash]); // make sure we're on the next block! - assert.strictEqual(parseInt(receipt.blockNumber), initialBlockNumber + 1); + assert.strictEqual( + parseInt(receipt.blockNumber), + initialBlockNumber + 1 + ); } it("should stop mining, then mine when started", async () => { @@ -67,18 +79,27 @@ describe("api", () => { describe("miner_setEtherbase", () => { it("sets the etherbase", async () => { - const setState = await provider.send("miner_setEtherbase", [accounts[1]]); + const setState = await provider.send("miner_setEtherbase", [ + accounts[1] + ]); assert.strictEqual(setState, true); const coinbase = await provider.send("eth_coinbase"); assert.strictEqual(coinbase, accounts[1]); await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendTransaction", [{ from: accounts[0], to: accounts[0] }]); + const txHash = await provider.send("eth_sendTransaction", [ + { from: accounts[0], to: accounts[0] } + ]); await provider.once("message"); - const { status, blockNumber } = await provider.send("eth_getTransactionReceipt", [txHash]); + const { + status, + blockNumber + } = await provider.send("eth_getTransactionReceipt", [txHash]); assert.strictEqual(status, 1); - const { miner } = await provider.send("eth_getBlockByNumber", [blockNumber]); + const { miner } = await provider.send("eth_getBlockByNumber", [ + blockNumber + ]); assert.strictEqual(miner, accounts[1]); }); }); @@ -86,17 +107,23 @@ describe("api", () => { describe("miner_setGasPrice", () => { it("sets the gasPrice and uses it as the default price in tranactions", async () => { const newGasPrice = "0xffff"; - const setState = await provider.send("miner_setGasPrice", [newGasPrice]); + const setState = await provider.send("miner_setGasPrice", [ + newGasPrice + ]); assert.strictEqual(setState, true); const ethGasPrice = await provider.send("eth_gasPrice"); assert.strictEqual(ethGasPrice, newGasPrice); await provider.send("eth_subscribe", ["newHeads"]); - const txHash = await provider.send("eth_sendTransaction", [{ from: accounts[0], to: accounts[0] }]); + const txHash = await provider.send("eth_sendTransaction", [ + { from: accounts[0], to: accounts[0] } + ]); await provider.once("message"); - const { gasPrice } = await provider.send("eth_getTransactionByHash", [txHash]); + const { gasPrice } = await provider.send("eth_getTransactionByHash", [ + txHash + ]); assert.strictEqual(gasPrice, newGasPrice); }); }); diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/__tests__/api/personal/personal.test.ts index d3000112c4..1ec37637c7 100644 --- a/src/chains/ethereum/__tests__/api/personal/personal.test.ts +++ b/src/chains/ethereum/__tests__/api/personal/personal.test.ts @@ -38,26 +38,42 @@ describe("api", () => { ); // unlock the account indefinitely - const unlocked = await provider.send("personal_unlockAccount", [newAccount, passphrase, 0]); + const unlocked = await provider.send("personal_unlockAccount", [ + newAccount, + passphrase, + 0 + ]); assert.strictEqual(unlocked, true); await provider.send("eth_subscribe", ["newHeads"]); // send a normal transaction - const transactionHash = await provider.send("eth_sendTransaction", [transaction]); + const transactionHash = await provider.send("eth_sendTransaction", [ + transaction + ]); await provider.once("message"); // ensure sure it worked - const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); - assert.strictEqual(receipt.status, 1, "Transaction failed when it should have succeeded"); + const receipt = await provider.send("eth_getTransactionReceipt", [ + transactionHash + ]); + assert.strictEqual( + receipt.status, + 1, + "Transaction failed when it should have succeeded" + ); // lock the account - const accountLocked = await provider.send("personal_lockAccount", [newAccount]); + const accountLocked = await provider.send("personal_lockAccount", [ + newAccount + ]); assert.strictEqual(accountLocked, true); // make sure it is locked await assert.rejects( - provider.send("eth_sendTransaction", [Object.assign({}, transaction, { nonce: 1 })]), + provider.send("eth_sendTransaction", [ + Object.assign({}, transaction, { nonce: 1 }) + ]), { message: "authentication needed: password or unlock" }, @@ -102,7 +118,10 @@ describe("api", () => { await Promise.all( invalidPassphrases.map(invalidPassphrase => { return assert.rejects( - provider.send("personal_sendTransaction", [transaction, invalidPassphrase as any]), + provider.send("personal_sendTransaction", [ + transaction, + invalidPassphrase as any + ]), { message: "could not decrypt key with given password" }, @@ -113,11 +132,18 @@ describe("api", () => { // use personal_sendTransaction with the valid passphrase await provider.send("eth_subscribe", ["newHeads"]); - const transactionHashPromise = provider.send("personal_sendTransaction", [transaction, passphrase]); - const msgPromise = transactionHashPromise.then(() => provider.once("message")); + const transactionHashPromise = provider.send("personal_sendTransaction", [ + transaction, + passphrase + ]); + const msgPromise = transactionHashPromise.then(() => + provider.once("message") + ); await assert.rejects( - provider.send("eth_sendTransaction", [Object.assign({}, transaction, { nonce: 1 })]), + provider.send("eth_sendTransaction", [ + Object.assign({}, transaction, { nonce: 1 }) + ]), { message: "authentication needed: password or unlock" }, @@ -127,12 +153,20 @@ describe("api", () => { const transactionHash = await transactionHashPromise; await msgPromise; - const receipt = await provider.send("eth_getTransactionReceipt", [transactionHash]); - assert.strictEqual(receipt.status, 1, "Transaction failed when it should have succeeded"); + const receipt = await provider.send("eth_getTransactionReceipt", [ + transactionHash + ]); + assert.strictEqual( + receipt.status, + 1, + "Transaction failed when it should have succeeded" + ); // ensure the account is still locked await assert.rejects( - provider.send("eth_sendTransaction", [Object.assign({}, transaction, { nonce: 1 })]), + provider.send("eth_sendTransaction", [ + Object.assign({}, transaction, { nonce: 1 }) + ]), { message: "authentication needed: password or unlock" }, @@ -145,7 +179,10 @@ describe("api", () => { const controlProvider = await getProvider(); const provider = await getProvider(); const newAccount = await provider.send("personal_newAccount", [""]); - const controlAccount = await controlProvider.send("personal_newAccount", [""]); + const controlAccount = await controlProvider.send( + "personal_newAccount", + [""] + ); assert.strictEqual(newAccount, controlAccount); }); @@ -153,7 +190,10 @@ describe("api", () => { const controlProvider = await getProvider(); const provider = await getProvider({ wallet: { seed: "temet nosce" } }); const newAccount = await provider.send("personal_newAccount", [""]); - const controlAccount = await controlProvider.send("personal_newAccount", [""]); + const controlAccount = await controlProvider.send( + "personal_newAccount", + [""] + ); assert.notStrictEqual(newAccount, controlAccount); }); @@ -163,25 +203,39 @@ describe("api", () => { wallet: { mnemonic: "sweet treat" } }); const newAccount = await provider.send("personal_newAccount", [""]); - const controlAccount = await controlProvider.send("personal_newAccount", [""]); + const controlAccount = await controlProvider.send( + "personal_newAccount", + [""] + ); assert.notStrictEqual(newAccount, controlAccount); }); it("generates different accounts on successive calls", async () => { const provider = await getProvider(); - const firstNewAccount = await provider.send("personal_newAccount", [""]); - const secondNewAccount = await provider.send("personal_newAccount", [""]); + const firstNewAccount = await provider.send("personal_newAccount", [ + "" + ]); + const secondNewAccount = await provider.send("personal_newAccount", [ + "" + ]); assert.notStrictEqual(firstNewAccount, secondNewAccount); }); it("generates different accounts on successive calls based on the seed", async () => { const controlProvider = await getProvider(); const provider = await getProvider({ wallet: { seed: "temet nosce" } }); - const firstNewAccount = await provider.send("personal_newAccount", [""]); - const secondNewAccount = await provider.send("personal_newAccount", [""]); + const firstNewAccount = await provider.send("personal_newAccount", [ + "" + ]); + const secondNewAccount = await provider.send("personal_newAccount", [ + "" + ]); await provider.send("personal_newAccount", [""]); - const controlSecondNewAccount = await controlProvider.send("personal_newAccount", [""]); + const controlSecondNewAccount = await controlProvider.send( + "personal_newAccount", + [""] + ); assert.notStrictEqual( firstNewAccount, @@ -200,9 +254,15 @@ describe("api", () => { const provider = await getProvider({ miner: { gasPrice: 0 } }); const passphrase = "this is my passphrase"; // generate an account - const newAccount = await provider.send("personal_newAccount", [passphrase]); - - testLockedAccountWithPassphraseViaEth_SendTransaction(provider, newAccount, passphrase); + const newAccount = await provider.send("personal_newAccount", [ + passphrase + ]); + + testLockedAccountWithPassphraseViaEth_SendTransaction( + provider, + newAccount, + passphrase + ); }); }); @@ -211,20 +271,30 @@ describe("api", () => { const provider = await getProvider({ miner: { gasPrice: 0 } }); const passphrase = "this is my passphrase"; // generate an account - const newAccount = await provider.send("personal_newAccount", [passphrase]); - - testLockedAccountWithPassphraseViaPersonal_SendTransaction(provider, newAccount, passphrase); + const newAccount = await provider.send("personal_newAccount", [ + passphrase + ]); + + testLockedAccountWithPassphraseViaPersonal_SendTransaction( + provider, + newAccount, + passphrase + ); }); }); }); describe("personal_importRawKey", () => { - const secretKey = "0x0123456789012345678901234567890123456789012345678901234567890123"; + const secretKey = + "0x0123456789012345678901234567890123456789012345678901234567890123"; const passphrase = "this is my passphrase"; it("should return the known account address", async () => { const provider = await getProvider(); - const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); + const newAccount = await provider.send("personal_importRawKey", [ + secretKey, + passphrase + ]); assert.strictEqual( newAccount, "0x14791697260e4c9a71f18484c9f997b308e59325", @@ -237,9 +307,16 @@ describe("api", () => { const provider = await getProvider({ miner: { gasPrice: 0 } }); const passphrase = "this is my passphrase"; // generate an account - const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); - - await testLockedAccountWithPassphraseViaEth_SendTransaction(provider, newAccount, passphrase); + const newAccount = await provider.send("personal_importRawKey", [ + secretKey, + passphrase + ]); + + await testLockedAccountWithPassphraseViaEth_SendTransaction( + provider, + newAccount, + passphrase + ); }); }); @@ -247,9 +324,16 @@ describe("api", () => { it("generates locked accounts with passphrase", async () => { const provider = await getProvider({ miner: { gasPrice: 0 } }); // generate an account - const newAccount = await provider.send("personal_importRawKey", [secretKey, passphrase]); - - await testLockedAccountWithPassphraseViaPersonal_SendTransaction(provider, newAccount, passphrase); + const newAccount = await provider.send("personal_importRawKey", [ + secretKey, + passphrase + ]); + + await testLockedAccountWithPassphraseViaPersonal_SendTransaction( + provider, + newAccount, + passphrase + ); }); }); }); diff --git a/src/chains/ethereum/__tests__/api/web3/web3.test.ts b/src/chains/ethereum/__tests__/api/web3/web3.test.ts index 13846b6235..21c9a51275 100644 --- a/src/chains/ethereum/__tests__/api/web3/web3.test.ts +++ b/src/chains/ethereum/__tests__/api/web3/web3.test.ts @@ -19,7 +19,10 @@ describe("api", () => { const input = "Tim is a swell guy."; const result = await provider.send("web3_sha3", [input]); - assert.strictEqual(result, "0xee80d4ac03202e2246d51a596c76a18e1a6d899bed9f05246d998fb656d9bd1f"); + assert.strictEqual( + result, + "0xee80d4ac03202e2246d51a596c76a18e1a6d899bed9f05246d998fb656d9bd1f" + ); }); }); }); diff --git a/src/chains/ethereum/__tests__/helpers/compile.ts b/src/chains/ethereum/__tests__/helpers/compile.ts index dca78d5f52..4b64cbbe21 100644 --- a/src/chains/ethereum/__tests__/helpers/compile.ts +++ b/src/chains/ethereum/__tests__/helpers/compile.ts @@ -8,7 +8,9 @@ import solc from "solc"; if (solcListener && solcListener.name === "abort") { process.removeListener("unhandledRejection", solcListener); } else { - throw new Error("Looks like either the solc listener was finally removed, or they changed the name. Check it!"); + throw new Error( + "Looks like either the solc listener was finally removed, or they changed the name. Check it!" + ); } } diff --git a/src/chains/ethereum/__tests__/helpers/getProvider.ts b/src/chains/ethereum/__tests__/helpers/getProvider.ts index 5fbfb837c2..1814c4f8a3 100644 --- a/src/chains/ethereum/__tests__/helpers/getProvider.ts +++ b/src/chains/ethereum/__tests__/helpers/getProvider.ts @@ -3,7 +3,8 @@ import EthereumProvider from "../../src/provider"; import { EthereumProviderOptions } from "../../src/options"; const { RequestCoordinator, Executor } = utils; -const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; +const mnemonic = + "into trim cross then helmet popular suit hammer cart shrug oval student"; type Writeable = { -readonly [P in keyof T]: T[P] }; @@ -17,7 +18,8 @@ const getProvider = async ( // set `asyncRequestProcessing` to `true` by default let doAsync = options.chain.asyncRequestProcessing; - doAsync = options.chain.asyncRequestProcessing = doAsync != null ? doAsync : true; + doAsync = options.chain.asyncRequestProcessing = + doAsync != null ? doAsync : true; // don't write to stdout in tests if (!options.logging.logger) { diff --git a/src/chains/ethereum/__tests__/provider.test.ts b/src/chains/ethereum/__tests__/provider.test.ts index 61b3519414..14aaab9fe3 100644 --- a/src/chains/ethereum/__tests__/provider.test.ts +++ b/src/chains/ethereum/__tests__/provider.test.ts @@ -9,7 +9,10 @@ describe("provider", () => { it("generates predictable accounts when given a seed", async () => { const provider = await getProvider({ wallet: { seed: "temet nosce" } }); const accounts = await provider.send("eth_accounts"); - assert.strictEqual(accounts[0], "0x59ef313e6ee26bab6bcb1b5694e59613debd88da"); + assert.strictEqual( + accounts[0], + "0x59ef313e6ee26bab6bcb1b5694e59613debd88da" + ); }); }); @@ -36,7 +39,7 @@ describe("provider", () => { methods .map(method => { return new Promise((resolve, reject) => { - provider[method](jsonRpcRequest, (err: Error, { result }): void => { + provider[method](jsonRpcRequest, (err: Error, { result }) => { if (err) return reject(err); assert.strictEqual(result, `${networkId}`); resolve(void 0); diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/__tests__/temp-tests.test.ts index 0a585698a5..e5f17da2aa 100644 --- a/src/chains/ethereum/__tests__/temp-tests.test.ts +++ b/src/chains/ethereum/__tests__/temp-tests.test.ts @@ -12,7 +12,8 @@ import { join } from "path"; describe("Random tests that are temporary!", () => { const expectedAddress = "0x604a95c9165bc95ae016a5299dd7d400dddbea9a"; - const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; + const mnemonic = + "into trim cross then helmet popular suit hammer cart shrug oval student"; it("should respect the BIP99 mnemonic", async () => { const options = { wallet: { mnemonic } }; @@ -50,20 +51,28 @@ describe("Random tests that are temporary!", () => { it("shouldn't allow initialization without accounts", async () => { const options = { wallet: { totalAccounts: 0 } } as any; await assert.rejects(getProvider(options), { - message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" + message: + "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" }); options.wallet.accounts = []; await assert.rejects(getProvider(options), { - message: "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" + message: + "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" }); }); it("sets up accounts", async () => { - const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); + const privateKey = Buffer.from( + "4646464646464646464646464646464646464646464646464646464646464646", + "hex" + ); const p = await getProvider({ wallet: { - accounts: [{ balance: "0x123", secretKey: "0x" + privateKey.toString("hex") }, { balance: "0x456" }] + accounts: [ + { balance: "0x123", secretKey: "0x" + privateKey.toString("hex") }, + { balance: "0x456" } + ] } }); const accounts = await p.send("eth_accounts"); @@ -110,7 +119,10 @@ describe("Random tests that are temporary!", () => { } ]); }; - await assert.rejects(badSend, "Error: authentication needed: password or unlock"); + await assert.rejects( + badSend, + "Error: authentication needed: password or unlock" + ); await p.send("eth_subscribe", ["newHeads"]); await p.send("eth_sendTransaction", [ @@ -162,37 +174,58 @@ describe("Random tests that are temporary!", () => { await p.once("message"); - const receipt = await p.send("eth_getTransactionReceipt", [transactionHash]); + const receipt = await p.send("eth_getTransactionReceipt", [ + transactionHash + ]); assert.strictEqual(receipt.blockNumber, "0x1"); const to = receipt.contractAddress; const methods = contract.contract.evm.methodIdentifiers; - const value = await p.send("eth_call", [{ from, to, data: "0x" + methods["value()"] }]); + const value = await p.send("eth_call", [ + { from, to, data: "0x" + methods["value()"] } + ]); - const x5 = "0x0000000000000000000000000000000000000000000000000000000000000005"; + const x5 = + "0x0000000000000000000000000000000000000000000000000000000000000005"; assert.strictEqual(value, x5); - const constVal = await p.send("eth_call", [{ from, to, data: "0x" + methods["getConstVal()"] }]); + const constVal = await p.send("eth_call", [ + { from, to, data: "0x" + methods["getConstVal()"] } + ]); - const x123 = "0x000000000000000000000000000000000000000000000000000000000000007b"; + const x123 = + "0x000000000000000000000000000000000000000000000000000000000000007b"; assert.strictEqual(constVal, x123); - const storage = await p.send("eth_getStorageAt", [receipt.contractAddress, 0, receipt.blockNumber]); + const storage = await p.send("eth_getStorageAt", [ + receipt.contractAddress, + 0, + receipt.blockNumber + ]); assert.strictEqual(storage, "0x05"); - const raw25 = "0000000000000000000000000000000000000000000000000000000000000019"; + const raw25 = + "0000000000000000000000000000000000000000000000000000000000000019"; const x25 = "0x" + raw25; - const hash = await p.send("eth_sendTransaction", [{ from, to, data: "0x" + methods["setValue(uint256)"] + raw25 }]); + const hash = await p.send("eth_sendTransaction", [ + { from, to, data: "0x" + methods["setValue(uint256)"] + raw25 } + ]); await p.once("message"); const txReceipt = await p.send("eth_getTransactionReceipt", [hash]); assert.strictEqual(txReceipt.blockNumber, "0x2"); - const getValueAgain = await p.send("eth_call", [{ from, to, data: "0x" + methods["value()"] }]); + const getValueAgain = await p.send("eth_call", [ + { from, to, data: "0x" + methods["value()"] } + ]); assert.strictEqual(getValueAgain, x25); - const storage2 = await p.send("eth_getStorageAt", [receipt.contractAddress, 0, txReceipt.blockNumber]); + const storage2 = await p.send("eth_getStorageAt", [ + receipt.contractAddress, + 0, + txReceipt.blockNumber + ]); assert.strictEqual(storage2, "0x19"); }); @@ -212,21 +245,32 @@ describe("Random tests that are temporary!", () => { await p.once("message"); const balances = ( - await Promise.all([p.send("eth_getBalance", [accounts[1]]), p.send("eth_getBalance", [accounts[2]])]) + await Promise.all([ + p.send("eth_getBalance", [accounts[1]]), + p.send("eth_getBalance", [accounts[2]]) + ]) ).map(BigInt); assert.strictEqual(balances[0], startingBalance - ONE_ETHER); assert.strictEqual(balances[1], startingBalance + ONE_ETHER); }); it("runs eth_call", async () => { - const privateKey = Buffer.from("4646464646464646464646464646464646464646464646464646464646464646", "hex"); + const privateKey = Buffer.from( + "4646464646464646464646464646464646464646464646464646464646464646", + "hex" + ); const p = await getProvider({ wallet: { - accounts: [{ balance: "0x123", secretKey: "0x" + privateKey.toString("hex") }, { balance: "0x456" }] + accounts: [ + { balance: "0x123", secretKey: "0x" + privateKey.toString("hex") }, + { balance: "0x456" } + ] } }); const accounts = await p.send("eth_accounts"); - const result = await p.send("eth_call", [{ from: accounts[0], to: accounts[0], value: "0x1" }]); + const result = await p.send("eth_call", [ + { from: accounts[0], to: accounts[0], value: "0x1" } + ]); assert(result, "0x"); }); @@ -245,13 +289,21 @@ describe("Random tests that are temporary!", () => { }); it("should create the file by name", async () => { await getProvider({ wallet: { accountKeysPath: fileName } }); - assert.strictEqual(fs.existsSync(fileName), true, "The account_keys file doesn't exist."); + assert.strictEqual( + fs.existsSync(fileName), + true, + "The account_keys file doesn't exist." + ); }); it("should populate the file by descriptor", async () => { const fd = fs.openSync(fileName, "w"); try { await getProvider({ wallet: { accountKeysPath: fd } }); - assert.strictEqual(fs.existsSync(fileName), true, "The account_keys file doesn't exist."); + assert.strictEqual( + fs.existsSync(fileName), + true, + "The account_keys file doesn't exist." + ); } finally { fs.closeSync(fd); } diff --git a/src/chains/ethereum/scripts/post-process-docs.js b/src/chains/ethereum/scripts/post-process-docs.js index 8ee831f249..5db1da3f63 100644 --- a/src/chains/ethereum/scripts/post-process-docs.js +++ b/src/chains/ethereum/scripts/post-process-docs.js @@ -1,7 +1,9 @@ const cheerio = require("cheerio"); const { readFileSync, writeFileSync } = require("fs"); const { randomBytes } = require("crypto"); -const $ = cheerio.load(readFileSync("./lib/docs/classes/_api_.ethereumapi.html")); +const $ = cheerio.load( + readFileSync("./lib/docs/classes/_api_.ethereumapi.html") +); $(`.tsd-page-title`).after(``); diff --git a/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts b/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts index 4014380bed..6f69e9149e 100644 --- a/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts +++ b/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts @@ -40,12 +40,19 @@ declare module "ethereumjs-block/header" { public mixHash!: Buffer; public nonce!: Buffer; - constructor(data: Buffer | PrefixedHexString | BufferLike[] | BlockHeaderData = {}, opts: ChainOptions = {}); + constructor( + data: Buffer | PrefixedHexString | BufferLike[] | BlockHeaderData = {}, + opts: ChainOptions = {} + ); serialize(): Buffer; canonicalDifficulty(block: Block): BN; validateDifficulty(block: Block): boolean; validateGasLimit(block: Block): boolean; - validate(blockChain: Blockchain, height: BN | Callback, cb?: Callback): void; + validate( + blockChain: Blockchain, + height: BN | Callback, + cb?: Callback + ): void; hash(): Buffer; isGenesis(): boolean; toJSON(labeled: boolean): object; diff --git a/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts b/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts index e9eac23952..4c5d858c8e 100644 --- a/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts +++ b/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts @@ -22,7 +22,10 @@ declare module "ethereumjs-block" { header: BlockHeader; raw: Buffer[]; - constructor(data: Buffer | [Buffer[], Buffer[], Buffer[]] | BlockData = {}, opts: ChainOptions = {}); + constructor( + data: Buffer | [Buffer[], Buffer[], Buffer[]] | BlockData = {}, + opts: ChainOptions = {} + ); hash(): Buffer; isGenesis(): boolean; setGenesisParams(): void; diff --git a/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts b/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts index 0345eb30c1..24678e1695 100644 --- a/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts +++ b/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts @@ -1,5 +1,8 @@ import "ethereumjs-util"; declare module "ethereumjs-util" { - export declare const publicToAddress: (pubKey: Buffer, sanitize?: boolean) => Buffer; + export declare const publicToAddress: ( + pubKey: Buffer, + sanitize?: boolean + ) => Buffer; } diff --git a/src/chains/ethereum/src/@types/hdkey/index.d.ts b/src/chains/ethereum/src/@types/hdkey/index.d.ts index 63344e6789..486d9d12a7 100644 --- a/src/chains/ethereum/src/@types/hdkey/index.d.ts +++ b/src/chains/ethereum/src/@types/hdkey/index.d.ts @@ -23,8 +23,14 @@ declare module "hdkey" { public verify: (hash: Buffer, signature: Buffer) => boolean; public wipePrivateData: () => HDKey; public toJSON: (path: string) => HDKeyJSON; - public static fromMasterSeed: (seedBuffer: Buffer, version?: HDKeyVersions) => HDKey; - public static fromExtendedKey: (base58key: string, version?: HDKeyVersions) => HDKey; + public static fromMasterSeed: ( + seedBuffer: Buffer, + version?: HDKeyVersions + ) => HDKey; + public static fromExtendedKey: ( + base58key: string, + version?: HDKeyVersions + ) => HDKey; public static fromJSON: (obj: HDKeyJSON) => HDKey; public static HARDENED_OFFSET: 0x80000000; } diff --git a/src/chains/ethereum/src/@types/levelup/index.d.ts b/src/chains/ethereum/src/@types/levelup/index.d.ts index 041437a954..8274b83162 100644 --- a/src/chains/ethereum/src/@types/levelup/index.d.ts +++ b/src/chains/ethereum/src/@types/levelup/index.d.ts @@ -33,11 +33,19 @@ declare module "levelup" { put(key: any, value: any): Promise; put(key: any, value: any, callback: (error: any) => any): void; put(key: any, value: any, options: { sync?: boolean }): Promise; - put(key: any, value: any, options: { sync?: boolean }, callback: (error: any) => any): void; + put( + key: any, + value: any, + options: { sync?: boolean }, + callback: (error: any) => any + ): void; get(key: any): Promise; get(key: any, callback: (error: any, value: any) => any): void; - get(key: any, options: { keyEncoding?: Encoding; fillCache?: boolean }): Promise; + get( + key: any, + options: { keyEncoding?: Encoding; fillCache?: boolean } + ): Promise; get( key: any, options: { keyEncoding?: Encoding; fillCache?: boolean }, @@ -46,8 +54,15 @@ declare module "levelup" { del(key: any): Promise; del(key: any, callback: (error: any) => any): void; - del(key: any, options: { keyEncoding?: Encoding; sync?: boolean }): Promise; - del(key: any, options: { keyEncoding?: Encoding; sync?: boolean }, callback: (error: any) => any): void; + del( + key: any, + options: { keyEncoding?: Encoding; sync?: boolean } + ): Promise; + del( + key: any, + options: { keyEncoding?: Encoding; sync?: boolean }, + callback: (error: any) => any + ): void; batch(): LevelUpChain; batch(array: BatchType[]): Promise; @@ -83,13 +98,25 @@ declare module "levelup" { put(key: any, value: any): LevelUpChain; put(key: any, value: any, options?: { sync?: boolean }): LevelUpChain; del(key: any): LevelUpChain; - del(key: any, options?: { keyEncoding?: Encoding; sync?: boolean }): LevelUpChain; + del( + key: any, + options?: { keyEncoding?: Encoding; sync?: boolean } + ): LevelUpChain; clear(): LevelUpChain; write(): Promise; write(callback?: (error?: any) => any): void; } - interface levelupOptions { + interface levelupOptions< + K = any, + V = any, + O = any, + PO = any, + GO = any, + DO = any, + IO = any, + BO = any + > { db?: (location: string) => AbstractLevelDOWN; } diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts index 663bff4cff..3ab25a0f0c 100644 --- a/src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts +++ b/src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts @@ -5,7 +5,12 @@ declare module "merkle-patricia-tree/baseTrie" { import ReadStream from "merkle-patricia-tree/readStream"; type Callback = (err: Error | null, result: T) => void; - type FindPathCallback = (err: Error, node: TrieNode, keyRemainder: Buffer, stack: TrieNode[]) => void; + type FindPathCallback = ( + err: Error, + node: TrieNode, + keyRemainder: Buffer, + stack: TrieNode[] + ) => void; type LargeNumber = string | Buffer | BN; // Rather than using LevelUp here, specify the minimal interface we need diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts index 7b6bc6c5b3..098dcd79ab 100644 --- a/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts +++ b/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts @@ -27,7 +27,12 @@ declare module "merkle-patricia-tree" { revert(cb: Callback): void; createScratchReadStream(scratch: Database): ScratchReadStream; static prove(trie: Trie, key: LargeNumber, cb: Callback): void; - static verifyProof(rootHash: LargeNumber, key: LargeNumber, proof: MerkleProof, cb: Callback): void; + static verifyProof( + rootHash: LargeNumber, + key: LargeNumber, + proof: MerkleProof, + cb: Callback + ): void; } export default CheckpointTrie; } diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.ts b/src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.ts index 4f7bc096bf..25fe0e6d67 100644 --- a/src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.ts +++ b/src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.ts @@ -12,7 +12,11 @@ declare module "merkle-patricia-tree/trieNode" { type: NodeType; raw: number[]; - constructor(type: NodeType | NibbleArray, key?: NibbleArray, value?: NibbleArray); + constructor( + type: NodeType | NibbleArray, + key?: NibbleArray, + value?: NibbleArray + ); parseNode(node: NibbleArray): void; setValue(key: NibbleArray, value: NibbleArray): void; getValue(key: NibbleArray): NibbleArray; diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index bc60f90745..0eefe01c69 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,5 +1,10 @@ //#region Imports -import { toRpcSig, KECCAK256_NULL, ecsign, hashPersonalMessage } from "ethereumjs-util"; +import { + toRpcSig, + KECCAK256_NULL, + ecsign, + hashPersonalMessage +} from "ethereumjs-util"; import { TypedData as NotTypedData, signTypedData_v4 } from "eth-sig-util"; import { EthereumInternalOptions } from "./options"; import { types, Data, Quantity } from "@ganache/utils"; @@ -23,11 +28,21 @@ import { Block } from "./data-managers/block-manager"; import estimateGas from "./helpers/gas-estimator"; import CodedError, { ErrorCodes } from "./errors/coded-error"; import { WhisperPostObject } from "./types/shh"; -import { BaseFilterArgs, Filter, FilterArgs, FilterTypes, RangeFilterArgs } from "./types/filters"; +import { + BaseFilterArgs, + Filter, + FilterArgs, + FilterTypes, + RangeFilterArgs +} from "./types/filters"; import { assertArgLength } from "./helpers/assert-arg-length"; import Account from "./things/account"; import { SubscriptionId, SubscriptionName } from "./types/subscriptions"; -import { parseFilter, parseFilterDetails, parseFilterRange } from "./helpers/filter-parsing"; +import { + parseFilter, + parseFilterDetails, + parseFilterRange +} from "./helpers/filter-parsing"; import { Hardfork } from "./options/chain-options"; //#endregion @@ -47,7 +62,10 @@ const KNOWN_CHAINIDS = new Set([1, 3, 4, 5, 42]); //#endregion //#region misc types -type TypedData = Exclude[1]["data"], NotTypedData>; +type TypedData = Exclude< + Parameters[1]["data"], + NotTypedData +>; //#endregion //#region helpers @@ -60,12 +78,18 @@ function assertExceptionalTransactions(transactions: Transaction[]) { if (transaction.execException) { if (baseError) { baseError = VM_EXCEPTIONS; - errors.push(`${Data.from(transaction.hash(), 32).toString()}: ${transaction.execException}\n`); - data[transaction.execException.data.hash] = transaction.execException.data; + errors.push( + `${Data.from(transaction.hash(), 32).toString()}: ${ + transaction.execException + }\n` + ); + data[transaction.execException.data.hash] = + transaction.execException.data; } else { baseError = VM_EXCEPTION; errors = [transaction.execException.message]; - data[transaction.execException.data.hash] = transaction.execException.data; + data[transaction.execException.data.hash] = + transaction.execException.data; } } }); @@ -77,7 +101,10 @@ function assertExceptionalTransactions(transactions: Transaction[]) { } } -function parseCoinbaseAddress(coinbase: string | number | Address, initialAccounts: Account[]) { +function parseCoinbaseAddress( + coinbase: string | number | Address, + initialAccounts: Account[] +) { switch (typeof coinbase) { case "object": return coinbase; @@ -91,7 +118,9 @@ function parseCoinbaseAddress(coinbase: string | number | Address, initialAccoun case "string": return Address.from(coinbase); default: { - throw new Error(`coinbase address must be string or number, received: ${coinbase}`); + throw new Error( + `coinbase address must be string or number, received: ${coinbase}` + ); } } } @@ -132,15 +161,30 @@ export default class EthereumApi implements types.Api { * @param options * @param ready Callback for when the API is fully initialized */ - constructor(options: EthereumInternalOptions, emitter: Emittery.Typed<{ message: any }, "connect" | "disconnect">) { + constructor( + options: EthereumInternalOptions, + emitter: Emittery.Typed<{ message: any }, "connect" | "disconnect"> + ) { this.#options = options; const chain = options.chain; const { initialAccounts } = (this.#wallet = new Wallet(options.wallet)); - const coinbaseAddress = parseCoinbaseAddress(options.miner.coinbase, initialAccounts); - const common = (this.#common = createCommon(chain.chainId, chain.networkId, chain.hardfork)); - - const blockchain = (this.#blockchain = new Blockchain(options, common, initialAccounts, coinbaseAddress)); + const coinbaseAddress = parseCoinbaseAddress( + options.miner.coinbase, + initialAccounts + ); + const common = (this.#common = createCommon( + chain.chainId, + chain.networkId, + chain.hardfork + )); + + const blockchain = (this.#blockchain = new Blockchain( + options, + common, + initialAccounts, + coinbaseAddress + )); blockchain.on("start", () => emitter.emit("connect")); emitter.on("disconnect", blockchain.stop.bind(blockchain)); } @@ -308,21 +352,24 @@ export default class EthereumApi implements types.Api { const buffer = Address.from(address).toBuffer(); const blockchain = this.#blockchain; const stateManager = blockchain.vm.stateManager; - stateManager.getAccount(buffer, (err: Error, account: EthereumAccount) => { - if (err) { - reject(err); - return; - } - account.nonce = Quantity.from(nonce).toBuffer(); - stateManager.putAccount(buffer, account, (err: Error) => { + stateManager.getAccount( + buffer, + (err: Error, account: EthereumAccount) => { if (err) { reject(err); return; } + account.nonce = Quantity.from(nonce).toBuffer(); + stateManager.putAccount(buffer, account, (err: Error) => { + if (err) { + reject(err); + return; + } - blockchain.mine(0).then(() => resolve(true), reject); - }); - }); + blockchain.mine(0).then(() => resolve(true), reject); + }); + } + ); }); } @@ -333,7 +380,10 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1) async evm_increaseTime(seconds: number | string) { - const milliseconds = (typeof seconds === "number" ? seconds : Quantity.from(seconds).toNumber()) * 1000; + const milliseconds = + (typeof seconds === "number" + ? seconds + : Quantity.from(seconds).toNumber()) * 1000; return Math.floor(this.#blockchain.increaseTime(milliseconds) / 1000); } @@ -606,7 +656,10 @@ export default class EthereumApi implements types.Api { * @returns the amount of gas used. */ @assertArgLength(1, 2) - async eth_estimateGas(transaction: any, blockNumber: Buffer | Tag | string = Tag.LATEST) { + async eth_estimateGas( + transaction: any, + blockNumber: Buffer | Tag | string = Tag.LATEST + ) { const blockchain = this.#blockchain; const blocks = blockchain.blocks; const parentBlock = await blocks.get(blockNumber); @@ -618,7 +671,11 @@ export default class EthereumApi implements types.Api { }; return new Promise((resolve, reject) => { const coinbase = blockchain.coinbase; - const tx = Transaction.fromJSON(transaction, this.#common, Transaction.types.fake); + const tx = Transaction.fromJSON( + transaction, + this.#common, + Transaction.types.fake + ); if (tx._from == null) { tx._from = blockchain.coinbase.toBuffer(); } @@ -710,7 +767,9 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1, 2) async eth_getBlockByHash(hash: string | Buffer, transactions = false) { - const block = await this.#blockchain.blocks.getByHash(hash).catch(_ => null); + const block = await this.#blockchain.blocks + .getByHash(hash) + .catch(_ => null); return block ? block.toJSON(transactions) : null; } @@ -755,7 +814,10 @@ export default class EthereumApi implements types.Api { * @param index QUANTITY - integer of the transaction index position. */ @assertArgLength(2) - async eth_getTransactionByBlockHashAndIndex(hash: string | Buffer, index: string) { + async eth_getTransactionByBlockHashAndIndex( + hash: string | Buffer, + index: string + ) { const block = await this.eth_getBlockByHash(hash, true); if (block) { const tx = block.transactions[parseInt(index, 10)]; @@ -771,7 +833,10 @@ export default class EthereumApi implements types.Api { * @param index QUANTITY - integer of the transaction index position. */ @assertArgLength(2) - async eth_getTransactionByBlockNumberAndIndex(number: string | Buffer, index: string) { + async eth_getTransactionByBlockNumberAndIndex( + number: string | Buffer, + index: string + ) { const block = await this.eth_getBlockByNumber(number, true); return block.transactions[parseInt(index, 10)]; } @@ -813,7 +878,10 @@ export default class EthereumApi implements types.Api { * @param uncleIndex - the uncle's index position. */ @assertArgLength(2) - async eth_getUncleByBlockNumberAndIndex(blockNumber: Buffer | Tag, uncleIndex: Quantity) { + async eth_getUncleByBlockNumberAndIndex( + blockNumber: Buffer | Tag, + uncleIndex: Quantity + ) { return null as ReturnType; } @@ -921,8 +989,14 @@ export default class EthereumApi implements types.Api { * or "pending", see the default block parameter */ @assertArgLength(1, 2) - async eth_getBalance(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { - return this.#blockchain.accounts.getBalance(Address.from(address), blockNumber); + async eth_getBalance( + address: string, + blockNumber: Buffer | Tag = Tag.LATEST + ) { + return this.#blockchain.accounts.getBalance( + Address.from(address), + blockNumber + ); } /** @@ -988,7 +1062,11 @@ export default class EthereumApi implements types.Api { * or "pending", see the default block parameter */ @assertArgLength(2, 3) - async eth_getStorageAt(address: string, position: bigint | number, blockNumber: string | Buffer | Tag = Tag.LATEST) { + async eth_getStorageAt( + address: string, + position: bigint | number, + blockNumber: string | Buffer | Tag = Tag.LATEST + ) { const blockProm = this.#blockchain.blocks.getRaw(blockNumber); const trie = this.#blockchain.trie.copy(); @@ -1078,8 +1156,14 @@ export default class EthereumApi implements types.Api { const blockchain = this.#blockchain; const transactionPromise = blockchain.transactions.get(transactionHash); const receiptPromise = blockchain.transactionReceipts.get(transactionHash); - const blockPromise = transactionPromise.then(t => (t ? blockchain.blocks.get(t._blockNum) : null)); - const [transaction, receipt, block] = await Promise.all([transactionPromise, receiptPromise, blockPromise]); + const blockPromise = transactionPromise.then(t => + t ? blockchain.blocks.get(t._blockNum) : null + ); + const [transaction, receipt, block] = await Promise.all([ + transactionPromise, + receiptPromise, + blockPromise + ]); if (transaction) { return receipt.toJSON(block, transaction); } else { @@ -1117,11 +1201,15 @@ export default class EthereumApi implements types.Api { const isUnlockedAccount = wallet.unlockedAccounts.has(fromString); if (!isUnlockedAccount) { - const msg = isKnownAccount ? "authentication needed: password or unlock" : "sender account not recognized"; + const msg = isKnownAccount + ? "authentication needed: password or unlock" + : "sender account not recognized"; throw new Error(msg); } - const type = isKnownAccount ? Transaction.types.none : Transaction.types.fake; + const type = isKnownAccount + ? Transaction.types.none + : Transaction.types.fake; const tx = Transaction.fromJSON(transaction, this.#common, type); if (tx.gasLimit.length === 0) { @@ -1155,7 +1243,11 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1) async eth_sendRawTransaction(transaction: string) { - const tx = new Transaction(transaction, this.#common, Transaction.types.signed); + const tx = new Transaction( + transaction, + this.#common, + Transaction.types.signed + ); return this.#blockchain.queueTransaction(tx); } @@ -1184,7 +1276,12 @@ export default class EthereumApi implements types.Api { const messageHash = hashPersonalMessage(Data.from(message).toBuffer()); const signature = ecsign(messageHash, privateKey.toBuffer()); - return toRpcSig(signature.v, signature.r, signature.s, +this.#options.chain.chainId); + return toRpcSig( + signature.v, + signature.r, + signature.s, + +this.#options.chain.chainId + ); } /** @@ -1252,7 +1349,10 @@ export default class EthereumApi implements types.Api { * * `topics`, only logs which match the specified topics * @returns A subscription id. */ - eth_subscribe(subscriptionName: "logs", options: BaseFilterArgs): PromiEvent; + eth_subscribe( + subscriptionName: "logs", + options: BaseFilterArgs + ): PromiEvent; @assertArgLength(1, 2) eth_subscribe(subscriptionName: SubscriptionName, options?: BaseFilterArgs) { const subscriptions = this.#subscriptions; @@ -1300,19 +1400,26 @@ export default class EthereumApi implements types.Api { const subscription = this.#getId(); const promiEvent = PromiEvent.resolve(subscription); - const { addresses, topics } = options ? parseFilterDetails(options) : { addresses: [], topics: [] }; - const unsubscribe = this.#blockchain.on("blockLogs", (blockLogs: BlockLogs) => { - // TODO: move the JSON stringification closer to where the message - // is actually sent to the listener - const result = JSON.parse(JSON.stringify([...blockLogs.filter(addresses, topics)])); - promiEvent.emit("message", { - type: "eth_subscription", - data: { - result, - subscription: subscription.toString() - } - }); - }); + const { addresses, topics } = options + ? parseFilterDetails(options) + : { addresses: [], topics: [] }; + const unsubscribe = this.#blockchain.on( + "blockLogs", + (blockLogs: BlockLogs) => { + // TODO: move the JSON stringification closer to where the message + // is actually sent to the listener + const result = JSON.parse( + JSON.stringify([...blockLogs.filter(addresses, topics)]) + ); + promiEvent.emit("message", { + type: "eth_subscription", + data: { + result, + subscription: subscription.toString() + } + }); + } + ); subscriptions.set(subscription.toString(), unsubscribe); return promiEvent; } @@ -1320,16 +1427,19 @@ export default class EthereumApi implements types.Api { const subscription = this.#getId(); const promiEvent = PromiEvent.resolve(subscription); - const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { - const result = Data.from(transaction.hash(), 32).toString(); - promiEvent.emit("message", { - type: "eth_subscription", - data: { - result, - subscription: subscription.toString() - } - }); - }); + const unsubscribe = this.#blockchain.on( + "pendingTransaction", + (transaction: Transaction) => { + const result = Data.from(transaction.hash(), 32).toString(); + promiEvent.emit("message", { + type: "eth_subscription", + data: { + result, + subscription: subscription.toString() + } + }); + } + ); subscriptions.set(subscription.toString(), unsubscribe); return promiEvent; } @@ -1342,7 +1452,10 @@ export default class EthereumApi implements types.Api { return promiEvent; } default: - throw new CodedError(`no \"${subscriptionName}\" subscription in eth namespace`, ErrorCodes.METHOD_NOT_FOUND); + throw new CodedError( + `no \"${subscriptionName}\" subscription in eth namespace`, + ErrorCodes.METHOD_NOT_FOUND + ); } } @@ -1389,9 +1502,12 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(0) async eth_newPendingTransactionFilter() { - const unsubscribe = this.#blockchain.on("pendingTransaction", (transaction: Transaction) => { - value.updates.push(Data.from(transaction.hash(), 32)); - }); + const unsubscribe = this.#blockchain.on( + "pendingTransaction", + (transaction: Transaction) => { + value.updates.push(Data.from(transaction.hash(), 32)); + } + ); const value = { updates: [], unsubscribe, @@ -1511,16 +1627,23 @@ export default class EthereumApi implements types.Api { const blockchain = this.#blockchain; if ("blockHash" in filter) { const { addresses, topics } = parseFilterDetails(filter); - const blockNumber = await blockchain.blocks.getNumberFromHash(filter.blockHash); + const blockNumber = await blockchain.blocks.getNumberFromHash( + filter.blockHash + ); if (!blockNumber) return []; const blockLogs = blockchain.blockLogs; const logs = await blockLogs.get(blockNumber); return logs ? [...logs.filter(addresses, topics)] : []; } else { - const { addresses, topics, fromBlock, toBlockNumber } = parseFilter(filter, blockchain); + const { addresses, topics, fromBlock, toBlockNumber } = parseFilter( + filter, + blockchain + ); const blockLogs = blockchain.blockLogs; - const pendingLogsPromises: Promise[] = [blockLogs.get(fromBlock.toBuffer())]; + const pendingLogsPromises: Promise[] = [ + blockLogs.get(fromBlock.toBuffer()) + ]; const fromBlockNumber = fromBlock.toNumber(); // if we have a range of blocks to search, do that here: @@ -1534,11 +1657,14 @@ export default class EthereumApi implements types.Api { // now filter and compute all the blocks' blockLogs (in block order) return Promise.all(pendingLogsPromises).then(blockLogsRange => { - const filteredBlockLogs: ReturnType[] = []; + const filteredBlockLogs: ReturnType< + typeof BlockLogs["logToJSON"] + >[] = []; blockLogsRange.forEach(blockLogs => { // TODO(perf): this loops over all addresses for every block. // Maybe make it loop only once? - if (blockLogs) filteredBlockLogs.push(...blockLogs.filter(addresses, topics)); + if (blockLogs) + filteredBlockLogs.push(...blockLogs.filter(addresses, topics)); }); return filteredBlockLogs; }); @@ -1554,8 +1680,14 @@ export default class EthereumApi implements types.Api { * @returns integer of the number of transactions sent from this address. */ @assertArgLength(1, 2) - async eth_getTransactionCount(address: string, blockNumber: Buffer | Tag = Tag.LATEST) { - return this.#blockchain.accounts.getNonce(Address.from(address), blockNumber); + async eth_getTransactionCount( + address: string, + blockNumber: Buffer | Tag = Tag.LATEST + ) { + return this.#blockchain.accounts.getNonce( + Address.from(address), + blockNumber + ); } /** @@ -1567,7 +1699,10 @@ export default class EthereumApi implements types.Api { * @returns the return value of executed contract. */ @assertArgLength(1, 2) - async eth_call(transaction: any, blockNumber: string | Buffer | Tag = Tag.LATEST) { + async eth_call( + transaction: any, + blockNumber: string | Buffer | Tag = Tag.LATEST + ) { const blockchain = this.#blockchain; const blocks = blockchain.blocks; const parentBlock = await blocks.get(blockNumber); @@ -1606,10 +1741,16 @@ export default class EthereumApi implements types.Api { const simulatedTransaction = { gas, // if we don't have a from address, our caller sut be the configured coinbase address - from: transaction.from == null ? blockchain.coinbase : Address.from(transaction.from), + from: + transaction.from == null + ? blockchain.coinbase + : Address.from(transaction.from), to: transaction.to == null ? null : Address.from(transaction.to), - gasPrice: Quantity.from(transaction.gasPrice == null ? 0 : transaction.gasPrice), - value: transaction.value == null ? null : Quantity.from(transaction.value), + gasPrice: Quantity.from( + transaction.gasPrice == null ? 0 : transaction.gasPrice + ), + value: + transaction.value == null ? null : Quantity.from(transaction.value), data, block }; @@ -1642,10 +1783,15 @@ export default class EthereumApi implements types.Api { } const wallet = this.#wallet; - const newAccount = wallet.createRandomAccount(this.#options.wallet.mnemonic); + const newAccount = wallet.createRandomAccount( + this.#options.wallet.mnemonic + ); const address = newAccount.address; const strAddress = address.toString(); - const encryptedKeyFile = await wallet.encrypt(newAccount.privateKey, passphrase); + const encryptedKeyFile = await wallet.encrypt( + newAccount.privateKey, + passphrase + ); wallet.encryptedKeyFiles.set(strAddress, encryptedKeyFile); wallet.addresses.push(strAddress); wallet.knownAccounts.add(strAddress); @@ -1669,7 +1815,10 @@ export default class EthereumApi implements types.Api { const newAccount = Wallet.createAccountFromPrivateKey(Data.from(rawKey)); const address = newAccount.address; const strAddress = address.toString(); - const encryptedKeyFile = await wallet.encrypt(newAccount.privateKey, passphrase); + const encryptedKeyFile = await wallet.encrypt( + newAccount.privateKey, + passphrase + ); wallet.encryptedKeyFiles.set(strAddress, encryptedKeyFile); wallet.addresses.push(strAddress); wallet.knownAccounts.add(strAddress); @@ -1701,8 +1850,16 @@ export default class EthereumApi implements types.Api { * @returns true if it worked. Throws an error if it did not. */ @assertArgLength(2, 3) - async personal_unlockAccount(address: string, passphrase: string, duration: number = 300) { - return this.#wallet.unlockAccount(address.toLowerCase(), passphrase, duration); + async personal_unlockAccount( + address: string, + passphrase: string, + duration: number = 300 + ) { + return this.#wallet.unlockAccount( + address.toLowerCase(), + passphrase, + duration + ); } /** diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index e9960f859f..ef02e28389 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -89,7 +89,10 @@ function setStateRootSync(stateManager: VM["stateManager"], stateRoot: Buffer) { stateManager._storageTries = {}; } -export default class Blockchain extends Emittery.Typed { +export default class Blockchain extends Emittery.Typed< + BlockchainTypedEvents, + BlockchainEvents +> { #state: Status = Status.starting; #miner: Miner; #blockBeingSavedPromise: Promise<{ block: Block; blockLogs: BlockLogs }>; @@ -114,12 +117,18 @@ export default class Blockchain extends Emittery.Typed { - const blocks = (this.blocks = await BlockManager.initialize(common, database.blockIndexes, database.blocks)); + const blocks = (this.blocks = await BlockManager.initialize( + common, + database.blockIndexes, + database.blocks + )); // if we have a latest block, use it to set up the trie. const latest = blocks.latest; @@ -154,20 +169,34 @@ export default class Blockchain extends Emittery.Typed block); + this.#blockBeingSavedPromise = this.#initializeGenesisBlock( + firstBlockTime, + options.miner.blockGasLimit + ); + blocks.earliest = blocks.latest = await this.#blockBeingSavedPromise.then( + ({ block }) => block + ); } } @@ -204,14 +238,19 @@ export default class Blockchain extends Emittery.Typed (this.#isPaused() ? null : this.mine(maxTransactions)); + const mineAll = async (maxTransactions: number) => + this.#isPaused() ? null : this.mine(maxTransactions); if (instamine) { // insta mining // whenever the transaction pool is drained mine the txs into blocks - this.transactions.transactionPool.on("drain", mineAll.bind(null, 1)); + this.transactions.transactionPool.on( + "drain", + mineAll.bind(null, 1) + ); } else { // interval mining - const wait = () => unref(setTimeout(mineNext, options.miner.blockTime * 1000)); + const wait = () => + unref(setTimeout(mineNext, options.miner.blockTime * 1000)); const mineNext = () => mineAll(-1).then(wait); wait(); } @@ -221,7 +260,8 @@ export default class Blockchain extends Emittery.Typed { - const hash = tx.hash(); - const index = Quantity.from(i).toBuffer(); - const txAndExtraData = [...tx.raw, blockHash, blockNumber, index, Buffer.from([tx.type]), tx.from]; - const encodedTx = rlpEncode(txAndExtraData); - this.transactions.set(hash, encodedTx); - - const receipt = tx.getReceipt(); - const encodedReceipt = receipt.serialize(true); - this.transactionReceipts.set(hash, encodedReceipt); - - tx.getLogs().forEach(log => { - blockLogs.append(index, hash, log); - }); - - logger.log(""); - logger.log(" Transaction: " + Data.from(hash)); - - const contractAddress = receipt.contractAddress; - if (contractAddress != null) { - logger.log(" Contract created: " + Address.from(contractAddress)); - } - - const raw = receipt.raw; - logger.log(" Gas usage: " + Quantity.from(raw[1])); - logger.log(" Block Number: " + blockNumberQ); - logger.log(" Block Time: " + timestamp); + const timestamp = new Date( + Quantity.from(header.timestamp).toNumber() * 1000 + ).toString(); + blockData.blockTransactions.forEach( + (tx: Transaction, i: number) => { + const hash = tx.hash(); + const index = Quantity.from(i).toBuffer(); + const txAndExtraData = [ + ...tx.raw, + blockHash, + blockNumber, + index, + Buffer.from([tx.type]), + tx.from + ]; + const encodedTx = rlpEncode(txAndExtraData); + this.transactions.set(hash, encodedTx); + + const receipt = tx.getReceipt(); + const encodedReceipt = receipt.serialize(true); + this.transactionReceipts.set(hash, encodedReceipt); + + tx.getLogs().forEach(log => { + blockLogs.append(index, hash, log); + }); + + logger.log(""); + logger.log(" Transaction: " + Data.from(hash)); + + const contractAddress = receipt.contractAddress; + if (contractAddress != null) { + logger.log( + " Contract created: " + Address.from(contractAddress) + ); + } - const error = tx.execException; - if (error) { - logger.log(" Runtime Error: " + error.data.message); - if ((error as any).reason) { - logger.log(" Revert reason: " + (error as any).data.reason); + const raw = receipt.raw; + logger.log(" Gas usage: " + Quantity.from(raw[1])); + logger.log(" Block Number: " + blockNumberQ); + logger.log(" Block Time: " + timestamp); + + const error = tx.execException; + if (error) { + logger.log(" Runtime Error: " + error.data.message); + if ((error as any).reason) { + logger.log( + " Revert reason: " + (error as any).data.reason + ); + } } - } - logger.log(""); - }); + logger.log(""); + } + ); blockLogs.blockNumber = blockNumberQ; this.blockLogs.set(blockNumber, blockLogs.serialize()); value.transactions = blockData.blockTransactions; @@ -292,7 +347,9 @@ export default class Blockchain extends Emittery.Typed { block.value.transactions.forEach(transaction => { - const error = options.chain.vmErrorsOnRPCResponse ? transaction.execException : null; + const error = options.chain.vmErrorsOnRPCResponse + ? transaction.execException + : null; transaction.finalize("confirmed", error); }); @@ -321,7 +378,8 @@ export default class Blockchain extends Emittery.Typed { const previousHeader = previousBlock.header; - const previousNumber = Quantity.from(previousHeader.number).toBigInt() || 0n; + const previousNumber = + Quantity.from(previousHeader.number).toBigInt() || 0n; return this.blocks.createBlock({ number: Quantity.from(previousNumber + 1n).toBuffer(), gasLimit: this.#options.miner.blockGasLimit.toBuffer(), @@ -334,7 +392,11 @@ export default class Blockchain extends Emittery.Typed { + mine = async ( + maxTransactions: number, + timestamp?: number, + onlyOneBlock: boolean = false + ) => { await this.#blockBeingSavedPromise; const nextBlock = this.#readyNextBlock(this.blocks.latest.value, timestamp); return this.#miner.mine(nextBlock, maxTransactions, onlyOneBlock); @@ -363,7 +425,10 @@ export default class Blockchain extends Emittery.Typed { + createVmFromStateTrie = ( + stateTrie: CheckpointTrie, + allowUnlimitedContractSize: boolean + ): any => { const blocks = this.blocks; // ethereumjs vm doesn't use the callback style anymore const getBlock = class T { @@ -395,14 +460,21 @@ export default class Blockchain extends Emittery.Typed { + #initializeGenesisBlock = async ( + timestamp: number, + blockGasLimit: Quantity + ) => { // create the genesis block const genesis = this.blocks.next({ // If we were given a timestamp, use it instead of the `_currentTime` @@ -588,7 +660,8 @@ export default class Blockchain extends Emittery.Typed= 0) { - const stateTrie = new CheckpointTrie(this.#database.trie, parentBlock.value.header.stateRoot); - const vm = this.createVmFromStateTrie(stateTrie, this.vm.allowUnlimitedContractSize); + const stateTrie = new CheckpointTrie( + this.#database.trie, + parentBlock.value.header.stateRoot + ); + const vm = this.createVmFromStateTrie( + stateTrie, + this.vm.allowUnlimitedContractSize + ); vm.on("step", this.emit.bind(this, "step")); result = await vm.runCall({ diff --git a/src/chains/ethereum/src/data-managers/account-manager.ts b/src/chains/ethereum/src/data-managers/account-manager.ts index 7527418083..5d1a7e43b4 100644 --- a/src/chains/ethereum/src/data-managers/account-manager.ts +++ b/src/chains/ethereum/src/data-managers/account-manager.ts @@ -17,7 +17,10 @@ export default class AccountManager { this.#trie = trie; } - public async getRaw(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + public async getRaw( + address: Address, + blockNumber: Buffer | Tag = Tag.LATEST + ): Promise { const blockchain = this.#blockchain; const block = await blockchain.blocks.get(blockNumber); const trieCopy = new Trie(this.#trie, block.value.header.stateRoot); @@ -29,7 +32,10 @@ export default class AccountManager { }); } - public async getNonce(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + public async getNonce( + address: Address, + blockNumber: Buffer | Tag = Tag.LATEST + ): Promise { return this.getRaw(address, blockNumber).then(data => { if (data) { const [nonce] = (rlp.decode(data) as any) as Buffer[]; @@ -40,7 +46,10 @@ export default class AccountManager { }); } - public async getBalance(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + public async getBalance( + address: Address, + blockNumber: Buffer | Tag = Tag.LATEST + ): Promise { return this.getRaw(address, blockNumber).then(data => { if (data) { const [, balance] = (rlp.decode(data) as any) as Buffer[]; @@ -51,7 +60,10 @@ export default class AccountManager { }); } - public async get(address: Address, blockNumber: Buffer | Tag = Tag.LATEST): Promise { + public async get( + address: Address, + blockNumber: Buffer | Tag = Tag.LATEST + ): Promise { return this.getRaw(address, blockNumber).then(data => { return Account.fromBuffer(data); }); diff --git a/src/chains/ethereum/src/data-managers/block-manager.ts b/src/chains/ethereum/src/data-managers/block-manager.ts index 8cde3ad7cb..791d7d3d20 100644 --- a/src/chains/ethereum/src/data-managers/block-manager.ts +++ b/src/chains/ethereum/src/data-managers/block-manager.ts @@ -32,7 +32,11 @@ export default class BlockManager extends Manager { #common: Common; #blockIndexes: LevelUp; - static async initialize(common: Common, blockIndexes: LevelUp, base: LevelUp) { + static async initialize( + common: Common, + blockIndexes: LevelUp, + base: LevelUp + ) { const bm = new BlockManager(common, blockIndexes, base); await bm.updateTaggedBlocks(); return bm; @@ -147,7 +151,10 @@ export default class BlockManager extends Manager { key = Buffer.from([0]); } const secondaryKey = header.hash(); - await Promise.all([this.#blockIndexes.put(secondaryKey, key), super.set(key, block.serialize())]); + await Promise.all([ + this.#blockIndexes.put(secondaryKey, key), + super.set(key, block.serialize()) + ]); return block; } @@ -186,7 +193,10 @@ export class Block { if (raw) { this.size = raw.length; const data = (rlpDecode(raw) as any) as [Buffer[], Buffer[], Buffer[]]; - this.value = new EthereumJsBlock({ header: data[0], uncleHeaders: data[2] }, { common }); + this.value = new EthereumJsBlock( + { header: data[0], uncleHeaders: data[2] }, + { common } + ); const rawTransactions = data[1]; // parse transactions so we can use our own transaction class @@ -208,7 +218,11 @@ export class Block { return serialized; } - getTxFn = (include = false): ((tx: Transaction) => { [key: string]: string | Data | Quantity } | Data) => { + getTxFn = ( + include = false + ): (( + tx: Transaction + ) => { [key: string]: string | Data | Quantity } | Data) => { if (include) { return (tx: Transaction) => tx.toJSON(this); } else { @@ -239,7 +253,9 @@ export class Block { gasLimit: Quantity.from(header.gasLimit), gasUsed: Quantity.from(header.gasUsed), timestamp: Quantity.from(header.timestamp), - transactions: this.value.transactions.map(this.getTxFn(includeFullTransactions)), + transactions: this.value.transactions.map( + this.getTxFn(includeFullTransactions) + ), uncles: [] as string[] // this.value.uncleHeaders.map(function(uncleHash) {return to.hex(uncleHash)}) }; } diff --git a/src/chains/ethereum/src/data-managers/manager.ts b/src/chains/ethereum/src/data-managers/manager.ts index 765e8c79a8..49c5930334 100644 --- a/src/chains/ethereum/src/data-managers/manager.ts +++ b/src/chains/ethereum/src/data-managers/manager.ts @@ -9,7 +9,11 @@ export default class Manager { #Type: Instantiable; #options: {}; protected base: LevelUp; - constructor(base: LevelUp, type: Instantiable, options?: ConstructorParameters>[1]) { + constructor( + base: LevelUp, + type: Instantiable, + options?: ConstructorParameters>[1] + ) { this.#Type = type; this.#options = options; this.base = base; diff --git a/src/chains/ethereum/src/data-managers/transaction-manager.ts b/src/chains/ethereum/src/data-managers/transaction-manager.ts index 575270e54f..3338f7e85f 100644 --- a/src/chains/ethereum/src/data-managers/transaction-manager.ts +++ b/src/chains/ethereum/src/data-managers/transaction-manager.ts @@ -16,7 +16,12 @@ export default class TransactionManager extends Manager { #resumer: Promise; #resolver: (value: void) => void; - constructor(options: EthereumInternalOptions["miner"], common: Common, blockchain: Blockchain, base: LevelUp) { + constructor( + options: EthereumInternalOptions["miner"], + common: Common, + blockchain: Blockchain, + base: LevelUp + ) { super(base, Transaction, common); this.transactionPool = new TransactionPool(options, blockchain); @@ -40,7 +45,10 @@ export default class TransactionManager extends Manager { // potentially affect the order in which transactions are inserted into the // pool, so we use a FIFO queue to _return_ transaction insertions in the // order the were received. - const insertion = this.transactionPool.prepareTransaction(transaction, secretKey); + const insertion = this.transactionPool.prepareTransaction( + transaction, + secretKey + ); const result = await this.#queue.add(insertion); if (result) { this.transactionPool.drain(); diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index 9c5bd2d7cd..e12ab9e4dd 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -36,7 +36,10 @@ export default class Database extends Emittery { * store instance) or `dbPath` (the path to store/read the db instance) * @param blockchain */ - constructor(options: EthereumInternalOptions["database"], blockchain: Blockchain) { + constructor( + options: EthereumInternalOptions["database"], + blockchain: Blockchain + ) { super(); this.#options = options; diff --git a/src/chains/ethereum/src/errors/errors.ts b/src/chains/ethereum/src/errors/errors.ts index 085a6b2b89..8dad72db9b 100644 --- a/src/chains/ethereum/src/errors/errors.ts +++ b/src/chains/ethereum/src/errors/errors.ts @@ -31,4 +31,5 @@ export const VM_EXCEPTION = "VM Exception while processing transaction: "; /** * Prefix for multiple VM Exceptions occuring when running transactions or a block */ -export const VM_EXCEPTIONS = "Multiple VM Exceptions while processing transactions: : \n\n"; +export const VM_EXCEPTIONS = + "Multiple VM Exceptions while processing transactions: : \n\n"; diff --git a/src/chains/ethereum/src/errors/runtime-error.ts b/src/chains/ethereum/src/errors/runtime-error.ts index a7e03d0876..47d16569cd 100644 --- a/src/chains/ethereum/src/errors/runtime-error.ts +++ b/src/chains/ethereum/src/errors/runtime-error.ts @@ -20,7 +20,11 @@ export default class RuntimeError extends CodedError { reason?: string; message: string; }; - constructor(transactionHash: Buffer, result: EVMResult, returnType: RETURN_TYPES) { + constructor( + transactionHash: Buffer, + result: EVMResult, + returnType: RETURN_TYPES + ) { const execResult = result.execResult; const error = execResult.exceptionError.error; let message = VM_EXCEPTION + error; @@ -33,7 +37,10 @@ export default class RuntimeError extends CodedError { const returnValue = execResult.returnValue; const hash = `0x${transactionHash.toString("hex")}`; let reason: string | null; - if (returnValue.length > 4 && REVERT_REASON.compare(returnValue, 0, 4) === 0) { + if ( + returnValue.length > 4 && + REVERT_REASON.compare(returnValue, 0, 4) === 0 + ) { try { // it is possible for the `returnValue` to be gibberish that can't be // decoded. See: https://github.com/trufflesuite/ganache-core/pull/452 @@ -51,7 +58,10 @@ export default class RuntimeError extends CodedError { this.data = { hash: hash, programCounter: execResult.runState.programCounter, - result: returnType === RETURN_TYPES.TRANSACTION_HASH ? hash : Data.from(returnValue || "0x").toString(), + result: + returnType === RETURN_TYPES.TRANSACTION_HASH + ? hash + : Data.from(returnValue || "0x").toString(), reason: reason, message: error }; diff --git a/src/chains/ethereum/src/helpers/assert-arg-length.ts b/src/chains/ethereum/src/helpers/assert-arg-length.ts index 8553b5b884..29f00476e1 100644 --- a/src/chains/ethereum/src/helpers/assert-arg-length.ts +++ b/src/chains/ethereum/src/helpers/assert-arg-length.ts @@ -1,5 +1,7 @@ type UnknownFn = (this: unknown, ...args: any[]) => unknown; -type FunctionPropertyDescriptor = TypedPropertyDescriptor; +type FunctionPropertyDescriptor = TypedPropertyDescriptor< + T +>; export function assertArgLength(min: number, max: number = min) { return function ( target: O, diff --git a/src/chains/ethereum/src/helpers/filter-parsing.ts b/src/chains/ethereum/src/helpers/filter-parsing.ts index eb1c0b8f93..71cb476413 100644 --- a/src/chains/ethereum/src/helpers/filter-parsing.ts +++ b/src/chains/ethereum/src/helpers/filter-parsing.ts @@ -3,23 +3,33 @@ import Blockchain from "../blockchain"; import Address from "../things/address"; import { FilterArgs, RangeFilterArgs } from "../types/filters"; -export function parseFilterDetails(filter: Pick) { +export function parseFilterDetails( + filter: Pick +) { // `filter.address` may be a single address or an array const addresses = filter.address - ? (Array.isArray(filter.address) ? filter.address : [filter.address]).map(a => - Address.from(a.toLowerCase()).toBuffer() - ) + ? (Array.isArray(filter.address) + ? filter.address + : [filter.address] + ).map(a => Address.from(a.toLowerCase()).toBuffer()) : []; const topics = filter.topics ? filter.topics : []; return { addresses, topics }; } -export function parseFilterRange(filter: Omit, blockchain: Blockchain) { +export function parseFilterRange( + filter: Omit, + blockchain: Blockchain +) { const latestBlockNumberBuffer = blockchain.blocks.latest.value.header.number; const latestBlock = Quantity.from(latestBlockNumberBuffer); - const fromBlock = blockchain.blocks.getEffectiveNumber(filter.fromBlock || "latest"); + const fromBlock = blockchain.blocks.getEffectiveNumber( + filter.fromBlock || "latest" + ); const latestBlockNumber = latestBlock.toNumber(); - const toBlock = blockchain.blocks.getEffectiveNumber(filter.toBlock || "latest"); + const toBlock = blockchain.blocks.getEffectiveNumber( + filter.toBlock || "latest" + ); let toBlockNumber: number; // don't search after the "latest" block, unless it's "pending", of course. if (toBlock > latestBlock) { @@ -33,9 +43,15 @@ export function parseFilterRange(filter: Omit opname => set.has(opname); -const isCall = check(new Set(["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"])); +const isCall = check( + new Set(["CALL", "DELEGATECALL", "STATICCALL", "CALLCODE"]) +); const isCallOrCallcode = check(new Set(["CALL", "CALLCODE"])); const isCreate = check(new Set(["CREATE", "CREATE2"])); -const isTerminator = check(new Set(["STOP", "RETURN", "REVERT", "INVALID", "SELFDESTRUCT"])); +const isTerminator = check( + new Set(["STOP", "RETURN", "REVERT", "INVALID", "SELFDESTRUCT"]) +); const stepTracker = () => { const sysOps = []; @@ -49,7 +53,10 @@ const stepTracker = () => { allOps.push(info); }, isPrecompile: index => preCompile.has(index), - done: () => !allOps.length || sysOps.length < 2 || !isTerminator(allOps[allOps.length - 1].opcode.name), + done: () => + !allOps.length || + sysOps.length < 2 || + !isTerminator(allOps[allOps.length - 1].opcode.name), ops: allOps, systemOps: sysOps }; @@ -68,7 +75,9 @@ const estimateGas = (generateVM, runArgs, callback) => { const binSearch = async (generateVM, runArgs, result, callback) => { const MAX = Quantity.from(runArgs.block.header.gasLimit).toBigInt(); const gasRefund = result.execResult.gasRefund; - const startingGas = gasRefund ? result.gasEstimate.add(gasRefund) : result.gasEstimate; + const startingGas = gasRefund + ? result.gasEstimate.add(gasRefund) + : result.gasEstimate; const range = { lo: startingGas, hi: startingGas }; const isEnoughGas = async gas => { const vm = generateVM(); // Generate fresh VM @@ -91,7 +100,11 @@ const binSearch = async (generateVM, runArgs, result, callback) => { } if (range.hi.gte(MAX)) { if (!(await isEnoughGas(range.hi))) { - return callback(new Error("gas required exceeds allowance or always failing transaction")); + return callback( + new Error( + "gas required exceeds allowance or always failing transaction" + ) + ); } } } @@ -149,7 +162,11 @@ const exactimate = async (vm, runArgs, callback) => { }, addRange: (fee = bn()) => { // only occurs on stack increasing ops - addGas(steps.ops[base || compositeContext ? start : start + 1].gasLeft.sub(steps.ops[stop].gasLeft).add(fee)); + addGas( + steps.ops[base || compositeContext ? start : start + 1].gasLeft + .sub(steps.ops[stop].gasLeft) + .add(fee) + ); }, finalizeRange: () => { let range; @@ -164,7 +181,10 @@ const exactimate = async (vm, runArgs, callback) => { } range.isub(callingFee); addGas(range); - if (isCallOrCallcode(op.opcode.name) && !op.stack[op.stack.length - 3].isZero()) { + if ( + isCallOrCallcode(op.opcode.name) && + !op.stack[op.stack.length - 3].isZero() + ) { cost.iadd(sixtyFloorths); const innerCost = next.gasLeft.sub(steps.ops[stop - 1].gasLeft); if (innerCost.gt(STIPEND)) { @@ -205,7 +225,9 @@ const exactimate = async (vm, runArgs, callback) => { } } else if (isTerminator(name)) { // only on the last operation - context.setStop(currentIndex + 1 < steps.ops.length ? currentIndex + 1 : currentIndex); + context.setStop( + currentIndex + 1 < steps.ops.length ? currentIndex + 1 : currentIndex + ); context.finalizeRange(); const ctx = stack.pop(); if (ctx) { @@ -229,13 +251,19 @@ const exactimate = async (vm, runArgs, callback) => { if (vmerr) { return callback(vmerr); } else if (result.execResult.exceptionError) { - const error = new RuntimeError(runArgs.tx.hash(), result, RETURN_TYPES.RETURN_VALUE); + const error = new RuntimeError( + runArgs.tx.hash(), + result, + RETURN_TYPES.RETURN_VALUE + ); return callback(error, result); } else if (steps.done()) { const estimate = result.gasUsed; result.gasEstimate = estimate; } else { - const actualUsed = steps.ops[0].gasLeft.sub(steps.ops[steps.ops.length - 1].gasLeft); + const actualUsed = steps.ops[0].gasLeft.sub( + steps.ops[steps.ops.length - 1].gasLeft + ); const sixtyFloorths = getTotal().sub(actualUsed); result.gasEstimate = result.gasUsed.add(sixtyFloorths); } diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 6fd4008fe2..e6f7f689f0 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -6,7 +6,9 @@ import { RecognizedString, WebSocket, HttpRequest } from "uWebSockets.js"; import CodedError, { ErrorCodes } from "./errors/coded-error"; import { EthereumProviderOptions } from "./options"; -function isHttp(connection: HttpRequest | WebSocket): connection is HttpRequest { +function isHttp( + connection: HttpRequest | WebSocket +): connection is HttpRequest { return connection.constructor.name === "uWS.HttpRequest"; } @@ -28,10 +30,16 @@ export class Connector return this.#provider; } - constructor(providerOptions: ProviderOptions = null, executor: utils.Executor) { + constructor( + providerOptions: ProviderOptions = null, + executor: utils.Executor + ) { super(); - const provider = (this.#provider = new EthereumProvider(providerOptions, executor)); + const provider = (this.#provider = new EthereumProvider( + providerOptions, + executor + )); provider.on("connect", () => { // tell the consumer (like a `ganache-core` server/connector) everything is ready this.emit("ready"); @@ -47,7 +55,9 @@ export class Connector } handle( - payload: JsonRpcTypes.Request | JsonRpcTypes.Request[], + payload: + | JsonRpcTypes.Request + | JsonRpcTypes.Request[], connection: HttpRequest | WebSocket ) { if (Array.isArray(payload)) { @@ -62,22 +72,38 @@ export class Connector return this.#handle(payload, connection); } } - #handle = (payload: JsonRpcTypes.Request, connection: HttpRequest | WebSocket) => { + #handle = ( + payload: JsonRpcTypes.Request, + connection: HttpRequest | WebSocket + ) => { const method = payload.method; if (method === "eth_subscribe") { if (isHttp(connection)) { - return Promise.reject(new CodedError("notifications not supported", ErrorCodes.METHOD_NOT_SUPPORTED)); + return Promise.reject( + new CodedError( + "notifications not supported", + ErrorCodes.METHOD_NOT_SUPPORTED + ) + ); } } const params = payload.params as Parameters; return this.#provider.requestRaw({ method, params }); }; - format(result: any, payload: JsonRpcTypes.Request): RecognizedString; - format(results: any[], payloads: JsonRpcTypes.Request[]): RecognizedString; + format( + result: any, + payload: JsonRpcTypes.Request + ): RecognizedString; + format( + results: any[], + payloads: JsonRpcTypes.Request[] + ): RecognizedString; format( results: any | any[], - payload: JsonRpcTypes.Request | JsonRpcTypes.Request[] + payload: + | JsonRpcTypes.Request + | JsonRpcTypes.Request[] ): RecognizedString { if (Array.isArray(payload)) { return JSON.stringify( @@ -96,8 +122,14 @@ export class Connector } } - formatError(error: Error & { code: number }, payload: JsonRpcTypes.Request): RecognizedString { - const json = JsonRpcTypes.Error(payload && payload.id ? payload.id : null, error); + formatError( + error: Error & { code: number }, + payload: JsonRpcTypes.Request + ): RecognizedString { + const json = JsonRpcTypes.Error( + payload && payload.id ? payload.id : null, + error + ); return JSON.stringify(json); } diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 0577f92dfb..f04cfc70b4 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -20,9 +20,13 @@ type BlockData = { timestamp: Buffer; }; -const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); +const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => + promisify(trie.put.bind(trie))(key, val); -function replaceFromHeap(priced: utils.Heap, source: utils.Heap) { +function replaceFromHeap( + priced: utils.Heap, + source: utils.Heap +) { // get the next best for this account, removing from the source Heap: const next = source.peek(); if (next) { @@ -41,7 +45,10 @@ function byPrice(values: Transaction[], a: number, b: number) { return Quantity.from(values[a].gasPrice) > Quantity.from(values[b].gasPrice); } -export default class Miner extends Emittery.Typed<{ block: BlockData }, "idle"> { +export default class Miner extends Emittery.Typed< + { block: BlockData }, + "idle" +> { #currentlyExecutingPrice = 0n; #origins = new Set(); #pending: boolean; @@ -115,7 +122,11 @@ export default class Miner extends Emittery.Typed<{ block: BlockData }, "idle"> * * @returns the transactions mined in the _first_ block */ - public async mine(block: Block, maxTransactions: number = -1, onlyOneBlock = false) { + public async mine( + block: Block, + maxTransactions: number = -1, + onlyOneBlock = false + ) { if (this.#paused) { await this.#resumer; } @@ -136,8 +147,16 @@ export default class Miner extends Emittery.Typed<{ block: BlockData }, "idle"> return result; } - #mine = async (block: Block, maxTransactions: number = -1, onlyOneBlock = false) => { - const { block: lastBlock, transactions } = await this.#mineTxs(block, maxTransactions, onlyOneBlock); + #mine = async ( + block: Block, + maxTransactions: number = -1, + onlyOneBlock = false + ) => { + const { block: lastBlock, transactions } = await this.#mineTxs( + block, + maxTransactions, + onlyOneBlock + ); // if there are more txs to mine, start mining them without awaiting their // result. @@ -150,7 +169,11 @@ export default class Miner extends Emittery.Typed<{ block: BlockData }, "idle"> return transactions; }; - #mineTxs = async (block: Block, maxTransactions: number, onlyOneBlock: boolean) => { + #mineTxs = async ( + block: Block, + maxTransactions: number, + onlyOneBlock: boolean + ) => { const { pending, inProgress } = this.#executables; let keepMining = true; @@ -263,7 +286,10 @@ export default class Miner extends Emittery.Typed<{ block: BlockData }, "idle"> // we're done with this block! // notice: when `maxTransactions` is `-1` (AKA infinite), `numTransactions === maxTransactions` // will always return false, so this comparison works out fine. - if (blockGasLeft <= params.TRANSACTION_GAS || numTransactions === maxTransactions) { + if ( + blockGasLeft <= params.TRANSACTION_GAS || + numTransactions === maxTransactions + ) { if (keepMining) { // remove the newest (`best`) tx from this account's pending queue // as we know we can fit another transaction in the block. Stick @@ -340,7 +366,12 @@ export default class Miner extends Emittery.Typed<{ block: BlockData }, "idle"> return { block, transactions: blockTransactions }; }; - #runTx = async (tx: Transaction, block: Block, origin: string, pending: Map>) => { + #runTx = async ( + tx: Transaction, + block: Block, + origin: string, + pending: Map> + ) => { try { return await this.#vm.runTx({ tx, block } as any); } catch (err) { @@ -362,7 +393,10 @@ export default class Miner extends Emittery.Typed<{ block: BlockData }, "idle"> returnValue: Buffer.allocUnsafe(0) } } as any; - tx.finalize("rejected", new RuntimeError(tx.hash(), e, RETURN_TYPES.TRANSACTION_HASH)); + tx.finalize( + "rejected", + new RuntimeError(tx.hash(), e, RETURN_TYPES.TRANSACTION_HASH) + ); return null; } }; diff --git a/src/chains/ethereum/src/options/chain-options.ts b/src/chains/ethereum/src/options/chain-options.ts index 6c8eb47972..7a702232a1 100644 --- a/src/chains/ethereum/src/options/chain-options.ts +++ b/src/chains/ethereum/src/options/chain-options.ts @@ -1,6 +1,11 @@ import { Definitions } from "@ganache/options"; -export type Hardfork = "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier"; +export type Hardfork = + | "constantinople" + | "byzantium" + | "petersburg" + | "istanbul" + | "muirGlacier"; export type ChainConfig = { options: { diff --git a/src/chains/ethereum/src/options/index.ts b/src/chains/ethereum/src/options/index.ts index 7b574aa8cf..ce99e6fc43 100644 --- a/src/chains/ethereum/src/options/index.ts +++ b/src/chains/ethereum/src/options/index.ts @@ -3,7 +3,13 @@ import { DatabaseConfig, DatabaseOptions } from "./database-options"; import { LoggingConfig, LoggingOptions } from "./logging-options"; import { MinerConfig, MinerOptions } from "./miner-options"; import { WalletConfig, WalletOptions } from "./wallet-options"; -import { Defaults, Definitions, ExternalConfig, InternalConfig, OptionsConfig } from "@ganache/options"; +import { + Defaults, + Definitions, + ExternalConfig, + InternalConfig, + OptionsConfig +} from "@ganache/options"; export type EthereumOptions = { chain: ChainConfig; diff --git a/src/chains/ethereum/src/options/wallet-options.ts b/src/chains/ethereum/src/options/wallet-options.ts index 0715844f04..8483587a03 100644 --- a/src/chains/ethereum/src/options/wallet-options.ts +++ b/src/chains/ethereum/src/options/wallet-options.ts @@ -16,7 +16,8 @@ function randomBytes(length: number, rng: () => number) { } const randomAlphaNumericString = (() => { - const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + const alphabet = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; const alphabetLength = alphabet.length; return (length: number, rng: () => number) => { let text = ""; @@ -133,7 +134,8 @@ export const WalletOptions: Definitions = { }, mnemonic: { normalize: rawInput => rawInput, - default: config => entropyToMnemonic(randomBytes(16, seedrandom(config.seed))) + default: config => + entropyToMnemonic(randomBytes(16, seedrandom(config.seed))) }, unlockedAccounts: { normalize: rawInput => rawInput, diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 230a93dbbc..06446ae232 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -1,12 +1,18 @@ import Emittery from "emittery"; import EthereumApi from "./api"; import { JsonRpcTypes } from "@ganache/utils"; -import { EthereumProviderOptions, EthereumInternalOptions, EthereumOptionsConfig } from "./options"; +import { + EthereumProviderOptions, + EthereumInternalOptions, + EthereumOptionsConfig +} from "./options"; import cloneDeep from "lodash.clonedeep"; import { PromiEvent, types, utils } from "@ganache/utils"; declare type RequestMethods = types.KnownKeys; -type mergePromiseGenerics = Promise ? X : never>; +type mergePromiseGenerics = Promise< + Type extends Promise ? X : never +>; interface Callback { (err?: Error, response?: JsonRpcTypes.Response): void; @@ -28,7 +34,9 @@ export default class EthereumProvider constructor(options: EthereumProviderOptions = {}, executor: utils.Executor) { super(); - const providerOptions = (this.#options = EthereumOptionsConfig.normalize(options)); + const providerOptions = (this.#options = EthereumOptionsConfig.normalize( + options + )); this.#executor = executor; @@ -52,7 +60,10 @@ export default class EthereumProvider * @param callback * @deprecated Use the `request` method */ - public send(payload: JsonRpcTypes.Request, callback?: Callback): undefined; + public send( + payload: JsonRpcTypes.Request, + callback?: Callback + ): undefined; /** * Legacy callback style API * @param payload JSON-RPC payload @@ -60,15 +71,24 @@ export default class EthereumProvider * @deprecated Batch transactions have been deprecated. Send payloads * individually via the `request` method. */ - public send(payloads: JsonRpcTypes.Request[], callback?: Callback): undefined; + public send( + payloads: JsonRpcTypes.Request[], + callback?: Callback + ): undefined; /** * @param method * @param params * @ignore Non standard! Do not use. */ - public send(method: RequestMethods, params?: Parameters): any; public send( - arg1: RequestMethods | JsonRpcTypes.Request | JsonRpcTypes.Request[], + method: RequestMethods, + params?: Parameters + ): any; + public send( + arg1: + | RequestMethods + | JsonRpcTypes.Request + | JsonRpcTypes.Request[], arg2?: Callback | any[] ) { let method: RequestMethods; @@ -108,7 +128,10 @@ export default class EthereumProvider * @param callback callback * @deprecated Use the `request` method. */ - public sendAsync(payload: JsonRpcTypes.Request, callback?: Callback): void { + public sendAsync( + payload: JsonRpcTypes.Request, + callback?: Callback + ): void { return this.send(payload, callback); } @@ -119,7 +142,9 @@ export default class EthereumProvider * @EIP [1193](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md) */ public async request( - args: Parameters["length"] extends 0 ? Pick, "method"> : never + args: Parameters["length"] extends 0 + ? Pick, "method"> + : never ): mergePromiseGenerics>; /** * EIP-1193 style request method @@ -130,7 +155,9 @@ export default class EthereumProvider public async request( args: RequestParams ): mergePromiseGenerics>; - public async request(args: RequestParams) { + public async request( + args: RequestParams + ) { const rawResult = await this.requestRaw(args); const value = await rawResult.value; return JSON.parse(JSON.stringify(value)); @@ -141,7 +168,10 @@ export default class EthereumProvider * otherwise be flattened into a regular Promise through the Promise chain. * @param request */ - public async requestRaw({ method, params }: RequestParams) { + public async requestRaw({ + method, + params + }: RequestParams) { this.#logRequest(method, params); const result = await this.#executor.execute(this.#api, method, params); @@ -166,7 +196,9 @@ export default class EthereumProvider if (hasOwn(error, "result")) { // stringify the result here // TODO: not sure why the stringification is even needed. - (error as any).result = JSON.parse(JSON.stringify((error as any).result)); + (error as any).result = JSON.parse( + JSON.stringify((error as any).result) + ); } } // then rethrow @@ -175,11 +207,18 @@ export default class EthereumProvider return { value: value }; } - #logRequest = (method: string, params: Parameters) => { + #logRequest = ( + method: string, + params: Parameters + ) => { const options = this.#options; if (options.logging.verbose) { options.logging.logger.log( - ` > ${method}: ${params == null ? params : JSON.stringify(params, null, 2).split("\n").join("\n > ")}` + ` > ${method}: ${ + params == null + ? params + : JSON.stringify(params, null, 2).split("\n").join("\n > ") + }` ); } }; @@ -214,7 +253,10 @@ export default class EthereumProvider const result = await this.request({ method, params }); return { error: null as JsonRpcTypes.Error, - result: JsonRpcTypes.Response(payload.id, JSON.parse(JSON.stringify(result))) + result: JsonRpcTypes.Response( + payload.id, + JSON.parse(JSON.stringify(result)) + ) }; } catch (error) { let result: any; diff --git a/src/chains/ethereum/src/things/account.ts b/src/chains/ethereum/src/things/account.ts index a035e7ccdc..88639235c8 100644 --- a/src/chains/ethereum/src/things/account.ts +++ b/src/chains/ethereum/src/things/account.ts @@ -30,6 +30,13 @@ export default class Account { } public serialize() { - return rlp.encode(Buffer.concat([this.nonce.toBuffer(), this.balance.toBuffer(), this.stateRoot, this.codeHash])); + return rlp.encode( + Buffer.concat([ + this.nonce.toBuffer(), + this.balance.toBuffer(), + this.stateRoot, + this.codeHash + ]) + ); } } diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/src/things/blocklogs.ts index 5e4d14031b..f71b435b47 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/src/things/blocklogs.ts @@ -3,7 +3,11 @@ import { Data, Quantity } from "@ganache/utils"; import Address from "./address"; import { utils } from "@ganache/utils"; -export type TransactionLog = [address: Buffer, topics: Buffer[], data: Buffer | Buffer[]]; +export type TransactionLog = [ + address: Buffer, + topics: Buffer[], + data: Buffer | Buffer[] +]; export type BlockLog = [ removed: Buffer, transactionIndex: Buffer, @@ -16,7 +20,10 @@ export type BlockLog = [ const _raw = Symbol("raw"); const _logs = Symbol("logs"); -const filterByTopic = (expectedTopics: (string | string[])[], logTopics: Buffer[]) => { +const filterByTopic = ( + expectedTopics: (string | string[])[], + logTopics: Buffer[] +) => { // Exclude log if its number of topics is less than the number expected if (expectedTopics.length > logTopics.length) return false; @@ -35,7 +42,9 @@ const filterByTopic = (expectedTopics: (string | string[])[], logTopics: Buffer[ const logTopic = logTopics[logPosition]; // "OR" logic, e.g., [[A, B]] means log topic in the first position matching either "A" OR "B": - return expectedTopicSet.some(expectedTopic => logTopic.equals(Data.from(expectedTopic).toBuffer())); + return expectedTopicSet.some(expectedTopic => + logTopic.equals(Data.from(expectedTopic).toBuffer()) + ); }); }; @@ -73,7 +82,11 @@ export default class BlockLogs { * @param transactionHash * @param log */ - public append(/*removed: boolean, */ transactionIndex: Buffer, transactionHash: Buffer, log: TransactionLog) { + public append( + /*removed: boolean, */ transactionIndex: Buffer, + transactionHash: Buffer, + log: TransactionLog + ) { this[_raw][1].push([ utils.BUFFER_ZERO, // `removed`, TODO: this is used for reorgs, but we don't support them yet transactionIndex, // transactionIndex @@ -108,7 +121,12 @@ export default class BlockLogs { return { *[Symbol.iterator]() { for (let i = 0; i < l; i++) { - yield BlockLogs.logToJSON(logs[i], Quantity.from(i), blockHash, blockNumber); + yield BlockLogs.logToJSON( + logs[i], + Quantity.from(i), + blockHash, + blockNumber + ); } } }; @@ -121,7 +139,8 @@ export default class BlockLogs { yield { address, topics, - toJSON: () => BlockLogs.logToJSON(log, Quantity.from(i), blockHash, blockNumber) + toJSON: () => + BlockLogs.logToJSON(log, Quantity.from(i), blockHash, blockNumber) }; } } @@ -135,7 +154,12 @@ export default class BlockLogs { * @param blockHash The hash of the block * @param blockNumber The block number */ - protected static logToJSON(log: BlockLog, logIndex: Quantity, blockHash: Data, blockNumber: Quantity) { + protected static logToJSON( + log: BlockLog, + logIndex: Quantity, + blockHash: Data, + blockNumber: Quantity + ) { const topics = log[4]; const data = log[5]; @@ -143,10 +167,14 @@ export default class BlockLogs { address: Address.from(log[3]), blockHash, blockNumber, - data: Array.isArray(data) ? data.map(d => Data.from(d, d.length)) : Data.from(data, data.length), + data: Array.isArray(data) + ? data.map(d => Data.from(d, d.length)) + : Data.from(data, data.length), logIndex, // this is the index in the *block* removed: log[0].equals(utils.BUFFER_ZERO) ? false : true, - topics: Array.isArray(topics) ? topics.map(t => Data.from(t, 32)) : Data.from(topics, 32), + topics: Array.isArray(topics) + ? topics.map(t => Data.from(t, 32)) + : Data.from(topics, 32), transactionHash: Data.from(log[2], 32), transactionIndex: Quantity.from(log[1]) }; @@ -171,11 +199,13 @@ export default class BlockLogs { if (expectedAddresses.length !== 0) { if (expectedTopics.length === 0) { for (const log of logs) { - if (expectedAddresses.some(address => address.equals(log.address))) yield log.toJSON(); + if (expectedAddresses.some(address => address.equals(log.address))) + yield log.toJSON(); } } else { for (const log of logs) { - if (!expectedAddresses.some(address => address.equals(log.address))) continue; + if (!expectedAddresses.some(address => address.equals(log.address))) + continue; if (filterByTopic(expectedTopics, log.topics)) yield log.toJSON(); } } diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index cf82e9d4d5..ede2214c3b 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -4,7 +4,12 @@ import { encode as rlpEncode, decode as rlpDecode } from "rlp"; import { Data, Quantity } from "@ganache/utils"; import BlockLogs, { TransactionLog } from "./blocklogs"; -type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; +type OmitLastType]> = T extends [ + ...infer A, + infer _L +] + ? A + : never; type FullRawReceipt = [ status: Buffer, cumulativeGasUsed: Buffer, @@ -23,7 +28,14 @@ export default class TransactionReceipt { constructor(data?: Buffer) { if (data) { const decoded = (rlpDecode(data) as unknown) as FullRawReceipt; - this.#init(decoded[0], decoded[1], decoded[2], decoded[3], decoded[4], decoded[5]); + this.#init( + decoded[0], + decoded[1], + decoded[2], + decoded[3], + decoded[4], + decoded[5] + ); } } #init = ( @@ -48,14 +60,25 @@ export default class TransactionReceipt { contractAddress: Buffer ) { const receipt = new TransactionReceipt(); - receipt.#init(status, cumulativeGasUsed, logsBloom, logs, contractAddress, gasUsed); + receipt.#init( + status, + cumulativeGasUsed, + logsBloom, + logs, + contractAddress, + gasUsed + ); return receipt; } public serialize(all: boolean) { if (all) { // the database format includes the contractAddress: - return rlpEncode([...this.raw, this.#gasUsed, this.contractAddress] as FullRawReceipt); + return rlpEncode([ + ...this.raw, + this.#gasUsed, + this.contractAddress + ] as FullRawReceipt); } else { // receipt trie format: return rlpEncode(this.raw); @@ -64,7 +87,10 @@ export default class TransactionReceipt { public toJSON(block: Block, transaction: Transaction) { const raw = this.raw; - const contractAddress = this.contractAddress.length === 0 ? null : Data.from(this.contractAddress); + const contractAddress = + this.contractAddress.length === 0 + ? null + : Data.from(this.contractAddress); const blockLog = BlockLogs.create(block.value.hash()); blockLog.blockNumber = Quantity.from(block.value.header.number); ((raw[3] as any) as TransactionLog[]).forEach(log => { diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 904d2ca397..56aa85f9a1 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -2,7 +2,10 @@ import { INTRINSIC_GAS_TOO_LOW } from "../errors/errors"; import RuntimeError, { RETURN_TYPES } from "../errors/runtime-error"; import { utils, Data, Quantity } from "@ganache/utils"; import params from "./params"; -import { Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction } from "ethereumjs-tx"; +import { + Transaction as EthereumJsTransaction, + FakeTransaction as EthereumJsFakeTransaction +} from "ethereumjs-tx"; import * as ethUtil from "ethereumjs-util"; import assert from "assert"; import { decode as rlpDecode } from "rlp"; @@ -28,7 +31,10 @@ const fakeHash = function (this: Transaction) { if (this._hash != null) { return this._hash; } - return EthereumJsFakeTransaction.prototype.hash.apply(this, (arguments as unknown) as [(boolean | undefined)?]); + return EthereumJsFakeTransaction.prototype.hash.apply( + this, + (arguments as unknown) as [(boolean | undefined)?] + ); }; function configZeroableField(tx: any, fieldName: string, fieldLength = 32) { @@ -39,7 +45,10 @@ function configZeroableField(tx: any, fieldName: string, fieldLength = 32) { set: v => { descriptor.set.call(tx, v); v = ethUtil.toBuffer(v); - assert(fieldLength >= v.length, `The field ${fieldName} must not have more ${fieldLength} bytes`); + assert( + fieldLength >= v.length, + `The field ${fieldName} must not have more ${fieldLength} bytes` + ); tx._originals[index] = v; }, get: () => { @@ -195,7 +204,9 @@ function initData(tx: Transaction, data: any) { //#endregion -type TransactionFinalization = { status: "confirmed"; error?: Error } | { status: "rejected"; error: Error }; +type TransactionFinalization = + | { status: "confirmed"; error?: Error } + | { status: "rejected"; error: Error }; interface Transaction extends Omit {} // TODO fix the EthereumJsTransaction as any via some "fake" multi-inheritance: @@ -218,7 +229,11 @@ class Transaction extends (EthereumJsTransaction as any) { * @param {Number} type The `Transaction.types` bit flag for this transaction * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ - constructor(data: any, common: Common, type: number = Transaction.types.none) { + constructor( + data: any, + common: Common, + type: number = Transaction.types.none + ) { super(void 0, { common }); // EthereumJS-TX Transaction overwrites our `toJSON`, so we overwrite it back here: @@ -251,7 +266,8 @@ class Transaction extends (EthereumJsTransaction as any) { cost(): bigint { return ( - Quantity.from(this.gasPrice).toBigInt() * Quantity.from(this.gasLimit).toBigInt() + + Quantity.from(this.gasPrice).toBigInt() * + Quantity.from(this.gasLimit).toBigInt() + Quantity.from(this.value).toBigInt() ); } @@ -289,7 +305,12 @@ class Transaction extends (EthereumJsTransaction as any) { */ public static calculateIntrinsicGas( data: Buffer | null, - hardfork: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier" + hardfork: + | "constantinople" + | "byzantium" + | "petersburg" + | "istanbul" + | "muirGlacier" ) { // Set the starting gas for the raw transaction let gas = params.TRANSACTION_GAS; @@ -297,7 +318,9 @@ class Transaction extends (EthereumJsTransaction as any) { // Bump the required gas by the amount of transactional data const dataLength = data.byteLength; if (dataLength > 0) { - const TRANSACTION_DATA_NON_ZERO_GAS = params.TRANSACTION_DATA_NON_ZERO_GAS.get(hardfork); + const TRANSACTION_DATA_NON_ZERO_GAS = params.TRANSACTION_DATA_NON_ZERO_GAS.get( + hardfork + ); const TRANSACTION_DATA_ZERO_GAS = params.TRANSACTION_DATA_ZERO_GAS; // Zero and non-zero bytes are priced differently @@ -335,7 +358,11 @@ class Transaction extends (EthereumJsTransaction as any) { * @param {Number} type The `Transaction.types` bit flag for this transaction * Can be a combination of `Transaction.types.none`, `Transaction.types.signed`, and `Transaction.types.fake`. */ - static fromJSON(json: any, common: Common, type: ExtractValuesFromType) { + static fromJSON( + json: any, + common: Common, + type: ExtractValuesFromType + ) { let toAccount: Buffer; if (json.to) { // Remove all padding and make it easily comparible. @@ -463,7 +490,11 @@ class Transaction extends (EthereumJsTransaction as any) { let status: Buffer; if (execException) { status = ZERO_BUFFER; - this.execException = new RuntimeError(this.hash(), result, RETURN_TYPES.TRANSACTION_HASH); + this.execException = new RuntimeError( + this.hash(), + result, + RETURN_TYPES.TRANSACTION_HASH + ); } else { status = ONE_BUFFER; } diff --git a/src/chains/ethereum/src/transaction-pool.ts b/src/chains/ethereum/src/transaction-pool.ts index e974feb55c..2e8f01924d 100644 --- a/src/chains/ethereum/src/transaction-pool.ts +++ b/src/chains/ethereum/src/transaction-pool.ts @@ -9,7 +9,10 @@ import { EthereumInternalOptions } from "./options"; import { Executables } from "./types/executables"; function byNonce(values: Transaction[], a: number, b: number) { - return (Quantity.from(values[b].nonce).toBigInt() || 0n) > (Quantity.from(values[a].nonce).toBigInt() || 0n); + return ( + (Quantity.from(values[b].nonce).toBigInt() || 0n) > + (Quantity.from(values[a].nonce).toBigInt() || 0n) + ); } export default class TransactionPool extends Emittery.Typed<{}, "drain"> { @@ -21,7 +24,10 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { #priceBump: bigint = 10n; #blockchain: Blockchain; - constructor(options: EthereumInternalOptions["miner"], blockchain: Blockchain) { + constructor( + options: EthereumInternalOptions["miner"], + blockchain: Blockchain + ) { super(); this.#blockchain = blockchain; this.#options = options; @@ -97,7 +103,10 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { let executableOriginTransactions = executables.get(origin); let length: number; - if (executableOriginTransactions && (length = executableOriginTransactions.length)) { + if ( + executableOriginTransactions && + (length = executableOriginTransactions.length) + ) { // check if a transaction with the same nonce is in the origin's // executables queue already. Replace the matching transaction or throw this // new transaction away as neccessary. @@ -124,7 +133,10 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { currentPendingTx.finalize( "rejected", - new CodedError("Transaction replaced by better transaction", ErrorCodes.TRANSACTION_REJECTED) + new CodedError( + "Transaction replaced by better transaction", + ErrorCodes.TRANSACTION_REJECTED + ) ); } else { throw new CodedError( diff --git a/src/chains/ethereum/src/types/subscriptions.ts b/src/chains/ethereum/src/types/subscriptions.ts index fd6d567016..17adeaa0f2 100644 --- a/src/chains/ethereum/src/types/subscriptions.ts +++ b/src/chains/ethereum/src/types/subscriptions.ts @@ -1,2 +1,6 @@ export type SubscriptionId = string; -export type SubscriptionName = "newHeads" | "newPendingTransactions" | "syncing" | "logs"; +export type SubscriptionName = + | "newHeads" + | "newPendingTransactions" + | "syncing" + | "logs"; diff --git a/src/chains/ethereum/src/types/tuple-from-union.ts b/src/chains/ethereum/src/types/tuple-from-union.ts index 3cc254329f..71aa7e40e1 100644 --- a/src/chains/ethereum/src/types/tuple-from-union.ts +++ b/src/chains/ethereum/src/types/tuple-from-union.ts @@ -1,21 +1,36 @@ -type TuplePrepend = [NewElement, ...Tuple]; +type TuplePrepend = [ + NewElement, + ...Tuple +]; type Consumer = (value: Value) => void; -type IntersectionFromUnion = (Union extends unknown ? Consumer : never) extends Consumer< - infer ResultIntersection -> +type IntersectionFromUnion = ( + Union extends unknown ? Consumer : never +) extends Consumer ? ResultIntersection : never; -type OverloadedConsumerFromUnion = IntersectionFromUnion : never>; +type OverloadedConsumerFromUnion = IntersectionFromUnion< + Union extends unknown ? Consumer : never +>; -type UnionLast = OverloadedConsumerFromUnion extends (a: infer A) => void ? A : never; +type UnionLast = OverloadedConsumerFromUnion extends ( + a: infer A +) => void + ? A + : never; type UnionExcludingLast = Exclude>; -type TupleFromUnionRec = [RemainingUnion] extends [never] +type TupleFromUnionRec< + RemainingUnion, + CurrentTuple extends readonly unknown[] +> = [RemainingUnion] extends [never] ? CurrentTuple - : TupleFromUnionRec, TuplePrepend>>; + : TupleFromUnionRec< + UnionExcludingLast, + TuplePrepend> + >; export type TupleFromUnion = TupleFromUnionRec; diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 1e5030ec13..23033f3abd 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -23,31 +23,56 @@ const CIPHER = "aes-128-ctr"; const WEI = utils.WEI; //#endregion -type OmitLastType]> = T extends [...infer A, infer _L] ? A : never; -type LastType]> = T extends [...infer _A, infer L] ? L : never; +type OmitLastType]> = T extends [ + ...infer A, + infer _L +] + ? A + : never; +type LastType]> = T extends [ + ...infer _A, + infer L +] + ? L + : never; type Params = Parameters; type LastParams = Parameters>; const scrypt = (...args: OmitLastType) => { - return new Promise((resolve: (value: LastParams[1]) => void, reject: (reason: LastParams[0]) => void) => { - crypto.scrypt.call(crypto, ...args, (err: LastParams[0], derivedKey: LastParams[1]) => { - if (err) { - return void reject(err); - } - return resolve(derivedKey); - }); - }); + return new Promise( + ( + resolve: (value: LastParams[1]) => void, + reject: (reason: LastParams[0]) => void + ) => { + crypto.scrypt.call( + crypto, + ...args, + (err: LastParams[0], derivedKey: LastParams[1]) => { + if (err) { + return void reject(err); + } + return resolve(derivedKey); + } + ); + } + ); }; const uncompressedPublicKeyToAddress = (uncompressedPublicKey: Buffer) => { - const compresedPublicKey = secp256k1.publicKeyConvert(uncompressedPublicKey, false).slice(1); + const compresedPublicKey = secp256k1 + .publicKeyConvert(uncompressedPublicKey, false) + .slice(1); const hasher = createKeccakHash("keccak256"); (hasher as any)._state.absorb(compresedPublicKey); return Address.from(hasher.digest().slice(-20)); }; const asUUID = (uuid: Buffer | { length: 16 }) => { - return `${uuid.toString("hex", 0, 4)}-${uuid.toString("hex", 4, 6)}-${uuid.toString("hex", 6, 8)}-${uuid.toString( + return `${uuid.toString("hex", 0, 4)}-${uuid.toString( + "hex", + 4, + 6 + )}-${uuid.toString("hex", 6, 8)}-${uuid.toString( "hex", 8, 10 @@ -70,7 +95,9 @@ export default class Wallet { constructor(opts: EthereumInternalOptions["wallet"]) { this.#hdKey = HDKey.fromMasterSeed(mnemonicToSeedSync(opts.mnemonic, null)); - const initialAccounts = (this.initialAccounts = this.#initializeAccounts(opts)); + const initialAccounts = (this.initialAccounts = this.#initializeAccounts( + opts + )); const l = initialAccounts.length; const knownAccounts = this.knownAccounts; @@ -109,7 +136,11 @@ export default class Wallet { case "number": const account = initialAccounts[arg]; if (account == null) { - throw new Error(`Account at index ${arg} not found. Max index available is ${l - 1}.`); + throw new Error( + `Account at index ${arg} not found. Max index available is ${ + l - 1 + }.` + ); } address = account.address.toString().toLowerCase(); break; @@ -171,14 +202,17 @@ export default class Wallet { return buf; }; - #initializeAccounts = (options: EthereumInternalOptions["wallet"]): Account[] => { + #initializeAccounts = ( + options: EthereumInternalOptions["wallet"] + ): Account[] => { // convert a potentially fractional balance of Ether to WEI const balanceParts = options.defaultBalance.toString().split(".", 2); const significand = BigInt(balanceParts[0]); const fractionalStr = balanceParts[1] || "0"; const fractional = BigInt(fractionalStr); const magnitude = 10n ** BigInt(fractionalStr.length); - const defaultBalanceInWei = WEI * significand + fractional * (WEI / magnitude); + const defaultBalanceInWei = + WEI * significand + fractional * (WEI / magnitude); const etherInWei = Quantity.from(defaultBalanceInWei); let accounts: Account[]; @@ -197,10 +231,16 @@ export default class Wallet { const acct = hdKey.derive(hdPath + i); address = uncompressedPublicKeyToAddress(acct.publicKey); privateKey = Data.from(acct.privateKey); - accounts[i] = Wallet.createAccount(Quantity.from(account.balance), privateKey, address); + accounts[i] = Wallet.createAccount( + Quantity.from(account.balance), + privateKey, + address + ); } else { privateKey = Data.from(secretKey); - const a = (accounts[i] = Wallet.createAccountFromPrivateKey(privateKey)); + const a = (accounts[i] = Wallet.createAccountFromPrivateKey( + privateKey + )); a.balance = Quantity.from(account.balance); } } @@ -215,10 +255,16 @@ export default class Wallet { const acct = hdKey.derive(hdPath + index); const address = uncompressedPublicKeyToAddress(acct.publicKey); const privateKey = Data.from(acct.privateKey); - accounts[index] = Wallet.createAccount(etherInWei, privateKey, address); + accounts[index] = Wallet.createAccount( + etherInWei, + privateKey, + address + ); } } else { - throw new Error("Cannot initialize chain: either options.accounts or options.total_accounts must be specified"); + throw new Error( + "Cannot initialize chain: either options.accounts or options.total_accounts must be specified" + ); } } return accounts; @@ -235,7 +281,10 @@ export default class Wallet { N: SCRYPT_PARAMS.n }); const cipher = crypto.createCipheriv(CIPHER, derivedKey.slice(0, 16), iv); - const ciphertext = Buffer.concat([cipher.update(privateKey.toBuffer()), cipher.final()]); + const ciphertext = Buffer.concat([ + cipher.update(privateKey.toBuffer()), + cipher.final() + ]); const mac = createKeccakHash("keccak256") .update(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) .digest(); @@ -277,7 +326,12 @@ export default class Wallet { let localMac: Buffer; if (passphrase != null) { try { - derivedKey = await scrypt(passphrase, salt.toBuffer(), kdfParams.dklen, { ...kdfParams, N: kdfParams.n }); + derivedKey = await scrypt( + passphrase, + salt.toBuffer(), + kdfParams.dklen, + { ...kdfParams, N: kdfParams.n } + ); localMac = createKeccakHash("keccak256") .update(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) .digest(); @@ -290,12 +344,20 @@ export default class Wallet { throw new Error("could not decrypt key with given password"); } - const decipher = crypto.createDecipheriv(crypt.cipher, derivedKey.slice(0, 16), crypt.cipherparams.iv.toBuffer()); + const decipher = crypto.createDecipheriv( + crypt.cipher, + derivedKey.slice(0, 16), + crypt.cipherparams.iv.toBuffer() + ); const plaintext = decipher.update(ciphertext); return plaintext; } - public static createAccount(balance: Quantity, privateKey: Data, address: Address) { + public static createAccount( + balance: Quantity, + privateKey: Data, + address: Address + ) { const account = new Account(address); account.privateKey = privateKey; account.balance = balance; @@ -312,14 +374,21 @@ export default class Wallet { public createRandomAccount(startingSeed: string) { // create some seeded deterministic psuedo-randomness based on the chain's // initial starting conditions (`startingSeed`) - const seed = Buffer.concat([Buffer.from(startingSeed), this.#randomBytes(64)]); + const seed = Buffer.concat([ + Buffer.from(startingSeed), + this.#randomBytes(64) + ]); const acct = HDKey.fromMasterSeed(seed); const address = uncompressedPublicKeyToAddress(acct.publicKey); const privateKey = Data.from(acct.privateKey); return Wallet.createAccount(utils.RPCQUANTITY_ZERO, privateKey, address); } - public async unlockAccount(lowerAddress: string, passphrase: string, duration: number) { + public async unlockAccount( + lowerAddress: string, + passphrase: string, + duration: number + ) { const encryptedKeyFile = this.encryptedKeyFiles.get(lowerAddress); if (encryptedKeyFile == null) { return false; diff --git a/src/chains/tezos/src/provider.ts b/src/chains/tezos/src/provider.ts index bb0c110513..22450f7273 100644 --- a/src/chains/tezos/src/provider.ts +++ b/src/chains/tezos/src/provider.ts @@ -3,7 +3,10 @@ import TezosApi from "./api"; import Emittery from "emittery"; export default class TezosProvider - extends Emittery.Typed<{ request: types.RequestType }, "ready" | "close"> + extends Emittery.Typed< + { request: types.RequestType }, + "ready" | "close" + > implements types.Provider { constructor(providerOptions?: any) { super(); diff --git a/src/packages/core/__tests__/connector.test.ts b/src/packages/core/__tests__/connector.test.ts index 1b0e81e58a..b7c913eb27 100644 --- a/src/packages/core/__tests__/connector.test.ts +++ b/src/packages/core/__tests__/connector.test.ts @@ -12,13 +12,18 @@ describe("connector", () => { const p = Ganache.provider({ logging: { logger, verbose: true } }); logger.log = msg => { - assert.strictEqual(msg, " > net_version: undefined", "doesn't work when no params"); + assert.strictEqual( + msg, + " > net_version: undefined", + "doesn't work when no params" + ); }; await p.send("net_version"); return new Promise(async resolve => { logger.log = msg => { - const expected = " > web3_sha3: [\n" + ' > "Tim is a swell guy."\n' + " > ]"; + const expected = + " > web3_sha3: [\n" + ' > "Tim is a swell guy."\n' + " > ]"; assert.strictEqual(msg, expected, "doesn't work with params"); resolve(); }; diff --git a/src/packages/core/__tests__/helpers/getProvider.ts b/src/packages/core/__tests__/helpers/getProvider.ts index ca4814a987..01a35543be 100644 --- a/src/packages/core/__tests__/helpers/getProvider.ts +++ b/src/packages/core/__tests__/helpers/getProvider.ts @@ -2,8 +2,11 @@ import Ganache from "../../src/"; import { ProviderOptions } from "@ganache/options"; import { EthereumProvider } from "@ganache/ethereum"; -const mnemonic = "into trim cross then helmet popular suit hammer cart shrug oval student"; -const getProvider = (options: ProviderOptions = { flavor: "ethereum", mnemonic }) => { +const mnemonic = + "into trim cross then helmet popular suit hammer cart shrug oval student"; +const getProvider = ( + options: ProviderOptions = { flavor: "ethereum", mnemonic } +) => { return Ganache.provider(options) as EthereumProvider; }; diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/__tests__/server.test.ts index b637e594ea..6c7a73093c 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/__tests__/server.test.ts @@ -49,7 +49,9 @@ describe("server", () => { describe("http", () => { async function simpleTest() { - const response = await request.post("http://localhost:" + port).send(jsonRpcJson); + const response = await request + .post("http://localhost:" + port) + .send(jsonRpcJson); assert.strictEqual(response.status, 200); const json = JSON.parse(response.text); @@ -63,16 +65,28 @@ describe("server", () => { assert.strictEqual(s.status, Status.closed); const pendingListen = s.listen(port); assert.strictEqual(s.status, Status.opening); - assert.ok(s.status & Status.opening, "Bitmask broken: can't be used to determine `open || closed` state"); + assert.ok( + s.status & Status.opening, + "Bitmask broken: can't be used to determine `open || closed` state" + ); await pendingListen; assert.strictEqual(s.status, Status.open); - assert.ok(s.status & Status.open, "Bitmask broken: can't be used to determine `open || closed` state"); + assert.ok( + s.status & Status.open, + "Bitmask broken: can't be used to determine `open || closed` state" + ); const pendingClose = s.close(); assert.strictEqual(s.status, Status.closing); - assert.ok(s.status & Status.closing, "Bitmask broken: can't be used to determine `closed || closing` state"); + assert.ok( + s.status & Status.closing, + "Bitmask broken: can't be used to determine `closed || closing` state" + ); await pendingClose; assert.strictEqual(s.status, Status.closed); - assert.ok(s.status & Status.closed, "Bitmask broken: can't be used to determine `closed || closing` state"); + assert.ok( + s.status & Status.closed, + "Bitmask broken: can't be used to determine `closed || closing` state" + ); } catch (e) { // in case of failure, make sure we properly shut things down if (s.status & Status.open) { @@ -187,24 +201,27 @@ describe("server", () => { }); // skip on Windows until https://github.com/uNetworking/uSockets/pull/101 is merged - (IS_WINDOWS ? xit : it)("fails to listen if the socket is already in use by Ganache", async () => { - await setup(); - const s2 = Ganache.server(); + (IS_WINDOWS ? xit : it)( + "fails to listen if the socket is already in use by Ganache", + async () => { + await setup(); + const s2 = Ganache.server(); - try { - await assert.rejects(s2.listen(port), { - message: `listen EADDRINUSE: address already in use 127.0.0.1:${port}.` - }); - } catch (e) { - // in case of failure, make sure we properly shut things down - if (s2.status & Status.open) { - await s2.close().catch(e => e); + try { + await assert.rejects(s2.listen(port), { + message: `listen EADDRINUSE: address already in use 127.0.0.1:${port}.` + }); + } catch (e) { + // in case of failure, make sure we properly shut things down + if (s2.status & Status.open) { + await s2.close().catch(e => e); + } + throw e; + } finally { + await teardown(); } - throw e; - } finally { - await teardown(); } - }); + ); it("rejects if listen called while server is closing, Promise", async () => { await setup(); @@ -307,9 +324,14 @@ describe("server", () => { params: [] }; try { - const response = await request.post("http://localhost:" + port).send(jsonRpcJson); + const response = await request + .post("http://localhost:" + port) + .send(jsonRpcJson); assert.strictEqual(response.status, 200); - assert.strictEqual(JSON.parse(response.text).error.message, "notifications not supported"); + assert.strictEqual( + JSON.parse(response.text).error.message, + "notifications not supported" + ); } finally { await teardown(); } @@ -338,7 +360,9 @@ describe("server", () => { } ]; try { - const response = await request.post("http://localhost:" + port).send(jsonRpcJson); + const response = await request + .post("http://localhost:" + port) + .send(jsonRpcJson); const json = JSON.parse(response.text); assert.deepStrictEqual(json[0], { jsonrpc: "2.0", @@ -353,7 +377,10 @@ describe("server", () => { assert.deepStrictEqual(json[2].jsonrpc, "2.0"); assert.deepStrictEqual(json[2].id, "3"); assert.deepStrictEqual(json[2].error.code, -32004); - assert.deepStrictEqual(json[2].error.message, "notifications not supported"); + assert.deepStrictEqual( + json[2].error.message, + "notifications not supported" + ); } finally { await teardown(); } @@ -362,7 +389,9 @@ describe("server", () => { it("returns a teapot (easter egg)", async () => { await setup(); try { - const result = await request.get("http://localhost:" + port + "/418").catch(e => e); + const result = await request + .get("http://localhost:" + port + "/418") + .catch(e => e); assert.strictEqual(result.status, 418); assert.strictEqual(result.message, "I'm a Teapot"); } finally { @@ -372,10 +401,21 @@ describe("server", () => { it("returns 404 for bad routes", async () => { await setup(); - const methods = ["get", "post", "head", "options", "put", "delete", "patch", "trace"] as const; + const methods = [ + "get", + "post", + "head", + "options", + "put", + "delete", + "patch", + "trace" + ] as const; try { const requests = methods.map(async method => { - const result = await request[method]("http://localhost:" + port + "/there-is-no-spoon").catch((e: any) => e); + const result = await request[method]( + "http://localhost:" + port + "/there-is-no-spoon" + ).catch((e: any) => e); assert.strictEqual(result.status, 404); assert.strictEqual(result.message, "Not Found"); }); @@ -444,7 +484,10 @@ describe("server", () => { "Access-Control-Allow-Headers", "Access-Control-Max-Age" ] as const; - const baseHeaders = ["Access-Control-Allow-Credentials", "Access-Control-Allow-Origin"] as const; + const baseHeaders = [ + "Access-Control-Allow-Credentials", + "Access-Control-Allow-Origin" + ] as const; const allCorsHeaders = [...optionsHeaders, ...baseHeaders] as const; it("does not return CORS headers for non-CORS requests", async () => { @@ -472,8 +515,14 @@ describe("server", () => { .set("origin", origin) .send(jsonRpcJson); assert.strictEqual(resp.status, 200); - assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); - assert.strictEqual(resp.header["access-control-allow-origin"], origin); + assert.strictEqual( + resp.header["access-control-allow-credentials"], + "true" + ); + assert.strictEqual( + resp.header["access-control-allow-origin"], + origin + ); optionsHeaders.forEach(header => { assert.strictEqual( resp.header[header.toLowerCase()], @@ -495,11 +544,20 @@ describe("server", () => { .set("origin", origin) .send(jsonRpcJson); assert.strictEqual(resp.status, 204); - assert.strictEqual(resp.header["access-control-allow-methods"], "POST"); - assert.strictEqual(resp.header["access-control-allow-origin"], origin); + assert.strictEqual( + resp.header["access-control-allow-methods"], + "POST" + ); + assert.strictEqual( + resp.header["access-control-allow-origin"], + origin + ); assert.strictEqual(resp.header["access-control-max-age"], "600"); assert.strictEqual(resp.header["content-length"], "0"); - assert.strictEqual(resp.header["access-control-allow-credentials"], "true"); + assert.strictEqual( + resp.header["access-control-allow-credentials"], + "true" + ); } finally { await teardown(); } @@ -546,22 +604,36 @@ describe("server", () => { const ws = new WebSocket("ws://localhost:" + port); const response: any = await new Promise(resolve => { ws.on("open", () => { - const strToAB = (str: string) => new Uint8Array(str.split("").map(c => c.charCodeAt(0))).buffer; + const strToAB = (str: string) => + new Uint8Array(str.split("").map(c => c.charCodeAt(0))).buffer; ws.send(strToAB(JSON.stringify(jsonRpcJson))); }); ws.on("message", resolve); }); - assert.strictEqual(response.constructor, Buffer, "response doesn't seem to be a Buffer as expect"); + assert.strictEqual( + response.constructor, + Buffer, + "response doesn't seem to be a Buffer as expect" + ); const json = JSON.parse(response); - assert.strictEqual(json.result, `${networkId}`, "Binary data result is not as expected"); + assert.strictEqual( + json.result, + `${networkId}`, + "Binary data result is not as expected" + ); }); it("doesn't crash when sending bad data over http", async () => { - await assert.rejects(request.post("http://localhost:" + port).send("This is _not_ pudding."), { - message: "Bad Request" - }); + await assert.rejects( + request.post("http://localhost:" + port).send("This is _not_ pudding."), + { + message: "Bad Request" + } + ); - const response = await request.post("http://localhost:" + port).send(jsonRpcJson); + const response = await request + .post("http://localhost:" + port) + .send(jsonRpcJson); const json = JSON.parse(response.text); assert.strictEqual(json.result, `${networkId}`); }); @@ -592,7 +664,9 @@ describe("server", () => { // If we get a message that means things didn't get closed as they // should have OR they are closing too late for some reason and // this test isn't testing anything. - ws.on("message", () => reject("Got a message when we shouldn't have!")); + ws.on("message", () => + reject("Got a message when we shouldn't have!") + ); // make sure we leave enough time for things to crash if it does end // up crashing. diff --git a/src/packages/core/src/@types/uWebsockets.js.ts b/src/packages/core/src/@types/uWebsockets.js.ts index d7f3003d30..ebb1f396f5 100644 --- a/src/packages/core/src/@types/uWebsockets.js.ts +++ b/src/packages/core/src/@types/uWebsockets.js.ts @@ -7,6 +7,10 @@ enum ListenOptions { // uWebSockets.js doesn't include these in its TS def file. declare module "uWebSockets.js" { export interface TemplatedApp { - listen(port: number, options: ListenOptions, cb: (listenSocket: us_listen_socket | false) => void): TemplatedApp; + listen( + port: number, + options: ListenOptions, + cb: (listenSocket: us_listen_socket | false) => void + ): TemplatedApp; } } diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index 1f0bf91a99..756187322d 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -21,7 +21,9 @@ export default { if (providerOptions.chain.asyncRequestProcessing == null) { providerOptions.chain.asyncRequestProcessing = true; } - const requestCoordinator = new utils.RequestCoordinator(providerOptions.chain.asyncRequestProcessing ? 0 : 1); + const requestCoordinator = new utils.RequestCoordinator( + providerOptions.chain.asyncRequestProcessing ? 0 : 1 + ); // The Executor is responsible for actually executing the method on the chain/API. // It performs some safety checks to ensure "safe" method execution before passing it diff --git a/src/packages/core/src/index.ts b/src/packages/core/src/index.ts index b812252b10..7e3314b1bf 100644 --- a/src/packages/core/src/index.ts +++ b/src/packages/core/src/index.ts @@ -4,5 +4,6 @@ import Server from "./server"; export default { server: (options?: ServerOptions) => new Server(options), - provider: (options?: ProviderOptions) => Connector.initialize(options).provider + provider: (options?: ProviderOptions) => + Connector.initialize(options).provider }; diff --git a/src/packages/core/src/options/index.ts b/src/packages/core/src/options/index.ts index 7fdd0b840d..b36205c05c 100644 --- a/src/packages/core/src/options/index.ts +++ b/src/packages/core/src/options/index.ts @@ -1,6 +1,12 @@ import { Options as FlavorOptions } from "@ganache/flavors"; import { ServerConfig, ServerOptions } from "./server-options"; -import { Defaults, Definitions, ExternalConfig, InternalConfig, OptionsConfig } from "@ganache/options"; +import { + Defaults, + Definitions, + ExternalConfig, + InternalConfig, + OptionsConfig +} from "@ganache/options"; export type ProviderOptions = FlavorOptions; diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index b102e69a90..a8397eb064 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -64,7 +64,11 @@ export default class Server { const _app = (this.#app = uWS.App()); if (this.#options.server.ws) { - this.#websocketServer = new WebsocketServer(_app, connector as WebSocketCapableFlavor, opts.server); + this.#websocketServer = new WebsocketServer( + _app, + connector as WebSocketCapableFlavor, + opts.server + ); } this.#httpServer = new HttpServer(_app, connector); } @@ -77,28 +81,36 @@ export default class Server { if (status === Status.closing) { // if closing const err = new Error(`Cannot start server while it is closing.`); - return callbackIsFunction ? process.nextTick(callback!, err) : Promise.reject(err); + return callbackIsFunction + ? process.nextTick(callback!, err) + : Promise.reject(err); } else if (status & Status.open) { // if open or opening const err = new Error(`Server is already open on port: ${port}.`); - return callbackIsFunction ? process.nextTick(callback!, err) : Promise.reject(err); + return callbackIsFunction + ? process.nextTick(callback!, err) + : Promise.reject(err); } this.#status = Status.opening; - const promise = new Promise((resolve: (listenSocket: false | uWS.us_listen_socket) => void) => { - // Make sure we have *exclusive* use of this port. - // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 - const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); - }).then(listenSocket => { + const promise = new Promise( + (resolve: (listenSocket: false | uWS.us_listen_socket) => void) => { + // Make sure we have *exclusive* use of this port. + // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 + const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; + this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + } + ).then(listenSocket => { if (listenSocket) { this.#status = Status.open; this.#listenSocket = listenSocket; if (callbackIsFunction) callback!(null); } else { this.#status = Status.closed; - const err = new Error(`listen EADDRINUSE: address already in use 127.0.0.1:${port}.`); + const err = new Error( + `listen EADDRINUSE: address already in use 127.0.0.1:${port}.` + ); if (callbackIsFunction) callback!(err); else throw err; } diff --git a/src/packages/core/src/servers/http-server.ts b/src/packages/core/src/servers/http-server.ts index d48a3b4210..481f2321ed 100644 --- a/src/packages/core/src/servers/http-server.ts +++ b/src/packages/core/src/servers/http-server.ts @@ -1,4 +1,9 @@ -import { TemplatedApp, HttpResponse, HttpRequest, RecognizedString } from "uWebSockets.js"; +import { + TemplatedApp, + HttpResponse, + HttpRequest, + RecognizedString +} from "uWebSockets.js"; import ContentTypes from "./utils/content-types"; import HttpResponseCodes from "./utils/http-response-codes"; import { Connectors } from "@ganache/flavors"; @@ -89,7 +94,12 @@ export default class HttpServer { // because Easter Eggs are fun... app.get("/418", response => { - sendResponse(response, HttpResponseCodes.IM_A_TEAPOT, ContentTypes.PLAIN, "418 I'm a teapot"); + sendResponse( + response, + HttpResponseCodes.IM_A_TEAPOT, + ContentTypes.PLAIN, + "418 I'm a teapot" + ); }); // fallback routes... @@ -98,10 +108,20 @@ export default class HttpServer { if (connectionHeader && connectionHeader.toLowerCase() === "upgrade") { // if we got here it means the websocket server wasn't enabled but // a client tried to connect via websocket. This is a Bad Request. - sendResponse(response, HttpResponseCodes.BAD_REQUEST, ContentTypes.PLAIN, "400 Bad Request"); + sendResponse( + response, + HttpResponseCodes.BAD_REQUEST, + ContentTypes.PLAIN, + "400 Bad Request" + ); } else { // all other requests don't mean anything to us, so respond with `404 NOT FOUND`... - sendResponse(response, HttpResponseCodes.NOT_FOUND, ContentTypes.PLAIN, "404 Not Found"); + sendResponse( + response, + HttpResponseCodes.NOT_FOUND, + ContentTypes.PLAIN, + "404 Not Found" + ); } }); } @@ -145,7 +165,13 @@ export default class HttpServer { return; } const data = connector.format(result, payload); - sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); + sendResponse( + response, + HttpResponseCodes.OK, + ContentTypes.JSON, + data, + writeHeaders + ); }) .catch(error => { if (aborted) { @@ -154,7 +180,13 @@ export default class HttpServer { return; } const data = connector.formatError(error, payload); - sendResponse(response, HttpResponseCodes.OK, ContentTypes.JSON, data, writeHeaders); + sendResponse( + response, + HttpResponseCodes.OK, + ContentTypes.JSON, + data, + writeHeaders + ); }); } else { if (buffer) { @@ -170,7 +202,13 @@ export default class HttpServer { // handle CORS preflight requests... const writeHeaders = prepareCORSResponseHeaders("OPTIONS", request); // OPTIONS responses don't have a body, so respond with `204 No Content`... - sendResponse(response, HttpResponseCodes.NO_CONTENT, void 0, "", writeHeaders); + sendResponse( + response, + HttpResponseCodes.NO_CONTENT, + void 0, + "", + writeHeaders + ); }; public close() { // currently a no op. diff --git a/src/packages/core/src/servers/ws-server.ts b/src/packages/core/src/servers/ws-server.ts index 1fe2fdfc7b..792da2d0e3 100644 --- a/src/packages/core/src/servers/ws-server.ts +++ b/src/packages/core/src/servers/ws-server.ts @@ -24,7 +24,11 @@ export type WebsocketServerOptions = Pick; export default class WebsocketServer { #connections = new Map void>>(); - constructor(app: TemplatedApp, connector: WebSocketCapableFlavor, options: WebsocketServerOptions) { + constructor( + app: TemplatedApp, + connector: WebSocketCapableFlavor, + options: WebsocketServerOptions + ) { const connections = this.#connections; const wsBinary = options.wsBinary; const autoBinary = wsBinary === "auto"; @@ -40,7 +44,11 @@ export default class WebsocketServer { connections.set(ws, new Set()); }, - message: async (ws: GanacheWebSocket, message: ArrayBuffer, isBinary: boolean) => { + message: async ( + ws: GanacheWebSocket, + message: ArrayBuffer, + isBinary: boolean + ) => { let payload: ReturnType; const useBinary = autoBinary ? isBinary : (wsBinary as boolean); try { @@ -108,6 +116,8 @@ export default class WebsocketServer { }); } close() { - this.#connections.forEach((_, ws) => ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client")); + this.#connections.forEach((_, ws) => + ws.end(WebSocketCloseCodes.CLOSE_GOING_AWAY, "Server closed by client") + ); } } diff --git a/src/packages/options/src/helpers/definition.ts b/src/packages/options/src/helpers/definition.ts index 2f1e0fb6a8..733b81b858 100644 --- a/src/packages/options/src/helpers/definition.ts +++ b/src/packages/options/src/helpers/definition.ts @@ -1,20 +1,32 @@ import { Base } from "./base"; import { ExclusiveGroupUnionAndUnconstrainedPlus } from "./exclusive"; -import { OptionHasDefault, OptionName, OptionRawType, OptionType } from "./getters"; +import { + OptionHasDefault, + OptionName, + OptionRawType, + OptionType +} from "./getters"; //#region Definition helpers -type Normalize = OptionName> = ( - rawInput: OptionRawType -) => OptionType; +type Normalize< + C extends Base.Config, + N extends OptionName = OptionName +> = (rawInput: OptionRawType) => OptionType; -export type ExternalConfig = Partial>; +export type ExternalConfig = Partial< + ExclusiveGroupUnionAndUnconstrainedPlus +>; -export type InternalConfig = ExclusiveGroupUnionAndUnconstrainedPlus; +export type InternalConfig< + C extends Base.Config +> = ExclusiveGroupUnionAndUnconstrainedPlus; export type Definitions = { [N in OptionName]: { normalize: Normalize; legacyName?: string; - } & (void extends OptionHasDefault ? {} : { default: (config: InternalConfig) => OptionType }); + } & (void extends OptionHasDefault + ? {} + : { default: (config: InternalConfig) => OptionType }); }; //#endregion Definition helpers diff --git a/src/packages/options/src/helpers/exclusive.ts b/src/packages/options/src/helpers/exclusive.ts index 3dc5fb5fa1..7adbfad5af 100644 --- a/src/packages/options/src/helpers/exclusive.ts +++ b/src/packages/options/src/helpers/exclusive.ts @@ -10,21 +10,39 @@ import { } from "./getters"; //#region options not part of exclusive groups -type UnconstrainedOptions = Omit, ExclusiveGroupOptionName>; -type UnconstrainedOptionName = string & keyof UnconstrainedOptions; -type UnconstrainedOptionsByType = { - [N in UnconstrainedOptionName]: T extends "type" ? OptionType : OptionRawType; +type UnconstrainedOptions = Omit< + Options, + ExclusiveGroupOptionName +>; +type UnconstrainedOptionName = string & + keyof UnconstrainedOptions; +type UnconstrainedOptionsByType< + C extends Base.Config, + T extends "type" | "rawType" +> = { + [N in UnconstrainedOptionName]: T extends "type" + ? OptionType + : OptionRawType; }; //#endregion options not part of exclusive groups //#region exclusive group options helpers -type ExclusiveGroupOptionPairs = G extends [] +type ExclusiveGroupOptionPairs< + C extends Base.Config, + G extends unknown[] +> = G extends [] ? [] : G extends [infer N, ...infer R] - ? [[N, ExclusiveGroupOptionNameOption], ...ExclusiveGroupOptionPairs] + ? [ + [N, ExclusiveGroupOptionNameOption], + ...ExclusiveGroupOptionPairs + ] : never; -type ExclusiveGroupOptionNameOption = N extends OptionName ? Option : never; +type ExclusiveGroupOptionNameOption< + C extends Base.Config, + N +> = N extends OptionName ? Option : never; type PairsToMapping = T extends [] ? {} : T extends [[infer N, infer O], ...infer R] @@ -49,12 +67,22 @@ type ExclusiveGroupOptionalUnionByName< : never; }; -type Combine, T extends "rawType" | "type"> = { +type Combine< + C extends Base.Config, + O extends unknown, + GRP extends ExclusiveGroup, + T extends "rawType" | "type" +> = { [N in keyof GRP]: GRP[N] extends OptionName ? { [Key in keyof (ExclusiveGroupOptionalUnionByName & UnconstrainedOptionsByType & - O)]: Key extends keyof ExclusiveGroupOptionalUnionByName + O)]: Key extends keyof ExclusiveGroupOptionalUnionByName< + C, + GRP, + GRP[N], + T + > ? ExclusiveGroupOptionalUnionByName[Key] : Key extends keyof UnconstrainedOptionsByType ? UnconstrainedOptionsByType[Key] @@ -78,7 +106,12 @@ export type ExclusiveGroupUnionAndUnconstrainedPlus< ? Rest extends any[] ? O extends [] ? // first time through - ExclusiveGroupUnionAndUnconstrainedPlus>> + ExclusiveGroupUnionAndUnconstrainedPlus< + C, + T, + Rest, + UnionToTuple> + > : // recurse ExclusiveGroupUnionAndUnconstrainedPlus< C, @@ -103,31 +136,49 @@ export type ExclusiveGroupUnionAndUnconstrainedPlus< // directly true extends IsNeverType ? { - [Key in keyof UnconstrainedOptionsByType]: UnconstrainedOptionsByType[Key]; + [Key in keyof UnconstrainedOptionsByType< + C, + T + >]: UnconstrainedOptionsByType[Key]; } : I : never; //#region UnionToTuple -type TuplePrepend = [NewElement, ...Tuple]; +type TuplePrepend = [ + NewElement, + ...Tuple +]; type Consumer = (value: Value) => void; -type IntersectionFromUnion = (Union extends unknown ? Consumer : never) extends Consumer< - infer ResultIntersection -> +type IntersectionFromUnion = ( + Union extends unknown ? Consumer : never +) extends Consumer ? ResultIntersection : never; -type OverloadedConsumerFromUnion = IntersectionFromUnion : never>; +type OverloadedConsumerFromUnion = IntersectionFromUnion< + Union extends unknown ? Consumer : never +>; -type UnionLast = OverloadedConsumerFromUnion extends (a: infer A) => void ? A : never; +type UnionLast = OverloadedConsumerFromUnion extends ( + a: infer A +) => void + ? A + : never; type UnionExcludingLast = Exclude>; -type TupleFromUnionRec = [RemainingUnion] extends [never] +type TupleFromUnionRec< + RemainingUnion, + CurrentTuple extends readonly unknown[] +> = [RemainingUnion] extends [never] ? CurrentTuple - : TupleFromUnionRec, TuplePrepend>>; + : TupleFromUnionRec< + UnionExcludingLast, + TuplePrepend> + >; export type UnionToTuple = TupleFromUnionRec; //#endregion @@ -135,9 +186,10 @@ export type UnionToTuple = TupleFromUnionRec; //#endregion exclusive group options helpers //#region exclusive groups -type ExclusiveGroup = ExclusiveGroupIndex> = ExclusiveGroups< - C ->[K]; +type ExclusiveGroup< + C extends Base.Config, + K extends ExclusiveGroupIndex = ExclusiveGroupIndex +> = ExclusiveGroups[K]; type ExclusiveGroupOptionName< C extends Base.Config, @@ -154,7 +206,8 @@ type DeepTupleToUnion = T extends [] // empty tuple case (b //#endregion exclusive groups //#region options separated by exclusive group -type ExclusiveGroupOptionsByGroup> = PairsToMapping< - ExclusiveGroupOptionPairs ->; +type ExclusiveGroupOptionsByGroup< + C extends Base.Config, + G extends ExclusiveGroup +> = PairsToMapping>; //#endregion diff --git a/src/packages/options/src/helpers/getters.ts b/src/packages/options/src/helpers/getters.ts index 067d61d1c5..514ffe59c9 100644 --- a/src/packages/options/src/helpers/getters.ts +++ b/src/packages/options/src/helpers/getters.ts @@ -7,25 +7,32 @@ export type ExclusiveGroups = C["exclusiveGroups"]; //#region getters for keys export type OptionName = string & keyof Options; -export type ExclusiveGroupIndex = number & keyof ExclusiveGroups; +export type ExclusiveGroupIndex = number & + keyof ExclusiveGroups; //#endregion //#region getters for individual things -export type Option = OptionName> = Options[N]; +export type Option< + C extends Base.Config, + N extends OptionName = OptionName +> = Options[N]; //#endregion //#region getters for option -export type OptionRawType = OptionName> = void extends Option< - C, - N ->["rawType"] +export type OptionRawType< + C extends Base.Config, + N extends OptionName = OptionName +> = void extends Option["rawType"] ? Option["type"] : Option["rawType"]; -export type OptionType = OptionName> = Option["type"]; +export type OptionType< + C extends Base.Config, + N extends OptionName = OptionName +> = Option["type"]; -export type OptionHasDefault = OptionName> = Option< - C, - N ->["hasDefault"]; +export type OptionHasDefault< + C extends Base.Config, + N extends OptionName = OptionName +> = Option["hasDefault"]; //#endregion getters for option diff --git a/src/packages/promise-queue/src/entry.ts b/src/packages/promise-queue/src/entry.ts index 74dadbe098..5b59c0cb77 100644 --- a/src/packages/promise-queue/src/entry.ts +++ b/src/packages/promise-queue/src/entry.ts @@ -8,7 +8,11 @@ export default class Entry { public resolved = false; public onSetteled: (queue: Entry[], entry: Entry) => void; - constructor(promise: Promise, queue: Entry[], onSetteled: (queue: Entry[], entry: Entry) => void) { + constructor( + promise: Promise, + queue: Entry[], + onSetteled: (queue: Entry[], entry: Entry) => void + ) { this.value = promise; this.queue = queue; this.onSetteled = onSetteled; diff --git a/src/packages/promise-queue/src/index.ts b/src/packages/promise-queue/src/index.ts index 499e869e14..c860aaf881 100644 --- a/src/packages/promise-queue/src/index.ts +++ b/src/packages/promise-queue/src/index.ts @@ -98,7 +98,8 @@ class PromiseQueue { }; } -interface PromiseQueue extends Pick { +interface PromiseQueue + extends Pick { emittery: Emittery; } diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts index 02b3a3dd33..590e598412 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts @@ -10,7 +10,13 @@ export const toBuffers = new WeakMap(); const inspect = Symbol.for("nodejs.util.inspect.custom"); -export class BaseJsonRpcType { +export class BaseJsonRpcType< + T extends number | bigint | string | Buffer = + | number + | bigint + | string + | Buffer +> { public [Symbol.toStringTag]: string; protected value: T; @@ -97,4 +103,6 @@ export class BaseJsonRpcType = BaseJsonRpcType; +export type JsonRpcType< + T extends number | bigint | string | Buffer +> = BaseJsonRpcType; diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-data.ts b/src/packages/utils/src/things/json-rpc/json-rpc-data.ts index 05ecc5cfc8..e0c06a4001 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-data.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-data.ts @@ -49,7 +49,10 @@ export class Data extends BaseJsonRpcType { return `0x${str}`; } } - public static from(value: T, byteLength?: number) { + public static from( + value: T, + byteLength?: number + ) { return new Data(value, byteLength); } } diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index 0dc3dfba09..b75a7b1489 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -3,7 +3,10 @@ const toBigIntBE = require("bigint-buffer").toBigIntBE; export class Quantity extends BaseJsonRpcType { _nullable: boolean = false; - public static from(value: number | bigint | string | Buffer, nullable = false) { + public static from( + value: number | bigint | string | Buffer, + nullable = false + ) { if (value instanceof Quantity) return value; const q = new Quantity(value); q._nullable = nullable; @@ -67,7 +70,9 @@ export class Quantity extends BaseJsonRpcType { } } public toNumber() { - return typeof this.value === "number" ? this.value : Number(this.toBigInt()); + return typeof this.value === "number" + ? this.value + : Number(this.toBigInt()); } valueOf(): bigint { const value = this.value; diff --git a/src/packages/utils/src/things/jsonrpc.ts b/src/packages/utils/src/things/jsonrpc.ts index 7853524b43..41185fd18d 100644 --- a/src/packages/utils/src/things/jsonrpc.ts +++ b/src/packages/utils/src/things/jsonrpc.ts @@ -40,7 +40,11 @@ namespace JsonRpc { result }; }; - export const Error = (id: string, error: T, result?: unknown): Error => { + export const Error = ( + id: string, + error: T, + result?: unknown + ): Error => { type E = { [K in keyof T]: K extends string ? T[K] : never }; // Error objects are weird, `message` isn't included in the property names, // so it is pulled out separately. diff --git a/src/packages/utils/src/things/promievent.ts b/src/packages/utils/src/things/promievent.ts index 25755a145c..4e2dbde175 100644 --- a/src/packages/utils/src/things/promievent.ts +++ b/src/packages/utils/src/things/promievent.ts @@ -9,7 +9,10 @@ declare var Promise: { * @returns A Promise for the completion of the callback. */ catch( - onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null + onrejected?: + | ((reason: any) => TResult | PromiseLike) + | undefined + | null ): PromiEvent; /** @@ -26,11 +29,22 @@ declare var Promise: { resolve(): PromiEvent; } & PromiseConstructor; -const emitteryMethods = ["clearListeners", "once", "on", "emit", "onAny"] as const; +const emitteryMethods = [ + "clearListeners", + "once", + "on", + "emit", + "onAny" +] as const; @Emittery.mixin(Symbol.for("emittery"), emitteryMethods) class PromiEvent extends Promise { - constructor(executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) { + constructor( + executor: ( + resolve: (value?: T | PromiseLike) => void, + reject: (reason?: any) => void + ) => void + ) { super(executor); } @@ -39,7 +53,12 @@ class PromiEvent extends Promise { * @param onrejected The callback to execute when the Promise is rejected. * @returns A PromiEvent for the completion of the callback. */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null) { + catch( + onrejected?: + | ((reason: any) => TResult | PromiseLike) + | undefined + | null + ) { const prom = new PromiEvent((resolve, reject) => { this.onAny((eventName, eventData) => { return prom.emit(eventName, eventData); @@ -96,7 +115,9 @@ class PromiEvent extends Promise { }; } -interface PromiEvent extends Promise, Pick { +interface PromiEvent + extends Promise, + Pick { emittery: Emittery; } diff --git a/src/packages/utils/src/types/connector.ts b/src/packages/utils/src/types/connector.ts index 06f5800650..498bb94876 100644 --- a/src/packages/utils/src/types/connector.ts +++ b/src/packages/utils/src/types/connector.ts @@ -7,8 +7,11 @@ import Emittery from "emittery"; /** * Connects an arbitrary public chain provider to ganache-core */ -export interface Connector - extends Emittery.Typed { +export interface Connector< + ApiImplementation extends Api, + RequestFormat, + ResponseFormat +> extends Emittery.Typed { provider: Provider; /** @@ -22,10 +25,22 @@ export interface Connector Promise<{ value: ReturnType]> }>) - | ((payload: RequestFormat[], connection: HttpRequest) => Promise<{ value: ReturnType]>[] }>) - | ((payload: RequestFormat, connection: WebSocket) => Promise<{ value: ReturnType]> }>) - | ((payload: RequestFormat[], connection: WebSocket) => Promise<{ value: ReturnType]>[] }>); + | (( + payload: RequestFormat, + connection: HttpRequest + ) => Promise<{ value: ReturnType]> }>) + | (( + payload: RequestFormat[], + connection: HttpRequest + ) => Promise<{ value: ReturnType]>[] }>) + | (( + payload: RequestFormat, + connection: WebSocket + ) => Promise<{ value: ReturnType]> }>) + | (( + payload: RequestFormat[], + connection: WebSocket + ) => Promise<{ value: ReturnType]>[] }>); /** * Formats the response (returned from `handle`) diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index e9304c1033..92fab8b1da 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -17,7 +17,11 @@ export class Executor { * @param methodName The name of the JSON-RPC method to execute. * @param params The params to pass to the JSON-RPC method. */ - public execute>(api: T, methodName: M, params: Parameters) { + public execute>( + api: T, + methodName: M, + params: Parameters + ) { // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { @@ -30,7 +34,10 @@ export class Executor { // class SomeClass { // method(){} // api.__proto__.hasOwnProperty("method") === true // } - if ((hasOwn(api.__proto__, methodName) && methodName !== "constructor") || hasOwn(api, methodName)) { + if ( + (hasOwn(api.__proto__, methodName) && methodName !== "constructor") || + hasOwn(api, methodName) + ) { // cast methodName from `KnownKeys & string` back to KnownKeys so our return type isn't weird. const fn = api[methodName as M]; // just double check, in case a API breaks the rules and adds non-fns diff --git a/src/packages/utils/src/utils/has-own.ts b/src/packages/utils/src/utils/has-own.ts index c3ca01e149..5ba52c0fbd 100644 --- a/src/packages/utils/src/utils/has-own.ts +++ b/src/packages/utils/src/utils/has-own.ts @@ -12,6 +12,6 @@ export const hasOwn: ( obj: X, prop: Y -) => obj is X extends Record ? X & Required> : never = {}.hasOwnProperty.call.bind( - {}.hasOwnProperty -) as any; +) => obj is X extends Record + ? X & Required> + : never = {}.hasOwnProperty.call.bind({}.hasOwnProperty) as any; diff --git a/src/packages/utils/src/utils/request-coordinator.ts b/src/packages/utils/src/utils/request-coordinator.ts index 563e87f0b4..b70f9409eb 100644 --- a/src/packages/utils/src/utils/request-coordinator.ts +++ b/src/packages/utils/src/utils/request-coordinator.ts @@ -51,7 +51,11 @@ export class RequestCoordinator { #process = () => { // if we aren't paused and the number of things we're processing is under // our limit and we have things to process: do it! - while (!this.paused && this.pending.length > 0 && (!this.limit || this.runningTasks < this.limit)) { + while ( + !this.paused && + this.pending.length > 0 && + (!this.limit || this.runningTasks < this.limit) + ) { const current = this.pending.shift(); this.runningTasks++; current() @@ -80,7 +84,11 @@ export class RequestCoordinator { // const executor is `async` to force the return value into a Promise. const executor = async () => { try { - const value = Reflect.apply(fn, thisArgument, argumentsList || []) as ReturnType; + const value = Reflect.apply( + fn, + thisArgument, + argumentsList || [] + ) as ReturnType; resolve({ value }); return value; } catch (e) { From d89ee29c38b47e07f3fa76a40e25f0a864800b82 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 18:28:00 -0400 Subject: [PATCH 617/691] remove description from root package.json --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 99602a356b..1956fbf167 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,5 @@ { "name": "root", - "description": "> TODO: description", "author": "David Murdoch (https://davidmurdoch.com)", "private": true, "engines": { From bd63c8bb010c827e060c4043046b47ab01d804e2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 18:45:42 -0400 Subject: [PATCH 618/691] add directory field to package.jsons' repo fields --- src/chains/ethereum/package.json | 3 ++- src/chains/tezos/package.json | 3 ++- src/packages/core/package.json | 5 +++-- src/packages/flavors/package.json | 3 ++- src/packages/options/package.json | 3 ++- src/packages/promise-queue/package.json | 3 ++- src/packages/utils/package.json | 3 ++- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index bc4f1812bd..07e745cb17 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -20,7 +20,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/trufflesuite/ganache-core.git" + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/chains/ethereum" }, "scripts": { "docs.build": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run docs.post-process", diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index ae461d6618..9e8ba537c8 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -20,7 +20,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/trufflesuite/ganache-core.git" + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/chains/tezos" }, "scripts": { "docs.build": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run docs.post-process", diff --git a/src/packages/core/package.json b/src/packages/core/package.json index c888b2b917..3340bc7c67 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@ganache/core", "version": "2.2.1", - "description": "> TODO: description", + "description": "A library to create a local blockchain for fast Ethereum development.", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core#readme", "license": "MIT", @@ -20,7 +20,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/trufflesuite/ganache-core.git" + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/packages/core" }, "scripts": { "tsc": "ts-node ../../../scripts/compile", diff --git a/src/packages/flavors/package.json b/src/packages/flavors/package.json index aa25313963..7511aebfe3 100644 --- a/src/packages/flavors/package.json +++ b/src/packages/flavors/package.json @@ -17,7 +17,8 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/trufflesuite/ganache-core.git" + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/packages/flavors" }, "scripts": { "tsc": "ts-node ../../../scripts/compile" diff --git a/src/packages/options/package.json b/src/packages/options/package.json index 60b13c4b6e..1d6bfc5bd6 100644 --- a/src/packages/options/package.json +++ b/src/packages/options/package.json @@ -16,7 +16,8 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/trufflesuite/ganache-core.git" + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/packages/options" }, "scripts": { "tsc": "ts-node ../../../scripts/compile" diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index df5e3ff746..2078c00835 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -16,7 +16,8 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/trufflesuite/ganache-core.git" + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/packages/promise-queue" }, "scripts": { "tsc": "ts-node ../../../scripts/compile", diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index 8e8c4b497a..31af6a7776 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -20,7 +20,8 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/trufflesuite/ganache-core.git" + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/packages/utils" }, "scripts": { "tsc": "ts-node ../../../scripts/compile" From c29576265c6b66fe790d2ebf8393939f7234f752 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 18:45:48 -0400 Subject: [PATCH 619/691] add newline --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 2fafdb93a2..39ac70e40f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ docs/launch.json linguist-language=JSON5 .nycrc linguist-language=JSON -.prettierrc linguist-language=JSON \ No newline at end of file +.prettierrc linguist-language=JSON From 04a1da60a071ccef1360aae422554e2a4f5a4ba2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 18:45:59 -0400 Subject: [PATCH 620/691] npm-shrinkwrap.json change --- npm-shrinkwrap.json | 12624 +----------------------------------------- 1 file changed, 1 insertion(+), 12623 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 904007b0c2..2eef8197cf 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,12623 +1 @@ -{ - "name": "root", - "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/core": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", - "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.6", - "@babel/helper-module-transforms": "^7.11.0", - "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.5", - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.11.5", - "@babel/types": "^7.11.5", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", - "json5": "^2.1.2", - "lodash": "^4.17.19", - "resolve": "^1.3.2", - "semver": "^5.4.1", - "source-map": "^0.5.0" - }, - "dependencies": { - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } - } - }, - "@babel/generator": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", - "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", - "dev": true, - "requires": { - "@babel/types": "^7.11.5", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "@babel/helper-function-name": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", - "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.10.4", - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", - "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", - "dev": true, - "requires": { - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", - "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", - "dev": true, - "requires": { - "@babel/types": "^7.11.0" - } - }, - "@babel/helper-module-imports": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", - "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", - "dev": true, - "requires": { - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-module-transforms": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", - "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-simple-access": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/template": "^7.10.4", - "@babel/types": "^7.11.0", - "lodash": "^4.17.19" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", - "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", - "dev": true, - "requires": { - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-replace-supers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", - "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.10.4", - "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-simple-access": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", - "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", - "dev": true, - "requires": { - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", - "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", - "dev": true, - "requires": { - "@babel/types": "^7.11.0" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/helpers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", - "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", - "dev": true, - "requires": { - "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" - } - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@babel/parser": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", - "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", - "dev": true - }, - "@babel/template": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", - "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/parser": "^7.10.4", - "@babel/types": "^7.10.4" - } - }, - "@babel/traverse": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", - "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.5", - "@babel/helper-function-name": "^7.10.4", - "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.5", - "@babel/types": "^7.11.5", - "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" - }, - "dependencies": { - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } - } - }, - "@babel/types": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", - "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.19", - "to-fast-properties": "^2.0.0" - } - }, - "@dsherret/to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-H2R13IvZdM6gei2vOGSzF7HdMyw=", - "dev": true, - "requires": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" - } - }, - "@evocateur/libnpmaccess": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz", - "integrity": "sha512-KSCAHwNWro0CF2ukxufCitT9K5LjL/KuMmNzSu8wuwN2rjyKHD8+cmOsiybK+W5hdnwc5M1SmRlVCaMHQo+3rg==", - "dev": true, - "requires": { - "@evocateur/npm-registry-fetch": "^4.0.0", - "aproba": "^2.0.0", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.0.0", - "npm-package-arg": "^6.1.0" - }, - "dependencies": { - "aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "dev": true - }, - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "@evocateur/libnpmpublish": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@evocateur/libnpmpublish/-/libnpmpublish-1.2.2.tgz", - "integrity": "sha512-MJrrk9ct1FeY9zRlyeoyMieBjGDG9ihyyD9/Ft6MMrTxql9NyoEx2hw9casTIP4CdqEVu+3nQ2nXxoJ8RCXyFg==", - "dev": true, - "requires": { - "@evocateur/npm-registry-fetch": "^4.0.0", - "aproba": "^2.0.0", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.0.0", - "lodash.clonedeep": "^4.5.0", - "normalize-package-data": "^2.4.0", - "npm-package-arg": "^6.1.0", - "semver": "^5.5.1", - "ssri": "^6.0.1" - }, - "dependencies": { - "aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "dev": true - }, - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "@evocateur/npm-registry-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@evocateur/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz", - "integrity": "sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g==", - "dev": true, - "requires": { - "JSONStream": "^1.3.4", - "bluebird": "^3.5.1", - "figgy-pudding": "^3.4.1", - "lru-cache": "^5.1.1", - "make-fetch-happen": "^5.0.0", - "npm-package-arg": "^6.1.0", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "@evocateur/pacote": { - "version": "9.6.5", - "resolved": "https://registry.npmjs.org/@evocateur/pacote/-/pacote-9.6.5.tgz", - "integrity": "sha512-EI552lf0aG2nOV8NnZpTxNo2PcXKPmDbF9K8eCBFQdIZwHNGN/mi815fxtmUMa2wTa1yndotICIDt/V0vpEx2w==", - "dev": true, - "requires": { - "@evocateur/npm-registry-fetch": "^4.0.0", - "bluebird": "^3.5.3", - "cacache": "^12.0.3", - "chownr": "^1.1.2", - "figgy-pudding": "^3.5.1", - "get-stream": "^4.1.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^5.1.1", - "make-fetch-happen": "^5.0.0", - "minimatch": "^3.0.4", - "minipass": "^2.3.5", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "normalize-package-data": "^2.5.0", - "npm-package-arg": "^6.1.0", - "npm-packlist": "^1.4.4", - "npm-pick-manifest": "^3.0.0", - "osenv": "^0.1.5", - "promise-inflight": "^1.0.1", - "promise-retry": "^1.1.1", - "protoduck": "^5.0.1", - "rimraf": "^2.6.3", - "safe-buffer": "^5.2.0", - "semver": "^5.7.0", - "ssri": "^6.0.1", - "tar": "^4.4.10", - "unique-filename": "^1.1.1", - "which": "^1.3.1" - }, - "dependencies": { - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - } - } - }, - "@istanbuljs/nyc-config-typescript": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz", - "integrity": "sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2" - } - }, - "@istanbuljs/schema": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", - "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", - "dev": true - }, - "@lerna/add": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/add/-/add-3.21.0.tgz", - "integrity": "sha512-vhUXXF6SpufBE1EkNEXwz1VLW03f177G9uMOFMQkp6OJ30/PWg4Ekifuz9/3YfgB2/GH8Tu4Lk3O51P2Hskg/A==", - "dev": true, - "requires": { - "@evocateur/pacote": "^9.6.3", - "@lerna/bootstrap": "3.21.0", - "@lerna/command": "3.21.0", - "@lerna/filter-options": "3.20.0", - "@lerna/npm-conf": "3.16.0", - "@lerna/validation-error": "3.13.0", - "dedent": "^0.7.0", - "npm-package-arg": "^6.1.0", - "p-map": "^2.1.0", - "semver": "^6.2.0" - }, - "dependencies": { - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/bootstrap": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.21.0.tgz", - "integrity": "sha512-mtNHlXpmvJn6JTu0KcuTTPl2jLsDNud0QacV/h++qsaKbhAaJr/FElNZ5s7MwZFUM3XaDmvWzHKaszeBMHIbBw==", - "dev": true, - "requires": { - "@lerna/command": "3.21.0", - "@lerna/filter-options": "3.20.0", - "@lerna/has-npm-version": "3.16.5", - "@lerna/npm-install": "3.16.5", - "@lerna/package-graph": "3.18.5", - "@lerna/pulse-till-done": "3.13.0", - "@lerna/rimraf-dir": "3.16.5", - "@lerna/run-lifecycle": "3.16.2", - "@lerna/run-topologically": "3.18.5", - "@lerna/symlink-binary": "3.17.0", - "@lerna/symlink-dependencies": "3.17.0", - "@lerna/validation-error": "3.13.0", - "dedent": "^0.7.0", - "get-port": "^4.2.0", - "multimatch": "^3.0.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "p-finally": "^1.0.0", - "p-map": "^2.1.0", - "p-map-series": "^1.0.0", - "p-waterfall": "^1.0.0", - "read-package-tree": "^5.1.6", - "semver": "^6.2.0" - }, - "dependencies": { - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/changed": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-3.21.0.tgz", - "integrity": "sha512-hzqoyf8MSHVjZp0gfJ7G8jaz+++mgXYiNs9iViQGA8JlN/dnWLI5sWDptEH3/B30Izo+fdVz0S0s7ydVE3pWIw==", - "dev": true, - "requires": { - "@lerna/collect-updates": "3.20.0", - "@lerna/command": "3.21.0", - "@lerna/listable": "3.18.5", - "@lerna/output": "3.13.0" - } - }, - "@lerna/check-working-tree": { - "version": "3.16.5", - "resolved": "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-3.16.5.tgz", - "integrity": "sha512-xWjVBcuhvB8+UmCSb5tKVLB5OuzSpw96WEhS2uz6hkWVa/Euh1A0/HJwn2cemyK47wUrCQXtczBUiqnq9yX5VQ==", - "dev": true, - "requires": { - "@lerna/collect-uncommitted": "3.16.5", - "@lerna/describe-ref": "3.16.5", - "@lerna/validation-error": "3.13.0" - } - }, - "@lerna/child-process": { - "version": "3.16.5", - "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-3.16.5.tgz", - "integrity": "sha512-vdcI7mzei9ERRV4oO8Y1LHBZ3A5+ampRKg1wq5nutLsUA4mEBN6H7JqjWOMY9xZemv6+kATm2ofjJ3lW5TszQg==", - "dev": true, - "requires": { - "chalk": "^2.3.1", - "execa": "^1.0.0", - "strong-log-transformer": "^2.0.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@lerna/clean": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-3.21.0.tgz", - "integrity": "sha512-b/L9l+MDgE/7oGbrav6rG8RTQvRiZLO1zTcG17zgJAAuhlsPxJExMlh2DFwJEVi2les70vMhHfST3Ue1IMMjpg==", - "dev": true, - "requires": { - "@lerna/command": "3.21.0", - "@lerna/filter-options": "3.20.0", - "@lerna/prompt": "3.18.5", - "@lerna/pulse-till-done": "3.13.0", - "@lerna/rimraf-dir": "3.16.5", - "p-map": "^2.1.0", - "p-map-series": "^1.0.0", - "p-waterfall": "^1.0.0" - } - }, - "@lerna/cli": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/cli/-/cli-3.18.5.tgz", - "integrity": "sha512-erkbxkj9jfc89vVs/jBLY/fM0I80oLmJkFUV3Q3wk9J3miYhP14zgVEBsPZY68IZlEjT6T3Xlq2xO1AVaatHsA==", - "dev": true, - "requires": { - "@lerna/global-options": "3.13.0", - "dedent": "^0.7.0", - "npmlog": "^4.1.2", - "yargs": "^14.2.2" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "yargs": { - "version": "14.2.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", - "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "decamelize": "^1.2.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^15.0.1" - } - } - } - }, - "@lerna/collect-uncommitted": { - "version": "3.16.5", - "resolved": "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-3.16.5.tgz", - "integrity": "sha512-ZgqnGwpDZiWyzIQVZtQaj9tRizsL4dUOhuOStWgTAw1EMe47cvAY2kL709DzxFhjr6JpJSjXV5rZEAeU3VE0Hg==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "chalk": "^2.3.1", - "figgy-pudding": "^3.5.1", - "npmlog": "^4.1.2" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@lerna/collect-updates": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-3.20.0.tgz", - "integrity": "sha512-qBTVT5g4fupVhBFuY4nI/3FSJtQVcDh7/gEPOpRxoXB/yCSnT38MFHXWl+y4einLciCjt/+0x6/4AG80fjay2Q==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "@lerna/describe-ref": "3.16.5", - "minimatch": "^3.0.4", - "npmlog": "^4.1.2", - "slash": "^2.0.0" - } - }, - "@lerna/command": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/command/-/command-3.21.0.tgz", - "integrity": "sha512-T2bu6R8R3KkH5YoCKdutKv123iUgUbW8efVjdGCDnCMthAQzoentOJfDeodBwn0P2OqCl3ohsiNVtSn9h78fyQ==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "@lerna/package-graph": "3.18.5", - "@lerna/project": "3.21.0", - "@lerna/validation-error": "3.13.0", - "@lerna/write-log-file": "3.13.0", - "clone-deep": "^4.0.1", - "dedent": "^0.7.0", - "execa": "^1.0.0", - "is-ci": "^2.0.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/conventional-commits": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-3.22.0.tgz", - "integrity": "sha512-z4ZZk1e8Mhz7+IS8NxHr64wyklHctCJyWpJKEZZPJiLFJ8yKto/x38O80R10pIzC0rr8Sy/OsjSH4bl0TbbgqA==", - "dev": true, - "requires": { - "@lerna/validation-error": "3.13.0", - "conventional-changelog-angular": "^5.0.3", - "conventional-changelog-core": "^3.1.6", - "conventional-recommended-bump": "^5.0.0", - "fs-extra": "^8.1.0", - "get-stream": "^4.0.0", - "lodash.template": "^4.5.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "pify": "^4.0.1", - "semver": "^6.2.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/create": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.22.0.tgz", - "integrity": "sha512-MdiQQzCcB4E9fBF1TyMOaAEz9lUjIHp1Ju9H7f3lXze5JK6Fl5NYkouAvsLgY6YSIhXMY8AHW2zzXeBDY4yWkw==", - "dev": true, - "requires": { - "@evocateur/pacote": "^9.6.3", - "@lerna/child-process": "3.16.5", - "@lerna/command": "3.21.0", - "@lerna/npm-conf": "3.16.0", - "@lerna/validation-error": "3.13.0", - "camelcase": "^5.0.0", - "dedent": "^0.7.0", - "fs-extra": "^8.1.0", - "globby": "^9.2.0", - "init-package-json": "^1.10.3", - "npm-package-arg": "^6.1.0", - "p-reduce": "^1.0.0", - "pify": "^4.0.1", - "semver": "^6.2.0", - "slash": "^2.0.0", - "validate-npm-package-license": "^3.0.3", - "validate-npm-package-name": "^3.0.0", - "whatwg-url": "^7.0.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/create-symlink": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-3.16.2.tgz", - "integrity": "sha512-pzXIJp6av15P325sgiIRpsPXLFmkisLhMBCy4764d+7yjf2bzrJ4gkWVMhsv4AdF0NN3OyZ5jjzzTtLNqfR+Jw==", - "dev": true, - "requires": { - "@zkochan/cmd-shim": "^3.1.0", - "fs-extra": "^8.1.0", - "npmlog": "^4.1.2" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/describe-ref": { - "version": "3.16.5", - "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-3.16.5.tgz", - "integrity": "sha512-c01+4gUF0saOOtDBzbLMFOTJDHTKbDFNErEY6q6i9QaXuzy9LNN62z+Hw4acAAZuJQhrVWncVathcmkkjvSVGw==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "npmlog": "^4.1.2" - } - }, - "@lerna/diff": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-3.21.0.tgz", - "integrity": "sha512-5viTR33QV3S7O+bjruo1SaR40m7F2aUHJaDAC7fL9Ca6xji+aw1KFkpCtVlISS0G8vikUREGMJh+c/VMSc8Usw==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "@lerna/command": "3.21.0", - "@lerna/validation-error": "3.13.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/exec": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-3.21.0.tgz", - "integrity": "sha512-iLvDBrIE6rpdd4GIKTY9mkXyhwsJ2RvQdB9ZU+/NhR3okXfqKc6py/24tV111jqpXTtZUW6HNydT4dMao2hi1Q==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "@lerna/command": "3.21.0", - "@lerna/filter-options": "3.20.0", - "@lerna/profiler": "3.20.0", - "@lerna/run-topologically": "3.18.5", - "@lerna/validation-error": "3.13.0", - "p-map": "^2.1.0" - } - }, - "@lerna/filter-options": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-3.20.0.tgz", - "integrity": "sha512-bmcHtvxn7SIl/R9gpiNMVG7yjx7WyT0HSGw34YVZ9B+3xF/83N3r5Rgtjh4hheLZ+Q91Or0Jyu5O3Nr+AwZe2g==", - "dev": true, - "requires": { - "@lerna/collect-updates": "3.20.0", - "@lerna/filter-packages": "3.18.0", - "dedent": "^0.7.0", - "figgy-pudding": "^3.5.1", - "npmlog": "^4.1.2" - } - }, - "@lerna/filter-packages": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-3.18.0.tgz", - "integrity": "sha512-6/0pMM04bCHNATIOkouuYmPg6KH3VkPCIgTfQmdkPJTullERyEQfNUKikrefjxo1vHOoCACDpy65JYyKiAbdwQ==", - "dev": true, - "requires": { - "@lerna/validation-error": "3.13.0", - "multimatch": "^3.0.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/get-npm-exec-opts": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.13.0.tgz", - "integrity": "sha512-Y0xWL0rg3boVyJk6An/vurKzubyJKtrxYv2sj4bB8Mc5zZ3tqtv0ccbOkmkXKqbzvNNF7VeUt1OJ3DRgtC/QZw==", - "dev": true, - "requires": { - "npmlog": "^4.1.2" - } - }, - "@lerna/get-packed": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-3.16.0.tgz", - "integrity": "sha512-AjsFiaJzo1GCPnJUJZiTW6J1EihrPkc2y3nMu6m3uWFxoleklsSCyImumzVZJssxMi3CPpztj8LmADLedl9kXw==", - "dev": true, - "requires": { - "fs-extra": "^8.1.0", - "ssri": "^6.0.1", - "tar": "^4.4.8" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/github-client": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-3.22.0.tgz", - "integrity": "sha512-O/GwPW+Gzr3Eb5bk+nTzTJ3uv+jh5jGho9BOqKlajXaOkMYGBELEAqV5+uARNGWZFvYAiF4PgqHb6aCUu7XdXg==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "@octokit/plugin-enterprise-rest": "^6.0.1", - "@octokit/rest": "^16.28.4", - "git-url-parse": "^11.1.2", - "npmlog": "^4.1.2" - } - }, - "@lerna/gitlab-client": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-3.15.0.tgz", - "integrity": "sha512-OsBvRSejHXUBMgwWQqNoioB8sgzL/Pf1pOUhHKtkiMl6aAWjklaaq5HPMvTIsZPfS6DJ9L5OK2GGZuooP/5c8Q==", - "dev": true, - "requires": { - "node-fetch": "^2.5.0", - "npmlog": "^4.1.2", - "whatwg-url": "^7.0.0" - } - }, - "@lerna/global-options": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/global-options/-/global-options-3.13.0.tgz", - "integrity": "sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ==", - "dev": true - }, - "@lerna/has-npm-version": { - "version": "3.16.5", - "resolved": "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-3.16.5.tgz", - "integrity": "sha512-WL7LycR9bkftyqbYop5rEGJ9sRFIV55tSGmbN1HLrF9idwOCD7CLrT64t235t3t4O5gehDnwKI5h2U3oxTrF8Q==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/import": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.22.0.tgz", - "integrity": "sha512-uWOlexasM5XR6tXi4YehODtH9Y3OZrFht3mGUFFT3OIl2s+V85xIGFfqFGMTipMPAGb2oF1UBLL48kR43hRsOg==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "@lerna/command": "3.21.0", - "@lerna/prompt": "3.18.5", - "@lerna/pulse-till-done": "3.13.0", - "@lerna/validation-error": "3.13.0", - "dedent": "^0.7.0", - "fs-extra": "^8.1.0", - "p-map-series": "^1.0.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/info": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/info/-/info-3.21.0.tgz", - "integrity": "sha512-0XDqGYVBgWxUquFaIptW2bYSIu6jOs1BtkvRTWDDhw4zyEdp6q4eaMvqdSap1CG+7wM5jeLCi6z94wS0AuiuwA==", - "dev": true, - "requires": { - "@lerna/command": "3.21.0", - "@lerna/output": "3.13.0", - "envinfo": "^7.3.1" - } - }, - "@lerna/init": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/init/-/init-3.21.0.tgz", - "integrity": "sha512-6CM0z+EFUkFfurwdJCR+LQQF6MqHbYDCBPyhu/d086LRf58GtYZYj49J8mKG9ktayp/TOIxL/pKKjgLD8QBPOg==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "@lerna/command": "3.21.0", - "fs-extra": "^8.1.0", - "p-map": "^2.1.0", - "write-json-file": "^3.2.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/link": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/link/-/link-3.21.0.tgz", - "integrity": "sha512-tGu9GxrX7Ivs+Wl3w1+jrLi1nQ36kNI32dcOssij6bg0oZ2M2MDEFI9UF2gmoypTaN9uO5TSsjCFS7aR79HbdQ==", - "dev": true, - "requires": { - "@lerna/command": "3.21.0", - "@lerna/package-graph": "3.18.5", - "@lerna/symlink-dependencies": "3.17.0", - "p-map": "^2.1.0", - "slash": "^2.0.0" - } - }, - "@lerna/list": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/list/-/list-3.21.0.tgz", - "integrity": "sha512-KehRjE83B1VaAbRRkRy6jLX1Cin8ltsrQ7FHf2bhwhRHK0S54YuA6LOoBnY/NtA8bHDX/Z+G5sMY78X30NS9tg==", - "dev": true, - "requires": { - "@lerna/command": "3.21.0", - "@lerna/filter-options": "3.20.0", - "@lerna/listable": "3.18.5", - "@lerna/output": "3.13.0" - } - }, - "@lerna/listable": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/listable/-/listable-3.18.5.tgz", - "integrity": "sha512-Sdr3pVyaEv5A7ZkGGYR7zN+tTl2iDcinryBPvtuv20VJrXBE8wYcOks1edBTcOWsPjCE/rMP4bo1pseyk3UTsg==", - "dev": true, - "requires": { - "@lerna/query-graph": "3.18.5", - "chalk": "^2.3.1", - "columnify": "^1.5.4" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@lerna/log-packed": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-3.16.0.tgz", - "integrity": "sha512-Fp+McSNBV/P2mnLUYTaSlG8GSmpXM7krKWcllqElGxvAqv6chk2K3c2k80MeVB4WvJ9tRjUUf+i7HUTiQ9/ckQ==", - "dev": true, - "requires": { - "byte-size": "^5.0.1", - "columnify": "^1.5.4", - "has-unicode": "^2.0.1", - "npmlog": "^4.1.2" - } - }, - "@lerna/npm-conf": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-3.16.0.tgz", - "integrity": "sha512-HbO3DUrTkCAn2iQ9+FF/eisDpWY5POQAOF1m7q//CZjdC2HSW3UYbKEGsSisFxSfaF9Z4jtrV+F/wX6qWs3CuA==", - "dev": true, - "requires": { - "config-chain": "^1.1.11", - "pify": "^4.0.1" - } - }, - "@lerna/npm-dist-tag": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-3.18.5.tgz", - "integrity": "sha512-xw0HDoIG6HreVsJND9/dGls1c+lf6vhu7yJoo56Sz5bvncTloYGLUppIfDHQr4ZvmPCK8rsh0euCVh2giPxzKQ==", - "dev": true, - "requires": { - "@evocateur/npm-registry-fetch": "^4.0.0", - "@lerna/otplease": "3.18.5", - "figgy-pudding": "^3.5.1", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2" - }, - "dependencies": { - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "@lerna/npm-install": { - "version": "3.16.5", - "resolved": "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-3.16.5.tgz", - "integrity": "sha512-hfiKk8Eku6rB9uApqsalHHTHY+mOrrHeWEs+gtg7+meQZMTS3kzv4oVp5cBZigndQr3knTLjwthT/FX4KvseFg==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "@lerna/get-npm-exec-opts": "3.13.0", - "fs-extra": "^8.1.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "signal-exit": "^3.0.2", - "write-pkg": "^3.1.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/npm-publish": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-3.18.5.tgz", - "integrity": "sha512-3etLT9+2L8JAx5F8uf7qp6iAtOLSMj+ZYWY6oUgozPi/uLqU0/gsMsEXh3F0+YVW33q0M61RpduBoAlOOZnaTg==", - "dev": true, - "requires": { - "@evocateur/libnpmpublish": "^1.2.2", - "@lerna/otplease": "3.18.5", - "@lerna/run-lifecycle": "3.16.2", - "figgy-pudding": "^3.5.1", - "fs-extra": "^8.1.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "pify": "^4.0.1", - "read-package-json": "^2.0.13" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/npm-run-script": { - "version": "3.16.5", - "resolved": "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-3.16.5.tgz", - "integrity": "sha512-1asRi+LjmVn3pMjEdpqKJZFT/3ZNpb+VVeJMwrJaV/3DivdNg7XlPK9LTrORuKU4PSvhdEZvJmSlxCKyDpiXsQ==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "@lerna/get-npm-exec-opts": "3.13.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/otplease": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/otplease/-/otplease-3.18.5.tgz", - "integrity": "sha512-S+SldXAbcXTEDhzdxYLU0ZBKuYyURP/ND2/dK6IpKgLxQYh/z4ScljPDMyKymmEvgiEJmBsPZAAPfmNPEzxjog==", - "dev": true, - "requires": { - "@lerna/prompt": "3.18.5", - "figgy-pudding": "^3.5.1" - } - }, - "@lerna/output": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/output/-/output-3.13.0.tgz", - "integrity": "sha512-7ZnQ9nvUDu/WD+bNsypmPG5MwZBwu86iRoiW6C1WBuXXDxM5cnIAC1m2WxHeFnjyMrYlRXM9PzOQ9VDD+C15Rg==", - "dev": true, - "requires": { - "npmlog": "^4.1.2" - } - }, - "@lerna/pack-directory": { - "version": "3.16.4", - "resolved": "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-3.16.4.tgz", - "integrity": "sha512-uxSF0HZeGyKaaVHz5FroDY9A5NDDiCibrbYR6+khmrhZtY0Bgn6hWq8Gswl9iIlymA+VzCbshWIMX4o2O8C8ng==", - "dev": true, - "requires": { - "@lerna/get-packed": "3.16.0", - "@lerna/package": "3.16.0", - "@lerna/run-lifecycle": "3.16.2", - "figgy-pudding": "^3.5.1", - "npm-packlist": "^1.4.4", - "npmlog": "^4.1.2", - "tar": "^4.4.10", - "temp-write": "^3.4.0" - } - }, - "@lerna/package": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/package/-/package-3.16.0.tgz", - "integrity": "sha512-2lHBWpaxcBoiNVbtyLtPUuTYEaB/Z+eEqRS9duxpZs6D+mTTZMNy6/5vpEVSCBmzvdYpyqhqaYjjSLvjjr5Riw==", - "dev": true, - "requires": { - "load-json-file": "^5.3.0", - "npm-package-arg": "^6.1.0", - "write-pkg": "^3.1.0" - }, - "dependencies": { - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "@lerna/package-graph": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-3.18.5.tgz", - "integrity": "sha512-8QDrR9T+dBegjeLr+n9WZTVxUYUhIUjUgZ0gvNxUBN8S1WB9r6H5Yk56/MVaB64tA3oGAN9IIxX6w0WvTfFudA==", - "dev": true, - "requires": { - "@lerna/prerelease-id-from-version": "3.16.0", - "@lerna/validation-error": "3.13.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "semver": "^6.2.0" - }, - "dependencies": { - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/prerelease-id-from-version": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.16.0.tgz", - "integrity": "sha512-qZyeUyrE59uOK8rKdGn7jQz+9uOpAaF/3hbslJVFL1NqF9ELDTqjCPXivuejMX/lN4OgD6BugTO4cR7UTq/sZA==", - "dev": true, - "requires": { - "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "@lerna/profiler": { - "version": "3.20.0", - "resolved": "https://registry.npmjs.org/@lerna/profiler/-/profiler-3.20.0.tgz", - "integrity": "sha512-bh8hKxAlm6yu8WEOvbLENm42i2v9SsR4WbrCWSbsmOElx3foRnMlYk7NkGECa+U5c3K4C6GeBbwgqs54PP7Ljg==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1", - "fs-extra": "^8.1.0", - "npmlog": "^4.1.2", - "upath": "^1.2.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/project": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/project/-/project-3.21.0.tgz", - "integrity": "sha512-xT1mrpET2BF11CY32uypV2GPtPVm6Hgtha7D81GQP9iAitk9EccrdNjYGt5UBYASl4CIDXBRxwmTTVGfrCx82A==", - "dev": true, - "requires": { - "@lerna/package": "3.16.0", - "@lerna/validation-error": "3.13.0", - "cosmiconfig": "^5.1.0", - "dedent": "^0.7.0", - "dot-prop": "^4.2.0", - "glob-parent": "^5.0.0", - "globby": "^9.2.0", - "load-json-file": "^5.3.0", - "npmlog": "^4.1.2", - "p-map": "^2.1.0", - "resolve-from": "^4.0.0", - "write-json-file": "^3.2.0" - } - }, - "@lerna/prompt": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/prompt/-/prompt-3.18.5.tgz", - "integrity": "sha512-rkKj4nm1twSbBEb69+Em/2jAERK8htUuV8/xSjN0NPC+6UjzAwY52/x9n5cfmpa9lyKf/uItp7chCI7eDmNTKQ==", - "dev": true, - "requires": { - "inquirer": "^6.2.0", - "npmlog": "^4.1.2" - } - }, - "@lerna/publish": { - "version": "3.22.1", - "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.22.1.tgz", - "integrity": "sha512-PG9CM9HUYDreb1FbJwFg90TCBQooGjj+n/pb3gw/eH5mEDq0p8wKdLFe0qkiqUkm/Ub5C8DbVFertIo0Vd0zcw==", - "dev": true, - "requires": { - "@evocateur/libnpmaccess": "^3.1.2", - "@evocateur/npm-registry-fetch": "^4.0.0", - "@evocateur/pacote": "^9.6.3", - "@lerna/check-working-tree": "3.16.5", - "@lerna/child-process": "3.16.5", - "@lerna/collect-updates": "3.20.0", - "@lerna/command": "3.21.0", - "@lerna/describe-ref": "3.16.5", - "@lerna/log-packed": "3.16.0", - "@lerna/npm-conf": "3.16.0", - "@lerna/npm-dist-tag": "3.18.5", - "@lerna/npm-publish": "3.18.5", - "@lerna/otplease": "3.18.5", - "@lerna/output": "3.13.0", - "@lerna/pack-directory": "3.16.4", - "@lerna/prerelease-id-from-version": "3.16.0", - "@lerna/prompt": "3.18.5", - "@lerna/pulse-till-done": "3.13.0", - "@lerna/run-lifecycle": "3.16.2", - "@lerna/run-topologically": "3.18.5", - "@lerna/validation-error": "3.13.0", - "@lerna/version": "3.22.1", - "figgy-pudding": "^3.5.1", - "fs-extra": "^8.1.0", - "npm-package-arg": "^6.1.0", - "npmlog": "^4.1.2", - "p-finally": "^1.0.0", - "p-map": "^2.1.0", - "p-pipe": "^1.2.0", - "semver": "^6.2.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/pulse-till-done": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-3.13.0.tgz", - "integrity": "sha512-1SOHpy7ZNTPulzIbargrgaJX387csN7cF1cLOGZiJQA6VqnS5eWs2CIrG8i8wmaUavj2QlQ5oEbRMVVXSsGrzA==", - "dev": true, - "requires": { - "npmlog": "^4.1.2" - } - }, - "@lerna/query-graph": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-3.18.5.tgz", - "integrity": "sha512-50Lf4uuMpMWvJ306be3oQDHrWV42nai9gbIVByPBYJuVW8dT8O8pA3EzitNYBUdLL9/qEVbrR0ry1HD7EXwtRA==", - "dev": true, - "requires": { - "@lerna/package-graph": "3.18.5", - "figgy-pudding": "^3.5.1" - } - }, - "@lerna/resolve-symlink": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-3.16.0.tgz", - "integrity": "sha512-Ibj5e7njVHNJ/NOqT4HlEgPFPtPLWsO7iu59AM5bJDcAJcR96mLZ7KGVIsS2tvaO7akMEJvt2P+ErwCdloG3jQ==", - "dev": true, - "requires": { - "fs-extra": "^8.1.0", - "npmlog": "^4.1.2", - "read-cmd-shim": "^1.0.1" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/rimraf-dir": { - "version": "3.16.5", - "resolved": "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-3.16.5.tgz", - "integrity": "sha512-bQlKmO0pXUsXoF8lOLknhyQjOZsCc0bosQDoX4lujBXSWxHVTg1VxURtWf2lUjz/ACsJVDfvHZbDm8kyBk5okA==", - "dev": true, - "requires": { - "@lerna/child-process": "3.16.5", - "npmlog": "^4.1.2", - "path-exists": "^3.0.0", - "rimraf": "^2.6.2" - }, - "dependencies": { - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "@lerna/run": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/@lerna/run/-/run-3.21.0.tgz", - "integrity": "sha512-fJF68rT3veh+hkToFsBmUJ9MHc9yGXA7LSDvhziAojzOb0AI/jBDp6cEcDQyJ7dbnplba2Lj02IH61QUf9oW0Q==", - "dev": true, - "requires": { - "@lerna/command": "3.21.0", - "@lerna/filter-options": "3.20.0", - "@lerna/npm-run-script": "3.16.5", - "@lerna/output": "3.13.0", - "@lerna/profiler": "3.20.0", - "@lerna/run-topologically": "3.18.5", - "@lerna/timer": "3.13.0", - "@lerna/validation-error": "3.13.0", - "p-map": "^2.1.0" - } - }, - "@lerna/run-lifecycle": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-3.16.2.tgz", - "integrity": "sha512-RqFoznE8rDpyyF0rOJy3+KjZCeTkO8y/OB9orPauR7G2xQ7PTdCpgo7EO6ZNdz3Al+k1BydClZz/j78gNCmL2A==", - "dev": true, - "requires": { - "@lerna/npm-conf": "3.16.0", - "figgy-pudding": "^3.5.1", - "npm-lifecycle": "^3.1.2", - "npmlog": "^4.1.2" - } - }, - "@lerna/run-topologically": { - "version": "3.18.5", - "resolved": "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-3.18.5.tgz", - "integrity": "sha512-6N1I+6wf4hLOnPW+XDZqwufyIQ6gqoPfHZFkfWlvTQ+Ue7CuF8qIVQ1Eddw5HKQMkxqN10thKOFfq/9NQZ4NUg==", - "dev": true, - "requires": { - "@lerna/query-graph": "3.18.5", - "figgy-pudding": "^3.5.1", - "p-queue": "^4.0.0" - } - }, - "@lerna/symlink-binary": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-3.17.0.tgz", - "integrity": "sha512-RLpy9UY6+3nT5J+5jkM5MZyMmjNHxZIZvXLV+Q3MXrf7Eaa1hNqyynyj4RO95fxbS+EZc4XVSk25DGFQbcRNSQ==", - "dev": true, - "requires": { - "@lerna/create-symlink": "3.16.2", - "@lerna/package": "3.16.0", - "fs-extra": "^8.1.0", - "p-map": "^2.1.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/symlink-dependencies": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-3.17.0.tgz", - "integrity": "sha512-KmjU5YT1bpt6coOmdFueTJ7DFJL4H1w5eF8yAQ2zsGNTtZ+i5SGFBWpb9AQaw168dydc3s4eu0W0Sirda+F59Q==", - "dev": true, - "requires": { - "@lerna/create-symlink": "3.16.2", - "@lerna/resolve-symlink": "3.16.0", - "@lerna/symlink-binary": "3.17.0", - "fs-extra": "^8.1.0", - "p-finally": "^1.0.0", - "p-map": "^2.1.0", - "p-map-series": "^1.0.0" - }, - "dependencies": { - "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - } - } - }, - "@lerna/timer": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/timer/-/timer-3.13.0.tgz", - "integrity": "sha512-RHWrDl8U4XNPqY5MQHkToWS9jHPnkLZEt5VD+uunCKTfzlxGnRCr3/zVr8VGy/uENMYpVP3wJa4RKGY6M0vkRw==", - "dev": true - }, - "@lerna/validation-error": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-3.13.0.tgz", - "integrity": "sha512-SiJP75nwB8GhgwLKQfdkSnDufAaCbkZWJqEDlKOUPUvVOplRGnfL+BPQZH5nvq2BYSRXsksXWZ4UHVnQZI/HYA==", - "dev": true, - "requires": { - "npmlog": "^4.1.2" - } - }, - "@lerna/version": { - "version": "3.22.1", - "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.22.1.tgz", - "integrity": "sha512-PSGt/K1hVqreAFoi3zjD0VEDupQ2WZVlVIwesrE5GbrL2BjXowjCsTDPqblahDUPy0hp6h7E2kG855yLTp62+g==", - "dev": true, - "requires": { - "@lerna/check-working-tree": "3.16.5", - "@lerna/child-process": "3.16.5", - "@lerna/collect-updates": "3.20.0", - "@lerna/command": "3.21.0", - "@lerna/conventional-commits": "3.22.0", - "@lerna/github-client": "3.22.0", - "@lerna/gitlab-client": "3.15.0", - "@lerna/output": "3.13.0", - "@lerna/prerelease-id-from-version": "3.16.0", - "@lerna/prompt": "3.18.5", - "@lerna/run-lifecycle": "3.16.2", - "@lerna/run-topologically": "3.18.5", - "@lerna/validation-error": "3.13.0", - "chalk": "^2.3.1", - "dedent": "^0.7.0", - "load-json-file": "^5.3.0", - "minimatch": "^3.0.4", - "npmlog": "^4.1.2", - "p-map": "^2.1.0", - "p-pipe": "^1.2.0", - "p-reduce": "^1.0.0", - "p-waterfall": "^1.0.0", - "semver": "^6.2.0", - "slash": "^2.0.0", - "temp-write": "^3.4.0", - "write-json-file": "^3.2.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "@lerna/write-log-file": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-3.13.0.tgz", - "integrity": "sha512-RibeMnDPvlL8bFYW5C8cs4mbI3AHfQef73tnJCQ/SgrXZHehmHnsyWUiE7qDQCAo+B1RfTapvSyFF69iPj326A==", - "dev": true, - "requires": { - "npmlog": "^4.1.2", - "write-file-atomic": "^2.3.0" - } - }, - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", - "dev": true, - "requires": { - "call-me-maybe": "^1.0.1", - "glob-to-regexp": "^0.3.0" - } - }, - "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.3", - "run-parallel": "^1.1.9" - }, - "dependencies": { - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true - } - } - }, - "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.3", - "fastq": "^1.6.0" - } - }, - "@octokit/auth-token": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", - "integrity": "sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==", - "dev": true, - "requires": { - "@octokit/types": "^5.0.0" - } - }, - "@octokit/endpoint": { - "version": "6.0.6", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.6.tgz", - "integrity": "sha512-7Cc8olaCoL/mtquB7j/HTbPM+sY6Ebr4k2X2y4JoXpVKQ7r5xB4iGQE0IoO58wIPsUk4AzoT65AMEpymSbWTgQ==", - "dev": true, - "requires": { - "@octokit/types": "^5.0.0", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" - }, - "dependencies": { - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true - }, - "universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", - "dev": true - } - } - }, - "@octokit/plugin-enterprise-rest": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz", - "integrity": "sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw==", - "dev": true - }, - "@octokit/plugin-paginate-rest": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", - "integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==", - "dev": true, - "requires": { - "@octokit/types": "^2.0.1" - }, - "dependencies": { - "@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "dev": true, - "requires": { - "@types/node": ">= 8" - } - } - } - }, - "@octokit/plugin-request-log": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz", - "integrity": "sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw==", - "dev": true - }, - "@octokit/plugin-rest-endpoint-methods": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz", - "integrity": "sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==", - "dev": true, - "requires": { - "@octokit/types": "^2.0.1", - "deprecation": "^2.3.1" - }, - "dependencies": { - "@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "dev": true, - "requires": { - "@types/node": ">= 8" - } - } - } - }, - "@octokit/request": { - "version": "5.4.9", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz", - "integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==", - "dev": true, - "requires": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.0.0", - "@octokit/types": "^5.0.0", - "deprecation": "^2.0.0", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.1", - "once": "^1.4.0", - "universal-user-agent": "^6.0.0" - }, - "dependencies": { - "@octokit/request-error": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz", - "integrity": "sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==", - "dev": true, - "requires": { - "@octokit/types": "^5.0.1", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "dev": true - }, - "universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", - "dev": true - } - } - }, - "@octokit/request-error": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz", - "integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==", - "dev": true, - "requires": { - "@octokit/types": "^2.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - }, - "dependencies": { - "@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "dev": true, - "requires": { - "@types/node": ">= 8" - } - } - } - }, - "@octokit/rest": { - "version": "16.43.2", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz", - "integrity": "sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ==", - "dev": true, - "requires": { - "@octokit/auth-token": "^2.4.0", - "@octokit/plugin-paginate-rest": "^1.1.1", - "@octokit/plugin-request-log": "^1.0.0", - "@octokit/plugin-rest-endpoint-methods": "2.4.0", - "@octokit/request": "^5.2.0", - "@octokit/request-error": "^1.0.2", - "atob-lite": "^2.0.0", - "before-after-hook": "^2.0.0", - "btoa-lite": "^1.0.0", - "deprecation": "^2.0.0", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", - "lodash.uniq": "^4.5.0", - "octokit-pagination-methods": "^1.1.0", - "once": "^1.4.0", - "universal-user-agent": "^4.0.0" - } - }, - "@octokit/types": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz", - "integrity": "sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==", - "dev": true, - "requires": { - "@types/node": ">= 8" - } - }, - "@ts-morph/common": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.5.2.tgz", - "integrity": "sha512-eLmfYV6u6gUgHrB9QV9lpuWg3cD60mhXdv0jvM5exWR/Cor8HG+GziFIj2hPEWHJknqzuU4meZd8DTqIzZfDRQ==", - "dev": true, - "requires": { - "@dsherret/to-absolute-glob": "^2.0.2", - "fast-glob": "^3.2.2", - "fs-extra": "^9.0.0", - "is-negated-glob": "^1.0.0", - "multimatch": "^4.0.0", - "typescript": "~3.9.7" - }, - "dependencies": { - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true - }, - "array-differ": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", - "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "multimatch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", - "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", - "dev": true, - "requires": { - "@types/minimatch": "^3.0.3", - "array-differ": "^3.0.0", - "array-union": "^2.1.0", - "arrify": "^2.0.1", - "minimatch": "^3.0.4" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", - "dev": true - } - } - }, - "@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "requires": { - "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "14.11.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", - "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" - } - } - }, - "@types/cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", - "dev": true - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/fs-extra": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.2.tgz", - "integrity": "sha512-jp0RI6xfZpi5JL8v7WQwpBEQTq63RqW2kxwTZt+m27LcJqQdPVU1yGnT1ZI4EtCDynQQJtIGyQahkiCGCS7e+A==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", - "dev": true, - "requires": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/lodash": { - "version": "4.14.161", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.161.tgz", - "integrity": "sha512-EP6O3Jkr7bXvZZSZYlsgt5DIjiGr0dXP1/jVEwVLTFgg0d+3lWVQkRavYVQszV7dYUwvg0B8R0MBDpcmXg7XIA==", - "dev": true - }, - "@types/lodash.clonedeep": { - "version": "4.5.6", - "resolved": "https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz", - "integrity": "sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==", - "dev": true, - "requires": { - "@types/lodash": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, - "@types/minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", - "dev": true - }, - "@types/mocha": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.0.3.tgz", - "integrity": "sha512-vyxR57nv8NfcU0GZu8EUXZLTbCMupIUwy95LJ6lllN+JRPG25CwMHoB1q5xKh8YKhQnHYRAn4yW2yuHbf/5xgg==", - "dev": true - }, - "@types/node": { - "version": "14.14.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.2.tgz", - "integrity": "sha512-jeYJU2kl7hL9U5xuI/BhKPZ4vqGM/OmK6whiFAXVhlstzZhVamWhDSmHyGLIp+RVyuF9/d0dqr2P85aFj4BvJg==", - "dev": true - }, - "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", - "dev": true - }, - "@types/npm-package-arg": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@types/npm-package-arg/-/npm-package-arg-6.1.0.tgz", - "integrity": "sha512-vbt5fb0y1svMhu++1lwtKmZL76d0uPChFlw7kEzyUmTwfmpHRcFb8i0R8ElT69q/L+QLgK2hgECivIAvaEDwag==", - "dev": true - }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, - "@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", - "requires": { - "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "14.11.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", - "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" - } - } - }, - "@types/prettier": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz", - "integrity": "sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==", - "dev": true - }, - "@types/secp256k1": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", - "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", - "requires": { - "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "14.11.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", - "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" - } - } - }, - "@types/seedrandom": { - "version": "2.4.28", - "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz", - "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", - "dev": true - }, - "@types/superagent": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.10.tgz", - "integrity": "sha512-xAgkb2CMWUMCyVc/3+7iQfOEBE75NvuZeezvmixbUw3nmENf2tCnQkW5yQLTYqvXUQ+R6EXxdqKKbal2zM5V/g==", - "dev": true, - "requires": { - "@types/cookiejar": "*", - "@types/node": "*" - } - }, - "@types/uws": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", - "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/node": "*" - } - }, - "@types/ws": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.7.tgz", - "integrity": "sha512-UUFC/xxqFLP17hTva8/lVT0SybLUrfSD9c+iapKb0fEiC8uoDbA+xuZ3pAN603eW+bY8ebSMLm9jXdIPnD0ZgA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/yargs": { - "version": "15.0.9", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.9.tgz", - "integrity": "sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g==", - "dev": true, - "requires": { - "@types/yargs-parser": "*" - } - }, - "@types/yargs-parser": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", - "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", - "dev": true - }, - "@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, - "@zkochan/cmd-shim": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", - "integrity": "sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg==", - "dev": true, - "requires": { - "is-windows": "^1.0.0", - "mkdirp-promise": "^5.0.1", - "mz": "^2.5.0" - } - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, - "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", - "requires": { - "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "agentkeepalive": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", - "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", - "dev": true, - "requires": { - "humanize-ms": "^1.2.1" - } - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.5", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", - "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", - "dev": true - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "append-transform": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", - "dev": true, - "requires": { - "default-require-extensions": "^3.0.0" - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "dev": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "argparse": { - "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.2" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "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==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-differ": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", - "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "array-ify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "asap": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "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=", - "dev": true - }, - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "requires": { - "lodash": "^4.17.14" - } - }, - "async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "requires": { - "async": "^2.4.0" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "atob-lite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", - "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "base-x": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", - "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "before-after-hook": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", - "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", - "dev": true - }, - "bigint-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", - "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", - "optional": true, - "requires": { - "bindings": "^1.3.0" - } - }, - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bip39": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", - "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", - "requires": { - "@types/node": "11.11.6", - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1" - }, - "dependencies": { - "@types/node": { - "version": "11.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", - "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" - } - } - }, - "blakejs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", - "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", - "requires": { - "base-x": "^3.0.2" - } - }, - "bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "requires": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, - "btoa-lite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", - "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", - "dev": true - }, - "buffer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", - "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" - }, - "builtins": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", - "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", - "dev": true - }, - "byline": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", - "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=", - "dev": true - }, - "byte-size": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz", - "integrity": "sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw==", - "dev": true - }, - "cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - }, - "dependencies": { - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "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" - } - }, - "caching-transform": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", - "dev": true, - "requires": { - "hasha": "^5.0.0", - "make-dir": "^3.0.0", - "package-hash": "^4.0.0", - "write-file-atomic": "^3.0.0" - }, - "dependencies": { - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - } - } - }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", - "dev": true - }, - "caller-callsite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", - "dev": true, - "requires": { - "callsites": "^2.0.0" - } - }, - "caller-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", - "dev": true, - "requires": { - "caller-callsite": "^2.0.0" - } - }, - "callsites": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", - "dev": true - }, - "camelcase": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz", - "integrity": "sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==", - "dev": true - }, - "camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, - "checkpoint-store": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", - "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", - "requires": { - "functional-red-black-tree": "^1.0.1" - } - }, - "chokidar": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", - "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "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==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-highlight": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.4.tgz", - "integrity": "sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "highlight.js": "^9.6.0", - "mz": "^2.4.0", - "parse5": "^5.1.1", - "parse5-htmlparser2-tree-adapter": "^5.1.1", - "yargs": "^15.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", - "dev": true - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - }, - "clone-deep": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", - "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4", - "kind-of": "^6.0.2", - "shallow-clone": "^3.0.0" - } - }, - "code-block-writer": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.0.tgz", - "integrity": "sha512-RG9hpXtWFeUWhuUav1YuP/vGcyncW+t90yJLk9fNZs1De2OuHTHKAKThVCokt29PYq5RoJ0QSZaIZ+rvPO23hA==", - "dev": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "columnify": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", - "integrity": "sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=", - "dev": true, - "requires": { - "strip-ansi": "^3.0.0", - "wcwidth": "^1.0.0" - } - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "command-exists": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "dev": true - }, - "commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "compare-func": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", - "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", - "dev": true, - "requires": { - "array-ify": "^1.0.0", - "dot-prop": "^5.1.0" - }, - "dependencies": { - "dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, - "requires": { - "is-obj": "^2.0.0" - } - }, - "is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true - } - } - }, - "compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "config-chain": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", - "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", - "dev": true, - "requires": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true - }, - "conventional-changelog-angular": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", - "integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==", - "dev": true, - "requires": { - "compare-func": "^2.0.0", - "q": "^1.5.1" - } - }, - "conventional-changelog-core": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz", - "integrity": "sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ==", - "dev": true, - "requires": { - "conventional-changelog-writer": "^4.0.6", - "conventional-commits-parser": "^3.0.3", - "dateformat": "^3.0.0", - "get-pkg-repo": "^1.0.0", - "git-raw-commits": "2.0.0", - "git-remote-origin-url": "^2.0.0", - "git-semver-tags": "^2.0.3", - "lodash": "^4.2.1", - "normalize-package-data": "^2.3.5", - "q": "^1.5.1", - "read-pkg": "^3.0.0", - "read-pkg-up": "^3.0.0", - "through2": "^3.0.0" - }, - "dependencies": { - "through2": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", - "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "2 || 3" - } - } - } - }, - "conventional-changelog-preset-loader": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", - "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", - "dev": true - }, - "conventional-changelog-writer": { - "version": "4.0.17", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz", - "integrity": "sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==", - "dev": true, - "requires": { - "compare-func": "^2.0.0", - "conventional-commits-filter": "^2.0.6", - "dateformat": "^3.0.0", - "handlebars": "^4.7.6", - "json-stringify-safe": "^5.0.1", - "lodash": "^4.17.15", - "meow": "^7.0.0", - "semver": "^6.0.0", - "split": "^1.0.0", - "through2": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "through2": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", - "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "2 || 3" - } - } - } - }, - "conventional-commits-filter": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz", - "integrity": "sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==", - "dev": true, - "requires": { - "lodash.ismatch": "^4.4.0", - "modify-values": "^1.0.0" - } - }, - "conventional-commits-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz", - "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", - "dev": true, - "requires": { - "JSONStream": "^1.0.4", - "is-text-path": "^1.0.1", - "lodash": "^4.17.15", - "meow": "^7.0.0", - "split2": "^2.0.0", - "through2": "^3.0.0", - "trim-off-newlines": "^1.0.0" - }, - "dependencies": { - "through2": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", - "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "2 || 3" - } - } - } - }, - "conventional-recommended-bump": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-5.0.1.tgz", - "integrity": "sha512-RVdt0elRcCxL90IrNP0fYCpq1uGt2MALko0eyeQ+zQuDVWtMGAy9ng6yYn3kax42lCj9+XBxQ8ZN6S9bdKxDhQ==", - "dev": true, - "requires": { - "concat-stream": "^2.0.0", - "conventional-changelog-preset-loader": "^2.1.1", - "conventional-commits-filter": "^2.0.2", - "conventional-commits-parser": "^3.0.3", - "git-raw-commits": "2.0.0", - "git-semver-tags": "^2.0.3", - "meow": "^4.0.0", - "q": "^1.5.1" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - } - }, - "concat-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.0.2", - "typedarray": "^0.0.6" - } - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", - "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", - "dev": true, - "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist": "^1.1.3", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0" - } - }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - } - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - } - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - } - } - }, - "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - } - } - }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", - "dev": true - }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - }, - "dependencies": { - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-js-pure": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", - "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" - }, - "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=" - }, - "cosmiconfig": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", - "dev": true, - "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-env": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz", - "integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.1" - } - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, - "dargs": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", - "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", - "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "debuglog": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", - "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=", - "dev": true - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "dev": true, - "requires": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": 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=", - "dev": true - }, - "dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", - "dev": true - }, - "default-require-extensions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", - "dev": true, - "requires": { - "strip-bom": "^4.0.0" - }, - "dependencies": { - "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true - } - } - }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "requires": { - "clone": "^1.0.2" - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", - "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "defined": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", - "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true - }, - "deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", - "dev": true - }, - "detect-indent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", - "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", - "dev": true - }, - "dezalgo": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", - "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", - "dev": true, - "requires": { - "asap": "^2.0.0", - "wrappy": "1" - } - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, - "dir-glob": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", - "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", - "dev": true, - "requires": { - "path-type": "^3.0.0" - } - }, - "dot-prop": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", - "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, - "duplexer": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - "dev": true - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "emittery": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", - "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==" - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "dev": true, - "requires": { - "iconv-lite": "^0.6.2" - } - }, - "encoding-down": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", - "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", - "requires": { - "abstract-leveldown": "^5.0.0", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "xtend": "^4.0.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", - "requires": { - "buffer": "^5.6.0" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "env-paths": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", - "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==", - "dev": true - }, - "envinfo": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz", - "integrity": "sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==", - "dev": true - }, - "err-code": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", - "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=", - "dev": true - }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "requires": { - "prr": "~1.0.1" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - }, - "dependencies": { - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true - }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "dev": true - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dev": true, - "requires": { - "es6-promise": "^4.0.3" - } - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "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=", - "dev": true - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "ethashjs": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz", - "integrity": "sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==", - "requires": { - "async": "^2.1.2", - "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.0.2", - "miller-rabin": "^4.0.0" - }, - "dependencies": { - "buffer-xor": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", - "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", - "requires": { - "safe-buffer": "^5.1.1" - } - } - } - }, - "ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "requires": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "ethereumjs-account": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", - "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", - "requires": { - "ethereumjs-util": "^6.0.0", - "rlp": "^2.2.1", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - } - } - }, - "ethereumjs-block": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", - "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", - "requires": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", - "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "ethereumjs-blockchain": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz", - "integrity": "sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ==", - "requires": { - "async": "^2.6.1", - "ethashjs": "~0.0.7", - "ethereumjs-block": "~2.2.2", - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.1.0", - "flow-stoplight": "^1.0.0", - "level-mem": "^3.0.1", - "lru-cache": "^5.1.1", - "rlp": "^2.2.2", - "semaphore": "^1.1.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - } - } - }, - "ethereumjs-common": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", - "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" - }, - "ethereumjs-tx": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", - "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - } - } - }, - "ethereumjs-util": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz", - "integrity": "sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.4" - }, - "dependencies": { - "bn.js": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", - "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==" - } - } - }, - "ethereumjs-vm": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz", - "integrity": "sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==", - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "core-js-pure": "^3.0.1", - "ethereumjs-account": "^3.0.0", - "ethereumjs-block": "^2.2.2", - "ethereumjs-blockchain": "^4.0.3", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.2", - "ethereumjs-util": "^6.2.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1", - "util.promisify": "^1.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "ethereumjs-util": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", - "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "ethjs-util": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "requires": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - } - }, - "eventemitter3": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", - "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "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": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "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==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fake-merkle-patricia-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", - "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", - "requires": { - "checkpoint-store": "^1.1.0" - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", - "dev": true, - "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - }, - "dependencies": { - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - } - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", - "dev": true - }, - "fastq": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", - "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "optional": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "find-cache-dir": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", - "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "find-versions": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", - "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", - "dev": true, - "requires": { - "semver-regex": "^2.0.0" - } - }, - "flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true - }, - "flow-stoplight": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", - "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" - }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", - "dev": true - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", - "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "fromentries": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", - "integrity": "sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==", - "dev": true - }, - "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=", - "dev": true - }, - "fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", - "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", - "dev": true, - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^1.0.0" - } - }, - "fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "dev": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "genfun": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", - "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==", - "dev": true - }, - "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true - }, - "get-pkg-repo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", - "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "meow": "^3.3.0", - "normalize-package-data": "^2.3.0", - "parse-github-repo-url": "^1.3.0", - "through2": "^2.0.0" - }, - "dependencies": { - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "dev": true, - "requires": { - "get-stdin": "^4.0.1" - } - }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - } - } - }, - "get-port": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-4.2.0.tgz", - "integrity": "sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw==", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "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" - } - }, - "git-config-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", - "integrity": "sha1-bTP37WPbDQ4RgTFQO6s6ykfVRmQ=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "fs-exists-sync": "^0.1.0", - "homedir-polyfill": "^1.0.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "git-raw-commits": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", - "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", - "dev": true, - "requires": { - "dargs": "^4.0.1", - "lodash.template": "^4.0.2", - "meow": "^4.0.0", - "split2": "^2.0.0", - "through2": "^2.0.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - } - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", - "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", - "dev": true, - "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist": "^1.1.3", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0" - } - }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - } - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - } - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - } - } - }, - "git-remote-origin-url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", - "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", - "dev": true, - "requires": { - "gitconfiglocal": "^1.0.0", - "pify": "^2.3.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "git-semver-tags": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-2.0.3.tgz", - "integrity": "sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA==", - "dev": true, - "requires": { - "meow": "^4.0.0", - "semver": "^6.0.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - } - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", - "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", - "dev": true, - "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist": "^1.1.3", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0" - } - }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - } - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - } - } - }, - "git-up": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/git-up/-/git-up-4.0.2.tgz", - "integrity": "sha512-kbuvus1dWQB2sSW4cbfTeGpCMd8ge9jx9RKnhXhuJ7tnvT+NIrTVfYZxjtflZddQYcmdOTlkAcjmx7bor+15AQ==", - "dev": true, - "requires": { - "is-ssh": "^1.3.0", - "parse-url": "^5.0.0" - } - }, - "git-url-parse": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.2.0.tgz", - "integrity": "sha512-KPoHZg8v+plarZvto4ruIzzJLFQoRx+sUs5DQSr07By9IBKguVd+e6jwrFR6/TP6xrCJlNV1tPqLO1aREc7O2g==", - "dev": true, - "requires": { - "git-up": "^4.0.0" - } - }, - "git-user-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-user-name/-/git-user-name-2.0.0.tgz", - "integrity": "sha512-1DC8rUNm2I5V9v4eIpK6PSjKCp9bI0t6Wl05WSk+xEMS8GhR8GWzxM3aGZfPrfuqEfWxSbui5/pQJryJFXqCzQ==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "git-config-path": "^1.0.1", - "parse-git-config": "^1.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "gitconfiglocal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", - "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", - "dev": true, - "requires": { - "ini": "^1.3.2" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "requires": { - "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" - } - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", - "dev": true - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "globby": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", - "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^1.0.2", - "dir-glob": "^2.2.2", - "fast-glob": "^2.2.6", - "glob": "^7.1.3", - "ignore": "^4.0.3", - "pify": "^4.0.1", - "slash": "^2.0.0" - } - }, - "graceful-fs": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", - "dev": true - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "handlebars": { - "version": "4.7.6", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", - "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", - "dev": true, - "requires": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4", - "wordwrap": "^1.0.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "dev": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "hard-rejection": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "dev": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hasha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", - "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", - "dev": true, - "requires": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - }, - "dependencies": { - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } - } - }, - "hdkey": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-2.0.1.tgz", - "integrity": "sha512-c+tl9PHG9/XkGgG0tD7CJpRVaE0jfZizDNmnErUAKQ4EjQSOcOUcV3EN9ZEZS8pZ4usaeiiK0H7stzuzna8feA==", - "requires": { - "bs58check": "^2.1.2", - "safe-buffer": "^5.1.1", - "secp256k1": "^4.0.0" - } - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "highlight.js": { - "version": "9.18.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.3.tgz", - "integrity": "sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ==", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, - "html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "http-cache-semantics": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", - "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", - "dev": true - }, - "http-proxy-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", - "dev": true, - "requires": { - "agent-base": "4", - "debug": "3.1.0" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", - "dev": true, - "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - } - }, - "human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "dev": true - }, - "humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", - "dev": true, - "requires": { - "ms": "^2.0.0" - } - }, - "husky": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.0.tgz", - "integrity": "sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^7.0.0", - "find-versions": "^3.2.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^4.2.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, - "dependencies": { - "cosmiconfig": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", - "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "parse-json": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", - "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - } - } - }, - "iconv-lite": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", - "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "ignore-walk": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", - "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", - "dev": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "immediate": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", - "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" - }, - "import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", - "dev": true, - "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } - } - }, - "import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", - "dev": true, - "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "init-package-json": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz", - "integrity": "sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==", - "dev": true, - "requires": { - "glob": "^7.1.1", - "npm-package-arg": "^4.0.0 || ^5.0.0 || ^6.0.0", - "promzard": "^0.3.0", - "read": "~1.0.1", - "read-package-json": "1 || 2", - "semver": "2.x || 3.x || 4 || 5", - "validate-npm-package-license": "^3.0.1", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - } - } - }, - "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", - "dev": true, - "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true - }, - "into-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz", - "integrity": "sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==", - "dev": true, - "requires": { - "from2": "^2.3.0", - "p-is-promise": "^3.0.0" - } - }, - "ip": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", - "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", - "dev": true - }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "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=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "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==", - "dev": true - } - } - }, - "is-directory": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", - "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", - "dev": true - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-finite": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", - "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-hex-prefixed": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" - }, - "is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", - "dev": true - }, - "is-negative-zero": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", - "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=" - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "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==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", - "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "dev": true, - "requires": { - "is-unc-path": "^1.0.0" - } - }, - "is-ssh": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz", - "integrity": "sha512-elEw0/0c2UscLrNG+OAorbP539E3rhliKPg+hDMWN9VwrDXfYK+4PBEykDPfxlYYtQvl84TascnQyobfQLHEhQ==", - "dev": true, - "requires": { - "protocols": "^1.1.0" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-text-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", - "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", - "dev": true, - "requires": { - "text-extensions": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "dev": true, - "requires": { - "unc-path-regex": "^0.1.2" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", - "dev": true - }, - "istanbul-lib-hook": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", - "dev": true, - "requires": { - "append-transform": "^2.0.0" - } - }, - "istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", - "dev": true, - "requires": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "istanbul-lib-processinfo": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", - "dev": true, - "requires": { - "archy": "^1.0.0", - "cross-spawn": "^7.0.0", - "istanbul-lib-coverage": "^3.0.0-alpha.1", - "make-dir": "^3.0.0", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^3.3.3" - }, - "dependencies": { - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, - "dependencies": { - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "istanbul-reports": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", - "dev": true, - "requires": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - } - }, - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "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=", - "dev": true - }, - "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" - } - }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "keccak": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", - "integrity": "sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==", - "requires": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "lerna": { - "version": "3.22.1", - "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.22.1.tgz", - "integrity": "sha512-vk1lfVRFm+UuEFA7wkLKeSF7Iz13W+N/vFd48aW2yuS7Kv0RbNm2/qcDPV863056LMfkRlsEe+QYOw3palj5Lg==", - "dev": true, - "requires": { - "@lerna/add": "3.21.0", - "@lerna/bootstrap": "3.21.0", - "@lerna/changed": "3.21.0", - "@lerna/clean": "3.21.0", - "@lerna/cli": "3.18.5", - "@lerna/create": "3.22.0", - "@lerna/diff": "3.21.0", - "@lerna/exec": "3.21.0", - "@lerna/import": "3.22.0", - "@lerna/info": "3.21.0", - "@lerna/init": "3.21.0", - "@lerna/link": "3.21.0", - "@lerna/list": "3.21.0", - "@lerna/publish": "3.22.1", - "@lerna/run": "3.21.0", - "@lerna/version": "3.22.1", - "import-local": "^2.0.0", - "npmlog": "^4.1.2" - } - }, - "level-codec": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", - "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" - }, - "level-concat-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" - }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-mem": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", - "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", - "requires": { - "level-packager": "~4.0.0", - "memdown": "~3.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" - }, - "memdown": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", - "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", - "requires": { - "abstract-leveldown": "~5.0.0", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-option-wrap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/level-option-wrap/-/level-option-wrap-1.1.0.tgz", - "integrity": "sha1-rSDmjZ88IsiJdTHMaqevWWse0Sk=", - "requires": { - "defined": "~0.0.0" - } - }, - "level-packager": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", - "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", - "requires": { - "encoding-down": "~5.0.0", - "levelup": "^3.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", - "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", - "requires": { - "abstract-leveldown": "~5.0.0", - "inherits": "^2.0.3" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", - "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "xtend": "^4.0.0" - } - }, - "levelup": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", - "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", - "requires": { - "deferred-leveldown": "~4.0.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~3.0.0", - "xtend": "~4.0.0" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-supports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", - "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", - "requires": { - "xtend": "^4.0.2" - }, - "dependencies": { - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-ws": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", - "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } - } - }, - "leveldown": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", - "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", - "requires": { - "abstract-leveldown": "~6.2.1", - "napi-macros": "~2.0.0", - "node-gyp-build": "~4.1.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "node-gyp-build": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", - "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, - "load-json-file": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", - "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "parse-json": "^4.0.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0", - "type-fest": "^0.3.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, - "lodash.ismatch": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", - "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", - "dev": true - }, - "lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", - "dev": true - }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, - "lodash.template": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", - "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "lodash.templatesettings": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0" - } - }, - "lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", - "dev": true - }, - "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", - "dev": true, - "requires": { - "chalk": "^4.0.0" - } - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "requires": { - "yallist": "^3.0.2" - } - }, - "ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" - }, - "macos-release": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz", - "integrity": "sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg==", - "dev": true - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "make-fetch-happen": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz", - "integrity": "sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==", - "dev": true, - "requires": { - "agentkeepalive": "^3.4.1", - "cacache": "^12.0.0", - "http-cache-semantics": "^3.8.1", - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^2.2.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "node-fetch-npm": "^2.0.2", - "promise-retry": "^1.1.1", - "socks-proxy-agent": "^4.0.0", - "ssri": "^6.0.0" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", - "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "memdown": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", - "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "requires": { - "xtend": "~4.0.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", - "dev": true - }, - "meow": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", - "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", - "dev": true, - "requires": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "4.1.0", - "normalize-package-data": "^2.5.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.13.1", - "yargs-parser": "^18.1.3" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "parse-json": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", - "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } - } - }, - "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dev": true, - "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } - } - }, - "type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", - "dev": true - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "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" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", - "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==", - "dev": true - }, - "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", - "dev": true - }, - "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "dev": true, - "requires": { - "mime-db": "1.44.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - } - }, - "minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "dev": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "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==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "mkdirp-promise": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", - "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", - "dev": true, - "requires": { - "mkdirp": "*" - } - }, - "mocha": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.2.0.tgz", - "integrity": "sha512-lEWEMq2LMfNJMKeuEwb5UELi+OgFDollXaytR5ggQcHpzG3NP/R7rvixAvF+9/lLsTWhWG+4yD2M70GsM06nxw==", - "dev": true, - "requires": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.4.3", - "debug": "4.2.0", - "diff": "4.0.2", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.1.6", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "3.14.0", - "log-symbols": "4.0.0", - "minimatch": "3.0.4", - "ms": "2.1.2", - "nanoid": "3.1.12", - "serialize-javascript": "5.0.1", - "strip-json-comments": "3.1.1", - "supports-color": "7.2.0", - "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.0.2", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "p-limit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", - "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "modify-values": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", - "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", - "dev": true - }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - }, - "dependencies": { - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "mri": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", - "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "multimatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", - "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", - "dev": true, - "requires": { - "array-differ": "^2.0.3", - "array-union": "^1.0.2", - "arrify": "^1.0.1", - "minimatch": "^3.0.4" - } - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "nanoid": { - "version": "3.1.12", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.12.tgz", - "integrity": "sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==", - "dev": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "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-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" - } - }, - "napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" - }, - "neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" - }, - "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "dev": true - }, - "node-fetch-npm": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz", - "integrity": "sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg==", - "dev": true, - "requires": { - "encoding": "^0.1.11", - "json-parse-better-errors": "^1.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node-gyp": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz", - "integrity": "sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw==", - "dev": true, - "requires": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.2", - "mkdirp": "^0.5.1", - "nopt": "^4.0.1", - "npmlog": "^4.1.2", - "request": "^2.88.0", - "rimraf": "^2.6.3", - "semver": "^5.7.1", - "tar": "^4.4.12", - "which": "^1.3.1" - }, - "dependencies": { - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "node-gyp-build": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" - }, - "node-preload": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", - "dev": true, - "requires": { - "process-on-spawn": "^1.0.0" - } - }, - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "dev": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "normalize-url": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", - "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", - "dev": true - }, - "npm-bundled": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", - "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", - "dev": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-lifecycle": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz", - "integrity": "sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g==", - "dev": true, - "requires": { - "byline": "^5.0.0", - "graceful-fs": "^4.1.15", - "node-gyp": "^5.0.2", - "resolve-from": "^4.0.0", - "slide": "^1.1.6", - "uid-number": "0.0.6", - "umask": "^1.1.0", - "which": "^1.3.1" - }, - "dependencies": { - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "dev": true - }, - "npm-package-arg": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.0.tgz", - "integrity": "sha512-/ep6QDxBkm9HvOhOg0heitSd7JHA1U7y1qhhlRlteYYAi9Pdb/ZV7FW5aHpkrpM8+P+4p/jjR8zCyKPBMBjSig==", - "dev": true, - "requires": { - "hosted-git-info": "^3.0.6", - "semver": "^7.0.0", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "hosted-git-info": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz", - "integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - } - }, - "npm-packlist": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", - "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", - "dev": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-pick-manifest": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz", - "integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1", - "npm-package-arg": "^6.0.0", - "semver": "^5.4.1" - }, - "dependencies": { - "npm-package-arg": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", - "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", - "dev": true, - "requires": { - "hosted-git-info": "^2.7.1", - "osenv": "^0.1.5", - "semver": "^5.6.0", - "validate-npm-package-name": "^3.0.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - } - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - }, - "dependencies": { - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - } - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "nyc": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", - "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", - "dev": true, - "requires": { - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "caching-transform": "^4.0.0", - "convert-source-map": "^1.7.0", - "decamelize": "^1.2.0", - "find-cache-dir": "^3.2.0", - "find-up": "^4.1.0", - "foreground-child": "^2.0.0", - "get-package-type": "^0.1.0", - "glob": "^7.1.6", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-processinfo": "^2.0.2", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "make-dir": "^3.0.0", - "node-preload": "^0.2.1", - "p-map": "^3.0.0", - "process-on-spawn": "^1.0.0", - "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "spawn-wrap": "^2.0.0", - "test-exclude": "^6.0.0", - "yargs": "^15.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "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=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "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" - } - } - } - }, - "object-inspect": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", - "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", - "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.0", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.18.0-next.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", - "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-negative-zero": "^2.0.0", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - } - } - }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "octokit-pagination-methods": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", - "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "opencollective-postinstall": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-name": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", - "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", - "dev": true, - "requires": { - "macos-release": "^2.2.0", - "windows-release": "^3.1.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-is-promise": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", - "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", - "dev": true - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-map": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", - "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", - "dev": true - }, - "p-map-series": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-map-series/-/p-map-series-1.0.0.tgz", - "integrity": "sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco=", - "dev": true, - "requires": { - "p-reduce": "^1.0.0" - } - }, - "p-pipe": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-pipe/-/p-pipe-1.2.0.tgz", - "integrity": "sha1-SxoROZoRUgpneQ7loMHViB1r7+k=", - "dev": true - }, - "p-queue": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-4.0.0.tgz", - "integrity": "sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg==", - "dev": true, - "requires": { - "eventemitter3": "^3.1.0" - } - }, - "p-reduce": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", - "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", - "dev": true - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "p-waterfall": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-waterfall/-/p-waterfall-1.0.0.tgz", - "integrity": "sha1-ftlLPOszMngjU69qrhGqn8I1uwA=", - "dev": true, - "requires": { - "p-reduce": "^1.0.0" - } - }, - "package-hash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "hasha": "^5.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" - } - }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - }, - "dependencies": { - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - } - } - }, - "parse-git-config": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", - "integrity": "sha1-06mYQxcTL1c5hxK7pDjhKVkN34w=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "fs-exists-sync": "^0.1.0", - "git-config-path": "^1.0.1", - "ini": "^1.3.4" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "parse-github-repo-url": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", - "integrity": "sha1-nn2LslKmy2ukJZUGC3v23z28H1A=", - "dev": true - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "parse-path": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.2.tgz", - "integrity": "sha512-HSqVz6iuXSiL8C1ku5Gl1Z5cwDd9Wo0q8CoffdAghP6bz8pJa1tcMC+m4N+z6VAS8QdksnIGq1TB6EgR4vPR6w==", - "dev": true, - "requires": { - "is-ssh": "^1.3.0", - "protocols": "^1.4.0" - } - }, - "parse-url": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-5.0.2.tgz", - "integrity": "sha512-Czj+GIit4cdWtxo3ISZCvLiUjErSo0iI3wJ+q9Oi3QuMYTI6OZu+7cewMWZ+C1YAnKhYTk6/TLuhIgCypLthPA==", - "dev": true, - "requires": { - "is-ssh": "^1.3.0", - "normalize-url": "^3.3.0", - "parse-path": "^4.0.0", - "protocols": "^1.4.0" - } - }, - "parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", - "dev": true - }, - "parse5-htmlparser2-tree-adapter": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz", - "integrity": "sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw==", - "dev": true, - "requires": { - "parse5": "^5.1.1" - } - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "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-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "pbkdf2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", - "dev": true, - "requires": { - "semver-compare": "^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=", - "dev": true - }, - "prettier": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", - "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", - "dev": true - }, - "pretty-quick": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.1.0.tgz", - "integrity": "sha512-DtxIxksaUWCgPFN7E1ZZk4+Aav3CCuRdhrDSFZENb404sYMtuo9Zka823F+Mgeyt8Zt3bUiCjFzzWYE9LYqkmQ==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "execa": "^4.0.0", - "find-up": "^4.1.0", - "ignore": "^5.1.4", - "mri": "^1.1.5", - "multimatch": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "array-differ": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", - "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "multimatch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", - "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", - "dev": true, - "requires": { - "@types/minimatch": "^3.0.3", - "array-differ": "^3.0.0", - "array-union": "^2.1.0", - "arrify": "^2.0.1", - "minimatch": "^3.0.4" - } - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "requires": { - "path-key": "^3.0.0" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - } - } - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "process-on-spawn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", - "dev": true, - "requires": { - "fromentries": "^1.2.0" - } - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "promise-retry": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", - "integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=", - "dev": true, - "requires": { - "err-code": "^1.0.0", - "retry": "^0.10.0" - } - }, - "promzard": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", - "integrity": "sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=", - "dev": true, - "requires": { - "read": "1" - } - }, - "proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", - "dev": true - }, - "protocols": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz", - "integrity": "sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg==", - "dev": true - }, - "protoduck": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", - "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", - "dev": true, - "requires": { - "genfun": "^5.0.0" - } - }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" - }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "dev": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "reachdown": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz", - "integrity": "sha512-6LsdRe4cZyOjw4NnvbhUd/rGG7WQ9HMopPr+kyL018Uci4kijtxcGR5kVb5Ln13k4PEE+fEFQbjfOvNw7cnXmA==" - }, - "read": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", - "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", - "dev": true, - "requires": { - "mute-stream": "~0.0.4" - } - }, - "read-cmd-shim": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz", - "integrity": "sha512-v5yCqQ/7okKoZZkBQUAfTsQ3sVJtXdNfbPnI5cceppoxEVLYA3k+VtV2omkeo8MS94JCy4fSiUwlRBAwCVRPUA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2" - } - }, - "read-package-json": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz", - "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==", - "dev": true, - "requires": { - "glob": "^7.1.1", - "json-parse-even-better-errors": "^2.3.0", - "normalize-package-data": "^2.0.0", - "npm-normalize-package-bin": "^1.0.0" - } - }, - "read-package-tree": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz", - "integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==", - "dev": true, - "requires": { - "read-package-json": "^2.0.0", - "readdir-scoped-modules": "^1.0.0", - "util-promisify": "^2.1.0" - } - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - }, - "dependencies": { - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "^2.0.0", - "read-pkg": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - } - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "readdir-scoped-modules": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", - "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", - "dev": true, - "requires": { - "debuglog": "^1.0.1", - "dezalgo": "^1.0.0", - "graceful-fs": "^4.1.2", - "once": "^1.3.0" - } - }, - "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "^1.1.6" - } - }, - "redent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "dev": true, - "requires": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", - "dev": true, - "requires": { - "es6-error": "^4.0.1" - } - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } - } - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "retry": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", - "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rlp": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", - "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", - "requires": { - "bn.js": "^4.11.1" - } - }, - "run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true - }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true - }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, - "rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" - }, - "rxjs": { - "version": "6.6.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", - "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "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==", - "dev": true - }, - "scrypt-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" - }, - "secp256k1": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", - "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", - "requires": { - "elliptic": "^6.5.2", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, - "seedrandom": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", - "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" - }, - "semaphore": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", - "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" - }, - "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" - }, - "semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", - "dev": true - }, - "semver-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", - "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", - "dev": true - }, - "serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shallow-clone": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", - "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "shelljs": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", - "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", - "dev": true, - "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - } - }, - "shx": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.3.tgz", - "integrity": "sha512-nZJ3HFWVoTSyyB+evEKjJ1STiixGztlqwKLTUNV5KqMWtGey9fTd4KU1gdZ1X9BV6215pswQ/Jew9NsuS/fNDA==", - "dev": true, - "requires": { - "minimist": "^1.2.3", - "shelljs": "^0.8.4" - } - }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", - "dev": true - }, - "smart-buffer": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", - "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==", - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "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": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "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==", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "socks": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz", - "integrity": "sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==", - "dev": true, - "requires": { - "ip": "1.1.5", - "smart-buffer": "^4.1.0" - } - }, - "socks-proxy-agent": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", - "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", - "dev": true, - "requires": { - "agent-base": "~4.2.1", - "socks": "~2.3.2" - }, - "dependencies": { - "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - } - } - } - }, - "solc": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.4.tgz", - "integrity": "sha512-IVLqAfUkJqgTS0JIgFPeC50ehUeBXu2eE+iU+rqb6UeOyf6w/BB/EsNcTSTpjtUti8BTG/sCd2qVhrWVYy7p0g==", - "dev": true, - "requires": { - "command-exists": "^1.2.8", - "commander": "3.0.2", - "follow-redirects": "^1.12.1", - "fs-extra": "^0.30.0", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", - "tmp": "0.0.33" - }, - "dependencies": { - "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - } - } - }, - "sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", - "dev": true, - "requires": { - "is-plain-obj": "^1.0.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "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=", - "dev": true - }, - "spawn-wrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", - "dev": true, - "requires": { - "foreground-child": "^2.0.0", - "is-windows": "^1.0.2", - "make-dir": "^3.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "which": "^2.0.1" - }, - "dependencies": { - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", - "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", - "dev": true - }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dev": true, - "requires": { - "through": "2" - } - }, - "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==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "split2": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", - "dev": true, - "requires": { - "through2": "^2.0.2" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "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", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string.prototype.trimend": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", - "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string.prototype.trimstart": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", - "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true - }, - "strip-hex-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", - "requires": { - "is-hex-prefixed": "1.0.0" - } - }, - "strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, - "requires": { - "min-indent": "^1.0.0" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "strong-log-transformer": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz", - "integrity": "sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==", - "dev": true, - "requires": { - "duplexer": "^0.1.1", - "minimist": "^1.2.0", - "through": "^2.3.4" - } - }, - "subleveldown": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.1.tgz", - "integrity": "sha512-cVqd/URpp7si1HWu5YqQ3vqQkjuolAwHypY1B4itPlS71/lsf6TQPZ2Y0ijT22EYVkvH5ove9JFJf4u7VGPuZw==", - "requires": { - "abstract-leveldown": "^6.3.0", - "encoding-down": "^6.2.0", - "inherits": "^2.0.3", - "level-option-wrap": "^1.1.0", - "levelup": "^4.4.0", - "reachdown": "^1.1.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", - "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - } - } - }, - "encoding-down": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", - "requires": { - "abstract-leveldown": "^6.2.1", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0" - } - }, - "level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", - "requires": { - "buffer": "^5.6.0" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - } - }, - "levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", - "requires": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "superagent": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", - "integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==", - "dev": true, - "requires": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.2", - "debug": "^4.1.1", - "fast-safe-stringify": "^2.0.7", - "form-data": "^3.0.0", - "formidable": "^1.2.2", - "methods": "^1.1.2", - "mime": "^2.4.6", - "qs": "^6.9.4", - "readable-stream": "^3.6.0", - "semver": "^7.3.2" - }, - "dependencies": { - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "form-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", - "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", - "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", - "dev": true - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true - } - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "tar": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", - "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", - "dev": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", - "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=", - "dev": true - }, - "temp-write": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-3.4.0.tgz", - "integrity": "sha1-jP9jD7fp2gXwR8dM5M5NaFRX1JI=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "is-stream": "^1.1.0", - "make-dir": "^1.0.0", - "pify": "^3.0.0", - "temp-dir": "^1.0.0", - "uuid": "^3.0.1" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - } - } - }, - "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - } - }, - "text-extensions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", - "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", - "dev": true - }, - "thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dev": true, - "requires": { - "any-promise": "^1.0.0" - } - }, - "thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "dev": true, - "requires": { - "thenify": ">= 3.1.0 < 4" - } - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - } - } - }, - "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "requires": { - "rimraf": "^3.0.0" - } - }, - "tmp-promise": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.2.tgz", - "integrity": "sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA==", - "requires": { - "tmp": "^0.2.0" - } - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "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=", - "dev": true, - "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=", - "dev": true, - "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==", - "dev": true, - "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=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "trim-newlines": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", - "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", - "dev": true - }, - "trim-off-newlines": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", - "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", - "dev": true - }, - "ts-morph": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.3.0.tgz", - "integrity": "sha512-BUKSoz7AFSKPcYTZODbICW2mOthAN4vc5juD6FL1lD/dLwZ0WvrC3zqBM3/X6f5gHxq3yaz+HmanHGaWm0ddbQ==", - "dev": true, - "requires": { - "@dsherret/to-absolute-glob": "^2.0.2", - "@ts-morph/common": "~0.5.2", - "code-block-writer": "^10.1.0" - } - }, - "ts-node": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", - "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", - "dev": true, - "requires": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - } - }, - "tslib": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", - "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, - "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", - "dev": true - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "typescript": { - "version": "4.1.0-beta", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.0-beta.tgz", - "integrity": "sha512-b/LAttdVl3G6FEmnMkDsK0xvfvaftXpSKrjXn+OVCRqrwz5WD/6QJOiN+dTorqDY+hkaH+r2gP5wI1jBDmdQ7A==", - "dev": true - }, - "uWebSockets.js": { - "version": "github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c", - "from": "github:uNetworking/uWebSockets.js#v18.4.0" - }, - "uglify-js": { - "version": "3.10.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz", - "integrity": "sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==", - "dev": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", - "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", - "dev": true - }, - "umask": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", - "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=", - "dev": true - }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "universal-user-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz", - "integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==", - "dev": true, - "requires": { - "os-name": "^3.1.0" - } - }, - "universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true, - "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=", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true - }, - "uri-js": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", - "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "utf-8-validate": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", - "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", - "dev": true, - "requires": { - "node-gyp-build": "~3.7.0" - }, - "dependencies": { - "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", - "dev": true - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "util-promisify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz", - "integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3" - } - }, - "util.promisify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", - "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.2", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.0" - } - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "validate-npm-package-name": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", - "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", - "dev": true, - "requires": { - "builtins": "^1.0.3" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "requires": { - "defaults": "^1.0.3" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", - "dev": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "windows-release": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.3.tgz", - "integrity": "sha512-OSOGH1QYiW5yVor9TtmXKQvt2vjQqbYS+DqmsZw+r7xDwLXEeT3JGW0ZppFmHx4diyXmxt238KFR3N9jzevBRg==", - "dev": true, - "requires": { - "execa": "^1.0.0" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, - "workerpool": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.2.tgz", - "integrity": "sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q==", - "dev": true - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "write-json-file": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", - "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", - "dev": true, - "requires": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.15", - "make-dir": "^2.1.0", - "pify": "^4.0.1", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.4.2" - }, - "dependencies": { - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "write-pkg": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz", - "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", - "dev": true, - "requires": { - "sort-keys": "^2.0.0", - "write-json-file": "^2.2.0" - }, - "dependencies": { - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "write-json-file": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", - "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", - "dev": true, - "requires": { - "detect-indent": "^5.0.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "pify": "^3.0.0", - "sort-keys": "^2.0.0", - "write-file-atomic": "^2.0.0" - } - } - } - }, - "ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", - "dev": true - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } - }, - "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", - "dev": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, - "yaml": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", - "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", - "dev": true - }, - "yargs": { - "version": "16.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.1.0.tgz", - "integrity": "sha512-upWFJOmDdHN0syLuESuvXDmrRcWd1QafJolHskzaw79uZa7/x53gxQKiR07W59GWY1tFhhU/Th9DrtSfpS782g==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.2", - "yargs-parser": "^20.2.2" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "cliui": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.3.tgz", - "integrity": "sha512-Gj3QHTkVMPKqwP3f7B4KPkBZRMR9r4rfi5bXFpg1a+Svvj8l7q5CnkBkVQzfxT5DFSsGk2+PascOgL0JYkL2kw==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.4.tgz", - "integrity": "sha512-deLOfD+RvFgrpAmSZgfGdWYE+OKyHcVHaRQ7NphG/63scpRvTHHeQMAxGGvaLVGJ+HYVcCXlzcTK0ZehFf+eHQ==", - "dev": true - }, - "yargs-parser": { - "version": "20.2.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.3.tgz", - "integrity": "sha512-emOFRT9WVHw03QSvN5qor9QQT9+sw5vwxfYweivSMHTcAXPefwVae2FjO7JJjj8hCE4CzPOPeFM83VwT29HCww==", - "dev": true - } - } - }, - "yargs-parser": { - "version": "15.0.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", - "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } - } - }, - "yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "requires": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "dependencies": { - "decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true - }, - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true - } - } - }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true - } - } -} +{"name":"root","requires":true,"lockfileVersion":1,"dependencies":{"@babel/code-frame":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz","integrity":"sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==","dev":true,"requires":{"@babel/highlight":"^7.10.4"}},"@babel/core":{"version":"7.11.6","resolved":"https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz","integrity":"sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==","dev":true,"requires":{"@babel/code-frame":"^7.10.4","@babel/generator":"^7.11.6","@babel/helper-module-transforms":"^7.11.0","@babel/helpers":"^7.10.4","@babel/parser":"^7.11.5","@babel/template":"^7.10.4","@babel/traverse":"^7.11.5","@babel/types":"^7.11.5","convert-source-map":"^1.7.0","debug":"^4.1.0","gensync":"^1.0.0-beta.1","json5":"^2.1.2","lodash":"^4.17.19","resolve":"^1.3.2","semver":"^5.4.1","source-map":"^0.5.0"},"dependencies":{"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}}}},"@babel/generator":{"version":"7.11.6","resolved":"https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz","integrity":"sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==","dev":true,"requires":{"@babel/types":"^7.11.5","jsesc":"^2.5.1","source-map":"^0.5.0"}},"@babel/helper-function-name":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz","integrity":"sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==","dev":true,"requires":{"@babel/helper-get-function-arity":"^7.10.4","@babel/template":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/helper-get-function-arity":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz","integrity":"sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==","dev":true,"requires":{"@babel/types":"^7.10.4"}},"@babel/helper-member-expression-to-functions":{"version":"7.11.0","resolved":"https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz","integrity":"sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==","dev":true,"requires":{"@babel/types":"^7.11.0"}},"@babel/helper-module-imports":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz","integrity":"sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==","dev":true,"requires":{"@babel/types":"^7.10.4"}},"@babel/helper-module-transforms":{"version":"7.11.0","resolved":"https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz","integrity":"sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==","dev":true,"requires":{"@babel/helper-module-imports":"^7.10.4","@babel/helper-replace-supers":"^7.10.4","@babel/helper-simple-access":"^7.10.4","@babel/helper-split-export-declaration":"^7.11.0","@babel/template":"^7.10.4","@babel/types":"^7.11.0","lodash":"^4.17.19"}},"@babel/helper-optimise-call-expression":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz","integrity":"sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==","dev":true,"requires":{"@babel/types":"^7.10.4"}},"@babel/helper-replace-supers":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz","integrity":"sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==","dev":true,"requires":{"@babel/helper-member-expression-to-functions":"^7.10.4","@babel/helper-optimise-call-expression":"^7.10.4","@babel/traverse":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/helper-simple-access":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz","integrity":"sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==","dev":true,"requires":{"@babel/template":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/helper-split-export-declaration":{"version":"7.11.0","resolved":"https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz","integrity":"sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==","dev":true,"requires":{"@babel/types":"^7.11.0"}},"@babel/helper-validator-identifier":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz","integrity":"sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==","dev":true},"@babel/helpers":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz","integrity":"sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==","dev":true,"requires":{"@babel/template":"^7.10.4","@babel/traverse":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/highlight":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz","integrity":"sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==","dev":true,"requires":{"@babel/helper-validator-identifier":"^7.10.4","chalk":"^2.0.0","js-tokens":"^4.0.0"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@babel/parser":{"version":"7.11.5","resolved":"https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz","integrity":"sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==","dev":true},"@babel/template":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz","integrity":"sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==","dev":true,"requires":{"@babel/code-frame":"^7.10.4","@babel/parser":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/traverse":{"version":"7.11.5","resolved":"https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz","integrity":"sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==","dev":true,"requires":{"@babel/code-frame":"^7.10.4","@babel/generator":"^7.11.5","@babel/helper-function-name":"^7.10.4","@babel/helper-split-export-declaration":"^7.11.0","@babel/parser":"^7.11.5","@babel/types":"^7.11.5","debug":"^4.1.0","globals":"^11.1.0","lodash":"^4.17.19"},"dependencies":{"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}}}},"@babel/types":{"version":"7.11.5","resolved":"https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz","integrity":"sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==","dev":true,"requires":{"@babel/helper-validator-identifier":"^7.10.4","lodash":"^4.17.19","to-fast-properties":"^2.0.0"}},"@dsherret/to-absolute-glob":{"version":"2.0.2","resolved":"https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz","integrity":"sha1-H2R13IvZdM6gei2vOGSzF7HdMyw=","dev":true,"requires":{"is-absolute":"^1.0.0","is-negated-glob":"^1.0.0"}},"@evocateur/libnpmaccess":{"version":"3.1.2","resolved":"https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz","integrity":"sha512-KSCAHwNWro0CF2ukxufCitT9K5LjL/KuMmNzSu8wuwN2rjyKHD8+cmOsiybK+W5hdnwc5M1SmRlVCaMHQo+3rg==","dev":true,"requires":{"@evocateur/npm-registry-fetch":"^4.0.0","aproba":"^2.0.0","figgy-pudding":"^3.5.1","get-stream":"^4.0.0","npm-package-arg":"^6.1.0"},"dependencies":{"aproba":{"version":"2.0.0","resolved":"https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz","integrity":"sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==","dev":true},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@evocateur/libnpmpublish":{"version":"1.2.2","resolved":"https://registry.npmjs.org/@evocateur/libnpmpublish/-/libnpmpublish-1.2.2.tgz","integrity":"sha512-MJrrk9ct1FeY9zRlyeoyMieBjGDG9ihyyD9/Ft6MMrTxql9NyoEx2hw9casTIP4CdqEVu+3nQ2nXxoJ8RCXyFg==","dev":true,"requires":{"@evocateur/npm-registry-fetch":"^4.0.0","aproba":"^2.0.0","figgy-pudding":"^3.5.1","get-stream":"^4.0.0","lodash.clonedeep":"^4.5.0","normalize-package-data":"^2.4.0","npm-package-arg":"^6.1.0","semver":"^5.5.1","ssri":"^6.0.1"},"dependencies":{"aproba":{"version":"2.0.0","resolved":"https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz","integrity":"sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==","dev":true},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@evocateur/npm-registry-fetch":{"version":"4.0.0","resolved":"https://registry.npmjs.org/@evocateur/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz","integrity":"sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g==","dev":true,"requires":{"JSONStream":"^1.3.4","bluebird":"^3.5.1","figgy-pudding":"^3.4.1","lru-cache":"^5.1.1","make-fetch-happen":"^5.0.0","npm-package-arg":"^6.1.0","safe-buffer":"^5.1.2"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@evocateur/pacote":{"version":"9.6.5","resolved":"https://registry.npmjs.org/@evocateur/pacote/-/pacote-9.6.5.tgz","integrity":"sha512-EI552lf0aG2nOV8NnZpTxNo2PcXKPmDbF9K8eCBFQdIZwHNGN/mi815fxtmUMa2wTa1yndotICIDt/V0vpEx2w==","dev":true,"requires":{"@evocateur/npm-registry-fetch":"^4.0.0","bluebird":"^3.5.3","cacache":"^12.0.3","chownr":"^1.1.2","figgy-pudding":"^3.5.1","get-stream":"^4.1.0","glob":"^7.1.4","infer-owner":"^1.0.4","lru-cache":"^5.1.1","make-fetch-happen":"^5.0.0","minimatch":"^3.0.4","minipass":"^2.3.5","mississippi":"^3.0.0","mkdirp":"^0.5.1","normalize-package-data":"^2.5.0","npm-package-arg":"^6.1.0","npm-packlist":"^1.4.4","npm-pick-manifest":"^3.0.0","osenv":"^0.1.5","promise-inflight":"^1.0.1","promise-retry":"^1.1.1","protoduck":"^5.0.1","rimraf":"^2.6.3","safe-buffer":"^5.2.0","semver":"^5.7.0","ssri":"^6.0.1","tar":"^4.4.10","unique-filename":"^1.1.1","which":"^1.3.1"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"which":{"version":"1.3.1","resolved":"https://registry.npmjs.org/which/-/which-1.3.1.tgz","integrity":"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==","dev":true,"requires":{"isexe":"^2.0.0"}}}},"@istanbuljs/load-nyc-config":{"version":"1.1.0","resolved":"https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz","integrity":"sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==","dev":true,"requires":{"camelcase":"^5.3.1","find-up":"^4.1.0","get-package-type":"^0.1.0","js-yaml":"^3.13.1","resolve-from":"^5.0.0"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"resolve-from":{"version":"5.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz","integrity":"sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==","dev":true}}},"@istanbuljs/nyc-config-typescript":{"version":"1.0.1","resolved":"https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz","integrity":"sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==","dev":true,"requires":{"@istanbuljs/schema":"^0.1.2"}},"@istanbuljs/schema":{"version":"0.1.2","resolved":"https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz","integrity":"sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==","dev":true},"@lerna/add":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/add/-/add-3.21.0.tgz","integrity":"sha512-vhUXXF6SpufBE1EkNEXwz1VLW03f177G9uMOFMQkp6OJ30/PWg4Ekifuz9/3YfgB2/GH8Tu4Lk3O51P2Hskg/A==","dev":true,"requires":{"@evocateur/pacote":"^9.6.3","@lerna/bootstrap":"3.21.0","@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/npm-conf":"3.16.0","@lerna/validation-error":"3.13.0","dedent":"^0.7.0","npm-package-arg":"^6.1.0","p-map":"^2.1.0","semver":"^6.2.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/bootstrap":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.21.0.tgz","integrity":"sha512-mtNHlXpmvJn6JTu0KcuTTPl2jLsDNud0QacV/h++qsaKbhAaJr/FElNZ5s7MwZFUM3XaDmvWzHKaszeBMHIbBw==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/has-npm-version":"3.16.5","@lerna/npm-install":"3.16.5","@lerna/package-graph":"3.18.5","@lerna/pulse-till-done":"3.13.0","@lerna/rimraf-dir":"3.16.5","@lerna/run-lifecycle":"3.16.2","@lerna/run-topologically":"3.18.5","@lerna/symlink-binary":"3.17.0","@lerna/symlink-dependencies":"3.17.0","@lerna/validation-error":"3.13.0","dedent":"^0.7.0","get-port":"^4.2.0","multimatch":"^3.0.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","p-finally":"^1.0.0","p-map":"^2.1.0","p-map-series":"^1.0.0","p-waterfall":"^1.0.0","read-package-tree":"^5.1.6","semver":"^6.2.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/changed":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/changed/-/changed-3.21.0.tgz","integrity":"sha512-hzqoyf8MSHVjZp0gfJ7G8jaz+++mgXYiNs9iViQGA8JlN/dnWLI5sWDptEH3/B30Izo+fdVz0S0s7ydVE3pWIw==","dev":true,"requires":{"@lerna/collect-updates":"3.20.0","@lerna/command":"3.21.0","@lerna/listable":"3.18.5","@lerna/output":"3.13.0"}},"@lerna/check-working-tree":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-3.16.5.tgz","integrity":"sha512-xWjVBcuhvB8+UmCSb5tKVLB5OuzSpw96WEhS2uz6hkWVa/Euh1A0/HJwn2cemyK47wUrCQXtczBUiqnq9yX5VQ==","dev":true,"requires":{"@lerna/collect-uncommitted":"3.16.5","@lerna/describe-ref":"3.16.5","@lerna/validation-error":"3.13.0"}},"@lerna/child-process":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/child-process/-/child-process-3.16.5.tgz","integrity":"sha512-vdcI7mzei9ERRV4oO8Y1LHBZ3A5+ampRKg1wq5nutLsUA4mEBN6H7JqjWOMY9xZemv6+kATm2ofjJ3lW5TszQg==","dev":true,"requires":{"chalk":"^2.3.1","execa":"^1.0.0","strong-log-transformer":"^2.0.0"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@lerna/clean":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/clean/-/clean-3.21.0.tgz","integrity":"sha512-b/L9l+MDgE/7oGbrav6rG8RTQvRiZLO1zTcG17zgJAAuhlsPxJExMlh2DFwJEVi2les70vMhHfST3Ue1IMMjpg==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/prompt":"3.18.5","@lerna/pulse-till-done":"3.13.0","@lerna/rimraf-dir":"3.16.5","p-map":"^2.1.0","p-map-series":"^1.0.0","p-waterfall":"^1.0.0"}},"@lerna/cli":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/cli/-/cli-3.18.5.tgz","integrity":"sha512-erkbxkj9jfc89vVs/jBLY/fM0I80oLmJkFUV3Q3wk9J3miYhP14zgVEBsPZY68IZlEjT6T3Xlq2xO1AVaatHsA==","dev":true,"requires":{"@lerna/global-options":"3.13.0","dedent":"^0.7.0","npmlog":"^4.1.2","yargs":"^14.2.2"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"string-width":{"version":"3.1.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz","integrity":"sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==","dev":true,"requires":{"emoji-regex":"^7.0.1","is-fullwidth-code-point":"^2.0.0","strip-ansi":"^5.1.0"}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"}},"yargs":{"version":"14.2.3","resolved":"https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz","integrity":"sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==","dev":true,"requires":{"cliui":"^5.0.0","decamelize":"^1.2.0","find-up":"^3.0.0","get-caller-file":"^2.0.1","require-directory":"^2.1.1","require-main-filename":"^2.0.0","set-blocking":"^2.0.0","string-width":"^3.0.0","which-module":"^2.0.0","y18n":"^4.0.0","yargs-parser":"^15.0.1"}}}},"@lerna/collect-uncommitted":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-3.16.5.tgz","integrity":"sha512-ZgqnGwpDZiWyzIQVZtQaj9tRizsL4dUOhuOStWgTAw1EMe47cvAY2kL709DzxFhjr6JpJSjXV5rZEAeU3VE0Hg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","chalk":"^2.3.1","figgy-pudding":"^3.5.1","npmlog":"^4.1.2"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@lerna/collect-updates":{"version":"3.20.0","resolved":"https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-3.20.0.tgz","integrity":"sha512-qBTVT5g4fupVhBFuY4nI/3FSJtQVcDh7/gEPOpRxoXB/yCSnT38MFHXWl+y4einLciCjt/+0x6/4AG80fjay2Q==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/describe-ref":"3.16.5","minimatch":"^3.0.4","npmlog":"^4.1.2","slash":"^2.0.0"}},"@lerna/command":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/command/-/command-3.21.0.tgz","integrity":"sha512-T2bu6R8R3KkH5YoCKdutKv123iUgUbW8efVjdGCDnCMthAQzoentOJfDeodBwn0P2OqCl3ohsiNVtSn9h78fyQ==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/package-graph":"3.18.5","@lerna/project":"3.21.0","@lerna/validation-error":"3.13.0","@lerna/write-log-file":"3.13.0","clone-deep":"^4.0.1","dedent":"^0.7.0","execa":"^1.0.0","is-ci":"^2.0.0","npmlog":"^4.1.2"}},"@lerna/conventional-commits":{"version":"3.22.0","resolved":"https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-3.22.0.tgz","integrity":"sha512-z4ZZk1e8Mhz7+IS8NxHr64wyklHctCJyWpJKEZZPJiLFJ8yKto/x38O80R10pIzC0rr8Sy/OsjSH4bl0TbbgqA==","dev":true,"requires":{"@lerna/validation-error":"3.13.0","conventional-changelog-angular":"^5.0.3","conventional-changelog-core":"^3.1.6","conventional-recommended-bump":"^5.0.0","fs-extra":"^8.1.0","get-stream":"^4.0.0","lodash.template":"^4.5.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","pify":"^4.0.1","semver":"^6.2.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/create":{"version":"3.22.0","resolved":"https://registry.npmjs.org/@lerna/create/-/create-3.22.0.tgz","integrity":"sha512-MdiQQzCcB4E9fBF1TyMOaAEz9lUjIHp1Ju9H7f3lXze5JK6Fl5NYkouAvsLgY6YSIhXMY8AHW2zzXeBDY4yWkw==","dev":true,"requires":{"@evocateur/pacote":"^9.6.3","@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","@lerna/npm-conf":"3.16.0","@lerna/validation-error":"3.13.0","camelcase":"^5.0.0","dedent":"^0.7.0","fs-extra":"^8.1.0","globby":"^9.2.0","init-package-json":"^1.10.3","npm-package-arg":"^6.1.0","p-reduce":"^1.0.0","pify":"^4.0.1","semver":"^6.2.0","slash":"^2.0.0","validate-npm-package-license":"^3.0.3","validate-npm-package-name":"^3.0.0","whatwg-url":"^7.0.0"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/create-symlink":{"version":"3.16.2","resolved":"https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-3.16.2.tgz","integrity":"sha512-pzXIJp6av15P325sgiIRpsPXLFmkisLhMBCy4764d+7yjf2bzrJ4gkWVMhsv4AdF0NN3OyZ5jjzzTtLNqfR+Jw==","dev":true,"requires":{"@zkochan/cmd-shim":"^3.1.0","fs-extra":"^8.1.0","npmlog":"^4.1.2"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/describe-ref":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-3.16.5.tgz","integrity":"sha512-c01+4gUF0saOOtDBzbLMFOTJDHTKbDFNErEY6q6i9QaXuzy9LNN62z+Hw4acAAZuJQhrVWncVathcmkkjvSVGw==","dev":true,"requires":{"@lerna/child-process":"3.16.5","npmlog":"^4.1.2"}},"@lerna/diff":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/diff/-/diff-3.21.0.tgz","integrity":"sha512-5viTR33QV3S7O+bjruo1SaR40m7F2aUHJaDAC7fL9Ca6xji+aw1KFkpCtVlISS0G8vikUREGMJh+c/VMSc8Usw==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","@lerna/validation-error":"3.13.0","npmlog":"^4.1.2"}},"@lerna/exec":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/exec/-/exec-3.21.0.tgz","integrity":"sha512-iLvDBrIE6rpdd4GIKTY9mkXyhwsJ2RvQdB9ZU+/NhR3okXfqKc6py/24tV111jqpXTtZUW6HNydT4dMao2hi1Q==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/profiler":"3.20.0","@lerna/run-topologically":"3.18.5","@lerna/validation-error":"3.13.0","p-map":"^2.1.0"}},"@lerna/filter-options":{"version":"3.20.0","resolved":"https://registry.npmjs.org/@lerna/filter-options/-/filter-options-3.20.0.tgz","integrity":"sha512-bmcHtvxn7SIl/R9gpiNMVG7yjx7WyT0HSGw34YVZ9B+3xF/83N3r5Rgtjh4hheLZ+Q91Or0Jyu5O3Nr+AwZe2g==","dev":true,"requires":{"@lerna/collect-updates":"3.20.0","@lerna/filter-packages":"3.18.0","dedent":"^0.7.0","figgy-pudding":"^3.5.1","npmlog":"^4.1.2"}},"@lerna/filter-packages":{"version":"3.18.0","resolved":"https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-3.18.0.tgz","integrity":"sha512-6/0pMM04bCHNATIOkouuYmPg6KH3VkPCIgTfQmdkPJTullERyEQfNUKikrefjxo1vHOoCACDpy65JYyKiAbdwQ==","dev":true,"requires":{"@lerna/validation-error":"3.13.0","multimatch":"^3.0.0","npmlog":"^4.1.2"}},"@lerna/get-npm-exec-opts":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.13.0.tgz","integrity":"sha512-Y0xWL0rg3boVyJk6An/vurKzubyJKtrxYv2sj4bB8Mc5zZ3tqtv0ccbOkmkXKqbzvNNF7VeUt1OJ3DRgtC/QZw==","dev":true,"requires":{"npmlog":"^4.1.2"}},"@lerna/get-packed":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/get-packed/-/get-packed-3.16.0.tgz","integrity":"sha512-AjsFiaJzo1GCPnJUJZiTW6J1EihrPkc2y3nMu6m3uWFxoleklsSCyImumzVZJssxMi3CPpztj8LmADLedl9kXw==","dev":true,"requires":{"fs-extra":"^8.1.0","ssri":"^6.0.1","tar":"^4.4.8"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/github-client":{"version":"3.22.0","resolved":"https://registry.npmjs.org/@lerna/github-client/-/github-client-3.22.0.tgz","integrity":"sha512-O/GwPW+Gzr3Eb5bk+nTzTJ3uv+jh5jGho9BOqKlajXaOkMYGBELEAqV5+uARNGWZFvYAiF4PgqHb6aCUu7XdXg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@octokit/plugin-enterprise-rest":"^6.0.1","@octokit/rest":"^16.28.4","git-url-parse":"^11.1.2","npmlog":"^4.1.2"}},"@lerna/gitlab-client":{"version":"3.15.0","resolved":"https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-3.15.0.tgz","integrity":"sha512-OsBvRSejHXUBMgwWQqNoioB8sgzL/Pf1pOUhHKtkiMl6aAWjklaaq5HPMvTIsZPfS6DJ9L5OK2GGZuooP/5c8Q==","dev":true,"requires":{"node-fetch":"^2.5.0","npmlog":"^4.1.2","whatwg-url":"^7.0.0"}},"@lerna/global-options":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/global-options/-/global-options-3.13.0.tgz","integrity":"sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ==","dev":true},"@lerna/has-npm-version":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-3.16.5.tgz","integrity":"sha512-WL7LycR9bkftyqbYop5rEGJ9sRFIV55tSGmbN1HLrF9idwOCD7CLrT64t235t3t4O5gehDnwKI5h2U3oxTrF8Q==","dev":true,"requires":{"@lerna/child-process":"3.16.5","semver":"^6.2.0"},"dependencies":{"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/import":{"version":"3.22.0","resolved":"https://registry.npmjs.org/@lerna/import/-/import-3.22.0.tgz","integrity":"sha512-uWOlexasM5XR6tXi4YehODtH9Y3OZrFht3mGUFFT3OIl2s+V85xIGFfqFGMTipMPAGb2oF1UBLL48kR43hRsOg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","@lerna/prompt":"3.18.5","@lerna/pulse-till-done":"3.13.0","@lerna/validation-error":"3.13.0","dedent":"^0.7.0","fs-extra":"^8.1.0","p-map-series":"^1.0.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/info":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/info/-/info-3.21.0.tgz","integrity":"sha512-0XDqGYVBgWxUquFaIptW2bYSIu6jOs1BtkvRTWDDhw4zyEdp6q4eaMvqdSap1CG+7wM5jeLCi6z94wS0AuiuwA==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/output":"3.13.0","envinfo":"^7.3.1"}},"@lerna/init":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/init/-/init-3.21.0.tgz","integrity":"sha512-6CM0z+EFUkFfurwdJCR+LQQF6MqHbYDCBPyhu/d086LRf58GtYZYj49J8mKG9ktayp/TOIxL/pKKjgLD8QBPOg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","fs-extra":"^8.1.0","p-map":"^2.1.0","write-json-file":"^3.2.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/link":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/link/-/link-3.21.0.tgz","integrity":"sha512-tGu9GxrX7Ivs+Wl3w1+jrLi1nQ36kNI32dcOssij6bg0oZ2M2MDEFI9UF2gmoypTaN9uO5TSsjCFS7aR79HbdQ==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/package-graph":"3.18.5","@lerna/symlink-dependencies":"3.17.0","p-map":"^2.1.0","slash":"^2.0.0"}},"@lerna/list":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/list/-/list-3.21.0.tgz","integrity":"sha512-KehRjE83B1VaAbRRkRy6jLX1Cin8ltsrQ7FHf2bhwhRHK0S54YuA6LOoBnY/NtA8bHDX/Z+G5sMY78X30NS9tg==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/listable":"3.18.5","@lerna/output":"3.13.0"}},"@lerna/listable":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/listable/-/listable-3.18.5.tgz","integrity":"sha512-Sdr3pVyaEv5A7ZkGGYR7zN+tTl2iDcinryBPvtuv20VJrXBE8wYcOks1edBTcOWsPjCE/rMP4bo1pseyk3UTsg==","dev":true,"requires":{"@lerna/query-graph":"3.18.5","chalk":"^2.3.1","columnify":"^1.5.4"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@lerna/log-packed":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/log-packed/-/log-packed-3.16.0.tgz","integrity":"sha512-Fp+McSNBV/P2mnLUYTaSlG8GSmpXM7krKWcllqElGxvAqv6chk2K3c2k80MeVB4WvJ9tRjUUf+i7HUTiQ9/ckQ==","dev":true,"requires":{"byte-size":"^5.0.1","columnify":"^1.5.4","has-unicode":"^2.0.1","npmlog":"^4.1.2"}},"@lerna/npm-conf":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-3.16.0.tgz","integrity":"sha512-HbO3DUrTkCAn2iQ9+FF/eisDpWY5POQAOF1m7q//CZjdC2HSW3UYbKEGsSisFxSfaF9Z4jtrV+F/wX6qWs3CuA==","dev":true,"requires":{"config-chain":"^1.1.11","pify":"^4.0.1"}},"@lerna/npm-dist-tag":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-3.18.5.tgz","integrity":"sha512-xw0HDoIG6HreVsJND9/dGls1c+lf6vhu7yJoo56Sz5bvncTloYGLUppIfDHQr4ZvmPCK8rsh0euCVh2giPxzKQ==","dev":true,"requires":{"@evocateur/npm-registry-fetch":"^4.0.0","@lerna/otplease":"3.18.5","figgy-pudding":"^3.5.1","npm-package-arg":"^6.1.0","npmlog":"^4.1.2"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@lerna/npm-install":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/npm-install/-/npm-install-3.16.5.tgz","integrity":"sha512-hfiKk8Eku6rB9uApqsalHHTHY+mOrrHeWEs+gtg7+meQZMTS3kzv4oVp5cBZigndQr3knTLjwthT/FX4KvseFg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/get-npm-exec-opts":"3.13.0","fs-extra":"^8.1.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","signal-exit":"^3.0.2","write-pkg":"^3.1.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/npm-publish":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-3.18.5.tgz","integrity":"sha512-3etLT9+2L8JAx5F8uf7qp6iAtOLSMj+ZYWY6oUgozPi/uLqU0/gsMsEXh3F0+YVW33q0M61RpduBoAlOOZnaTg==","dev":true,"requires":{"@evocateur/libnpmpublish":"^1.2.2","@lerna/otplease":"3.18.5","@lerna/run-lifecycle":"3.16.2","figgy-pudding":"^3.5.1","fs-extra":"^8.1.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","pify":"^4.0.1","read-package-json":"^2.0.13"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/npm-run-script":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-3.16.5.tgz","integrity":"sha512-1asRi+LjmVn3pMjEdpqKJZFT/3ZNpb+VVeJMwrJaV/3DivdNg7XlPK9LTrORuKU4PSvhdEZvJmSlxCKyDpiXsQ==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/get-npm-exec-opts":"3.13.0","npmlog":"^4.1.2"}},"@lerna/otplease":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/otplease/-/otplease-3.18.5.tgz","integrity":"sha512-S+SldXAbcXTEDhzdxYLU0ZBKuYyURP/ND2/dK6IpKgLxQYh/z4ScljPDMyKymmEvgiEJmBsPZAAPfmNPEzxjog==","dev":true,"requires":{"@lerna/prompt":"3.18.5","figgy-pudding":"^3.5.1"}},"@lerna/output":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/output/-/output-3.13.0.tgz","integrity":"sha512-7ZnQ9nvUDu/WD+bNsypmPG5MwZBwu86iRoiW6C1WBuXXDxM5cnIAC1m2WxHeFnjyMrYlRXM9PzOQ9VDD+C15Rg==","dev":true,"requires":{"npmlog":"^4.1.2"}},"@lerna/pack-directory":{"version":"3.16.4","resolved":"https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-3.16.4.tgz","integrity":"sha512-uxSF0HZeGyKaaVHz5FroDY9A5NDDiCibrbYR6+khmrhZtY0Bgn6hWq8Gswl9iIlymA+VzCbshWIMX4o2O8C8ng==","dev":true,"requires":{"@lerna/get-packed":"3.16.0","@lerna/package":"3.16.0","@lerna/run-lifecycle":"3.16.2","figgy-pudding":"^3.5.1","npm-packlist":"^1.4.4","npmlog":"^4.1.2","tar":"^4.4.10","temp-write":"^3.4.0"}},"@lerna/package":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/package/-/package-3.16.0.tgz","integrity":"sha512-2lHBWpaxcBoiNVbtyLtPUuTYEaB/Z+eEqRS9duxpZs6D+mTTZMNy6/5vpEVSCBmzvdYpyqhqaYjjSLvjjr5Riw==","dev":true,"requires":{"load-json-file":"^5.3.0","npm-package-arg":"^6.1.0","write-pkg":"^3.1.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@lerna/package-graph":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/package-graph/-/package-graph-3.18.5.tgz","integrity":"sha512-8QDrR9T+dBegjeLr+n9WZTVxUYUhIUjUgZ0gvNxUBN8S1WB9r6H5Yk56/MVaB64tA3oGAN9IIxX6w0WvTfFudA==","dev":true,"requires":{"@lerna/prerelease-id-from-version":"3.16.0","@lerna/validation-error":"3.13.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","semver":"^6.2.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/prerelease-id-from-version":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.16.0.tgz","integrity":"sha512-qZyeUyrE59uOK8rKdGn7jQz+9uOpAaF/3hbslJVFL1NqF9ELDTqjCPXivuejMX/lN4OgD6BugTO4cR7UTq/sZA==","dev":true,"requires":{"semver":"^6.2.0"},"dependencies":{"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/profiler":{"version":"3.20.0","resolved":"https://registry.npmjs.org/@lerna/profiler/-/profiler-3.20.0.tgz","integrity":"sha512-bh8hKxAlm6yu8WEOvbLENm42i2v9SsR4WbrCWSbsmOElx3foRnMlYk7NkGECa+U5c3K4C6GeBbwgqs54PP7Ljg==","dev":true,"requires":{"figgy-pudding":"^3.5.1","fs-extra":"^8.1.0","npmlog":"^4.1.2","upath":"^1.2.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/project":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/project/-/project-3.21.0.tgz","integrity":"sha512-xT1mrpET2BF11CY32uypV2GPtPVm6Hgtha7D81GQP9iAitk9EccrdNjYGt5UBYASl4CIDXBRxwmTTVGfrCx82A==","dev":true,"requires":{"@lerna/package":"3.16.0","@lerna/validation-error":"3.13.0","cosmiconfig":"^5.1.0","dedent":"^0.7.0","dot-prop":"^4.2.0","glob-parent":"^5.0.0","globby":"^9.2.0","load-json-file":"^5.3.0","npmlog":"^4.1.2","p-map":"^2.1.0","resolve-from":"^4.0.0","write-json-file":"^3.2.0"}},"@lerna/prompt":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/prompt/-/prompt-3.18.5.tgz","integrity":"sha512-rkKj4nm1twSbBEb69+Em/2jAERK8htUuV8/xSjN0NPC+6UjzAwY52/x9n5cfmpa9lyKf/uItp7chCI7eDmNTKQ==","dev":true,"requires":{"inquirer":"^6.2.0","npmlog":"^4.1.2"}},"@lerna/publish":{"version":"3.22.1","resolved":"https://registry.npmjs.org/@lerna/publish/-/publish-3.22.1.tgz","integrity":"sha512-PG9CM9HUYDreb1FbJwFg90TCBQooGjj+n/pb3gw/eH5mEDq0p8wKdLFe0qkiqUkm/Ub5C8DbVFertIo0Vd0zcw==","dev":true,"requires":{"@evocateur/libnpmaccess":"^3.1.2","@evocateur/npm-registry-fetch":"^4.0.0","@evocateur/pacote":"^9.6.3","@lerna/check-working-tree":"3.16.5","@lerna/child-process":"3.16.5","@lerna/collect-updates":"3.20.0","@lerna/command":"3.21.0","@lerna/describe-ref":"3.16.5","@lerna/log-packed":"3.16.0","@lerna/npm-conf":"3.16.0","@lerna/npm-dist-tag":"3.18.5","@lerna/npm-publish":"3.18.5","@lerna/otplease":"3.18.5","@lerna/output":"3.13.0","@lerna/pack-directory":"3.16.4","@lerna/prerelease-id-from-version":"3.16.0","@lerna/prompt":"3.18.5","@lerna/pulse-till-done":"3.13.0","@lerna/run-lifecycle":"3.16.2","@lerna/run-topologically":"3.18.5","@lerna/validation-error":"3.13.0","@lerna/version":"3.22.1","figgy-pudding":"^3.5.1","fs-extra":"^8.1.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","p-finally":"^1.0.0","p-map":"^2.1.0","p-pipe":"^1.2.0","semver":"^6.2.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/pulse-till-done":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-3.13.0.tgz","integrity":"sha512-1SOHpy7ZNTPulzIbargrgaJX387csN7cF1cLOGZiJQA6VqnS5eWs2CIrG8i8wmaUavj2QlQ5oEbRMVVXSsGrzA==","dev":true,"requires":{"npmlog":"^4.1.2"}},"@lerna/query-graph":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/query-graph/-/query-graph-3.18.5.tgz","integrity":"sha512-50Lf4uuMpMWvJ306be3oQDHrWV42nai9gbIVByPBYJuVW8dT8O8pA3EzitNYBUdLL9/qEVbrR0ry1HD7EXwtRA==","dev":true,"requires":{"@lerna/package-graph":"3.18.5","figgy-pudding":"^3.5.1"}},"@lerna/resolve-symlink":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-3.16.0.tgz","integrity":"sha512-Ibj5e7njVHNJ/NOqT4HlEgPFPtPLWsO7iu59AM5bJDcAJcR96mLZ7KGVIsS2tvaO7akMEJvt2P+ErwCdloG3jQ==","dev":true,"requires":{"fs-extra":"^8.1.0","npmlog":"^4.1.2","read-cmd-shim":"^1.0.1"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/rimraf-dir":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-3.16.5.tgz","integrity":"sha512-bQlKmO0pXUsXoF8lOLknhyQjOZsCc0bosQDoX4lujBXSWxHVTg1VxURtWf2lUjz/ACsJVDfvHZbDm8kyBk5okA==","dev":true,"requires":{"@lerna/child-process":"3.16.5","npmlog":"^4.1.2","path-exists":"^3.0.0","rimraf":"^2.6.2"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}}}},"@lerna/run":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/run/-/run-3.21.0.tgz","integrity":"sha512-fJF68rT3veh+hkToFsBmUJ9MHc9yGXA7LSDvhziAojzOb0AI/jBDp6cEcDQyJ7dbnplba2Lj02IH61QUf9oW0Q==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/npm-run-script":"3.16.5","@lerna/output":"3.13.0","@lerna/profiler":"3.20.0","@lerna/run-topologically":"3.18.5","@lerna/timer":"3.13.0","@lerna/validation-error":"3.13.0","p-map":"^2.1.0"}},"@lerna/run-lifecycle":{"version":"3.16.2","resolved":"https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-3.16.2.tgz","integrity":"sha512-RqFoznE8rDpyyF0rOJy3+KjZCeTkO8y/OB9orPauR7G2xQ7PTdCpgo7EO6ZNdz3Al+k1BydClZz/j78gNCmL2A==","dev":true,"requires":{"@lerna/npm-conf":"3.16.0","figgy-pudding":"^3.5.1","npm-lifecycle":"^3.1.2","npmlog":"^4.1.2"}},"@lerna/run-topologically":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-3.18.5.tgz","integrity":"sha512-6N1I+6wf4hLOnPW+XDZqwufyIQ6gqoPfHZFkfWlvTQ+Ue7CuF8qIVQ1Eddw5HKQMkxqN10thKOFfq/9NQZ4NUg==","dev":true,"requires":{"@lerna/query-graph":"3.18.5","figgy-pudding":"^3.5.1","p-queue":"^4.0.0"}},"@lerna/symlink-binary":{"version":"3.17.0","resolved":"https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-3.17.0.tgz","integrity":"sha512-RLpy9UY6+3nT5J+5jkM5MZyMmjNHxZIZvXLV+Q3MXrf7Eaa1hNqyynyj4RO95fxbS+EZc4XVSk25DGFQbcRNSQ==","dev":true,"requires":{"@lerna/create-symlink":"3.16.2","@lerna/package":"3.16.0","fs-extra":"^8.1.0","p-map":"^2.1.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/symlink-dependencies":{"version":"3.17.0","resolved":"https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-3.17.0.tgz","integrity":"sha512-KmjU5YT1bpt6coOmdFueTJ7DFJL4H1w5eF8yAQ2zsGNTtZ+i5SGFBWpb9AQaw168dydc3s4eu0W0Sirda+F59Q==","dev":true,"requires":{"@lerna/create-symlink":"3.16.2","@lerna/resolve-symlink":"3.16.0","@lerna/symlink-binary":"3.17.0","fs-extra":"^8.1.0","p-finally":"^1.0.0","p-map":"^2.1.0","p-map-series":"^1.0.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/timer":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/timer/-/timer-3.13.0.tgz","integrity":"sha512-RHWrDl8U4XNPqY5MQHkToWS9jHPnkLZEt5VD+uunCKTfzlxGnRCr3/zVr8VGy/uENMYpVP3wJa4RKGY6M0vkRw==","dev":true},"@lerna/validation-error":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/validation-error/-/validation-error-3.13.0.tgz","integrity":"sha512-SiJP75nwB8GhgwLKQfdkSnDufAaCbkZWJqEDlKOUPUvVOplRGnfL+BPQZH5nvq2BYSRXsksXWZ4UHVnQZI/HYA==","dev":true,"requires":{"npmlog":"^4.1.2"}},"@lerna/version":{"version":"3.22.1","resolved":"https://registry.npmjs.org/@lerna/version/-/version-3.22.1.tgz","integrity":"sha512-PSGt/K1hVqreAFoi3zjD0VEDupQ2WZVlVIwesrE5GbrL2BjXowjCsTDPqblahDUPy0hp6h7E2kG855yLTp62+g==","dev":true,"requires":{"@lerna/check-working-tree":"3.16.5","@lerna/child-process":"3.16.5","@lerna/collect-updates":"3.20.0","@lerna/command":"3.21.0","@lerna/conventional-commits":"3.22.0","@lerna/github-client":"3.22.0","@lerna/gitlab-client":"3.15.0","@lerna/output":"3.13.0","@lerna/prerelease-id-from-version":"3.16.0","@lerna/prompt":"3.18.5","@lerna/run-lifecycle":"3.16.2","@lerna/run-topologically":"3.18.5","@lerna/validation-error":"3.13.0","chalk":"^2.3.1","dedent":"^0.7.0","load-json-file":"^5.3.0","minimatch":"^3.0.4","npmlog":"^4.1.2","p-map":"^2.1.0","p-pipe":"^1.2.0","p-reduce":"^1.0.0","p-waterfall":"^1.0.0","semver":"^6.2.0","slash":"^2.0.0","temp-write":"^3.4.0","write-json-file":"^3.2.0"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@lerna/write-log-file":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-3.13.0.tgz","integrity":"sha512-RibeMnDPvlL8bFYW5C8cs4mbI3AHfQef73tnJCQ/SgrXZHehmHnsyWUiE7qDQCAo+B1RfTapvSyFF69iPj326A==","dev":true,"requires":{"npmlog":"^4.1.2","write-file-atomic":"^2.3.0"}},"@mrmlnc/readdir-enhanced":{"version":"2.2.1","resolved":"https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz","integrity":"sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==","dev":true,"requires":{"call-me-maybe":"^1.0.1","glob-to-regexp":"^0.3.0"}},"@nodelib/fs.scandir":{"version":"2.1.3","resolved":"https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz","integrity":"sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==","dev":true,"requires":{"@nodelib/fs.stat":"2.0.3","run-parallel":"^1.1.9"},"dependencies":{"@nodelib/fs.stat":{"version":"2.0.3","resolved":"https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz","integrity":"sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==","dev":true}}},"@nodelib/fs.stat":{"version":"1.1.3","resolved":"https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz","integrity":"sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==","dev":true},"@nodelib/fs.walk":{"version":"1.2.4","resolved":"https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz","integrity":"sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==","dev":true,"requires":{"@nodelib/fs.scandir":"2.1.3","fastq":"^1.6.0"}},"@octokit/auth-token":{"version":"2.4.2","resolved":"https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz","integrity":"sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==","dev":true,"requires":{"@octokit/types":"^5.0.0"}},"@octokit/endpoint":{"version":"6.0.6","resolved":"https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.6.tgz","integrity":"sha512-7Cc8olaCoL/mtquB7j/HTbPM+sY6Ebr4k2X2y4JoXpVKQ7r5xB4iGQE0IoO58wIPsUk4AzoT65AMEpymSbWTgQ==","dev":true,"requires":{"@octokit/types":"^5.0.0","is-plain-object":"^5.0.0","universal-user-agent":"^6.0.0"},"dependencies":{"is-plain-object":{"version":"5.0.0","resolved":"https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz","integrity":"sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==","dev":true},"universal-user-agent":{"version":"6.0.0","resolved":"https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz","integrity":"sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==","dev":true}}},"@octokit/plugin-enterprise-rest":{"version":"6.0.1","resolved":"https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz","integrity":"sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw==","dev":true},"@octokit/plugin-paginate-rest":{"version":"1.1.2","resolved":"https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz","integrity":"sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==","dev":true,"requires":{"@octokit/types":"^2.0.1"},"dependencies":{"@octokit/types":{"version":"2.16.2","resolved":"https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz","integrity":"sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==","dev":true,"requires":{"@types/node":">= 8"}}}},"@octokit/plugin-request-log":{"version":"1.0.0","resolved":"https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz","integrity":"sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw==","dev":true},"@octokit/plugin-rest-endpoint-methods":{"version":"2.4.0","resolved":"https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz","integrity":"sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==","dev":true,"requires":{"@octokit/types":"^2.0.1","deprecation":"^2.3.1"},"dependencies":{"@octokit/types":{"version":"2.16.2","resolved":"https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz","integrity":"sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==","dev":true,"requires":{"@types/node":">= 8"}}}},"@octokit/request":{"version":"5.4.9","resolved":"https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz","integrity":"sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==","dev":true,"requires":{"@octokit/endpoint":"^6.0.1","@octokit/request-error":"^2.0.0","@octokit/types":"^5.0.0","deprecation":"^2.0.0","is-plain-object":"^5.0.0","node-fetch":"^2.6.1","once":"^1.4.0","universal-user-agent":"^6.0.0"},"dependencies":{"@octokit/request-error":{"version":"2.0.2","resolved":"https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz","integrity":"sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==","dev":true,"requires":{"@octokit/types":"^5.0.1","deprecation":"^2.0.0","once":"^1.4.0"}},"is-plain-object":{"version":"5.0.0","resolved":"https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz","integrity":"sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==","dev":true},"universal-user-agent":{"version":"6.0.0","resolved":"https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz","integrity":"sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==","dev":true}}},"@octokit/request-error":{"version":"1.2.1","resolved":"https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz","integrity":"sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==","dev":true,"requires":{"@octokit/types":"^2.0.0","deprecation":"^2.0.0","once":"^1.4.0"},"dependencies":{"@octokit/types":{"version":"2.16.2","resolved":"https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz","integrity":"sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==","dev":true,"requires":{"@types/node":">= 8"}}}},"@octokit/rest":{"version":"16.43.2","resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz","integrity":"sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ==","dev":true,"requires":{"@octokit/auth-token":"^2.4.0","@octokit/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"}},"@octokit/types":{"version":"5.5.0","resolved":"https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz","integrity":"sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==","dev":true,"requires":{"@types/node":">= 8"}},"@ts-morph/common":{"version":"0.5.2","resolved":"https://registry.npmjs.org/@ts-morph/common/-/common-0.5.2.tgz","integrity":"sha512-eLmfYV6u6gUgHrB9QV9lpuWg3cD60mhXdv0jvM5exWR/Cor8HG+GziFIj2hPEWHJknqzuU4meZd8DTqIzZfDRQ==","dev":true,"requires":{"@dsherret/to-absolute-glob":"^2.0.2","fast-glob":"^3.2.2","fs-extra":"^9.0.0","is-negated-glob":"^1.0.0","multimatch":"^4.0.0","typescript":"~3.9.7"},"dependencies":{"@nodelib/fs.stat":{"version":"2.0.3","resolved":"https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz","integrity":"sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==","dev":true},"array-differ":{"version":"3.0.0","resolved":"https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz","integrity":"sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==","dev":true},"array-union":{"version":"2.1.0","resolved":"https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz","integrity":"sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==","dev":true},"arrify":{"version":"2.0.1","resolved":"https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz","integrity":"sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==","dev":true},"braces":{"version":"3.0.2","resolved":"https://registry.npmjs.org/braces/-/braces-3.0.2.tgz","integrity":"sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==","dev":true,"requires":{"fill-range":"^7.0.1"}},"fast-glob":{"version":"3.2.4","resolved":"https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz","integrity":"sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==","dev":true,"requires":{"@nodelib/fs.stat":"^2.0.2","@nodelib/fs.walk":"^1.2.3","glob-parent":"^5.1.0","merge2":"^1.3.0","micromatch":"^4.0.2","picomatch":"^2.2.1"}},"fill-range":{"version":"7.0.1","resolved":"https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz","integrity":"sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==","dev":true,"requires":{"to-regex-range":"^5.0.1"}},"is-number":{"version":"7.0.0","resolved":"https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz","integrity":"sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==","dev":true},"micromatch":{"version":"4.0.2","resolved":"https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz","integrity":"sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==","dev":true,"requires":{"braces":"^3.0.1","picomatch":"^2.0.5"}},"multimatch":{"version":"4.0.0","resolved":"https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz","integrity":"sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==","dev":true,"requires":{"@types/minimatch":"^3.0.3","array-differ":"^3.0.0","array-union":"^2.1.0","arrify":"^2.0.1","minimatch":"^3.0.4"}},"to-regex-range":{"version":"5.0.1","resolved":"https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz","integrity":"sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==","dev":true,"requires":{"is-number":"^7.0.0"}},"typescript":{"version":"3.9.7","resolved":"https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz","integrity":"sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==","dev":true}}},"@types/bn.js":{"version":"4.11.6","resolved":"https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz","integrity":"sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==","requires":{"@types/node":"*"},"dependencies":{"@types/node":{"version":"14.11.2","resolved":"https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz","integrity":"sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA=="}}},"@types/cookiejar":{"version":"2.1.2","resolved":"https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz","integrity":"sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==","dev":true},"@types/events":{"version":"3.0.0","resolved":"https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz","integrity":"sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==","dev":true},"@types/fs-extra":{"version":"9.0.2","resolved":"https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.2.tgz","integrity":"sha512-jp0RI6xfZpi5JL8v7WQwpBEQTq63RqW2kxwTZt+m27LcJqQdPVU1yGnT1ZI4EtCDynQQJtIGyQahkiCGCS7e+A==","dev":true,"requires":{"@types/node":"*"}},"@types/glob":{"version":"7.1.3","resolved":"https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz","integrity":"sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==","dev":true,"requires":{"@types/minimatch":"*","@types/node":"*"}},"@types/lodash":{"version":"4.14.161","resolved":"https://registry.npmjs.org/@types/lodash/-/lodash-4.14.161.tgz","integrity":"sha512-EP6O3Jkr7bXvZZSZYlsgt5DIjiGr0dXP1/jVEwVLTFgg0d+3lWVQkRavYVQszV7dYUwvg0B8R0MBDpcmXg7XIA==","dev":true},"@types/lodash.clonedeep":{"version":"4.5.6","resolved":"https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz","integrity":"sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==","dev":true,"requires":{"@types/lodash":"*"}},"@types/minimatch":{"version":"3.0.3","resolved":"https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz","integrity":"sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==","dev":true},"@types/minimist":{"version":"1.2.0","resolved":"https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz","integrity":"sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=","dev":true},"@types/mocha":{"version":"8.0.3","resolved":"https://registry.npmjs.org/@types/mocha/-/mocha-8.0.3.tgz","integrity":"sha512-vyxR57nv8NfcU0GZu8EUXZLTbCMupIUwy95LJ6lllN+JRPG25CwMHoB1q5xKh8YKhQnHYRAn4yW2yuHbf/5xgg==","dev":true},"@types/node":{"version":"14.14.2","resolved":"https://registry.npmjs.org/@types/node/-/node-14.14.2.tgz","integrity":"sha512-jeYJU2kl7hL9U5xuI/BhKPZ4vqGM/OmK6whiFAXVhlstzZhVamWhDSmHyGLIp+RVyuF9/d0dqr2P85aFj4BvJg==","dev":true},"@types/normalize-package-data":{"version":"2.4.0","resolved":"https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz","integrity":"sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==","dev":true},"@types/npm-package-arg":{"version":"6.1.0","resolved":"https://registry.npmjs.org/@types/npm-package-arg/-/npm-package-arg-6.1.0.tgz","integrity":"sha512-vbt5fb0y1svMhu++1lwtKmZL76d0uPChFlw7kEzyUmTwfmpHRcFb8i0R8ElT69q/L+QLgK2hgECivIAvaEDwag==","dev":true},"@types/parse-json":{"version":"4.0.0","resolved":"https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz","integrity":"sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==","dev":true},"@types/pbkdf2":{"version":"3.1.0","resolved":"https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz","integrity":"sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==","requires":{"@types/node":"*"},"dependencies":{"@types/node":{"version":"14.11.2","resolved":"https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz","integrity":"sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA=="}}},"@types/prettier":{"version":"2.1.5","resolved":"https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz","integrity":"sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==","dev":true},"@types/secp256k1":{"version":"4.0.1","resolved":"https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz","integrity":"sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==","requires":{"@types/node":"*"},"dependencies":{"@types/node":{"version":"14.11.2","resolved":"https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz","integrity":"sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA=="}}},"@types/seedrandom":{"version":"2.4.28","resolved":"https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz","integrity":"sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==","dev":true},"@types/superagent":{"version":"4.1.10","resolved":"https://registry.npmjs.org/@types/superagent/-/superagent-4.1.10.tgz","integrity":"sha512-xAgkb2CMWUMCyVc/3+7iQfOEBE75NvuZeezvmixbUw3nmENf2tCnQkW5yQLTYqvXUQ+R6EXxdqKKbal2zM5V/g==","dev":true,"requires":{"@types/cookiejar":"*","@types/node":"*"}},"@types/uws":{"version":"0.13.2","resolved":"https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz","integrity":"sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==","dev":true,"requires":{"@types/events":"*","@types/node":"*"}},"@types/ws":{"version":"7.2.7","resolved":"https://registry.npmjs.org/@types/ws/-/ws-7.2.7.tgz","integrity":"sha512-UUFC/xxqFLP17hTva8/lVT0SybLUrfSD9c+iapKb0fEiC8uoDbA+xuZ3pAN603eW+bY8ebSMLm9jXdIPnD0ZgA==","dev":true,"requires":{"@types/node":"*"}},"@types/yargs":{"version":"15.0.9","resolved":"https://registry.npmjs.org/@types/yargs/-/yargs-15.0.9.tgz","integrity":"sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g==","dev":true,"requires":{"@types/yargs-parser":"*"}},"@types/yargs-parser":{"version":"15.0.0","resolved":"https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz","integrity":"sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==","dev":true},"@ungap/promise-all-settled":{"version":"1.1.2","resolved":"https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz","integrity":"sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==","dev":true},"@zkochan/cmd-shim":{"version":"3.1.0","resolved":"https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz","integrity":"sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg==","dev":true,"requires":{"is-windows":"^1.0.0","mkdirp-promise":"^5.0.1","mz":"^2.5.0"}},"JSONStream":{"version":"1.3.5","resolved":"https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz","integrity":"sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==","dev":true,"requires":{"jsonparse":"^1.2.0","through":">=2.2.7 <3"}},"abbrev":{"version":"1.1.1","resolved":"https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz","integrity":"sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==","dev":true},"abstract-leveldown":{"version":"2.6.3","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz","integrity":"sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==","requires":{"xtend":"~4.0.0"},"dependencies":{"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"agent-base":{"version":"4.3.0","resolved":"https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz","integrity":"sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==","dev":true,"requires":{"es6-promisify":"^5.0.0"}},"agentkeepalive":{"version":"3.5.2","resolved":"https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz","integrity":"sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==","dev":true,"requires":{"humanize-ms":"^1.2.1"}},"aggregate-error":{"version":"3.1.0","resolved":"https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz","integrity":"sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==","dev":true,"requires":{"clean-stack":"^2.0.0","indent-string":"^4.0.0"}},"ajv":{"version":"6.12.5","resolved":"https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz","integrity":"sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==","dev":true,"requires":{"fast-deep-equal":"^3.1.1","fast-json-stable-stringify":"^2.0.0","json-schema-traverse":"^0.4.1","uri-js":"^4.2.2"}},"ansi-colors":{"version":"4.1.1","resolved":"https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz","integrity":"sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==","dev":true},"ansi-escapes":{"version":"3.2.0","resolved":"https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz","integrity":"sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==","dev":true},"ansi-regex":{"version":"2.1.1","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz","integrity":"sha1-w7M6te42DYbg5ijwRorn7yfWVN8=","dev":true},"ansi-styles":{"version":"3.2.1","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz","integrity":"sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==","dev":true,"requires":{"color-convert":"^1.9.0"}},"any-promise":{"version":"1.3.0","resolved":"https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz","integrity":"sha1-q8av7tzqUugJzcA3au0845Y10X8=","dev":true},"anymatch":{"version":"3.1.1","resolved":"https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz","integrity":"sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==","dev":true,"requires":{"normalize-path":"^3.0.0","picomatch":"^2.0.4"}},"append-transform":{"version":"2.0.0","resolved":"https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz","integrity":"sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==","dev":true,"requires":{"default-require-extensions":"^3.0.0"}},"aproba":{"version":"1.2.0","resolved":"https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz","integrity":"sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==","dev":true},"archy":{"version":"1.0.0","resolved":"https://registry.npmjs.org/archy/-/archy-1.0.0.tgz","integrity":"sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=","dev":true},"are-we-there-yet":{"version":"1.1.5","resolved":"https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz","integrity":"sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==","dev":true,"requires":{"delegates":"^1.0.0","readable-stream":"^2.0.6"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"arg":{"version":"4.1.3","resolved":"https://registry.npmjs.org/arg/-/arg-4.1.3.tgz","integrity":"sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==","dev":true},"argparse":{"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.2"}},"arr-diff":{"version":"4.0.0","resolved":"https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz","integrity":"sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=","dev":true},"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==","dev":true},"arr-union":{"version":"3.1.0","resolved":"https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz","integrity":"sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=","dev":true},"array-differ":{"version":"2.1.0","resolved":"https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz","integrity":"sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==","dev":true},"array-find-index":{"version":"1.0.2","resolved":"https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz","integrity":"sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=","dev":true},"array-ify":{"version":"1.0.0","resolved":"https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz","integrity":"sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=","dev":true},"array-union":{"version":"1.0.2","resolved":"https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz","integrity":"sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=","dev":true,"requires":{"array-uniq":"^1.0.1"}},"array-uniq":{"version":"1.0.3","resolved":"https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz","integrity":"sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=","dev":true},"array-unique":{"version":"0.3.2","resolved":"https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz","integrity":"sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=","dev":true},"arrify":{"version":"1.0.1","resolved":"https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz","integrity":"sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=","dev":true},"asap":{"version":"2.0.6","resolved":"https://registry.npmjs.org/asap/-/asap-2.0.6.tgz","integrity":"sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=","dev":true},"asn1":{"version":"0.2.4","resolved":"https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz","integrity":"sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==","dev":true,"requires":{"safer-buffer":"~2.1.0"}},"assert-plus":{"version":"1.0.0","resolved":"https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz","integrity":"sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=","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=","dev":true},"async":{"version":"2.6.3","resolved":"https://registry.npmjs.org/async/-/async-2.6.3.tgz","integrity":"sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==","requires":{"lodash":"^4.17.14"}},"async-eventemitter":{"version":"0.2.4","resolved":"https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz","integrity":"sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==","requires":{"async":"^2.4.0"}},"asynckit":{"version":"0.4.0","resolved":"https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz","integrity":"sha1-x57Zf380y48robyXkLzDZkdLS3k=","dev":true},"at-least-node":{"version":"1.0.0","resolved":"https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz","integrity":"sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==","dev":true},"atob":{"version":"2.1.2","resolved":"https://registry.npmjs.org/atob/-/atob-2.1.2.tgz","integrity":"sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==","dev":true},"atob-lite":{"version":"2.0.0","resolved":"https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz","integrity":"sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=","dev":true},"aws-sign2":{"version":"0.7.0","resolved":"https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz","integrity":"sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=","dev":true},"aws4":{"version":"1.10.1","resolved":"https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz","integrity":"sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==","dev":true},"balanced-match":{"version":"1.0.0","resolved":"https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz","integrity":"sha1-ibTRmasr7kneFk6gK4nORi1xt2c="},"base":{"version":"0.11.2","resolved":"https://registry.npmjs.org/base/-/base-0.11.2.tgz","integrity":"sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==","dev":true,"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=","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"requires":{"is-accessor-descriptor":"^1.0.0","is-data-descriptor":"^1.0.0","kind-of":"^6.0.2"}}}},"base-x":{"version":"3.0.8","resolved":"https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz","integrity":"sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==","requires":{"safe-buffer":"^5.0.1"}},"base64-js":{"version":"1.3.1","resolved":"https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz","integrity":"sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g=="},"bcrypt-pbkdf":{"version":"1.0.2","resolved":"https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz","integrity":"sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=","dev":true,"requires":{"tweetnacl":"^0.14.3"}},"before-after-hook":{"version":"2.1.0","resolved":"https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz","integrity":"sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==","dev":true},"bigint-buffer":{"version":"1.1.5","resolved":"https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz","integrity":"sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==","optional":true,"requires":{"bindings":"^1.3.0"}},"binary-extensions":{"version":"2.1.0","resolved":"https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz","integrity":"sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==","dev":true},"bindings":{"version":"1.5.0","resolved":"https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz","integrity":"sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==","optional":true,"requires":{"file-uri-to-path":"1.0.0"}},"bip39":{"version":"3.0.2","resolved":"https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz","integrity":"sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==","requires":{"@types/node":"11.11.6","create-hash":"^1.1.0","pbkdf2":"^3.0.9","randombytes":"^2.0.1"},"dependencies":{"@types/node":{"version":"11.11.6","resolved":"https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz","integrity":"sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ=="}}},"blakejs":{"version":"1.1.0","resolved":"https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz","integrity":"sha1-ad+S75U6qIylGjLfarHFShVfx6U="},"bluebird":{"version":"3.7.2","resolved":"https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz","integrity":"sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==","dev":true},"bn.js":{"version":"4.11.9","resolved":"https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz","integrity":"sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw=="},"brace-expansion":{"version":"1.1.11","resolved":"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz","integrity":"sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==","requires":{"balanced-match":"^1.0.0","concat-map":"0.0.1"}},"braces":{"version":"2.3.2","resolved":"https://registry.npmjs.org/braces/-/braces-2.3.2.tgz","integrity":"sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==","dev":true,"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"brorand":{"version":"1.1.0","resolved":"https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz","integrity":"sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8="},"browser-stdout":{"version":"1.3.1","resolved":"https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz","integrity":"sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==","dev":true},"browserify-aes":{"version":"1.2.0","resolved":"https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz","integrity":"sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==","requires":{"buffer-xor":"^1.0.3","cipher-base":"^1.0.0","create-hash":"^1.1.0","evp_bytestokey":"^1.0.3","inherits":"^2.0.1","safe-buffer":"^5.0.1"}},"bs58":{"version":"4.0.1","resolved":"https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz","integrity":"sha1-vhYedsNU9veIrkBx9j806MTwpCo=","requires":{"base-x":"^3.0.2"}},"bs58check":{"version":"2.1.2","resolved":"https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz","integrity":"sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==","requires":{"bs58":"^4.0.0","create-hash":"^1.1.0","safe-buffer":"^5.1.2"}},"btoa-lite":{"version":"1.0.0","resolved":"https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz","integrity":"sha1-M3dm2hWAEhD92VbCLpxokaudAzc=","dev":true},"buffer":{"version":"5.6.0","resolved":"https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz","integrity":"sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==","requires":{"base64-js":"^1.0.2","ieee754":"^1.1.4"}},"buffer-from":{"version":"1.1.1","resolved":"https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz","integrity":"sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==","dev":true},"buffer-xor":{"version":"1.0.3","resolved":"https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz","integrity":"sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk="},"builtins":{"version":"1.0.3","resolved":"https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz","integrity":"sha1-y5T662HIaWRR2zZTThQi+U8K7og=","dev":true},"byline":{"version":"5.0.0","resolved":"https://registry.npmjs.org/byline/-/byline-5.0.0.tgz","integrity":"sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=","dev":true},"byte-size":{"version":"5.0.1","resolved":"https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz","integrity":"sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw==","dev":true},"cacache":{"version":"12.0.4","resolved":"https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz","integrity":"sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==","dev":true,"requires":{"bluebird":"^3.5.5","chownr":"^1.1.1","figgy-pudding":"^3.5.1","glob":"^7.1.4","graceful-fs":"^4.1.15","infer-owner":"^1.0.3","lru-cache":"^5.1.1","mississippi":"^3.0.0","mkdirp":"^0.5.1","move-concurrently":"^1.0.1","promise-inflight":"^1.0.1","rimraf":"^2.6.3","ssri":"^6.0.1","unique-filename":"^1.1.1","y18n":"^4.0.0"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}}}},"cache-base":{"version":"1.0.1","resolved":"https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz","integrity":"sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==","dev":true,"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"}},"caching-transform":{"version":"4.0.0","resolved":"https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz","integrity":"sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==","dev":true,"requires":{"hasha":"^5.0.0","make-dir":"^3.0.0","package-hash":"^4.0.0","write-file-atomic":"^3.0.0"},"dependencies":{"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"write-file-atomic":{"version":"3.0.3","resolved":"https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz","integrity":"sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==","dev":true,"requires":{"imurmurhash":"^0.1.4","is-typedarray":"^1.0.0","signal-exit":"^3.0.2","typedarray-to-buffer":"^3.1.5"}}}},"call-me-maybe":{"version":"1.0.1","resolved":"https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz","integrity":"sha1-JtII6onje1y95gJQoV8DHBak1ms=","dev":true},"caller-callsite":{"version":"2.0.0","resolved":"https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz","integrity":"sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=","dev":true,"requires":{"callsites":"^2.0.0"}},"caller-path":{"version":"2.0.0","resolved":"https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz","integrity":"sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=","dev":true,"requires":{"caller-callsite":"^2.0.0"}},"callsites":{"version":"2.0.0","resolved":"https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz","integrity":"sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=","dev":true},"camelcase":{"version":"6.1.0","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz","integrity":"sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==","dev":true},"camelcase-keys":{"version":"6.2.2","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz","integrity":"sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==","dev":true,"requires":{"camelcase":"^5.3.1","map-obj":"^4.0.0","quick-lru":"^4.0.1"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true}}},"caseless":{"version":"0.12.0","resolved":"https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz","integrity":"sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=","dev":true},"chalk":{"version":"4.1.0","resolved":"https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz","integrity":"sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==","dev":true,"requires":{"ansi-styles":"^4.1.0","supports-color":"^7.1.0"},"dependencies":{"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true}}},"chardet":{"version":"0.7.0","resolved":"https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz","integrity":"sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==","dev":true},"checkpoint-store":{"version":"1.1.0","resolved":"https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz","integrity":"sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=","requires":{"functional-red-black-tree":"^1.0.1"}},"chokidar":{"version":"3.4.3","resolved":"https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz","integrity":"sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==","dev":true,"requires":{"anymatch":"~3.1.1","braces":"~3.0.2","fsevents":"~2.1.2","glob-parent":"~5.1.0","is-binary-path":"~2.1.0","is-glob":"~4.0.1","normalize-path":"~3.0.0","readdirp":"~3.5.0"},"dependencies":{"braces":{"version":"3.0.2","resolved":"https://registry.npmjs.org/braces/-/braces-3.0.2.tgz","integrity":"sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==","dev":true,"requires":{"fill-range":"^7.0.1"}},"fill-range":{"version":"7.0.1","resolved":"https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz","integrity":"sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==","dev":true,"requires":{"to-regex-range":"^5.0.1"}},"is-number":{"version":"7.0.0","resolved":"https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz","integrity":"sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==","dev":true},"to-regex-range":{"version":"5.0.1","resolved":"https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz","integrity":"sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==","dev":true,"requires":{"is-number":"^7.0.0"}}}},"chownr":{"version":"1.1.4","resolved":"https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz","integrity":"sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==","dev":true},"ci-info":{"version":"2.0.0","resolved":"https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz","integrity":"sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==","dev":true},"cipher-base":{"version":"1.0.4","resolved":"https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz","integrity":"sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==","requires":{"inherits":"^2.0.1","safe-buffer":"^5.0.1"}},"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==","dev":true,"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=","dev":true,"requires":{"is-descriptor":"^0.1.0"}}}},"clean-stack":{"version":"2.2.0","resolved":"https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz","integrity":"sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==","dev":true},"cli-cursor":{"version":"2.1.0","resolved":"https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz","integrity":"sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=","dev":true,"requires":{"restore-cursor":"^2.0.0"}},"cli-highlight":{"version":"2.1.4","resolved":"https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.4.tgz","integrity":"sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ==","dev":true,"requires":{"chalk":"^3.0.0","highlight.js":"^9.6.0","mz":"^2.4.0","parse5":"^5.1.1","parse5-htmlparser2-tree-adapter":"^5.1.1","yargs":"^15.0.0"},"dependencies":{"ansi-regex":{"version":"5.0.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz","integrity":"sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==","dev":true},"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"chalk":{"version":"3.0.0","resolved":"https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz","integrity":"sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==","dev":true,"requires":{"ansi-styles":"^4.1.0","supports-color":"^7.1.0"}},"cliui":{"version":"6.0.0","resolved":"https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz","integrity":"sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==","dev":true,"requires":{"string-width":"^4.2.0","strip-ansi":"^6.0.0","wrap-ansi":"^6.2.0"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true},"emoji-regex":{"version":"8.0.0","resolved":"https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz","integrity":"sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==","dev":true},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"is-fullwidth-code-point":{"version":"3.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz","integrity":"sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==","dev":true},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"string-width":{"version":"4.2.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz","integrity":"sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==","dev":true,"requires":{"emoji-regex":"^8.0.0","is-fullwidth-code-point":"^3.0.0","strip-ansi":"^6.0.0"}},"strip-ansi":{"version":"6.0.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz","integrity":"sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==","dev":true,"requires":{"ansi-regex":"^5.0.0"}},"wrap-ansi":{"version":"6.2.0","resolved":"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz","integrity":"sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==","dev":true,"requires":{"ansi-styles":"^4.0.0","string-width":"^4.1.0","strip-ansi":"^6.0.0"}},"yargs":{"version":"15.4.1","resolved":"https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz","integrity":"sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==","dev":true,"requires":{"cliui":"^6.0.0","decamelize":"^1.2.0","find-up":"^4.1.0","get-caller-file":"^2.0.1","require-directory":"^2.1.1","require-main-filename":"^2.0.0","set-blocking":"^2.0.0","string-width":"^4.2.0","which-module":"^2.0.0","y18n":"^4.0.0","yargs-parser":"^18.1.2"}},"yargs-parser":{"version":"18.1.3","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz","integrity":"sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"}}}},"cli-width":{"version":"2.2.1","resolved":"https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz","integrity":"sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==","dev":true},"cliui":{"version":"5.0.0","resolved":"https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz","integrity":"sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==","dev":true,"requires":{"string-width":"^3.1.0","strip-ansi":"^5.2.0","wrap-ansi":"^5.1.0"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"string-width":{"version":"3.1.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz","integrity":"sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==","dev":true,"requires":{"emoji-regex":"^7.0.1","is-fullwidth-code-point":"^2.0.0","strip-ansi":"^5.1.0"}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"}}}},"clone":{"version":"1.0.4","resolved":"https://registry.npmjs.org/clone/-/clone-1.0.4.tgz","integrity":"sha1-2jCcwmPfFZlMaIypAheco8fNfH4=","dev":true},"clone-deep":{"version":"4.0.1","resolved":"https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz","integrity":"sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==","dev":true,"requires":{"is-plain-object":"^2.0.4","kind-of":"^6.0.2","shallow-clone":"^3.0.0"}},"code-block-writer":{"version":"10.1.0","resolved":"https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.0.tgz","integrity":"sha512-RG9hpXtWFeUWhuUav1YuP/vGcyncW+t90yJLk9fNZs1De2OuHTHKAKThVCokt29PYq5RoJ0QSZaIZ+rvPO23hA==","dev":true},"code-point-at":{"version":"1.1.0","resolved":"https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz","integrity":"sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=","dev":true},"collection-visit":{"version":"1.0.0","resolved":"https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz","integrity":"sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=","dev":true,"requires":{"map-visit":"^1.0.0","object-visit":"^1.0.0"}},"color-convert":{"version":"1.9.3","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz","integrity":"sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==","dev":true,"requires":{"color-name":"1.1.3"}},"color-name":{"version":"1.1.3","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz","integrity":"sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=","dev":true},"columnify":{"version":"1.5.4","resolved":"https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz","integrity":"sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=","dev":true,"requires":{"strip-ansi":"^3.0.0","wcwidth":"^1.0.0"}},"combined-stream":{"version":"1.0.8","resolved":"https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz","integrity":"sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==","dev":true,"requires":{"delayed-stream":"~1.0.0"}},"command-exists":{"version":"1.2.9","resolved":"https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz","integrity":"sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==","dev":true},"commander":{"version":"3.0.2","resolved":"https://registry.npmjs.org/commander/-/commander-3.0.2.tgz","integrity":"sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==","dev":true},"commondir":{"version":"1.0.1","resolved":"https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz","integrity":"sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=","dev":true},"compare-func":{"version":"2.0.0","resolved":"https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz","integrity":"sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==","dev":true,"requires":{"array-ify":"^1.0.0","dot-prop":"^5.1.0"},"dependencies":{"dot-prop":{"version":"5.3.0","resolved":"https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz","integrity":"sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==","dev":true,"requires":{"is-obj":"^2.0.0"}},"is-obj":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz","integrity":"sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==","dev":true}}},"compare-versions":{"version":"3.6.0","resolved":"https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz","integrity":"sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==","dev":true},"component-emitter":{"version":"1.3.0","resolved":"https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz","integrity":"sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==","dev":true},"concat-map":{"version":"0.0.1","resolved":"https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz","integrity":"sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="},"concat-stream":{"version":"1.6.2","resolved":"https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz","integrity":"sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==","dev":true,"requires":{"buffer-from":"^1.0.0","inherits":"^2.0.3","readable-stream":"^2.2.2","typedarray":"^0.0.6"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"config-chain":{"version":"1.1.12","resolved":"https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz","integrity":"sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==","dev":true,"requires":{"ini":"^1.3.4","proto-list":"~1.2.1"}},"console-control-strings":{"version":"1.1.0","resolved":"https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz","integrity":"sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=","dev":true},"conventional-changelog-angular":{"version":"5.0.11","resolved":"https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz","integrity":"sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==","dev":true,"requires":{"compare-func":"^2.0.0","q":"^1.5.1"}},"conventional-changelog-core":{"version":"3.2.3","resolved":"https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz","integrity":"sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ==","dev":true,"requires":{"conventional-changelog-writer":"^4.0.6","conventional-commits-parser":"^3.0.3","dateformat":"^3.0.0","get-pkg-repo":"^1.0.0","git-raw-commits":"2.0.0","git-remote-origin-url":"^2.0.0","git-semver-tags":"^2.0.3","lodash":"^4.2.1","normalize-package-data":"^2.3.5","q":"^1.5.1","read-pkg":"^3.0.0","read-pkg-up":"^3.0.0","through2":"^3.0.0"},"dependencies":{"through2":{"version":"3.0.2","resolved":"https://registry.npmjs.org/through2/-/through2-3.0.2.tgz","integrity":"sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==","dev":true,"requires":{"inherits":"^2.0.4","readable-stream":"2 || 3"}}}},"conventional-changelog-preset-loader":{"version":"2.3.4","resolved":"https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz","integrity":"sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==","dev":true},"conventional-changelog-writer":{"version":"4.0.17","resolved":"https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz","integrity":"sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==","dev":true,"requires":{"compare-func":"^2.0.0","conventional-commits-filter":"^2.0.6","dateformat":"^3.0.0","handlebars":"^4.7.6","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","meow":"^7.0.0","semver":"^6.0.0","split":"^1.0.0","through2":"^3.0.0"},"dependencies":{"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"through2":{"version":"3.0.2","resolved":"https://registry.npmjs.org/through2/-/through2-3.0.2.tgz","integrity":"sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==","dev":true,"requires":{"inherits":"^2.0.4","readable-stream":"2 || 3"}}}},"conventional-commits-filter":{"version":"2.0.6","resolved":"https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz","integrity":"sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==","dev":true,"requires":{"lodash.ismatch":"^4.4.0","modify-values":"^1.0.0"}},"conventional-commits-parser":{"version":"3.1.0","resolved":"https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz","integrity":"sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==","dev":true,"requires":{"JSONStream":"^1.0.4","is-text-path":"^1.0.1","lodash":"^4.17.15","meow":"^7.0.0","split2":"^2.0.0","through2":"^3.0.0","trim-off-newlines":"^1.0.0"},"dependencies":{"through2":{"version":"3.0.2","resolved":"https://registry.npmjs.org/through2/-/through2-3.0.2.tgz","integrity":"sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==","dev":true,"requires":{"inherits":"^2.0.4","readable-stream":"2 || 3"}}}},"conventional-recommended-bump":{"version":"5.0.1","resolved":"https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-5.0.1.tgz","integrity":"sha512-RVdt0elRcCxL90IrNP0fYCpq1uGt2MALko0eyeQ+zQuDVWtMGAy9ng6yYn3kax42lCj9+XBxQ8ZN6S9bdKxDhQ==","dev":true,"requires":{"concat-stream":"^2.0.0","conventional-changelog-preset-loader":"^2.1.1","conventional-commits-filter":"^2.0.2","conventional-commits-parser":"^3.0.3","git-raw-commits":"2.0.0","git-semver-tags":"^2.0.3","meow":"^4.0.0","q":"^1.5.1"},"dependencies":{"camelcase":{"version":"4.1.0","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz","integrity":"sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=","dev":true},"camelcase-keys":{"version":"4.2.0","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz","integrity":"sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=","dev":true,"requires":{"camelcase":"^4.1.0","map-obj":"^2.0.0","quick-lru":"^1.0.0"}},"concat-stream":{"version":"2.0.0","resolved":"https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz","integrity":"sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==","dev":true,"requires":{"buffer-from":"^1.0.0","inherits":"^2.0.3","readable-stream":"^3.0.2","typedarray":"^0.0.6"}},"indent-string":{"version":"3.2.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz","integrity":"sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=","dev":true},"map-obj":{"version":"2.0.0","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz","integrity":"sha1-plzSkIepJZi4eRJXpSPgISIqwfk=","dev":true},"meow":{"version":"4.0.1","resolved":"https://registry.npmjs.org/meow/-/meow-4.0.1.tgz","integrity":"sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==","dev":true,"requires":{"camelcase-keys":"^4.0.0","decamelize-keys":"^1.0.0","loud-rejection":"^1.0.0","minimist":"^1.1.3","minimist-options":"^3.0.1","normalize-package-data":"^2.3.4","read-pkg-up":"^3.0.0","redent":"^2.0.0","trim-newlines":"^2.0.0"}},"minimist-options":{"version":"3.0.2","resolved":"https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz","integrity":"sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==","dev":true,"requires":{"arrify":"^1.0.1","is-plain-obj":"^1.1.0"}},"quick-lru":{"version":"1.1.0","resolved":"https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz","integrity":"sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=","dev":true},"redent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-2.0.0.tgz","integrity":"sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=","dev":true,"requires":{"indent-string":"^3.0.0","strip-indent":"^2.0.0"}},"strip-indent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz","integrity":"sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=","dev":true},"trim-newlines":{"version":"2.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz","integrity":"sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=","dev":true}}},"convert-source-map":{"version":"1.7.0","resolved":"https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz","integrity":"sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==","dev":true,"requires":{"safe-buffer":"~5.1.1"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true}}},"cookiejar":{"version":"2.1.2","resolved":"https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz","integrity":"sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==","dev":true},"copy-concurrently":{"version":"1.0.5","resolved":"https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz","integrity":"sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==","dev":true,"requires":{"aproba":"^1.1.1","fs-write-stream-atomic":"^1.0.8","iferr":"^0.1.5","mkdirp":"^0.5.1","rimraf":"^2.5.4","run-queue":"^1.0.0"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}}}},"copy-descriptor":{"version":"0.1.1","resolved":"https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz","integrity":"sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=","dev":true},"core-js-pure":{"version":"3.6.5","resolved":"https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz","integrity":"sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA=="},"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="},"cosmiconfig":{"version":"5.2.1","resolved":"https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz","integrity":"sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==","dev":true,"requires":{"import-fresh":"^2.0.0","is-directory":"^0.3.1","js-yaml":"^3.13.1","parse-json":"^4.0.0"}},"create-hash":{"version":"1.2.0","resolved":"https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz","integrity":"sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==","requires":{"cipher-base":"^1.0.1","inherits":"^2.0.1","md5.js":"^1.3.4","ripemd160":"^2.0.1","sha.js":"^2.4.0"}},"create-hmac":{"version":"1.1.7","resolved":"https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz","integrity":"sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==","requires":{"cipher-base":"^1.0.3","create-hash":"^1.1.0","inherits":"^2.0.1","ripemd160":"^2.0.0","safe-buffer":"^5.0.1","sha.js":"^2.4.8"}},"cross-env":{"version":"7.0.2","resolved":"https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz","integrity":"sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==","dev":true,"requires":{"cross-spawn":"^7.0.1"}},"cross-spawn":{"version":"7.0.3","resolved":"https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz","integrity":"sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==","dev":true,"requires":{"path-key":"^3.1.0","shebang-command":"^2.0.0","which":"^2.0.1"}},"currently-unhandled":{"version":"0.4.1","resolved":"https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz","integrity":"sha1-mI3zP+qxke95mmE2nddsF635V+o=","dev":true,"requires":{"array-find-index":"^1.0.1"}},"cyclist":{"version":"1.0.1","resolved":"https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz","integrity":"sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=","dev":true},"dargs":{"version":"4.1.0","resolved":"https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz","integrity":"sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=","dev":true,"requires":{"number-is-nan":"^1.0.0"}},"dashdash":{"version":"1.14.1","resolved":"https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz","integrity":"sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=","dev":true,"requires":{"assert-plus":"^1.0.0"}},"dateformat":{"version":"3.0.3","resolved":"https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz","integrity":"sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==","dev":true},"debug":{"version":"3.1.0","resolved":"https://registry.npmjs.org/debug/-/debug-3.1.0.tgz","integrity":"sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==","dev":true,"requires":{"ms":"2.0.0"},"dependencies":{"ms":{"version":"2.0.0","resolved":"https://registry.npmjs.org/ms/-/ms-2.0.0.tgz","integrity":"sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=","dev":true}}},"debuglog":{"version":"1.0.1","resolved":"https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz","integrity":"sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=","dev":true},"decamelize":{"version":"1.2.0","resolved":"https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz","integrity":"sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=","dev":true},"decamelize-keys":{"version":"1.1.0","resolved":"https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz","integrity":"sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=","dev":true,"requires":{"decamelize":"^1.1.0","map-obj":"^1.0.0"},"dependencies":{"map-obj":{"version":"1.0.1","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz","integrity":"sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=","dev":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=","dev":true},"dedent":{"version":"0.7.0","resolved":"https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz","integrity":"sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=","dev":true},"default-require-extensions":{"version":"3.0.0","resolved":"https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz","integrity":"sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==","dev":true,"requires":{"strip-bom":"^4.0.0"},"dependencies":{"strip-bom":{"version":"4.0.0","resolved":"https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz","integrity":"sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==","dev":true}}},"defaults":{"version":"1.0.3","resolved":"https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz","integrity":"sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=","dev":true,"requires":{"clone":"^1.0.2"}},"deferred-leveldown":{"version":"1.2.2","resolved":"https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz","integrity":"sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==","requires":{"abstract-leveldown":"~2.6.0"}},"define-properties":{"version":"1.1.3","resolved":"https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz","integrity":"sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==","requires":{"object-keys":"^1.0.12"},"dependencies":{"object-keys":{"version":"1.1.1","resolved":"https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz","integrity":"sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="}}},"define-property":{"version":"2.0.2","resolved":"https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz","integrity":"sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"requires":{"is-accessor-descriptor":"^1.0.0","is-data-descriptor":"^1.0.0","kind-of":"^6.0.2"}}}},"defined":{"version":"0.0.0","resolved":"https://registry.npmjs.org/defined/-/defined-0.0.0.tgz","integrity":"sha1-817qfXBekzuvE7LwOz+D2SFAOz4="},"delayed-stream":{"version":"1.0.0","resolved":"https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz","integrity":"sha1-3zrhmayt+31ECqrgsp4icrJOxhk=","dev":true},"delegates":{"version":"1.0.0","resolved":"https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz","integrity":"sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=","dev":true},"deprecation":{"version":"2.3.1","resolved":"https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz","integrity":"sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==","dev":true},"detect-indent":{"version":"5.0.0","resolved":"https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz","integrity":"sha1-OHHMCmoALow+Wzz38zYmRnXwa50=","dev":true},"dezalgo":{"version":"1.0.3","resolved":"https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz","integrity":"sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=","dev":true,"requires":{"asap":"^2.0.0","wrappy":"1"}},"diff":{"version":"4.0.2","resolved":"https://registry.npmjs.org/diff/-/diff-4.0.2.tgz","integrity":"sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==","dev":true},"dir-glob":{"version":"2.2.2","resolved":"https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz","integrity":"sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==","dev":true,"requires":{"path-type":"^3.0.0"}},"dot-prop":{"version":"4.2.1","resolved":"https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz","integrity":"sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==","dev":true,"requires":{"is-obj":"^1.0.0"}},"duplexer":{"version":"0.1.2","resolved":"https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz","integrity":"sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==","dev":true},"duplexify":{"version":"3.7.1","resolved":"https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz","integrity":"sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==","dev":true,"requires":{"end-of-stream":"^1.0.0","inherits":"^2.0.1","readable-stream":"^2.0.0","stream-shift":"^1.0.0"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"ecc-jsbn":{"version":"0.1.2","resolved":"https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz","integrity":"sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=","dev":true,"requires":{"jsbn":"~0.1.0","safer-buffer":"^2.1.0"}},"elliptic":{"version":"6.5.3","resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz","integrity":"sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==","requires":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}},"emittery":{"version":"0.7.2","resolved":"https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz","integrity":"sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ=="},"emoji-regex":{"version":"7.0.3","resolved":"https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz","integrity":"sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==","dev":true},"encoding":{"version":"0.1.13","resolved":"https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz","integrity":"sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==","dev":true,"requires":{"iconv-lite":"^0.6.2"}},"encoding-down":{"version":"5.0.4","resolved":"https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz","integrity":"sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==","requires":{"abstract-leveldown":"^5.0.0","inherits":"^2.0.3","level-codec":"^9.0.0","level-errors":"^2.0.0","xtend":"^4.0.1"},"dependencies":{"abstract-leveldown":{"version":"5.0.0","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz","integrity":"sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==","requires":{"xtend":"~4.0.0"}},"level-codec":{"version":"9.0.2","resolved":"https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz","integrity":"sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==","requires":{"buffer":"^5.6.0"}},"level-errors":{"version":"2.0.1","resolved":"https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz","integrity":"sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==","requires":{"errno":"~0.1.1"}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"end-of-stream":{"version":"1.4.4","resolved":"https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz","integrity":"sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==","dev":true,"requires":{"once":"^1.4.0"}},"env-paths":{"version":"2.2.0","resolved":"https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz","integrity":"sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==","dev":true},"envinfo":{"version":"7.7.3","resolved":"https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz","integrity":"sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==","dev":true},"err-code":{"version":"1.1.2","resolved":"https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz","integrity":"sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=","dev":true},"errno":{"version":"0.1.7","resolved":"https://registry.npmjs.org/errno/-/errno-0.1.7.tgz","integrity":"sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==","requires":{"prr":"~1.0.1"}},"error-ex":{"version":"1.3.2","resolved":"https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz","integrity":"sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==","dev":true,"requires":{"is-arrayish":"^0.2.1"}},"es-abstract":{"version":"1.17.6","resolved":"https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz","integrity":"sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==","requires":{"es-to-primitive":"^1.2.1","function-bind":"^1.1.1","has":"^1.0.3","has-symbols":"^1.0.1","is-callable":"^1.2.0","is-regex":"^1.1.0","object-inspect":"^1.7.0","object-keys":"^1.1.1","object.assign":"^4.1.0","string.prototype.trimend":"^1.0.1","string.prototype.trimstart":"^1.0.1"},"dependencies":{"object-keys":{"version":"1.1.1","resolved":"https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz","integrity":"sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="}}},"es-to-primitive":{"version":"1.2.1","resolved":"https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz","integrity":"sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==","requires":{"is-callable":"^1.1.4","is-date-object":"^1.0.1","is-symbol":"^1.0.2"}},"es6-error":{"version":"4.1.1","resolved":"https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz","integrity":"sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==","dev":true},"es6-promise":{"version":"4.2.8","resolved":"https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz","integrity":"sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==","dev":true},"es6-promisify":{"version":"5.0.0","resolved":"https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz","integrity":"sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=","dev":true,"requires":{"es6-promise":"^4.0.3"}},"escalade":{"version":"3.1.1","resolved":"https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz","integrity":"sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==","dev":true},"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=","dev":true},"esprima":{"version":"4.0.1","resolved":"https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz","integrity":"sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==","dev":true},"ethashjs":{"version":"0.0.8","resolved":"https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz","integrity":"sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==","requires":{"async":"^2.1.2","buffer-xor":"^2.0.1","ethereumjs-util":"^7.0.2","miller-rabin":"^4.0.0"},"dependencies":{"buffer-xor":{"version":"2.0.2","resolved":"https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz","integrity":"sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==","requires":{"safe-buffer":"^5.1.1"}}}},"ethereum-cryptography":{"version":"0.1.3","resolved":"https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz","integrity":"sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==","requires":{"@types/pbkdf2":"^3.0.0","@types/secp256k1":"^4.0.1","blakejs":"^1.1.0","browserify-aes":"^1.2.0","bs58check":"^2.1.2","create-hash":"^1.2.0","create-hmac":"^1.1.7","hash.js":"^1.1.7","keccak":"^3.0.0","pbkdf2":"^3.0.17","randombytes":"^2.1.0","safe-buffer":"^5.1.2","scrypt-js":"^3.0.0","secp256k1":"^4.0.1","setimmediate":"^1.0.5"}},"ethereumjs-account":{"version":"3.0.0","resolved":"https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz","integrity":"sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==","requires":{"ethereumjs-util":"^6.0.0","rlp":"^2.2.1","safe-buffer":"^5.1.1"},"dependencies":{"ethereumjs-util":{"version":"6.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz","integrity":"sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.3"}}}},"ethereumjs-block":{"version":"2.2.2","resolved":"https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz","integrity":"sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==","requires":{"async":"^2.0.1","ethereumjs-common":"^1.5.0","ethereumjs-tx":"^2.1.1","ethereumjs-util":"^5.0.0","merkle-patricia-tree":"^2.1.2"},"dependencies":{"ethereumjs-util":{"version":"5.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz","integrity":"sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==","requires":{"bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"^0.1.3","rlp":"^2.0.0","safe-buffer":"^5.1.1"}},"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="},"levelup":{"version":"1.3.9","resolved":"https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz","integrity":"sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==","requires":{"deferred-leveldown":"~1.2.1","level-codec":"~7.0.0","level-errors":"~1.0.3","level-iterator-stream":"~1.3.0","prr":"~1.0.1","semver":"~5.4.1","xtend":"~4.0.0"}},"merkle-patricia-tree":{"version":"2.3.2","resolved":"https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz","integrity":"sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==","requires":{"async":"^1.4.2","ethereumjs-util":"^5.0.0","level-ws":"0.0.0","levelup":"^1.2.1","memdown":"^1.0.0","readable-stream":"^2.0.0","rlp":"^2.0.0","semaphore":">=1.0.1"},"dependencies":{"async":{"version":"1.5.2","resolved":"https://registry.npmjs.org/async/-/async-1.5.2.tgz","integrity":"sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="}}},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="}}},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","requires":{"safe-buffer":"~5.1.0"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="}}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"ethereumjs-blockchain":{"version":"4.0.4","resolved":"https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz","integrity":"sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ==","requires":{"async":"^2.6.1","ethashjs":"~0.0.7","ethereumjs-block":"~2.2.2","ethereumjs-common":"^1.5.0","ethereumjs-util":"^6.1.0","flow-stoplight":"^1.0.0","level-mem":"^3.0.1","lru-cache":"^5.1.1","rlp":"^2.2.2","semaphore":"^1.1.0"},"dependencies":{"ethereumjs-util":{"version":"6.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz","integrity":"sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.3"}}}},"ethereumjs-common":{"version":"1.5.1","resolved":"https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz","integrity":"sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ=="},"ethereumjs-tx":{"version":"2.1.2","resolved":"https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz","integrity":"sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==","requires":{"ethereumjs-common":"^1.5.0","ethereumjs-util":"^6.0.0"},"dependencies":{"ethereumjs-util":{"version":"6.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz","integrity":"sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.3"}}}},"ethereumjs-util":{"version":"7.0.7","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz","integrity":"sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^5.1.2","create-hash":"^1.1.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.4"},"dependencies":{"bn.js":{"version":"5.1.3","resolved":"https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz","integrity":"sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ=="}}},"ethereumjs-vm":{"version":"4.2.0","resolved":"https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz","integrity":"sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==","requires":{"async":"^2.1.2","async-eventemitter":"^0.2.2","core-js-pure":"^3.0.1","ethereumjs-account":"^3.0.0","ethereumjs-block":"^2.2.2","ethereumjs-blockchain":"^4.0.3","ethereumjs-common":"^1.5.0","ethereumjs-tx":"^2.1.2","ethereumjs-util":"^6.2.0","fake-merkle-patricia-tree":"^1.0.1","functional-red-black-tree":"^1.0.1","merkle-patricia-tree":"^2.3.2","rustbn.js":"~0.2.0","safe-buffer":"^5.1.1","util.promisify":"^1.0.0"},"dependencies":{"ethereumjs-util":{"version":"6.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz","integrity":"sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.3"}},"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="},"levelup":{"version":"1.3.9","resolved":"https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz","integrity":"sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==","requires":{"deferred-leveldown":"~1.2.1","level-codec":"~7.0.0","level-errors":"~1.0.3","level-iterator-stream":"~1.3.0","prr":"~1.0.1","semver":"~5.4.1","xtend":"~4.0.0"}},"merkle-patricia-tree":{"version":"2.3.2","resolved":"https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz","integrity":"sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==","requires":{"async":"^1.4.2","ethereumjs-util":"^5.0.0","level-ws":"0.0.0","levelup":"^1.2.1","memdown":"^1.0.0","readable-stream":"^2.0.0","rlp":"^2.0.0","semaphore":">=1.0.1"},"dependencies":{"async":{"version":"1.5.2","resolved":"https://registry.npmjs.org/async/-/async-1.5.2.tgz","integrity":"sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="},"ethereumjs-util":{"version":"5.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz","integrity":"sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==","requires":{"bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"^0.1.3","rlp":"^2.0.0","safe-buffer":"^5.1.1"}}}},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="}}},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","requires":{"safe-buffer":"~5.1.0"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="}}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"ethjs-util":{"version":"0.1.6","resolved":"https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz","integrity":"sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==","requires":{"is-hex-prefixed":"1.0.0","strip-hex-prefix":"1.0.0"}},"eventemitter3":{"version":"3.1.2","resolved":"https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz","integrity":"sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==","dev":true},"evp_bytestokey":{"version":"1.0.3","resolved":"https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz","integrity":"sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==","requires":{"md5.js":"^1.3.4","safe-buffer":"^5.1.1"}},"execa":{"version":"1.0.0","resolved":"https://registry.npmjs.org/execa/-/execa-1.0.0.tgz","integrity":"sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==","dev":true,"requires":{"cross-spawn":"^6.0.0","get-stream":"^4.0.0","is-stream":"^1.1.0","npm-run-path":"^2.0.0","p-finally":"^1.0.0","signal-exit":"^3.0.0","strip-eof":"^1.0.0"},"dependencies":{"cross-spawn":{"version":"6.0.5","resolved":"https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz","integrity":"sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==","dev":true,"requires":{"nice-try":"^1.0.4","path-key":"^2.0.1","semver":"^5.5.0","shebang-command":"^1.2.0","which":"^1.2.9"}},"path-key":{"version":"2.0.1","resolved":"https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz","integrity":"sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=","dev":true},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"shebang-command":{"version":"1.2.0","resolved":"https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz","integrity":"sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=","dev":true,"requires":{"shebang-regex":"^1.0.0"}},"shebang-regex":{"version":"1.0.0","resolved":"https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz","integrity":"sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=","dev":true},"which":{"version":"1.3.1","resolved":"https://registry.npmjs.org/which/-/which-1.3.1.tgz","integrity":"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==","dev":true,"requires":{"isexe":"^2.0.0"}}}},"expand-brackets":{"version":"2.1.4","resolved":"https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz","integrity":"sha1-t3c14xXOMPa27/D4OwQVGiJEliI=","dev":true,"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":{"debug":{"version":"2.6.9","resolved":"https://registry.npmjs.org/debug/-/debug-2.6.9.tgz","integrity":"sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==","dev":true,"requires":{"ms":"2.0.0"}},"define-property":{"version":"0.2.5","resolved":"https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz","integrity":"sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=","dev":true,"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}},"ms":{"version":"2.0.0","resolved":"https://registry.npmjs.org/ms/-/ms-2.0.0.tgz","integrity":"sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=","dev":true}}},"extend":{"version":"3.0.2","resolved":"https://registry.npmjs.org/extend/-/extend-3.0.2.tgz","integrity":"sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==","dev":true},"extend-shallow":{"version":"3.0.2","resolved":"https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz","integrity":"sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=","dev":true,"requires":{"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==","dev":true,"requires":{"is-plain-object":"^2.0.4"}}}},"external-editor":{"version":"3.1.0","resolved":"https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz","integrity":"sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==","dev":true,"requires":{"chardet":"^0.7.0","iconv-lite":"^0.4.24","tmp":"^0.0.33"},"dependencies":{"iconv-lite":{"version":"0.4.24","resolved":"https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz","integrity":"sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==","dev":true,"requires":{"safer-buffer":">= 2.1.2 < 3"}},"tmp":{"version":"0.0.33","resolved":"https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz","integrity":"sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==","dev":true,"requires":{"os-tmpdir":"~1.0.2"}}}},"extglob":{"version":"2.0.4","resolved":"https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz","integrity":"sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==","dev":true,"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=","dev":true,"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=","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"requires":{"is-accessor-descriptor":"^1.0.0","is-data-descriptor":"^1.0.0","kind-of":"^6.0.2"}}}},"extsprintf":{"version":"1.3.0","resolved":"https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz","integrity":"sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=","dev":true},"fake-merkle-patricia-tree":{"version":"1.0.1","resolved":"https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz","integrity":"sha1-S4w6z7Ugr635hgsfFM2M40As3dM=","requires":{"checkpoint-store":"^1.1.0"}},"fast-deep-equal":{"version":"3.1.3","resolved":"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz","integrity":"sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==","dev":true},"fast-glob":{"version":"2.2.7","resolved":"https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz","integrity":"sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==","dev":true,"requires":{"@mrmlnc/readdir-enhanced":"^2.2.1","@nodelib/fs.stat":"^1.1.2","glob-parent":"^3.1.0","is-glob":"^4.0.0","merge2":"^1.2.3","micromatch":"^3.1.10"},"dependencies":{"glob-parent":{"version":"3.1.0","resolved":"https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz","integrity":"sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=","dev":true,"requires":{"is-glob":"^3.1.0","path-dirname":"^1.0.0"},"dependencies":{"is-glob":{"version":"3.1.0","resolved":"https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz","integrity":"sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=","dev":true,"requires":{"is-extglob":"^2.1.0"}}}}}},"fast-json-stable-stringify":{"version":"2.1.0","resolved":"https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz","integrity":"sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==","dev":true},"fast-safe-stringify":{"version":"2.0.7","resolved":"https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz","integrity":"sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==","dev":true},"fastq":{"version":"1.8.0","resolved":"https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz","integrity":"sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==","dev":true,"requires":{"reusify":"^1.0.4"}},"figgy-pudding":{"version":"3.5.2","resolved":"https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz","integrity":"sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==","dev":true},"figures":{"version":"2.0.0","resolved":"https://registry.npmjs.org/figures/-/figures-2.0.0.tgz","integrity":"sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=","dev":true,"requires":{"escape-string-regexp":"^1.0.5"}},"file-uri-to-path":{"version":"1.0.0","resolved":"https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz","integrity":"sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==","optional":true},"fill-range":{"version":"4.0.0","resolved":"https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz","integrity":"sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=","dev":true,"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"find-cache-dir":{"version":"3.3.1","resolved":"https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz","integrity":"sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==","dev":true,"requires":{"commondir":"^1.0.1","make-dir":"^3.0.2","pkg-dir":"^4.1.0"},"dependencies":{"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"pkg-dir":{"version":"4.2.0","resolved":"https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz","integrity":"sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==","dev":true,"requires":{"find-up":"^4.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"find-up":{"version":"3.0.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz","integrity":"sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==","dev":true,"requires":{"locate-path":"^3.0.0"}},"find-versions":{"version":"3.2.0","resolved":"https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz","integrity":"sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==","dev":true,"requires":{"semver-regex":"^2.0.0"}},"flat":{"version":"5.0.2","resolved":"https://registry.npmjs.org/flat/-/flat-5.0.2.tgz","integrity":"sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==","dev":true},"flow-stoplight":{"version":"1.0.0","resolved":"https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz","integrity":"sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s="},"flush-write-stream":{"version":"1.1.1","resolved":"https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz","integrity":"sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==","dev":true,"requires":{"inherits":"^2.0.3","readable-stream":"^2.3.6"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"follow-redirects":{"version":"1.13.0","resolved":"https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz","integrity":"sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==","dev":true},"for-in":{"version":"1.0.2","resolved":"https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz","integrity":"sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=","dev":true},"foreground-child":{"version":"2.0.0","resolved":"https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz","integrity":"sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==","dev":true,"requires":{"cross-spawn":"^7.0.0","signal-exit":"^3.0.2"}},"forever-agent":{"version":"0.6.1","resolved":"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz","integrity":"sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=","dev":true},"form-data":{"version":"2.3.3","resolved":"https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz","integrity":"sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==","dev":true,"requires":{"asynckit":"^0.4.0","combined-stream":"^1.0.6","mime-types":"^2.1.12"}},"formidable":{"version":"1.2.2","resolved":"https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz","integrity":"sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==","dev":true},"fragment-cache":{"version":"0.2.1","resolved":"https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz","integrity":"sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=","dev":true,"requires":{"map-cache":"^0.2.2"}},"from2":{"version":"2.3.0","resolved":"https://registry.npmjs.org/from2/-/from2-2.3.0.tgz","integrity":"sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=","dev":true,"requires":{"inherits":"^2.0.1","readable-stream":"^2.0.0"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"fromentries":{"version":"1.2.1","resolved":"https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz","integrity":"sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==","dev":true},"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=","dev":true},"fs-extra":{"version":"9.0.1","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz","integrity":"sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==","dev":true,"requires":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^1.0.0"}},"fs-minipass":{"version":"1.2.7","resolved":"https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz","integrity":"sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==","dev":true,"requires":{"minipass":"^2.6.0"}},"fs-write-stream-atomic":{"version":"1.0.10","resolved":"https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz","integrity":"sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=","dev":true,"requires":{"graceful-fs":"^4.1.2","iferr":"^0.1.5","imurmurhash":"^0.1.4","readable-stream":"1 || 2"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"fs.realpath":{"version":"1.0.0","resolved":"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz","integrity":"sha1-FQStJSMVjKpA20onh8sBQRmU6k8="},"fsevents":{"version":"2.1.3","resolved":"https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz","integrity":"sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==","dev":true,"optional":true},"function-bind":{"version":"1.1.1","resolved":"https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz","integrity":"sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="},"functional-red-black-tree":{"version":"1.0.1","resolved":"https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz","integrity":"sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc="},"gauge":{"version":"2.7.4","resolved":"https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz","integrity":"sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=","dev":true,"requires":{"aproba":"^1.0.3","console-control-strings":"^1.0.0","has-unicode":"^2.0.0","object-assign":"^4.1.0","signal-exit":"^3.0.0","string-width":"^1.0.1","strip-ansi":"^3.0.1","wide-align":"^1.1.0"}},"genfun":{"version":"5.0.0","resolved":"https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz","integrity":"sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==","dev":true},"gensync":{"version":"1.0.0-beta.1","resolved":"https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz","integrity":"sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==","dev":true},"get-caller-file":{"version":"2.0.5","resolved":"https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz","integrity":"sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==","dev":true},"get-package-type":{"version":"0.1.0","resolved":"https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz","integrity":"sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==","dev":true},"get-pkg-repo":{"version":"1.4.0","resolved":"https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz","integrity":"sha1-xztInAbYDMVTbCyFP54FIyBWly0=","dev":true,"requires":{"hosted-git-info":"^2.1.4","meow":"^3.3.0","normalize-package-data":"^2.3.0","parse-github-repo-url":"^1.3.0","through2":"^2.0.0"},"dependencies":{"camelcase":{"version":"2.1.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz","integrity":"sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=","dev":true},"camelcase-keys":{"version":"2.1.0","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz","integrity":"sha1-MIvur/3ygRkFHvodkyITyRuPkuc=","dev":true,"requires":{"camelcase":"^2.0.0","map-obj":"^1.0.0"}},"find-up":{"version":"1.1.2","resolved":"https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz","integrity":"sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=","dev":true,"requires":{"path-exists":"^2.0.0","pinkie-promise":"^2.0.0"}},"indent-string":{"version":"2.1.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz","integrity":"sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=","dev":true,"requires":{"repeating":"^2.0.0"}},"load-json-file":{"version":"1.1.0","resolved":"https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz","integrity":"sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=","dev":true,"requires":{"graceful-fs":"^4.1.2","parse-json":"^2.2.0","pify":"^2.0.0","pinkie-promise":"^2.0.0","strip-bom":"^2.0.0"}},"map-obj":{"version":"1.0.1","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz","integrity":"sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=","dev":true},"meow":{"version":"3.7.0","resolved":"https://registry.npmjs.org/meow/-/meow-3.7.0.tgz","integrity":"sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=","dev":true,"requires":{"camelcase-keys":"^2.0.0","decamelize":"^1.1.2","loud-rejection":"^1.0.0","map-obj":"^1.0.1","minimist":"^1.1.3","normalize-package-data":"^2.3.4","object-assign":"^4.0.1","read-pkg-up":"^1.0.1","redent":"^1.0.0","trim-newlines":"^1.0.0"}},"parse-json":{"version":"2.2.0","resolved":"https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz","integrity":"sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=","dev":true,"requires":{"error-ex":"^1.2.0"}},"path-exists":{"version":"2.1.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz","integrity":"sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=","dev":true,"requires":{"pinkie-promise":"^2.0.0"}},"path-type":{"version":"1.1.0","resolved":"https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz","integrity":"sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=","dev":true,"requires":{"graceful-fs":"^4.1.2","pify":"^2.0.0","pinkie-promise":"^2.0.0"}},"pify":{"version":"2.3.0","resolved":"https://registry.npmjs.org/pify/-/pify-2.3.0.tgz","integrity":"sha1-7RQaasBDqEnqWISY59yosVMw6Qw=","dev":true},"read-pkg":{"version":"1.1.0","resolved":"https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz","integrity":"sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=","dev":true,"requires":{"load-json-file":"^1.0.0","normalize-package-data":"^2.3.2","path-type":"^1.0.0"}},"read-pkg-up":{"version":"1.0.1","resolved":"https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz","integrity":"sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=","dev":true,"requires":{"find-up":"^1.0.0","read-pkg":"^1.0.0"}},"redent":{"version":"1.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-1.0.0.tgz","integrity":"sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=","dev":true,"requires":{"indent-string":"^2.1.0","strip-indent":"^1.0.1"}},"strip-bom":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz","integrity":"sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=","dev":true,"requires":{"is-utf8":"^0.2.0"}},"strip-indent":{"version":"1.0.1","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz","integrity":"sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=","dev":true,"requires":{"get-stdin":"^4.0.1"}},"trim-newlines":{"version":"1.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz","integrity":"sha1-WIeWa7WCpFA6QetST301ARgVphM=","dev":true}}},"get-port":{"version":"4.2.0","resolved":"https://registry.npmjs.org/get-port/-/get-port-4.2.0.tgz","integrity":"sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw==","dev":true},"get-stdin":{"version":"4.0.1","resolved":"https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz","integrity":"sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=","dev":true},"get-stream":{"version":"4.1.0","resolved":"https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz","integrity":"sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==","dev":true,"requires":{"pump":"^3.0.0"}},"get-value":{"version":"2.0.6","resolved":"https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz","integrity":"sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=","dev":true},"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"}},"git-config-path":{"version":"1.0.1","resolved":"https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz","integrity":"sha1-bTP37WPbDQ4RgTFQO6s6ykfVRmQ=","dev":true,"requires":{"extend-shallow":"^2.0.1","fs-exists-sync":"^0.1.0","homedir-polyfill":"^1.0.0"},"dependencies":{"extend-shallow":{"version":"2.0.1","resolved":"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz","integrity":"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"git-raw-commits":{"version":"2.0.0","resolved":"https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz","integrity":"sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==","dev":true,"requires":{"dargs":"^4.0.1","lodash.template":"^4.0.2","meow":"^4.0.0","split2":"^2.0.0","through2":"^2.0.0"},"dependencies":{"camelcase":{"version":"4.1.0","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz","integrity":"sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=","dev":true},"camelcase-keys":{"version":"4.2.0","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz","integrity":"sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=","dev":true,"requires":{"camelcase":"^4.1.0","map-obj":"^2.0.0","quick-lru":"^1.0.0"}},"indent-string":{"version":"3.2.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz","integrity":"sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=","dev":true},"map-obj":{"version":"2.0.0","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz","integrity":"sha1-plzSkIepJZi4eRJXpSPgISIqwfk=","dev":true},"meow":{"version":"4.0.1","resolved":"https://registry.npmjs.org/meow/-/meow-4.0.1.tgz","integrity":"sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==","dev":true,"requires":{"camelcase-keys":"^4.0.0","decamelize-keys":"^1.0.0","loud-rejection":"^1.0.0","minimist":"^1.1.3","minimist-options":"^3.0.1","normalize-package-data":"^2.3.4","read-pkg-up":"^3.0.0","redent":"^2.0.0","trim-newlines":"^2.0.0"}},"minimist-options":{"version":"3.0.2","resolved":"https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz","integrity":"sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==","dev":true,"requires":{"arrify":"^1.0.1","is-plain-obj":"^1.1.0"}},"quick-lru":{"version":"1.1.0","resolved":"https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz","integrity":"sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=","dev":true},"redent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-2.0.0.tgz","integrity":"sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=","dev":true,"requires":{"indent-string":"^3.0.0","strip-indent":"^2.0.0"}},"strip-indent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz","integrity":"sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=","dev":true},"trim-newlines":{"version":"2.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz","integrity":"sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=","dev":true}}},"git-remote-origin-url":{"version":"2.0.0","resolved":"https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz","integrity":"sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=","dev":true,"requires":{"gitconfiglocal":"^1.0.0","pify":"^2.3.0"},"dependencies":{"pify":{"version":"2.3.0","resolved":"https://registry.npmjs.org/pify/-/pify-2.3.0.tgz","integrity":"sha1-7RQaasBDqEnqWISY59yosVMw6Qw=","dev":true}}},"git-semver-tags":{"version":"2.0.3","resolved":"https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-2.0.3.tgz","integrity":"sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA==","dev":true,"requires":{"meow":"^4.0.0","semver":"^6.0.0"},"dependencies":{"camelcase":{"version":"4.1.0","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz","integrity":"sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=","dev":true},"camelcase-keys":{"version":"4.2.0","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz","integrity":"sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=","dev":true,"requires":{"camelcase":"^4.1.0","map-obj":"^2.0.0","quick-lru":"^1.0.0"}},"indent-string":{"version":"3.2.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz","integrity":"sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=","dev":true},"map-obj":{"version":"2.0.0","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz","integrity":"sha1-plzSkIepJZi4eRJXpSPgISIqwfk=","dev":true},"meow":{"version":"4.0.1","resolved":"https://registry.npmjs.org/meow/-/meow-4.0.1.tgz","integrity":"sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==","dev":true,"requires":{"camelcase-keys":"^4.0.0","decamelize-keys":"^1.0.0","loud-rejection":"^1.0.0","minimist":"^1.1.3","minimist-options":"^3.0.1","normalize-package-data":"^2.3.4","read-pkg-up":"^3.0.0","redent":"^2.0.0","trim-newlines":"^2.0.0"}},"minimist-options":{"version":"3.0.2","resolved":"https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz","integrity":"sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==","dev":true,"requires":{"arrify":"^1.0.1","is-plain-obj":"^1.1.0"}},"quick-lru":{"version":"1.1.0","resolved":"https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz","integrity":"sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=","dev":true},"redent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-2.0.0.tgz","integrity":"sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=","dev":true,"requires":{"indent-string":"^3.0.0","strip-indent":"^2.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"strip-indent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz","integrity":"sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=","dev":true},"trim-newlines":{"version":"2.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz","integrity":"sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=","dev":true}}},"git-up":{"version":"4.0.2","resolved":"https://registry.npmjs.org/git-up/-/git-up-4.0.2.tgz","integrity":"sha512-kbuvus1dWQB2sSW4cbfTeGpCMd8ge9jx9RKnhXhuJ7tnvT+NIrTVfYZxjtflZddQYcmdOTlkAcjmx7bor+15AQ==","dev":true,"requires":{"is-ssh":"^1.3.0","parse-url":"^5.0.0"}},"git-url-parse":{"version":"11.2.0","resolved":"https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.2.0.tgz","integrity":"sha512-KPoHZg8v+plarZvto4ruIzzJLFQoRx+sUs5DQSr07By9IBKguVd+e6jwrFR6/TP6xrCJlNV1tPqLO1aREc7O2g==","dev":true,"requires":{"git-up":"^4.0.0"}},"git-user-name":{"version":"2.0.0","resolved":"https://registry.npmjs.org/git-user-name/-/git-user-name-2.0.0.tgz","integrity":"sha512-1DC8rUNm2I5V9v4eIpK6PSjKCp9bI0t6Wl05WSk+xEMS8GhR8GWzxM3aGZfPrfuqEfWxSbui5/pQJryJFXqCzQ==","dev":true,"requires":{"extend-shallow":"^2.0.1","git-config-path":"^1.0.1","parse-git-config":"^1.1.1"},"dependencies":{"extend-shallow":{"version":"2.0.1","resolved":"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz","integrity":"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"gitconfiglocal":{"version":"1.0.0","resolved":"https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz","integrity":"sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=","dev":true,"requires":{"ini":"^1.3.2"}},"glob":{"version":"7.1.6","resolved":"https://registry.npmjs.org/glob/-/glob-7.1.6.tgz","integrity":"sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==","requires":{"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"}},"glob-parent":{"version":"5.1.1","resolved":"https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz","integrity":"sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==","dev":true,"requires":{"is-glob":"^4.0.1"}},"glob-to-regexp":{"version":"0.3.0","resolved":"https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz","integrity":"sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=","dev":true},"globals":{"version":"11.12.0","resolved":"https://registry.npmjs.org/globals/-/globals-11.12.0.tgz","integrity":"sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==","dev":true},"globby":{"version":"9.2.0","resolved":"https://registry.npmjs.org/globby/-/globby-9.2.0.tgz","integrity":"sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==","dev":true,"requires":{"@types/glob":"^7.1.1","array-union":"^1.0.2","dir-glob":"^2.2.2","fast-glob":"^2.2.6","glob":"^7.1.3","ignore":"^4.0.3","pify":"^4.0.1","slash":"^2.0.0"}},"graceful-fs":{"version":"4.2.4","resolved":"https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz","integrity":"sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==","dev":true},"growl":{"version":"1.10.5","resolved":"https://registry.npmjs.org/growl/-/growl-1.10.5.tgz","integrity":"sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==","dev":true},"handlebars":{"version":"4.7.6","resolved":"https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz","integrity":"sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==","dev":true,"requires":{"minimist":"^1.2.5","neo-async":"^2.6.0","source-map":"^0.6.1","uglify-js":"^3.1.4","wordwrap":"^1.0.0"},"dependencies":{"source-map":{"version":"0.6.1","resolved":"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz","integrity":"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==","dev":true}}},"har-schema":{"version":"2.0.0","resolved":"https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz","integrity":"sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=","dev":true},"har-validator":{"version":"5.1.5","resolved":"https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz","integrity":"sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==","dev":true,"requires":{"ajv":"^6.12.3","har-schema":"^2.0.0"}},"hard-rejection":{"version":"2.1.0","resolved":"https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz","integrity":"sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==","dev":true},"has":{"version":"1.0.3","resolved":"https://registry.npmjs.org/has/-/has-1.0.3.tgz","integrity":"sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==","requires":{"function-bind":"^1.1.1"}},"has-flag":{"version":"4.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz","integrity":"sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==","dev":true},"has-symbols":{"version":"1.0.1","resolved":"https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz","integrity":"sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg=="},"has-unicode":{"version":"2.0.1","resolved":"https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz","integrity":"sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=","dev":true},"has-value":{"version":"1.0.0","resolved":"https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz","integrity":"sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=","dev":true,"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=","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"hash-base":{"version":"3.1.0","resolved":"https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz","integrity":"sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==","requires":{"inherits":"^2.0.4","readable-stream":"^3.6.0","safe-buffer":"^5.2.0"}},"hash.js":{"version":"1.1.7","resolved":"https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz","integrity":"sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==","requires":{"inherits":"^2.0.3","minimalistic-assert":"^1.0.1"}},"hasha":{"version":"5.2.0","resolved":"https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz","integrity":"sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==","dev":true,"requires":{"is-stream":"^2.0.0","type-fest":"^0.8.0"},"dependencies":{"is-stream":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz","integrity":"sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==","dev":true},"type-fest":{"version":"0.8.1","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz","integrity":"sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==","dev":true}}},"hdkey":{"version":"2.0.1","resolved":"https://registry.npmjs.org/hdkey/-/hdkey-2.0.1.tgz","integrity":"sha512-c+tl9PHG9/XkGgG0tD7CJpRVaE0jfZizDNmnErUAKQ4EjQSOcOUcV3EN9ZEZS8pZ4usaeiiK0H7stzuzna8feA==","requires":{"bs58check":"^2.1.2","safe-buffer":"^5.1.1","secp256k1":"^4.0.0"}},"he":{"version":"1.2.0","resolved":"https://registry.npmjs.org/he/-/he-1.2.0.tgz","integrity":"sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==","dev":true},"highlight.js":{"version":"9.18.3","resolved":"https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.3.tgz","integrity":"sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ==","dev":true},"hmac-drbg":{"version":"1.0.1","resolved":"https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz","integrity":"sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=","requires":{"hash.js":"^1.0.3","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.1"}},"homedir-polyfill":{"version":"1.0.3","resolved":"https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz","integrity":"sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==","dev":true,"requires":{"parse-passwd":"^1.0.0"}},"hosted-git-info":{"version":"2.8.8","resolved":"https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz","integrity":"sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==","dev":true},"html-escaper":{"version":"2.0.2","resolved":"https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz","integrity":"sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==","dev":true},"http-cache-semantics":{"version":"3.8.1","resolved":"https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz","integrity":"sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==","dev":true},"http-proxy-agent":{"version":"2.1.0","resolved":"https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz","integrity":"sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==","dev":true,"requires":{"agent-base":"4","debug":"3.1.0"}},"http-signature":{"version":"1.2.0","resolved":"https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz","integrity":"sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=","dev":true,"requires":{"assert-plus":"^1.0.0","jsprim":"^1.2.2","sshpk":"^1.7.0"}},"https-proxy-agent":{"version":"2.2.4","resolved":"https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz","integrity":"sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==","dev":true,"requires":{"agent-base":"^4.3.0","debug":"^3.1.0"}},"human-signals":{"version":"1.1.1","resolved":"https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz","integrity":"sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==","dev":true},"humanize-ms":{"version":"1.2.1","resolved":"https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz","integrity":"sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=","dev":true,"requires":{"ms":"^2.0.0"}},"husky":{"version":"4.3.0","resolved":"https://registry.npmjs.org/husky/-/husky-4.3.0.tgz","integrity":"sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==","dev":true,"requires":{"chalk":"^4.0.0","ci-info":"^2.0.0","compare-versions":"^3.6.0","cosmiconfig":"^7.0.0","find-versions":"^3.2.0","opencollective-postinstall":"^2.0.2","pkg-dir":"^4.2.0","please-upgrade-node":"^3.2.0","slash":"^3.0.0","which-pm-runs":"^1.0.0"},"dependencies":{"cosmiconfig":{"version":"7.0.0","resolved":"https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz","integrity":"sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==","dev":true,"requires":{"@types/parse-json":"^4.0.0","import-fresh":"^3.2.1","parse-json":"^5.0.0","path-type":"^4.0.0","yaml":"^1.10.0"}},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"import-fresh":{"version":"3.2.1","resolved":"https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz","integrity":"sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==","dev":true,"requires":{"parent-module":"^1.0.0","resolve-from":"^4.0.0"}},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"parse-json":{"version":"5.1.0","resolved":"https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz","integrity":"sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==","dev":true,"requires":{"@babel/code-frame":"^7.0.0","error-ex":"^1.3.1","json-parse-even-better-errors":"^2.3.0","lines-and-columns":"^1.1.6"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"path-type":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz","integrity":"sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==","dev":true},"pkg-dir":{"version":"4.2.0","resolved":"https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz","integrity":"sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==","dev":true,"requires":{"find-up":"^4.0.0"}},"slash":{"version":"3.0.0","resolved":"https://registry.npmjs.org/slash/-/slash-3.0.0.tgz","integrity":"sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==","dev":true}}},"iconv-lite":{"version":"0.6.2","resolved":"https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz","integrity":"sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==","dev":true,"requires":{"safer-buffer":">= 2.1.2 < 3.0.0"}},"ieee754":{"version":"1.1.13","resolved":"https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz","integrity":"sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="},"iferr":{"version":"0.1.5","resolved":"https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz","integrity":"sha1-xg7taebY/bazEEofy8ocGS3FtQE=","dev":true},"ignore":{"version":"4.0.6","resolved":"https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz","integrity":"sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==","dev":true},"ignore-walk":{"version":"3.0.3","resolved":"https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz","integrity":"sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==","dev":true,"requires":{"minimatch":"^3.0.4"}},"immediate":{"version":"3.3.0","resolved":"https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz","integrity":"sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q=="},"import-fresh":{"version":"2.0.0","resolved":"https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz","integrity":"sha1-2BNVwVYS04bGH53dOSLUMEgipUY=","dev":true,"requires":{"caller-path":"^2.0.0","resolve-from":"^3.0.0"},"dependencies":{"resolve-from":{"version":"3.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz","integrity":"sha1-six699nWiBvItuZTM17rywoYh0g=","dev":true}}},"import-local":{"version":"2.0.0","resolved":"https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz","integrity":"sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==","dev":true,"requires":{"pkg-dir":"^3.0.0","resolve-cwd":"^2.0.0"}},"imurmurhash":{"version":"0.1.4","resolved":"https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz","integrity":"sha1-khi5srkoojixPcT7a21XbyMUU+o=","dev":true},"indent-string":{"version":"4.0.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz","integrity":"sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==","dev":true},"infer-owner":{"version":"1.0.4","resolved":"https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz","integrity":"sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==","dev":true},"inflight":{"version":"1.0.6","resolved":"https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz","integrity":"sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=","requires":{"once":"^1.3.0","wrappy":"1"}},"inherits":{"version":"2.0.4","resolved":"https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz","integrity":"sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="},"ini":{"version":"1.3.5","resolved":"https://registry.npmjs.org/ini/-/ini-1.3.5.tgz","integrity":"sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==","dev":true},"init-package-json":{"version":"1.10.3","resolved":"https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz","integrity":"sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==","dev":true,"requires":{"glob":"^7.1.1","npm-package-arg":"^4.0.0 || ^5.0.0 || ^6.0.0","promzard":"^0.3.0","read":"~1.0.1","read-package-json":"1 || 2","semver":"2.x || 3.x || 4 || 5","validate-npm-package-license":"^3.0.1","validate-npm-package-name":"^3.0.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}}}},"inquirer":{"version":"6.5.2","resolved":"https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz","integrity":"sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==","dev":true,"requires":{"ansi-escapes":"^3.2.0","chalk":"^2.4.2","cli-cursor":"^2.1.0","cli-width":"^2.0.0","external-editor":"^3.0.3","figures":"^2.0.0","lodash":"^4.17.12","mute-stream":"0.0.7","run-async":"^2.2.0","rxjs":"^6.4.0","string-width":"^2.1.0","strip-ansi":"^5.1.0","through":"^2.3.6"},"dependencies":{"ansi-regex":{"version":"3.0.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz","integrity":"sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=","dev":true},"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"string-width":{"version":"2.1.1","resolved":"https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz","integrity":"sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==","dev":true,"requires":{"is-fullwidth-code-point":"^2.0.0","strip-ansi":"^4.0.0"},"dependencies":{"strip-ansi":{"version":"4.0.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz","integrity":"sha1-qEeQIusaw2iocTibY1JixQXuNo8=","dev":true,"requires":{"ansi-regex":"^3.0.0"}}}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true}}},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"interpret":{"version":"1.4.0","resolved":"https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz","integrity":"sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==","dev":true},"into-stream":{"version":"6.0.0","resolved":"https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz","integrity":"sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==","dev":true,"requires":{"from2":"^2.3.0","p-is-promise":"^3.0.0"}},"ip":{"version":"1.1.5","resolved":"https://registry.npmjs.org/ip/-/ip-1.1.5.tgz","integrity":"sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=","dev":true},"is-absolute":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz","integrity":"sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==","dev":true,"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=","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"is-arrayish":{"version":"0.2.1","resolved":"https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz","integrity":"sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=","dev":true},"is-binary-path":{"version":"2.1.0","resolved":"https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz","integrity":"sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==","dev":true,"requires":{"binary-extensions":"^2.0.0"}},"is-buffer":{"version":"1.1.6","resolved":"https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz","integrity":"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==","dev":true},"is-callable":{"version":"1.2.2","resolved":"https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz","integrity":"sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA=="},"is-ci":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz","integrity":"sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==","dev":true,"requires":{"ci-info":"^2.0.0"}},"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=","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"is-date-object":{"version":"1.0.2","resolved":"https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz","integrity":"sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g=="},"is-descriptor":{"version":"0.1.6","resolved":"https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz","integrity":"sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==","dev":true,"requires":{"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==","dev":true}}},"is-directory":{"version":"0.3.1","resolved":"https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz","integrity":"sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=","dev":true},"is-extendable":{"version":"0.1.1","resolved":"https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz","integrity":"sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=","dev":true},"is-extglob":{"version":"2.1.1","resolved":"https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz","integrity":"sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=","dev":true},"is-finite":{"version":"1.1.0","resolved":"https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz","integrity":"sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==","dev":true},"is-fullwidth-code-point":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz","integrity":"sha1-754xOG8DGn8NZDr4L95QxFfvAMs=","dev":true,"requires":{"number-is-nan":"^1.0.0"}},"is-glob":{"version":"4.0.1","resolved":"https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz","integrity":"sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==","dev":true,"requires":{"is-extglob":"^2.1.1"}},"is-hex-prefixed":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz","integrity":"sha1-fY035q135dEnFIkTxXPggtd39VQ="},"is-negated-glob":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz","integrity":"sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=","dev":true},"is-negative-zero":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz","integrity":"sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE="},"is-number":{"version":"3.0.0","resolved":"https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz","integrity":"sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"is-obj":{"version":"1.0.1","resolved":"https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz","integrity":"sha1-PkcprB9f3gJc19g6iW2rn09n2w8=","dev":true},"is-plain-obj":{"version":"1.1.0","resolved":"https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz","integrity":"sha1-caUMhCnfync8kqOQpKA7OfzVHT4=","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==","dev":true,"requires":{"isobject":"^3.0.1"}},"is-regex":{"version":"1.1.1","resolved":"https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz","integrity":"sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==","requires":{"has-symbols":"^1.0.1"}},"is-relative":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz","integrity":"sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==","dev":true,"requires":{"is-unc-path":"^1.0.0"}},"is-ssh":{"version":"1.3.2","resolved":"https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz","integrity":"sha512-elEw0/0c2UscLrNG+OAorbP539E3rhliKPg+hDMWN9VwrDXfYK+4PBEykDPfxlYYtQvl84TascnQyobfQLHEhQ==","dev":true,"requires":{"protocols":"^1.1.0"}},"is-stream":{"version":"1.1.0","resolved":"https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz","integrity":"sha1-EtSj3U5o4Lec6428hBc66A2RykQ=","dev":true},"is-symbol":{"version":"1.0.3","resolved":"https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz","integrity":"sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==","requires":{"has-symbols":"^1.0.1"}},"is-text-path":{"version":"1.0.1","resolved":"https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz","integrity":"sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=","dev":true,"requires":{"text-extensions":"^1.0.0"}},"is-typedarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz","integrity":"sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=","dev":true},"is-unc-path":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz","integrity":"sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==","dev":true,"requires":{"unc-path-regex":"^0.1.2"}},"is-utf8":{"version":"0.2.1","resolved":"https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz","integrity":"sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=","dev":true},"is-windows":{"version":"1.0.2","resolved":"https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz","integrity":"sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==","dev":true},"isarray":{"version":"0.0.1","resolved":"https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz","integrity":"sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="},"isexe":{"version":"2.0.0","resolved":"https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz","integrity":"sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=","dev":true},"isobject":{"version":"3.0.1","resolved":"https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz","integrity":"sha1-TkMekrEalzFjaqH5yNHMvP2reN8=","dev":true},"isstream":{"version":"0.1.2","resolved":"https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz","integrity":"sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=","dev":true},"istanbul-lib-coverage":{"version":"3.0.0","resolved":"https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz","integrity":"sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==","dev":true},"istanbul-lib-hook":{"version":"3.0.0","resolved":"https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz","integrity":"sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==","dev":true,"requires":{"append-transform":"^2.0.0"}},"istanbul-lib-instrument":{"version":"4.0.3","resolved":"https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz","integrity":"sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==","dev":true,"requires":{"@babel/core":"^7.7.5","@istanbuljs/schema":"^0.1.2","istanbul-lib-coverage":"^3.0.0","semver":"^6.3.0"},"dependencies":{"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"istanbul-lib-processinfo":{"version":"2.0.2","resolved":"https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz","integrity":"sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==","dev":true,"requires":{"archy":"^1.0.0","cross-spawn":"^7.0.0","istanbul-lib-coverage":"^3.0.0-alpha.1","make-dir":"^3.0.0","p-map":"^3.0.0","rimraf":"^3.0.0","uuid":"^3.3.3"},"dependencies":{"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"p-map":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz","integrity":"sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==","dev":true,"requires":{"aggregate-error":"^3.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"istanbul-lib-report":{"version":"3.0.0","resolved":"https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz","integrity":"sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==","dev":true,"requires":{"istanbul-lib-coverage":"^3.0.0","make-dir":"^3.0.0","supports-color":"^7.1.0"},"dependencies":{"has-flag":{"version":"4.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz","integrity":"sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==","dev":true},"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"supports-color":{"version":"7.2.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz","integrity":"sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==","dev":true,"requires":{"has-flag":"^4.0.0"}}}},"istanbul-lib-source-maps":{"version":"4.0.0","resolved":"https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz","integrity":"sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==","dev":true,"requires":{"debug":"^4.1.1","istanbul-lib-coverage":"^3.0.0","source-map":"^0.6.1"},"dependencies":{"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}},"source-map":{"version":"0.6.1","resolved":"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz","integrity":"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==","dev":true}}},"istanbul-reports":{"version":"3.0.2","resolved":"https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz","integrity":"sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==","dev":true,"requires":{"html-escaper":"^2.0.0","istanbul-lib-report":"^3.0.0"}},"js-sha3":{"version":"0.8.0","resolved":"https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz","integrity":"sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==","dev":true},"js-tokens":{"version":"4.0.0","resolved":"https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz","integrity":"sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==","dev":true},"js-yaml":{"version":"3.14.0","resolved":"https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz","integrity":"sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==","dev":true,"requires":{"argparse":"^1.0.7","esprima":"^4.0.0"}},"jsbn":{"version":"0.1.1","resolved":"https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz","integrity":"sha1-peZUwuWi3rXyAdls77yoDA7y9RM=","dev":true},"jsesc":{"version":"2.5.2","resolved":"https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz","integrity":"sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==","dev":true},"json-parse-better-errors":{"version":"1.0.2","resolved":"https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz","integrity":"sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==","dev":true},"json-parse-even-better-errors":{"version":"2.3.1","resolved":"https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz","integrity":"sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==","dev":true},"json-schema":{"version":"0.2.3","resolved":"https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz","integrity":"sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=","dev":true},"json-schema-traverse":{"version":"0.4.1","resolved":"https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz","integrity":"sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==","dev":true},"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=","dev":true},"json5":{"version":"2.1.3","resolved":"https://registry.npmjs.org/json5/-/json5-2.1.3.tgz","integrity":"sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==","dev":true,"requires":{"minimist":"^1.2.5"}},"jsonfile":{"version":"6.0.1","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz","integrity":"sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==","dev":true,"requires":{"graceful-fs":"^4.1.6","universalify":"^1.0.0"}},"jsonparse":{"version":"1.3.1","resolved":"https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz","integrity":"sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=","dev":true},"jsprim":{"version":"1.4.1","resolved":"https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz","integrity":"sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=","dev":true,"requires":{"assert-plus":"1.0.0","extsprintf":"1.3.0","json-schema":"0.2.3","verror":"1.10.0"}},"keccak":{"version":"3.0.0","resolved":"https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz","integrity":"sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==","requires":{"node-addon-api":"^2.0.0","node-gyp-build":"^4.2.0"}},"kind-of":{"version":"6.0.3","resolved":"https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz","integrity":"sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==","dev":true},"klaw":{"version":"1.3.1","resolved":"https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz","integrity":"sha1-QIhDO0azsbolnXh4XY6W9zugJDk=","dev":true,"requires":{"graceful-fs":"^4.1.9"}},"lerna":{"version":"3.22.1","resolved":"https://registry.npmjs.org/lerna/-/lerna-3.22.1.tgz","integrity":"sha512-vk1lfVRFm+UuEFA7wkLKeSF7Iz13W+N/vFd48aW2yuS7Kv0RbNm2/qcDPV863056LMfkRlsEe+QYOw3palj5Lg==","dev":true,"requires":{"@lerna/add":"3.21.0","@lerna/bootstrap":"3.21.0","@lerna/changed":"3.21.0","@lerna/clean":"3.21.0","@lerna/cli":"3.18.5","@lerna/create":"3.22.0","@lerna/diff":"3.21.0","@lerna/exec":"3.21.0","@lerna/import":"3.22.0","@lerna/info":"3.21.0","@lerna/init":"3.21.0","@lerna/link":"3.21.0","@lerna/list":"3.21.0","@lerna/publish":"3.22.1","@lerna/run":"3.21.0","@lerna/version":"3.22.1","import-local":"^2.0.0","npmlog":"^4.1.2"}},"level-codec":{"version":"7.0.1","resolved":"https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz","integrity":"sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ=="},"level-concat-iterator":{"version":"2.0.1","resolved":"https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz","integrity":"sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw=="},"level-errors":{"version":"1.0.5","resolved":"https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz","integrity":"sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==","requires":{"errno":"~0.1.1"}},"level-iterator-stream":{"version":"1.3.1","resolved":"https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz","integrity":"sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=","requires":{"inherits":"^2.0.1","level-errors":"^1.0.3","readable-stream":"^1.0.33","xtend":"^4.0.0"},"dependencies":{"readable-stream":{"version":"1.1.14","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz","integrity":"sha1-fPTFTvZI44EwhMY23SB54WbAgdk=","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.1","isarray":"0.0.1","string_decoder":"~0.10.x"}},"string_decoder":{"version":"0.10.31","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz","integrity":"sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"level-mem":{"version":"3.0.1","resolved":"https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz","integrity":"sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==","requires":{"level-packager":"~4.0.0","memdown":"~3.0.0"},"dependencies":{"abstract-leveldown":{"version":"5.0.0","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz","integrity":"sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==","requires":{"xtend":"~4.0.0"}},"immediate":{"version":"3.2.3","resolved":"https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz","integrity":"sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw="},"memdown":{"version":"3.0.0","resolved":"https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz","integrity":"sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==","requires":{"abstract-leveldown":"~5.0.0","functional-red-black-tree":"~1.0.1","immediate":"~3.2.3","inherits":"~2.0.1","ltgt":"~2.2.0","safe-buffer":"~5.1.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"level-option-wrap":{"version":"1.1.0","resolved":"https://registry.npmjs.org/level-option-wrap/-/level-option-wrap-1.1.0.tgz","integrity":"sha1-rSDmjZ88IsiJdTHMaqevWWse0Sk=","requires":{"defined":"~0.0.0"}},"level-packager":{"version":"4.0.1","resolved":"https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz","integrity":"sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==","requires":{"encoding-down":"~5.0.0","levelup":"^3.0.0"},"dependencies":{"abstract-leveldown":{"version":"5.0.0","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz","integrity":"sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==","requires":{"xtend":"~4.0.0"}},"deferred-leveldown":{"version":"4.0.2","resolved":"https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz","integrity":"sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==","requires":{"abstract-leveldown":"~5.0.0","inherits":"^2.0.3"}},"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="},"level-errors":{"version":"2.0.1","resolved":"https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz","integrity":"sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==","requires":{"errno":"~0.1.1"}},"level-iterator-stream":{"version":"3.0.1","resolved":"https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz","integrity":"sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==","requires":{"inherits":"^2.0.1","readable-stream":"^2.3.6","xtend":"^4.0.0"}},"levelup":{"version":"3.1.1","resolved":"https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz","integrity":"sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==","requires":{"deferred-leveldown":"~4.0.0","level-errors":"~2.0.0","level-iterator-stream":"~3.0.0","xtend":"~4.0.0"}},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","requires":{"safe-buffer":"~5.1.0"}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"level-supports":{"version":"1.0.1","resolved":"https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz","integrity":"sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==","requires":{"xtend":"^4.0.2"},"dependencies":{"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"level-ws":{"version":"0.0.0","resolved":"https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz","integrity":"sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=","requires":{"readable-stream":"~1.0.15","xtend":"~2.1.1"},"dependencies":{"readable-stream":{"version":"1.0.34","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz","integrity":"sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.1","isarray":"0.0.1","string_decoder":"~0.10.x"}},"string_decoder":{"version":"0.10.31","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz","integrity":"sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="}}},"leveldown":{"version":"5.6.0","resolved":"https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz","integrity":"sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==","requires":{"abstract-leveldown":"~6.2.1","napi-macros":"~2.0.0","node-gyp-build":"~4.1.0"},"dependencies":{"abstract-leveldown":{"version":"6.2.3","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz","integrity":"sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==","requires":{"buffer":"^5.5.0","immediate":"^3.2.3","level-concat-iterator":"~2.0.0","level-supports":"~1.0.0","xtend":"~4.0.0"}},"node-gyp-build":{"version":"4.1.1","resolved":"https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz","integrity":"sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ=="},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"lines-and-columns":{"version":"1.1.6","resolved":"https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz","integrity":"sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=","dev":true},"load-json-file":{"version":"5.3.0","resolved":"https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz","integrity":"sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==","dev":true,"requires":{"graceful-fs":"^4.1.15","parse-json":"^4.0.0","pify":"^4.0.1","strip-bom":"^3.0.0","type-fest":"^0.3.0"}},"locate-path":{"version":"3.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz","integrity":"sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==","dev":true,"requires":{"p-locate":"^3.0.0","path-exists":"^3.0.0"}},"lodash":{"version":"4.17.20","resolved":"https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz","integrity":"sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="},"lodash._reinterpolate":{"version":"3.0.0","resolved":"https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz","integrity":"sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=","dev":true},"lodash.clonedeep":{"version":"4.5.0","resolved":"https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz","integrity":"sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="},"lodash.flattendeep":{"version":"4.4.0","resolved":"https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz","integrity":"sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=","dev":true},"lodash.get":{"version":"4.4.2","resolved":"https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz","integrity":"sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=","dev":true},"lodash.ismatch":{"version":"4.4.0","resolved":"https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz","integrity":"sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=","dev":true},"lodash.set":{"version":"4.3.2","resolved":"https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz","integrity":"sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=","dev":true},"lodash.sortby":{"version":"4.7.0","resolved":"https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz","integrity":"sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=","dev":true},"lodash.template":{"version":"4.5.0","resolved":"https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz","integrity":"sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==","dev":true,"requires":{"lodash._reinterpolate":"^3.0.0","lodash.templatesettings":"^4.0.0"}},"lodash.templatesettings":{"version":"4.2.0","resolved":"https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz","integrity":"sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==","dev":true,"requires":{"lodash._reinterpolate":"^3.0.0"}},"lodash.uniq":{"version":"4.5.0","resolved":"https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz","integrity":"sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=","dev":true},"log-symbols":{"version":"4.0.0","resolved":"https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz","integrity":"sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==","dev":true,"requires":{"chalk":"^4.0.0"}},"loud-rejection":{"version":"1.6.0","resolved":"https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz","integrity":"sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=","dev":true,"requires":{"currently-unhandled":"^0.4.1","signal-exit":"^3.0.0"}},"lru-cache":{"version":"5.1.1","resolved":"https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz","integrity":"sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==","requires":{"yallist":"^3.0.2"}},"ltgt":{"version":"2.2.1","resolved":"https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz","integrity":"sha1-81ypHEk/e3PaDgdJUwTxezH4fuU="},"macos-release":{"version":"2.4.1","resolved":"https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz","integrity":"sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg==","dev":true},"make-dir":{"version":"1.3.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz","integrity":"sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==","dev":true,"requires":{"pify":"^3.0.0"},"dependencies":{"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true}}},"make-error":{"version":"1.3.6","resolved":"https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz","integrity":"sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==","dev":true},"make-fetch-happen":{"version":"5.0.2","resolved":"https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz","integrity":"sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==","dev":true,"requires":{"agentkeepalive":"^3.4.1","cacache":"^12.0.0","http-cache-semantics":"^3.8.1","http-proxy-agent":"^2.1.0","https-proxy-agent":"^2.2.3","lru-cache":"^5.1.1","mississippi":"^3.0.0","node-fetch-npm":"^2.0.2","promise-retry":"^1.1.1","socks-proxy-agent":"^4.0.0","ssri":"^6.0.0"}},"map-cache":{"version":"0.2.2","resolved":"https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz","integrity":"sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=","dev":true},"map-obj":{"version":"4.1.0","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz","integrity":"sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==","dev":true},"map-visit":{"version":"1.0.0","resolved":"https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz","integrity":"sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=","dev":true,"requires":{"object-visit":"^1.0.0"}},"md5.js":{"version":"1.3.5","resolved":"https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz","integrity":"sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==","requires":{"hash-base":"^3.0.0","inherits":"^2.0.1","safe-buffer":"^5.1.2"}},"memdown":{"version":"1.4.1","resolved":"https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz","integrity":"sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=","requires":{"abstract-leveldown":"~2.7.1","functional-red-black-tree":"^1.0.1","immediate":"^3.2.3","inherits":"~2.0.1","ltgt":"~2.2.0","safe-buffer":"~5.1.1"},"dependencies":{"abstract-leveldown":{"version":"2.7.2","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz","integrity":"sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==","requires":{"xtend":"~4.0.0"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"memorystream":{"version":"0.3.1","resolved":"https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz","integrity":"sha1-htcJCzDORV1j+64S3aUaR93K+bI=","dev":true},"meow":{"version":"7.1.1","resolved":"https://registry.npmjs.org/meow/-/meow-7.1.1.tgz","integrity":"sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==","dev":true,"requires":{"@types/minimist":"^1.2.0","camelcase-keys":"^6.2.2","decamelize-keys":"^1.1.0","hard-rejection":"^2.1.0","minimist-options":"4.1.0","normalize-package-data":"^2.5.0","read-pkg-up":"^7.0.1","redent":"^3.0.0","trim-newlines":"^3.0.0","type-fest":"^0.13.1","yargs-parser":"^18.1.3"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"parse-json":{"version":"5.1.0","resolved":"https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz","integrity":"sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==","dev":true,"requires":{"@babel/code-frame":"^7.0.0","error-ex":"^1.3.1","json-parse-even-better-errors":"^2.3.0","lines-and-columns":"^1.1.6"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"read-pkg":{"version":"5.2.0","resolved":"https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz","integrity":"sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==","dev":true,"requires":{"@types/normalize-package-data":"^2.4.0","normalize-package-data":"^2.5.0","parse-json":"^5.0.0","type-fest":"^0.6.0"},"dependencies":{"type-fest":{"version":"0.6.0","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz","integrity":"sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==","dev":true}}},"read-pkg-up":{"version":"7.0.1","resolved":"https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz","integrity":"sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==","dev":true,"requires":{"find-up":"^4.1.0","read-pkg":"^5.2.0","type-fest":"^0.8.1"},"dependencies":{"type-fest":{"version":"0.8.1","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz","integrity":"sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==","dev":true}}},"type-fest":{"version":"0.13.1","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz","integrity":"sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==","dev":true},"yargs-parser":{"version":"18.1.3","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz","integrity":"sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"}}}},"merge-stream":{"version":"2.0.0","resolved":"https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz","integrity":"sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==","dev":true},"merge2":{"version":"1.4.1","resolved":"https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz","integrity":"sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==","dev":true},"methods":{"version":"1.1.2","resolved":"https://registry.npmjs.org/methods/-/methods-1.1.2.tgz","integrity":"sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=","dev":true},"micromatch":{"version":"3.1.10","resolved":"https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz","integrity":"sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==","dev":true,"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"}},"miller-rabin":{"version":"4.0.1","resolved":"https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz","integrity":"sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==","requires":{"bn.js":"^4.0.0","brorand":"^1.0.1"}},"mime":{"version":"2.4.6","resolved":"https://registry.npmjs.org/mime/-/mime-2.4.6.tgz","integrity":"sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==","dev":true},"mime-db":{"version":"1.44.0","resolved":"https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz","integrity":"sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==","dev":true},"mime-types":{"version":"2.1.27","resolved":"https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz","integrity":"sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==","dev":true,"requires":{"mime-db":"1.44.0"}},"mimic-fn":{"version":"1.2.0","resolved":"https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz","integrity":"sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==","dev":true},"min-indent":{"version":"1.0.1","resolved":"https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz","integrity":"sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==","dev":true},"minimalistic-assert":{"version":"1.0.1","resolved":"https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz","integrity":"sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="},"minimalistic-crypto-utils":{"version":"1.0.1","resolved":"https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz","integrity":"sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo="},"minimatch":{"version":"3.0.4","resolved":"https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz","integrity":"sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==","requires":{"brace-expansion":"^1.1.7"}},"minimist":{"version":"1.2.5","resolved":"https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz","integrity":"sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==","dev":true},"minimist-options":{"version":"4.1.0","resolved":"https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz","integrity":"sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==","dev":true,"requires":{"arrify":"^1.0.1","is-plain-obj":"^1.1.0","kind-of":"^6.0.3"}},"minipass":{"version":"2.9.0","resolved":"https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz","integrity":"sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==","dev":true,"requires":{"safe-buffer":"^5.1.2","yallist":"^3.0.0"}},"minizlib":{"version":"1.3.3","resolved":"https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz","integrity":"sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==","dev":true,"requires":{"minipass":"^2.9.0"}},"mississippi":{"version":"3.0.0","resolved":"https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz","integrity":"sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==","dev":true,"requires":{"concat-stream":"^1.5.0","duplexify":"^3.4.2","end-of-stream":"^1.1.0","flush-write-stream":"^1.0.0","from2":"^2.1.0","parallel-transform":"^1.1.0","pump":"^3.0.0","pumpify":"^1.3.3","stream-each":"^1.1.0","through2":"^2.0.0"}},"mixin-deep":{"version":"1.3.2","resolved":"https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz","integrity":"sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==","dev":true,"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==","dev":true,"requires":{"is-plain-object":"^2.0.4"}}}},"mkdirp":{"version":"0.5.5","resolved":"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz","integrity":"sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==","dev":true,"requires":{"minimist":"^1.2.5"}},"mkdirp-promise":{"version":"5.0.1","resolved":"https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz","integrity":"sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=","dev":true,"requires":{"mkdirp":"*"}},"mocha":{"version":"8.2.0","resolved":"https://registry.npmjs.org/mocha/-/mocha-8.2.0.tgz","integrity":"sha512-lEWEMq2LMfNJMKeuEwb5UELi+OgFDollXaytR5ggQcHpzG3NP/R7rvixAvF+9/lLsTWhWG+4yD2M70GsM06nxw==","dev":true,"requires":{"@ungap/promise-all-settled":"1.1.2","ansi-colors":"4.1.1","browser-stdout":"1.3.1","chokidar":"3.4.3","debug":"4.2.0","diff":"4.0.2","escape-string-regexp":"4.0.0","find-up":"5.0.0","glob":"7.1.6","growl":"1.10.5","he":"1.2.0","js-yaml":"3.14.0","log-symbols":"4.0.0","minimatch":"3.0.4","ms":"2.1.2","nanoid":"3.1.12","serialize-javascript":"5.0.1","strip-json-comments":"3.1.1","supports-color":"7.2.0","which":"2.0.2","wide-align":"1.1.3","workerpool":"6.0.2","yargs":"13.3.2","yargs-parser":"13.1.2","yargs-unparser":"2.0.0"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true},"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}},"escape-string-regexp":{"version":"4.0.0","resolved":"https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz","integrity":"sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==","dev":true},"find-up":{"version":"5.0.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz","integrity":"sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==","dev":true,"requires":{"locate-path":"^6.0.0","path-exists":"^4.0.0"}},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"locate-path":{"version":"6.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz","integrity":"sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==","dev":true,"requires":{"p-locate":"^5.0.0"}},"p-limit":{"version":"3.0.2","resolved":"https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz","integrity":"sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==","dev":true,"requires":{"p-try":"^2.0.0"}},"p-locate":{"version":"5.0.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz","integrity":"sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==","dev":true,"requires":{"p-limit":"^3.0.2"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"string-width":{"version":"3.1.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz","integrity":"sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==","dev":true,"requires":{"emoji-regex":"^7.0.1","is-fullwidth-code-point":"^2.0.0","strip-ansi":"^5.1.0"}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"}},"yargs":{"version":"13.3.2","resolved":"https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz","integrity":"sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==","dev":true,"requires":{"cliui":"^5.0.0","find-up":"^3.0.0","get-caller-file":"^2.0.1","require-directory":"^2.1.1","require-main-filename":"^2.0.0","set-blocking":"^2.0.0","string-width":"^3.0.0","which-module":"^2.0.0","y18n":"^4.0.0","yargs-parser":"^13.1.2"},"dependencies":{"find-up":{"version":"3.0.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz","integrity":"sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==","dev":true,"requires":{"locate-path":"^3.0.0"}},"locate-path":{"version":"3.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz","integrity":"sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==","dev":true,"requires":{"p-locate":"^3.0.0","path-exists":"^3.0.0"}},"p-limit":{"version":"2.3.0","resolved":"https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz","integrity":"sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==","dev":true,"requires":{"p-try":"^2.0.0"}},"p-locate":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz","integrity":"sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==","dev":true,"requires":{"p-limit":"^2.0.0"}},"path-exists":{"version":"3.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz","integrity":"sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=","dev":true}}},"yargs-parser":{"version":"13.1.2","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz","integrity":"sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"}}}},"modify-values":{"version":"1.0.1","resolved":"https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz","integrity":"sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==","dev":true},"move-concurrently":{"version":"1.0.1","resolved":"https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz","integrity":"sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=","dev":true,"requires":{"aproba":"^1.1.1","copy-concurrently":"^1.0.0","fs-write-stream-atomic":"^1.0.8","mkdirp":"^0.5.1","rimraf":"^2.5.4","run-queue":"^1.0.3"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}}}},"mri":{"version":"1.1.6","resolved":"https://registry.npmjs.org/mri/-/mri-1.1.6.tgz","integrity":"sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==","dev":true},"ms":{"version":"2.1.2","resolved":"https://registry.npmjs.org/ms/-/ms-2.1.2.tgz","integrity":"sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==","dev":true},"multimatch":{"version":"3.0.0","resolved":"https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz","integrity":"sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==","dev":true,"requires":{"array-differ":"^2.0.3","array-union":"^1.0.2","arrify":"^1.0.1","minimatch":"^3.0.4"}},"mute-stream":{"version":"0.0.7","resolved":"https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz","integrity":"sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=","dev":true},"mz":{"version":"2.7.0","resolved":"https://registry.npmjs.org/mz/-/mz-2.7.0.tgz","integrity":"sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==","dev":true,"requires":{"any-promise":"^1.0.0","object-assign":"^4.0.1","thenify-all":"^1.0.0"}},"nanoid":{"version":"3.1.12","resolved":"https://registry.npmjs.org/nanoid/-/nanoid-3.1.12.tgz","integrity":"sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==","dev":true},"nanomatch":{"version":"1.2.13","resolved":"https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz","integrity":"sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==","dev":true,"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-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"}},"napi-macros":{"version":"2.0.0","resolved":"https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz","integrity":"sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg=="},"neo-async":{"version":"2.6.2","resolved":"https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz","integrity":"sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==","dev":true},"nice-try":{"version":"1.0.5","resolved":"https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz","integrity":"sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==","dev":true},"node-addon-api":{"version":"2.0.2","resolved":"https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz","integrity":"sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA=="},"node-fetch":{"version":"2.6.1","resolved":"https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz","integrity":"sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==","dev":true},"node-fetch-npm":{"version":"2.0.4","resolved":"https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz","integrity":"sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg==","dev":true,"requires":{"encoding":"^0.1.11","json-parse-better-errors":"^1.0.0","safe-buffer":"^5.1.1"}},"node-gyp":{"version":"5.1.1","resolved":"https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz","integrity":"sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw==","dev":true,"requires":{"env-paths":"^2.2.0","glob":"^7.1.4","graceful-fs":"^4.2.2","mkdirp":"^0.5.1","nopt":"^4.0.1","npmlog":"^4.1.2","request":"^2.88.0","rimraf":"^2.6.3","semver":"^5.7.1","tar":"^4.4.12","which":"^1.3.1"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"which":{"version":"1.3.1","resolved":"https://registry.npmjs.org/which/-/which-1.3.1.tgz","integrity":"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==","dev":true,"requires":{"isexe":"^2.0.0"}}}},"node-gyp-build":{"version":"4.2.3","resolved":"https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz","integrity":"sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg=="},"node-preload":{"version":"0.2.1","resolved":"https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz","integrity":"sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==","dev":true,"requires":{"process-on-spawn":"^1.0.0"}},"nopt":{"version":"4.0.3","resolved":"https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz","integrity":"sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==","dev":true,"requires":{"abbrev":"1","osenv":"^0.1.4"}},"normalize-package-data":{"version":"2.5.0","resolved":"https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz","integrity":"sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==","dev":true,"requires":{"hosted-git-info":"^2.1.4","resolve":"^1.10.0","semver":"2 || 3 || 4 || 5","validate-npm-package-license":"^3.0.1"}},"normalize-path":{"version":"3.0.0","resolved":"https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz","integrity":"sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==","dev":true},"normalize-url":{"version":"3.3.0","resolved":"https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz","integrity":"sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==","dev":true},"npm-bundled":{"version":"1.1.1","resolved":"https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz","integrity":"sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==","dev":true,"requires":{"npm-normalize-package-bin":"^1.0.1"}},"npm-lifecycle":{"version":"3.1.5","resolved":"https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz","integrity":"sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g==","dev":true,"requires":{"byline":"^5.0.0","graceful-fs":"^4.1.15","node-gyp":"^5.0.2","resolve-from":"^4.0.0","slide":"^1.1.6","uid-number":"0.0.6","umask":"^1.1.0","which":"^1.3.1"},"dependencies":{"which":{"version":"1.3.1","resolved":"https://registry.npmjs.org/which/-/which-1.3.1.tgz","integrity":"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==","dev":true,"requires":{"isexe":"^2.0.0"}}}},"npm-normalize-package-bin":{"version":"1.0.1","resolved":"https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz","integrity":"sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==","dev":true},"npm-package-arg":{"version":"8.1.0","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.0.tgz","integrity":"sha512-/ep6QDxBkm9HvOhOg0heitSd7JHA1U7y1qhhlRlteYYAi9Pdb/ZV7FW5aHpkrpM8+P+4p/jjR8zCyKPBMBjSig==","dev":true,"requires":{"hosted-git-info":"^3.0.6","semver":"^7.0.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"hosted-git-info":{"version":"3.0.7","resolved":"https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz","integrity":"sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==","dev":true,"requires":{"lru-cache":"^6.0.0"}},"lru-cache":{"version":"6.0.0","resolved":"https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz","integrity":"sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==","dev":true,"requires":{"yallist":"^4.0.0"}},"semver":{"version":"7.3.2","resolved":"https://registry.npmjs.org/semver/-/semver-7.3.2.tgz","integrity":"sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==","dev":true},"yallist":{"version":"4.0.0","resolved":"https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz","integrity":"sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==","dev":true}}},"npm-packlist":{"version":"1.4.8","resolved":"https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz","integrity":"sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==","dev":true,"requires":{"ignore-walk":"^3.0.1","npm-bundled":"^1.0.1","npm-normalize-package-bin":"^1.0.1"}},"npm-pick-manifest":{"version":"3.0.2","resolved":"https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz","integrity":"sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==","dev":true,"requires":{"figgy-pudding":"^3.5.1","npm-package-arg":"^6.0.0","semver":"^5.4.1"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}}}},"npm-run-path":{"version":"2.0.2","resolved":"https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz","integrity":"sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=","dev":true,"requires":{"path-key":"^2.0.0"},"dependencies":{"path-key":{"version":"2.0.1","resolved":"https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz","integrity":"sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=","dev":true}}},"npmlog":{"version":"4.1.2","resolved":"https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz","integrity":"sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==","dev":true,"requires":{"are-we-there-yet":"~1.1.2","console-control-strings":"~1.1.0","gauge":"~2.7.3","set-blocking":"~2.0.0"}},"number-is-nan":{"version":"1.0.1","resolved":"https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz","integrity":"sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=","dev":true},"nyc":{"version":"15.1.0","resolved":"https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz","integrity":"sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==","dev":true,"requires":{"@istanbuljs/load-nyc-config":"^1.0.0","@istanbuljs/schema":"^0.1.2","caching-transform":"^4.0.0","convert-source-map":"^1.7.0","decamelize":"^1.2.0","find-cache-dir":"^3.2.0","find-up":"^4.1.0","foreground-child":"^2.0.0","get-package-type":"^0.1.0","glob":"^7.1.6","istanbul-lib-coverage":"^3.0.0","istanbul-lib-hook":"^3.0.0","istanbul-lib-instrument":"^4.0.0","istanbul-lib-processinfo":"^2.0.2","istanbul-lib-report":"^3.0.0","istanbul-lib-source-maps":"^4.0.0","istanbul-reports":"^3.0.2","make-dir":"^3.0.0","node-preload":"^0.2.1","p-map":"^3.0.0","process-on-spawn":"^1.0.0","resolve-from":"^5.0.0","rimraf":"^3.0.0","signal-exit":"^3.0.2","spawn-wrap":"^2.0.0","test-exclude":"^6.0.0","yargs":"^15.0.2"},"dependencies":{"ansi-regex":{"version":"5.0.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz","integrity":"sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==","dev":true},"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"cliui":{"version":"6.0.0","resolved":"https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz","integrity":"sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==","dev":true,"requires":{"string-width":"^4.2.0","strip-ansi":"^6.0.0","wrap-ansi":"^6.2.0"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true},"emoji-regex":{"version":"8.0.0","resolved":"https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz","integrity":"sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==","dev":true},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"is-fullwidth-code-point":{"version":"3.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz","integrity":"sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==","dev":true},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"p-map":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz","integrity":"sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==","dev":true,"requires":{"aggregate-error":"^3.0.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"resolve-from":{"version":"5.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz","integrity":"sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==","dev":true},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"string-width":{"version":"4.2.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz","integrity":"sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==","dev":true,"requires":{"emoji-regex":"^8.0.0","is-fullwidth-code-point":"^3.0.0","strip-ansi":"^6.0.0"}},"strip-ansi":{"version":"6.0.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz","integrity":"sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==","dev":true,"requires":{"ansi-regex":"^5.0.0"}},"wrap-ansi":{"version":"6.2.0","resolved":"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz","integrity":"sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==","dev":true,"requires":{"ansi-styles":"^4.0.0","string-width":"^4.1.0","strip-ansi":"^6.0.0"}},"yargs":{"version":"15.4.1","resolved":"https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz","integrity":"sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==","dev":true,"requires":{"cliui":"^6.0.0","decamelize":"^1.2.0","find-up":"^4.1.0","get-caller-file":"^2.0.1","require-directory":"^2.1.1","require-main-filename":"^2.0.0","set-blocking":"^2.0.0","string-width":"^4.2.0","which-module":"^2.0.0","y18n":"^4.0.0","yargs-parser":"^18.1.2"}},"yargs-parser":{"version":"18.1.3","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz","integrity":"sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"}}}},"oauth-sign":{"version":"0.9.0","resolved":"https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz","integrity":"sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==","dev":true},"object-assign":{"version":"4.1.1","resolved":"https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz","integrity":"sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=","dev":true},"object-copy":{"version":"0.1.0","resolved":"https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz","integrity":"sha1-fn2Fi3gb18mRpBupde04EnVOmYw=","dev":true,"requires":{"copy-descriptor":"^0.1.0","define-property":"^0.2.5","kind-of":"^3.0.3"},"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=","dev":true,"requires":{"is-descriptor":"^0.1.0"}},"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"}}}},"object-inspect":{"version":"1.8.0","resolved":"https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz","integrity":"sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA=="},"object-keys":{"version":"0.4.0","resolved":"https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz","integrity":"sha1-KKaq50KN0sOpLz2V8hM13SBOAzY="},"object-visit":{"version":"1.0.1","resolved":"https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz","integrity":"sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=","dev":true,"requires":{"isobject":"^3.0.0"}},"object.assign":{"version":"4.1.1","resolved":"https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz","integrity":"sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.18.0-next.0","has-symbols":"^1.0.1","object-keys":"^1.1.1"},"dependencies":{"es-abstract":{"version":"1.18.0-next.0","resolved":"https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz","integrity":"sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==","requires":{"es-to-primitive":"^1.2.1","function-bind":"^1.1.1","has":"^1.0.3","has-symbols":"^1.0.1","is-callable":"^1.2.0","is-negative-zero":"^2.0.0","is-regex":"^1.1.1","object-inspect":"^1.8.0","object-keys":"^1.1.1","object.assign":"^4.1.0","string.prototype.trimend":"^1.0.1","string.prototype.trimstart":"^1.0.1"}},"object-keys":{"version":"1.1.1","resolved":"https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz","integrity":"sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="}}},"object.getownpropertydescriptors":{"version":"2.1.0","resolved":"https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz","integrity":"sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.17.0-next.1"}},"object.pick":{"version":"1.3.0","resolved":"https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz","integrity":"sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=","dev":true,"requires":{"isobject":"^3.0.1"}},"octokit-pagination-methods":{"version":"1.1.0","resolved":"https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz","integrity":"sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==","dev":true},"once":{"version":"1.4.0","resolved":"https://registry.npmjs.org/once/-/once-1.4.0.tgz","integrity":"sha1-WDsap3WWHUsROsF9nFC6753Xa9E=","requires":{"wrappy":"1"}},"onetime":{"version":"2.0.1","resolved":"https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz","integrity":"sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=","dev":true,"requires":{"mimic-fn":"^1.0.0"}},"opencollective-postinstall":{"version":"2.0.3","resolved":"https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz","integrity":"sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==","dev":true},"os-homedir":{"version":"1.0.2","resolved":"https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz","integrity":"sha1-/7xJiDNuDoM94MFox+8VISGqf7M=","dev":true},"os-name":{"version":"3.1.0","resolved":"https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz","integrity":"sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==","dev":true,"requires":{"macos-release":"^2.2.0","windows-release":"^3.1.0"}},"os-tmpdir":{"version":"1.0.2","resolved":"https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz","integrity":"sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=","dev":true},"osenv":{"version":"0.1.5","resolved":"https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz","integrity":"sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==","dev":true,"requires":{"os-homedir":"^1.0.0","os-tmpdir":"^1.0.0"}},"p-finally":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz","integrity":"sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=","dev":true},"p-is-promise":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz","integrity":"sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==","dev":true},"p-limit":{"version":"2.3.0","resolved":"https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz","integrity":"sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==","dev":true,"requires":{"p-try":"^2.0.0"}},"p-locate":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz","integrity":"sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==","dev":true,"requires":{"p-limit":"^2.0.0"}},"p-map":{"version":"2.1.0","resolved":"https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz","integrity":"sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==","dev":true},"p-map-series":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-map-series/-/p-map-series-1.0.0.tgz","integrity":"sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco=","dev":true,"requires":{"p-reduce":"^1.0.0"}},"p-pipe":{"version":"1.2.0","resolved":"https://registry.npmjs.org/p-pipe/-/p-pipe-1.2.0.tgz","integrity":"sha1-SxoROZoRUgpneQ7loMHViB1r7+k=","dev":true},"p-queue":{"version":"4.0.0","resolved":"https://registry.npmjs.org/p-queue/-/p-queue-4.0.0.tgz","integrity":"sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg==","dev":true,"requires":{"eventemitter3":"^3.1.0"}},"p-reduce":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz","integrity":"sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=","dev":true},"p-try":{"version":"2.2.0","resolved":"https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz","integrity":"sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==","dev":true},"p-waterfall":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-waterfall/-/p-waterfall-1.0.0.tgz","integrity":"sha1-ftlLPOszMngjU69qrhGqn8I1uwA=","dev":true,"requires":{"p-reduce":"^1.0.0"}},"package-hash":{"version":"4.0.0","resolved":"https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz","integrity":"sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==","dev":true,"requires":{"graceful-fs":"^4.1.15","hasha":"^5.0.0","lodash.flattendeep":"^4.4.0","release-zalgo":"^1.0.0"}},"parallel-transform":{"version":"1.2.0","resolved":"https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz","integrity":"sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==","dev":true,"requires":{"cyclist":"^1.0.1","inherits":"^2.0.3","readable-stream":"^2.1.5"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"parent-module":{"version":"1.0.1","resolved":"https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz","integrity":"sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==","dev":true,"requires":{"callsites":"^3.0.0"},"dependencies":{"callsites":{"version":"3.1.0","resolved":"https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz","integrity":"sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==","dev":true}}},"parse-git-config":{"version":"1.1.1","resolved":"https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz","integrity":"sha1-06mYQxcTL1c5hxK7pDjhKVkN34w=","dev":true,"requires":{"extend-shallow":"^2.0.1","fs-exists-sync":"^0.1.0","git-config-path":"^1.0.1","ini":"^1.3.4"},"dependencies":{"extend-shallow":{"version":"2.0.1","resolved":"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz","integrity":"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"parse-github-repo-url":{"version":"1.4.1","resolved":"https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz","integrity":"sha1-nn2LslKmy2ukJZUGC3v23z28H1A=","dev":true},"parse-json":{"version":"4.0.0","resolved":"https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz","integrity":"sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=","dev":true,"requires":{"error-ex":"^1.3.1","json-parse-better-errors":"^1.0.1"}},"parse-passwd":{"version":"1.0.0","resolved":"https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz","integrity":"sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=","dev":true},"parse-path":{"version":"4.0.2","resolved":"https://registry.npmjs.org/parse-path/-/parse-path-4.0.2.tgz","integrity":"sha512-HSqVz6iuXSiL8C1ku5Gl1Z5cwDd9Wo0q8CoffdAghP6bz8pJa1tcMC+m4N+z6VAS8QdksnIGq1TB6EgR4vPR6w==","dev":true,"requires":{"is-ssh":"^1.3.0","protocols":"^1.4.0"}},"parse-url":{"version":"5.0.2","resolved":"https://registry.npmjs.org/parse-url/-/parse-url-5.0.2.tgz","integrity":"sha512-Czj+GIit4cdWtxo3ISZCvLiUjErSo0iI3wJ+q9Oi3QuMYTI6OZu+7cewMWZ+C1YAnKhYTk6/TLuhIgCypLthPA==","dev":true,"requires":{"is-ssh":"^1.3.0","normalize-url":"^3.3.0","parse-path":"^4.0.0","protocols":"^1.4.0"}},"parse5":{"version":"5.1.1","resolved":"https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz","integrity":"sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==","dev":true},"parse5-htmlparser2-tree-adapter":{"version":"5.1.1","resolved":"https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz","integrity":"sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw==","dev":true,"requires":{"parse5":"^5.1.1"}},"pascalcase":{"version":"0.1.1","resolved":"https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz","integrity":"sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=","dev":true},"path-dirname":{"version":"1.0.2","resolved":"https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz","integrity":"sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=","dev":true},"path-exists":{"version":"3.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz","integrity":"sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=","dev":true},"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-key":{"version":"3.1.1","resolved":"https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz","integrity":"sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==","dev":true},"path-parse":{"version":"1.0.6","resolved":"https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz","integrity":"sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==","dev":true},"path-type":{"version":"3.0.0","resolved":"https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz","integrity":"sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==","dev":true,"requires":{"pify":"^3.0.0"},"dependencies":{"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true}}},"pbkdf2":{"version":"3.1.1","resolved":"https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz","integrity":"sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==","requires":{"create-hash":"^1.1.2","create-hmac":"^1.1.4","ripemd160":"^2.0.1","safe-buffer":"^5.0.1","sha.js":"^2.4.8"}},"performance-now":{"version":"2.1.0","resolved":"https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz","integrity":"sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=","dev":true},"picomatch":{"version":"2.2.2","resolved":"https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz","integrity":"sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==","dev":true},"pify":{"version":"4.0.1","resolved":"https://registry.npmjs.org/pify/-/pify-4.0.1.tgz","integrity":"sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==","dev":true},"pinkie":{"version":"2.0.4","resolved":"https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz","integrity":"sha1-clVrgM+g1IqXToDnckjoDtT3+HA=","dev":true},"pinkie-promise":{"version":"2.0.1","resolved":"https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz","integrity":"sha1-ITXW36ejWMBprJsXh3YogihFD/o=","dev":true,"requires":{"pinkie":"^2.0.0"}},"pkg-dir":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz","integrity":"sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==","dev":true,"requires":{"find-up":"^3.0.0"}},"please-upgrade-node":{"version":"3.2.0","resolved":"https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz","integrity":"sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==","dev":true,"requires":{"semver-compare":"^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=","dev":true},"prettier":{"version":"2.1.2","resolved":"https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz","integrity":"sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==","dev":true},"pretty-quick":{"version":"3.1.0","resolved":"https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.1.0.tgz","integrity":"sha512-DtxIxksaUWCgPFN7E1ZZk4+Aav3CCuRdhrDSFZENb404sYMtuo9Zka823F+Mgeyt8Zt3bUiCjFzzWYE9LYqkmQ==","dev":true,"requires":{"chalk":"^3.0.0","execa":"^4.0.0","find-up":"^4.1.0","ignore":"^5.1.4","mri":"^1.1.5","multimatch":"^4.0.0"},"dependencies":{"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"array-differ":{"version":"3.0.0","resolved":"https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz","integrity":"sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==","dev":true},"array-union":{"version":"2.1.0","resolved":"https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz","integrity":"sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==","dev":true},"arrify":{"version":"2.0.1","resolved":"https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz","integrity":"sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==","dev":true},"chalk":{"version":"3.0.0","resolved":"https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz","integrity":"sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==","dev":true,"requires":{"ansi-styles":"^4.1.0","supports-color":"^7.1.0"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true},"execa":{"version":"4.1.0","resolved":"https://registry.npmjs.org/execa/-/execa-4.1.0.tgz","integrity":"sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==","dev":true,"requires":{"cross-spawn":"^7.0.0","get-stream":"^5.0.0","human-signals":"^1.1.1","is-stream":"^2.0.0","merge-stream":"^2.0.0","npm-run-path":"^4.0.0","onetime":"^5.1.0","signal-exit":"^3.0.2","strip-final-newline":"^2.0.0"}},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"get-stream":{"version":"5.2.0","resolved":"https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz","integrity":"sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==","dev":true,"requires":{"pump":"^3.0.0"}},"ignore":{"version":"5.1.8","resolved":"https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz","integrity":"sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==","dev":true},"is-stream":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz","integrity":"sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==","dev":true},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"mimic-fn":{"version":"2.1.0","resolved":"https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz","integrity":"sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==","dev":true},"multimatch":{"version":"4.0.0","resolved":"https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz","integrity":"sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==","dev":true,"requires":{"@types/minimatch":"^3.0.3","array-differ":"^3.0.0","array-union":"^2.1.0","arrify":"^2.0.1","minimatch":"^3.0.4"}},"npm-run-path":{"version":"4.0.1","resolved":"https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz","integrity":"sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==","dev":true,"requires":{"path-key":"^3.0.0"}},"onetime":{"version":"5.1.2","resolved":"https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz","integrity":"sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==","dev":true,"requires":{"mimic-fn":"^2.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true}}},"process-nextick-args":{"version":"2.0.1","resolved":"https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz","integrity":"sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="},"process-on-spawn":{"version":"1.0.0","resolved":"https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz","integrity":"sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==","dev":true,"requires":{"fromentries":"^1.2.0"}},"promise-inflight":{"version":"1.0.1","resolved":"https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz","integrity":"sha1-mEcocL8igTL8vdhoEputEsPAKeM=","dev":true},"promise-retry":{"version":"1.1.1","resolved":"https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz","integrity":"sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=","dev":true,"requires":{"err-code":"^1.0.0","retry":"^0.10.0"}},"promzard":{"version":"0.3.0","resolved":"https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz","integrity":"sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=","dev":true,"requires":{"read":"1"}},"proto-list":{"version":"1.2.4","resolved":"https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz","integrity":"sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=","dev":true},"protocols":{"version":"1.4.8","resolved":"https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz","integrity":"sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg==","dev":true},"protoduck":{"version":"5.0.1","resolved":"https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz","integrity":"sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==","dev":true,"requires":{"genfun":"^5.0.0"}},"prr":{"version":"1.0.1","resolved":"https://registry.npmjs.org/prr/-/prr-1.0.1.tgz","integrity":"sha1-0/wRS6BplaRexok/SEzrHXj19HY="},"psl":{"version":"1.8.0","resolved":"https://registry.npmjs.org/psl/-/psl-1.8.0.tgz","integrity":"sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==","dev":true},"pump":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pump/-/pump-3.0.0.tgz","integrity":"sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==","dev":true,"requires":{"end-of-stream":"^1.1.0","once":"^1.3.1"}},"pumpify":{"version":"1.5.1","resolved":"https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz","integrity":"sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==","dev":true,"requires":{"duplexify":"^3.6.0","inherits":"^2.0.3","pump":"^2.0.0"},"dependencies":{"pump":{"version":"2.0.1","resolved":"https://registry.npmjs.org/pump/-/pump-2.0.1.tgz","integrity":"sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==","dev":true,"requires":{"end-of-stream":"^1.1.0","once":"^1.3.1"}}}},"punycode":{"version":"2.1.1","resolved":"https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz","integrity":"sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==","dev":true},"q":{"version":"1.5.1","resolved":"https://registry.npmjs.org/q/-/q-1.5.1.tgz","integrity":"sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=","dev":true},"qs":{"version":"6.5.2","resolved":"https://registry.npmjs.org/qs/-/qs-6.5.2.tgz","integrity":"sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==","dev":true},"quick-lru":{"version":"4.0.1","resolved":"https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz","integrity":"sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==","dev":true},"randombytes":{"version":"2.1.0","resolved":"https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz","integrity":"sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==","requires":{"safe-buffer":"^5.1.0"}},"reachdown":{"version":"1.1.0","resolved":"https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz","integrity":"sha512-6LsdRe4cZyOjw4NnvbhUd/rGG7WQ9HMopPr+kyL018Uci4kijtxcGR5kVb5Ln13k4PEE+fEFQbjfOvNw7cnXmA=="},"read":{"version":"1.0.7","resolved":"https://registry.npmjs.org/read/-/read-1.0.7.tgz","integrity":"sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=","dev":true,"requires":{"mute-stream":"~0.0.4"}},"read-cmd-shim":{"version":"1.0.5","resolved":"https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz","integrity":"sha512-v5yCqQ/7okKoZZkBQUAfTsQ3sVJtXdNfbPnI5cceppoxEVLYA3k+VtV2omkeo8MS94JCy4fSiUwlRBAwCVRPUA==","dev":true,"requires":{"graceful-fs":"^4.1.2"}},"read-package-json":{"version":"2.1.2","resolved":"https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz","integrity":"sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==","dev":true,"requires":{"glob":"^7.1.1","json-parse-even-better-errors":"^2.3.0","normalize-package-data":"^2.0.0","npm-normalize-package-bin":"^1.0.0"}},"read-package-tree":{"version":"5.3.1","resolved":"https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz","integrity":"sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==","dev":true,"requires":{"read-package-json":"^2.0.0","readdir-scoped-modules":"^1.0.0","util-promisify":"^2.1.0"}},"read-pkg":{"version":"3.0.0","resolved":"https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz","integrity":"sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=","dev":true,"requires":{"load-json-file":"^4.0.0","normalize-package-data":"^2.3.2","path-type":"^3.0.0"},"dependencies":{"load-json-file":{"version":"4.0.0","resolved":"https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz","integrity":"sha1-L19Fq5HjMhYjT9U62rZo607AmTs=","dev":true,"requires":{"graceful-fs":"^4.1.2","parse-json":"^4.0.0","pify":"^3.0.0","strip-bom":"^3.0.0"}},"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true}}},"read-pkg-up":{"version":"3.0.0","resolved":"https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz","integrity":"sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=","dev":true,"requires":{"find-up":"^2.0.0","read-pkg":"^3.0.0"},"dependencies":{"find-up":{"version":"2.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz","integrity":"sha1-RdG35QbHF93UgndaK3eSCjwMV6c=","dev":true,"requires":{"locate-path":"^2.0.0"}},"locate-path":{"version":"2.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz","integrity":"sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=","dev":true,"requires":{"p-locate":"^2.0.0","path-exists":"^3.0.0"}},"p-limit":{"version":"1.3.0","resolved":"https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz","integrity":"sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==","dev":true,"requires":{"p-try":"^1.0.0"}},"p-locate":{"version":"2.0.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz","integrity":"sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=","dev":true,"requires":{"p-limit":"^1.1.0"}},"p-try":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz","integrity":"sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=","dev":true}}},"readable-stream":{"version":"3.6.0","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz","integrity":"sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==","requires":{"inherits":"^2.0.3","string_decoder":"^1.1.1","util-deprecate":"^1.0.1"}},"readdir-scoped-modules":{"version":"1.1.0","resolved":"https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz","integrity":"sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==","dev":true,"requires":{"debuglog":"^1.0.1","dezalgo":"^1.0.0","graceful-fs":"^4.1.2","once":"^1.3.0"}},"readdirp":{"version":"3.5.0","resolved":"https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz","integrity":"sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==","dev":true,"requires":{"picomatch":"^2.2.1"}},"rechoir":{"version":"0.6.2","resolved":"https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz","integrity":"sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=","dev":true,"requires":{"resolve":"^1.1.6"}},"redent":{"version":"3.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-3.0.0.tgz","integrity":"sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==","dev":true,"requires":{"indent-string":"^4.0.0","strip-indent":"^3.0.0"}},"regex-not":{"version":"1.0.2","resolved":"https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz","integrity":"sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==","dev":true,"requires":{"extend-shallow":"^3.0.2","safe-regex":"^1.1.0"}},"release-zalgo":{"version":"1.0.0","resolved":"https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz","integrity":"sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=","dev":true,"requires":{"es6-error":"^4.0.1"}},"repeat-element":{"version":"1.1.3","resolved":"https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz","integrity":"sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==","dev":true},"repeat-string":{"version":"1.6.1","resolved":"https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz","integrity":"sha1-jcrkcOHIirwtYA//Sndihtp15jc=","dev":true},"repeating":{"version":"2.0.1","resolved":"https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz","integrity":"sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=","dev":true,"requires":{"is-finite":"^1.0.0"}},"request":{"version":"2.88.2","resolved":"https://registry.npmjs.org/request/-/request-2.88.2.tgz","integrity":"sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==","dev":true,"requires":{"aws-sign2":"~0.7.0","aws4":"^1.8.0","caseless":"~0.12.0","combined-stream":"~1.0.6","extend":"~3.0.2","forever-agent":"~0.6.1","form-data":"~2.3.2","har-validator":"~5.1.3","http-signature":"~1.2.0","is-typedarray":"~1.0.0","isstream":"~0.1.2","json-stringify-safe":"~5.0.1","mime-types":"~2.1.19","oauth-sign":"~0.9.0","performance-now":"^2.1.0","qs":"~6.5.2","safe-buffer":"^5.1.2","tough-cookie":"~2.5.0","tunnel-agent":"^0.6.0","uuid":"^3.3.2"}},"require-directory":{"version":"2.1.1","resolved":"https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz","integrity":"sha1-jGStX9MNqxyXbiNE/+f3kqam30I=","dev":true},"require-from-string":{"version":"2.0.2","resolved":"https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz","integrity":"sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==","dev":true},"require-main-filename":{"version":"2.0.0","resolved":"https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz","integrity":"sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==","dev":true},"resolve":{"version":"1.17.0","resolved":"https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz","integrity":"sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==","dev":true,"requires":{"path-parse":"^1.0.6"}},"resolve-cwd":{"version":"2.0.0","resolved":"https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz","integrity":"sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=","dev":true,"requires":{"resolve-from":"^3.0.0"},"dependencies":{"resolve-from":{"version":"3.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz","integrity":"sha1-six699nWiBvItuZTM17rywoYh0g=","dev":true}}},"resolve-from":{"version":"4.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz","integrity":"sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==","dev":true},"resolve-url":{"version":"0.2.1","resolved":"https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz","integrity":"sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=","dev":true},"restore-cursor":{"version":"2.0.0","resolved":"https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz","integrity":"sha1-n37ih/gv0ybU/RYpI9YhKe7g368=","dev":true,"requires":{"onetime":"^2.0.0","signal-exit":"^3.0.2"}},"ret":{"version":"0.1.15","resolved":"https://registry.npmjs.org/ret/-/ret-0.1.15.tgz","integrity":"sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==","dev":true},"retry":{"version":"0.10.1","resolved":"https://registry.npmjs.org/retry/-/retry-0.10.1.tgz","integrity":"sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=","dev":true},"reusify":{"version":"1.0.4","resolved":"https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz","integrity":"sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==","dev":true},"rimraf":{"version":"3.0.2","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz","integrity":"sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==","requires":{"glob":"^7.1.3"}},"ripemd160":{"version":"2.0.2","resolved":"https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz","integrity":"sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==","requires":{"hash-base":"^3.0.0","inherits":"^2.0.1"}},"rlp":{"version":"2.2.6","resolved":"https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz","integrity":"sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==","requires":{"bn.js":"^4.11.1"}},"run-async":{"version":"2.4.1","resolved":"https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz","integrity":"sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==","dev":true},"run-parallel":{"version":"1.1.9","resolved":"https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz","integrity":"sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==","dev":true},"run-queue":{"version":"1.0.3","resolved":"https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz","integrity":"sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=","dev":true,"requires":{"aproba":"^1.1.1"}},"rustbn.js":{"version":"0.2.0","resolved":"https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz","integrity":"sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA=="},"rxjs":{"version":"6.6.3","resolved":"https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz","integrity":"sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==","dev":true,"requires":{"tslib":"^1.9.0"}},"safe-buffer":{"version":"5.2.1","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz","integrity":"sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="},"safe-regex":{"version":"1.1.0","resolved":"https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz","integrity":"sha1-QKNmnzsHfR6UPURinhV91IAjvy4=","dev":true,"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==","dev":true},"scrypt-js":{"version":"3.0.1","resolved":"https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz","integrity":"sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA=="},"secp256k1":{"version":"4.0.2","resolved":"https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz","integrity":"sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==","requires":{"elliptic":"^6.5.2","node-addon-api":"^2.0.0","node-gyp-build":"^4.2.0"}},"seedrandom":{"version":"3.0.5","resolved":"https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz","integrity":"sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="},"semaphore":{"version":"1.1.0","resolved":"https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz","integrity":"sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA=="},"semver":{"version":"5.4.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.4.1.tgz","integrity":"sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg=="},"semver-compare":{"version":"1.0.0","resolved":"https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz","integrity":"sha1-De4hahyUGrN+nvsXiPavxf9VN/w=","dev":true},"semver-regex":{"version":"2.0.0","resolved":"https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz","integrity":"sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==","dev":true},"serialize-javascript":{"version":"5.0.1","resolved":"https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz","integrity":"sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==","dev":true,"requires":{"randombytes":"^2.1.0"}},"set-blocking":{"version":"2.0.0","resolved":"https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz","integrity":"sha1-BF+XgtARrppoA93TgrJDkrPYkPc=","dev":true},"set-value":{"version":"2.0.1","resolved":"https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz","integrity":"sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==","dev":true,"requires":{"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"setimmediate":{"version":"1.0.5","resolved":"https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz","integrity":"sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="},"sha.js":{"version":"2.4.11","resolved":"https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz","integrity":"sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==","requires":{"inherits":"^2.0.1","safe-buffer":"^5.0.1"}},"shallow-clone":{"version":"3.0.1","resolved":"https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz","integrity":"sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==","dev":true,"requires":{"kind-of":"^6.0.2"}},"shebang-command":{"version":"2.0.0","resolved":"https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz","integrity":"sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==","dev":true,"requires":{"shebang-regex":"^3.0.0"}},"shebang-regex":{"version":"3.0.0","resolved":"https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz","integrity":"sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==","dev":true},"shelljs":{"version":"0.8.4","resolved":"https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz","integrity":"sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==","dev":true,"requires":{"glob":"^7.0.0","interpret":"^1.0.0","rechoir":"^0.6.2"}},"shx":{"version":"0.3.3","resolved":"https://registry.npmjs.org/shx/-/shx-0.3.3.tgz","integrity":"sha512-nZJ3HFWVoTSyyB+evEKjJ1STiixGztlqwKLTUNV5KqMWtGey9fTd4KU1gdZ1X9BV6215pswQ/Jew9NsuS/fNDA==","dev":true,"requires":{"minimist":"^1.2.3","shelljs":"^0.8.4"}},"signal-exit":{"version":"3.0.3","resolved":"https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz","integrity":"sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==","dev":true},"slash":{"version":"2.0.0","resolved":"https://registry.npmjs.org/slash/-/slash-2.0.0.tgz","integrity":"sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==","dev":true},"slide":{"version":"1.1.6","resolved":"https://registry.npmjs.org/slide/-/slide-1.1.6.tgz","integrity":"sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=","dev":true},"smart-buffer":{"version":"4.1.0","resolved":"https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz","integrity":"sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==","dev":true},"snapdragon":{"version":"0.8.2","resolved":"https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz","integrity":"sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==","dev":true,"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":{"debug":{"version":"2.6.9","resolved":"https://registry.npmjs.org/debug/-/debug-2.6.9.tgz","integrity":"sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==","dev":true,"requires":{"ms":"2.0.0"}},"define-property":{"version":"0.2.5","resolved":"https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz","integrity":"sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=","dev":true,"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}},"ms":{"version":"2.0.0","resolved":"https://registry.npmjs.org/ms/-/ms-2.0.0.tgz","integrity":"sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=","dev":true}}},"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==","dev":true,"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=","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"socks":{"version":"2.3.3","resolved":"https://registry.npmjs.org/socks/-/socks-2.3.3.tgz","integrity":"sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==","dev":true,"requires":{"ip":"1.1.5","smart-buffer":"^4.1.0"}},"socks-proxy-agent":{"version":"4.0.2","resolved":"https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz","integrity":"sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==","dev":true,"requires":{"agent-base":"~4.2.1","socks":"~2.3.2"},"dependencies":{"agent-base":{"version":"4.2.1","resolved":"https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz","integrity":"sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==","dev":true,"requires":{"es6-promisify":"^5.0.0"}}}},"solc":{"version":"0.7.4","resolved":"https://registry.npmjs.org/solc/-/solc-0.7.4.tgz","integrity":"sha512-IVLqAfUkJqgTS0JIgFPeC50ehUeBXu2eE+iU+rqb6UeOyf6w/BB/EsNcTSTpjtUti8BTG/sCd2qVhrWVYy7p0g==","dev":true,"requires":{"command-exists":"^1.2.8","commander":"3.0.2","follow-redirects":"^1.12.1","fs-extra":"^0.30.0","js-sha3":"0.8.0","memorystream":"^0.3.1","require-from-string":"^2.0.0","semver":"^5.5.0","tmp":"0.0.33"},"dependencies":{"fs-extra":{"version":"0.30.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz","integrity":"sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=","dev":true,"requires":{"graceful-fs":"^4.1.2","jsonfile":"^2.1.0","klaw":"^1.0.0","path-is-absolute":"^1.0.0","rimraf":"^2.2.8"}},"jsonfile":{"version":"2.4.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz","integrity":"sha1-NzaitCi4e72gzIO1P6PWM6NcKug=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"tmp":{"version":"0.0.33","resolved":"https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz","integrity":"sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==","dev":true,"requires":{"os-tmpdir":"~1.0.2"}}}},"sort-keys":{"version":"2.0.0","resolved":"https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz","integrity":"sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=","dev":true,"requires":{"is-plain-obj":"^1.0.0"}},"source-map":{"version":"0.5.7","resolved":"https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz","integrity":"sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=","dev":true},"source-map-resolve":{"version":"0.5.3","resolved":"https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz","integrity":"sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==","dev":true,"requires":{"atob":"^2.1.2","decode-uri-component":"^0.2.0","resolve-url":"^0.2.1","source-map-url":"^0.4.0","urix":"^0.1.0"}},"source-map-support":{"version":"0.5.19","resolved":"https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz","integrity":"sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==","dev":true,"requires":{"buffer-from":"^1.0.0","source-map":"^0.6.0"},"dependencies":{"source-map":{"version":"0.6.1","resolved":"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz","integrity":"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==","dev":true}}},"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=","dev":true},"spawn-wrap":{"version":"2.0.0","resolved":"https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz","integrity":"sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==","dev":true,"requires":{"foreground-child":"^2.0.0","is-windows":"^1.0.2","make-dir":"^3.0.0","rimraf":"^3.0.0","signal-exit":"^3.0.2","which":"^2.0.1"},"dependencies":{"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"spdx-correct":{"version":"3.1.1","resolved":"https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz","integrity":"sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==","dev":true,"requires":{"spdx-expression-parse":"^3.0.0","spdx-license-ids":"^3.0.0"}},"spdx-exceptions":{"version":"2.3.0","resolved":"https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz","integrity":"sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==","dev":true},"spdx-expression-parse":{"version":"3.0.1","resolved":"https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz","integrity":"sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==","dev":true,"requires":{"spdx-exceptions":"^2.1.0","spdx-license-ids":"^3.0.0"}},"spdx-license-ids":{"version":"3.0.6","resolved":"https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz","integrity":"sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==","dev":true},"split":{"version":"1.0.1","resolved":"https://registry.npmjs.org/split/-/split-1.0.1.tgz","integrity":"sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==","dev":true,"requires":{"through":"2"}},"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==","dev":true,"requires":{"extend-shallow":"^3.0.0"}},"split2":{"version":"2.2.0","resolved":"https://registry.npmjs.org/split2/-/split2-2.2.0.tgz","integrity":"sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==","dev":true,"requires":{"through2":"^2.0.2"}},"sprintf-js":{"version":"1.0.3","resolved":"https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz","integrity":"sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=","dev":true},"sshpk":{"version":"1.16.1","resolved":"https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz","integrity":"sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==","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","safer-buffer":"^2.0.2","tweetnacl":"~0.14.0"}},"ssri":{"version":"6.0.1","resolved":"https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz","integrity":"sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==","dev":true,"requires":{"figgy-pudding":"^3.5.1"}},"static-extend":{"version":"0.1.2","resolved":"https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz","integrity":"sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=","dev":true,"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=","dev":true,"requires":{"is-descriptor":"^0.1.0"}}}},"stream-each":{"version":"1.2.3","resolved":"https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz","integrity":"sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==","dev":true,"requires":{"end-of-stream":"^1.1.0","stream-shift":"^1.0.0"}},"stream-shift":{"version":"1.0.1","resolved":"https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz","integrity":"sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==","dev":true},"string-width":{"version":"1.0.2","resolved":"https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz","integrity":"sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=","dev":true,"requires":{"code-point-at":"^1.0.0","is-fullwidth-code-point":"^1.0.0","strip-ansi":"^3.0.0"}},"string.prototype.trimend":{"version":"1.0.1","resolved":"https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz","integrity":"sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.17.5"}},"string.prototype.trimstart":{"version":"1.0.1","resolved":"https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz","integrity":"sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.17.5"}},"string_decoder":{"version":"1.3.0","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz","integrity":"sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==","requires":{"safe-buffer":"~5.2.0"}},"strip-ansi":{"version":"3.0.1","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz","integrity":"sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=","dev":true,"requires":{"ansi-regex":"^2.0.0"}},"strip-bom":{"version":"3.0.0","resolved":"https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz","integrity":"sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=","dev":true},"strip-eof":{"version":"1.0.0","resolved":"https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz","integrity":"sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=","dev":true},"strip-final-newline":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz","integrity":"sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==","dev":true},"strip-hex-prefix":{"version":"1.0.0","resolved":"https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz","integrity":"sha1-DF8VX+8RUTczd96du1iNoFUA428=","requires":{"is-hex-prefixed":"1.0.0"}},"strip-indent":{"version":"3.0.0","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz","integrity":"sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==","dev":true,"requires":{"min-indent":"^1.0.0"}},"strip-json-comments":{"version":"3.1.1","resolved":"https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz","integrity":"sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==","dev":true},"strong-log-transformer":{"version":"2.1.0","resolved":"https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz","integrity":"sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==","dev":true,"requires":{"duplexer":"^0.1.1","minimist":"^1.2.0","through":"^2.3.4"}},"subleveldown":{"version":"5.0.1","resolved":"https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.1.tgz","integrity":"sha512-cVqd/URpp7si1HWu5YqQ3vqQkjuolAwHypY1B4itPlS71/lsf6TQPZ2Y0ijT22EYVkvH5ove9JFJf4u7VGPuZw==","requires":{"abstract-leveldown":"^6.3.0","encoding-down":"^6.2.0","inherits":"^2.0.3","level-option-wrap":"^1.1.0","levelup":"^4.4.0","reachdown":"^1.1.0"},"dependencies":{"abstract-leveldown":{"version":"6.3.0","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz","integrity":"sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==","requires":{"buffer":"^5.5.0","immediate":"^3.2.3","level-concat-iterator":"~2.0.0","level-supports":"~1.0.0","xtend":"~4.0.0"}},"deferred-leveldown":{"version":"5.3.0","resolved":"https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz","integrity":"sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==","requires":{"abstract-leveldown":"~6.2.1","inherits":"^2.0.3"},"dependencies":{"abstract-leveldown":{"version":"6.2.3","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz","integrity":"sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==","requires":{"buffer":"^5.5.0","immediate":"^3.2.3","level-concat-iterator":"~2.0.0","level-supports":"~1.0.0","xtend":"~4.0.0"}}}},"encoding-down":{"version":"6.3.0","resolved":"https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz","integrity":"sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==","requires":{"abstract-leveldown":"^6.2.1","inherits":"^2.0.3","level-codec":"^9.0.0","level-errors":"^2.0.0"}},"level-codec":{"version":"9.0.2","resolved":"https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz","integrity":"sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==","requires":{"buffer":"^5.6.0"}},"level-errors":{"version":"2.0.1","resolved":"https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz","integrity":"sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==","requires":{"errno":"~0.1.1"}},"level-iterator-stream":{"version":"4.0.2","resolved":"https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz","integrity":"sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==","requires":{"inherits":"^2.0.4","readable-stream":"^3.4.0","xtend":"^4.0.2"}},"levelup":{"version":"4.4.0","resolved":"https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz","integrity":"sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==","requires":{"deferred-leveldown":"~5.3.0","level-errors":"~2.0.0","level-iterator-stream":"~4.0.0","level-supports":"~1.0.0","xtend":"~4.0.0"}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"superagent":{"version":"6.1.0","resolved":"https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz","integrity":"sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==","dev":true,"requires":{"component-emitter":"^1.3.0","cookiejar":"^2.1.2","debug":"^4.1.1","fast-safe-stringify":"^2.0.7","form-data":"^3.0.0","formidable":"^1.2.2","methods":"^1.1.2","mime":"^2.4.6","qs":"^6.9.4","readable-stream":"^3.6.0","semver":"^7.3.2"},"dependencies":{"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}},"form-data":{"version":"3.0.0","resolved":"https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz","integrity":"sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==","dev":true,"requires":{"asynckit":"^0.4.0","combined-stream":"^1.0.8","mime-types":"^2.1.12"}},"qs":{"version":"6.9.4","resolved":"https://registry.npmjs.org/qs/-/qs-6.9.4.tgz","integrity":"sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==","dev":true},"semver":{"version":"7.3.2","resolved":"https://registry.npmjs.org/semver/-/semver-7.3.2.tgz","integrity":"sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==","dev":true}}},"supports-color":{"version":"7.2.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz","integrity":"sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==","dev":true,"requires":{"has-flag":"^4.0.0"}},"tar":{"version":"4.4.13","resolved":"https://registry.npmjs.org/tar/-/tar-4.4.13.tgz","integrity":"sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==","dev":true,"requires":{"chownr":"^1.1.1","fs-minipass":"^1.2.5","minipass":"^2.8.6","minizlib":"^1.2.1","mkdirp":"^0.5.0","safe-buffer":"^5.1.2","yallist":"^3.0.3"}},"temp-dir":{"version":"1.0.0","resolved":"https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz","integrity":"sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=","dev":true},"temp-write":{"version":"3.4.0","resolved":"https://registry.npmjs.org/temp-write/-/temp-write-3.4.0.tgz","integrity":"sha1-jP9jD7fp2gXwR8dM5M5NaFRX1JI=","dev":true,"requires":{"graceful-fs":"^4.1.2","is-stream":"^1.1.0","make-dir":"^1.0.0","pify":"^3.0.0","temp-dir":"^1.0.0","uuid":"^3.0.1"},"dependencies":{"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true}}},"test-exclude":{"version":"6.0.0","resolved":"https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz","integrity":"sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==","dev":true,"requires":{"@istanbuljs/schema":"^0.1.2","glob":"^7.1.4","minimatch":"^3.0.4"}},"text-extensions":{"version":"1.9.0","resolved":"https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz","integrity":"sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==","dev":true},"thenify":{"version":"3.3.1","resolved":"https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz","integrity":"sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==","dev":true,"requires":{"any-promise":"^1.0.0"}},"thenify-all":{"version":"1.6.0","resolved":"https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz","integrity":"sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=","dev":true,"requires":{"thenify":">= 3.1.0 < 4"}},"through":{"version":"2.3.8","resolved":"https://registry.npmjs.org/through/-/through-2.3.8.tgz","integrity":"sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=","dev":true},"through2":{"version":"2.0.5","resolved":"https://registry.npmjs.org/through2/-/through2-2.0.5.tgz","integrity":"sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==","dev":true,"requires":{"readable-stream":"~2.3.6","xtend":"~4.0.1"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==","dev":true}}},"tmp":{"version":"0.2.1","resolved":"https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz","integrity":"sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==","requires":{"rimraf":"^3.0.0"}},"tmp-promise":{"version":"3.0.2","resolved":"https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.2.tgz","integrity":"sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA==","requires":{"tmp":"^0.2.0"}},"to-fast-properties":{"version":"2.0.0","resolved":"https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz","integrity":"sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=","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=","dev":true,"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=","dev":true,"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==","dev":true,"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=","dev":true,"requires":{"is-number":"^3.0.0","repeat-string":"^1.6.1"}},"tough-cookie":{"version":"2.5.0","resolved":"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz","integrity":"sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==","dev":true,"requires":{"psl":"^1.1.28","punycode":"^2.1.1"}},"tr46":{"version":"1.0.1","resolved":"https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz","integrity":"sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=","dev":true,"requires":{"punycode":"^2.1.0"}},"trim-newlines":{"version":"3.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz","integrity":"sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==","dev":true},"trim-off-newlines":{"version":"1.0.1","resolved":"https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz","integrity":"sha1-n5up2e+odkw4dpi8v+sshI8RrbM=","dev":true},"ts-morph":{"version":"7.3.0","resolved":"https://registry.npmjs.org/ts-morph/-/ts-morph-7.3.0.tgz","integrity":"sha512-BUKSoz7AFSKPcYTZODbICW2mOthAN4vc5juD6FL1lD/dLwZ0WvrC3zqBM3/X6f5gHxq3yaz+HmanHGaWm0ddbQ==","dev":true,"requires":{"@dsherret/to-absolute-glob":"^2.0.2","@ts-morph/common":"~0.5.2","code-block-writer":"^10.1.0"}},"ts-node":{"version":"9.0.0","resolved":"https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz","integrity":"sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==","dev":true,"requires":{"arg":"^4.1.0","diff":"^4.0.1","make-error":"^1.1.1","source-map-support":"^0.5.17","yn":"3.1.1"}},"tslib":{"version":"1.13.0","resolved":"https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz","integrity":"sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==","dev":true},"tunnel-agent":{"version":"0.6.0","resolved":"https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz","integrity":"sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=","dev":true,"requires":{"safe-buffer":"^5.0.1"}},"tweetnacl":{"version":"0.14.5","resolved":"https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz","integrity":"sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=","dev":true},"type-fest":{"version":"0.3.1","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz","integrity":"sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==","dev":true},"typedarray":{"version":"0.0.6","resolved":"https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz","integrity":"sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=","dev":true},"typedarray-to-buffer":{"version":"3.1.5","resolved":"https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz","integrity":"sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==","dev":true,"requires":{"is-typedarray":"^1.0.0"}},"typescript":{"version":"4.1.0-beta","resolved":"https://registry.npmjs.org/typescript/-/typescript-4.1.0-beta.tgz","integrity":"sha512-b/LAttdVl3G6FEmnMkDsK0xvfvaftXpSKrjXn+OVCRqrwz5WD/6QJOiN+dTorqDY+hkaH+r2gP5wI1jBDmdQ7A==","dev":true},"uWebSockets.js":{"version":"github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c","from":"github:uNetworking/uWebSockets.js#v18.4.0"},"uglify-js":{"version":"3.10.4","resolved":"https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz","integrity":"sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==","dev":true,"optional":true},"uid-number":{"version":"0.0.6","resolved":"https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz","integrity":"sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=","dev":true},"umask":{"version":"1.1.0","resolved":"https://registry.npmjs.org/umask/-/umask-1.1.0.tgz","integrity":"sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=","dev":true},"unc-path-regex":{"version":"0.1.2","resolved":"https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz","integrity":"sha1-5z3T17DXxe2G+6xrCufYxqadUPo=","dev":true},"union-value":{"version":"1.0.1","resolved":"https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz","integrity":"sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==","dev":true,"requires":{"arr-union":"^3.1.0","get-value":"^2.0.6","is-extendable":"^0.1.1","set-value":"^2.0.1"}},"unique-filename":{"version":"1.1.1","resolved":"https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz","integrity":"sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==","dev":true,"requires":{"unique-slug":"^2.0.0"}},"unique-slug":{"version":"2.0.2","resolved":"https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz","integrity":"sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==","dev":true,"requires":{"imurmurhash":"^0.1.4"}},"universal-user-agent":{"version":"4.0.1","resolved":"https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz","integrity":"sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==","dev":true,"requires":{"os-name":"^3.1.0"}},"universalify":{"version":"1.0.0","resolved":"https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz","integrity":"sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==","dev":true},"unset-value":{"version":"1.0.0","resolved":"https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz","integrity":"sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=","dev":true,"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=","dev":true,"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=","dev":true,"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=","dev":true},"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true}}},"upath":{"version":"1.2.0","resolved":"https://registry.npmjs.org/upath/-/upath-1.2.0.tgz","integrity":"sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==","dev":true},"uri-js":{"version":"4.4.0","resolved":"https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz","integrity":"sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==","dev":true,"requires":{"punycode":"^2.1.0"}},"urix":{"version":"0.1.0","resolved":"https://registry.npmjs.org/urix/-/urix-0.1.0.tgz","integrity":"sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=","dev":true},"use":{"version":"3.1.1","resolved":"https://registry.npmjs.org/use/-/use-3.1.1.tgz","integrity":"sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==","dev":true},"utf-8-validate":{"version":"5.0.2","resolved":"https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz","integrity":"sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==","dev":true,"requires":{"node-gyp-build":"~3.7.0"},"dependencies":{"node-gyp-build":{"version":"3.7.0","resolved":"https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz","integrity":"sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==","dev":true}}},"util-deprecate":{"version":"1.0.2","resolved":"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz","integrity":"sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="},"util-promisify":{"version":"2.1.0","resolved":"https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz","integrity":"sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=","dev":true,"requires":{"object.getownpropertydescriptors":"^2.0.3"}},"util.promisify":{"version":"1.0.1","resolved":"https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz","integrity":"sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.17.2","has-symbols":"^1.0.1","object.getownpropertydescriptors":"^2.1.0"}},"uuid":{"version":"3.4.0","resolved":"https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz","integrity":"sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==","dev":true},"validate-npm-package-license":{"version":"3.0.4","resolved":"https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz","integrity":"sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==","dev":true,"requires":{"spdx-correct":"^3.0.0","spdx-expression-parse":"^3.0.0"}},"validate-npm-package-name":{"version":"3.0.0","resolved":"https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz","integrity":"sha1-X6kS2B630MdK/BQN5zF/DKffQ34=","dev":true,"requires":{"builtins":"^1.0.3"}},"verror":{"version":"1.10.0","resolved":"https://registry.npmjs.org/verror/-/verror-1.10.0.tgz","integrity":"sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=","dev":true,"requires":{"assert-plus":"^1.0.0","core-util-is":"1.0.2","extsprintf":"^1.2.0"}},"wcwidth":{"version":"1.0.1","resolved":"https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz","integrity":"sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=","dev":true,"requires":{"defaults":"^1.0.3"}},"webidl-conversions":{"version":"4.0.2","resolved":"https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz","integrity":"sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==","dev":true},"whatwg-url":{"version":"7.1.0","resolved":"https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz","integrity":"sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==","dev":true,"requires":{"lodash.sortby":"^4.7.0","tr46":"^1.0.1","webidl-conversions":"^4.0.2"}},"which":{"version":"2.0.2","resolved":"https://registry.npmjs.org/which/-/which-2.0.2.tgz","integrity":"sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==","dev":true,"requires":{"isexe":"^2.0.0"}},"which-module":{"version":"2.0.0","resolved":"https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz","integrity":"sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=","dev":true},"which-pm-runs":{"version":"1.0.0","resolved":"https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz","integrity":"sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=","dev":true},"wide-align":{"version":"1.1.3","resolved":"https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz","integrity":"sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==","dev":true,"requires":{"string-width":"^1.0.2 || 2"}},"windows-release":{"version":"3.3.3","resolved":"https://registry.npmjs.org/windows-release/-/windows-release-3.3.3.tgz","integrity":"sha512-OSOGH1QYiW5yVor9TtmXKQvt2vjQqbYS+DqmsZw+r7xDwLXEeT3JGW0ZppFmHx4diyXmxt238KFR3N9jzevBRg==","dev":true,"requires":{"execa":"^1.0.0"}},"wordwrap":{"version":"1.0.0","resolved":"https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz","integrity":"sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=","dev":true},"workerpool":{"version":"6.0.2","resolved":"https://registry.npmjs.org/workerpool/-/workerpool-6.0.2.tgz","integrity":"sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q==","dev":true},"wrap-ansi":{"version":"5.1.0","resolved":"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz","integrity":"sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==","dev":true,"requires":{"ansi-styles":"^3.2.0","string-width":"^3.0.0","strip-ansi":"^5.0.0"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"string-width":{"version":"3.1.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz","integrity":"sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==","dev":true,"requires":{"emoji-regex":"^7.0.1","is-fullwidth-code-point":"^2.0.0","strip-ansi":"^5.1.0"}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"}}}},"wrappy":{"version":"1.0.2","resolved":"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz","integrity":"sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="},"write-file-atomic":{"version":"2.4.3","resolved":"https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz","integrity":"sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==","dev":true,"requires":{"graceful-fs":"^4.1.11","imurmurhash":"^0.1.4","signal-exit":"^3.0.2"}},"write-json-file":{"version":"3.2.0","resolved":"https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz","integrity":"sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==","dev":true,"requires":{"detect-indent":"^5.0.0","graceful-fs":"^4.1.15","make-dir":"^2.1.0","pify":"^4.0.1","sort-keys":"^2.0.0","write-file-atomic":"^2.4.2"},"dependencies":{"make-dir":{"version":"2.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz","integrity":"sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==","dev":true,"requires":{"pify":"^4.0.1","semver":"^5.6.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"write-pkg":{"version":"3.2.0","resolved":"https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz","integrity":"sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==","dev":true,"requires":{"sort-keys":"^2.0.0","write-json-file":"^2.2.0"},"dependencies":{"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true},"write-json-file":{"version":"2.3.0","resolved":"https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz","integrity":"sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=","dev":true,"requires":{"detect-indent":"^5.0.0","graceful-fs":"^4.1.2","make-dir":"^1.0.0","pify":"^3.0.0","sort-keys":"^2.0.0","write-file-atomic":"^2.0.0"}}}},"ws":{"version":"7.3.1","resolved":"https://registry.npmjs.org/ws/-/ws-7.3.1.tgz","integrity":"sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==","dev":true},"xtend":{"version":"2.1.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz","integrity":"sha1-bv7MKk2tjmlixJAbM3znuoe10os=","requires":{"object-keys":"~0.4.0"}},"y18n":{"version":"4.0.0","resolved":"https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz","integrity":"sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==","dev":true},"yallist":{"version":"3.1.1","resolved":"https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz","integrity":"sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="},"yaml":{"version":"1.10.0","resolved":"https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz","integrity":"sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==","dev":true},"yargs":{"version":"16.1.0","resolved":"https://registry.npmjs.org/yargs/-/yargs-16.1.0.tgz","integrity":"sha512-upWFJOmDdHN0syLuESuvXDmrRcWd1QafJolHskzaw79uZa7/x53gxQKiR07W59GWY1tFhhU/Th9DrtSfpS782g==","dev":true,"requires":{"cliui":"^7.0.2","escalade":"^3.1.1","get-caller-file":"^2.0.5","require-directory":"^2.1.1","string-width":"^4.2.0","y18n":"^5.0.2","yargs-parser":"^20.2.2"},"dependencies":{"ansi-regex":{"version":"5.0.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz","integrity":"sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==","dev":true},"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"cliui":{"version":"7.0.3","resolved":"https://registry.npmjs.org/cliui/-/cliui-7.0.3.tgz","integrity":"sha512-Gj3QHTkVMPKqwP3f7B4KPkBZRMR9r4rfi5bXFpg1a+Svvj8l7q5CnkBkVQzfxT5DFSsGk2+PascOgL0JYkL2kw==","dev":true,"requires":{"string-width":"^4.2.0","strip-ansi":"^6.0.0","wrap-ansi":"^7.0.0"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true},"emoji-regex":{"version":"8.0.0","resolved":"https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz","integrity":"sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==","dev":true},"is-fullwidth-code-point":{"version":"3.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz","integrity":"sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==","dev":true},"string-width":{"version":"4.2.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz","integrity":"sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==","dev":true,"requires":{"emoji-regex":"^8.0.0","is-fullwidth-code-point":"^3.0.0","strip-ansi":"^6.0.0"}},"strip-ansi":{"version":"6.0.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz","integrity":"sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==","dev":true,"requires":{"ansi-regex":"^5.0.0"}},"wrap-ansi":{"version":"7.0.0","resolved":"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz","integrity":"sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==","dev":true,"requires":{"ansi-styles":"^4.0.0","string-width":"^4.1.0","strip-ansi":"^6.0.0"}},"y18n":{"version":"5.0.4","resolved":"https://registry.npmjs.org/y18n/-/y18n-5.0.4.tgz","integrity":"sha512-deLOfD+RvFgrpAmSZgfGdWYE+OKyHcVHaRQ7NphG/63scpRvTHHeQMAxGGvaLVGJ+HYVcCXlzcTK0ZehFf+eHQ==","dev":true},"yargs-parser":{"version":"20.2.3","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.3.tgz","integrity":"sha512-emOFRT9WVHw03QSvN5qor9QQT9+sw5vwxfYweivSMHTcAXPefwVae2FjO7JJjj8hCE4CzPOPeFM83VwT29HCww==","dev":true}}},"yargs-parser":{"version":"15.0.1","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz","integrity":"sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true}}},"yargs-unparser":{"version":"2.0.0","resolved":"https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz","integrity":"sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==","dev":true,"requires":{"camelcase":"^6.0.0","decamelize":"^4.0.0","flat":"^5.0.2","is-plain-obj":"^2.1.0"},"dependencies":{"decamelize":{"version":"4.0.0","resolved":"https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz","integrity":"sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==","dev":true},"is-plain-obj":{"version":"2.1.0","resolved":"https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz","integrity":"sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==","dev":true}}},"yn":{"version":"3.1.1","resolved":"https://registry.npmjs.org/yn/-/yn-3.1.1.tgz","integrity":"sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==","dev":true}}} From 0ef11b63c4c14addcf162c763955af4da3e8facc Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 28 Oct 2020 19:20:17 -0400 Subject: [PATCH 621/691] Add keywords, homepage, and descriptions to package.json --- scripts/create.ts | 28 +++++++++++++++++++++---- src/chains/ethereum/package.json | 16 +++++++++++++- src/chains/tezos/package.json | 12 ++++++++++- src/packages/core/package.json | 16 +++++++++++++- src/packages/flavors/package.json | 18 ++++++++++++++-- src/packages/options/package.json | 18 ++++++++++++++-- src/packages/promise-queue/package.json | 20 +++++++++++++++--- src/packages/utils/package.json | 20 +++++++++++++++--- 8 files changed, 131 insertions(+), 17 deletions(-) diff --git a/scripts/create.ts b/scripts/create.ts index 3672b5defb..72addcb019 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -96,7 +96,7 @@ process.stdout.write(`${COLORS.Reset}`); name: packageName, version: version, author: packageAuthor || require("../package.json").author, - homepage: "https://github.com/trufflesuite/ganache-core#readme", + homepage: `https://github.com/trufflesuite/ganache-core/tree/develop/src/${location}/${name}#readme`, license: "MIT", main: "lib/index.js", types: "src/index.ts", @@ -107,7 +107,8 @@ process.stdout.write(`${COLORS.Reset}`); files: ["lib"], repository: { type: "git", - url: "git+https://github.com/trufflesuite/ganache-core.git" + url: "https://github.com/trufflesuite/ganache-core.git", + directory: `src/${location}/${name}` }, scripts: { tsc: "ts-node ../../../scripts/compile", @@ -117,7 +118,22 @@ process.stdout.write(`${COLORS.Reset}`); }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" - } + }, + keywords: [ + "ganache", + `ganache-${name}`, + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling", + "truffle" + ] }; const tsConfig = { @@ -237,7 +253,11 @@ typedoc.json ); console.log( - chalk`{green success} {magenta create} New package {bgBlack ${name} } created. New package created at ./src/packages/${name}.\n\n package.json: {bold ${dir}/package.json}` + chalk`{green success} {magenta create} New package {bgBlack ${name} } created at ./src/packages/${name}.` + ); + console.log(""); + console.log( + chalk` Update the package.json here: {bold ${dir}/package.json}` ); } catch (e) { console.error(e); diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 07e745cb17..5f05b0af3e 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -3,7 +3,7 @@ "version": "2.2.1", "description": "ganache-core's Ethereum client implementation", "author": "David Murdoch (https://davidmurdoch.com)", - "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/ethereum#readme", "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -34,6 +34,20 @@ "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, + "keywords": [ + "ganache", + "ganache-ethereum", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling" + ], "dependencies": { "@ganache/options": "^2.2.1", "@ganache/promise-queue": "^2.2.1", diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 9e8ba537c8..16aa4ccf4c 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -3,7 +3,7 @@ "version": "2.2.1", "description": "ganache-core's Tezos client implementation", "author": "David Murdoch (https://davidmurdoch.com)", - "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/chains/tezos#readme", "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -32,6 +32,16 @@ "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, + "keywords": [ + "ganache", + "ganache-tezos", + "tezos", + "blockchain", + "smart contracts", + "dapps", + "michelson", + "tooling" + ], "dependencies": { "@ganache/options": "^2.2.1", "@ganache/utils": "^2.2.1" diff --git a/src/packages/core/package.json b/src/packages/core/package.json index 3340bc7c67..6fd5568871 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -3,7 +3,7 @@ "version": "2.2.1", "description": "A library to create a local blockchain for fast Ethereum development.", "author": "David Murdoch (https://davidmurdoch.com)", - "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/core#readme", "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -31,6 +31,20 @@ "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, + "keywords": [ + "ganache", + "ganache-core", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling" + ], "dependencies": { "@ganache/options": "^2.2.1", "@ganache/flavors": "^2.2.1", diff --git a/src/packages/flavors/package.json b/src/packages/flavors/package.json index 7511aebfe3..53409df9d9 100644 --- a/src/packages/flavors/package.json +++ b/src/packages/flavors/package.json @@ -1,9 +1,9 @@ { "name": "@ganache/flavors", "version": "2.2.1", - "description": "> TODO: description", + "description": "Ganache's flavors enumeration and TypeScript types", "author": "David Murdoch (https://davidmurdoch.com)", - "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/flavors#readme", "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -26,6 +26,20 @@ "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, + "keywords": [ + "ganache", + "ganache-flavors", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling" + ], "dependencies": { "@ganache/ethereum": "^2.2.1", "@ganache/tezos": "^2.2.1", diff --git a/src/packages/options/package.json b/src/packages/options/package.json index 1d6bfc5bd6..a79c76daec 100644 --- a/src/packages/options/package.json +++ b/src/packages/options/package.json @@ -1,9 +1,9 @@ { "name": "@ganache/options", "version": "2.2.1", - "description": "> TODO: description", + "description": "Ganache's server/provider options TypeScript types", "author": "David Murdoch (https://davidmurdoch.com)", - "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/options#readme", "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -25,6 +25,20 @@ "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" }, + "keywords": [ + "ganache", + "ganache-options", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling" + ], "dependencies": { "@ganache/utils": "^2.2.1" } diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index 2078c00835..a2733d634d 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -1,9 +1,9 @@ { "name": "@ganache/promise-queue", "version": "2.2.1", - "description": "> TODO: description", + "description": "A queue that resolves Promise instances in first-in first-out order.", "author": "David Murdoch (https://davidmurdoch.com)", - "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/promise-queue#readme", "license": "MIT", "main": "lib/index.js", "types": "src/index.ts", @@ -26,5 +26,19 @@ }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" - } + }, + "keywords": [ + "ganache", + "ganache-promise-queue", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling" + ] } diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index 31af6a7776..086e5b3305 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -1,9 +1,9 @@ { "name": "@ganache/utils", "version": "2.2.1", - "description": "> TODO: description", + "description": "Utility functions for @ganache packages", "author": "David Murdoch (https://davidmurdoch.com)", - "homepage": "https://github.com/trufflesuite/ganache-core#readme", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/utils#readme", "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -28,5 +28,19 @@ }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" - } + }, + "keywords": [ + "ganache", + "ganache-utils", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling" + ] } From 0235759e6e80232ea5083a885e8e002c953ce579 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 13:10:26 -0400 Subject: [PATCH 622/691] begin creating readme page --- .github/ganache-logo-dark.svg | 1 + .github/truffle-logo-dark.svg | 1 + .github/workflows/{nodejs.yml => CI.yml} | 2 +- docs/README.md => CONTRIBUTING.md | 2 +- README.md | 212 ++++++++++++++++++++++- docs/DATAFLOW.md | 42 ----- 6 files changed, 214 insertions(+), 46 deletions(-) create mode 100644 .github/ganache-logo-dark.svg create mode 100644 .github/truffle-logo-dark.svg rename .github/workflows/{nodejs.yml => CI.yml} (98%) rename docs/README.md => CONTRIBUTING.md (99%) delete mode 100644 docs/DATAFLOW.md diff --git a/.github/ganache-logo-dark.svg b/.github/ganache-logo-dark.svg new file mode 100644 index 0000000000..3746549d85 --- /dev/null +++ b/.github/ganache-logo-dark.svg @@ -0,0 +1 @@ +ganache-logo-v-dark \ No newline at end of file diff --git a/.github/truffle-logo-dark.svg b/.github/truffle-logo-dark.svg new file mode 100644 index 0000000000..92900f899f --- /dev/null +++ b/.github/truffle-logo-dark.svg @@ -0,0 +1 @@ +truffle-logo-dark \ No newline at end of file diff --git a/.github/workflows/nodejs.yml b/.github/workflows/CI.yml similarity index 98% rename from .github/workflows/nodejs.yml rename to .github/workflows/CI.yml index ebaf020102..106f632c66 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/CI.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: CI on: [push, pull_request] diff --git a/docs/README.md b/CONTRIBUTING.md similarity index 99% rename from docs/README.md rename to CONTRIBUTING.md index 95229dd77e..d6e1db7237 100644 --- a/docs/README.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Developer Documentation +# Contributing to Ganache ## Getting set up diff --git a/README.md b/README.md index 5bdb24d4e9..fcd51dd430 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,211 @@ -# JUST FOR EXPERIMENTS +

+ Ganache +

-[Developer Documentation](./docs/README.md); +

+ A tool for creating a local blockchain for fast Ethereum development. +

+ +

+ + + +

+ +

+ Features • + Getting Started • + Documentation • + Community • + Contributing • + Related +

+ +--- + +## Features + +Ganache uses simulates full Ethereum client behavior and makes developing Ethereum applications faster, easier, and safer. It includes all popular RPC functions and features (like events) and can be run deterministically to make development a breeze. + +- Fork any Ethereum network without waiting to sync +- Ethereum json-rpc support +- Snapshot/revert state +- Mine blocks _instantly_, _on demand_, or at an interval +- Fast-forward time +- Impersonate any account (no private keys required!) +- Listens for JSON-RPC 2.0 requests over HTTP/WebSockets +- Programmatic use in Node.js +- Pending Transactions + +## Getting Started + +Ganache can be used from the command line or programmatically via Node.js. + +### Command line use + +You must first install [Node.js](https://nodejs.org/) >= v10.7.0 and npm >= 6.1.0. + +To install ganache-cli globally, run: + +```bash +$ npm install ganache-cli --global +``` + +Once installed globally, you can start ganache-cli right from your command line: + +```bash +$ ganache-cli +Ganache CLI v6.12.1 (ganache-core: 2.13.1) + +Available Accounts +================== +(0) 0x665a72A5A58c8ecD51dBC913f18286a104Ff6F8d (100 ETH) +(1) 0x990Ca50F8Ac586384594a98EDaB3F8b46CEd179c (100 ETH) +(2) 0x5c49b8831C81C4aa572d2733Ea7619e2fbaE7bb2 (100 ETH) +(3) 0xb3eFA990367077B0b74150B74E8D6520E692bD82 (100 ETH) +(4) 0xEb9D56915a83F7f2FEA6B18C702cD24D6a07fD62 (100 ETH) +(5) 0x8A199Adfd3D2fB10430f8D006cfd79b28D7D6562 (100 ETH) +(6) 0x2964eCA6615534E59b94FBf642d73Bcc09C7D835 (100 ETH) +(7) 0x255dE55cA7040D4ada06295F89Af5a3d7204f751 (100 ETH) +(8) 0x946790395bB4C0f6a6cEDD90D04D0023c3Bf256B (100 ETH) +(9) 0xddAeCA7f5d58539c9f78F64e8Be4bD437e6E085a (100 ETH) + +Private Keys +================== +(0) 0x3b1f1c5750edbda54702bcd70d2f0925f38c77269d606bd0faad2369aa834770 +(1) 0xdd09ee23ec00b5a6c24d954d9b333411c0ad830c1edc4dec0d625c532785e621 +(2) 0x71edfcf731f142526f2a9adee826775b2ae512d7a65de7ae65fd074e0c7053a9 +(3) 0x66ad9dd75f1fc73582a09c6da31ededec8df138db0acd02285792e9c29cd6711 +(4) 0xa0a728215cbf24a62edfef3ecfdc5b137b18b4a07fa2502d4f21f705f898c5a4 +(5) 0x9003b737d388eff793d308302c2e484f339c417e727e213cc46b7cd3f29dcef5 +(6) 0xe8de8c5ee8643699f344cefb0c502e6081422fc012bd50274007dd167147a4e6 +(7) 0xdf5df29263acd5b327db6870798856c2abab31262c83b5801ab4851297326266 +(8) 0x2bb1e1a8372370ac758795c26a6cf1f015b89d05079a8750616cd1b61d93d3bb +(9) 0xbaa9325adb6a75b1177700130aed2281b1eb1fcfac5203c14a8cabf0f82e71d3 + +HD Wallet +================== +Mnemonic: charge bamboo worry unaware rude drink congress mushroom exile federal typical couple +Base HD Path: m/44'/60'/0'/0/{account_index} + +Gas Price +================== +20000000000 + +Gas Limit +================== +6721975 + +Call Gas Limit +================== +9007199254740991 + +Listening on 127.0.0.1:8545 +``` + +To install ganache-cli into an npm project, run: + +```bash +$ npm install ganache-cli +``` + +You can then add ganache-cli to your package.json scripts: + +```json +"scripts": { + "ganache": "ganache-cli --seed myCustomSeed" +} +``` + +_see [Documentation](#documentation) additional command line options_ + +then start it: + +```bash +$ npm run ganache +``` + +### Programmatic use + +You can use ganache-cli programmatically from Node.js. Install ganache-cli into your npm package: + +```bash +npm install ganache-cli +``` + +then start ganache as an EIP-1193 provider only: + +```javascript +import ganache from "ganache-cli"; + +const options = {}; +const provider = ganache.provider(options); +const accounts = await provider.request({ method: "eth_accounts", params: [] }); +``` + +or as an EIP-1193 provider _and_ JSON-RPC web server: + +```javascript +import ganache from "ganache-cli"; + +const options = {}; +const server = ganache.server(options); +const PORT = 8545; +server.listen(PORT, err => { + if (err) throw err; + + console.log(`ganache-cli listening on port ${PORT}...`); + const provider = server.provider; + const accounts = await provider.request({ method: "eth_accounts", params:[] }); +}); +``` + +#### As a [web3.js](https://www.npmjs.com/package/web3) Provider + +To use ganache as a Web3 provider: + +``` +import Web3 from "web3"; +import ganache from "ganache-cli"; + +const web3 = new Web3(ganache.provider()); +``` + +NOTE: depending on your web3 version, you may need to set a number of confirmation blocks + +``` +const web3 = new Web3(ganache.provider(), null, { transactionConfirmationBlocks: 1 }); +``` + +#### As an [ethers.js]() provider: + +``` +import ganache from "ganache-core"; + +const provider = new ethers.providers.Web3Provider(ganache.provider()); +``` + +## Documentation + +TODO + +## Community + +TODO + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) for our guide to contributing to ganache. + +## Related + +- [Truffle](https://www.github.com/trufflesuite/truffle) +- [Drizzle](https://www.github.com/trufflesuite/drizzle) + +
+ +--- + +

+ Truffle +

diff --git a/docs/DATAFLOW.md b/docs/DATAFLOW.md deleted file mode 100644 index c87bae060d..0000000000 --- a/docs/DATAFLOW.md +++ /dev/null @@ -1,42 +0,0 @@ -Render at https://www.planttext.com/ - -```uml -@startuml - -title Ganache Core Data Flow \n - -start - -:Server; - -:HttpServer/WebsocketServer; - -:Provider; - -note left - Ethereum, Tezos, etc. - `request(method: string, params: any[])` -end note - -:RequestCoordinator; - -note left - Lets us limit how many simultenous requests we process. -end note - -:Executor; - -note left - Ensures the requested RPC is a valid Ledger endpoint -end note - -:Ledger; - -note left - Executes the request. Implementation dependent. -end note - -stop - -@enduml -``` From 505a248771f361e28102a00819b6a8137440e43c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 15:51:19 -0400 Subject: [PATCH 623/691] Update descriptions --- scripts/create.ts | 2 +- src/chains/ethereum/README.md | 10 +--------- src/chains/ethereum/package.json | 2 +- src/chains/tezos/README.md | 10 +--------- src/chains/tezos/package.json | 2 +- src/packages/core/README.md | 10 ++-------- src/packages/flavors/README.md | 4 ++-- src/packages/options/README.md | 4 ++-- src/packages/promise-queue/README.md | 4 ++-- src/packages/utils/README.md | 10 +--------- 10 files changed, 14 insertions(+), 44 deletions(-) diff --git a/scripts/create.ts b/scripts/create.ts index 72addcb019..686d1c1c1b 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -230,7 +230,7 @@ typedoc.json ), writeFile( join(dir, "README.md"), - prettier.format(`# ${packageName}\n> TODO: description`, { + prettier.format(`# \`${packageName}\`\n> TODO: description`, { ...prettierConfig, parser: "markdown" }) diff --git a/src/chains/ethereum/README.md b/src/chains/ethereum/README.md index 2d0213bd50..7a449f8f46 100644 --- a/src/chains/ethereum/README.md +++ b/src/chains/ethereum/README.md @@ -1,11 +1,3 @@ # `@ganache/ethereum` -> TODO: description - -## Usage - -``` -const ethereum = require('@ganache/ethereum'); - -// TODO: DEMONSTRATE API -``` +This is ganache's Ethereum client implementation. diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 5f05b0af3e..ffeb068248 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -1,7 +1,7 @@ { "name": "@ganache/ethereum", "version": "2.2.1", - "description": "ganache-core's Ethereum client implementation", + "description": "Ganache's Ethereum client implementation", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/ethereum#readme", "license": "MIT", diff --git a/src/chains/tezos/README.md b/src/chains/tezos/README.md index e09a9ea2a7..59fe51bb8c 100644 --- a/src/chains/tezos/README.md +++ b/src/chains/tezos/README.md @@ -1,11 +1,3 @@ # `@ganache/tezos` -> TODO: description - -## Usage - -``` -const tezos = require('@ganache/tezos'); - -// TODO: DEMONSTRATE API -``` +This is ganache's Tezos client implementation. diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 16aa4ccf4c..99a8957ff2 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -1,7 +1,7 @@ { "name": "@ganache/tezos", "version": "2.2.1", - "description": "ganache-core's Tezos client implementation", + "description": "Ganache's Tezos client implementation", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/chains/tezos#readme", "license": "MIT", diff --git a/src/packages/core/README.md b/src/packages/core/README.md index ff63f7d2ec..9ae51677af 100644 --- a/src/packages/core/README.md +++ b/src/packages/core/README.md @@ -1,11 +1,5 @@ # `@ganache/core` -> TODO: description +The `ganache-core` npm package. -## Usage - -``` -const core = require('@ganache/core'); - -// TODO: DEMONSTRATE API -``` +See [README.md](../../../README.md) for info. diff --git a/src/packages/flavors/README.md b/src/packages/flavors/README.md index 0a370b3a7d..e1b8783f7e 100644 --- a/src/packages/flavors/README.md +++ b/src/packages/flavors/README.md @@ -1,3 +1,3 @@ -# flavors +# `@ganache/flavors` -> TODO: description +Ganache's flavors enumeration and TypeScript types diff --git a/src/packages/options/README.md b/src/packages/options/README.md index 2221a9a0a1..177621cbe7 100644 --- a/src/packages/options/README.md +++ b/src/packages/options/README.md @@ -1,3 +1,3 @@ -# options +# `@ganache/options` -> TODO: description +Ganache's server/provider options TypeScript types diff --git a/src/packages/promise-queue/README.md b/src/packages/promise-queue/README.md index d86dd5c991..f9807bd8c9 100644 --- a/src/packages/promise-queue/README.md +++ b/src/packages/promise-queue/README.md @@ -1,3 +1,3 @@ -# @ganache/promise-queue +# `@ganache/promise-queue` -> TODO: description +A queue that resolves Promise instances in first-in first-out order. diff --git a/src/packages/utils/README.md b/src/packages/utils/README.md index 52e545daf2..0368a05105 100644 --- a/src/packages/utils/README.md +++ b/src/packages/utils/README.md @@ -1,11 +1,3 @@ # `@ganache/utils` -> TODO: description - -## Usage - -``` -const utils = require('@ganache/utils'); - -// TODO: DEMONSTRATE API -``` +Utility functions for @ganache packages. From 3197fcc1d49692aa49432ab5ad3b57ac3b9de5ed Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 15:55:50 -0400 Subject: [PATCH 624/691] debug CI test --- .../ethereum/__tests__/api/eth/eth.test.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/__tests__/api/eth/eth.test.ts index 745c4a796e..5de4379d33 100644 --- a/src/chains/ethereum/__tests__/api/eth/eth.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/eth.test.ts @@ -222,7 +222,11 @@ describe("api", () => { await provider.send("eth_sendTransaction", [{ ...tx }]); await provider.once("message"); const blockx1 = await provider.send("eth_blockNumber"); - assert.strictEqual(+blockx1, startingBlockNumber + 1); + assert.strictEqual( + +blockx1, + startingBlockNumber + 1, + "first tx's block number not as expected" + ); const awaitFor = count => new Promise(resolve => { @@ -253,10 +257,18 @@ describe("api", () => { await wait; wait = awaitFor(4); const blockx5 = await provider.send("eth_blockNumber"); - assert.strictEqual(+blockx5, startingBlockNumber + 5); + assert.strictEqual( + +blockx5, + startingBlockNumber + 5, + "second block's number not as expected" + ); await wait; const blockx9 = await provider.send("eth_blockNumber"); - assert.strictEqual(+blockx9, startingBlockNumber + 9); + assert.strictEqual( + +blockx9, + startingBlockNumber + 9, + "third block's number not as expected" + ); }); }); From e101000e5777ed7eb2dfcabda4570b86fd32922c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 16:09:10 -0400 Subject: [PATCH 625/691] maybe fix flaky test --- .../__tests__/api/evm/snapshot.test.ts | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index a2f91dbc62..9b01bdbbaa 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -407,6 +407,16 @@ describe("api", () => { // revert while these transactions are being mined const revertPromise = send("evm_revert", [snapShotId]); + const txsMinedProm = new Promise(resolve => { + let count = 0; + const unsub = provider.on("message", () => { + if (++count === 2) { + unsub(); + resolve(null); + } + }); + }); + // send some transactions const inFlightTxs = [ send("eth_sendTransaction", [{ from, to, value: value++ }]), @@ -422,15 +432,6 @@ describe("api", () => { { from, to, value: value++, nonce: accountNonce + 3 } ]) ]; - const txsMinedProm = new Promise(resolve => { - let count = 0; - const unsub = provider.on("message", () => { - if (++count === 2) { - unsub(); - resolve(null); - } - }); - }); // wait for the tx hashes to be returned; this is confirmation that // they've been accepted by the transaction pool. @@ -500,10 +501,7 @@ describe("api", () => { ); }); - // send one more transaction to fill in the gap - send("eth_sendTransaction", [{ from, to, value: value++ }]); - - await new Promise(resolve => { + const gotTxsProm = new Promise(resolve => { let count = 0; const unsub = provider.on("message", () => { if (++count === 3) { @@ -513,6 +511,11 @@ describe("api", () => { }); }); + // send one more transaction to fill in the gap + send("eth_sendTransaction", [{ from, to, value: value++ }]); + + await gotTxsProm; + const finalLaterTxsReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalLaterTxsTransactionsProm = Promise.all(txHashes.map(getTx)); const [ From 5aa48a4cc2d54f75326992b69780435093284be6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 18:12:54 -0400 Subject: [PATCH 626/691] just trying to see where this test fails --- .../__tests__/api/evm/snapshot.test.ts | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 9b01bdbbaa..e59ed480aa 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -387,12 +387,12 @@ describe("api", () => { send, accounts: [from, to] } = context; - + console.log("got here 1"); const accountNonce = parseInt( await send("eth_getTransactionCount", [from]), 16 ); - + console.log("got here 2"); const snapShotId = await send("evm_snapshot"); // increment value for each transaction so the hashes always differ @@ -402,14 +402,17 @@ describe("api", () => { const revertedTx = await send("eth_sendTransaction", [ { from, to, value: value++ } ]); + console.log("got here 3"); await provider.once("message"); + console.log("got here 4"); // revert while these transactions are being mined const revertPromise = send("evm_revert", [snapShotId]); const txsMinedProm = new Promise(resolve => { let count = 0; - const unsub = provider.on("message", () => { + const unsub = provider.on("message", m => { + console.log(m); if (++count === 2) { unsub(); resolve(null); @@ -443,6 +446,7 @@ describe("api", () => { send("eth_getTransactionByHash", [hash]); // wait for the revert to finish up + console.log("got here 5"); const result = await Promise.race([revertPromise, txHashPromises]); assert.strictEqual( result, @@ -451,22 +455,28 @@ describe("api", () => { ); // wait for the inFlightTxs to be mined + console.log("got here 6"); await txsMinedProm; + console.log("got here 7"); const txHashes = await txHashPromises; + console.log("got here 8"); const laterHashes = await Promise.all(laterTxs); // and mine one more block just to force the any executable transactions // to be immediately mined + console.log("got here 9"); await send("evm_mine"); const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalTransactionsProm = Promise.all(txHashes.map(getTx)); + console.log("got here 10"); const [finalReceipts, finalTransactions] = await Promise.all([ finalReceiptsProm, finalTransactionsProm ]); // verify that we do have the receipts + console.log(finalReceipts); finalReceipts.forEach(receipt => { assert.notStrictEqual(receipt, null, "Receipt should not be null"); }); @@ -482,6 +492,7 @@ describe("api", () => { const laterTxsReceiptsProm = Promise.all(laterHashes.map(getReceipt)); const laterTxsTransactionsProm = Promise.all(laterHashes.map(getTx)); + console.log("got here 11"); const [laterTxsReceipts, laterTxsTransactions] = await Promise.all([ laterTxsReceiptsProm, laterTxsTransactionsProm @@ -503,7 +514,8 @@ describe("api", () => { const gotTxsProm = new Promise(resolve => { let count = 0; - const unsub = provider.on("message", () => { + const unsub = provider.on("message", m => { + console.log(m); if (++count === 3) { unsub(); resolve(null); @@ -513,11 +525,12 @@ describe("api", () => { // send one more transaction to fill in the gap send("eth_sendTransaction", [{ from, to, value: value++ }]); - + console.log("got here 12"); await gotTxsProm; const finalLaterTxsReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalLaterTxsTransactionsProm = Promise.all(txHashes.map(getTx)); + console.log("got here 13"); const [ finalLaterTxsReceipts, finalLaterTxsTransactions @@ -540,7 +553,9 @@ describe("api", () => { ); }); + console.log("got here 14"); const revertedTxReceipt = await getReceipt(revertedTx); + console.log("got here 15"); const revertedTxTransactions = await getTx(revertedTx); assert.strictEqual( revertedTxReceipt, From fda597136c7f8a2b83364922add7577f5ed7e702 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 18:13:36 -0400 Subject: [PATCH 627/691] this setting was horrible --- .npmrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.npmrc b/.npmrc index e9d11a868d..eb29e2d5fe 100644 --- a/.npmrc +++ b/.npmrc @@ -4,4 +4,3 @@ sign-git-commit=true sign-git-tag=true loglevel=error fund=false -format-package-lock=false From 363271228018c5a6c319801cebd07f3536286877 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 18:15:39 -0400 Subject: [PATCH 628/691] console highlights things betetr --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fcd51dd430..dff48a353d 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,13 @@ You must first install [Node.js](https://nodejs.org/) >= v10.7.0 and npm >= 6.1. To install ganache-cli globally, run: -```bash +```console $ npm install ganache-cli --global ``` Once installed globally, you can start ganache-cli right from your command line: -```bash +```console $ ganache-cli Ganache CLI v6.12.1 (ganache-core: 2.13.1) @@ -105,7 +105,7 @@ Listening on 127.0.0.1:8545 To install ganache-cli into an npm project, run: -```bash +```console $ npm install ganache-cli ``` @@ -121,7 +121,7 @@ _see [Documentation](#documentation) additional command line options_ then start it: -```bash +```console $ npm run ganache ``` @@ -129,8 +129,8 @@ $ npm run ganache You can use ganache-cli programmatically from Node.js. Install ganache-cli into your npm package: -```bash -npm install ganache-cli +```console +$ npm install ganache-cli ``` then start ganache as an EIP-1193 provider only: From 6e4bb0923d2215177514d109b33347b36e497ad6 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 18:21:57 -0400 Subject: [PATCH 629/691] shrinkwrap --- npm-shrinkwrap.json | 12624 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 12623 insertions(+), 1 deletion(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2eef8197cf..904007b0c2 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1 +1,12623 @@ -{"name":"root","requires":true,"lockfileVersion":1,"dependencies":{"@babel/code-frame":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz","integrity":"sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==","dev":true,"requires":{"@babel/highlight":"^7.10.4"}},"@babel/core":{"version":"7.11.6","resolved":"https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz","integrity":"sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==","dev":true,"requires":{"@babel/code-frame":"^7.10.4","@babel/generator":"^7.11.6","@babel/helper-module-transforms":"^7.11.0","@babel/helpers":"^7.10.4","@babel/parser":"^7.11.5","@babel/template":"^7.10.4","@babel/traverse":"^7.11.5","@babel/types":"^7.11.5","convert-source-map":"^1.7.0","debug":"^4.1.0","gensync":"^1.0.0-beta.1","json5":"^2.1.2","lodash":"^4.17.19","resolve":"^1.3.2","semver":"^5.4.1","source-map":"^0.5.0"},"dependencies":{"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}}}},"@babel/generator":{"version":"7.11.6","resolved":"https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz","integrity":"sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==","dev":true,"requires":{"@babel/types":"^7.11.5","jsesc":"^2.5.1","source-map":"^0.5.0"}},"@babel/helper-function-name":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz","integrity":"sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==","dev":true,"requires":{"@babel/helper-get-function-arity":"^7.10.4","@babel/template":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/helper-get-function-arity":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz","integrity":"sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==","dev":true,"requires":{"@babel/types":"^7.10.4"}},"@babel/helper-member-expression-to-functions":{"version":"7.11.0","resolved":"https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz","integrity":"sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==","dev":true,"requires":{"@babel/types":"^7.11.0"}},"@babel/helper-module-imports":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz","integrity":"sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==","dev":true,"requires":{"@babel/types":"^7.10.4"}},"@babel/helper-module-transforms":{"version":"7.11.0","resolved":"https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz","integrity":"sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==","dev":true,"requires":{"@babel/helper-module-imports":"^7.10.4","@babel/helper-replace-supers":"^7.10.4","@babel/helper-simple-access":"^7.10.4","@babel/helper-split-export-declaration":"^7.11.0","@babel/template":"^7.10.4","@babel/types":"^7.11.0","lodash":"^4.17.19"}},"@babel/helper-optimise-call-expression":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz","integrity":"sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==","dev":true,"requires":{"@babel/types":"^7.10.4"}},"@babel/helper-replace-supers":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz","integrity":"sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==","dev":true,"requires":{"@babel/helper-member-expression-to-functions":"^7.10.4","@babel/helper-optimise-call-expression":"^7.10.4","@babel/traverse":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/helper-simple-access":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz","integrity":"sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==","dev":true,"requires":{"@babel/template":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/helper-split-export-declaration":{"version":"7.11.0","resolved":"https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz","integrity":"sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==","dev":true,"requires":{"@babel/types":"^7.11.0"}},"@babel/helper-validator-identifier":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz","integrity":"sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==","dev":true},"@babel/helpers":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz","integrity":"sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==","dev":true,"requires":{"@babel/template":"^7.10.4","@babel/traverse":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/highlight":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz","integrity":"sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==","dev":true,"requires":{"@babel/helper-validator-identifier":"^7.10.4","chalk":"^2.0.0","js-tokens":"^4.0.0"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@babel/parser":{"version":"7.11.5","resolved":"https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz","integrity":"sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==","dev":true},"@babel/template":{"version":"7.10.4","resolved":"https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz","integrity":"sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==","dev":true,"requires":{"@babel/code-frame":"^7.10.4","@babel/parser":"^7.10.4","@babel/types":"^7.10.4"}},"@babel/traverse":{"version":"7.11.5","resolved":"https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz","integrity":"sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==","dev":true,"requires":{"@babel/code-frame":"^7.10.4","@babel/generator":"^7.11.5","@babel/helper-function-name":"^7.10.4","@babel/helper-split-export-declaration":"^7.11.0","@babel/parser":"^7.11.5","@babel/types":"^7.11.5","debug":"^4.1.0","globals":"^11.1.0","lodash":"^4.17.19"},"dependencies":{"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}}}},"@babel/types":{"version":"7.11.5","resolved":"https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz","integrity":"sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==","dev":true,"requires":{"@babel/helper-validator-identifier":"^7.10.4","lodash":"^4.17.19","to-fast-properties":"^2.0.0"}},"@dsherret/to-absolute-glob":{"version":"2.0.2","resolved":"https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz","integrity":"sha1-H2R13IvZdM6gei2vOGSzF7HdMyw=","dev":true,"requires":{"is-absolute":"^1.0.0","is-negated-glob":"^1.0.0"}},"@evocateur/libnpmaccess":{"version":"3.1.2","resolved":"https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz","integrity":"sha512-KSCAHwNWro0CF2ukxufCitT9K5LjL/KuMmNzSu8wuwN2rjyKHD8+cmOsiybK+W5hdnwc5M1SmRlVCaMHQo+3rg==","dev":true,"requires":{"@evocateur/npm-registry-fetch":"^4.0.0","aproba":"^2.0.0","figgy-pudding":"^3.5.1","get-stream":"^4.0.0","npm-package-arg":"^6.1.0"},"dependencies":{"aproba":{"version":"2.0.0","resolved":"https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz","integrity":"sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==","dev":true},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@evocateur/libnpmpublish":{"version":"1.2.2","resolved":"https://registry.npmjs.org/@evocateur/libnpmpublish/-/libnpmpublish-1.2.2.tgz","integrity":"sha512-MJrrk9ct1FeY9zRlyeoyMieBjGDG9ihyyD9/Ft6MMrTxql9NyoEx2hw9casTIP4CdqEVu+3nQ2nXxoJ8RCXyFg==","dev":true,"requires":{"@evocateur/npm-registry-fetch":"^4.0.0","aproba":"^2.0.0","figgy-pudding":"^3.5.1","get-stream":"^4.0.0","lodash.clonedeep":"^4.5.0","normalize-package-data":"^2.4.0","npm-package-arg":"^6.1.0","semver":"^5.5.1","ssri":"^6.0.1"},"dependencies":{"aproba":{"version":"2.0.0","resolved":"https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz","integrity":"sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==","dev":true},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@evocateur/npm-registry-fetch":{"version":"4.0.0","resolved":"https://registry.npmjs.org/@evocateur/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz","integrity":"sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g==","dev":true,"requires":{"JSONStream":"^1.3.4","bluebird":"^3.5.1","figgy-pudding":"^3.4.1","lru-cache":"^5.1.1","make-fetch-happen":"^5.0.0","npm-package-arg":"^6.1.0","safe-buffer":"^5.1.2"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@evocateur/pacote":{"version":"9.6.5","resolved":"https://registry.npmjs.org/@evocateur/pacote/-/pacote-9.6.5.tgz","integrity":"sha512-EI552lf0aG2nOV8NnZpTxNo2PcXKPmDbF9K8eCBFQdIZwHNGN/mi815fxtmUMa2wTa1yndotICIDt/V0vpEx2w==","dev":true,"requires":{"@evocateur/npm-registry-fetch":"^4.0.0","bluebird":"^3.5.3","cacache":"^12.0.3","chownr":"^1.1.2","figgy-pudding":"^3.5.1","get-stream":"^4.1.0","glob":"^7.1.4","infer-owner":"^1.0.4","lru-cache":"^5.1.1","make-fetch-happen":"^5.0.0","minimatch":"^3.0.4","minipass":"^2.3.5","mississippi":"^3.0.0","mkdirp":"^0.5.1","normalize-package-data":"^2.5.0","npm-package-arg":"^6.1.0","npm-packlist":"^1.4.4","npm-pick-manifest":"^3.0.0","osenv":"^0.1.5","promise-inflight":"^1.0.1","promise-retry":"^1.1.1","protoduck":"^5.0.1","rimraf":"^2.6.3","safe-buffer":"^5.2.0","semver":"^5.7.0","ssri":"^6.0.1","tar":"^4.4.10","unique-filename":"^1.1.1","which":"^1.3.1"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"which":{"version":"1.3.1","resolved":"https://registry.npmjs.org/which/-/which-1.3.1.tgz","integrity":"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==","dev":true,"requires":{"isexe":"^2.0.0"}}}},"@istanbuljs/load-nyc-config":{"version":"1.1.0","resolved":"https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz","integrity":"sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==","dev":true,"requires":{"camelcase":"^5.3.1","find-up":"^4.1.0","get-package-type":"^0.1.0","js-yaml":"^3.13.1","resolve-from":"^5.0.0"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"resolve-from":{"version":"5.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz","integrity":"sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==","dev":true}}},"@istanbuljs/nyc-config-typescript":{"version":"1.0.1","resolved":"https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz","integrity":"sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==","dev":true,"requires":{"@istanbuljs/schema":"^0.1.2"}},"@istanbuljs/schema":{"version":"0.1.2","resolved":"https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz","integrity":"sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==","dev":true},"@lerna/add":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/add/-/add-3.21.0.tgz","integrity":"sha512-vhUXXF6SpufBE1EkNEXwz1VLW03f177G9uMOFMQkp6OJ30/PWg4Ekifuz9/3YfgB2/GH8Tu4Lk3O51P2Hskg/A==","dev":true,"requires":{"@evocateur/pacote":"^9.6.3","@lerna/bootstrap":"3.21.0","@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/npm-conf":"3.16.0","@lerna/validation-error":"3.13.0","dedent":"^0.7.0","npm-package-arg":"^6.1.0","p-map":"^2.1.0","semver":"^6.2.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/bootstrap":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.21.0.tgz","integrity":"sha512-mtNHlXpmvJn6JTu0KcuTTPl2jLsDNud0QacV/h++qsaKbhAaJr/FElNZ5s7MwZFUM3XaDmvWzHKaszeBMHIbBw==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/has-npm-version":"3.16.5","@lerna/npm-install":"3.16.5","@lerna/package-graph":"3.18.5","@lerna/pulse-till-done":"3.13.0","@lerna/rimraf-dir":"3.16.5","@lerna/run-lifecycle":"3.16.2","@lerna/run-topologically":"3.18.5","@lerna/symlink-binary":"3.17.0","@lerna/symlink-dependencies":"3.17.0","@lerna/validation-error":"3.13.0","dedent":"^0.7.0","get-port":"^4.2.0","multimatch":"^3.0.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","p-finally":"^1.0.0","p-map":"^2.1.0","p-map-series":"^1.0.0","p-waterfall":"^1.0.0","read-package-tree":"^5.1.6","semver":"^6.2.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/changed":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/changed/-/changed-3.21.0.tgz","integrity":"sha512-hzqoyf8MSHVjZp0gfJ7G8jaz+++mgXYiNs9iViQGA8JlN/dnWLI5sWDptEH3/B30Izo+fdVz0S0s7ydVE3pWIw==","dev":true,"requires":{"@lerna/collect-updates":"3.20.0","@lerna/command":"3.21.0","@lerna/listable":"3.18.5","@lerna/output":"3.13.0"}},"@lerna/check-working-tree":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-3.16.5.tgz","integrity":"sha512-xWjVBcuhvB8+UmCSb5tKVLB5OuzSpw96WEhS2uz6hkWVa/Euh1A0/HJwn2cemyK47wUrCQXtczBUiqnq9yX5VQ==","dev":true,"requires":{"@lerna/collect-uncommitted":"3.16.5","@lerna/describe-ref":"3.16.5","@lerna/validation-error":"3.13.0"}},"@lerna/child-process":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/child-process/-/child-process-3.16.5.tgz","integrity":"sha512-vdcI7mzei9ERRV4oO8Y1LHBZ3A5+ampRKg1wq5nutLsUA4mEBN6H7JqjWOMY9xZemv6+kATm2ofjJ3lW5TszQg==","dev":true,"requires":{"chalk":"^2.3.1","execa":"^1.0.0","strong-log-transformer":"^2.0.0"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@lerna/clean":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/clean/-/clean-3.21.0.tgz","integrity":"sha512-b/L9l+MDgE/7oGbrav6rG8RTQvRiZLO1zTcG17zgJAAuhlsPxJExMlh2DFwJEVi2les70vMhHfST3Ue1IMMjpg==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/prompt":"3.18.5","@lerna/pulse-till-done":"3.13.0","@lerna/rimraf-dir":"3.16.5","p-map":"^2.1.0","p-map-series":"^1.0.0","p-waterfall":"^1.0.0"}},"@lerna/cli":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/cli/-/cli-3.18.5.tgz","integrity":"sha512-erkbxkj9jfc89vVs/jBLY/fM0I80oLmJkFUV3Q3wk9J3miYhP14zgVEBsPZY68IZlEjT6T3Xlq2xO1AVaatHsA==","dev":true,"requires":{"@lerna/global-options":"3.13.0","dedent":"^0.7.0","npmlog":"^4.1.2","yargs":"^14.2.2"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"string-width":{"version":"3.1.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz","integrity":"sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==","dev":true,"requires":{"emoji-regex":"^7.0.1","is-fullwidth-code-point":"^2.0.0","strip-ansi":"^5.1.0"}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"}},"yargs":{"version":"14.2.3","resolved":"https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz","integrity":"sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==","dev":true,"requires":{"cliui":"^5.0.0","decamelize":"^1.2.0","find-up":"^3.0.0","get-caller-file":"^2.0.1","require-directory":"^2.1.1","require-main-filename":"^2.0.0","set-blocking":"^2.0.0","string-width":"^3.0.0","which-module":"^2.0.0","y18n":"^4.0.0","yargs-parser":"^15.0.1"}}}},"@lerna/collect-uncommitted":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-3.16.5.tgz","integrity":"sha512-ZgqnGwpDZiWyzIQVZtQaj9tRizsL4dUOhuOStWgTAw1EMe47cvAY2kL709DzxFhjr6JpJSjXV5rZEAeU3VE0Hg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","chalk":"^2.3.1","figgy-pudding":"^3.5.1","npmlog":"^4.1.2"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@lerna/collect-updates":{"version":"3.20.0","resolved":"https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-3.20.0.tgz","integrity":"sha512-qBTVT5g4fupVhBFuY4nI/3FSJtQVcDh7/gEPOpRxoXB/yCSnT38MFHXWl+y4einLciCjt/+0x6/4AG80fjay2Q==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/describe-ref":"3.16.5","minimatch":"^3.0.4","npmlog":"^4.1.2","slash":"^2.0.0"}},"@lerna/command":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/command/-/command-3.21.0.tgz","integrity":"sha512-T2bu6R8R3KkH5YoCKdutKv123iUgUbW8efVjdGCDnCMthAQzoentOJfDeodBwn0P2OqCl3ohsiNVtSn9h78fyQ==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/package-graph":"3.18.5","@lerna/project":"3.21.0","@lerna/validation-error":"3.13.0","@lerna/write-log-file":"3.13.0","clone-deep":"^4.0.1","dedent":"^0.7.0","execa":"^1.0.0","is-ci":"^2.0.0","npmlog":"^4.1.2"}},"@lerna/conventional-commits":{"version":"3.22.0","resolved":"https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-3.22.0.tgz","integrity":"sha512-z4ZZk1e8Mhz7+IS8NxHr64wyklHctCJyWpJKEZZPJiLFJ8yKto/x38O80R10pIzC0rr8Sy/OsjSH4bl0TbbgqA==","dev":true,"requires":{"@lerna/validation-error":"3.13.0","conventional-changelog-angular":"^5.0.3","conventional-changelog-core":"^3.1.6","conventional-recommended-bump":"^5.0.0","fs-extra":"^8.1.0","get-stream":"^4.0.0","lodash.template":"^4.5.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","pify":"^4.0.1","semver":"^6.2.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/create":{"version":"3.22.0","resolved":"https://registry.npmjs.org/@lerna/create/-/create-3.22.0.tgz","integrity":"sha512-MdiQQzCcB4E9fBF1TyMOaAEz9lUjIHp1Ju9H7f3lXze5JK6Fl5NYkouAvsLgY6YSIhXMY8AHW2zzXeBDY4yWkw==","dev":true,"requires":{"@evocateur/pacote":"^9.6.3","@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","@lerna/npm-conf":"3.16.0","@lerna/validation-error":"3.13.0","camelcase":"^5.0.0","dedent":"^0.7.0","fs-extra":"^8.1.0","globby":"^9.2.0","init-package-json":"^1.10.3","npm-package-arg":"^6.1.0","p-reduce":"^1.0.0","pify":"^4.0.1","semver":"^6.2.0","slash":"^2.0.0","validate-npm-package-license":"^3.0.3","validate-npm-package-name":"^3.0.0","whatwg-url":"^7.0.0"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/create-symlink":{"version":"3.16.2","resolved":"https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-3.16.2.tgz","integrity":"sha512-pzXIJp6av15P325sgiIRpsPXLFmkisLhMBCy4764d+7yjf2bzrJ4gkWVMhsv4AdF0NN3OyZ5jjzzTtLNqfR+Jw==","dev":true,"requires":{"@zkochan/cmd-shim":"^3.1.0","fs-extra":"^8.1.0","npmlog":"^4.1.2"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/describe-ref":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-3.16.5.tgz","integrity":"sha512-c01+4gUF0saOOtDBzbLMFOTJDHTKbDFNErEY6q6i9QaXuzy9LNN62z+Hw4acAAZuJQhrVWncVathcmkkjvSVGw==","dev":true,"requires":{"@lerna/child-process":"3.16.5","npmlog":"^4.1.2"}},"@lerna/diff":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/diff/-/diff-3.21.0.tgz","integrity":"sha512-5viTR33QV3S7O+bjruo1SaR40m7F2aUHJaDAC7fL9Ca6xji+aw1KFkpCtVlISS0G8vikUREGMJh+c/VMSc8Usw==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","@lerna/validation-error":"3.13.0","npmlog":"^4.1.2"}},"@lerna/exec":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/exec/-/exec-3.21.0.tgz","integrity":"sha512-iLvDBrIE6rpdd4GIKTY9mkXyhwsJ2RvQdB9ZU+/NhR3okXfqKc6py/24tV111jqpXTtZUW6HNydT4dMao2hi1Q==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/profiler":"3.20.0","@lerna/run-topologically":"3.18.5","@lerna/validation-error":"3.13.0","p-map":"^2.1.0"}},"@lerna/filter-options":{"version":"3.20.0","resolved":"https://registry.npmjs.org/@lerna/filter-options/-/filter-options-3.20.0.tgz","integrity":"sha512-bmcHtvxn7SIl/R9gpiNMVG7yjx7WyT0HSGw34YVZ9B+3xF/83N3r5Rgtjh4hheLZ+Q91Or0Jyu5O3Nr+AwZe2g==","dev":true,"requires":{"@lerna/collect-updates":"3.20.0","@lerna/filter-packages":"3.18.0","dedent":"^0.7.0","figgy-pudding":"^3.5.1","npmlog":"^4.1.2"}},"@lerna/filter-packages":{"version":"3.18.0","resolved":"https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-3.18.0.tgz","integrity":"sha512-6/0pMM04bCHNATIOkouuYmPg6KH3VkPCIgTfQmdkPJTullERyEQfNUKikrefjxo1vHOoCACDpy65JYyKiAbdwQ==","dev":true,"requires":{"@lerna/validation-error":"3.13.0","multimatch":"^3.0.0","npmlog":"^4.1.2"}},"@lerna/get-npm-exec-opts":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.13.0.tgz","integrity":"sha512-Y0xWL0rg3boVyJk6An/vurKzubyJKtrxYv2sj4bB8Mc5zZ3tqtv0ccbOkmkXKqbzvNNF7VeUt1OJ3DRgtC/QZw==","dev":true,"requires":{"npmlog":"^4.1.2"}},"@lerna/get-packed":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/get-packed/-/get-packed-3.16.0.tgz","integrity":"sha512-AjsFiaJzo1GCPnJUJZiTW6J1EihrPkc2y3nMu6m3uWFxoleklsSCyImumzVZJssxMi3CPpztj8LmADLedl9kXw==","dev":true,"requires":{"fs-extra":"^8.1.0","ssri":"^6.0.1","tar":"^4.4.8"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/github-client":{"version":"3.22.0","resolved":"https://registry.npmjs.org/@lerna/github-client/-/github-client-3.22.0.tgz","integrity":"sha512-O/GwPW+Gzr3Eb5bk+nTzTJ3uv+jh5jGho9BOqKlajXaOkMYGBELEAqV5+uARNGWZFvYAiF4PgqHb6aCUu7XdXg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@octokit/plugin-enterprise-rest":"^6.0.1","@octokit/rest":"^16.28.4","git-url-parse":"^11.1.2","npmlog":"^4.1.2"}},"@lerna/gitlab-client":{"version":"3.15.0","resolved":"https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-3.15.0.tgz","integrity":"sha512-OsBvRSejHXUBMgwWQqNoioB8sgzL/Pf1pOUhHKtkiMl6aAWjklaaq5HPMvTIsZPfS6DJ9L5OK2GGZuooP/5c8Q==","dev":true,"requires":{"node-fetch":"^2.5.0","npmlog":"^4.1.2","whatwg-url":"^7.0.0"}},"@lerna/global-options":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/global-options/-/global-options-3.13.0.tgz","integrity":"sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ==","dev":true},"@lerna/has-npm-version":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-3.16.5.tgz","integrity":"sha512-WL7LycR9bkftyqbYop5rEGJ9sRFIV55tSGmbN1HLrF9idwOCD7CLrT64t235t3t4O5gehDnwKI5h2U3oxTrF8Q==","dev":true,"requires":{"@lerna/child-process":"3.16.5","semver":"^6.2.0"},"dependencies":{"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/import":{"version":"3.22.0","resolved":"https://registry.npmjs.org/@lerna/import/-/import-3.22.0.tgz","integrity":"sha512-uWOlexasM5XR6tXi4YehODtH9Y3OZrFht3mGUFFT3OIl2s+V85xIGFfqFGMTipMPAGb2oF1UBLL48kR43hRsOg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","@lerna/prompt":"3.18.5","@lerna/pulse-till-done":"3.13.0","@lerna/validation-error":"3.13.0","dedent":"^0.7.0","fs-extra":"^8.1.0","p-map-series":"^1.0.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/info":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/info/-/info-3.21.0.tgz","integrity":"sha512-0XDqGYVBgWxUquFaIptW2bYSIu6jOs1BtkvRTWDDhw4zyEdp6q4eaMvqdSap1CG+7wM5jeLCi6z94wS0AuiuwA==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/output":"3.13.0","envinfo":"^7.3.1"}},"@lerna/init":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/init/-/init-3.21.0.tgz","integrity":"sha512-6CM0z+EFUkFfurwdJCR+LQQF6MqHbYDCBPyhu/d086LRf58GtYZYj49J8mKG9ktayp/TOIxL/pKKjgLD8QBPOg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/command":"3.21.0","fs-extra":"^8.1.0","p-map":"^2.1.0","write-json-file":"^3.2.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/link":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/link/-/link-3.21.0.tgz","integrity":"sha512-tGu9GxrX7Ivs+Wl3w1+jrLi1nQ36kNI32dcOssij6bg0oZ2M2MDEFI9UF2gmoypTaN9uO5TSsjCFS7aR79HbdQ==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/package-graph":"3.18.5","@lerna/symlink-dependencies":"3.17.0","p-map":"^2.1.0","slash":"^2.0.0"}},"@lerna/list":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/list/-/list-3.21.0.tgz","integrity":"sha512-KehRjE83B1VaAbRRkRy6jLX1Cin8ltsrQ7FHf2bhwhRHK0S54YuA6LOoBnY/NtA8bHDX/Z+G5sMY78X30NS9tg==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/listable":"3.18.5","@lerna/output":"3.13.0"}},"@lerna/listable":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/listable/-/listable-3.18.5.tgz","integrity":"sha512-Sdr3pVyaEv5A7ZkGGYR7zN+tTl2iDcinryBPvtuv20VJrXBE8wYcOks1edBTcOWsPjCE/rMP4bo1pseyk3UTsg==","dev":true,"requires":{"@lerna/query-graph":"3.18.5","chalk":"^2.3.1","columnify":"^1.5.4"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@lerna/log-packed":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/log-packed/-/log-packed-3.16.0.tgz","integrity":"sha512-Fp+McSNBV/P2mnLUYTaSlG8GSmpXM7krKWcllqElGxvAqv6chk2K3c2k80MeVB4WvJ9tRjUUf+i7HUTiQ9/ckQ==","dev":true,"requires":{"byte-size":"^5.0.1","columnify":"^1.5.4","has-unicode":"^2.0.1","npmlog":"^4.1.2"}},"@lerna/npm-conf":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-3.16.0.tgz","integrity":"sha512-HbO3DUrTkCAn2iQ9+FF/eisDpWY5POQAOF1m7q//CZjdC2HSW3UYbKEGsSisFxSfaF9Z4jtrV+F/wX6qWs3CuA==","dev":true,"requires":{"config-chain":"^1.1.11","pify":"^4.0.1"}},"@lerna/npm-dist-tag":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-3.18.5.tgz","integrity":"sha512-xw0HDoIG6HreVsJND9/dGls1c+lf6vhu7yJoo56Sz5bvncTloYGLUppIfDHQr4ZvmPCK8rsh0euCVh2giPxzKQ==","dev":true,"requires":{"@evocateur/npm-registry-fetch":"^4.0.0","@lerna/otplease":"3.18.5","figgy-pudding":"^3.5.1","npm-package-arg":"^6.1.0","npmlog":"^4.1.2"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@lerna/npm-install":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/npm-install/-/npm-install-3.16.5.tgz","integrity":"sha512-hfiKk8Eku6rB9uApqsalHHTHY+mOrrHeWEs+gtg7+meQZMTS3kzv4oVp5cBZigndQr3knTLjwthT/FX4KvseFg==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/get-npm-exec-opts":"3.13.0","fs-extra":"^8.1.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","signal-exit":"^3.0.2","write-pkg":"^3.1.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/npm-publish":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-3.18.5.tgz","integrity":"sha512-3etLT9+2L8JAx5F8uf7qp6iAtOLSMj+ZYWY6oUgozPi/uLqU0/gsMsEXh3F0+YVW33q0M61RpduBoAlOOZnaTg==","dev":true,"requires":{"@evocateur/libnpmpublish":"^1.2.2","@lerna/otplease":"3.18.5","@lerna/run-lifecycle":"3.16.2","figgy-pudding":"^3.5.1","fs-extra":"^8.1.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","pify":"^4.0.1","read-package-json":"^2.0.13"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/npm-run-script":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-3.16.5.tgz","integrity":"sha512-1asRi+LjmVn3pMjEdpqKJZFT/3ZNpb+VVeJMwrJaV/3DivdNg7XlPK9LTrORuKU4PSvhdEZvJmSlxCKyDpiXsQ==","dev":true,"requires":{"@lerna/child-process":"3.16.5","@lerna/get-npm-exec-opts":"3.13.0","npmlog":"^4.1.2"}},"@lerna/otplease":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/otplease/-/otplease-3.18.5.tgz","integrity":"sha512-S+SldXAbcXTEDhzdxYLU0ZBKuYyURP/ND2/dK6IpKgLxQYh/z4ScljPDMyKymmEvgiEJmBsPZAAPfmNPEzxjog==","dev":true,"requires":{"@lerna/prompt":"3.18.5","figgy-pudding":"^3.5.1"}},"@lerna/output":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/output/-/output-3.13.0.tgz","integrity":"sha512-7ZnQ9nvUDu/WD+bNsypmPG5MwZBwu86iRoiW6C1WBuXXDxM5cnIAC1m2WxHeFnjyMrYlRXM9PzOQ9VDD+C15Rg==","dev":true,"requires":{"npmlog":"^4.1.2"}},"@lerna/pack-directory":{"version":"3.16.4","resolved":"https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-3.16.4.tgz","integrity":"sha512-uxSF0HZeGyKaaVHz5FroDY9A5NDDiCibrbYR6+khmrhZtY0Bgn6hWq8Gswl9iIlymA+VzCbshWIMX4o2O8C8ng==","dev":true,"requires":{"@lerna/get-packed":"3.16.0","@lerna/package":"3.16.0","@lerna/run-lifecycle":"3.16.2","figgy-pudding":"^3.5.1","npm-packlist":"^1.4.4","npmlog":"^4.1.2","tar":"^4.4.10","temp-write":"^3.4.0"}},"@lerna/package":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/package/-/package-3.16.0.tgz","integrity":"sha512-2lHBWpaxcBoiNVbtyLtPUuTYEaB/Z+eEqRS9duxpZs6D+mTTZMNy6/5vpEVSCBmzvdYpyqhqaYjjSLvjjr5Riw==","dev":true,"requires":{"load-json-file":"^5.3.0","npm-package-arg":"^6.1.0","write-pkg":"^3.1.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"@lerna/package-graph":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/package-graph/-/package-graph-3.18.5.tgz","integrity":"sha512-8QDrR9T+dBegjeLr+n9WZTVxUYUhIUjUgZ0gvNxUBN8S1WB9r6H5Yk56/MVaB64tA3oGAN9IIxX6w0WvTfFudA==","dev":true,"requires":{"@lerna/prerelease-id-from-version":"3.16.0","@lerna/validation-error":"3.13.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","semver":"^6.2.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/prerelease-id-from-version":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.16.0.tgz","integrity":"sha512-qZyeUyrE59uOK8rKdGn7jQz+9uOpAaF/3hbslJVFL1NqF9ELDTqjCPXivuejMX/lN4OgD6BugTO4cR7UTq/sZA==","dev":true,"requires":{"semver":"^6.2.0"},"dependencies":{"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"@lerna/profiler":{"version":"3.20.0","resolved":"https://registry.npmjs.org/@lerna/profiler/-/profiler-3.20.0.tgz","integrity":"sha512-bh8hKxAlm6yu8WEOvbLENm42i2v9SsR4WbrCWSbsmOElx3foRnMlYk7NkGECa+U5c3K4C6GeBbwgqs54PP7Ljg==","dev":true,"requires":{"figgy-pudding":"^3.5.1","fs-extra":"^8.1.0","npmlog":"^4.1.2","upath":"^1.2.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/project":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/project/-/project-3.21.0.tgz","integrity":"sha512-xT1mrpET2BF11CY32uypV2GPtPVm6Hgtha7D81GQP9iAitk9EccrdNjYGt5UBYASl4CIDXBRxwmTTVGfrCx82A==","dev":true,"requires":{"@lerna/package":"3.16.0","@lerna/validation-error":"3.13.0","cosmiconfig":"^5.1.0","dedent":"^0.7.0","dot-prop":"^4.2.0","glob-parent":"^5.0.0","globby":"^9.2.0","load-json-file":"^5.3.0","npmlog":"^4.1.2","p-map":"^2.1.0","resolve-from":"^4.0.0","write-json-file":"^3.2.0"}},"@lerna/prompt":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/prompt/-/prompt-3.18.5.tgz","integrity":"sha512-rkKj4nm1twSbBEb69+Em/2jAERK8htUuV8/xSjN0NPC+6UjzAwY52/x9n5cfmpa9lyKf/uItp7chCI7eDmNTKQ==","dev":true,"requires":{"inquirer":"^6.2.0","npmlog":"^4.1.2"}},"@lerna/publish":{"version":"3.22.1","resolved":"https://registry.npmjs.org/@lerna/publish/-/publish-3.22.1.tgz","integrity":"sha512-PG9CM9HUYDreb1FbJwFg90TCBQooGjj+n/pb3gw/eH5mEDq0p8wKdLFe0qkiqUkm/Ub5C8DbVFertIo0Vd0zcw==","dev":true,"requires":{"@evocateur/libnpmaccess":"^3.1.2","@evocateur/npm-registry-fetch":"^4.0.0","@evocateur/pacote":"^9.6.3","@lerna/check-working-tree":"3.16.5","@lerna/child-process":"3.16.5","@lerna/collect-updates":"3.20.0","@lerna/command":"3.21.0","@lerna/describe-ref":"3.16.5","@lerna/log-packed":"3.16.0","@lerna/npm-conf":"3.16.0","@lerna/npm-dist-tag":"3.18.5","@lerna/npm-publish":"3.18.5","@lerna/otplease":"3.18.5","@lerna/output":"3.13.0","@lerna/pack-directory":"3.16.4","@lerna/prerelease-id-from-version":"3.16.0","@lerna/prompt":"3.18.5","@lerna/pulse-till-done":"3.13.0","@lerna/run-lifecycle":"3.16.2","@lerna/run-topologically":"3.18.5","@lerna/validation-error":"3.13.0","@lerna/version":"3.22.1","figgy-pudding":"^3.5.1","fs-extra":"^8.1.0","npm-package-arg":"^6.1.0","npmlog":"^4.1.2","p-finally":"^1.0.0","p-map":"^2.1.0","p-pipe":"^1.2.0","semver":"^6.2.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/pulse-till-done":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-3.13.0.tgz","integrity":"sha512-1SOHpy7ZNTPulzIbargrgaJX387csN7cF1cLOGZiJQA6VqnS5eWs2CIrG8i8wmaUavj2QlQ5oEbRMVVXSsGrzA==","dev":true,"requires":{"npmlog":"^4.1.2"}},"@lerna/query-graph":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/query-graph/-/query-graph-3.18.5.tgz","integrity":"sha512-50Lf4uuMpMWvJ306be3oQDHrWV42nai9gbIVByPBYJuVW8dT8O8pA3EzitNYBUdLL9/qEVbrR0ry1HD7EXwtRA==","dev":true,"requires":{"@lerna/package-graph":"3.18.5","figgy-pudding":"^3.5.1"}},"@lerna/resolve-symlink":{"version":"3.16.0","resolved":"https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-3.16.0.tgz","integrity":"sha512-Ibj5e7njVHNJ/NOqT4HlEgPFPtPLWsO7iu59AM5bJDcAJcR96mLZ7KGVIsS2tvaO7akMEJvt2P+ErwCdloG3jQ==","dev":true,"requires":{"fs-extra":"^8.1.0","npmlog":"^4.1.2","read-cmd-shim":"^1.0.1"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/rimraf-dir":{"version":"3.16.5","resolved":"https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-3.16.5.tgz","integrity":"sha512-bQlKmO0pXUsXoF8lOLknhyQjOZsCc0bosQDoX4lujBXSWxHVTg1VxURtWf2lUjz/ACsJVDfvHZbDm8kyBk5okA==","dev":true,"requires":{"@lerna/child-process":"3.16.5","npmlog":"^4.1.2","path-exists":"^3.0.0","rimraf":"^2.6.2"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}}}},"@lerna/run":{"version":"3.21.0","resolved":"https://registry.npmjs.org/@lerna/run/-/run-3.21.0.tgz","integrity":"sha512-fJF68rT3veh+hkToFsBmUJ9MHc9yGXA7LSDvhziAojzOb0AI/jBDp6cEcDQyJ7dbnplba2Lj02IH61QUf9oW0Q==","dev":true,"requires":{"@lerna/command":"3.21.0","@lerna/filter-options":"3.20.0","@lerna/npm-run-script":"3.16.5","@lerna/output":"3.13.0","@lerna/profiler":"3.20.0","@lerna/run-topologically":"3.18.5","@lerna/timer":"3.13.0","@lerna/validation-error":"3.13.0","p-map":"^2.1.0"}},"@lerna/run-lifecycle":{"version":"3.16.2","resolved":"https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-3.16.2.tgz","integrity":"sha512-RqFoznE8rDpyyF0rOJy3+KjZCeTkO8y/OB9orPauR7G2xQ7PTdCpgo7EO6ZNdz3Al+k1BydClZz/j78gNCmL2A==","dev":true,"requires":{"@lerna/npm-conf":"3.16.0","figgy-pudding":"^3.5.1","npm-lifecycle":"^3.1.2","npmlog":"^4.1.2"}},"@lerna/run-topologically":{"version":"3.18.5","resolved":"https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-3.18.5.tgz","integrity":"sha512-6N1I+6wf4hLOnPW+XDZqwufyIQ6gqoPfHZFkfWlvTQ+Ue7CuF8qIVQ1Eddw5HKQMkxqN10thKOFfq/9NQZ4NUg==","dev":true,"requires":{"@lerna/query-graph":"3.18.5","figgy-pudding":"^3.5.1","p-queue":"^4.0.0"}},"@lerna/symlink-binary":{"version":"3.17.0","resolved":"https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-3.17.0.tgz","integrity":"sha512-RLpy9UY6+3nT5J+5jkM5MZyMmjNHxZIZvXLV+Q3MXrf7Eaa1hNqyynyj4RO95fxbS+EZc4XVSk25DGFQbcRNSQ==","dev":true,"requires":{"@lerna/create-symlink":"3.16.2","@lerna/package":"3.16.0","fs-extra":"^8.1.0","p-map":"^2.1.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/symlink-dependencies":{"version":"3.17.0","resolved":"https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-3.17.0.tgz","integrity":"sha512-KmjU5YT1bpt6coOmdFueTJ7DFJL4H1w5eF8yAQ2zsGNTtZ+i5SGFBWpb9AQaw168dydc3s4eu0W0Sirda+F59Q==","dev":true,"requires":{"@lerna/create-symlink":"3.16.2","@lerna/resolve-symlink":"3.16.0","@lerna/symlink-binary":"3.17.0","fs-extra":"^8.1.0","p-finally":"^1.0.0","p-map":"^2.1.0","p-map-series":"^1.0.0"},"dependencies":{"fs-extra":{"version":"8.1.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz","integrity":"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==","dev":true,"requires":{"graceful-fs":"^4.2.0","jsonfile":"^4.0.0","universalify":"^0.1.0"}},"jsonfile":{"version":"4.0.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz","integrity":"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"universalify":{"version":"0.1.2","resolved":"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz","integrity":"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==","dev":true}}},"@lerna/timer":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/timer/-/timer-3.13.0.tgz","integrity":"sha512-RHWrDl8U4XNPqY5MQHkToWS9jHPnkLZEt5VD+uunCKTfzlxGnRCr3/zVr8VGy/uENMYpVP3wJa4RKGY6M0vkRw==","dev":true},"@lerna/validation-error":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/validation-error/-/validation-error-3.13.0.tgz","integrity":"sha512-SiJP75nwB8GhgwLKQfdkSnDufAaCbkZWJqEDlKOUPUvVOplRGnfL+BPQZH5nvq2BYSRXsksXWZ4UHVnQZI/HYA==","dev":true,"requires":{"npmlog":"^4.1.2"}},"@lerna/version":{"version":"3.22.1","resolved":"https://registry.npmjs.org/@lerna/version/-/version-3.22.1.tgz","integrity":"sha512-PSGt/K1hVqreAFoi3zjD0VEDupQ2WZVlVIwesrE5GbrL2BjXowjCsTDPqblahDUPy0hp6h7E2kG855yLTp62+g==","dev":true,"requires":{"@lerna/check-working-tree":"3.16.5","@lerna/child-process":"3.16.5","@lerna/collect-updates":"3.20.0","@lerna/command":"3.21.0","@lerna/conventional-commits":"3.22.0","@lerna/github-client":"3.22.0","@lerna/gitlab-client":"3.15.0","@lerna/output":"3.13.0","@lerna/prerelease-id-from-version":"3.16.0","@lerna/prompt":"3.18.5","@lerna/run-lifecycle":"3.16.2","@lerna/run-topologically":"3.18.5","@lerna/validation-error":"3.13.0","chalk":"^2.3.1","dedent":"^0.7.0","load-json-file":"^5.3.0","minimatch":"^3.0.4","npmlog":"^4.1.2","p-map":"^2.1.0","p-pipe":"^1.2.0","p-reduce":"^1.0.0","p-waterfall":"^1.0.0","semver":"^6.2.0","slash":"^2.0.0","temp-write":"^3.4.0","write-json-file":"^3.2.0"},"dependencies":{"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"@lerna/write-log-file":{"version":"3.13.0","resolved":"https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-3.13.0.tgz","integrity":"sha512-RibeMnDPvlL8bFYW5C8cs4mbI3AHfQef73tnJCQ/SgrXZHehmHnsyWUiE7qDQCAo+B1RfTapvSyFF69iPj326A==","dev":true,"requires":{"npmlog":"^4.1.2","write-file-atomic":"^2.3.0"}},"@mrmlnc/readdir-enhanced":{"version":"2.2.1","resolved":"https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz","integrity":"sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==","dev":true,"requires":{"call-me-maybe":"^1.0.1","glob-to-regexp":"^0.3.0"}},"@nodelib/fs.scandir":{"version":"2.1.3","resolved":"https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz","integrity":"sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==","dev":true,"requires":{"@nodelib/fs.stat":"2.0.3","run-parallel":"^1.1.9"},"dependencies":{"@nodelib/fs.stat":{"version":"2.0.3","resolved":"https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz","integrity":"sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==","dev":true}}},"@nodelib/fs.stat":{"version":"1.1.3","resolved":"https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz","integrity":"sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==","dev":true},"@nodelib/fs.walk":{"version":"1.2.4","resolved":"https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz","integrity":"sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==","dev":true,"requires":{"@nodelib/fs.scandir":"2.1.3","fastq":"^1.6.0"}},"@octokit/auth-token":{"version":"2.4.2","resolved":"https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz","integrity":"sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==","dev":true,"requires":{"@octokit/types":"^5.0.0"}},"@octokit/endpoint":{"version":"6.0.6","resolved":"https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.6.tgz","integrity":"sha512-7Cc8olaCoL/mtquB7j/HTbPM+sY6Ebr4k2X2y4JoXpVKQ7r5xB4iGQE0IoO58wIPsUk4AzoT65AMEpymSbWTgQ==","dev":true,"requires":{"@octokit/types":"^5.0.0","is-plain-object":"^5.0.0","universal-user-agent":"^6.0.0"},"dependencies":{"is-plain-object":{"version":"5.0.0","resolved":"https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz","integrity":"sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==","dev":true},"universal-user-agent":{"version":"6.0.0","resolved":"https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz","integrity":"sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==","dev":true}}},"@octokit/plugin-enterprise-rest":{"version":"6.0.1","resolved":"https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz","integrity":"sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw==","dev":true},"@octokit/plugin-paginate-rest":{"version":"1.1.2","resolved":"https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz","integrity":"sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==","dev":true,"requires":{"@octokit/types":"^2.0.1"},"dependencies":{"@octokit/types":{"version":"2.16.2","resolved":"https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz","integrity":"sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==","dev":true,"requires":{"@types/node":">= 8"}}}},"@octokit/plugin-request-log":{"version":"1.0.0","resolved":"https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz","integrity":"sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw==","dev":true},"@octokit/plugin-rest-endpoint-methods":{"version":"2.4.0","resolved":"https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz","integrity":"sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==","dev":true,"requires":{"@octokit/types":"^2.0.1","deprecation":"^2.3.1"},"dependencies":{"@octokit/types":{"version":"2.16.2","resolved":"https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz","integrity":"sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==","dev":true,"requires":{"@types/node":">= 8"}}}},"@octokit/request":{"version":"5.4.9","resolved":"https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz","integrity":"sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==","dev":true,"requires":{"@octokit/endpoint":"^6.0.1","@octokit/request-error":"^2.0.0","@octokit/types":"^5.0.0","deprecation":"^2.0.0","is-plain-object":"^5.0.0","node-fetch":"^2.6.1","once":"^1.4.0","universal-user-agent":"^6.0.0"},"dependencies":{"@octokit/request-error":{"version":"2.0.2","resolved":"https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz","integrity":"sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==","dev":true,"requires":{"@octokit/types":"^5.0.1","deprecation":"^2.0.0","once":"^1.4.0"}},"is-plain-object":{"version":"5.0.0","resolved":"https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz","integrity":"sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==","dev":true},"universal-user-agent":{"version":"6.0.0","resolved":"https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz","integrity":"sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==","dev":true}}},"@octokit/request-error":{"version":"1.2.1","resolved":"https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz","integrity":"sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==","dev":true,"requires":{"@octokit/types":"^2.0.0","deprecation":"^2.0.0","once":"^1.4.0"},"dependencies":{"@octokit/types":{"version":"2.16.2","resolved":"https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz","integrity":"sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==","dev":true,"requires":{"@types/node":">= 8"}}}},"@octokit/rest":{"version":"16.43.2","resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz","integrity":"sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ==","dev":true,"requires":{"@octokit/auth-token":"^2.4.0","@octokit/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"}},"@octokit/types":{"version":"5.5.0","resolved":"https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz","integrity":"sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==","dev":true,"requires":{"@types/node":">= 8"}},"@ts-morph/common":{"version":"0.5.2","resolved":"https://registry.npmjs.org/@ts-morph/common/-/common-0.5.2.tgz","integrity":"sha512-eLmfYV6u6gUgHrB9QV9lpuWg3cD60mhXdv0jvM5exWR/Cor8HG+GziFIj2hPEWHJknqzuU4meZd8DTqIzZfDRQ==","dev":true,"requires":{"@dsherret/to-absolute-glob":"^2.0.2","fast-glob":"^3.2.2","fs-extra":"^9.0.0","is-negated-glob":"^1.0.0","multimatch":"^4.0.0","typescript":"~3.9.7"},"dependencies":{"@nodelib/fs.stat":{"version":"2.0.3","resolved":"https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz","integrity":"sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==","dev":true},"array-differ":{"version":"3.0.0","resolved":"https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz","integrity":"sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==","dev":true},"array-union":{"version":"2.1.0","resolved":"https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz","integrity":"sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==","dev":true},"arrify":{"version":"2.0.1","resolved":"https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz","integrity":"sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==","dev":true},"braces":{"version":"3.0.2","resolved":"https://registry.npmjs.org/braces/-/braces-3.0.2.tgz","integrity":"sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==","dev":true,"requires":{"fill-range":"^7.0.1"}},"fast-glob":{"version":"3.2.4","resolved":"https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz","integrity":"sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==","dev":true,"requires":{"@nodelib/fs.stat":"^2.0.2","@nodelib/fs.walk":"^1.2.3","glob-parent":"^5.1.0","merge2":"^1.3.0","micromatch":"^4.0.2","picomatch":"^2.2.1"}},"fill-range":{"version":"7.0.1","resolved":"https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz","integrity":"sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==","dev":true,"requires":{"to-regex-range":"^5.0.1"}},"is-number":{"version":"7.0.0","resolved":"https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz","integrity":"sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==","dev":true},"micromatch":{"version":"4.0.2","resolved":"https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz","integrity":"sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==","dev":true,"requires":{"braces":"^3.0.1","picomatch":"^2.0.5"}},"multimatch":{"version":"4.0.0","resolved":"https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz","integrity":"sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==","dev":true,"requires":{"@types/minimatch":"^3.0.3","array-differ":"^3.0.0","array-union":"^2.1.0","arrify":"^2.0.1","minimatch":"^3.0.4"}},"to-regex-range":{"version":"5.0.1","resolved":"https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz","integrity":"sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==","dev":true,"requires":{"is-number":"^7.0.0"}},"typescript":{"version":"3.9.7","resolved":"https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz","integrity":"sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==","dev":true}}},"@types/bn.js":{"version":"4.11.6","resolved":"https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz","integrity":"sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==","requires":{"@types/node":"*"},"dependencies":{"@types/node":{"version":"14.11.2","resolved":"https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz","integrity":"sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA=="}}},"@types/cookiejar":{"version":"2.1.2","resolved":"https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz","integrity":"sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==","dev":true},"@types/events":{"version":"3.0.0","resolved":"https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz","integrity":"sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==","dev":true},"@types/fs-extra":{"version":"9.0.2","resolved":"https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.2.tgz","integrity":"sha512-jp0RI6xfZpi5JL8v7WQwpBEQTq63RqW2kxwTZt+m27LcJqQdPVU1yGnT1ZI4EtCDynQQJtIGyQahkiCGCS7e+A==","dev":true,"requires":{"@types/node":"*"}},"@types/glob":{"version":"7.1.3","resolved":"https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz","integrity":"sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==","dev":true,"requires":{"@types/minimatch":"*","@types/node":"*"}},"@types/lodash":{"version":"4.14.161","resolved":"https://registry.npmjs.org/@types/lodash/-/lodash-4.14.161.tgz","integrity":"sha512-EP6O3Jkr7bXvZZSZYlsgt5DIjiGr0dXP1/jVEwVLTFgg0d+3lWVQkRavYVQszV7dYUwvg0B8R0MBDpcmXg7XIA==","dev":true},"@types/lodash.clonedeep":{"version":"4.5.6","resolved":"https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz","integrity":"sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==","dev":true,"requires":{"@types/lodash":"*"}},"@types/minimatch":{"version":"3.0.3","resolved":"https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz","integrity":"sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==","dev":true},"@types/minimist":{"version":"1.2.0","resolved":"https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz","integrity":"sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=","dev":true},"@types/mocha":{"version":"8.0.3","resolved":"https://registry.npmjs.org/@types/mocha/-/mocha-8.0.3.tgz","integrity":"sha512-vyxR57nv8NfcU0GZu8EUXZLTbCMupIUwy95LJ6lllN+JRPG25CwMHoB1q5xKh8YKhQnHYRAn4yW2yuHbf/5xgg==","dev":true},"@types/node":{"version":"14.14.2","resolved":"https://registry.npmjs.org/@types/node/-/node-14.14.2.tgz","integrity":"sha512-jeYJU2kl7hL9U5xuI/BhKPZ4vqGM/OmK6whiFAXVhlstzZhVamWhDSmHyGLIp+RVyuF9/d0dqr2P85aFj4BvJg==","dev":true},"@types/normalize-package-data":{"version":"2.4.0","resolved":"https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz","integrity":"sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==","dev":true},"@types/npm-package-arg":{"version":"6.1.0","resolved":"https://registry.npmjs.org/@types/npm-package-arg/-/npm-package-arg-6.1.0.tgz","integrity":"sha512-vbt5fb0y1svMhu++1lwtKmZL76d0uPChFlw7kEzyUmTwfmpHRcFb8i0R8ElT69q/L+QLgK2hgECivIAvaEDwag==","dev":true},"@types/parse-json":{"version":"4.0.0","resolved":"https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz","integrity":"sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==","dev":true},"@types/pbkdf2":{"version":"3.1.0","resolved":"https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz","integrity":"sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==","requires":{"@types/node":"*"},"dependencies":{"@types/node":{"version":"14.11.2","resolved":"https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz","integrity":"sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA=="}}},"@types/prettier":{"version":"2.1.5","resolved":"https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz","integrity":"sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==","dev":true},"@types/secp256k1":{"version":"4.0.1","resolved":"https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz","integrity":"sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==","requires":{"@types/node":"*"},"dependencies":{"@types/node":{"version":"14.11.2","resolved":"https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz","integrity":"sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA=="}}},"@types/seedrandom":{"version":"2.4.28","resolved":"https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz","integrity":"sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==","dev":true},"@types/superagent":{"version":"4.1.10","resolved":"https://registry.npmjs.org/@types/superagent/-/superagent-4.1.10.tgz","integrity":"sha512-xAgkb2CMWUMCyVc/3+7iQfOEBE75NvuZeezvmixbUw3nmENf2tCnQkW5yQLTYqvXUQ+R6EXxdqKKbal2zM5V/g==","dev":true,"requires":{"@types/cookiejar":"*","@types/node":"*"}},"@types/uws":{"version":"0.13.2","resolved":"https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz","integrity":"sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==","dev":true,"requires":{"@types/events":"*","@types/node":"*"}},"@types/ws":{"version":"7.2.7","resolved":"https://registry.npmjs.org/@types/ws/-/ws-7.2.7.tgz","integrity":"sha512-UUFC/xxqFLP17hTva8/lVT0SybLUrfSD9c+iapKb0fEiC8uoDbA+xuZ3pAN603eW+bY8ebSMLm9jXdIPnD0ZgA==","dev":true,"requires":{"@types/node":"*"}},"@types/yargs":{"version":"15.0.9","resolved":"https://registry.npmjs.org/@types/yargs/-/yargs-15.0.9.tgz","integrity":"sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g==","dev":true,"requires":{"@types/yargs-parser":"*"}},"@types/yargs-parser":{"version":"15.0.0","resolved":"https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz","integrity":"sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==","dev":true},"@ungap/promise-all-settled":{"version":"1.1.2","resolved":"https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz","integrity":"sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==","dev":true},"@zkochan/cmd-shim":{"version":"3.1.0","resolved":"https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz","integrity":"sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg==","dev":true,"requires":{"is-windows":"^1.0.0","mkdirp-promise":"^5.0.1","mz":"^2.5.0"}},"JSONStream":{"version":"1.3.5","resolved":"https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz","integrity":"sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==","dev":true,"requires":{"jsonparse":"^1.2.0","through":">=2.2.7 <3"}},"abbrev":{"version":"1.1.1","resolved":"https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz","integrity":"sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==","dev":true},"abstract-leveldown":{"version":"2.6.3","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz","integrity":"sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==","requires":{"xtend":"~4.0.0"},"dependencies":{"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"agent-base":{"version":"4.3.0","resolved":"https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz","integrity":"sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==","dev":true,"requires":{"es6-promisify":"^5.0.0"}},"agentkeepalive":{"version":"3.5.2","resolved":"https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz","integrity":"sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==","dev":true,"requires":{"humanize-ms":"^1.2.1"}},"aggregate-error":{"version":"3.1.0","resolved":"https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz","integrity":"sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==","dev":true,"requires":{"clean-stack":"^2.0.0","indent-string":"^4.0.0"}},"ajv":{"version":"6.12.5","resolved":"https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz","integrity":"sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==","dev":true,"requires":{"fast-deep-equal":"^3.1.1","fast-json-stable-stringify":"^2.0.0","json-schema-traverse":"^0.4.1","uri-js":"^4.2.2"}},"ansi-colors":{"version":"4.1.1","resolved":"https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz","integrity":"sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==","dev":true},"ansi-escapes":{"version":"3.2.0","resolved":"https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz","integrity":"sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==","dev":true},"ansi-regex":{"version":"2.1.1","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz","integrity":"sha1-w7M6te42DYbg5ijwRorn7yfWVN8=","dev":true},"ansi-styles":{"version":"3.2.1","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz","integrity":"sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==","dev":true,"requires":{"color-convert":"^1.9.0"}},"any-promise":{"version":"1.3.0","resolved":"https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz","integrity":"sha1-q8av7tzqUugJzcA3au0845Y10X8=","dev":true},"anymatch":{"version":"3.1.1","resolved":"https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz","integrity":"sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==","dev":true,"requires":{"normalize-path":"^3.0.0","picomatch":"^2.0.4"}},"append-transform":{"version":"2.0.0","resolved":"https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz","integrity":"sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==","dev":true,"requires":{"default-require-extensions":"^3.0.0"}},"aproba":{"version":"1.2.0","resolved":"https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz","integrity":"sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==","dev":true},"archy":{"version":"1.0.0","resolved":"https://registry.npmjs.org/archy/-/archy-1.0.0.tgz","integrity":"sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=","dev":true},"are-we-there-yet":{"version":"1.1.5","resolved":"https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz","integrity":"sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==","dev":true,"requires":{"delegates":"^1.0.0","readable-stream":"^2.0.6"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"arg":{"version":"4.1.3","resolved":"https://registry.npmjs.org/arg/-/arg-4.1.3.tgz","integrity":"sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==","dev":true},"argparse":{"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.2"}},"arr-diff":{"version":"4.0.0","resolved":"https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz","integrity":"sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=","dev":true},"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==","dev":true},"arr-union":{"version":"3.1.0","resolved":"https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz","integrity":"sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=","dev":true},"array-differ":{"version":"2.1.0","resolved":"https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz","integrity":"sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==","dev":true},"array-find-index":{"version":"1.0.2","resolved":"https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz","integrity":"sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=","dev":true},"array-ify":{"version":"1.0.0","resolved":"https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz","integrity":"sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=","dev":true},"array-union":{"version":"1.0.2","resolved":"https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz","integrity":"sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=","dev":true,"requires":{"array-uniq":"^1.0.1"}},"array-uniq":{"version":"1.0.3","resolved":"https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz","integrity":"sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=","dev":true},"array-unique":{"version":"0.3.2","resolved":"https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz","integrity":"sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=","dev":true},"arrify":{"version":"1.0.1","resolved":"https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz","integrity":"sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=","dev":true},"asap":{"version":"2.0.6","resolved":"https://registry.npmjs.org/asap/-/asap-2.0.6.tgz","integrity":"sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=","dev":true},"asn1":{"version":"0.2.4","resolved":"https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz","integrity":"sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==","dev":true,"requires":{"safer-buffer":"~2.1.0"}},"assert-plus":{"version":"1.0.0","resolved":"https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz","integrity":"sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=","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=","dev":true},"async":{"version":"2.6.3","resolved":"https://registry.npmjs.org/async/-/async-2.6.3.tgz","integrity":"sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==","requires":{"lodash":"^4.17.14"}},"async-eventemitter":{"version":"0.2.4","resolved":"https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz","integrity":"sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==","requires":{"async":"^2.4.0"}},"asynckit":{"version":"0.4.0","resolved":"https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz","integrity":"sha1-x57Zf380y48robyXkLzDZkdLS3k=","dev":true},"at-least-node":{"version":"1.0.0","resolved":"https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz","integrity":"sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==","dev":true},"atob":{"version":"2.1.2","resolved":"https://registry.npmjs.org/atob/-/atob-2.1.2.tgz","integrity":"sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==","dev":true},"atob-lite":{"version":"2.0.0","resolved":"https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz","integrity":"sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=","dev":true},"aws-sign2":{"version":"0.7.0","resolved":"https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz","integrity":"sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=","dev":true},"aws4":{"version":"1.10.1","resolved":"https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz","integrity":"sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==","dev":true},"balanced-match":{"version":"1.0.0","resolved":"https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz","integrity":"sha1-ibTRmasr7kneFk6gK4nORi1xt2c="},"base":{"version":"0.11.2","resolved":"https://registry.npmjs.org/base/-/base-0.11.2.tgz","integrity":"sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==","dev":true,"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=","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"requires":{"is-accessor-descriptor":"^1.0.0","is-data-descriptor":"^1.0.0","kind-of":"^6.0.2"}}}},"base-x":{"version":"3.0.8","resolved":"https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz","integrity":"sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==","requires":{"safe-buffer":"^5.0.1"}},"base64-js":{"version":"1.3.1","resolved":"https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz","integrity":"sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g=="},"bcrypt-pbkdf":{"version":"1.0.2","resolved":"https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz","integrity":"sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=","dev":true,"requires":{"tweetnacl":"^0.14.3"}},"before-after-hook":{"version":"2.1.0","resolved":"https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz","integrity":"sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==","dev":true},"bigint-buffer":{"version":"1.1.5","resolved":"https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz","integrity":"sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==","optional":true,"requires":{"bindings":"^1.3.0"}},"binary-extensions":{"version":"2.1.0","resolved":"https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz","integrity":"sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==","dev":true},"bindings":{"version":"1.5.0","resolved":"https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz","integrity":"sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==","optional":true,"requires":{"file-uri-to-path":"1.0.0"}},"bip39":{"version":"3.0.2","resolved":"https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz","integrity":"sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==","requires":{"@types/node":"11.11.6","create-hash":"^1.1.0","pbkdf2":"^3.0.9","randombytes":"^2.0.1"},"dependencies":{"@types/node":{"version":"11.11.6","resolved":"https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz","integrity":"sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ=="}}},"blakejs":{"version":"1.1.0","resolved":"https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz","integrity":"sha1-ad+S75U6qIylGjLfarHFShVfx6U="},"bluebird":{"version":"3.7.2","resolved":"https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz","integrity":"sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==","dev":true},"bn.js":{"version":"4.11.9","resolved":"https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz","integrity":"sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw=="},"brace-expansion":{"version":"1.1.11","resolved":"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz","integrity":"sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==","requires":{"balanced-match":"^1.0.0","concat-map":"0.0.1"}},"braces":{"version":"2.3.2","resolved":"https://registry.npmjs.org/braces/-/braces-2.3.2.tgz","integrity":"sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==","dev":true,"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"brorand":{"version":"1.1.0","resolved":"https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz","integrity":"sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8="},"browser-stdout":{"version":"1.3.1","resolved":"https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz","integrity":"sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==","dev":true},"browserify-aes":{"version":"1.2.0","resolved":"https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz","integrity":"sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==","requires":{"buffer-xor":"^1.0.3","cipher-base":"^1.0.0","create-hash":"^1.1.0","evp_bytestokey":"^1.0.3","inherits":"^2.0.1","safe-buffer":"^5.0.1"}},"bs58":{"version":"4.0.1","resolved":"https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz","integrity":"sha1-vhYedsNU9veIrkBx9j806MTwpCo=","requires":{"base-x":"^3.0.2"}},"bs58check":{"version":"2.1.2","resolved":"https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz","integrity":"sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==","requires":{"bs58":"^4.0.0","create-hash":"^1.1.0","safe-buffer":"^5.1.2"}},"btoa-lite":{"version":"1.0.0","resolved":"https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz","integrity":"sha1-M3dm2hWAEhD92VbCLpxokaudAzc=","dev":true},"buffer":{"version":"5.6.0","resolved":"https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz","integrity":"sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==","requires":{"base64-js":"^1.0.2","ieee754":"^1.1.4"}},"buffer-from":{"version":"1.1.1","resolved":"https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz","integrity":"sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==","dev":true},"buffer-xor":{"version":"1.0.3","resolved":"https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz","integrity":"sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk="},"builtins":{"version":"1.0.3","resolved":"https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz","integrity":"sha1-y5T662HIaWRR2zZTThQi+U8K7og=","dev":true},"byline":{"version":"5.0.0","resolved":"https://registry.npmjs.org/byline/-/byline-5.0.0.tgz","integrity":"sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=","dev":true},"byte-size":{"version":"5.0.1","resolved":"https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz","integrity":"sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw==","dev":true},"cacache":{"version":"12.0.4","resolved":"https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz","integrity":"sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==","dev":true,"requires":{"bluebird":"^3.5.5","chownr":"^1.1.1","figgy-pudding":"^3.5.1","glob":"^7.1.4","graceful-fs":"^4.1.15","infer-owner":"^1.0.3","lru-cache":"^5.1.1","mississippi":"^3.0.0","mkdirp":"^0.5.1","move-concurrently":"^1.0.1","promise-inflight":"^1.0.1","rimraf":"^2.6.3","ssri":"^6.0.1","unique-filename":"^1.1.1","y18n":"^4.0.0"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}}}},"cache-base":{"version":"1.0.1","resolved":"https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz","integrity":"sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==","dev":true,"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"}},"caching-transform":{"version":"4.0.0","resolved":"https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz","integrity":"sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==","dev":true,"requires":{"hasha":"^5.0.0","make-dir":"^3.0.0","package-hash":"^4.0.0","write-file-atomic":"^3.0.0"},"dependencies":{"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"write-file-atomic":{"version":"3.0.3","resolved":"https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz","integrity":"sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==","dev":true,"requires":{"imurmurhash":"^0.1.4","is-typedarray":"^1.0.0","signal-exit":"^3.0.2","typedarray-to-buffer":"^3.1.5"}}}},"call-me-maybe":{"version":"1.0.1","resolved":"https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz","integrity":"sha1-JtII6onje1y95gJQoV8DHBak1ms=","dev":true},"caller-callsite":{"version":"2.0.0","resolved":"https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz","integrity":"sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=","dev":true,"requires":{"callsites":"^2.0.0"}},"caller-path":{"version":"2.0.0","resolved":"https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz","integrity":"sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=","dev":true,"requires":{"caller-callsite":"^2.0.0"}},"callsites":{"version":"2.0.0","resolved":"https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz","integrity":"sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=","dev":true},"camelcase":{"version":"6.1.0","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz","integrity":"sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==","dev":true},"camelcase-keys":{"version":"6.2.2","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz","integrity":"sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==","dev":true,"requires":{"camelcase":"^5.3.1","map-obj":"^4.0.0","quick-lru":"^4.0.1"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true}}},"caseless":{"version":"0.12.0","resolved":"https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz","integrity":"sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=","dev":true},"chalk":{"version":"4.1.0","resolved":"https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz","integrity":"sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==","dev":true,"requires":{"ansi-styles":"^4.1.0","supports-color":"^7.1.0"},"dependencies":{"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true}}},"chardet":{"version":"0.7.0","resolved":"https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz","integrity":"sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==","dev":true},"checkpoint-store":{"version":"1.1.0","resolved":"https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz","integrity":"sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=","requires":{"functional-red-black-tree":"^1.0.1"}},"chokidar":{"version":"3.4.3","resolved":"https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz","integrity":"sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==","dev":true,"requires":{"anymatch":"~3.1.1","braces":"~3.0.2","fsevents":"~2.1.2","glob-parent":"~5.1.0","is-binary-path":"~2.1.0","is-glob":"~4.0.1","normalize-path":"~3.0.0","readdirp":"~3.5.0"},"dependencies":{"braces":{"version":"3.0.2","resolved":"https://registry.npmjs.org/braces/-/braces-3.0.2.tgz","integrity":"sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==","dev":true,"requires":{"fill-range":"^7.0.1"}},"fill-range":{"version":"7.0.1","resolved":"https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz","integrity":"sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==","dev":true,"requires":{"to-regex-range":"^5.0.1"}},"is-number":{"version":"7.0.0","resolved":"https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz","integrity":"sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==","dev":true},"to-regex-range":{"version":"5.0.1","resolved":"https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz","integrity":"sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==","dev":true,"requires":{"is-number":"^7.0.0"}}}},"chownr":{"version":"1.1.4","resolved":"https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz","integrity":"sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==","dev":true},"ci-info":{"version":"2.0.0","resolved":"https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz","integrity":"sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==","dev":true},"cipher-base":{"version":"1.0.4","resolved":"https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz","integrity":"sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==","requires":{"inherits":"^2.0.1","safe-buffer":"^5.0.1"}},"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==","dev":true,"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=","dev":true,"requires":{"is-descriptor":"^0.1.0"}}}},"clean-stack":{"version":"2.2.0","resolved":"https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz","integrity":"sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==","dev":true},"cli-cursor":{"version":"2.1.0","resolved":"https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz","integrity":"sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=","dev":true,"requires":{"restore-cursor":"^2.0.0"}},"cli-highlight":{"version":"2.1.4","resolved":"https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.4.tgz","integrity":"sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ==","dev":true,"requires":{"chalk":"^3.0.0","highlight.js":"^9.6.0","mz":"^2.4.0","parse5":"^5.1.1","parse5-htmlparser2-tree-adapter":"^5.1.1","yargs":"^15.0.0"},"dependencies":{"ansi-regex":{"version":"5.0.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz","integrity":"sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==","dev":true},"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"chalk":{"version":"3.0.0","resolved":"https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz","integrity":"sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==","dev":true,"requires":{"ansi-styles":"^4.1.0","supports-color":"^7.1.0"}},"cliui":{"version":"6.0.0","resolved":"https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz","integrity":"sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==","dev":true,"requires":{"string-width":"^4.2.0","strip-ansi":"^6.0.0","wrap-ansi":"^6.2.0"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true},"emoji-regex":{"version":"8.0.0","resolved":"https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz","integrity":"sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==","dev":true},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"is-fullwidth-code-point":{"version":"3.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz","integrity":"sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==","dev":true},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"string-width":{"version":"4.2.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz","integrity":"sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==","dev":true,"requires":{"emoji-regex":"^8.0.0","is-fullwidth-code-point":"^3.0.0","strip-ansi":"^6.0.0"}},"strip-ansi":{"version":"6.0.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz","integrity":"sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==","dev":true,"requires":{"ansi-regex":"^5.0.0"}},"wrap-ansi":{"version":"6.2.0","resolved":"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz","integrity":"sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==","dev":true,"requires":{"ansi-styles":"^4.0.0","string-width":"^4.1.0","strip-ansi":"^6.0.0"}},"yargs":{"version":"15.4.1","resolved":"https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz","integrity":"sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==","dev":true,"requires":{"cliui":"^6.0.0","decamelize":"^1.2.0","find-up":"^4.1.0","get-caller-file":"^2.0.1","require-directory":"^2.1.1","require-main-filename":"^2.0.0","set-blocking":"^2.0.0","string-width":"^4.2.0","which-module":"^2.0.0","y18n":"^4.0.0","yargs-parser":"^18.1.2"}},"yargs-parser":{"version":"18.1.3","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz","integrity":"sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"}}}},"cli-width":{"version":"2.2.1","resolved":"https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz","integrity":"sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==","dev":true},"cliui":{"version":"5.0.0","resolved":"https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz","integrity":"sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==","dev":true,"requires":{"string-width":"^3.1.0","strip-ansi":"^5.2.0","wrap-ansi":"^5.1.0"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"string-width":{"version":"3.1.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz","integrity":"sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==","dev":true,"requires":{"emoji-regex":"^7.0.1","is-fullwidth-code-point":"^2.0.0","strip-ansi":"^5.1.0"}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"}}}},"clone":{"version":"1.0.4","resolved":"https://registry.npmjs.org/clone/-/clone-1.0.4.tgz","integrity":"sha1-2jCcwmPfFZlMaIypAheco8fNfH4=","dev":true},"clone-deep":{"version":"4.0.1","resolved":"https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz","integrity":"sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==","dev":true,"requires":{"is-plain-object":"^2.0.4","kind-of":"^6.0.2","shallow-clone":"^3.0.0"}},"code-block-writer":{"version":"10.1.0","resolved":"https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.0.tgz","integrity":"sha512-RG9hpXtWFeUWhuUav1YuP/vGcyncW+t90yJLk9fNZs1De2OuHTHKAKThVCokt29PYq5RoJ0QSZaIZ+rvPO23hA==","dev":true},"code-point-at":{"version":"1.1.0","resolved":"https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz","integrity":"sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=","dev":true},"collection-visit":{"version":"1.0.0","resolved":"https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz","integrity":"sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=","dev":true,"requires":{"map-visit":"^1.0.0","object-visit":"^1.0.0"}},"color-convert":{"version":"1.9.3","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz","integrity":"sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==","dev":true,"requires":{"color-name":"1.1.3"}},"color-name":{"version":"1.1.3","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz","integrity":"sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=","dev":true},"columnify":{"version":"1.5.4","resolved":"https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz","integrity":"sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=","dev":true,"requires":{"strip-ansi":"^3.0.0","wcwidth":"^1.0.0"}},"combined-stream":{"version":"1.0.8","resolved":"https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz","integrity":"sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==","dev":true,"requires":{"delayed-stream":"~1.0.0"}},"command-exists":{"version":"1.2.9","resolved":"https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz","integrity":"sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==","dev":true},"commander":{"version":"3.0.2","resolved":"https://registry.npmjs.org/commander/-/commander-3.0.2.tgz","integrity":"sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==","dev":true},"commondir":{"version":"1.0.1","resolved":"https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz","integrity":"sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=","dev":true},"compare-func":{"version":"2.0.0","resolved":"https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz","integrity":"sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==","dev":true,"requires":{"array-ify":"^1.0.0","dot-prop":"^5.1.0"},"dependencies":{"dot-prop":{"version":"5.3.0","resolved":"https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz","integrity":"sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==","dev":true,"requires":{"is-obj":"^2.0.0"}},"is-obj":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz","integrity":"sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==","dev":true}}},"compare-versions":{"version":"3.6.0","resolved":"https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz","integrity":"sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==","dev":true},"component-emitter":{"version":"1.3.0","resolved":"https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz","integrity":"sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==","dev":true},"concat-map":{"version":"0.0.1","resolved":"https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz","integrity":"sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="},"concat-stream":{"version":"1.6.2","resolved":"https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz","integrity":"sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==","dev":true,"requires":{"buffer-from":"^1.0.0","inherits":"^2.0.3","readable-stream":"^2.2.2","typedarray":"^0.0.6"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"config-chain":{"version":"1.1.12","resolved":"https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz","integrity":"sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==","dev":true,"requires":{"ini":"^1.3.4","proto-list":"~1.2.1"}},"console-control-strings":{"version":"1.1.0","resolved":"https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz","integrity":"sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=","dev":true},"conventional-changelog-angular":{"version":"5.0.11","resolved":"https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz","integrity":"sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==","dev":true,"requires":{"compare-func":"^2.0.0","q":"^1.5.1"}},"conventional-changelog-core":{"version":"3.2.3","resolved":"https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz","integrity":"sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ==","dev":true,"requires":{"conventional-changelog-writer":"^4.0.6","conventional-commits-parser":"^3.0.3","dateformat":"^3.0.0","get-pkg-repo":"^1.0.0","git-raw-commits":"2.0.0","git-remote-origin-url":"^2.0.0","git-semver-tags":"^2.0.3","lodash":"^4.2.1","normalize-package-data":"^2.3.5","q":"^1.5.1","read-pkg":"^3.0.0","read-pkg-up":"^3.0.0","through2":"^3.0.0"},"dependencies":{"through2":{"version":"3.0.2","resolved":"https://registry.npmjs.org/through2/-/through2-3.0.2.tgz","integrity":"sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==","dev":true,"requires":{"inherits":"^2.0.4","readable-stream":"2 || 3"}}}},"conventional-changelog-preset-loader":{"version":"2.3.4","resolved":"https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz","integrity":"sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==","dev":true},"conventional-changelog-writer":{"version":"4.0.17","resolved":"https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz","integrity":"sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==","dev":true,"requires":{"compare-func":"^2.0.0","conventional-commits-filter":"^2.0.6","dateformat":"^3.0.0","handlebars":"^4.7.6","json-stringify-safe":"^5.0.1","lodash":"^4.17.15","meow":"^7.0.0","semver":"^6.0.0","split":"^1.0.0","through2":"^3.0.0"},"dependencies":{"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"through2":{"version":"3.0.2","resolved":"https://registry.npmjs.org/through2/-/through2-3.0.2.tgz","integrity":"sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==","dev":true,"requires":{"inherits":"^2.0.4","readable-stream":"2 || 3"}}}},"conventional-commits-filter":{"version":"2.0.6","resolved":"https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz","integrity":"sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==","dev":true,"requires":{"lodash.ismatch":"^4.4.0","modify-values":"^1.0.0"}},"conventional-commits-parser":{"version":"3.1.0","resolved":"https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz","integrity":"sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==","dev":true,"requires":{"JSONStream":"^1.0.4","is-text-path":"^1.0.1","lodash":"^4.17.15","meow":"^7.0.0","split2":"^2.0.0","through2":"^3.0.0","trim-off-newlines":"^1.0.0"},"dependencies":{"through2":{"version":"3.0.2","resolved":"https://registry.npmjs.org/through2/-/through2-3.0.2.tgz","integrity":"sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==","dev":true,"requires":{"inherits":"^2.0.4","readable-stream":"2 || 3"}}}},"conventional-recommended-bump":{"version":"5.0.1","resolved":"https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-5.0.1.tgz","integrity":"sha512-RVdt0elRcCxL90IrNP0fYCpq1uGt2MALko0eyeQ+zQuDVWtMGAy9ng6yYn3kax42lCj9+XBxQ8ZN6S9bdKxDhQ==","dev":true,"requires":{"concat-stream":"^2.0.0","conventional-changelog-preset-loader":"^2.1.1","conventional-commits-filter":"^2.0.2","conventional-commits-parser":"^3.0.3","git-raw-commits":"2.0.0","git-semver-tags":"^2.0.3","meow":"^4.0.0","q":"^1.5.1"},"dependencies":{"camelcase":{"version":"4.1.0","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz","integrity":"sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=","dev":true},"camelcase-keys":{"version":"4.2.0","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz","integrity":"sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=","dev":true,"requires":{"camelcase":"^4.1.0","map-obj":"^2.0.0","quick-lru":"^1.0.0"}},"concat-stream":{"version":"2.0.0","resolved":"https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz","integrity":"sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==","dev":true,"requires":{"buffer-from":"^1.0.0","inherits":"^2.0.3","readable-stream":"^3.0.2","typedarray":"^0.0.6"}},"indent-string":{"version":"3.2.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz","integrity":"sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=","dev":true},"map-obj":{"version":"2.0.0","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz","integrity":"sha1-plzSkIepJZi4eRJXpSPgISIqwfk=","dev":true},"meow":{"version":"4.0.1","resolved":"https://registry.npmjs.org/meow/-/meow-4.0.1.tgz","integrity":"sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==","dev":true,"requires":{"camelcase-keys":"^4.0.0","decamelize-keys":"^1.0.0","loud-rejection":"^1.0.0","minimist":"^1.1.3","minimist-options":"^3.0.1","normalize-package-data":"^2.3.4","read-pkg-up":"^3.0.0","redent":"^2.0.0","trim-newlines":"^2.0.0"}},"minimist-options":{"version":"3.0.2","resolved":"https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz","integrity":"sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==","dev":true,"requires":{"arrify":"^1.0.1","is-plain-obj":"^1.1.0"}},"quick-lru":{"version":"1.1.0","resolved":"https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz","integrity":"sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=","dev":true},"redent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-2.0.0.tgz","integrity":"sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=","dev":true,"requires":{"indent-string":"^3.0.0","strip-indent":"^2.0.0"}},"strip-indent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz","integrity":"sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=","dev":true},"trim-newlines":{"version":"2.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz","integrity":"sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=","dev":true}}},"convert-source-map":{"version":"1.7.0","resolved":"https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz","integrity":"sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==","dev":true,"requires":{"safe-buffer":"~5.1.1"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true}}},"cookiejar":{"version":"2.1.2","resolved":"https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz","integrity":"sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==","dev":true},"copy-concurrently":{"version":"1.0.5","resolved":"https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz","integrity":"sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==","dev":true,"requires":{"aproba":"^1.1.1","fs-write-stream-atomic":"^1.0.8","iferr":"^0.1.5","mkdirp":"^0.5.1","rimraf":"^2.5.4","run-queue":"^1.0.0"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}}}},"copy-descriptor":{"version":"0.1.1","resolved":"https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz","integrity":"sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=","dev":true},"core-js-pure":{"version":"3.6.5","resolved":"https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz","integrity":"sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA=="},"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="},"cosmiconfig":{"version":"5.2.1","resolved":"https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz","integrity":"sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==","dev":true,"requires":{"import-fresh":"^2.0.0","is-directory":"^0.3.1","js-yaml":"^3.13.1","parse-json":"^4.0.0"}},"create-hash":{"version":"1.2.0","resolved":"https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz","integrity":"sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==","requires":{"cipher-base":"^1.0.1","inherits":"^2.0.1","md5.js":"^1.3.4","ripemd160":"^2.0.1","sha.js":"^2.4.0"}},"create-hmac":{"version":"1.1.7","resolved":"https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz","integrity":"sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==","requires":{"cipher-base":"^1.0.3","create-hash":"^1.1.0","inherits":"^2.0.1","ripemd160":"^2.0.0","safe-buffer":"^5.0.1","sha.js":"^2.4.8"}},"cross-env":{"version":"7.0.2","resolved":"https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz","integrity":"sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==","dev":true,"requires":{"cross-spawn":"^7.0.1"}},"cross-spawn":{"version":"7.0.3","resolved":"https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz","integrity":"sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==","dev":true,"requires":{"path-key":"^3.1.0","shebang-command":"^2.0.0","which":"^2.0.1"}},"currently-unhandled":{"version":"0.4.1","resolved":"https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz","integrity":"sha1-mI3zP+qxke95mmE2nddsF635V+o=","dev":true,"requires":{"array-find-index":"^1.0.1"}},"cyclist":{"version":"1.0.1","resolved":"https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz","integrity":"sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=","dev":true},"dargs":{"version":"4.1.0","resolved":"https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz","integrity":"sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=","dev":true,"requires":{"number-is-nan":"^1.0.0"}},"dashdash":{"version":"1.14.1","resolved":"https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz","integrity":"sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=","dev":true,"requires":{"assert-plus":"^1.0.0"}},"dateformat":{"version":"3.0.3","resolved":"https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz","integrity":"sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==","dev":true},"debug":{"version":"3.1.0","resolved":"https://registry.npmjs.org/debug/-/debug-3.1.0.tgz","integrity":"sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==","dev":true,"requires":{"ms":"2.0.0"},"dependencies":{"ms":{"version":"2.0.0","resolved":"https://registry.npmjs.org/ms/-/ms-2.0.0.tgz","integrity":"sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=","dev":true}}},"debuglog":{"version":"1.0.1","resolved":"https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz","integrity":"sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=","dev":true},"decamelize":{"version":"1.2.0","resolved":"https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz","integrity":"sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=","dev":true},"decamelize-keys":{"version":"1.1.0","resolved":"https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz","integrity":"sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=","dev":true,"requires":{"decamelize":"^1.1.0","map-obj":"^1.0.0"},"dependencies":{"map-obj":{"version":"1.0.1","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz","integrity":"sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=","dev":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=","dev":true},"dedent":{"version":"0.7.0","resolved":"https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz","integrity":"sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=","dev":true},"default-require-extensions":{"version":"3.0.0","resolved":"https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz","integrity":"sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==","dev":true,"requires":{"strip-bom":"^4.0.0"},"dependencies":{"strip-bom":{"version":"4.0.0","resolved":"https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz","integrity":"sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==","dev":true}}},"defaults":{"version":"1.0.3","resolved":"https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz","integrity":"sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=","dev":true,"requires":{"clone":"^1.0.2"}},"deferred-leveldown":{"version":"1.2.2","resolved":"https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz","integrity":"sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==","requires":{"abstract-leveldown":"~2.6.0"}},"define-properties":{"version":"1.1.3","resolved":"https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz","integrity":"sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==","requires":{"object-keys":"^1.0.12"},"dependencies":{"object-keys":{"version":"1.1.1","resolved":"https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz","integrity":"sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="}}},"define-property":{"version":"2.0.2","resolved":"https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz","integrity":"sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"requires":{"is-accessor-descriptor":"^1.0.0","is-data-descriptor":"^1.0.0","kind-of":"^6.0.2"}}}},"defined":{"version":"0.0.0","resolved":"https://registry.npmjs.org/defined/-/defined-0.0.0.tgz","integrity":"sha1-817qfXBekzuvE7LwOz+D2SFAOz4="},"delayed-stream":{"version":"1.0.0","resolved":"https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz","integrity":"sha1-3zrhmayt+31ECqrgsp4icrJOxhk=","dev":true},"delegates":{"version":"1.0.0","resolved":"https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz","integrity":"sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=","dev":true},"deprecation":{"version":"2.3.1","resolved":"https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz","integrity":"sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==","dev":true},"detect-indent":{"version":"5.0.0","resolved":"https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz","integrity":"sha1-OHHMCmoALow+Wzz38zYmRnXwa50=","dev":true},"dezalgo":{"version":"1.0.3","resolved":"https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz","integrity":"sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=","dev":true,"requires":{"asap":"^2.0.0","wrappy":"1"}},"diff":{"version":"4.0.2","resolved":"https://registry.npmjs.org/diff/-/diff-4.0.2.tgz","integrity":"sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==","dev":true},"dir-glob":{"version":"2.2.2","resolved":"https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz","integrity":"sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==","dev":true,"requires":{"path-type":"^3.0.0"}},"dot-prop":{"version":"4.2.1","resolved":"https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz","integrity":"sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==","dev":true,"requires":{"is-obj":"^1.0.0"}},"duplexer":{"version":"0.1.2","resolved":"https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz","integrity":"sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==","dev":true},"duplexify":{"version":"3.7.1","resolved":"https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz","integrity":"sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==","dev":true,"requires":{"end-of-stream":"^1.0.0","inherits":"^2.0.1","readable-stream":"^2.0.0","stream-shift":"^1.0.0"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"ecc-jsbn":{"version":"0.1.2","resolved":"https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz","integrity":"sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=","dev":true,"requires":{"jsbn":"~0.1.0","safer-buffer":"^2.1.0"}},"elliptic":{"version":"6.5.3","resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz","integrity":"sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==","requires":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}},"emittery":{"version":"0.7.2","resolved":"https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz","integrity":"sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ=="},"emoji-regex":{"version":"7.0.3","resolved":"https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz","integrity":"sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==","dev":true},"encoding":{"version":"0.1.13","resolved":"https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz","integrity":"sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==","dev":true,"requires":{"iconv-lite":"^0.6.2"}},"encoding-down":{"version":"5.0.4","resolved":"https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz","integrity":"sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==","requires":{"abstract-leveldown":"^5.0.0","inherits":"^2.0.3","level-codec":"^9.0.0","level-errors":"^2.0.0","xtend":"^4.0.1"},"dependencies":{"abstract-leveldown":{"version":"5.0.0","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz","integrity":"sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==","requires":{"xtend":"~4.0.0"}},"level-codec":{"version":"9.0.2","resolved":"https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz","integrity":"sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==","requires":{"buffer":"^5.6.0"}},"level-errors":{"version":"2.0.1","resolved":"https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz","integrity":"sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==","requires":{"errno":"~0.1.1"}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"end-of-stream":{"version":"1.4.4","resolved":"https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz","integrity":"sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==","dev":true,"requires":{"once":"^1.4.0"}},"env-paths":{"version":"2.2.0","resolved":"https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz","integrity":"sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==","dev":true},"envinfo":{"version":"7.7.3","resolved":"https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz","integrity":"sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==","dev":true},"err-code":{"version":"1.1.2","resolved":"https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz","integrity":"sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=","dev":true},"errno":{"version":"0.1.7","resolved":"https://registry.npmjs.org/errno/-/errno-0.1.7.tgz","integrity":"sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==","requires":{"prr":"~1.0.1"}},"error-ex":{"version":"1.3.2","resolved":"https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz","integrity":"sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==","dev":true,"requires":{"is-arrayish":"^0.2.1"}},"es-abstract":{"version":"1.17.6","resolved":"https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz","integrity":"sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==","requires":{"es-to-primitive":"^1.2.1","function-bind":"^1.1.1","has":"^1.0.3","has-symbols":"^1.0.1","is-callable":"^1.2.0","is-regex":"^1.1.0","object-inspect":"^1.7.0","object-keys":"^1.1.1","object.assign":"^4.1.0","string.prototype.trimend":"^1.0.1","string.prototype.trimstart":"^1.0.1"},"dependencies":{"object-keys":{"version":"1.1.1","resolved":"https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz","integrity":"sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="}}},"es-to-primitive":{"version":"1.2.1","resolved":"https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz","integrity":"sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==","requires":{"is-callable":"^1.1.4","is-date-object":"^1.0.1","is-symbol":"^1.0.2"}},"es6-error":{"version":"4.1.1","resolved":"https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz","integrity":"sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==","dev":true},"es6-promise":{"version":"4.2.8","resolved":"https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz","integrity":"sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==","dev":true},"es6-promisify":{"version":"5.0.0","resolved":"https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz","integrity":"sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=","dev":true,"requires":{"es6-promise":"^4.0.3"}},"escalade":{"version":"3.1.1","resolved":"https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz","integrity":"sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==","dev":true},"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=","dev":true},"esprima":{"version":"4.0.1","resolved":"https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz","integrity":"sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==","dev":true},"ethashjs":{"version":"0.0.8","resolved":"https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz","integrity":"sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==","requires":{"async":"^2.1.2","buffer-xor":"^2.0.1","ethereumjs-util":"^7.0.2","miller-rabin":"^4.0.0"},"dependencies":{"buffer-xor":{"version":"2.0.2","resolved":"https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz","integrity":"sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==","requires":{"safe-buffer":"^5.1.1"}}}},"ethereum-cryptography":{"version":"0.1.3","resolved":"https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz","integrity":"sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==","requires":{"@types/pbkdf2":"^3.0.0","@types/secp256k1":"^4.0.1","blakejs":"^1.1.0","browserify-aes":"^1.2.0","bs58check":"^2.1.2","create-hash":"^1.2.0","create-hmac":"^1.1.7","hash.js":"^1.1.7","keccak":"^3.0.0","pbkdf2":"^3.0.17","randombytes":"^2.1.0","safe-buffer":"^5.1.2","scrypt-js":"^3.0.0","secp256k1":"^4.0.1","setimmediate":"^1.0.5"}},"ethereumjs-account":{"version":"3.0.0","resolved":"https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz","integrity":"sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==","requires":{"ethereumjs-util":"^6.0.0","rlp":"^2.2.1","safe-buffer":"^5.1.1"},"dependencies":{"ethereumjs-util":{"version":"6.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz","integrity":"sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.3"}}}},"ethereumjs-block":{"version":"2.2.2","resolved":"https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz","integrity":"sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==","requires":{"async":"^2.0.1","ethereumjs-common":"^1.5.0","ethereumjs-tx":"^2.1.1","ethereumjs-util":"^5.0.0","merkle-patricia-tree":"^2.1.2"},"dependencies":{"ethereumjs-util":{"version":"5.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz","integrity":"sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==","requires":{"bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"^0.1.3","rlp":"^2.0.0","safe-buffer":"^5.1.1"}},"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="},"levelup":{"version":"1.3.9","resolved":"https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz","integrity":"sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==","requires":{"deferred-leveldown":"~1.2.1","level-codec":"~7.0.0","level-errors":"~1.0.3","level-iterator-stream":"~1.3.0","prr":"~1.0.1","semver":"~5.4.1","xtend":"~4.0.0"}},"merkle-patricia-tree":{"version":"2.3.2","resolved":"https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz","integrity":"sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==","requires":{"async":"^1.4.2","ethereumjs-util":"^5.0.0","level-ws":"0.0.0","levelup":"^1.2.1","memdown":"^1.0.0","readable-stream":"^2.0.0","rlp":"^2.0.0","semaphore":">=1.0.1"},"dependencies":{"async":{"version":"1.5.2","resolved":"https://registry.npmjs.org/async/-/async-1.5.2.tgz","integrity":"sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="}}},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="}}},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","requires":{"safe-buffer":"~5.1.0"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="}}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"ethereumjs-blockchain":{"version":"4.0.4","resolved":"https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz","integrity":"sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ==","requires":{"async":"^2.6.1","ethashjs":"~0.0.7","ethereumjs-block":"~2.2.2","ethereumjs-common":"^1.5.0","ethereumjs-util":"^6.1.0","flow-stoplight":"^1.0.0","level-mem":"^3.0.1","lru-cache":"^5.1.1","rlp":"^2.2.2","semaphore":"^1.1.0"},"dependencies":{"ethereumjs-util":{"version":"6.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz","integrity":"sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.3"}}}},"ethereumjs-common":{"version":"1.5.1","resolved":"https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz","integrity":"sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ=="},"ethereumjs-tx":{"version":"2.1.2","resolved":"https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz","integrity":"sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==","requires":{"ethereumjs-common":"^1.5.0","ethereumjs-util":"^6.0.0"},"dependencies":{"ethereumjs-util":{"version":"6.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz","integrity":"sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.3"}}}},"ethereumjs-util":{"version":"7.0.7","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz","integrity":"sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^5.1.2","create-hash":"^1.1.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.4"},"dependencies":{"bn.js":{"version":"5.1.3","resolved":"https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz","integrity":"sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ=="}}},"ethereumjs-vm":{"version":"4.2.0","resolved":"https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz","integrity":"sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==","requires":{"async":"^2.1.2","async-eventemitter":"^0.2.2","core-js-pure":"^3.0.1","ethereumjs-account":"^3.0.0","ethereumjs-block":"^2.2.2","ethereumjs-blockchain":"^4.0.3","ethereumjs-common":"^1.5.0","ethereumjs-tx":"^2.1.2","ethereumjs-util":"^6.2.0","fake-merkle-patricia-tree":"^1.0.1","functional-red-black-tree":"^1.0.1","merkle-patricia-tree":"^2.3.2","rustbn.js":"~0.2.0","safe-buffer":"^5.1.1","util.promisify":"^1.0.0"},"dependencies":{"ethereumjs-util":{"version":"6.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz","integrity":"sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==","requires":{"@types/bn.js":"^4.11.3","bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"0.1.6","rlp":"^2.2.3"}},"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="},"levelup":{"version":"1.3.9","resolved":"https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz","integrity":"sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==","requires":{"deferred-leveldown":"~1.2.1","level-codec":"~7.0.0","level-errors":"~1.0.3","level-iterator-stream":"~1.3.0","prr":"~1.0.1","semver":"~5.4.1","xtend":"~4.0.0"}},"merkle-patricia-tree":{"version":"2.3.2","resolved":"https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz","integrity":"sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==","requires":{"async":"^1.4.2","ethereumjs-util":"^5.0.0","level-ws":"0.0.0","levelup":"^1.2.1","memdown":"^1.0.0","readable-stream":"^2.0.0","rlp":"^2.0.0","semaphore":">=1.0.1"},"dependencies":{"async":{"version":"1.5.2","resolved":"https://registry.npmjs.org/async/-/async-1.5.2.tgz","integrity":"sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="},"ethereumjs-util":{"version":"5.2.1","resolved":"https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz","integrity":"sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==","requires":{"bn.js":"^4.11.0","create-hash":"^1.1.2","elliptic":"^6.5.2","ethereum-cryptography":"^0.1.3","ethjs-util":"^0.1.3","rlp":"^2.0.0","safe-buffer":"^5.1.1"}}}},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="}}},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","requires":{"safe-buffer":"~5.1.0"},"dependencies":{"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="}}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"ethjs-util":{"version":"0.1.6","resolved":"https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz","integrity":"sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==","requires":{"is-hex-prefixed":"1.0.0","strip-hex-prefix":"1.0.0"}},"eventemitter3":{"version":"3.1.2","resolved":"https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz","integrity":"sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==","dev":true},"evp_bytestokey":{"version":"1.0.3","resolved":"https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz","integrity":"sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==","requires":{"md5.js":"^1.3.4","safe-buffer":"^5.1.1"}},"execa":{"version":"1.0.0","resolved":"https://registry.npmjs.org/execa/-/execa-1.0.0.tgz","integrity":"sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==","dev":true,"requires":{"cross-spawn":"^6.0.0","get-stream":"^4.0.0","is-stream":"^1.1.0","npm-run-path":"^2.0.0","p-finally":"^1.0.0","signal-exit":"^3.0.0","strip-eof":"^1.0.0"},"dependencies":{"cross-spawn":{"version":"6.0.5","resolved":"https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz","integrity":"sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==","dev":true,"requires":{"nice-try":"^1.0.4","path-key":"^2.0.1","semver":"^5.5.0","shebang-command":"^1.2.0","which":"^1.2.9"}},"path-key":{"version":"2.0.1","resolved":"https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz","integrity":"sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=","dev":true},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"shebang-command":{"version":"1.2.0","resolved":"https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz","integrity":"sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=","dev":true,"requires":{"shebang-regex":"^1.0.0"}},"shebang-regex":{"version":"1.0.0","resolved":"https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz","integrity":"sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=","dev":true},"which":{"version":"1.3.1","resolved":"https://registry.npmjs.org/which/-/which-1.3.1.tgz","integrity":"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==","dev":true,"requires":{"isexe":"^2.0.0"}}}},"expand-brackets":{"version":"2.1.4","resolved":"https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz","integrity":"sha1-t3c14xXOMPa27/D4OwQVGiJEliI=","dev":true,"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":{"debug":{"version":"2.6.9","resolved":"https://registry.npmjs.org/debug/-/debug-2.6.9.tgz","integrity":"sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==","dev":true,"requires":{"ms":"2.0.0"}},"define-property":{"version":"0.2.5","resolved":"https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz","integrity":"sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=","dev":true,"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}},"ms":{"version":"2.0.0","resolved":"https://registry.npmjs.org/ms/-/ms-2.0.0.tgz","integrity":"sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=","dev":true}}},"extend":{"version":"3.0.2","resolved":"https://registry.npmjs.org/extend/-/extend-3.0.2.tgz","integrity":"sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==","dev":true},"extend-shallow":{"version":"3.0.2","resolved":"https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz","integrity":"sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=","dev":true,"requires":{"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==","dev":true,"requires":{"is-plain-object":"^2.0.4"}}}},"external-editor":{"version":"3.1.0","resolved":"https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz","integrity":"sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==","dev":true,"requires":{"chardet":"^0.7.0","iconv-lite":"^0.4.24","tmp":"^0.0.33"},"dependencies":{"iconv-lite":{"version":"0.4.24","resolved":"https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz","integrity":"sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==","dev":true,"requires":{"safer-buffer":">= 2.1.2 < 3"}},"tmp":{"version":"0.0.33","resolved":"https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz","integrity":"sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==","dev":true,"requires":{"os-tmpdir":"~1.0.2"}}}},"extglob":{"version":"2.0.4","resolved":"https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz","integrity":"sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==","dev":true,"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=","dev":true,"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=","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"requires":{"is-accessor-descriptor":"^1.0.0","is-data-descriptor":"^1.0.0","kind-of":"^6.0.2"}}}},"extsprintf":{"version":"1.3.0","resolved":"https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz","integrity":"sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=","dev":true},"fake-merkle-patricia-tree":{"version":"1.0.1","resolved":"https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz","integrity":"sha1-S4w6z7Ugr635hgsfFM2M40As3dM=","requires":{"checkpoint-store":"^1.1.0"}},"fast-deep-equal":{"version":"3.1.3","resolved":"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz","integrity":"sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==","dev":true},"fast-glob":{"version":"2.2.7","resolved":"https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz","integrity":"sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==","dev":true,"requires":{"@mrmlnc/readdir-enhanced":"^2.2.1","@nodelib/fs.stat":"^1.1.2","glob-parent":"^3.1.0","is-glob":"^4.0.0","merge2":"^1.2.3","micromatch":"^3.1.10"},"dependencies":{"glob-parent":{"version":"3.1.0","resolved":"https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz","integrity":"sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=","dev":true,"requires":{"is-glob":"^3.1.0","path-dirname":"^1.0.0"},"dependencies":{"is-glob":{"version":"3.1.0","resolved":"https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz","integrity":"sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=","dev":true,"requires":{"is-extglob":"^2.1.0"}}}}}},"fast-json-stable-stringify":{"version":"2.1.0","resolved":"https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz","integrity":"sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==","dev":true},"fast-safe-stringify":{"version":"2.0.7","resolved":"https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz","integrity":"sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==","dev":true},"fastq":{"version":"1.8.0","resolved":"https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz","integrity":"sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==","dev":true,"requires":{"reusify":"^1.0.4"}},"figgy-pudding":{"version":"3.5.2","resolved":"https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz","integrity":"sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==","dev":true},"figures":{"version":"2.0.0","resolved":"https://registry.npmjs.org/figures/-/figures-2.0.0.tgz","integrity":"sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=","dev":true,"requires":{"escape-string-regexp":"^1.0.5"}},"file-uri-to-path":{"version":"1.0.0","resolved":"https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz","integrity":"sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==","optional":true},"fill-range":{"version":"4.0.0","resolved":"https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz","integrity":"sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=","dev":true,"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"find-cache-dir":{"version":"3.3.1","resolved":"https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz","integrity":"sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==","dev":true,"requires":{"commondir":"^1.0.1","make-dir":"^3.0.2","pkg-dir":"^4.1.0"},"dependencies":{"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"pkg-dir":{"version":"4.2.0","resolved":"https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz","integrity":"sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==","dev":true,"requires":{"find-up":"^4.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"find-up":{"version":"3.0.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz","integrity":"sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==","dev":true,"requires":{"locate-path":"^3.0.0"}},"find-versions":{"version":"3.2.0","resolved":"https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz","integrity":"sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==","dev":true,"requires":{"semver-regex":"^2.0.0"}},"flat":{"version":"5.0.2","resolved":"https://registry.npmjs.org/flat/-/flat-5.0.2.tgz","integrity":"sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==","dev":true},"flow-stoplight":{"version":"1.0.0","resolved":"https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz","integrity":"sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s="},"flush-write-stream":{"version":"1.1.1","resolved":"https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz","integrity":"sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==","dev":true,"requires":{"inherits":"^2.0.3","readable-stream":"^2.3.6"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"follow-redirects":{"version":"1.13.0","resolved":"https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz","integrity":"sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==","dev":true},"for-in":{"version":"1.0.2","resolved":"https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz","integrity":"sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=","dev":true},"foreground-child":{"version":"2.0.0","resolved":"https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz","integrity":"sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==","dev":true,"requires":{"cross-spawn":"^7.0.0","signal-exit":"^3.0.2"}},"forever-agent":{"version":"0.6.1","resolved":"https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz","integrity":"sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=","dev":true},"form-data":{"version":"2.3.3","resolved":"https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz","integrity":"sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==","dev":true,"requires":{"asynckit":"^0.4.0","combined-stream":"^1.0.6","mime-types":"^2.1.12"}},"formidable":{"version":"1.2.2","resolved":"https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz","integrity":"sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==","dev":true},"fragment-cache":{"version":"0.2.1","resolved":"https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz","integrity":"sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=","dev":true,"requires":{"map-cache":"^0.2.2"}},"from2":{"version":"2.3.0","resolved":"https://registry.npmjs.org/from2/-/from2-2.3.0.tgz","integrity":"sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=","dev":true,"requires":{"inherits":"^2.0.1","readable-stream":"^2.0.0"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"fromentries":{"version":"1.2.1","resolved":"https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz","integrity":"sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==","dev":true},"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=","dev":true},"fs-extra":{"version":"9.0.1","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz","integrity":"sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==","dev":true,"requires":{"at-least-node":"^1.0.0","graceful-fs":"^4.2.0","jsonfile":"^6.0.1","universalify":"^1.0.0"}},"fs-minipass":{"version":"1.2.7","resolved":"https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz","integrity":"sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==","dev":true,"requires":{"minipass":"^2.6.0"}},"fs-write-stream-atomic":{"version":"1.0.10","resolved":"https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz","integrity":"sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=","dev":true,"requires":{"graceful-fs":"^4.1.2","iferr":"^0.1.5","imurmurhash":"^0.1.4","readable-stream":"1 || 2"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"fs.realpath":{"version":"1.0.0","resolved":"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz","integrity":"sha1-FQStJSMVjKpA20onh8sBQRmU6k8="},"fsevents":{"version":"2.1.3","resolved":"https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz","integrity":"sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==","dev":true,"optional":true},"function-bind":{"version":"1.1.1","resolved":"https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz","integrity":"sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="},"functional-red-black-tree":{"version":"1.0.1","resolved":"https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz","integrity":"sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc="},"gauge":{"version":"2.7.4","resolved":"https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz","integrity":"sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=","dev":true,"requires":{"aproba":"^1.0.3","console-control-strings":"^1.0.0","has-unicode":"^2.0.0","object-assign":"^4.1.0","signal-exit":"^3.0.0","string-width":"^1.0.1","strip-ansi":"^3.0.1","wide-align":"^1.1.0"}},"genfun":{"version":"5.0.0","resolved":"https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz","integrity":"sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==","dev":true},"gensync":{"version":"1.0.0-beta.1","resolved":"https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz","integrity":"sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==","dev":true},"get-caller-file":{"version":"2.0.5","resolved":"https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz","integrity":"sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==","dev":true},"get-package-type":{"version":"0.1.0","resolved":"https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz","integrity":"sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==","dev":true},"get-pkg-repo":{"version":"1.4.0","resolved":"https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz","integrity":"sha1-xztInAbYDMVTbCyFP54FIyBWly0=","dev":true,"requires":{"hosted-git-info":"^2.1.4","meow":"^3.3.0","normalize-package-data":"^2.3.0","parse-github-repo-url":"^1.3.0","through2":"^2.0.0"},"dependencies":{"camelcase":{"version":"2.1.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz","integrity":"sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=","dev":true},"camelcase-keys":{"version":"2.1.0","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz","integrity":"sha1-MIvur/3ygRkFHvodkyITyRuPkuc=","dev":true,"requires":{"camelcase":"^2.0.0","map-obj":"^1.0.0"}},"find-up":{"version":"1.1.2","resolved":"https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz","integrity":"sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=","dev":true,"requires":{"path-exists":"^2.0.0","pinkie-promise":"^2.0.0"}},"indent-string":{"version":"2.1.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz","integrity":"sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=","dev":true,"requires":{"repeating":"^2.0.0"}},"load-json-file":{"version":"1.1.0","resolved":"https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz","integrity":"sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=","dev":true,"requires":{"graceful-fs":"^4.1.2","parse-json":"^2.2.0","pify":"^2.0.0","pinkie-promise":"^2.0.0","strip-bom":"^2.0.0"}},"map-obj":{"version":"1.0.1","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz","integrity":"sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=","dev":true},"meow":{"version":"3.7.0","resolved":"https://registry.npmjs.org/meow/-/meow-3.7.0.tgz","integrity":"sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=","dev":true,"requires":{"camelcase-keys":"^2.0.0","decamelize":"^1.1.2","loud-rejection":"^1.0.0","map-obj":"^1.0.1","minimist":"^1.1.3","normalize-package-data":"^2.3.4","object-assign":"^4.0.1","read-pkg-up":"^1.0.1","redent":"^1.0.0","trim-newlines":"^1.0.0"}},"parse-json":{"version":"2.2.0","resolved":"https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz","integrity":"sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=","dev":true,"requires":{"error-ex":"^1.2.0"}},"path-exists":{"version":"2.1.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz","integrity":"sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=","dev":true,"requires":{"pinkie-promise":"^2.0.0"}},"path-type":{"version":"1.1.0","resolved":"https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz","integrity":"sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=","dev":true,"requires":{"graceful-fs":"^4.1.2","pify":"^2.0.0","pinkie-promise":"^2.0.0"}},"pify":{"version":"2.3.0","resolved":"https://registry.npmjs.org/pify/-/pify-2.3.0.tgz","integrity":"sha1-7RQaasBDqEnqWISY59yosVMw6Qw=","dev":true},"read-pkg":{"version":"1.1.0","resolved":"https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz","integrity":"sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=","dev":true,"requires":{"load-json-file":"^1.0.0","normalize-package-data":"^2.3.2","path-type":"^1.0.0"}},"read-pkg-up":{"version":"1.0.1","resolved":"https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz","integrity":"sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=","dev":true,"requires":{"find-up":"^1.0.0","read-pkg":"^1.0.0"}},"redent":{"version":"1.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-1.0.0.tgz","integrity":"sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=","dev":true,"requires":{"indent-string":"^2.1.0","strip-indent":"^1.0.1"}},"strip-bom":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz","integrity":"sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=","dev":true,"requires":{"is-utf8":"^0.2.0"}},"strip-indent":{"version":"1.0.1","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz","integrity":"sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=","dev":true,"requires":{"get-stdin":"^4.0.1"}},"trim-newlines":{"version":"1.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz","integrity":"sha1-WIeWa7WCpFA6QetST301ARgVphM=","dev":true}}},"get-port":{"version":"4.2.0","resolved":"https://registry.npmjs.org/get-port/-/get-port-4.2.0.tgz","integrity":"sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw==","dev":true},"get-stdin":{"version":"4.0.1","resolved":"https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz","integrity":"sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=","dev":true},"get-stream":{"version":"4.1.0","resolved":"https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz","integrity":"sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==","dev":true,"requires":{"pump":"^3.0.0"}},"get-value":{"version":"2.0.6","resolved":"https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz","integrity":"sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=","dev":true},"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"}},"git-config-path":{"version":"1.0.1","resolved":"https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz","integrity":"sha1-bTP37WPbDQ4RgTFQO6s6ykfVRmQ=","dev":true,"requires":{"extend-shallow":"^2.0.1","fs-exists-sync":"^0.1.0","homedir-polyfill":"^1.0.0"},"dependencies":{"extend-shallow":{"version":"2.0.1","resolved":"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz","integrity":"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"git-raw-commits":{"version":"2.0.0","resolved":"https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz","integrity":"sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==","dev":true,"requires":{"dargs":"^4.0.1","lodash.template":"^4.0.2","meow":"^4.0.0","split2":"^2.0.0","through2":"^2.0.0"},"dependencies":{"camelcase":{"version":"4.1.0","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz","integrity":"sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=","dev":true},"camelcase-keys":{"version":"4.2.0","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz","integrity":"sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=","dev":true,"requires":{"camelcase":"^4.1.0","map-obj":"^2.0.0","quick-lru":"^1.0.0"}},"indent-string":{"version":"3.2.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz","integrity":"sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=","dev":true},"map-obj":{"version":"2.0.0","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz","integrity":"sha1-plzSkIepJZi4eRJXpSPgISIqwfk=","dev":true},"meow":{"version":"4.0.1","resolved":"https://registry.npmjs.org/meow/-/meow-4.0.1.tgz","integrity":"sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==","dev":true,"requires":{"camelcase-keys":"^4.0.0","decamelize-keys":"^1.0.0","loud-rejection":"^1.0.0","minimist":"^1.1.3","minimist-options":"^3.0.1","normalize-package-data":"^2.3.4","read-pkg-up":"^3.0.0","redent":"^2.0.0","trim-newlines":"^2.0.0"}},"minimist-options":{"version":"3.0.2","resolved":"https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz","integrity":"sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==","dev":true,"requires":{"arrify":"^1.0.1","is-plain-obj":"^1.1.0"}},"quick-lru":{"version":"1.1.0","resolved":"https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz","integrity":"sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=","dev":true},"redent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-2.0.0.tgz","integrity":"sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=","dev":true,"requires":{"indent-string":"^3.0.0","strip-indent":"^2.0.0"}},"strip-indent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz","integrity":"sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=","dev":true},"trim-newlines":{"version":"2.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz","integrity":"sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=","dev":true}}},"git-remote-origin-url":{"version":"2.0.0","resolved":"https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz","integrity":"sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=","dev":true,"requires":{"gitconfiglocal":"^1.0.0","pify":"^2.3.0"},"dependencies":{"pify":{"version":"2.3.0","resolved":"https://registry.npmjs.org/pify/-/pify-2.3.0.tgz","integrity":"sha1-7RQaasBDqEnqWISY59yosVMw6Qw=","dev":true}}},"git-semver-tags":{"version":"2.0.3","resolved":"https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-2.0.3.tgz","integrity":"sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA==","dev":true,"requires":{"meow":"^4.0.0","semver":"^6.0.0"},"dependencies":{"camelcase":{"version":"4.1.0","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz","integrity":"sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=","dev":true},"camelcase-keys":{"version":"4.2.0","resolved":"https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz","integrity":"sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=","dev":true,"requires":{"camelcase":"^4.1.0","map-obj":"^2.0.0","quick-lru":"^1.0.0"}},"indent-string":{"version":"3.2.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz","integrity":"sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=","dev":true},"map-obj":{"version":"2.0.0","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz","integrity":"sha1-plzSkIepJZi4eRJXpSPgISIqwfk=","dev":true},"meow":{"version":"4.0.1","resolved":"https://registry.npmjs.org/meow/-/meow-4.0.1.tgz","integrity":"sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==","dev":true,"requires":{"camelcase-keys":"^4.0.0","decamelize-keys":"^1.0.0","loud-rejection":"^1.0.0","minimist":"^1.1.3","minimist-options":"^3.0.1","normalize-package-data":"^2.3.4","read-pkg-up":"^3.0.0","redent":"^2.0.0","trim-newlines":"^2.0.0"}},"minimist-options":{"version":"3.0.2","resolved":"https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz","integrity":"sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==","dev":true,"requires":{"arrify":"^1.0.1","is-plain-obj":"^1.1.0"}},"quick-lru":{"version":"1.1.0","resolved":"https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz","integrity":"sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=","dev":true},"redent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-2.0.0.tgz","integrity":"sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=","dev":true,"requires":{"indent-string":"^3.0.0","strip-indent":"^2.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"strip-indent":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz","integrity":"sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=","dev":true},"trim-newlines":{"version":"2.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz","integrity":"sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=","dev":true}}},"git-up":{"version":"4.0.2","resolved":"https://registry.npmjs.org/git-up/-/git-up-4.0.2.tgz","integrity":"sha512-kbuvus1dWQB2sSW4cbfTeGpCMd8ge9jx9RKnhXhuJ7tnvT+NIrTVfYZxjtflZddQYcmdOTlkAcjmx7bor+15AQ==","dev":true,"requires":{"is-ssh":"^1.3.0","parse-url":"^5.0.0"}},"git-url-parse":{"version":"11.2.0","resolved":"https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.2.0.tgz","integrity":"sha512-KPoHZg8v+plarZvto4ruIzzJLFQoRx+sUs5DQSr07By9IBKguVd+e6jwrFR6/TP6xrCJlNV1tPqLO1aREc7O2g==","dev":true,"requires":{"git-up":"^4.0.0"}},"git-user-name":{"version":"2.0.0","resolved":"https://registry.npmjs.org/git-user-name/-/git-user-name-2.0.0.tgz","integrity":"sha512-1DC8rUNm2I5V9v4eIpK6PSjKCp9bI0t6Wl05WSk+xEMS8GhR8GWzxM3aGZfPrfuqEfWxSbui5/pQJryJFXqCzQ==","dev":true,"requires":{"extend-shallow":"^2.0.1","git-config-path":"^1.0.1","parse-git-config":"^1.1.1"},"dependencies":{"extend-shallow":{"version":"2.0.1","resolved":"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz","integrity":"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"gitconfiglocal":{"version":"1.0.0","resolved":"https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz","integrity":"sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=","dev":true,"requires":{"ini":"^1.3.2"}},"glob":{"version":"7.1.6","resolved":"https://registry.npmjs.org/glob/-/glob-7.1.6.tgz","integrity":"sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==","requires":{"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"}},"glob-parent":{"version":"5.1.1","resolved":"https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz","integrity":"sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==","dev":true,"requires":{"is-glob":"^4.0.1"}},"glob-to-regexp":{"version":"0.3.0","resolved":"https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz","integrity":"sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=","dev":true},"globals":{"version":"11.12.0","resolved":"https://registry.npmjs.org/globals/-/globals-11.12.0.tgz","integrity":"sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==","dev":true},"globby":{"version":"9.2.0","resolved":"https://registry.npmjs.org/globby/-/globby-9.2.0.tgz","integrity":"sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==","dev":true,"requires":{"@types/glob":"^7.1.1","array-union":"^1.0.2","dir-glob":"^2.2.2","fast-glob":"^2.2.6","glob":"^7.1.3","ignore":"^4.0.3","pify":"^4.0.1","slash":"^2.0.0"}},"graceful-fs":{"version":"4.2.4","resolved":"https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz","integrity":"sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==","dev":true},"growl":{"version":"1.10.5","resolved":"https://registry.npmjs.org/growl/-/growl-1.10.5.tgz","integrity":"sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==","dev":true},"handlebars":{"version":"4.7.6","resolved":"https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz","integrity":"sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==","dev":true,"requires":{"minimist":"^1.2.5","neo-async":"^2.6.0","source-map":"^0.6.1","uglify-js":"^3.1.4","wordwrap":"^1.0.0"},"dependencies":{"source-map":{"version":"0.6.1","resolved":"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz","integrity":"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==","dev":true}}},"har-schema":{"version":"2.0.0","resolved":"https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz","integrity":"sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=","dev":true},"har-validator":{"version":"5.1.5","resolved":"https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz","integrity":"sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==","dev":true,"requires":{"ajv":"^6.12.3","har-schema":"^2.0.0"}},"hard-rejection":{"version":"2.1.0","resolved":"https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz","integrity":"sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==","dev":true},"has":{"version":"1.0.3","resolved":"https://registry.npmjs.org/has/-/has-1.0.3.tgz","integrity":"sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==","requires":{"function-bind":"^1.1.1"}},"has-flag":{"version":"4.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz","integrity":"sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==","dev":true},"has-symbols":{"version":"1.0.1","resolved":"https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz","integrity":"sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg=="},"has-unicode":{"version":"2.0.1","resolved":"https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz","integrity":"sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=","dev":true},"has-value":{"version":"1.0.0","resolved":"https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz","integrity":"sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=","dev":true,"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=","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"hash-base":{"version":"3.1.0","resolved":"https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz","integrity":"sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==","requires":{"inherits":"^2.0.4","readable-stream":"^3.6.0","safe-buffer":"^5.2.0"}},"hash.js":{"version":"1.1.7","resolved":"https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz","integrity":"sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==","requires":{"inherits":"^2.0.3","minimalistic-assert":"^1.0.1"}},"hasha":{"version":"5.2.0","resolved":"https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz","integrity":"sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==","dev":true,"requires":{"is-stream":"^2.0.0","type-fest":"^0.8.0"},"dependencies":{"is-stream":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz","integrity":"sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==","dev":true},"type-fest":{"version":"0.8.1","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz","integrity":"sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==","dev":true}}},"hdkey":{"version":"2.0.1","resolved":"https://registry.npmjs.org/hdkey/-/hdkey-2.0.1.tgz","integrity":"sha512-c+tl9PHG9/XkGgG0tD7CJpRVaE0jfZizDNmnErUAKQ4EjQSOcOUcV3EN9ZEZS8pZ4usaeiiK0H7stzuzna8feA==","requires":{"bs58check":"^2.1.2","safe-buffer":"^5.1.1","secp256k1":"^4.0.0"}},"he":{"version":"1.2.0","resolved":"https://registry.npmjs.org/he/-/he-1.2.0.tgz","integrity":"sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==","dev":true},"highlight.js":{"version":"9.18.3","resolved":"https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.3.tgz","integrity":"sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ==","dev":true},"hmac-drbg":{"version":"1.0.1","resolved":"https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz","integrity":"sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=","requires":{"hash.js":"^1.0.3","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.1"}},"homedir-polyfill":{"version":"1.0.3","resolved":"https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz","integrity":"sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==","dev":true,"requires":{"parse-passwd":"^1.0.0"}},"hosted-git-info":{"version":"2.8.8","resolved":"https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz","integrity":"sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==","dev":true},"html-escaper":{"version":"2.0.2","resolved":"https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz","integrity":"sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==","dev":true},"http-cache-semantics":{"version":"3.8.1","resolved":"https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz","integrity":"sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==","dev":true},"http-proxy-agent":{"version":"2.1.0","resolved":"https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz","integrity":"sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==","dev":true,"requires":{"agent-base":"4","debug":"3.1.0"}},"http-signature":{"version":"1.2.0","resolved":"https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz","integrity":"sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=","dev":true,"requires":{"assert-plus":"^1.0.0","jsprim":"^1.2.2","sshpk":"^1.7.0"}},"https-proxy-agent":{"version":"2.2.4","resolved":"https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz","integrity":"sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==","dev":true,"requires":{"agent-base":"^4.3.0","debug":"^3.1.0"}},"human-signals":{"version":"1.1.1","resolved":"https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz","integrity":"sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==","dev":true},"humanize-ms":{"version":"1.2.1","resolved":"https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz","integrity":"sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=","dev":true,"requires":{"ms":"^2.0.0"}},"husky":{"version":"4.3.0","resolved":"https://registry.npmjs.org/husky/-/husky-4.3.0.tgz","integrity":"sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==","dev":true,"requires":{"chalk":"^4.0.0","ci-info":"^2.0.0","compare-versions":"^3.6.0","cosmiconfig":"^7.0.0","find-versions":"^3.2.0","opencollective-postinstall":"^2.0.2","pkg-dir":"^4.2.0","please-upgrade-node":"^3.2.0","slash":"^3.0.0","which-pm-runs":"^1.0.0"},"dependencies":{"cosmiconfig":{"version":"7.0.0","resolved":"https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz","integrity":"sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==","dev":true,"requires":{"@types/parse-json":"^4.0.0","import-fresh":"^3.2.1","parse-json":"^5.0.0","path-type":"^4.0.0","yaml":"^1.10.0"}},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"import-fresh":{"version":"3.2.1","resolved":"https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz","integrity":"sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==","dev":true,"requires":{"parent-module":"^1.0.0","resolve-from":"^4.0.0"}},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"parse-json":{"version":"5.1.0","resolved":"https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz","integrity":"sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==","dev":true,"requires":{"@babel/code-frame":"^7.0.0","error-ex":"^1.3.1","json-parse-even-better-errors":"^2.3.0","lines-and-columns":"^1.1.6"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"path-type":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz","integrity":"sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==","dev":true},"pkg-dir":{"version":"4.2.0","resolved":"https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz","integrity":"sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==","dev":true,"requires":{"find-up":"^4.0.0"}},"slash":{"version":"3.0.0","resolved":"https://registry.npmjs.org/slash/-/slash-3.0.0.tgz","integrity":"sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==","dev":true}}},"iconv-lite":{"version":"0.6.2","resolved":"https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz","integrity":"sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==","dev":true,"requires":{"safer-buffer":">= 2.1.2 < 3.0.0"}},"ieee754":{"version":"1.1.13","resolved":"https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz","integrity":"sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="},"iferr":{"version":"0.1.5","resolved":"https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz","integrity":"sha1-xg7taebY/bazEEofy8ocGS3FtQE=","dev":true},"ignore":{"version":"4.0.6","resolved":"https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz","integrity":"sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==","dev":true},"ignore-walk":{"version":"3.0.3","resolved":"https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz","integrity":"sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==","dev":true,"requires":{"minimatch":"^3.0.4"}},"immediate":{"version":"3.3.0","resolved":"https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz","integrity":"sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q=="},"import-fresh":{"version":"2.0.0","resolved":"https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz","integrity":"sha1-2BNVwVYS04bGH53dOSLUMEgipUY=","dev":true,"requires":{"caller-path":"^2.0.0","resolve-from":"^3.0.0"},"dependencies":{"resolve-from":{"version":"3.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz","integrity":"sha1-six699nWiBvItuZTM17rywoYh0g=","dev":true}}},"import-local":{"version":"2.0.0","resolved":"https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz","integrity":"sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==","dev":true,"requires":{"pkg-dir":"^3.0.0","resolve-cwd":"^2.0.0"}},"imurmurhash":{"version":"0.1.4","resolved":"https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz","integrity":"sha1-khi5srkoojixPcT7a21XbyMUU+o=","dev":true},"indent-string":{"version":"4.0.0","resolved":"https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz","integrity":"sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==","dev":true},"infer-owner":{"version":"1.0.4","resolved":"https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz","integrity":"sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==","dev":true},"inflight":{"version":"1.0.6","resolved":"https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz","integrity":"sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=","requires":{"once":"^1.3.0","wrappy":"1"}},"inherits":{"version":"2.0.4","resolved":"https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz","integrity":"sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="},"ini":{"version":"1.3.5","resolved":"https://registry.npmjs.org/ini/-/ini-1.3.5.tgz","integrity":"sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==","dev":true},"init-package-json":{"version":"1.10.3","resolved":"https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz","integrity":"sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==","dev":true,"requires":{"glob":"^7.1.1","npm-package-arg":"^4.0.0 || ^5.0.0 || ^6.0.0","promzard":"^0.3.0","read":"~1.0.1","read-package-json":"1 || 2","semver":"2.x || 3.x || 4 || 5","validate-npm-package-license":"^3.0.1","validate-npm-package-name":"^3.0.0"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}}}},"inquirer":{"version":"6.5.2","resolved":"https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz","integrity":"sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==","dev":true,"requires":{"ansi-escapes":"^3.2.0","chalk":"^2.4.2","cli-cursor":"^2.1.0","cli-width":"^2.0.0","external-editor":"^3.0.3","figures":"^2.0.0","lodash":"^4.17.12","mute-stream":"0.0.7","run-async":"^2.2.0","rxjs":"^6.4.0","string-width":"^2.1.0","strip-ansi":"^5.1.0","through":"^2.3.6"},"dependencies":{"ansi-regex":{"version":"3.0.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz","integrity":"sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=","dev":true},"chalk":{"version":"2.4.2","resolved":"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz","integrity":"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==","dev":true,"requires":{"ansi-styles":"^3.2.1","escape-string-regexp":"^1.0.5","supports-color":"^5.3.0"}},"has-flag":{"version":"3.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz","integrity":"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=","dev":true},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"string-width":{"version":"2.1.1","resolved":"https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz","integrity":"sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==","dev":true,"requires":{"is-fullwidth-code-point":"^2.0.0","strip-ansi":"^4.0.0"},"dependencies":{"strip-ansi":{"version":"4.0.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz","integrity":"sha1-qEeQIusaw2iocTibY1JixQXuNo8=","dev":true,"requires":{"ansi-regex":"^3.0.0"}}}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true}}},"supports-color":{"version":"5.5.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz","integrity":"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==","dev":true,"requires":{"has-flag":"^3.0.0"}}}},"interpret":{"version":"1.4.0","resolved":"https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz","integrity":"sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==","dev":true},"into-stream":{"version":"6.0.0","resolved":"https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz","integrity":"sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==","dev":true,"requires":{"from2":"^2.3.0","p-is-promise":"^3.0.0"}},"ip":{"version":"1.1.5","resolved":"https://registry.npmjs.org/ip/-/ip-1.1.5.tgz","integrity":"sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=","dev":true},"is-absolute":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz","integrity":"sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==","dev":true,"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=","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"is-arrayish":{"version":"0.2.1","resolved":"https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz","integrity":"sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=","dev":true},"is-binary-path":{"version":"2.1.0","resolved":"https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz","integrity":"sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==","dev":true,"requires":{"binary-extensions":"^2.0.0"}},"is-buffer":{"version":"1.1.6","resolved":"https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz","integrity":"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==","dev":true},"is-callable":{"version":"1.2.2","resolved":"https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz","integrity":"sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA=="},"is-ci":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz","integrity":"sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==","dev":true,"requires":{"ci-info":"^2.0.0"}},"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=","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"is-date-object":{"version":"1.0.2","resolved":"https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz","integrity":"sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g=="},"is-descriptor":{"version":"0.1.6","resolved":"https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz","integrity":"sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==","dev":true,"requires":{"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==","dev":true}}},"is-directory":{"version":"0.3.1","resolved":"https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz","integrity":"sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=","dev":true},"is-extendable":{"version":"0.1.1","resolved":"https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz","integrity":"sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=","dev":true},"is-extglob":{"version":"2.1.1","resolved":"https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz","integrity":"sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=","dev":true},"is-finite":{"version":"1.1.0","resolved":"https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz","integrity":"sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==","dev":true},"is-fullwidth-code-point":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz","integrity":"sha1-754xOG8DGn8NZDr4L95QxFfvAMs=","dev":true,"requires":{"number-is-nan":"^1.0.0"}},"is-glob":{"version":"4.0.1","resolved":"https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz","integrity":"sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==","dev":true,"requires":{"is-extglob":"^2.1.1"}},"is-hex-prefixed":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz","integrity":"sha1-fY035q135dEnFIkTxXPggtd39VQ="},"is-negated-glob":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz","integrity":"sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=","dev":true},"is-negative-zero":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz","integrity":"sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE="},"is-number":{"version":"3.0.0","resolved":"https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz","integrity":"sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"is-obj":{"version":"1.0.1","resolved":"https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz","integrity":"sha1-PkcprB9f3gJc19g6iW2rn09n2w8=","dev":true},"is-plain-obj":{"version":"1.1.0","resolved":"https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz","integrity":"sha1-caUMhCnfync8kqOQpKA7OfzVHT4=","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==","dev":true,"requires":{"isobject":"^3.0.1"}},"is-regex":{"version":"1.1.1","resolved":"https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz","integrity":"sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==","requires":{"has-symbols":"^1.0.1"}},"is-relative":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz","integrity":"sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==","dev":true,"requires":{"is-unc-path":"^1.0.0"}},"is-ssh":{"version":"1.3.2","resolved":"https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz","integrity":"sha512-elEw0/0c2UscLrNG+OAorbP539E3rhliKPg+hDMWN9VwrDXfYK+4PBEykDPfxlYYtQvl84TascnQyobfQLHEhQ==","dev":true,"requires":{"protocols":"^1.1.0"}},"is-stream":{"version":"1.1.0","resolved":"https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz","integrity":"sha1-EtSj3U5o4Lec6428hBc66A2RykQ=","dev":true},"is-symbol":{"version":"1.0.3","resolved":"https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz","integrity":"sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==","requires":{"has-symbols":"^1.0.1"}},"is-text-path":{"version":"1.0.1","resolved":"https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz","integrity":"sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=","dev":true,"requires":{"text-extensions":"^1.0.0"}},"is-typedarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz","integrity":"sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=","dev":true},"is-unc-path":{"version":"1.0.0","resolved":"https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz","integrity":"sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==","dev":true,"requires":{"unc-path-regex":"^0.1.2"}},"is-utf8":{"version":"0.2.1","resolved":"https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz","integrity":"sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=","dev":true},"is-windows":{"version":"1.0.2","resolved":"https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz","integrity":"sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==","dev":true},"isarray":{"version":"0.0.1","resolved":"https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz","integrity":"sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="},"isexe":{"version":"2.0.0","resolved":"https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz","integrity":"sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=","dev":true},"isobject":{"version":"3.0.1","resolved":"https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz","integrity":"sha1-TkMekrEalzFjaqH5yNHMvP2reN8=","dev":true},"isstream":{"version":"0.1.2","resolved":"https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz","integrity":"sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=","dev":true},"istanbul-lib-coverage":{"version":"3.0.0","resolved":"https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz","integrity":"sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==","dev":true},"istanbul-lib-hook":{"version":"3.0.0","resolved":"https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz","integrity":"sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==","dev":true,"requires":{"append-transform":"^2.0.0"}},"istanbul-lib-instrument":{"version":"4.0.3","resolved":"https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz","integrity":"sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==","dev":true,"requires":{"@babel/core":"^7.7.5","@istanbuljs/schema":"^0.1.2","istanbul-lib-coverage":"^3.0.0","semver":"^6.3.0"},"dependencies":{"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"istanbul-lib-processinfo":{"version":"2.0.2","resolved":"https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz","integrity":"sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==","dev":true,"requires":{"archy":"^1.0.0","cross-spawn":"^7.0.0","istanbul-lib-coverage":"^3.0.0-alpha.1","make-dir":"^3.0.0","p-map":"^3.0.0","rimraf":"^3.0.0","uuid":"^3.3.3"},"dependencies":{"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"p-map":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz","integrity":"sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==","dev":true,"requires":{"aggregate-error":"^3.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"istanbul-lib-report":{"version":"3.0.0","resolved":"https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz","integrity":"sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==","dev":true,"requires":{"istanbul-lib-coverage":"^3.0.0","make-dir":"^3.0.0","supports-color":"^7.1.0"},"dependencies":{"has-flag":{"version":"4.0.0","resolved":"https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz","integrity":"sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==","dev":true},"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"supports-color":{"version":"7.2.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz","integrity":"sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==","dev":true,"requires":{"has-flag":"^4.0.0"}}}},"istanbul-lib-source-maps":{"version":"4.0.0","resolved":"https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz","integrity":"sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==","dev":true,"requires":{"debug":"^4.1.1","istanbul-lib-coverage":"^3.0.0","source-map":"^0.6.1"},"dependencies":{"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}},"source-map":{"version":"0.6.1","resolved":"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz","integrity":"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==","dev":true}}},"istanbul-reports":{"version":"3.0.2","resolved":"https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz","integrity":"sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==","dev":true,"requires":{"html-escaper":"^2.0.0","istanbul-lib-report":"^3.0.0"}},"js-sha3":{"version":"0.8.0","resolved":"https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz","integrity":"sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==","dev":true},"js-tokens":{"version":"4.0.0","resolved":"https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz","integrity":"sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==","dev":true},"js-yaml":{"version":"3.14.0","resolved":"https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz","integrity":"sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==","dev":true,"requires":{"argparse":"^1.0.7","esprima":"^4.0.0"}},"jsbn":{"version":"0.1.1","resolved":"https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz","integrity":"sha1-peZUwuWi3rXyAdls77yoDA7y9RM=","dev":true},"jsesc":{"version":"2.5.2","resolved":"https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz","integrity":"sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==","dev":true},"json-parse-better-errors":{"version":"1.0.2","resolved":"https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz","integrity":"sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==","dev":true},"json-parse-even-better-errors":{"version":"2.3.1","resolved":"https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz","integrity":"sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==","dev":true},"json-schema":{"version":"0.2.3","resolved":"https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz","integrity":"sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=","dev":true},"json-schema-traverse":{"version":"0.4.1","resolved":"https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz","integrity":"sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==","dev":true},"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=","dev":true},"json5":{"version":"2.1.3","resolved":"https://registry.npmjs.org/json5/-/json5-2.1.3.tgz","integrity":"sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==","dev":true,"requires":{"minimist":"^1.2.5"}},"jsonfile":{"version":"6.0.1","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz","integrity":"sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==","dev":true,"requires":{"graceful-fs":"^4.1.6","universalify":"^1.0.0"}},"jsonparse":{"version":"1.3.1","resolved":"https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz","integrity":"sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=","dev":true},"jsprim":{"version":"1.4.1","resolved":"https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz","integrity":"sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=","dev":true,"requires":{"assert-plus":"1.0.0","extsprintf":"1.3.0","json-schema":"0.2.3","verror":"1.10.0"}},"keccak":{"version":"3.0.0","resolved":"https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz","integrity":"sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==","requires":{"node-addon-api":"^2.0.0","node-gyp-build":"^4.2.0"}},"kind-of":{"version":"6.0.3","resolved":"https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz","integrity":"sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==","dev":true},"klaw":{"version":"1.3.1","resolved":"https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz","integrity":"sha1-QIhDO0azsbolnXh4XY6W9zugJDk=","dev":true,"requires":{"graceful-fs":"^4.1.9"}},"lerna":{"version":"3.22.1","resolved":"https://registry.npmjs.org/lerna/-/lerna-3.22.1.tgz","integrity":"sha512-vk1lfVRFm+UuEFA7wkLKeSF7Iz13W+N/vFd48aW2yuS7Kv0RbNm2/qcDPV863056LMfkRlsEe+QYOw3palj5Lg==","dev":true,"requires":{"@lerna/add":"3.21.0","@lerna/bootstrap":"3.21.0","@lerna/changed":"3.21.0","@lerna/clean":"3.21.0","@lerna/cli":"3.18.5","@lerna/create":"3.22.0","@lerna/diff":"3.21.0","@lerna/exec":"3.21.0","@lerna/import":"3.22.0","@lerna/info":"3.21.0","@lerna/init":"3.21.0","@lerna/link":"3.21.0","@lerna/list":"3.21.0","@lerna/publish":"3.22.1","@lerna/run":"3.21.0","@lerna/version":"3.22.1","import-local":"^2.0.0","npmlog":"^4.1.2"}},"level-codec":{"version":"7.0.1","resolved":"https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz","integrity":"sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ=="},"level-concat-iterator":{"version":"2.0.1","resolved":"https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz","integrity":"sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw=="},"level-errors":{"version":"1.0.5","resolved":"https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz","integrity":"sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==","requires":{"errno":"~0.1.1"}},"level-iterator-stream":{"version":"1.3.1","resolved":"https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz","integrity":"sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=","requires":{"inherits":"^2.0.1","level-errors":"^1.0.3","readable-stream":"^1.0.33","xtend":"^4.0.0"},"dependencies":{"readable-stream":{"version":"1.1.14","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz","integrity":"sha1-fPTFTvZI44EwhMY23SB54WbAgdk=","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.1","isarray":"0.0.1","string_decoder":"~0.10.x"}},"string_decoder":{"version":"0.10.31","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz","integrity":"sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"level-mem":{"version":"3.0.1","resolved":"https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz","integrity":"sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==","requires":{"level-packager":"~4.0.0","memdown":"~3.0.0"},"dependencies":{"abstract-leveldown":{"version":"5.0.0","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz","integrity":"sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==","requires":{"xtend":"~4.0.0"}},"immediate":{"version":"3.2.3","resolved":"https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz","integrity":"sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw="},"memdown":{"version":"3.0.0","resolved":"https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz","integrity":"sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==","requires":{"abstract-leveldown":"~5.0.0","functional-red-black-tree":"~1.0.1","immediate":"~3.2.3","inherits":"~2.0.1","ltgt":"~2.2.0","safe-buffer":"~5.1.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"level-option-wrap":{"version":"1.1.0","resolved":"https://registry.npmjs.org/level-option-wrap/-/level-option-wrap-1.1.0.tgz","integrity":"sha1-rSDmjZ88IsiJdTHMaqevWWse0Sk=","requires":{"defined":"~0.0.0"}},"level-packager":{"version":"4.0.1","resolved":"https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz","integrity":"sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==","requires":{"encoding-down":"~5.0.0","levelup":"^3.0.0"},"dependencies":{"abstract-leveldown":{"version":"5.0.0","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz","integrity":"sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==","requires":{"xtend":"~4.0.0"}},"deferred-leveldown":{"version":"4.0.2","resolved":"https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz","integrity":"sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==","requires":{"abstract-leveldown":"~5.0.0","inherits":"^2.0.3"}},"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="},"level-errors":{"version":"2.0.1","resolved":"https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz","integrity":"sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==","requires":{"errno":"~0.1.1"}},"level-iterator-stream":{"version":"3.0.1","resolved":"https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz","integrity":"sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==","requires":{"inherits":"^2.0.1","readable-stream":"^2.3.6","xtend":"^4.0.0"}},"levelup":{"version":"3.1.1","resolved":"https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz","integrity":"sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==","requires":{"deferred-leveldown":"~4.0.0","level-errors":"~2.0.0","level-iterator-stream":"~3.0.0","xtend":"~4.0.0"}},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","requires":{"safe-buffer":"~5.1.0"}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"level-supports":{"version":"1.0.1","resolved":"https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz","integrity":"sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==","requires":{"xtend":"^4.0.2"},"dependencies":{"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"level-ws":{"version":"0.0.0","resolved":"https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz","integrity":"sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=","requires":{"readable-stream":"~1.0.15","xtend":"~2.1.1"},"dependencies":{"readable-stream":{"version":"1.0.34","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz","integrity":"sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=","requires":{"core-util-is":"~1.0.0","inherits":"~2.0.1","isarray":"0.0.1","string_decoder":"~0.10.x"}},"string_decoder":{"version":"0.10.31","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz","integrity":"sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="}}},"leveldown":{"version":"5.6.0","resolved":"https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz","integrity":"sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==","requires":{"abstract-leveldown":"~6.2.1","napi-macros":"~2.0.0","node-gyp-build":"~4.1.0"},"dependencies":{"abstract-leveldown":{"version":"6.2.3","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz","integrity":"sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==","requires":{"buffer":"^5.5.0","immediate":"^3.2.3","level-concat-iterator":"~2.0.0","level-supports":"~1.0.0","xtend":"~4.0.0"}},"node-gyp-build":{"version":"4.1.1","resolved":"https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz","integrity":"sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ=="},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"lines-and-columns":{"version":"1.1.6","resolved":"https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz","integrity":"sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=","dev":true},"load-json-file":{"version":"5.3.0","resolved":"https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz","integrity":"sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==","dev":true,"requires":{"graceful-fs":"^4.1.15","parse-json":"^4.0.0","pify":"^4.0.1","strip-bom":"^3.0.0","type-fest":"^0.3.0"}},"locate-path":{"version":"3.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz","integrity":"sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==","dev":true,"requires":{"p-locate":"^3.0.0","path-exists":"^3.0.0"}},"lodash":{"version":"4.17.20","resolved":"https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz","integrity":"sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="},"lodash._reinterpolate":{"version":"3.0.0","resolved":"https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz","integrity":"sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=","dev":true},"lodash.clonedeep":{"version":"4.5.0","resolved":"https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz","integrity":"sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="},"lodash.flattendeep":{"version":"4.4.0","resolved":"https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz","integrity":"sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=","dev":true},"lodash.get":{"version":"4.4.2","resolved":"https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz","integrity":"sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=","dev":true},"lodash.ismatch":{"version":"4.4.0","resolved":"https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz","integrity":"sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=","dev":true},"lodash.set":{"version":"4.3.2","resolved":"https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz","integrity":"sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=","dev":true},"lodash.sortby":{"version":"4.7.0","resolved":"https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz","integrity":"sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=","dev":true},"lodash.template":{"version":"4.5.0","resolved":"https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz","integrity":"sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==","dev":true,"requires":{"lodash._reinterpolate":"^3.0.0","lodash.templatesettings":"^4.0.0"}},"lodash.templatesettings":{"version":"4.2.0","resolved":"https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz","integrity":"sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==","dev":true,"requires":{"lodash._reinterpolate":"^3.0.0"}},"lodash.uniq":{"version":"4.5.0","resolved":"https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz","integrity":"sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=","dev":true},"log-symbols":{"version":"4.0.0","resolved":"https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz","integrity":"sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==","dev":true,"requires":{"chalk":"^4.0.0"}},"loud-rejection":{"version":"1.6.0","resolved":"https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz","integrity":"sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=","dev":true,"requires":{"currently-unhandled":"^0.4.1","signal-exit":"^3.0.0"}},"lru-cache":{"version":"5.1.1","resolved":"https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz","integrity":"sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==","requires":{"yallist":"^3.0.2"}},"ltgt":{"version":"2.2.1","resolved":"https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz","integrity":"sha1-81ypHEk/e3PaDgdJUwTxezH4fuU="},"macos-release":{"version":"2.4.1","resolved":"https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz","integrity":"sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg==","dev":true},"make-dir":{"version":"1.3.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz","integrity":"sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==","dev":true,"requires":{"pify":"^3.0.0"},"dependencies":{"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true}}},"make-error":{"version":"1.3.6","resolved":"https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz","integrity":"sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==","dev":true},"make-fetch-happen":{"version":"5.0.2","resolved":"https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz","integrity":"sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==","dev":true,"requires":{"agentkeepalive":"^3.4.1","cacache":"^12.0.0","http-cache-semantics":"^3.8.1","http-proxy-agent":"^2.1.0","https-proxy-agent":"^2.2.3","lru-cache":"^5.1.1","mississippi":"^3.0.0","node-fetch-npm":"^2.0.2","promise-retry":"^1.1.1","socks-proxy-agent":"^4.0.0","ssri":"^6.0.0"}},"map-cache":{"version":"0.2.2","resolved":"https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz","integrity":"sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=","dev":true},"map-obj":{"version":"4.1.0","resolved":"https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz","integrity":"sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==","dev":true},"map-visit":{"version":"1.0.0","resolved":"https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz","integrity":"sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=","dev":true,"requires":{"object-visit":"^1.0.0"}},"md5.js":{"version":"1.3.5","resolved":"https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz","integrity":"sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==","requires":{"hash-base":"^3.0.0","inherits":"^2.0.1","safe-buffer":"^5.1.2"}},"memdown":{"version":"1.4.1","resolved":"https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz","integrity":"sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=","requires":{"abstract-leveldown":"~2.7.1","functional-red-black-tree":"^1.0.1","immediate":"^3.2.3","inherits":"~2.0.1","ltgt":"~2.2.0","safe-buffer":"~5.1.1"},"dependencies":{"abstract-leveldown":{"version":"2.7.2","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz","integrity":"sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==","requires":{"xtend":"~4.0.0"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"memorystream":{"version":"0.3.1","resolved":"https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz","integrity":"sha1-htcJCzDORV1j+64S3aUaR93K+bI=","dev":true},"meow":{"version":"7.1.1","resolved":"https://registry.npmjs.org/meow/-/meow-7.1.1.tgz","integrity":"sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==","dev":true,"requires":{"@types/minimist":"^1.2.0","camelcase-keys":"^6.2.2","decamelize-keys":"^1.1.0","hard-rejection":"^2.1.0","minimist-options":"4.1.0","normalize-package-data":"^2.5.0","read-pkg-up":"^7.0.1","redent":"^3.0.0","trim-newlines":"^3.0.0","type-fest":"^0.13.1","yargs-parser":"^18.1.3"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"parse-json":{"version":"5.1.0","resolved":"https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz","integrity":"sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==","dev":true,"requires":{"@babel/code-frame":"^7.0.0","error-ex":"^1.3.1","json-parse-even-better-errors":"^2.3.0","lines-and-columns":"^1.1.6"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"read-pkg":{"version":"5.2.0","resolved":"https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz","integrity":"sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==","dev":true,"requires":{"@types/normalize-package-data":"^2.4.0","normalize-package-data":"^2.5.0","parse-json":"^5.0.0","type-fest":"^0.6.0"},"dependencies":{"type-fest":{"version":"0.6.0","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz","integrity":"sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==","dev":true}}},"read-pkg-up":{"version":"7.0.1","resolved":"https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz","integrity":"sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==","dev":true,"requires":{"find-up":"^4.1.0","read-pkg":"^5.2.0","type-fest":"^0.8.1"},"dependencies":{"type-fest":{"version":"0.8.1","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz","integrity":"sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==","dev":true}}},"type-fest":{"version":"0.13.1","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz","integrity":"sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==","dev":true},"yargs-parser":{"version":"18.1.3","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz","integrity":"sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"}}}},"merge-stream":{"version":"2.0.0","resolved":"https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz","integrity":"sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==","dev":true},"merge2":{"version":"1.4.1","resolved":"https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz","integrity":"sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==","dev":true},"methods":{"version":"1.1.2","resolved":"https://registry.npmjs.org/methods/-/methods-1.1.2.tgz","integrity":"sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=","dev":true},"micromatch":{"version":"3.1.10","resolved":"https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz","integrity":"sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==","dev":true,"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"}},"miller-rabin":{"version":"4.0.1","resolved":"https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz","integrity":"sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==","requires":{"bn.js":"^4.0.0","brorand":"^1.0.1"}},"mime":{"version":"2.4.6","resolved":"https://registry.npmjs.org/mime/-/mime-2.4.6.tgz","integrity":"sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==","dev":true},"mime-db":{"version":"1.44.0","resolved":"https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz","integrity":"sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==","dev":true},"mime-types":{"version":"2.1.27","resolved":"https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz","integrity":"sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==","dev":true,"requires":{"mime-db":"1.44.0"}},"mimic-fn":{"version":"1.2.0","resolved":"https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz","integrity":"sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==","dev":true},"min-indent":{"version":"1.0.1","resolved":"https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz","integrity":"sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==","dev":true},"minimalistic-assert":{"version":"1.0.1","resolved":"https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz","integrity":"sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A=="},"minimalistic-crypto-utils":{"version":"1.0.1","resolved":"https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz","integrity":"sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo="},"minimatch":{"version":"3.0.4","resolved":"https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz","integrity":"sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==","requires":{"brace-expansion":"^1.1.7"}},"minimist":{"version":"1.2.5","resolved":"https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz","integrity":"sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==","dev":true},"minimist-options":{"version":"4.1.0","resolved":"https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz","integrity":"sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==","dev":true,"requires":{"arrify":"^1.0.1","is-plain-obj":"^1.1.0","kind-of":"^6.0.3"}},"minipass":{"version":"2.9.0","resolved":"https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz","integrity":"sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==","dev":true,"requires":{"safe-buffer":"^5.1.2","yallist":"^3.0.0"}},"minizlib":{"version":"1.3.3","resolved":"https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz","integrity":"sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==","dev":true,"requires":{"minipass":"^2.9.0"}},"mississippi":{"version":"3.0.0","resolved":"https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz","integrity":"sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==","dev":true,"requires":{"concat-stream":"^1.5.0","duplexify":"^3.4.2","end-of-stream":"^1.1.0","flush-write-stream":"^1.0.0","from2":"^2.1.0","parallel-transform":"^1.1.0","pump":"^3.0.0","pumpify":"^1.3.3","stream-each":"^1.1.0","through2":"^2.0.0"}},"mixin-deep":{"version":"1.3.2","resolved":"https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz","integrity":"sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==","dev":true,"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==","dev":true,"requires":{"is-plain-object":"^2.0.4"}}}},"mkdirp":{"version":"0.5.5","resolved":"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz","integrity":"sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==","dev":true,"requires":{"minimist":"^1.2.5"}},"mkdirp-promise":{"version":"5.0.1","resolved":"https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz","integrity":"sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=","dev":true,"requires":{"mkdirp":"*"}},"mocha":{"version":"8.2.0","resolved":"https://registry.npmjs.org/mocha/-/mocha-8.2.0.tgz","integrity":"sha512-lEWEMq2LMfNJMKeuEwb5UELi+OgFDollXaytR5ggQcHpzG3NP/R7rvixAvF+9/lLsTWhWG+4yD2M70GsM06nxw==","dev":true,"requires":{"@ungap/promise-all-settled":"1.1.2","ansi-colors":"4.1.1","browser-stdout":"1.3.1","chokidar":"3.4.3","debug":"4.2.0","diff":"4.0.2","escape-string-regexp":"4.0.0","find-up":"5.0.0","glob":"7.1.6","growl":"1.10.5","he":"1.2.0","js-yaml":"3.14.0","log-symbols":"4.0.0","minimatch":"3.0.4","ms":"2.1.2","nanoid":"3.1.12","serialize-javascript":"5.0.1","strip-json-comments":"3.1.1","supports-color":"7.2.0","which":"2.0.2","wide-align":"1.1.3","workerpool":"6.0.2","yargs":"13.3.2","yargs-parser":"13.1.2","yargs-unparser":"2.0.0"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true},"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}},"escape-string-regexp":{"version":"4.0.0","resolved":"https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz","integrity":"sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==","dev":true},"find-up":{"version":"5.0.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz","integrity":"sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==","dev":true,"requires":{"locate-path":"^6.0.0","path-exists":"^4.0.0"}},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"locate-path":{"version":"6.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz","integrity":"sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==","dev":true,"requires":{"p-locate":"^5.0.0"}},"p-limit":{"version":"3.0.2","resolved":"https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz","integrity":"sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==","dev":true,"requires":{"p-try":"^2.0.0"}},"p-locate":{"version":"5.0.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz","integrity":"sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==","dev":true,"requires":{"p-limit":"^3.0.2"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"string-width":{"version":"3.1.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz","integrity":"sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==","dev":true,"requires":{"emoji-regex":"^7.0.1","is-fullwidth-code-point":"^2.0.0","strip-ansi":"^5.1.0"}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"}},"yargs":{"version":"13.3.2","resolved":"https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz","integrity":"sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==","dev":true,"requires":{"cliui":"^5.0.0","find-up":"^3.0.0","get-caller-file":"^2.0.1","require-directory":"^2.1.1","require-main-filename":"^2.0.0","set-blocking":"^2.0.0","string-width":"^3.0.0","which-module":"^2.0.0","y18n":"^4.0.0","yargs-parser":"^13.1.2"},"dependencies":{"find-up":{"version":"3.0.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz","integrity":"sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==","dev":true,"requires":{"locate-path":"^3.0.0"}},"locate-path":{"version":"3.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz","integrity":"sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==","dev":true,"requires":{"p-locate":"^3.0.0","path-exists":"^3.0.0"}},"p-limit":{"version":"2.3.0","resolved":"https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz","integrity":"sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==","dev":true,"requires":{"p-try":"^2.0.0"}},"p-locate":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz","integrity":"sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==","dev":true,"requires":{"p-limit":"^2.0.0"}},"path-exists":{"version":"3.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz","integrity":"sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=","dev":true}}},"yargs-parser":{"version":"13.1.2","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz","integrity":"sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"}}}},"modify-values":{"version":"1.0.1","resolved":"https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz","integrity":"sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==","dev":true},"move-concurrently":{"version":"1.0.1","resolved":"https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz","integrity":"sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=","dev":true,"requires":{"aproba":"^1.1.1","copy-concurrently":"^1.0.0","fs-write-stream-atomic":"^1.0.8","mkdirp":"^0.5.1","rimraf":"^2.5.4","run-queue":"^1.0.3"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}}}},"mri":{"version":"1.1.6","resolved":"https://registry.npmjs.org/mri/-/mri-1.1.6.tgz","integrity":"sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==","dev":true},"ms":{"version":"2.1.2","resolved":"https://registry.npmjs.org/ms/-/ms-2.1.2.tgz","integrity":"sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==","dev":true},"multimatch":{"version":"3.0.0","resolved":"https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz","integrity":"sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==","dev":true,"requires":{"array-differ":"^2.0.3","array-union":"^1.0.2","arrify":"^1.0.1","minimatch":"^3.0.4"}},"mute-stream":{"version":"0.0.7","resolved":"https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz","integrity":"sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=","dev":true},"mz":{"version":"2.7.0","resolved":"https://registry.npmjs.org/mz/-/mz-2.7.0.tgz","integrity":"sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==","dev":true,"requires":{"any-promise":"^1.0.0","object-assign":"^4.0.1","thenify-all":"^1.0.0"}},"nanoid":{"version":"3.1.12","resolved":"https://registry.npmjs.org/nanoid/-/nanoid-3.1.12.tgz","integrity":"sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==","dev":true},"nanomatch":{"version":"1.2.13","resolved":"https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz","integrity":"sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==","dev":true,"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-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"}},"napi-macros":{"version":"2.0.0","resolved":"https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz","integrity":"sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg=="},"neo-async":{"version":"2.6.2","resolved":"https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz","integrity":"sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==","dev":true},"nice-try":{"version":"1.0.5","resolved":"https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz","integrity":"sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==","dev":true},"node-addon-api":{"version":"2.0.2","resolved":"https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz","integrity":"sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA=="},"node-fetch":{"version":"2.6.1","resolved":"https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz","integrity":"sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==","dev":true},"node-fetch-npm":{"version":"2.0.4","resolved":"https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz","integrity":"sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg==","dev":true,"requires":{"encoding":"^0.1.11","json-parse-better-errors":"^1.0.0","safe-buffer":"^5.1.1"}},"node-gyp":{"version":"5.1.1","resolved":"https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz","integrity":"sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw==","dev":true,"requires":{"env-paths":"^2.2.0","glob":"^7.1.4","graceful-fs":"^4.2.2","mkdirp":"^0.5.1","nopt":"^4.0.1","npmlog":"^4.1.2","request":"^2.88.0","rimraf":"^2.6.3","semver":"^5.7.1","tar":"^4.4.12","which":"^1.3.1"},"dependencies":{"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"which":{"version":"1.3.1","resolved":"https://registry.npmjs.org/which/-/which-1.3.1.tgz","integrity":"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==","dev":true,"requires":{"isexe":"^2.0.0"}}}},"node-gyp-build":{"version":"4.2.3","resolved":"https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz","integrity":"sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg=="},"node-preload":{"version":"0.2.1","resolved":"https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz","integrity":"sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==","dev":true,"requires":{"process-on-spawn":"^1.0.0"}},"nopt":{"version":"4.0.3","resolved":"https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz","integrity":"sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==","dev":true,"requires":{"abbrev":"1","osenv":"^0.1.4"}},"normalize-package-data":{"version":"2.5.0","resolved":"https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz","integrity":"sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==","dev":true,"requires":{"hosted-git-info":"^2.1.4","resolve":"^1.10.0","semver":"2 || 3 || 4 || 5","validate-npm-package-license":"^3.0.1"}},"normalize-path":{"version":"3.0.0","resolved":"https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz","integrity":"sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==","dev":true},"normalize-url":{"version":"3.3.0","resolved":"https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz","integrity":"sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==","dev":true},"npm-bundled":{"version":"1.1.1","resolved":"https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz","integrity":"sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==","dev":true,"requires":{"npm-normalize-package-bin":"^1.0.1"}},"npm-lifecycle":{"version":"3.1.5","resolved":"https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz","integrity":"sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g==","dev":true,"requires":{"byline":"^5.0.0","graceful-fs":"^4.1.15","node-gyp":"^5.0.2","resolve-from":"^4.0.0","slide":"^1.1.6","uid-number":"0.0.6","umask":"^1.1.0","which":"^1.3.1"},"dependencies":{"which":{"version":"1.3.1","resolved":"https://registry.npmjs.org/which/-/which-1.3.1.tgz","integrity":"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==","dev":true,"requires":{"isexe":"^2.0.0"}}}},"npm-normalize-package-bin":{"version":"1.0.1","resolved":"https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz","integrity":"sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==","dev":true},"npm-package-arg":{"version":"8.1.0","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.0.tgz","integrity":"sha512-/ep6QDxBkm9HvOhOg0heitSd7JHA1U7y1qhhlRlteYYAi9Pdb/ZV7FW5aHpkrpM8+P+4p/jjR8zCyKPBMBjSig==","dev":true,"requires":{"hosted-git-info":"^3.0.6","semver":"^7.0.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"hosted-git-info":{"version":"3.0.7","resolved":"https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz","integrity":"sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==","dev":true,"requires":{"lru-cache":"^6.0.0"}},"lru-cache":{"version":"6.0.0","resolved":"https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz","integrity":"sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==","dev":true,"requires":{"yallist":"^4.0.0"}},"semver":{"version":"7.3.2","resolved":"https://registry.npmjs.org/semver/-/semver-7.3.2.tgz","integrity":"sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==","dev":true},"yallist":{"version":"4.0.0","resolved":"https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz","integrity":"sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==","dev":true}}},"npm-packlist":{"version":"1.4.8","resolved":"https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz","integrity":"sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==","dev":true,"requires":{"ignore-walk":"^3.0.1","npm-bundled":"^1.0.1","npm-normalize-package-bin":"^1.0.1"}},"npm-pick-manifest":{"version":"3.0.2","resolved":"https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz","integrity":"sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==","dev":true,"requires":{"figgy-pudding":"^3.5.1","npm-package-arg":"^6.0.0","semver":"^5.4.1"},"dependencies":{"npm-package-arg":{"version":"6.1.1","resolved":"https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz","integrity":"sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==","dev":true,"requires":{"hosted-git-info":"^2.7.1","osenv":"^0.1.5","semver":"^5.6.0","validate-npm-package-name":"^3.0.0"},"dependencies":{"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}}}},"npm-run-path":{"version":"2.0.2","resolved":"https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz","integrity":"sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=","dev":true,"requires":{"path-key":"^2.0.0"},"dependencies":{"path-key":{"version":"2.0.1","resolved":"https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz","integrity":"sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=","dev":true}}},"npmlog":{"version":"4.1.2","resolved":"https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz","integrity":"sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==","dev":true,"requires":{"are-we-there-yet":"~1.1.2","console-control-strings":"~1.1.0","gauge":"~2.7.3","set-blocking":"~2.0.0"}},"number-is-nan":{"version":"1.0.1","resolved":"https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz","integrity":"sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=","dev":true},"nyc":{"version":"15.1.0","resolved":"https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz","integrity":"sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==","dev":true,"requires":{"@istanbuljs/load-nyc-config":"^1.0.0","@istanbuljs/schema":"^0.1.2","caching-transform":"^4.0.0","convert-source-map":"^1.7.0","decamelize":"^1.2.0","find-cache-dir":"^3.2.0","find-up":"^4.1.0","foreground-child":"^2.0.0","get-package-type":"^0.1.0","glob":"^7.1.6","istanbul-lib-coverage":"^3.0.0","istanbul-lib-hook":"^3.0.0","istanbul-lib-instrument":"^4.0.0","istanbul-lib-processinfo":"^2.0.2","istanbul-lib-report":"^3.0.0","istanbul-lib-source-maps":"^4.0.0","istanbul-reports":"^3.0.2","make-dir":"^3.0.0","node-preload":"^0.2.1","p-map":"^3.0.0","process-on-spawn":"^1.0.0","resolve-from":"^5.0.0","rimraf":"^3.0.0","signal-exit":"^3.0.2","spawn-wrap":"^2.0.0","test-exclude":"^6.0.0","yargs":"^15.0.2"},"dependencies":{"ansi-regex":{"version":"5.0.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz","integrity":"sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==","dev":true},"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true},"cliui":{"version":"6.0.0","resolved":"https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz","integrity":"sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==","dev":true,"requires":{"string-width":"^4.2.0","strip-ansi":"^6.0.0","wrap-ansi":"^6.2.0"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true},"emoji-regex":{"version":"8.0.0","resolved":"https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz","integrity":"sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==","dev":true},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"is-fullwidth-code-point":{"version":"3.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz","integrity":"sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==","dev":true},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"p-map":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz","integrity":"sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==","dev":true,"requires":{"aggregate-error":"^3.0.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true},"resolve-from":{"version":"5.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz","integrity":"sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==","dev":true},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true},"string-width":{"version":"4.2.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz","integrity":"sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==","dev":true,"requires":{"emoji-regex":"^8.0.0","is-fullwidth-code-point":"^3.0.0","strip-ansi":"^6.0.0"}},"strip-ansi":{"version":"6.0.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz","integrity":"sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==","dev":true,"requires":{"ansi-regex":"^5.0.0"}},"wrap-ansi":{"version":"6.2.0","resolved":"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz","integrity":"sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==","dev":true,"requires":{"ansi-styles":"^4.0.0","string-width":"^4.1.0","strip-ansi":"^6.0.0"}},"yargs":{"version":"15.4.1","resolved":"https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz","integrity":"sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==","dev":true,"requires":{"cliui":"^6.0.0","decamelize":"^1.2.0","find-up":"^4.1.0","get-caller-file":"^2.0.1","require-directory":"^2.1.1","require-main-filename":"^2.0.0","set-blocking":"^2.0.0","string-width":"^4.2.0","which-module":"^2.0.0","y18n":"^4.0.0","yargs-parser":"^18.1.2"}},"yargs-parser":{"version":"18.1.3","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz","integrity":"sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"}}}},"oauth-sign":{"version":"0.9.0","resolved":"https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz","integrity":"sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==","dev":true},"object-assign":{"version":"4.1.1","resolved":"https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz","integrity":"sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=","dev":true},"object-copy":{"version":"0.1.0","resolved":"https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz","integrity":"sha1-fn2Fi3gb18mRpBupde04EnVOmYw=","dev":true,"requires":{"copy-descriptor":"^0.1.0","define-property":"^0.2.5","kind-of":"^3.0.3"},"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=","dev":true,"requires":{"is-descriptor":"^0.1.0"}},"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"}}}},"object-inspect":{"version":"1.8.0","resolved":"https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz","integrity":"sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA=="},"object-keys":{"version":"0.4.0","resolved":"https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz","integrity":"sha1-KKaq50KN0sOpLz2V8hM13SBOAzY="},"object-visit":{"version":"1.0.1","resolved":"https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz","integrity":"sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=","dev":true,"requires":{"isobject":"^3.0.0"}},"object.assign":{"version":"4.1.1","resolved":"https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz","integrity":"sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.18.0-next.0","has-symbols":"^1.0.1","object-keys":"^1.1.1"},"dependencies":{"es-abstract":{"version":"1.18.0-next.0","resolved":"https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz","integrity":"sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==","requires":{"es-to-primitive":"^1.2.1","function-bind":"^1.1.1","has":"^1.0.3","has-symbols":"^1.0.1","is-callable":"^1.2.0","is-negative-zero":"^2.0.0","is-regex":"^1.1.1","object-inspect":"^1.8.0","object-keys":"^1.1.1","object.assign":"^4.1.0","string.prototype.trimend":"^1.0.1","string.prototype.trimstart":"^1.0.1"}},"object-keys":{"version":"1.1.1","resolved":"https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz","integrity":"sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="}}},"object.getownpropertydescriptors":{"version":"2.1.0","resolved":"https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz","integrity":"sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.17.0-next.1"}},"object.pick":{"version":"1.3.0","resolved":"https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz","integrity":"sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=","dev":true,"requires":{"isobject":"^3.0.1"}},"octokit-pagination-methods":{"version":"1.1.0","resolved":"https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz","integrity":"sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==","dev":true},"once":{"version":"1.4.0","resolved":"https://registry.npmjs.org/once/-/once-1.4.0.tgz","integrity":"sha1-WDsap3WWHUsROsF9nFC6753Xa9E=","requires":{"wrappy":"1"}},"onetime":{"version":"2.0.1","resolved":"https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz","integrity":"sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=","dev":true,"requires":{"mimic-fn":"^1.0.0"}},"opencollective-postinstall":{"version":"2.0.3","resolved":"https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz","integrity":"sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==","dev":true},"os-homedir":{"version":"1.0.2","resolved":"https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz","integrity":"sha1-/7xJiDNuDoM94MFox+8VISGqf7M=","dev":true},"os-name":{"version":"3.1.0","resolved":"https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz","integrity":"sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==","dev":true,"requires":{"macos-release":"^2.2.0","windows-release":"^3.1.0"}},"os-tmpdir":{"version":"1.0.2","resolved":"https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz","integrity":"sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=","dev":true},"osenv":{"version":"0.1.5","resolved":"https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz","integrity":"sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==","dev":true,"requires":{"os-homedir":"^1.0.0","os-tmpdir":"^1.0.0"}},"p-finally":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz","integrity":"sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=","dev":true},"p-is-promise":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz","integrity":"sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==","dev":true},"p-limit":{"version":"2.3.0","resolved":"https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz","integrity":"sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==","dev":true,"requires":{"p-try":"^2.0.0"}},"p-locate":{"version":"3.0.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz","integrity":"sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==","dev":true,"requires":{"p-limit":"^2.0.0"}},"p-map":{"version":"2.1.0","resolved":"https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz","integrity":"sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==","dev":true},"p-map-series":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-map-series/-/p-map-series-1.0.0.tgz","integrity":"sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco=","dev":true,"requires":{"p-reduce":"^1.0.0"}},"p-pipe":{"version":"1.2.0","resolved":"https://registry.npmjs.org/p-pipe/-/p-pipe-1.2.0.tgz","integrity":"sha1-SxoROZoRUgpneQ7loMHViB1r7+k=","dev":true},"p-queue":{"version":"4.0.0","resolved":"https://registry.npmjs.org/p-queue/-/p-queue-4.0.0.tgz","integrity":"sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg==","dev":true,"requires":{"eventemitter3":"^3.1.0"}},"p-reduce":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz","integrity":"sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=","dev":true},"p-try":{"version":"2.2.0","resolved":"https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz","integrity":"sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==","dev":true},"p-waterfall":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-waterfall/-/p-waterfall-1.0.0.tgz","integrity":"sha1-ftlLPOszMngjU69qrhGqn8I1uwA=","dev":true,"requires":{"p-reduce":"^1.0.0"}},"package-hash":{"version":"4.0.0","resolved":"https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz","integrity":"sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==","dev":true,"requires":{"graceful-fs":"^4.1.15","hasha":"^5.0.0","lodash.flattendeep":"^4.4.0","release-zalgo":"^1.0.0"}},"parallel-transform":{"version":"1.2.0","resolved":"https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz","integrity":"sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==","dev":true,"requires":{"cyclist":"^1.0.1","inherits":"^2.0.3","readable-stream":"^2.1.5"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}}}},"parent-module":{"version":"1.0.1","resolved":"https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz","integrity":"sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==","dev":true,"requires":{"callsites":"^3.0.0"},"dependencies":{"callsites":{"version":"3.1.0","resolved":"https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz","integrity":"sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==","dev":true}}},"parse-git-config":{"version":"1.1.1","resolved":"https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz","integrity":"sha1-06mYQxcTL1c5hxK7pDjhKVkN34w=","dev":true,"requires":{"extend-shallow":"^2.0.1","fs-exists-sync":"^0.1.0","git-config-path":"^1.0.1","ini":"^1.3.4"},"dependencies":{"extend-shallow":{"version":"2.0.1","resolved":"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz","integrity":"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"parse-github-repo-url":{"version":"1.4.1","resolved":"https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz","integrity":"sha1-nn2LslKmy2ukJZUGC3v23z28H1A=","dev":true},"parse-json":{"version":"4.0.0","resolved":"https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz","integrity":"sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=","dev":true,"requires":{"error-ex":"^1.3.1","json-parse-better-errors":"^1.0.1"}},"parse-passwd":{"version":"1.0.0","resolved":"https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz","integrity":"sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=","dev":true},"parse-path":{"version":"4.0.2","resolved":"https://registry.npmjs.org/parse-path/-/parse-path-4.0.2.tgz","integrity":"sha512-HSqVz6iuXSiL8C1ku5Gl1Z5cwDd9Wo0q8CoffdAghP6bz8pJa1tcMC+m4N+z6VAS8QdksnIGq1TB6EgR4vPR6w==","dev":true,"requires":{"is-ssh":"^1.3.0","protocols":"^1.4.0"}},"parse-url":{"version":"5.0.2","resolved":"https://registry.npmjs.org/parse-url/-/parse-url-5.0.2.tgz","integrity":"sha512-Czj+GIit4cdWtxo3ISZCvLiUjErSo0iI3wJ+q9Oi3QuMYTI6OZu+7cewMWZ+C1YAnKhYTk6/TLuhIgCypLthPA==","dev":true,"requires":{"is-ssh":"^1.3.0","normalize-url":"^3.3.0","parse-path":"^4.0.0","protocols":"^1.4.0"}},"parse5":{"version":"5.1.1","resolved":"https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz","integrity":"sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==","dev":true},"parse5-htmlparser2-tree-adapter":{"version":"5.1.1","resolved":"https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz","integrity":"sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw==","dev":true,"requires":{"parse5":"^5.1.1"}},"pascalcase":{"version":"0.1.1","resolved":"https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz","integrity":"sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=","dev":true},"path-dirname":{"version":"1.0.2","resolved":"https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz","integrity":"sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=","dev":true},"path-exists":{"version":"3.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz","integrity":"sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=","dev":true},"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-key":{"version":"3.1.1","resolved":"https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz","integrity":"sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==","dev":true},"path-parse":{"version":"1.0.6","resolved":"https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz","integrity":"sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==","dev":true},"path-type":{"version":"3.0.0","resolved":"https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz","integrity":"sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==","dev":true,"requires":{"pify":"^3.0.0"},"dependencies":{"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true}}},"pbkdf2":{"version":"3.1.1","resolved":"https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz","integrity":"sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==","requires":{"create-hash":"^1.1.2","create-hmac":"^1.1.4","ripemd160":"^2.0.1","safe-buffer":"^5.0.1","sha.js":"^2.4.8"}},"performance-now":{"version":"2.1.0","resolved":"https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz","integrity":"sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=","dev":true},"picomatch":{"version":"2.2.2","resolved":"https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz","integrity":"sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==","dev":true},"pify":{"version":"4.0.1","resolved":"https://registry.npmjs.org/pify/-/pify-4.0.1.tgz","integrity":"sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==","dev":true},"pinkie":{"version":"2.0.4","resolved":"https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz","integrity":"sha1-clVrgM+g1IqXToDnckjoDtT3+HA=","dev":true},"pinkie-promise":{"version":"2.0.1","resolved":"https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz","integrity":"sha1-ITXW36ejWMBprJsXh3YogihFD/o=","dev":true,"requires":{"pinkie":"^2.0.0"}},"pkg-dir":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz","integrity":"sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==","dev":true,"requires":{"find-up":"^3.0.0"}},"please-upgrade-node":{"version":"3.2.0","resolved":"https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz","integrity":"sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==","dev":true,"requires":{"semver-compare":"^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=","dev":true},"prettier":{"version":"2.1.2","resolved":"https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz","integrity":"sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==","dev":true},"pretty-quick":{"version":"3.1.0","resolved":"https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.1.0.tgz","integrity":"sha512-DtxIxksaUWCgPFN7E1ZZk4+Aav3CCuRdhrDSFZENb404sYMtuo9Zka823F+Mgeyt8Zt3bUiCjFzzWYE9LYqkmQ==","dev":true,"requires":{"chalk":"^3.0.0","execa":"^4.0.0","find-up":"^4.1.0","ignore":"^5.1.4","mri":"^1.1.5","multimatch":"^4.0.0"},"dependencies":{"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"array-differ":{"version":"3.0.0","resolved":"https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz","integrity":"sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==","dev":true},"array-union":{"version":"2.1.0","resolved":"https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz","integrity":"sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==","dev":true},"arrify":{"version":"2.0.1","resolved":"https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz","integrity":"sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==","dev":true},"chalk":{"version":"3.0.0","resolved":"https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz","integrity":"sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==","dev":true,"requires":{"ansi-styles":"^4.1.0","supports-color":"^7.1.0"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true},"execa":{"version":"4.1.0","resolved":"https://registry.npmjs.org/execa/-/execa-4.1.0.tgz","integrity":"sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==","dev":true,"requires":{"cross-spawn":"^7.0.0","get-stream":"^5.0.0","human-signals":"^1.1.1","is-stream":"^2.0.0","merge-stream":"^2.0.0","npm-run-path":"^4.0.0","onetime":"^5.1.0","signal-exit":"^3.0.2","strip-final-newline":"^2.0.0"}},"find-up":{"version":"4.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz","integrity":"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==","dev":true,"requires":{"locate-path":"^5.0.0","path-exists":"^4.0.0"}},"get-stream":{"version":"5.2.0","resolved":"https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz","integrity":"sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==","dev":true,"requires":{"pump":"^3.0.0"}},"ignore":{"version":"5.1.8","resolved":"https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz","integrity":"sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==","dev":true},"is-stream":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz","integrity":"sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==","dev":true},"locate-path":{"version":"5.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz","integrity":"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==","dev":true,"requires":{"p-locate":"^4.1.0"}},"mimic-fn":{"version":"2.1.0","resolved":"https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz","integrity":"sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==","dev":true},"multimatch":{"version":"4.0.0","resolved":"https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz","integrity":"sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==","dev":true,"requires":{"@types/minimatch":"^3.0.3","array-differ":"^3.0.0","array-union":"^2.1.0","arrify":"^2.0.1","minimatch":"^3.0.4"}},"npm-run-path":{"version":"4.0.1","resolved":"https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz","integrity":"sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==","dev":true,"requires":{"path-key":"^3.0.0"}},"onetime":{"version":"5.1.2","resolved":"https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz","integrity":"sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==","dev":true,"requires":{"mimic-fn":"^2.1.0"}},"p-locate":{"version":"4.1.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz","integrity":"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==","dev":true,"requires":{"p-limit":"^2.2.0"}},"path-exists":{"version":"4.0.0","resolved":"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz","integrity":"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev":true}}},"process-nextick-args":{"version":"2.0.1","resolved":"https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz","integrity":"sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="},"process-on-spawn":{"version":"1.0.0","resolved":"https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz","integrity":"sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==","dev":true,"requires":{"fromentries":"^1.2.0"}},"promise-inflight":{"version":"1.0.1","resolved":"https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz","integrity":"sha1-mEcocL8igTL8vdhoEputEsPAKeM=","dev":true},"promise-retry":{"version":"1.1.1","resolved":"https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz","integrity":"sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=","dev":true,"requires":{"err-code":"^1.0.0","retry":"^0.10.0"}},"promzard":{"version":"0.3.0","resolved":"https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz","integrity":"sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=","dev":true,"requires":{"read":"1"}},"proto-list":{"version":"1.2.4","resolved":"https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz","integrity":"sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=","dev":true},"protocols":{"version":"1.4.8","resolved":"https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz","integrity":"sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg==","dev":true},"protoduck":{"version":"5.0.1","resolved":"https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz","integrity":"sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==","dev":true,"requires":{"genfun":"^5.0.0"}},"prr":{"version":"1.0.1","resolved":"https://registry.npmjs.org/prr/-/prr-1.0.1.tgz","integrity":"sha1-0/wRS6BplaRexok/SEzrHXj19HY="},"psl":{"version":"1.8.0","resolved":"https://registry.npmjs.org/psl/-/psl-1.8.0.tgz","integrity":"sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==","dev":true},"pump":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pump/-/pump-3.0.0.tgz","integrity":"sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==","dev":true,"requires":{"end-of-stream":"^1.1.0","once":"^1.3.1"}},"pumpify":{"version":"1.5.1","resolved":"https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz","integrity":"sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==","dev":true,"requires":{"duplexify":"^3.6.0","inherits":"^2.0.3","pump":"^2.0.0"},"dependencies":{"pump":{"version":"2.0.1","resolved":"https://registry.npmjs.org/pump/-/pump-2.0.1.tgz","integrity":"sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==","dev":true,"requires":{"end-of-stream":"^1.1.0","once":"^1.3.1"}}}},"punycode":{"version":"2.1.1","resolved":"https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz","integrity":"sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==","dev":true},"q":{"version":"1.5.1","resolved":"https://registry.npmjs.org/q/-/q-1.5.1.tgz","integrity":"sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=","dev":true},"qs":{"version":"6.5.2","resolved":"https://registry.npmjs.org/qs/-/qs-6.5.2.tgz","integrity":"sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==","dev":true},"quick-lru":{"version":"4.0.1","resolved":"https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz","integrity":"sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==","dev":true},"randombytes":{"version":"2.1.0","resolved":"https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz","integrity":"sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==","requires":{"safe-buffer":"^5.1.0"}},"reachdown":{"version":"1.1.0","resolved":"https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz","integrity":"sha512-6LsdRe4cZyOjw4NnvbhUd/rGG7WQ9HMopPr+kyL018Uci4kijtxcGR5kVb5Ln13k4PEE+fEFQbjfOvNw7cnXmA=="},"read":{"version":"1.0.7","resolved":"https://registry.npmjs.org/read/-/read-1.0.7.tgz","integrity":"sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=","dev":true,"requires":{"mute-stream":"~0.0.4"}},"read-cmd-shim":{"version":"1.0.5","resolved":"https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz","integrity":"sha512-v5yCqQ/7okKoZZkBQUAfTsQ3sVJtXdNfbPnI5cceppoxEVLYA3k+VtV2omkeo8MS94JCy4fSiUwlRBAwCVRPUA==","dev":true,"requires":{"graceful-fs":"^4.1.2"}},"read-package-json":{"version":"2.1.2","resolved":"https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz","integrity":"sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==","dev":true,"requires":{"glob":"^7.1.1","json-parse-even-better-errors":"^2.3.0","normalize-package-data":"^2.0.0","npm-normalize-package-bin":"^1.0.0"}},"read-package-tree":{"version":"5.3.1","resolved":"https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz","integrity":"sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==","dev":true,"requires":{"read-package-json":"^2.0.0","readdir-scoped-modules":"^1.0.0","util-promisify":"^2.1.0"}},"read-pkg":{"version":"3.0.0","resolved":"https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz","integrity":"sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=","dev":true,"requires":{"load-json-file":"^4.0.0","normalize-package-data":"^2.3.2","path-type":"^3.0.0"},"dependencies":{"load-json-file":{"version":"4.0.0","resolved":"https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz","integrity":"sha1-L19Fq5HjMhYjT9U62rZo607AmTs=","dev":true,"requires":{"graceful-fs":"^4.1.2","parse-json":"^4.0.0","pify":"^3.0.0","strip-bom":"^3.0.0"}},"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true}}},"read-pkg-up":{"version":"3.0.0","resolved":"https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz","integrity":"sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=","dev":true,"requires":{"find-up":"^2.0.0","read-pkg":"^3.0.0"},"dependencies":{"find-up":{"version":"2.1.0","resolved":"https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz","integrity":"sha1-RdG35QbHF93UgndaK3eSCjwMV6c=","dev":true,"requires":{"locate-path":"^2.0.0"}},"locate-path":{"version":"2.0.0","resolved":"https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz","integrity":"sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=","dev":true,"requires":{"p-locate":"^2.0.0","path-exists":"^3.0.0"}},"p-limit":{"version":"1.3.0","resolved":"https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz","integrity":"sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==","dev":true,"requires":{"p-try":"^1.0.0"}},"p-locate":{"version":"2.0.0","resolved":"https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz","integrity":"sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=","dev":true,"requires":{"p-limit":"^1.1.0"}},"p-try":{"version":"1.0.0","resolved":"https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz","integrity":"sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=","dev":true}}},"readable-stream":{"version":"3.6.0","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz","integrity":"sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==","requires":{"inherits":"^2.0.3","string_decoder":"^1.1.1","util-deprecate":"^1.0.1"}},"readdir-scoped-modules":{"version":"1.1.0","resolved":"https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz","integrity":"sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==","dev":true,"requires":{"debuglog":"^1.0.1","dezalgo":"^1.0.0","graceful-fs":"^4.1.2","once":"^1.3.0"}},"readdirp":{"version":"3.5.0","resolved":"https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz","integrity":"sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==","dev":true,"requires":{"picomatch":"^2.2.1"}},"rechoir":{"version":"0.6.2","resolved":"https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz","integrity":"sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=","dev":true,"requires":{"resolve":"^1.1.6"}},"redent":{"version":"3.0.0","resolved":"https://registry.npmjs.org/redent/-/redent-3.0.0.tgz","integrity":"sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==","dev":true,"requires":{"indent-string":"^4.0.0","strip-indent":"^3.0.0"}},"regex-not":{"version":"1.0.2","resolved":"https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz","integrity":"sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==","dev":true,"requires":{"extend-shallow":"^3.0.2","safe-regex":"^1.1.0"}},"release-zalgo":{"version":"1.0.0","resolved":"https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz","integrity":"sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=","dev":true,"requires":{"es6-error":"^4.0.1"}},"repeat-element":{"version":"1.1.3","resolved":"https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz","integrity":"sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==","dev":true},"repeat-string":{"version":"1.6.1","resolved":"https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz","integrity":"sha1-jcrkcOHIirwtYA//Sndihtp15jc=","dev":true},"repeating":{"version":"2.0.1","resolved":"https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz","integrity":"sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=","dev":true,"requires":{"is-finite":"^1.0.0"}},"request":{"version":"2.88.2","resolved":"https://registry.npmjs.org/request/-/request-2.88.2.tgz","integrity":"sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==","dev":true,"requires":{"aws-sign2":"~0.7.0","aws4":"^1.8.0","caseless":"~0.12.0","combined-stream":"~1.0.6","extend":"~3.0.2","forever-agent":"~0.6.1","form-data":"~2.3.2","har-validator":"~5.1.3","http-signature":"~1.2.0","is-typedarray":"~1.0.0","isstream":"~0.1.2","json-stringify-safe":"~5.0.1","mime-types":"~2.1.19","oauth-sign":"~0.9.0","performance-now":"^2.1.0","qs":"~6.5.2","safe-buffer":"^5.1.2","tough-cookie":"~2.5.0","tunnel-agent":"^0.6.0","uuid":"^3.3.2"}},"require-directory":{"version":"2.1.1","resolved":"https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz","integrity":"sha1-jGStX9MNqxyXbiNE/+f3kqam30I=","dev":true},"require-from-string":{"version":"2.0.2","resolved":"https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz","integrity":"sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==","dev":true},"require-main-filename":{"version":"2.0.0","resolved":"https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz","integrity":"sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==","dev":true},"resolve":{"version":"1.17.0","resolved":"https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz","integrity":"sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==","dev":true,"requires":{"path-parse":"^1.0.6"}},"resolve-cwd":{"version":"2.0.0","resolved":"https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz","integrity":"sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=","dev":true,"requires":{"resolve-from":"^3.0.0"},"dependencies":{"resolve-from":{"version":"3.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz","integrity":"sha1-six699nWiBvItuZTM17rywoYh0g=","dev":true}}},"resolve-from":{"version":"4.0.0","resolved":"https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz","integrity":"sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==","dev":true},"resolve-url":{"version":"0.2.1","resolved":"https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz","integrity":"sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=","dev":true},"restore-cursor":{"version":"2.0.0","resolved":"https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz","integrity":"sha1-n37ih/gv0ybU/RYpI9YhKe7g368=","dev":true,"requires":{"onetime":"^2.0.0","signal-exit":"^3.0.2"}},"ret":{"version":"0.1.15","resolved":"https://registry.npmjs.org/ret/-/ret-0.1.15.tgz","integrity":"sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==","dev":true},"retry":{"version":"0.10.1","resolved":"https://registry.npmjs.org/retry/-/retry-0.10.1.tgz","integrity":"sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=","dev":true},"reusify":{"version":"1.0.4","resolved":"https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz","integrity":"sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==","dev":true},"rimraf":{"version":"3.0.2","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz","integrity":"sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==","requires":{"glob":"^7.1.3"}},"ripemd160":{"version":"2.0.2","resolved":"https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz","integrity":"sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==","requires":{"hash-base":"^3.0.0","inherits":"^2.0.1"}},"rlp":{"version":"2.2.6","resolved":"https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz","integrity":"sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==","requires":{"bn.js":"^4.11.1"}},"run-async":{"version":"2.4.1","resolved":"https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz","integrity":"sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==","dev":true},"run-parallel":{"version":"1.1.9","resolved":"https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz","integrity":"sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==","dev":true},"run-queue":{"version":"1.0.3","resolved":"https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz","integrity":"sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=","dev":true,"requires":{"aproba":"^1.1.1"}},"rustbn.js":{"version":"0.2.0","resolved":"https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz","integrity":"sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA=="},"rxjs":{"version":"6.6.3","resolved":"https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz","integrity":"sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==","dev":true,"requires":{"tslib":"^1.9.0"}},"safe-buffer":{"version":"5.2.1","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz","integrity":"sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="},"safe-regex":{"version":"1.1.0","resolved":"https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz","integrity":"sha1-QKNmnzsHfR6UPURinhV91IAjvy4=","dev":true,"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==","dev":true},"scrypt-js":{"version":"3.0.1","resolved":"https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz","integrity":"sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA=="},"secp256k1":{"version":"4.0.2","resolved":"https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz","integrity":"sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==","requires":{"elliptic":"^6.5.2","node-addon-api":"^2.0.0","node-gyp-build":"^4.2.0"}},"seedrandom":{"version":"3.0.5","resolved":"https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz","integrity":"sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="},"semaphore":{"version":"1.1.0","resolved":"https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz","integrity":"sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA=="},"semver":{"version":"5.4.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.4.1.tgz","integrity":"sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg=="},"semver-compare":{"version":"1.0.0","resolved":"https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz","integrity":"sha1-De4hahyUGrN+nvsXiPavxf9VN/w=","dev":true},"semver-regex":{"version":"2.0.0","resolved":"https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz","integrity":"sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==","dev":true},"serialize-javascript":{"version":"5.0.1","resolved":"https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz","integrity":"sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==","dev":true,"requires":{"randombytes":"^2.1.0"}},"set-blocking":{"version":"2.0.0","resolved":"https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz","integrity":"sha1-BF+XgtARrppoA93TgrJDkrPYkPc=","dev":true},"set-value":{"version":"2.0.1","resolved":"https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz","integrity":"sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==","dev":true,"requires":{"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}}}},"setimmediate":{"version":"1.0.5","resolved":"https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz","integrity":"sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="},"sha.js":{"version":"2.4.11","resolved":"https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz","integrity":"sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==","requires":{"inherits":"^2.0.1","safe-buffer":"^5.0.1"}},"shallow-clone":{"version":"3.0.1","resolved":"https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz","integrity":"sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==","dev":true,"requires":{"kind-of":"^6.0.2"}},"shebang-command":{"version":"2.0.0","resolved":"https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz","integrity":"sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==","dev":true,"requires":{"shebang-regex":"^3.0.0"}},"shebang-regex":{"version":"3.0.0","resolved":"https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz","integrity":"sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==","dev":true},"shelljs":{"version":"0.8.4","resolved":"https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz","integrity":"sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==","dev":true,"requires":{"glob":"^7.0.0","interpret":"^1.0.0","rechoir":"^0.6.2"}},"shx":{"version":"0.3.3","resolved":"https://registry.npmjs.org/shx/-/shx-0.3.3.tgz","integrity":"sha512-nZJ3HFWVoTSyyB+evEKjJ1STiixGztlqwKLTUNV5KqMWtGey9fTd4KU1gdZ1X9BV6215pswQ/Jew9NsuS/fNDA==","dev":true,"requires":{"minimist":"^1.2.3","shelljs":"^0.8.4"}},"signal-exit":{"version":"3.0.3","resolved":"https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz","integrity":"sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==","dev":true},"slash":{"version":"2.0.0","resolved":"https://registry.npmjs.org/slash/-/slash-2.0.0.tgz","integrity":"sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==","dev":true},"slide":{"version":"1.1.6","resolved":"https://registry.npmjs.org/slide/-/slide-1.1.6.tgz","integrity":"sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=","dev":true},"smart-buffer":{"version":"4.1.0","resolved":"https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz","integrity":"sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==","dev":true},"snapdragon":{"version":"0.8.2","resolved":"https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz","integrity":"sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==","dev":true,"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":{"debug":{"version":"2.6.9","resolved":"https://registry.npmjs.org/debug/-/debug-2.6.9.tgz","integrity":"sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==","dev":true,"requires":{"ms":"2.0.0"}},"define-property":{"version":"0.2.5","resolved":"https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz","integrity":"sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=","dev":true,"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=","dev":true,"requires":{"is-extendable":"^0.1.0"}},"ms":{"version":"2.0.0","resolved":"https://registry.npmjs.org/ms/-/ms-2.0.0.tgz","integrity":"sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=","dev":true}}},"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==","dev":true,"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=","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"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==","dev":true,"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=","dev":true,"requires":{"is-buffer":"^1.1.5"}}}},"socks":{"version":"2.3.3","resolved":"https://registry.npmjs.org/socks/-/socks-2.3.3.tgz","integrity":"sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==","dev":true,"requires":{"ip":"1.1.5","smart-buffer":"^4.1.0"}},"socks-proxy-agent":{"version":"4.0.2","resolved":"https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz","integrity":"sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==","dev":true,"requires":{"agent-base":"~4.2.1","socks":"~2.3.2"},"dependencies":{"agent-base":{"version":"4.2.1","resolved":"https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz","integrity":"sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==","dev":true,"requires":{"es6-promisify":"^5.0.0"}}}},"solc":{"version":"0.7.4","resolved":"https://registry.npmjs.org/solc/-/solc-0.7.4.tgz","integrity":"sha512-IVLqAfUkJqgTS0JIgFPeC50ehUeBXu2eE+iU+rqb6UeOyf6w/BB/EsNcTSTpjtUti8BTG/sCd2qVhrWVYy7p0g==","dev":true,"requires":{"command-exists":"^1.2.8","commander":"3.0.2","follow-redirects":"^1.12.1","fs-extra":"^0.30.0","js-sha3":"0.8.0","memorystream":"^0.3.1","require-from-string":"^2.0.0","semver":"^5.5.0","tmp":"0.0.33"},"dependencies":{"fs-extra":{"version":"0.30.0","resolved":"https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz","integrity":"sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=","dev":true,"requires":{"graceful-fs":"^4.1.2","jsonfile":"^2.1.0","klaw":"^1.0.0","path-is-absolute":"^1.0.0","rimraf":"^2.2.8"}},"jsonfile":{"version":"2.4.0","resolved":"https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz","integrity":"sha1-NzaitCi4e72gzIO1P6PWM6NcKug=","dev":true,"requires":{"graceful-fs":"^4.1.6"}},"rimraf":{"version":"2.7.1","resolved":"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz","integrity":"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==","dev":true,"requires":{"glob":"^7.1.3"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true},"tmp":{"version":"0.0.33","resolved":"https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz","integrity":"sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==","dev":true,"requires":{"os-tmpdir":"~1.0.2"}}}},"sort-keys":{"version":"2.0.0","resolved":"https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz","integrity":"sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=","dev":true,"requires":{"is-plain-obj":"^1.0.0"}},"source-map":{"version":"0.5.7","resolved":"https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz","integrity":"sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=","dev":true},"source-map-resolve":{"version":"0.5.3","resolved":"https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz","integrity":"sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==","dev":true,"requires":{"atob":"^2.1.2","decode-uri-component":"^0.2.0","resolve-url":"^0.2.1","source-map-url":"^0.4.0","urix":"^0.1.0"}},"source-map-support":{"version":"0.5.19","resolved":"https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz","integrity":"sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==","dev":true,"requires":{"buffer-from":"^1.0.0","source-map":"^0.6.0"},"dependencies":{"source-map":{"version":"0.6.1","resolved":"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz","integrity":"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==","dev":true}}},"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=","dev":true},"spawn-wrap":{"version":"2.0.0","resolved":"https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz","integrity":"sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==","dev":true,"requires":{"foreground-child":"^2.0.0","is-windows":"^1.0.2","make-dir":"^3.0.0","rimraf":"^3.0.0","signal-exit":"^3.0.2","which":"^2.0.1"},"dependencies":{"make-dir":{"version":"3.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz","integrity":"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==","dev":true,"requires":{"semver":"^6.0.0"}},"semver":{"version":"6.3.0","resolved":"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz","integrity":"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==","dev":true}}},"spdx-correct":{"version":"3.1.1","resolved":"https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz","integrity":"sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==","dev":true,"requires":{"spdx-expression-parse":"^3.0.0","spdx-license-ids":"^3.0.0"}},"spdx-exceptions":{"version":"2.3.0","resolved":"https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz","integrity":"sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==","dev":true},"spdx-expression-parse":{"version":"3.0.1","resolved":"https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz","integrity":"sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==","dev":true,"requires":{"spdx-exceptions":"^2.1.0","spdx-license-ids":"^3.0.0"}},"spdx-license-ids":{"version":"3.0.6","resolved":"https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz","integrity":"sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==","dev":true},"split":{"version":"1.0.1","resolved":"https://registry.npmjs.org/split/-/split-1.0.1.tgz","integrity":"sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==","dev":true,"requires":{"through":"2"}},"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==","dev":true,"requires":{"extend-shallow":"^3.0.0"}},"split2":{"version":"2.2.0","resolved":"https://registry.npmjs.org/split2/-/split2-2.2.0.tgz","integrity":"sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==","dev":true,"requires":{"through2":"^2.0.2"}},"sprintf-js":{"version":"1.0.3","resolved":"https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz","integrity":"sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=","dev":true},"sshpk":{"version":"1.16.1","resolved":"https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz","integrity":"sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==","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","safer-buffer":"^2.0.2","tweetnacl":"~0.14.0"}},"ssri":{"version":"6.0.1","resolved":"https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz","integrity":"sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==","dev":true,"requires":{"figgy-pudding":"^3.5.1"}},"static-extend":{"version":"0.1.2","resolved":"https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz","integrity":"sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=","dev":true,"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=","dev":true,"requires":{"is-descriptor":"^0.1.0"}}}},"stream-each":{"version":"1.2.3","resolved":"https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz","integrity":"sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==","dev":true,"requires":{"end-of-stream":"^1.1.0","stream-shift":"^1.0.0"}},"stream-shift":{"version":"1.0.1","resolved":"https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz","integrity":"sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==","dev":true},"string-width":{"version":"1.0.2","resolved":"https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz","integrity":"sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=","dev":true,"requires":{"code-point-at":"^1.0.0","is-fullwidth-code-point":"^1.0.0","strip-ansi":"^3.0.0"}},"string.prototype.trimend":{"version":"1.0.1","resolved":"https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz","integrity":"sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.17.5"}},"string.prototype.trimstart":{"version":"1.0.1","resolved":"https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz","integrity":"sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.17.5"}},"string_decoder":{"version":"1.3.0","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz","integrity":"sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==","requires":{"safe-buffer":"~5.2.0"}},"strip-ansi":{"version":"3.0.1","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz","integrity":"sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=","dev":true,"requires":{"ansi-regex":"^2.0.0"}},"strip-bom":{"version":"3.0.0","resolved":"https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz","integrity":"sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=","dev":true},"strip-eof":{"version":"1.0.0","resolved":"https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz","integrity":"sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=","dev":true},"strip-final-newline":{"version":"2.0.0","resolved":"https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz","integrity":"sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==","dev":true},"strip-hex-prefix":{"version":"1.0.0","resolved":"https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz","integrity":"sha1-DF8VX+8RUTczd96du1iNoFUA428=","requires":{"is-hex-prefixed":"1.0.0"}},"strip-indent":{"version":"3.0.0","resolved":"https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz","integrity":"sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==","dev":true,"requires":{"min-indent":"^1.0.0"}},"strip-json-comments":{"version":"3.1.1","resolved":"https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz","integrity":"sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==","dev":true},"strong-log-transformer":{"version":"2.1.0","resolved":"https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz","integrity":"sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==","dev":true,"requires":{"duplexer":"^0.1.1","minimist":"^1.2.0","through":"^2.3.4"}},"subleveldown":{"version":"5.0.1","resolved":"https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.1.tgz","integrity":"sha512-cVqd/URpp7si1HWu5YqQ3vqQkjuolAwHypY1B4itPlS71/lsf6TQPZ2Y0ijT22EYVkvH5ove9JFJf4u7VGPuZw==","requires":{"abstract-leveldown":"^6.3.0","encoding-down":"^6.2.0","inherits":"^2.0.3","level-option-wrap":"^1.1.0","levelup":"^4.4.0","reachdown":"^1.1.0"},"dependencies":{"abstract-leveldown":{"version":"6.3.0","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz","integrity":"sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==","requires":{"buffer":"^5.5.0","immediate":"^3.2.3","level-concat-iterator":"~2.0.0","level-supports":"~1.0.0","xtend":"~4.0.0"}},"deferred-leveldown":{"version":"5.3.0","resolved":"https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz","integrity":"sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==","requires":{"abstract-leveldown":"~6.2.1","inherits":"^2.0.3"},"dependencies":{"abstract-leveldown":{"version":"6.2.3","resolved":"https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz","integrity":"sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==","requires":{"buffer":"^5.5.0","immediate":"^3.2.3","level-concat-iterator":"~2.0.0","level-supports":"~1.0.0","xtend":"~4.0.0"}}}},"encoding-down":{"version":"6.3.0","resolved":"https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz","integrity":"sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==","requires":{"abstract-leveldown":"^6.2.1","inherits":"^2.0.3","level-codec":"^9.0.0","level-errors":"^2.0.0"}},"level-codec":{"version":"9.0.2","resolved":"https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz","integrity":"sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==","requires":{"buffer":"^5.6.0"}},"level-errors":{"version":"2.0.1","resolved":"https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz","integrity":"sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==","requires":{"errno":"~0.1.1"}},"level-iterator-stream":{"version":"4.0.2","resolved":"https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz","integrity":"sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==","requires":{"inherits":"^2.0.4","readable-stream":"^3.4.0","xtend":"^4.0.2"}},"levelup":{"version":"4.4.0","resolved":"https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz","integrity":"sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==","requires":{"deferred-leveldown":"~5.3.0","level-errors":"~2.0.0","level-iterator-stream":"~4.0.0","level-supports":"~1.0.0","xtend":"~4.0.0"}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="}}},"superagent":{"version":"6.1.0","resolved":"https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz","integrity":"sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==","dev":true,"requires":{"component-emitter":"^1.3.0","cookiejar":"^2.1.2","debug":"^4.1.1","fast-safe-stringify":"^2.0.7","form-data":"^3.0.0","formidable":"^1.2.2","methods":"^1.1.2","mime":"^2.4.6","qs":"^6.9.4","readable-stream":"^3.6.0","semver":"^7.3.2"},"dependencies":{"debug":{"version":"4.2.0","resolved":"https://registry.npmjs.org/debug/-/debug-4.2.0.tgz","integrity":"sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==","dev":true,"requires":{"ms":"2.1.2"}},"form-data":{"version":"3.0.0","resolved":"https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz","integrity":"sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==","dev":true,"requires":{"asynckit":"^0.4.0","combined-stream":"^1.0.8","mime-types":"^2.1.12"}},"qs":{"version":"6.9.4","resolved":"https://registry.npmjs.org/qs/-/qs-6.9.4.tgz","integrity":"sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==","dev":true},"semver":{"version":"7.3.2","resolved":"https://registry.npmjs.org/semver/-/semver-7.3.2.tgz","integrity":"sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==","dev":true}}},"supports-color":{"version":"7.2.0","resolved":"https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz","integrity":"sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==","dev":true,"requires":{"has-flag":"^4.0.0"}},"tar":{"version":"4.4.13","resolved":"https://registry.npmjs.org/tar/-/tar-4.4.13.tgz","integrity":"sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==","dev":true,"requires":{"chownr":"^1.1.1","fs-minipass":"^1.2.5","minipass":"^2.8.6","minizlib":"^1.2.1","mkdirp":"^0.5.0","safe-buffer":"^5.1.2","yallist":"^3.0.3"}},"temp-dir":{"version":"1.0.0","resolved":"https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz","integrity":"sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=","dev":true},"temp-write":{"version":"3.4.0","resolved":"https://registry.npmjs.org/temp-write/-/temp-write-3.4.0.tgz","integrity":"sha1-jP9jD7fp2gXwR8dM5M5NaFRX1JI=","dev":true,"requires":{"graceful-fs":"^4.1.2","is-stream":"^1.1.0","make-dir":"^1.0.0","pify":"^3.0.0","temp-dir":"^1.0.0","uuid":"^3.0.1"},"dependencies":{"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true}}},"test-exclude":{"version":"6.0.0","resolved":"https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz","integrity":"sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==","dev":true,"requires":{"@istanbuljs/schema":"^0.1.2","glob":"^7.1.4","minimatch":"^3.0.4"}},"text-extensions":{"version":"1.9.0","resolved":"https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz","integrity":"sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==","dev":true},"thenify":{"version":"3.3.1","resolved":"https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz","integrity":"sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==","dev":true,"requires":{"any-promise":"^1.0.0"}},"thenify-all":{"version":"1.6.0","resolved":"https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz","integrity":"sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=","dev":true,"requires":{"thenify":">= 3.1.0 < 4"}},"through":{"version":"2.3.8","resolved":"https://registry.npmjs.org/through/-/through-2.3.8.tgz","integrity":"sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=","dev":true},"through2":{"version":"2.0.5","resolved":"https://registry.npmjs.org/through2/-/through2-2.0.5.tgz","integrity":"sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==","dev":true,"requires":{"readable-stream":"~2.3.6","xtend":"~4.0.1"},"dependencies":{"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true},"readable-stream":{"version":"2.3.7","resolved":"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz","integrity":"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev":true,"requires":{"core-util-is":"~1.0.0","inherits":"~2.0.3","isarray":"~1.0.0","process-nextick-args":"~2.0.0","safe-buffer":"~5.1.1","string_decoder":"~1.1.1","util-deprecate":"~1.0.1"}},"safe-buffer":{"version":"5.1.2","resolved":"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz","integrity":"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==","dev":true},"string_decoder":{"version":"1.1.1","resolved":"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz","integrity":"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==","dev":true,"requires":{"safe-buffer":"~5.1.0"}},"xtend":{"version":"4.0.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz","integrity":"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==","dev":true}}},"tmp":{"version":"0.2.1","resolved":"https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz","integrity":"sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==","requires":{"rimraf":"^3.0.0"}},"tmp-promise":{"version":"3.0.2","resolved":"https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.2.tgz","integrity":"sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA==","requires":{"tmp":"^0.2.0"}},"to-fast-properties":{"version":"2.0.0","resolved":"https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz","integrity":"sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=","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=","dev":true,"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=","dev":true,"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==","dev":true,"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=","dev":true,"requires":{"is-number":"^3.0.0","repeat-string":"^1.6.1"}},"tough-cookie":{"version":"2.5.0","resolved":"https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz","integrity":"sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==","dev":true,"requires":{"psl":"^1.1.28","punycode":"^2.1.1"}},"tr46":{"version":"1.0.1","resolved":"https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz","integrity":"sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=","dev":true,"requires":{"punycode":"^2.1.0"}},"trim-newlines":{"version":"3.0.0","resolved":"https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz","integrity":"sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==","dev":true},"trim-off-newlines":{"version":"1.0.1","resolved":"https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz","integrity":"sha1-n5up2e+odkw4dpi8v+sshI8RrbM=","dev":true},"ts-morph":{"version":"7.3.0","resolved":"https://registry.npmjs.org/ts-morph/-/ts-morph-7.3.0.tgz","integrity":"sha512-BUKSoz7AFSKPcYTZODbICW2mOthAN4vc5juD6FL1lD/dLwZ0WvrC3zqBM3/X6f5gHxq3yaz+HmanHGaWm0ddbQ==","dev":true,"requires":{"@dsherret/to-absolute-glob":"^2.0.2","@ts-morph/common":"~0.5.2","code-block-writer":"^10.1.0"}},"ts-node":{"version":"9.0.0","resolved":"https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz","integrity":"sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==","dev":true,"requires":{"arg":"^4.1.0","diff":"^4.0.1","make-error":"^1.1.1","source-map-support":"^0.5.17","yn":"3.1.1"}},"tslib":{"version":"1.13.0","resolved":"https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz","integrity":"sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==","dev":true},"tunnel-agent":{"version":"0.6.0","resolved":"https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz","integrity":"sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=","dev":true,"requires":{"safe-buffer":"^5.0.1"}},"tweetnacl":{"version":"0.14.5","resolved":"https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz","integrity":"sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=","dev":true},"type-fest":{"version":"0.3.1","resolved":"https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz","integrity":"sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==","dev":true},"typedarray":{"version":"0.0.6","resolved":"https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz","integrity":"sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=","dev":true},"typedarray-to-buffer":{"version":"3.1.5","resolved":"https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz","integrity":"sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==","dev":true,"requires":{"is-typedarray":"^1.0.0"}},"typescript":{"version":"4.1.0-beta","resolved":"https://registry.npmjs.org/typescript/-/typescript-4.1.0-beta.tgz","integrity":"sha512-b/LAttdVl3G6FEmnMkDsK0xvfvaftXpSKrjXn+OVCRqrwz5WD/6QJOiN+dTorqDY+hkaH+r2gP5wI1jBDmdQ7A==","dev":true},"uWebSockets.js":{"version":"github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c","from":"github:uNetworking/uWebSockets.js#v18.4.0"},"uglify-js":{"version":"3.10.4","resolved":"https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz","integrity":"sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==","dev":true,"optional":true},"uid-number":{"version":"0.0.6","resolved":"https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz","integrity":"sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=","dev":true},"umask":{"version":"1.1.0","resolved":"https://registry.npmjs.org/umask/-/umask-1.1.0.tgz","integrity":"sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=","dev":true},"unc-path-regex":{"version":"0.1.2","resolved":"https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz","integrity":"sha1-5z3T17DXxe2G+6xrCufYxqadUPo=","dev":true},"union-value":{"version":"1.0.1","resolved":"https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz","integrity":"sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==","dev":true,"requires":{"arr-union":"^3.1.0","get-value":"^2.0.6","is-extendable":"^0.1.1","set-value":"^2.0.1"}},"unique-filename":{"version":"1.1.1","resolved":"https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz","integrity":"sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==","dev":true,"requires":{"unique-slug":"^2.0.0"}},"unique-slug":{"version":"2.0.2","resolved":"https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz","integrity":"sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==","dev":true,"requires":{"imurmurhash":"^0.1.4"}},"universal-user-agent":{"version":"4.0.1","resolved":"https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz","integrity":"sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==","dev":true,"requires":{"os-name":"^3.1.0"}},"universalify":{"version":"1.0.0","resolved":"https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz","integrity":"sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==","dev":true},"unset-value":{"version":"1.0.0","resolved":"https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz","integrity":"sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=","dev":true,"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=","dev":true,"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=","dev":true,"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=","dev":true},"isarray":{"version":"1.0.0","resolved":"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity":"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=","dev":true}}},"upath":{"version":"1.2.0","resolved":"https://registry.npmjs.org/upath/-/upath-1.2.0.tgz","integrity":"sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==","dev":true},"uri-js":{"version":"4.4.0","resolved":"https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz","integrity":"sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==","dev":true,"requires":{"punycode":"^2.1.0"}},"urix":{"version":"0.1.0","resolved":"https://registry.npmjs.org/urix/-/urix-0.1.0.tgz","integrity":"sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=","dev":true},"use":{"version":"3.1.1","resolved":"https://registry.npmjs.org/use/-/use-3.1.1.tgz","integrity":"sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==","dev":true},"utf-8-validate":{"version":"5.0.2","resolved":"https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz","integrity":"sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==","dev":true,"requires":{"node-gyp-build":"~3.7.0"},"dependencies":{"node-gyp-build":{"version":"3.7.0","resolved":"https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz","integrity":"sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==","dev":true}}},"util-deprecate":{"version":"1.0.2","resolved":"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz","integrity":"sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="},"util-promisify":{"version":"2.1.0","resolved":"https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz","integrity":"sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=","dev":true,"requires":{"object.getownpropertydescriptors":"^2.0.3"}},"util.promisify":{"version":"1.0.1","resolved":"https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz","integrity":"sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==","requires":{"define-properties":"^1.1.3","es-abstract":"^1.17.2","has-symbols":"^1.0.1","object.getownpropertydescriptors":"^2.1.0"}},"uuid":{"version":"3.4.0","resolved":"https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz","integrity":"sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==","dev":true},"validate-npm-package-license":{"version":"3.0.4","resolved":"https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz","integrity":"sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==","dev":true,"requires":{"spdx-correct":"^3.0.0","spdx-expression-parse":"^3.0.0"}},"validate-npm-package-name":{"version":"3.0.0","resolved":"https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz","integrity":"sha1-X6kS2B630MdK/BQN5zF/DKffQ34=","dev":true,"requires":{"builtins":"^1.0.3"}},"verror":{"version":"1.10.0","resolved":"https://registry.npmjs.org/verror/-/verror-1.10.0.tgz","integrity":"sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=","dev":true,"requires":{"assert-plus":"^1.0.0","core-util-is":"1.0.2","extsprintf":"^1.2.0"}},"wcwidth":{"version":"1.0.1","resolved":"https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz","integrity":"sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=","dev":true,"requires":{"defaults":"^1.0.3"}},"webidl-conversions":{"version":"4.0.2","resolved":"https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz","integrity":"sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==","dev":true},"whatwg-url":{"version":"7.1.0","resolved":"https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz","integrity":"sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==","dev":true,"requires":{"lodash.sortby":"^4.7.0","tr46":"^1.0.1","webidl-conversions":"^4.0.2"}},"which":{"version":"2.0.2","resolved":"https://registry.npmjs.org/which/-/which-2.0.2.tgz","integrity":"sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==","dev":true,"requires":{"isexe":"^2.0.0"}},"which-module":{"version":"2.0.0","resolved":"https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz","integrity":"sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=","dev":true},"which-pm-runs":{"version":"1.0.0","resolved":"https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz","integrity":"sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=","dev":true},"wide-align":{"version":"1.1.3","resolved":"https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz","integrity":"sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==","dev":true,"requires":{"string-width":"^1.0.2 || 2"}},"windows-release":{"version":"3.3.3","resolved":"https://registry.npmjs.org/windows-release/-/windows-release-3.3.3.tgz","integrity":"sha512-OSOGH1QYiW5yVor9TtmXKQvt2vjQqbYS+DqmsZw+r7xDwLXEeT3JGW0ZppFmHx4diyXmxt238KFR3N9jzevBRg==","dev":true,"requires":{"execa":"^1.0.0"}},"wordwrap":{"version":"1.0.0","resolved":"https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz","integrity":"sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=","dev":true},"workerpool":{"version":"6.0.2","resolved":"https://registry.npmjs.org/workerpool/-/workerpool-6.0.2.tgz","integrity":"sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q==","dev":true},"wrap-ansi":{"version":"5.1.0","resolved":"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz","integrity":"sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==","dev":true,"requires":{"ansi-styles":"^3.2.0","string-width":"^3.0.0","strip-ansi":"^5.0.0"},"dependencies":{"ansi-regex":{"version":"4.1.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz","integrity":"sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==","dev":true},"is-fullwidth-code-point":{"version":"2.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz","integrity":"sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=","dev":true},"string-width":{"version":"3.1.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz","integrity":"sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==","dev":true,"requires":{"emoji-regex":"^7.0.1","is-fullwidth-code-point":"^2.0.0","strip-ansi":"^5.1.0"}},"strip-ansi":{"version":"5.2.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz","integrity":"sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==","dev":true,"requires":{"ansi-regex":"^4.1.0"}}}},"wrappy":{"version":"1.0.2","resolved":"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz","integrity":"sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="},"write-file-atomic":{"version":"2.4.3","resolved":"https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz","integrity":"sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==","dev":true,"requires":{"graceful-fs":"^4.1.11","imurmurhash":"^0.1.4","signal-exit":"^3.0.2"}},"write-json-file":{"version":"3.2.0","resolved":"https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz","integrity":"sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==","dev":true,"requires":{"detect-indent":"^5.0.0","graceful-fs":"^4.1.15","make-dir":"^2.1.0","pify":"^4.0.1","sort-keys":"^2.0.0","write-file-atomic":"^2.4.2"},"dependencies":{"make-dir":{"version":"2.1.0","resolved":"https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz","integrity":"sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==","dev":true,"requires":{"pify":"^4.0.1","semver":"^5.6.0"}},"semver":{"version":"5.7.1","resolved":"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz","integrity":"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==","dev":true}}},"write-pkg":{"version":"3.2.0","resolved":"https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz","integrity":"sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==","dev":true,"requires":{"sort-keys":"^2.0.0","write-json-file":"^2.2.0"},"dependencies":{"pify":{"version":"3.0.0","resolved":"https://registry.npmjs.org/pify/-/pify-3.0.0.tgz","integrity":"sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=","dev":true},"write-json-file":{"version":"2.3.0","resolved":"https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz","integrity":"sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=","dev":true,"requires":{"detect-indent":"^5.0.0","graceful-fs":"^4.1.2","make-dir":"^1.0.0","pify":"^3.0.0","sort-keys":"^2.0.0","write-file-atomic":"^2.0.0"}}}},"ws":{"version":"7.3.1","resolved":"https://registry.npmjs.org/ws/-/ws-7.3.1.tgz","integrity":"sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==","dev":true},"xtend":{"version":"2.1.2","resolved":"https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz","integrity":"sha1-bv7MKk2tjmlixJAbM3znuoe10os=","requires":{"object-keys":"~0.4.0"}},"y18n":{"version":"4.0.0","resolved":"https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz","integrity":"sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==","dev":true},"yallist":{"version":"3.1.1","resolved":"https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz","integrity":"sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="},"yaml":{"version":"1.10.0","resolved":"https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz","integrity":"sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==","dev":true},"yargs":{"version":"16.1.0","resolved":"https://registry.npmjs.org/yargs/-/yargs-16.1.0.tgz","integrity":"sha512-upWFJOmDdHN0syLuESuvXDmrRcWd1QafJolHskzaw79uZa7/x53gxQKiR07W59GWY1tFhhU/Th9DrtSfpS782g==","dev":true,"requires":{"cliui":"^7.0.2","escalade":"^3.1.1","get-caller-file":"^2.0.5","require-directory":"^2.1.1","string-width":"^4.2.0","y18n":"^5.0.2","yargs-parser":"^20.2.2"},"dependencies":{"ansi-regex":{"version":"5.0.0","resolved":"https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz","integrity":"sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==","dev":true},"ansi-styles":{"version":"4.3.0","resolved":"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz","integrity":"sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==","dev":true,"requires":{"color-convert":"^2.0.1"}},"cliui":{"version":"7.0.3","resolved":"https://registry.npmjs.org/cliui/-/cliui-7.0.3.tgz","integrity":"sha512-Gj3QHTkVMPKqwP3f7B4KPkBZRMR9r4rfi5bXFpg1a+Svvj8l7q5CnkBkVQzfxT5DFSsGk2+PascOgL0JYkL2kw==","dev":true,"requires":{"string-width":"^4.2.0","strip-ansi":"^6.0.0","wrap-ansi":"^7.0.0"}},"color-convert":{"version":"2.0.1","resolved":"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz","integrity":"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==","dev":true,"requires":{"color-name":"~1.1.4"}},"color-name":{"version":"1.1.4","resolved":"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz","integrity":"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev":true},"emoji-regex":{"version":"8.0.0","resolved":"https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz","integrity":"sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==","dev":true},"is-fullwidth-code-point":{"version":"3.0.0","resolved":"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz","integrity":"sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==","dev":true},"string-width":{"version":"4.2.0","resolved":"https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz","integrity":"sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==","dev":true,"requires":{"emoji-regex":"^8.0.0","is-fullwidth-code-point":"^3.0.0","strip-ansi":"^6.0.0"}},"strip-ansi":{"version":"6.0.0","resolved":"https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz","integrity":"sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==","dev":true,"requires":{"ansi-regex":"^5.0.0"}},"wrap-ansi":{"version":"7.0.0","resolved":"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz","integrity":"sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==","dev":true,"requires":{"ansi-styles":"^4.0.0","string-width":"^4.1.0","strip-ansi":"^6.0.0"}},"y18n":{"version":"5.0.4","resolved":"https://registry.npmjs.org/y18n/-/y18n-5.0.4.tgz","integrity":"sha512-deLOfD+RvFgrpAmSZgfGdWYE+OKyHcVHaRQ7NphG/63scpRvTHHeQMAxGGvaLVGJ+HYVcCXlzcTK0ZehFf+eHQ==","dev":true},"yargs-parser":{"version":"20.2.3","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.3.tgz","integrity":"sha512-emOFRT9WVHw03QSvN5qor9QQT9+sw5vwxfYweivSMHTcAXPefwVae2FjO7JJjj8hCE4CzPOPeFM83VwT29HCww==","dev":true}}},"yargs-parser":{"version":"15.0.1","resolved":"https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz","integrity":"sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==","dev":true,"requires":{"camelcase":"^5.0.0","decamelize":"^1.2.0"},"dependencies":{"camelcase":{"version":"5.3.1","resolved":"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz","integrity":"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==","dev":true}}},"yargs-unparser":{"version":"2.0.0","resolved":"https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz","integrity":"sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==","dev":true,"requires":{"camelcase":"^6.0.0","decamelize":"^4.0.0","flat":"^5.0.2","is-plain-obj":"^2.1.0"},"dependencies":{"decamelize":{"version":"4.0.0","resolved":"https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz","integrity":"sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==","dev":true},"is-plain-obj":{"version":"2.1.0","resolved":"https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz","integrity":"sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==","dev":true}}},"yn":{"version":"3.1.1","resolved":"https://registry.npmjs.org/yn/-/yn-3.1.1.tgz","integrity":"sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==","dev":true}}} +{ + "name": "root", + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/core": { + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", + "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.6", + "@babel/helper-module-transforms": "^7.11.0", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.11.5", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.11.5", + "@babel/types": "^7.11.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } + } + }, + "@babel/generator": { + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", + "dev": true, + "requires": { + "@babel/types": "^7.11.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", + "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-module-transforms": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", + "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/template": "^7.10.4", + "@babel/types": "^7.11.0", + "lodash": "^4.17.19" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-replace-supers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-simple-access": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/helpers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/parser": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/traverse": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } + } + }, + "@babel/types": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "@dsherret/to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-H2R13IvZdM6gei2vOGSzF7HdMyw=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + } + }, + "@evocateur/libnpmaccess": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz", + "integrity": "sha512-KSCAHwNWro0CF2ukxufCitT9K5LjL/KuMmNzSu8wuwN2rjyKHD8+cmOsiybK+W5hdnwc5M1SmRlVCaMHQo+3rg==", + "dev": true, + "requires": { + "@evocateur/npm-registry-fetch": "^4.0.0", + "aproba": "^2.0.0", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.0.0", + "npm-package-arg": "^6.1.0" + }, + "dependencies": { + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@evocateur/libnpmpublish": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@evocateur/libnpmpublish/-/libnpmpublish-1.2.2.tgz", + "integrity": "sha512-MJrrk9ct1FeY9zRlyeoyMieBjGDG9ihyyD9/Ft6MMrTxql9NyoEx2hw9casTIP4CdqEVu+3nQ2nXxoJ8RCXyFg==", + "dev": true, + "requires": { + "@evocateur/npm-registry-fetch": "^4.0.0", + "aproba": "^2.0.0", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.0.0", + "lodash.clonedeep": "^4.5.0", + "normalize-package-data": "^2.4.0", + "npm-package-arg": "^6.1.0", + "semver": "^5.5.1", + "ssri": "^6.0.1" + }, + "dependencies": { + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@evocateur/npm-registry-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@evocateur/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz", + "integrity": "sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g==", + "dev": true, + "requires": { + "JSONStream": "^1.3.4", + "bluebird": "^3.5.1", + "figgy-pudding": "^3.4.1", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", + "npm-package-arg": "^6.1.0", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@evocateur/pacote": { + "version": "9.6.5", + "resolved": "https://registry.npmjs.org/@evocateur/pacote/-/pacote-9.6.5.tgz", + "integrity": "sha512-EI552lf0aG2nOV8NnZpTxNo2PcXKPmDbF9K8eCBFQdIZwHNGN/mi815fxtmUMa2wTa1yndotICIDt/V0vpEx2w==", + "dev": true, + "requires": { + "@evocateur/npm-registry-fetch": "^4.0.0", + "bluebird": "^3.5.3", + "cacache": "^12.0.3", + "chownr": "^1.1.2", + "figgy-pudding": "^3.5.1", + "get-stream": "^4.1.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", + "minimatch": "^3.0.4", + "minipass": "^2.3.5", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "normalize-package-data": "^2.5.0", + "npm-package-arg": "^6.1.0", + "npm-packlist": "^1.4.4", + "npm-pick-manifest": "^3.0.0", + "osenv": "^0.1.5", + "promise-inflight": "^1.0.1", + "promise-retry": "^1.1.1", + "protoduck": "^5.0.1", + "rimraf": "^2.6.3", + "safe-buffer": "^5.2.0", + "semver": "^5.7.0", + "ssri": "^6.0.1", + "tar": "^4.4.10", + "unique-filename": "^1.1.1", + "which": "^1.3.1" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/nyc-config-typescript": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz", + "integrity": "sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2" + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, + "@lerna/add": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/add/-/add-3.21.0.tgz", + "integrity": "sha512-vhUXXF6SpufBE1EkNEXwz1VLW03f177G9uMOFMQkp6OJ30/PWg4Ekifuz9/3YfgB2/GH8Tu4Lk3O51P2Hskg/A==", + "dev": true, + "requires": { + "@evocateur/pacote": "^9.6.3", + "@lerna/bootstrap": "3.21.0", + "@lerna/command": "3.21.0", + "@lerna/filter-options": "3.20.0", + "@lerna/npm-conf": "3.16.0", + "@lerna/validation-error": "3.13.0", + "dedent": "^0.7.0", + "npm-package-arg": "^6.1.0", + "p-map": "^2.1.0", + "semver": "^6.2.0" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/bootstrap": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/bootstrap/-/bootstrap-3.21.0.tgz", + "integrity": "sha512-mtNHlXpmvJn6JTu0KcuTTPl2jLsDNud0QacV/h++qsaKbhAaJr/FElNZ5s7MwZFUM3XaDmvWzHKaszeBMHIbBw==", + "dev": true, + "requires": { + "@lerna/command": "3.21.0", + "@lerna/filter-options": "3.20.0", + "@lerna/has-npm-version": "3.16.5", + "@lerna/npm-install": "3.16.5", + "@lerna/package-graph": "3.18.5", + "@lerna/pulse-till-done": "3.13.0", + "@lerna/rimraf-dir": "3.16.5", + "@lerna/run-lifecycle": "3.16.2", + "@lerna/run-topologically": "3.18.5", + "@lerna/symlink-binary": "3.17.0", + "@lerna/symlink-dependencies": "3.17.0", + "@lerna/validation-error": "3.13.0", + "dedent": "^0.7.0", + "get-port": "^4.2.0", + "multimatch": "^3.0.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "p-finally": "^1.0.0", + "p-map": "^2.1.0", + "p-map-series": "^1.0.0", + "p-waterfall": "^1.0.0", + "read-package-tree": "^5.1.6", + "semver": "^6.2.0" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/changed": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/changed/-/changed-3.21.0.tgz", + "integrity": "sha512-hzqoyf8MSHVjZp0gfJ7G8jaz+++mgXYiNs9iViQGA8JlN/dnWLI5sWDptEH3/B30Izo+fdVz0S0s7ydVE3pWIw==", + "dev": true, + "requires": { + "@lerna/collect-updates": "3.20.0", + "@lerna/command": "3.21.0", + "@lerna/listable": "3.18.5", + "@lerna/output": "3.13.0" + } + }, + "@lerna/check-working-tree": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/check-working-tree/-/check-working-tree-3.16.5.tgz", + "integrity": "sha512-xWjVBcuhvB8+UmCSb5tKVLB5OuzSpw96WEhS2uz6hkWVa/Euh1A0/HJwn2cemyK47wUrCQXtczBUiqnq9yX5VQ==", + "dev": true, + "requires": { + "@lerna/collect-uncommitted": "3.16.5", + "@lerna/describe-ref": "3.16.5", + "@lerna/validation-error": "3.13.0" + } + }, + "@lerna/child-process": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/child-process/-/child-process-3.16.5.tgz", + "integrity": "sha512-vdcI7mzei9ERRV4oO8Y1LHBZ3A5+ampRKg1wq5nutLsUA4mEBN6H7JqjWOMY9xZemv6+kATm2ofjJ3lW5TszQg==", + "dev": true, + "requires": { + "chalk": "^2.3.1", + "execa": "^1.0.0", + "strong-log-transformer": "^2.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@lerna/clean": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/clean/-/clean-3.21.0.tgz", + "integrity": "sha512-b/L9l+MDgE/7oGbrav6rG8RTQvRiZLO1zTcG17zgJAAuhlsPxJExMlh2DFwJEVi2les70vMhHfST3Ue1IMMjpg==", + "dev": true, + "requires": { + "@lerna/command": "3.21.0", + "@lerna/filter-options": "3.20.0", + "@lerna/prompt": "3.18.5", + "@lerna/pulse-till-done": "3.13.0", + "@lerna/rimraf-dir": "3.16.5", + "p-map": "^2.1.0", + "p-map-series": "^1.0.0", + "p-waterfall": "^1.0.0" + } + }, + "@lerna/cli": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/cli/-/cli-3.18.5.tgz", + "integrity": "sha512-erkbxkj9jfc89vVs/jBLY/fM0I80oLmJkFUV3Q3wk9J3miYhP14zgVEBsPZY68IZlEjT6T3Xlq2xO1AVaatHsA==", + "dev": true, + "requires": { + "@lerna/global-options": "3.13.0", + "dedent": "^0.7.0", + "npmlog": "^4.1.2", + "yargs": "^14.2.2" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "yargs": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^15.0.1" + } + } + } + }, + "@lerna/collect-uncommitted": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/collect-uncommitted/-/collect-uncommitted-3.16.5.tgz", + "integrity": "sha512-ZgqnGwpDZiWyzIQVZtQaj9tRizsL4dUOhuOStWgTAw1EMe47cvAY2kL709DzxFhjr6JpJSjXV5rZEAeU3VE0Hg==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "chalk": "^2.3.1", + "figgy-pudding": "^3.5.1", + "npmlog": "^4.1.2" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@lerna/collect-updates": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/collect-updates/-/collect-updates-3.20.0.tgz", + "integrity": "sha512-qBTVT5g4fupVhBFuY4nI/3FSJtQVcDh7/gEPOpRxoXB/yCSnT38MFHXWl+y4einLciCjt/+0x6/4AG80fjay2Q==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/describe-ref": "3.16.5", + "minimatch": "^3.0.4", + "npmlog": "^4.1.2", + "slash": "^2.0.0" + } + }, + "@lerna/command": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/command/-/command-3.21.0.tgz", + "integrity": "sha512-T2bu6R8R3KkH5YoCKdutKv123iUgUbW8efVjdGCDnCMthAQzoentOJfDeodBwn0P2OqCl3ohsiNVtSn9h78fyQ==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/package-graph": "3.18.5", + "@lerna/project": "3.21.0", + "@lerna/validation-error": "3.13.0", + "@lerna/write-log-file": "3.13.0", + "clone-deep": "^4.0.1", + "dedent": "^0.7.0", + "execa": "^1.0.0", + "is-ci": "^2.0.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/conventional-commits": { + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/@lerna/conventional-commits/-/conventional-commits-3.22.0.tgz", + "integrity": "sha512-z4ZZk1e8Mhz7+IS8NxHr64wyklHctCJyWpJKEZZPJiLFJ8yKto/x38O80R10pIzC0rr8Sy/OsjSH4bl0TbbgqA==", + "dev": true, + "requires": { + "@lerna/validation-error": "3.13.0", + "conventional-changelog-angular": "^5.0.3", + "conventional-changelog-core": "^3.1.6", + "conventional-recommended-bump": "^5.0.0", + "fs-extra": "^8.1.0", + "get-stream": "^4.0.0", + "lodash.template": "^4.5.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "pify": "^4.0.1", + "semver": "^6.2.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/create": { + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/@lerna/create/-/create-3.22.0.tgz", + "integrity": "sha512-MdiQQzCcB4E9fBF1TyMOaAEz9lUjIHp1Ju9H7f3lXze5JK6Fl5NYkouAvsLgY6YSIhXMY8AHW2zzXeBDY4yWkw==", + "dev": true, + "requires": { + "@evocateur/pacote": "^9.6.3", + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.21.0", + "@lerna/npm-conf": "3.16.0", + "@lerna/validation-error": "3.13.0", + "camelcase": "^5.0.0", + "dedent": "^0.7.0", + "fs-extra": "^8.1.0", + "globby": "^9.2.0", + "init-package-json": "^1.10.3", + "npm-package-arg": "^6.1.0", + "p-reduce": "^1.0.0", + "pify": "^4.0.1", + "semver": "^6.2.0", + "slash": "^2.0.0", + "validate-npm-package-license": "^3.0.3", + "validate-npm-package-name": "^3.0.0", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/create-symlink": { + "version": "3.16.2", + "resolved": "https://registry.npmjs.org/@lerna/create-symlink/-/create-symlink-3.16.2.tgz", + "integrity": "sha512-pzXIJp6av15P325sgiIRpsPXLFmkisLhMBCy4764d+7yjf2bzrJ4gkWVMhsv4AdF0NN3OyZ5jjzzTtLNqfR+Jw==", + "dev": true, + "requires": { + "@zkochan/cmd-shim": "^3.1.0", + "fs-extra": "^8.1.0", + "npmlog": "^4.1.2" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/describe-ref": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/describe-ref/-/describe-ref-3.16.5.tgz", + "integrity": "sha512-c01+4gUF0saOOtDBzbLMFOTJDHTKbDFNErEY6q6i9QaXuzy9LNN62z+Hw4acAAZuJQhrVWncVathcmkkjvSVGw==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "npmlog": "^4.1.2" + } + }, + "@lerna/diff": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/diff/-/diff-3.21.0.tgz", + "integrity": "sha512-5viTR33QV3S7O+bjruo1SaR40m7F2aUHJaDAC7fL9Ca6xji+aw1KFkpCtVlISS0G8vikUREGMJh+c/VMSc8Usw==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.21.0", + "@lerna/validation-error": "3.13.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/exec": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/exec/-/exec-3.21.0.tgz", + "integrity": "sha512-iLvDBrIE6rpdd4GIKTY9mkXyhwsJ2RvQdB9ZU+/NhR3okXfqKc6py/24tV111jqpXTtZUW6HNydT4dMao2hi1Q==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.21.0", + "@lerna/filter-options": "3.20.0", + "@lerna/profiler": "3.20.0", + "@lerna/run-topologically": "3.18.5", + "@lerna/validation-error": "3.13.0", + "p-map": "^2.1.0" + } + }, + "@lerna/filter-options": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/filter-options/-/filter-options-3.20.0.tgz", + "integrity": "sha512-bmcHtvxn7SIl/R9gpiNMVG7yjx7WyT0HSGw34YVZ9B+3xF/83N3r5Rgtjh4hheLZ+Q91Or0Jyu5O3Nr+AwZe2g==", + "dev": true, + "requires": { + "@lerna/collect-updates": "3.20.0", + "@lerna/filter-packages": "3.18.0", + "dedent": "^0.7.0", + "figgy-pudding": "^3.5.1", + "npmlog": "^4.1.2" + } + }, + "@lerna/filter-packages": { + "version": "3.18.0", + "resolved": "https://registry.npmjs.org/@lerna/filter-packages/-/filter-packages-3.18.0.tgz", + "integrity": "sha512-6/0pMM04bCHNATIOkouuYmPg6KH3VkPCIgTfQmdkPJTullERyEQfNUKikrefjxo1vHOoCACDpy65JYyKiAbdwQ==", + "dev": true, + "requires": { + "@lerna/validation-error": "3.13.0", + "multimatch": "^3.0.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/get-npm-exec-opts": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-3.13.0.tgz", + "integrity": "sha512-Y0xWL0rg3boVyJk6An/vurKzubyJKtrxYv2sj4bB8Mc5zZ3tqtv0ccbOkmkXKqbzvNNF7VeUt1OJ3DRgtC/QZw==", + "dev": true, + "requires": { + "npmlog": "^4.1.2" + } + }, + "@lerna/get-packed": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/get-packed/-/get-packed-3.16.0.tgz", + "integrity": "sha512-AjsFiaJzo1GCPnJUJZiTW6J1EihrPkc2y3nMu6m3uWFxoleklsSCyImumzVZJssxMi3CPpztj8LmADLedl9kXw==", + "dev": true, + "requires": { + "fs-extra": "^8.1.0", + "ssri": "^6.0.1", + "tar": "^4.4.8" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/github-client": { + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/@lerna/github-client/-/github-client-3.22.0.tgz", + "integrity": "sha512-O/GwPW+Gzr3Eb5bk+nTzTJ3uv+jh5jGho9BOqKlajXaOkMYGBELEAqV5+uARNGWZFvYAiF4PgqHb6aCUu7XdXg==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@octokit/plugin-enterprise-rest": "^6.0.1", + "@octokit/rest": "^16.28.4", + "git-url-parse": "^11.1.2", + "npmlog": "^4.1.2" + } + }, + "@lerna/gitlab-client": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/@lerna/gitlab-client/-/gitlab-client-3.15.0.tgz", + "integrity": "sha512-OsBvRSejHXUBMgwWQqNoioB8sgzL/Pf1pOUhHKtkiMl6aAWjklaaq5HPMvTIsZPfS6DJ9L5OK2GGZuooP/5c8Q==", + "dev": true, + "requires": { + "node-fetch": "^2.5.0", + "npmlog": "^4.1.2", + "whatwg-url": "^7.0.0" + } + }, + "@lerna/global-options": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/global-options/-/global-options-3.13.0.tgz", + "integrity": "sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ==", + "dev": true + }, + "@lerna/has-npm-version": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/has-npm-version/-/has-npm-version-3.16.5.tgz", + "integrity": "sha512-WL7LycR9bkftyqbYop5rEGJ9sRFIV55tSGmbN1HLrF9idwOCD7CLrT64t235t3t4O5gehDnwKI5h2U3oxTrF8Q==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/import": { + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/@lerna/import/-/import-3.22.0.tgz", + "integrity": "sha512-uWOlexasM5XR6tXi4YehODtH9Y3OZrFht3mGUFFT3OIl2s+V85xIGFfqFGMTipMPAGb2oF1UBLL48kR43hRsOg==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.21.0", + "@lerna/prompt": "3.18.5", + "@lerna/pulse-till-done": "3.13.0", + "@lerna/validation-error": "3.13.0", + "dedent": "^0.7.0", + "fs-extra": "^8.1.0", + "p-map-series": "^1.0.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/info": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/info/-/info-3.21.0.tgz", + "integrity": "sha512-0XDqGYVBgWxUquFaIptW2bYSIu6jOs1BtkvRTWDDhw4zyEdp6q4eaMvqdSap1CG+7wM5jeLCi6z94wS0AuiuwA==", + "dev": true, + "requires": { + "@lerna/command": "3.21.0", + "@lerna/output": "3.13.0", + "envinfo": "^7.3.1" + } + }, + "@lerna/init": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/init/-/init-3.21.0.tgz", + "integrity": "sha512-6CM0z+EFUkFfurwdJCR+LQQF6MqHbYDCBPyhu/d086LRf58GtYZYj49J8mKG9ktayp/TOIxL/pKKjgLD8QBPOg==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/command": "3.21.0", + "fs-extra": "^8.1.0", + "p-map": "^2.1.0", + "write-json-file": "^3.2.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/link": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/link/-/link-3.21.0.tgz", + "integrity": "sha512-tGu9GxrX7Ivs+Wl3w1+jrLi1nQ36kNI32dcOssij6bg0oZ2M2MDEFI9UF2gmoypTaN9uO5TSsjCFS7aR79HbdQ==", + "dev": true, + "requires": { + "@lerna/command": "3.21.0", + "@lerna/package-graph": "3.18.5", + "@lerna/symlink-dependencies": "3.17.0", + "p-map": "^2.1.0", + "slash": "^2.0.0" + } + }, + "@lerna/list": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/list/-/list-3.21.0.tgz", + "integrity": "sha512-KehRjE83B1VaAbRRkRy6jLX1Cin8ltsrQ7FHf2bhwhRHK0S54YuA6LOoBnY/NtA8bHDX/Z+G5sMY78X30NS9tg==", + "dev": true, + "requires": { + "@lerna/command": "3.21.0", + "@lerna/filter-options": "3.20.0", + "@lerna/listable": "3.18.5", + "@lerna/output": "3.13.0" + } + }, + "@lerna/listable": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/listable/-/listable-3.18.5.tgz", + "integrity": "sha512-Sdr3pVyaEv5A7ZkGGYR7zN+tTl2iDcinryBPvtuv20VJrXBE8wYcOks1edBTcOWsPjCE/rMP4bo1pseyk3UTsg==", + "dev": true, + "requires": { + "@lerna/query-graph": "3.18.5", + "chalk": "^2.3.1", + "columnify": "^1.5.4" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@lerna/log-packed": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/log-packed/-/log-packed-3.16.0.tgz", + "integrity": "sha512-Fp+McSNBV/P2mnLUYTaSlG8GSmpXM7krKWcllqElGxvAqv6chk2K3c2k80MeVB4WvJ9tRjUUf+i7HUTiQ9/ckQ==", + "dev": true, + "requires": { + "byte-size": "^5.0.1", + "columnify": "^1.5.4", + "has-unicode": "^2.0.1", + "npmlog": "^4.1.2" + } + }, + "@lerna/npm-conf": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/npm-conf/-/npm-conf-3.16.0.tgz", + "integrity": "sha512-HbO3DUrTkCAn2iQ9+FF/eisDpWY5POQAOF1m7q//CZjdC2HSW3UYbKEGsSisFxSfaF9Z4jtrV+F/wX6qWs3CuA==", + "dev": true, + "requires": { + "config-chain": "^1.1.11", + "pify": "^4.0.1" + } + }, + "@lerna/npm-dist-tag": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/npm-dist-tag/-/npm-dist-tag-3.18.5.tgz", + "integrity": "sha512-xw0HDoIG6HreVsJND9/dGls1c+lf6vhu7yJoo56Sz5bvncTloYGLUppIfDHQr4ZvmPCK8rsh0euCVh2giPxzKQ==", + "dev": true, + "requires": { + "@evocateur/npm-registry-fetch": "^4.0.0", + "@lerna/otplease": "3.18.5", + "figgy-pudding": "^3.5.1", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@lerna/npm-install": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/npm-install/-/npm-install-3.16.5.tgz", + "integrity": "sha512-hfiKk8Eku6rB9uApqsalHHTHY+mOrrHeWEs+gtg7+meQZMTS3kzv4oVp5cBZigndQr3knTLjwthT/FX4KvseFg==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/get-npm-exec-opts": "3.13.0", + "fs-extra": "^8.1.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "signal-exit": "^3.0.2", + "write-pkg": "^3.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/npm-publish": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/npm-publish/-/npm-publish-3.18.5.tgz", + "integrity": "sha512-3etLT9+2L8JAx5F8uf7qp6iAtOLSMj+ZYWY6oUgozPi/uLqU0/gsMsEXh3F0+YVW33q0M61RpduBoAlOOZnaTg==", + "dev": true, + "requires": { + "@evocateur/libnpmpublish": "^1.2.2", + "@lerna/otplease": "3.18.5", + "@lerna/run-lifecycle": "3.16.2", + "figgy-pudding": "^3.5.1", + "fs-extra": "^8.1.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "pify": "^4.0.1", + "read-package-json": "^2.0.13" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/npm-run-script": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/npm-run-script/-/npm-run-script-3.16.5.tgz", + "integrity": "sha512-1asRi+LjmVn3pMjEdpqKJZFT/3ZNpb+VVeJMwrJaV/3DivdNg7XlPK9LTrORuKU4PSvhdEZvJmSlxCKyDpiXsQ==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "@lerna/get-npm-exec-opts": "3.13.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/otplease": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/otplease/-/otplease-3.18.5.tgz", + "integrity": "sha512-S+SldXAbcXTEDhzdxYLU0ZBKuYyURP/ND2/dK6IpKgLxQYh/z4ScljPDMyKymmEvgiEJmBsPZAAPfmNPEzxjog==", + "dev": true, + "requires": { + "@lerna/prompt": "3.18.5", + "figgy-pudding": "^3.5.1" + } + }, + "@lerna/output": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/output/-/output-3.13.0.tgz", + "integrity": "sha512-7ZnQ9nvUDu/WD+bNsypmPG5MwZBwu86iRoiW6C1WBuXXDxM5cnIAC1m2WxHeFnjyMrYlRXM9PzOQ9VDD+C15Rg==", + "dev": true, + "requires": { + "npmlog": "^4.1.2" + } + }, + "@lerna/pack-directory": { + "version": "3.16.4", + "resolved": "https://registry.npmjs.org/@lerna/pack-directory/-/pack-directory-3.16.4.tgz", + "integrity": "sha512-uxSF0HZeGyKaaVHz5FroDY9A5NDDiCibrbYR6+khmrhZtY0Bgn6hWq8Gswl9iIlymA+VzCbshWIMX4o2O8C8ng==", + "dev": true, + "requires": { + "@lerna/get-packed": "3.16.0", + "@lerna/package": "3.16.0", + "@lerna/run-lifecycle": "3.16.2", + "figgy-pudding": "^3.5.1", + "npm-packlist": "^1.4.4", + "npmlog": "^4.1.2", + "tar": "^4.4.10", + "temp-write": "^3.4.0" + } + }, + "@lerna/package": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/package/-/package-3.16.0.tgz", + "integrity": "sha512-2lHBWpaxcBoiNVbtyLtPUuTYEaB/Z+eEqRS9duxpZs6D+mTTZMNy6/5vpEVSCBmzvdYpyqhqaYjjSLvjjr5Riw==", + "dev": true, + "requires": { + "load-json-file": "^5.3.0", + "npm-package-arg": "^6.1.0", + "write-pkg": "^3.1.0" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@lerna/package-graph": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/package-graph/-/package-graph-3.18.5.tgz", + "integrity": "sha512-8QDrR9T+dBegjeLr+n9WZTVxUYUhIUjUgZ0gvNxUBN8S1WB9r6H5Yk56/MVaB64tA3oGAN9IIxX6w0WvTfFudA==", + "dev": true, + "requires": { + "@lerna/prerelease-id-from-version": "3.16.0", + "@lerna/validation-error": "3.13.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "semver": "^6.2.0" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/prerelease-id-from-version": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.16.0.tgz", + "integrity": "sha512-qZyeUyrE59uOK8rKdGn7jQz+9uOpAaF/3hbslJVFL1NqF9ELDTqjCPXivuejMX/lN4OgD6BugTO4cR7UTq/sZA==", + "dev": true, + "requires": { + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@lerna/profiler": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@lerna/profiler/-/profiler-3.20.0.tgz", + "integrity": "sha512-bh8hKxAlm6yu8WEOvbLENm42i2v9SsR4WbrCWSbsmOElx3foRnMlYk7NkGECa+U5c3K4C6GeBbwgqs54PP7Ljg==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1", + "fs-extra": "^8.1.0", + "npmlog": "^4.1.2", + "upath": "^1.2.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/project": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/project/-/project-3.21.0.tgz", + "integrity": "sha512-xT1mrpET2BF11CY32uypV2GPtPVm6Hgtha7D81GQP9iAitk9EccrdNjYGt5UBYASl4CIDXBRxwmTTVGfrCx82A==", + "dev": true, + "requires": { + "@lerna/package": "3.16.0", + "@lerna/validation-error": "3.13.0", + "cosmiconfig": "^5.1.0", + "dedent": "^0.7.0", + "dot-prop": "^4.2.0", + "glob-parent": "^5.0.0", + "globby": "^9.2.0", + "load-json-file": "^5.3.0", + "npmlog": "^4.1.2", + "p-map": "^2.1.0", + "resolve-from": "^4.0.0", + "write-json-file": "^3.2.0" + } + }, + "@lerna/prompt": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/prompt/-/prompt-3.18.5.tgz", + "integrity": "sha512-rkKj4nm1twSbBEb69+Em/2jAERK8htUuV8/xSjN0NPC+6UjzAwY52/x9n5cfmpa9lyKf/uItp7chCI7eDmNTKQ==", + "dev": true, + "requires": { + "inquirer": "^6.2.0", + "npmlog": "^4.1.2" + } + }, + "@lerna/publish": { + "version": "3.22.1", + "resolved": "https://registry.npmjs.org/@lerna/publish/-/publish-3.22.1.tgz", + "integrity": "sha512-PG9CM9HUYDreb1FbJwFg90TCBQooGjj+n/pb3gw/eH5mEDq0p8wKdLFe0qkiqUkm/Ub5C8DbVFertIo0Vd0zcw==", + "dev": true, + "requires": { + "@evocateur/libnpmaccess": "^3.1.2", + "@evocateur/npm-registry-fetch": "^4.0.0", + "@evocateur/pacote": "^9.6.3", + "@lerna/check-working-tree": "3.16.5", + "@lerna/child-process": "3.16.5", + "@lerna/collect-updates": "3.20.0", + "@lerna/command": "3.21.0", + "@lerna/describe-ref": "3.16.5", + "@lerna/log-packed": "3.16.0", + "@lerna/npm-conf": "3.16.0", + "@lerna/npm-dist-tag": "3.18.5", + "@lerna/npm-publish": "3.18.5", + "@lerna/otplease": "3.18.5", + "@lerna/output": "3.13.0", + "@lerna/pack-directory": "3.16.4", + "@lerna/prerelease-id-from-version": "3.16.0", + "@lerna/prompt": "3.18.5", + "@lerna/pulse-till-done": "3.13.0", + "@lerna/run-lifecycle": "3.16.2", + "@lerna/run-topologically": "3.18.5", + "@lerna/validation-error": "3.13.0", + "@lerna/version": "3.22.1", + "figgy-pudding": "^3.5.1", + "fs-extra": "^8.1.0", + "npm-package-arg": "^6.1.0", + "npmlog": "^4.1.2", + "p-finally": "^1.0.0", + "p-map": "^2.1.0", + "p-pipe": "^1.2.0", + "semver": "^6.2.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/pulse-till-done": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/pulse-till-done/-/pulse-till-done-3.13.0.tgz", + "integrity": "sha512-1SOHpy7ZNTPulzIbargrgaJX387csN7cF1cLOGZiJQA6VqnS5eWs2CIrG8i8wmaUavj2QlQ5oEbRMVVXSsGrzA==", + "dev": true, + "requires": { + "npmlog": "^4.1.2" + } + }, + "@lerna/query-graph": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/query-graph/-/query-graph-3.18.5.tgz", + "integrity": "sha512-50Lf4uuMpMWvJ306be3oQDHrWV42nai9gbIVByPBYJuVW8dT8O8pA3EzitNYBUdLL9/qEVbrR0ry1HD7EXwtRA==", + "dev": true, + "requires": { + "@lerna/package-graph": "3.18.5", + "figgy-pudding": "^3.5.1" + } + }, + "@lerna/resolve-symlink": { + "version": "3.16.0", + "resolved": "https://registry.npmjs.org/@lerna/resolve-symlink/-/resolve-symlink-3.16.0.tgz", + "integrity": "sha512-Ibj5e7njVHNJ/NOqT4HlEgPFPtPLWsO7iu59AM5bJDcAJcR96mLZ7KGVIsS2tvaO7akMEJvt2P+ErwCdloG3jQ==", + "dev": true, + "requires": { + "fs-extra": "^8.1.0", + "npmlog": "^4.1.2", + "read-cmd-shim": "^1.0.1" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/rimraf-dir": { + "version": "3.16.5", + "resolved": "https://registry.npmjs.org/@lerna/rimraf-dir/-/rimraf-dir-3.16.5.tgz", + "integrity": "sha512-bQlKmO0pXUsXoF8lOLknhyQjOZsCc0bosQDoX4lujBXSWxHVTg1VxURtWf2lUjz/ACsJVDfvHZbDm8kyBk5okA==", + "dev": true, + "requires": { + "@lerna/child-process": "3.16.5", + "npmlog": "^4.1.2", + "path-exists": "^3.0.0", + "rimraf": "^2.6.2" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "@lerna/run": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/@lerna/run/-/run-3.21.0.tgz", + "integrity": "sha512-fJF68rT3veh+hkToFsBmUJ9MHc9yGXA7LSDvhziAojzOb0AI/jBDp6cEcDQyJ7dbnplba2Lj02IH61QUf9oW0Q==", + "dev": true, + "requires": { + "@lerna/command": "3.21.0", + "@lerna/filter-options": "3.20.0", + "@lerna/npm-run-script": "3.16.5", + "@lerna/output": "3.13.0", + "@lerna/profiler": "3.20.0", + "@lerna/run-topologically": "3.18.5", + "@lerna/timer": "3.13.0", + "@lerna/validation-error": "3.13.0", + "p-map": "^2.1.0" + } + }, + "@lerna/run-lifecycle": { + "version": "3.16.2", + "resolved": "https://registry.npmjs.org/@lerna/run-lifecycle/-/run-lifecycle-3.16.2.tgz", + "integrity": "sha512-RqFoznE8rDpyyF0rOJy3+KjZCeTkO8y/OB9orPauR7G2xQ7PTdCpgo7EO6ZNdz3Al+k1BydClZz/j78gNCmL2A==", + "dev": true, + "requires": { + "@lerna/npm-conf": "3.16.0", + "figgy-pudding": "^3.5.1", + "npm-lifecycle": "^3.1.2", + "npmlog": "^4.1.2" + } + }, + "@lerna/run-topologically": { + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@lerna/run-topologically/-/run-topologically-3.18.5.tgz", + "integrity": "sha512-6N1I+6wf4hLOnPW+XDZqwufyIQ6gqoPfHZFkfWlvTQ+Ue7CuF8qIVQ1Eddw5HKQMkxqN10thKOFfq/9NQZ4NUg==", + "dev": true, + "requires": { + "@lerna/query-graph": "3.18.5", + "figgy-pudding": "^3.5.1", + "p-queue": "^4.0.0" + } + }, + "@lerna/symlink-binary": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@lerna/symlink-binary/-/symlink-binary-3.17.0.tgz", + "integrity": "sha512-RLpy9UY6+3nT5J+5jkM5MZyMmjNHxZIZvXLV+Q3MXrf7Eaa1hNqyynyj4RO95fxbS+EZc4XVSk25DGFQbcRNSQ==", + "dev": true, + "requires": { + "@lerna/create-symlink": "3.16.2", + "@lerna/package": "3.16.0", + "fs-extra": "^8.1.0", + "p-map": "^2.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/symlink-dependencies": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/@lerna/symlink-dependencies/-/symlink-dependencies-3.17.0.tgz", + "integrity": "sha512-KmjU5YT1bpt6coOmdFueTJ7DFJL4H1w5eF8yAQ2zsGNTtZ+i5SGFBWpb9AQaw168dydc3s4eu0W0Sirda+F59Q==", + "dev": true, + "requires": { + "@lerna/create-symlink": "3.16.2", + "@lerna/resolve-symlink": "3.16.0", + "@lerna/symlink-binary": "3.17.0", + "fs-extra": "^8.1.0", + "p-finally": "^1.0.0", + "p-map": "^2.1.0", + "p-map-series": "^1.0.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, + "@lerna/timer": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/timer/-/timer-3.13.0.tgz", + "integrity": "sha512-RHWrDl8U4XNPqY5MQHkToWS9jHPnkLZEt5VD+uunCKTfzlxGnRCr3/zVr8VGy/uENMYpVP3wJa4RKGY6M0vkRw==", + "dev": true + }, + "@lerna/validation-error": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/validation-error/-/validation-error-3.13.0.tgz", + "integrity": "sha512-SiJP75nwB8GhgwLKQfdkSnDufAaCbkZWJqEDlKOUPUvVOplRGnfL+BPQZH5nvq2BYSRXsksXWZ4UHVnQZI/HYA==", + "dev": true, + "requires": { + "npmlog": "^4.1.2" + } + }, + "@lerna/version": { + "version": "3.22.1", + "resolved": "https://registry.npmjs.org/@lerna/version/-/version-3.22.1.tgz", + "integrity": "sha512-PSGt/K1hVqreAFoi3zjD0VEDupQ2WZVlVIwesrE5GbrL2BjXowjCsTDPqblahDUPy0hp6h7E2kG855yLTp62+g==", + "dev": true, + "requires": { + "@lerna/check-working-tree": "3.16.5", + "@lerna/child-process": "3.16.5", + "@lerna/collect-updates": "3.20.0", + "@lerna/command": "3.21.0", + "@lerna/conventional-commits": "3.22.0", + "@lerna/github-client": "3.22.0", + "@lerna/gitlab-client": "3.15.0", + "@lerna/output": "3.13.0", + "@lerna/prerelease-id-from-version": "3.16.0", + "@lerna/prompt": "3.18.5", + "@lerna/run-lifecycle": "3.16.2", + "@lerna/run-topologically": "3.18.5", + "@lerna/validation-error": "3.13.0", + "chalk": "^2.3.1", + "dedent": "^0.7.0", + "load-json-file": "^5.3.0", + "minimatch": "^3.0.4", + "npmlog": "^4.1.2", + "p-map": "^2.1.0", + "p-pipe": "^1.2.0", + "p-reduce": "^1.0.0", + "p-waterfall": "^1.0.0", + "semver": "^6.2.0", + "slash": "^2.0.0", + "temp-write": "^3.4.0", + "write-json-file": "^3.2.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@lerna/write-log-file": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@lerna/write-log-file/-/write-log-file-3.13.0.tgz", + "integrity": "sha512-RibeMnDPvlL8bFYW5C8cs4mbI3AHfQef73tnJCQ/SgrXZHehmHnsyWUiE7qDQCAo+B1RfTapvSyFF69iPj326A==", + "dev": true, + "requires": { + "npmlog": "^4.1.2", + "write-file-atomic": "^2.3.0" + } + }, + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + } + } + }, + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, + "@octokit/auth-token": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", + "integrity": "sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ==", + "dev": true, + "requires": { + "@octokit/types": "^5.0.0" + } + }, + "@octokit/endpoint": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.6.tgz", + "integrity": "sha512-7Cc8olaCoL/mtquB7j/HTbPM+sY6Ebr4k2X2y4JoXpVKQ7r5xB4iGQE0IoO58wIPsUk4AzoT65AMEpymSbWTgQ==", + "dev": true, + "requires": { + "@octokit/types": "^5.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true + }, + "universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true + } + } + }, + "@octokit/plugin-enterprise-rest": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz", + "integrity": "sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw==", + "dev": true + }, + "@octokit/plugin-paginate-rest": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", + "integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.1" + }, + "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } + } + }, + "@octokit/plugin-request-log": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.0.tgz", + "integrity": "sha512-ywoxP68aOT3zHCLgWZgwUJatiENeHE7xJzYjfz8WI0goynp96wETBF+d95b8g/uL4QmS6owPVlaxiz3wyMAzcw==", + "dev": true + }, + "@octokit/plugin-rest-endpoint-methods": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz", + "integrity": "sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.1", + "deprecation": "^2.3.1" + }, + "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } + } + }, + "@octokit/request": { + "version": "5.4.9", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.9.tgz", + "integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==", + "dev": true, + "requires": { + "@octokit/endpoint": "^6.0.1", + "@octokit/request-error": "^2.0.0", + "@octokit/types": "^5.0.0", + "deprecation": "^2.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.1", + "once": "^1.4.0", + "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "@octokit/request-error": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz", + "integrity": "sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==", + "dev": true, + "requires": { + "@octokit/types": "^5.0.1", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true + }, + "universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true + } + } + }, + "@octokit/request-error": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz", + "integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==", + "dev": true, + "requires": { + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "dependencies": { + "@octokit/types": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", + "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + } + } + }, + "@octokit/rest": { + "version": "16.43.2", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz", + "integrity": "sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ==", + "dev": true, + "requires": { + "@octokit/auth-token": "^2.4.0", + "@octokit/plugin-paginate-rest": "^1.1.1", + "@octokit/plugin-request-log": "^1.0.0", + "@octokit/plugin-rest-endpoint-methods": "2.4.0", + "@octokit/request": "^5.2.0", + "@octokit/request-error": "^1.0.2", + "atob-lite": "^2.0.0", + "before-after-hook": "^2.0.0", + "btoa-lite": "^1.0.0", + "deprecation": "^2.0.0", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "octokit-pagination-methods": "^1.1.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" + } + }, + "@octokit/types": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz", + "integrity": "sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==", + "dev": true, + "requires": { + "@types/node": ">= 8" + } + }, + "@ts-morph/common": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.5.2.tgz", + "integrity": "sha512-eLmfYV6u6gUgHrB9QV9lpuWg3cD60mhXdv0jvM5exWR/Cor8HG+GziFIj2hPEWHJknqzuU4meZd8DTqIzZfDRQ==", + "dev": true, + "requires": { + "@dsherret/to-absolute-glob": "^2.0.2", + "fast-glob": "^3.2.2", + "fs-extra": "^9.0.0", + "is-negated-glob": "^1.0.0", + "multimatch": "^4.0.0", + "typescript": "~3.9.7" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fast-glob": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "typescript": { + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "dev": true + } + } + }, + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "requires": { + "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" + } + } + }, + "@types/cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", + "dev": true + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/fs-extra": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.2.tgz", + "integrity": "sha512-jp0RI6xfZpi5JL8v7WQwpBEQTq63RqW2kxwTZt+m27LcJqQdPVU1yGnT1ZI4EtCDynQQJtIGyQahkiCGCS7e+A==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", + "dev": true, + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/lodash": { + "version": "4.14.161", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.161.tgz", + "integrity": "sha512-EP6O3Jkr7bXvZZSZYlsgt5DIjiGr0dXP1/jVEwVLTFgg0d+3lWVQkRavYVQszV7dYUwvg0B8R0MBDpcmXg7XIA==", + "dev": true + }, + "@types/lodash.clonedeep": { + "version": "4.5.6", + "resolved": "https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz", + "integrity": "sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==", + "dev": true, + "requires": { + "@types/lodash": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "dev": true + }, + "@types/mocha": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.0.3.tgz", + "integrity": "sha512-vyxR57nv8NfcU0GZu8EUXZLTbCMupIUwy95LJ6lllN+JRPG25CwMHoB1q5xKh8YKhQnHYRAn4yW2yuHbf/5xgg==", + "dev": true + }, + "@types/node": { + "version": "14.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.2.tgz", + "integrity": "sha512-jeYJU2kl7hL9U5xuI/BhKPZ4vqGM/OmK6whiFAXVhlstzZhVamWhDSmHyGLIp+RVyuF9/d0dqr2P85aFj4BvJg==", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "@types/npm-package-arg": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@types/npm-package-arg/-/npm-package-arg-6.1.0.tgz", + "integrity": "sha512-vbt5fb0y1svMhu++1lwtKmZL76d0uPChFlw7kEzyUmTwfmpHRcFb8i0R8ElT69q/L+QLgK2hgECivIAvaEDwag==", + "dev": true + }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "requires": { + "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" + } + } + }, + "@types/prettier": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz", + "integrity": "sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==", + "dev": true + }, + "@types/secp256k1": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "requires": { + "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" + } + } + }, + "@types/seedrandom": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz", + "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", + "dev": true + }, + "@types/superagent": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.10.tgz", + "integrity": "sha512-xAgkb2CMWUMCyVc/3+7iQfOEBE75NvuZeezvmixbUw3nmENf2tCnQkW5yQLTYqvXUQ+R6EXxdqKKbal2zM5V/g==", + "dev": true, + "requires": { + "@types/cookiejar": "*", + "@types/node": "*" + } + }, + "@types/uws": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", + "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/node": "*" + } + }, + "@types/ws": { + "version": "7.2.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.7.tgz", + "integrity": "sha512-UUFC/xxqFLP17hTva8/lVT0SybLUrfSD9c+iapKb0fEiC8uoDbA+xuZ3pAN603eW+bY8ebSMLm9jXdIPnD0ZgA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/yargs": { + "version": "15.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.9.tgz", + "integrity": "sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", + "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", + "dev": true + }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "@zkochan/cmd-shim": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", + "integrity": "sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg==", + "dev": true, + "requires": { + "is-windows": "^1.0.0", + "mkdirp-promise": "^5.0.1", + "mz": "^2.5.0" + } + }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + }, + "agentkeepalive": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", + "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", + "dev": true, + "requires": { + "humanize-ms": "^1.2.1" + } + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", + "dev": true + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "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.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "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==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-differ": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", + "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "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=", + "dev": true + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "requires": { + "async": "^2.4.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "atob-lite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", + "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "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=", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "before-after-hook": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", + "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", + "dev": true + }, + "bigint-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", + "optional": true, + "requires": { + "bindings": "^1.3.0" + } + }, + "binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "dev": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bip39": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", + "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", + "requires": { + "@types/node": "11.11.6", + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1" + }, + "dependencies": { + "@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" + } + } + }, + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "btoa-lite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", + "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", + "dev": true + }, + "buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og=", + "dev": true + }, + "byline": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz", + "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=", + "dev": true + }, + "byte-size": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz", + "integrity": "sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw==", + "dev": true + }, + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "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" + } + }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + }, + "dependencies": { + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + } + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "camelcase": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz", + "integrity": "sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==", + "dev": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "checkpoint-store": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", + "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", + "requires": { + "functional-red-black-tree": "^1.0.1" + } + }, + "chokidar": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", + "integrity": "sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "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==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-highlight": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.4.tgz", + "integrity": "sha512-s7Zofobm20qriqDoU9sXptQx0t2R9PEgac92mENNm7xaEe1hn71IIMsXMK+6encA6WRCWWxIGQbipr3q998tlQ==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "highlight.js": "^9.6.0", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^5.1.1", + "yargs": "^15.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, + "code-block-writer": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.0.tgz", + "integrity": "sha512-RG9hpXtWFeUWhuUav1YuP/vGcyncW+t90yJLk9fNZs1De2OuHTHKAKThVCokt29PYq5RoJ0QSZaIZ+rvPO23hA==", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "columnify": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", + "integrity": "sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=", + "dev": true, + "requires": { + "strip-ansi": "^3.0.0", + "wcwidth": "^1.0.0" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true + }, + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "requires": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + }, + "dependencies": { + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + } + } + }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "config-chain": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", + "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", + "dev": true, + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "conventional-changelog-angular": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", + "integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "q": "^1.5.1" + } + }, + "conventional-changelog-core": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz", + "integrity": "sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ==", + "dev": true, + "requires": { + "conventional-changelog-writer": "^4.0.6", + "conventional-commits-parser": "^3.0.3", + "dateformat": "^3.0.0", + "get-pkg-repo": "^1.0.0", + "git-raw-commits": "2.0.0", + "git-remote-origin-url": "^2.0.0", + "git-semver-tags": "^2.0.3", + "lodash": "^4.2.1", + "normalize-package-data": "^2.3.5", + "q": "^1.5.1", + "read-pkg": "^3.0.0", + "read-pkg-up": "^3.0.0", + "through2": "^3.0.0" + }, + "dependencies": { + "through2": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "2 || 3" + } + } + } + }, + "conventional-changelog-preset-loader": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", + "dev": true + }, + "conventional-changelog-writer": { + "version": "4.0.17", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz", + "integrity": "sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "conventional-commits-filter": "^2.0.6", + "dateformat": "^3.0.0", + "handlebars": "^4.7.6", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.15", + "meow": "^7.0.0", + "semver": "^6.0.0", + "split": "^1.0.0", + "through2": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "through2": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "2 || 3" + } + } + } + }, + "conventional-commits-filter": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz", + "integrity": "sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==", + "dev": true, + "requires": { + "lodash.ismatch": "^4.4.0", + "modify-values": "^1.0.0" + } + }, + "conventional-commits-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz", + "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.4", + "is-text-path": "^1.0.1", + "lodash": "^4.17.15", + "meow": "^7.0.0", + "split2": "^2.0.0", + "through2": "^3.0.0", + "trim-off-newlines": "^1.0.0" + }, + "dependencies": { + "through2": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "2 || 3" + } + } + } + }, + "conventional-recommended-bump": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-5.0.1.tgz", + "integrity": "sha512-RVdt0elRcCxL90IrNP0fYCpq1uGt2MALko0eyeQ+zQuDVWtMGAy9ng6yYn3kax42lCj9+XBxQ8ZN6S9bdKxDhQ==", + "dev": true, + "requires": { + "concat-stream": "^2.0.0", + "conventional-changelog-preset-loader": "^2.1.1", + "conventional-commits-filter": "^2.0.2", + "conventional-commits-parser": "^3.0.3", + "git-raw-commits": "2.0.0", + "git-semver-tags": "^2.0.3", + "meow": "^4.0.0", + "q": "^1.5.1" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "meow": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" + } + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + } + } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js-pure": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" + }, + "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=" + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-env": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz", + "integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true + }, + "dargs": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", + "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "debuglog": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=", + "dev": true + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": 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=", + "dev": true + }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + } + } + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "defined": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", + "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, + "detect-indent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", + "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50=", + "dev": true + }, + "dezalgo": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz", + "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", + "dev": true, + "requires": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "dir-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", + "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "dev": true, + "requires": { + "path-type": "^3.0.0" + } + }, + "dot-prop": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", + "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", + "dev": true, + "requires": { + "is-obj": "^1.0.0" + } + }, + "duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "dev": true + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emittery": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", + "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==" + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "requires": { + "iconv-lite": "^0.6.2" + } + }, + "encoding-down": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", + "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", + "requires": { + "abstract-leveldown": "^5.0.0", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0", + "xtend": "^4.0.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "requires": { + "buffer": "^5.6.0" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "env-paths": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", + "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==", + "dev": true + }, + "envinfo": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz", + "integrity": "sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==", + "dev": true + }, + "err-code": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", + "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=", + "dev": true + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3" + } + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "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=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "ethashjs": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz", + "integrity": "sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==", + "requires": { + "async": "^2.1.2", + "buffer-xor": "^2.0.1", + "ethereumjs-util": "^7.0.2", + "miller-rabin": "^4.0.0" + }, + "dependencies": { + "buffer-xor": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "requires": { + "safe-buffer": "^5.1.1" + } + } + } + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "ethereumjs-account": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", + "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", + "requires": { + "ethereumjs-util": "^6.0.0", + "rlp": "^2.2.1", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-block": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "requires": { + "async": "^2.0.1", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "ethereumjs-blockchain": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz", + "integrity": "sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ==", + "requires": { + "async": "^2.6.1", + "ethashjs": "~0.0.7", + "ethereumjs-block": "~2.2.2", + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.1.0", + "flow-stoplight": "^1.0.0", + "level-mem": "^3.0.1", + "lru-cache": "^5.1.1", + "rlp": "^2.2.2", + "semaphore": "^1.1.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-common": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", + "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-util": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz", + "integrity": "sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.4" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==" + } + } + }, + "ethereumjs-vm": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz", + "integrity": "sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==", + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "core-js-pure": "^3.0.1", + "ethereumjs-account": "^3.0.0", + "ethereumjs-block": "^2.2.2", + "ethereumjs-blockchain": "^4.0.3", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^6.2.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.3.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1", + "util.promisify": "^1.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "eventemitter3": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "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": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "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==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fake-merkle-patricia-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", + "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", + "requires": { + "checkpoint-store": "^1.1.0" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + }, + "dependencies": { + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + } + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-safe-stringify": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", + "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", + "dev": true + }, + "fastq": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", + "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "flow-stoplight": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", + "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "follow-redirects": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", + "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "formidable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", + "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "fromentries": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", + "integrity": "sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==", + "dev": true + }, + "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=", + "dev": true + }, + "fs-extra": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "dev": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" + } + }, + "fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, + "requires": { + "minipass": "^2.6.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "genfun": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz", + "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-pkg-repo": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", + "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "meow": "^3.3.0", + "normalize-package-data": "^2.3.0", + "parse-github-repo-url": "^1.3.0", + "through2": "^2.0.0" + }, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "^4.0.1" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + } + } + }, + "get-port": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-4.2.0.tgz", + "integrity": "sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw==", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "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" + } + }, + "git-config-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", + "integrity": "sha1-bTP37WPbDQ4RgTFQO6s6ykfVRmQ=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "homedir-polyfill": "^1.0.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "git-raw-commits": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", + "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", + "dev": true, + "requires": { + "dargs": "^4.0.1", + "lodash.template": "^4.0.2", + "meow": "^4.0.0", + "split2": "^2.0.0", + "through2": "^2.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "meow": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" + } + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + } + } + }, + "git-remote-origin-url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", + "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", + "dev": true, + "requires": { + "gitconfiglocal": "^1.0.0", + "pify": "^2.3.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "git-semver-tags": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-2.0.3.tgz", + "integrity": "sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA==", + "dev": true, + "requires": { + "meow": "^4.0.0", + "semver": "^6.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "meow": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist": "^1.1.3", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0" + } + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + } + } + }, + "git-up": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/git-up/-/git-up-4.0.2.tgz", + "integrity": "sha512-kbuvus1dWQB2sSW4cbfTeGpCMd8ge9jx9RKnhXhuJ7tnvT+NIrTVfYZxjtflZddQYcmdOTlkAcjmx7bor+15AQ==", + "dev": true, + "requires": { + "is-ssh": "^1.3.0", + "parse-url": "^5.0.0" + } + }, + "git-url-parse": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.2.0.tgz", + "integrity": "sha512-KPoHZg8v+plarZvto4ruIzzJLFQoRx+sUs5DQSr07By9IBKguVd+e6jwrFR6/TP6xrCJlNV1tPqLO1aREc7O2g==", + "dev": true, + "requires": { + "git-up": "^4.0.0" + } + }, + "git-user-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/git-user-name/-/git-user-name-2.0.0.tgz", + "integrity": "sha512-1DC8rUNm2I5V9v4eIpK6PSjKCp9bI0t6Wl05WSk+xEMS8GhR8GWzxM3aGZfPrfuqEfWxSbui5/pQJryJFXqCzQ==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "git-config-path": "^1.0.1", + "parse-git-config": "^1.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "gitconfiglocal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", + "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", + "dev": true, + "requires": { + "ini": "^1.3.2" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "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" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "globby": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", + "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^1.0.2", + "dir-glob": "^2.2.2", + "fast-glob": "^2.2.6", + "glob": "^7.1.3", + "ignore": "^4.0.3", + "pify": "^4.0.1", + "slash": "^2.0.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "handlebars": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hasha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "dependencies": { + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "hdkey": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-2.0.1.tgz", + "integrity": "sha512-c+tl9PHG9/XkGgG0tD7CJpRVaE0jfZizDNmnErUAKQ4EjQSOcOUcV3EN9ZEZS8pZ4usaeiiK0H7stzuzna8feA==", + "requires": { + "bs58check": "^2.1.2", + "safe-buffer": "^5.1.1", + "secp256k1": "^4.0.0" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "highlight.js": { + "version": "9.18.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.3.tgz", + "integrity": "sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ==", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-cache-semantics": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz", + "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==", + "dev": true + }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "dev": true, + "requires": { + "agent-base": "4", + "debug": "3.1.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-proxy-agent": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", + "dev": true, + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + } + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "requires": { + "ms": "^2.0.0" + } + }, + "husky": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.0.tgz", + "integrity": "sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^7.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "cosmiconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + } + } + }, + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "ignore-walk": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", + "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "init-package-json": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz", + "integrity": "sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==", + "dev": true, + "requires": { + "glob": "^7.1.1", + "npm-package-arg": "^4.0.0 || ^5.0.0 || ^6.0.0", + "promzard": "^0.3.0", + "read": "~1.0.1", + "read-package-json": "1 || 2", + "semver": "2.x || 3.x || 4 || 5", + "validate-npm-package-license": "^3.0.1", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + } + } + }, + "inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true + }, + "into-stream": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz", + "integrity": "sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==", + "dev": true, + "requires": { + "from2": "^2.3.0", + "p-is-promise": "^3.0.0" + } + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "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=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "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==", + "dev": true + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=" + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "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==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-ssh": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz", + "integrity": "sha512-elEw0/0c2UscLrNG+OAorbP539E3rhliKPg+hDMWN9VwrDXfYK+4PBEykDPfxlYYtQvl84TascnQyobfQLHEhQ==", + "dev": true, + "requires": { + "protocols": "^1.1.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-text-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", + "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", + "dev": true, + "requires": { + "text-extensions": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + }, + "dependencies": { + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "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=", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", + "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^1.0.0" + } + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keccak": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", + "integrity": "sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==", + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "lerna": { + "version": "3.22.1", + "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.22.1.tgz", + "integrity": "sha512-vk1lfVRFm+UuEFA7wkLKeSF7Iz13W+N/vFd48aW2yuS7Kv0RbNm2/qcDPV863056LMfkRlsEe+QYOw3palj5Lg==", + "dev": true, + "requires": { + "@lerna/add": "3.21.0", + "@lerna/bootstrap": "3.21.0", + "@lerna/changed": "3.21.0", + "@lerna/clean": "3.21.0", + "@lerna/cli": "3.18.5", + "@lerna/create": "3.22.0", + "@lerna/diff": "3.21.0", + "@lerna/exec": "3.21.0", + "@lerna/import": "3.22.0", + "@lerna/info": "3.21.0", + "@lerna/init": "3.21.0", + "@lerna/link": "3.21.0", + "@lerna/list": "3.21.0", + "@lerna/publish": "3.22.1", + "@lerna/run": "3.21.0", + "@lerna/version": "3.22.1", + "import-local": "^2.0.0", + "npmlog": "^4.1.2" + } + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + }, + "level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-mem": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", + "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", + "requires": { + "level-packager": "~4.0.0", + "memdown": "~3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, + "memdown": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", + "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", + "requires": { + "abstract-leveldown": "~5.0.0", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-option-wrap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/level-option-wrap/-/level-option-wrap-1.1.0.tgz", + "integrity": "sha1-rSDmjZ88IsiJdTHMaqevWWse0Sk=", + "requires": { + "defined": "~0.0.0" + } + }, + "level-packager": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", + "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", + "requires": { + "encoding-down": "~5.0.0", + "levelup": "^3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", + "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", + "requires": { + "abstract-leveldown": "~5.0.0", + "inherits": "^2.0.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", + "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "xtend": "^4.0.0" + } + }, + "levelup": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", + "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", + "requires": { + "deferred-leveldown": "~4.0.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~3.0.0", + "xtend": "~4.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "requires": { + "xtend": "^4.0.2" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "leveldown": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", + "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", + "requires": { + "abstract-leveldown": "~6.2.1", + "napi-macros": "~2.0.0", + "node-gyp-build": "~4.1.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "node-gyp-build": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", + "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "load-json-file": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", + "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "parse-json": "^4.0.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0", + "type-fest": "^0.3.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.ismatch": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", + "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", + "dev": true + }, + "lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "lodash.template": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "dev": true, + "requires": { + "lodash._reinterpolate": "^3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", + "dev": true, + "requires": { + "lodash._reinterpolate": "^3.0.0" + } + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + }, + "macos-release": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz", + "integrity": "sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg==", + "dev": true + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "make-fetch-happen": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz", + "integrity": "sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==", + "dev": true, + "requires": { + "agentkeepalive": "^3.4.1", + "cacache": "^12.0.0", + "http-cache-semantics": "^3.8.1", + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "node-fetch-npm": "^2.0.2", + "promise-retry": "^1.1.1", + "socks-proxy-agent": "^4.0.0", + "ssri": "^6.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "~4.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "meow": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "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" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==", + "dev": true + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + } + }, + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, + "requires": { + "minipass": "^2.9.0" + } + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mkdirp-promise": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", + "dev": true, + "requires": { + "mkdirp": "*" + } + }, + "mocha": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.2.0.tgz", + "integrity": "sha512-lEWEMq2LMfNJMKeuEwb5UELi+OgFDollXaytR5ggQcHpzG3NP/R7rvixAvF+9/lLsTWhWG+4yD2M70GsM06nxw==", + "dev": true, + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.4.3", + "debug": "4.2.0", + "diff": "4.0.2", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.14.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.2", + "nanoid": "3.1.12", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "7.2.0", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.0.2", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "modify-values": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", + "dev": true + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "mri": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", + "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "multimatch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-3.0.0.tgz", + "integrity": "sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA==", + "dev": true, + "requires": { + "array-differ": "^2.0.3", + "array-union": "^1.0.2", + "arrify": "^1.0.1", + "minimatch": "^3.0.4" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "nanoid": { + "version": "3.1.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.12.tgz", + "integrity": "sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==", + "dev": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "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-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" + } + }, + "napi-macros": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", + "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "dev": true + }, + "node-fetch-npm": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz", + "integrity": "sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg==", + "dev": true, + "requires": { + "encoding": "^0.1.11", + "json-parse-better-errors": "^1.0.0", + "safe-buffer": "^5.1.1" + } + }, + "node-gyp": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.1.1.tgz", + "integrity": "sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw==", + "dev": true, + "requires": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.2", + "mkdirp": "^0.5.1", + "nopt": "^4.0.1", + "npmlog": "^4.1.2", + "request": "^2.88.0", + "rimraf": "^2.6.3", + "semver": "^5.7.1", + "tar": "^4.4.12", + "which": "^1.3.1" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" + }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz", + "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==", + "dev": true + }, + "npm-bundled": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "dev": true, + "requires": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-lifecycle": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz", + "integrity": "sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g==", + "dev": true, + "requires": { + "byline": "^5.0.0", + "graceful-fs": "^4.1.15", + "node-gyp": "^5.0.2", + "resolve-from": "^4.0.0", + "slide": "^1.1.6", + "uid-number": "0.0.6", + "umask": "^1.1.0", + "which": "^1.3.1" + }, + "dependencies": { + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "dev": true + }, + "npm-package-arg": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.0.tgz", + "integrity": "sha512-/ep6QDxBkm9HvOhOg0heitSd7JHA1U7y1qhhlRlteYYAi9Pdb/ZV7FW5aHpkrpM8+P+4p/jjR8zCyKPBMBjSig==", + "dev": true, + "requires": { + "hosted-git-info": "^3.0.6", + "semver": "^7.0.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "hosted-git-info": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.7.tgz", + "integrity": "sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "npm-packlist": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", + "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", + "dev": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "npm-pick-manifest": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz", + "integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1", + "npm-package-arg": "^6.0.0", + "semver": "^5.4.1" + }, + "dependencies": { + "npm-package-arg": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz", + "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==", + "dev": true, + "requires": { + "hosted-git-info": "^2.7.1", + "osenv": "^0.1.5", + "semver": "^5.6.0", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + } + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + }, + "dependencies": { + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + } + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "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" + } + } + } + }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", + "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "octokit-pagination-methods": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", + "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "opencollective-postinstall": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", + "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-name": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", + "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", + "dev": true, + "requires": { + "macos-release": "^2.2.0", + "windows-release": "^3.1.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", + "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, + "p-map-series": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-map-series/-/p-map-series-1.0.0.tgz", + "integrity": "sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco=", + "dev": true, + "requires": { + "p-reduce": "^1.0.0" + } + }, + "p-pipe": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-pipe/-/p-pipe-1.2.0.tgz", + "integrity": "sha1-SxoROZoRUgpneQ7loMHViB1r7+k=", + "dev": true + }, + "p-queue": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-4.0.0.tgz", + "integrity": "sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg==", + "dev": true, + "requires": { + "eventemitter3": "^3.1.0" + } + }, + "p-reduce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", + "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", + "dev": true + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "p-waterfall": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-waterfall/-/p-waterfall-1.0.0.tgz", + "integrity": "sha1-ftlLPOszMngjU69qrhGqn8I1uwA=", + "dev": true, + "requires": { + "p-reduce": "^1.0.0" + } + }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, + "parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "dev": true, + "requires": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, + "parse-git-config": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", + "integrity": "sha1-06mYQxcTL1c5hxK7pDjhKVkN34w=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "git-config-path": "^1.0.1", + "ini": "^1.3.4" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "parse-github-repo-url": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", + "integrity": "sha1-nn2LslKmy2ukJZUGC3v23z28H1A=", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "parse-path": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.2.tgz", + "integrity": "sha512-HSqVz6iuXSiL8C1ku5Gl1Z5cwDd9Wo0q8CoffdAghP6bz8pJa1tcMC+m4N+z6VAS8QdksnIGq1TB6EgR4vPR6w==", + "dev": true, + "requires": { + "is-ssh": "^1.3.0", + "protocols": "^1.4.0" + } + }, + "parse-url": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/parse-url/-/parse-url-5.0.2.tgz", + "integrity": "sha512-Czj+GIit4cdWtxo3ISZCvLiUjErSo0iI3wJ+q9Oi3QuMYTI6OZu+7cewMWZ+C1YAnKhYTk6/TLuhIgCypLthPA==", + "dev": true, + "requires": { + "is-ssh": "^1.3.0", + "normalize-url": "^3.3.0", + "parse-path": "^4.0.0", + "protocols": "^1.4.0" + } + }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true + }, + "parse5-htmlparser2-tree-adapter": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-5.1.1.tgz", + "integrity": "sha512-CF+TKjXqoqyDwHqBhFQ+3l5t83xYi6fVT1tQNg+Ye0JRLnTxWvIroCjEp1A0k4lneHNBGnICUf0cfYVYGEazqw==", + "dev": true, + "requires": { + "parse5": "^5.1.1" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "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-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^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=", + "dev": true + }, + "prettier": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", + "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", + "dev": true + }, + "pretty-quick": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.1.0.tgz", + "integrity": "sha512-DtxIxksaUWCgPFN7E1ZZk4+Aav3CCuRdhrDSFZENb404sYMtuo9Zka823F+Mgeyt8Zt3bUiCjFzzWYE9LYqkmQ==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "execa": "^4.0.0", + "find-up": "^4.1.0", + "ignore": "^5.1.4", + "mri": "^1.1.5", + "multimatch": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "promise-retry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", + "integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=", + "dev": true, + "requires": { + "err-code": "^1.0.0", + "retry": "^0.10.0" + } + }, + "promzard": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", + "integrity": "sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=", + "dev": true, + "requires": { + "read": "1" + } + }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true + }, + "protocols": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz", + "integrity": "sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg==", + "dev": true + }, + "protoduck": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz", + "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==", + "dev": true, + "requires": { + "genfun": "^5.0.0" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "reachdown": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz", + "integrity": "sha512-6LsdRe4cZyOjw4NnvbhUd/rGG7WQ9HMopPr+kyL018Uci4kijtxcGR5kVb5Ln13k4PEE+fEFQbjfOvNw7cnXmA==" + }, + "read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", + "dev": true, + "requires": { + "mute-stream": "~0.0.4" + } + }, + "read-cmd-shim": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz", + "integrity": "sha512-v5yCqQ/7okKoZZkBQUAfTsQ3sVJtXdNfbPnI5cceppoxEVLYA3k+VtV2omkeo8MS94JCy4fSiUwlRBAwCVRPUA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2" + } + }, + "read-package-json": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz", + "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==", + "dev": true, + "requires": { + "glob": "^7.1.1", + "json-parse-even-better-errors": "^2.3.0", + "normalize-package-data": "^2.0.0", + "npm-normalize-package-bin": "^1.0.0" + } + }, + "read-package-tree": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz", + "integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==", + "dev": true, + "requires": { + "read-package-json": "^2.0.0", + "readdir-scoped-modules": "^1.0.0", + "util-promisify": "^2.1.0" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + } + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "readdir-scoped-modules": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz", + "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==", + "dev": true, + "requires": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "graceful-fs": "^4.1.2", + "once": "^1.3.0" + } + }, + "readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "retry": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", + "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "requires": { + "bn.js": "^4.11.1" + } + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + }, + "rxjs": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "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==", + "dev": true + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" + }, + "semaphore": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", + "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, + "serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "shx": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.3.tgz", + "integrity": "sha512-nZJ3HFWVoTSyyB+evEKjJ1STiixGztlqwKLTUNV5KqMWtGey9fTd4KU1gdZ1X9BV6215pswQ/Jew9NsuS/fNDA==", + "dev": true, + "requires": { + "minimist": "^1.2.3", + "shelljs": "^0.8.4" + } + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "dev": true + }, + "smart-buffer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", + "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "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": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "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==", + "dev": true, + "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=", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "socks": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz", + "integrity": "sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==", + "dev": true, + "requires": { + "ip": "1.1.5", + "smart-buffer": "^4.1.0" + } + }, + "socks-proxy-agent": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", + "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", + "dev": true, + "requires": { + "agent-base": "~4.2.1", + "socks": "~2.3.2" + }, + "dependencies": { + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + } + } + }, + "solc": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.4.tgz", + "integrity": "sha512-IVLqAfUkJqgTS0JIgFPeC50ehUeBXu2eE+iU+rqb6UeOyf6w/BB/EsNcTSTpjtUti8BTG/sCd2qVhrWVYy7p0g==", + "dev": true, + "requires": { + "command-exists": "^1.2.8", + "commander": "3.0.2", + "follow-redirects": "^1.12.1", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "dependencies": { + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + } + } + }, + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "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=", + "dev": true + }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", + "dev": true + }, + "split": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, + "requires": { + "through": "2" + } + }, + "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==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "split2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "dev": true, + "requires": { + "through2": "^2.0.2" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "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", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "strong-log-transformer": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz", + "integrity": "sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA==", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "minimist": "^1.2.0", + "through": "^2.3.4" + } + }, + "subleveldown": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.1.tgz", + "integrity": "sha512-cVqd/URpp7si1HWu5YqQ3vqQkjuolAwHypY1B4itPlS71/lsf6TQPZ2Y0ijT22EYVkvH5ove9JFJf4u7VGPuZw==", + "requires": { + "abstract-leveldown": "^6.3.0", + "encoding-down": "^6.2.0", + "inherits": "^2.0.3", + "level-option-wrap": "^1.1.0", + "levelup": "^4.4.0", + "reachdown": "^1.1.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", + "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", + "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", + "requires": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + } + } + }, + "encoding-down": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", + "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", + "requires": { + "abstract-leveldown": "^6.2.1", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0" + } + }, + "level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "requires": { + "buffer": "^5.6.0" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + } + }, + "levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "requires": { + "deferred-leveldown": "~5.3.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~4.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "superagent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", + "integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==", + "dev": true, + "requires": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.2", + "debug": "^4.1.1", + "fast-safe-stringify": "^2.0.7", + "form-data": "^3.0.0", + "formidable": "^1.2.2", + "methods": "^1.1.2", + "mime": "^2.4.6", + "qs": "^6.9.4", + "readable-stream": "^3.6.0", + "semver": "^7.3.2" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "dev": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + } + }, + "temp-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", + "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=", + "dev": true + }, + "temp-write": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-3.4.0.tgz", + "integrity": "sha1-jP9jD7fp2gXwR8dM5M5NaFRX1JI=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "is-stream": "^1.1.0", + "make-dir": "^1.0.0", + "pify": "^3.0.0", + "temp-dir": "^1.0.0", + "uuid": "^3.0.1" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "text-extensions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", + "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", + "dev": true + }, + "thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "dev": true, + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + } + } + }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "requires": { + "rimraf": "^3.0.0" + } + }, + "tmp-promise": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.2.tgz", + "integrity": "sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA==", + "requires": { + "tmp": "^0.2.0" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "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=", + "dev": true, + "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=", + "dev": true, + "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==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "trim-newlines": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "dev": true + }, + "trim-off-newlines": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", + "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", + "dev": true + }, + "ts-morph": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.3.0.tgz", + "integrity": "sha512-BUKSoz7AFSKPcYTZODbICW2mOthAN4vc5juD6FL1lD/dLwZ0WvrC3zqBM3/X6f5gHxq3yaz+HmanHGaWm0ddbQ==", + "dev": true, + "requires": { + "@dsherret/to-absolute-glob": "^2.0.2", + "@ts-morph/common": "~0.5.2", + "code-block-writer": "^10.1.0" + } + }, + "ts-node": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", + "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + } + }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript": { + "version": "4.1.0-beta", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.0-beta.tgz", + "integrity": "sha512-b/LAttdVl3G6FEmnMkDsK0xvfvaftXpSKrjXn+OVCRqrwz5WD/6QJOiN+dTorqDY+hkaH+r2gP5wI1jBDmdQ7A==", + "dev": true + }, + "uWebSockets.js": { + "version": "github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c", + "from": "github:uNetworking/uWebSockets.js#v18.4.0" + }, + "uglify-js": { + "version": "3.10.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz", + "integrity": "sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==", + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", + "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", + "dev": true + }, + "umask": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz", + "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=", + "dev": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "universal-user-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz", + "integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==", + "dev": true, + "requires": { + "os-name": "^3.1.0" + } + }, + "universalify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true, + "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=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true + }, + "uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "utf-8-validate": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", + "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", + "dev": true, + "requires": { + "node-gyp-build": "~3.7.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", + "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "util-promisify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz", + "integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=", + "dev": true, + "requires": { + "builtins": "^1.0.3" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "windows-release": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.3.tgz", + "integrity": "sha512-OSOGH1QYiW5yVor9TtmXKQvt2vjQqbYS+DqmsZw+r7xDwLXEeT3JGW0ZppFmHx4diyXmxt238KFR3N9jzevBRg==", + "dev": true, + "requires": { + "execa": "^1.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "workerpool": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.2.tgz", + "integrity": "sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q==", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "write-json-file": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz", + "integrity": "sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ==", + "dev": true, + "requires": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.15", + "make-dir": "^2.1.0", + "pify": "^4.0.1", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.4.2" + }, + "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "write-pkg": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/write-pkg/-/write-pkg-3.2.0.tgz", + "integrity": "sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw==", + "dev": true, + "requires": { + "sort-keys": "^2.0.0", + "write-json-file": "^2.2.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "write-json-file": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-2.3.0.tgz", + "integrity": "sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8=", + "dev": true, + "requires": { + "detect-indent": "^5.0.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "pify": "^3.0.0", + "sort-keys": "^2.0.0", + "write-file-atomic": "^2.0.0" + } + } + } + }, + "ws": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", + "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", + "dev": true + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true + }, + "yargs": { + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.1.0.tgz", + "integrity": "sha512-upWFJOmDdHN0syLuESuvXDmrRcWd1QafJolHskzaw79uZa7/x53gxQKiR07W59GWY1tFhhU/Th9DrtSfpS782g==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.2", + "yargs-parser": "^20.2.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.3.tgz", + "integrity": "sha512-Gj3QHTkVMPKqwP3f7B4KPkBZRMR9r4rfi5bXFpg1a+Svvj8l7q5CnkBkVQzfxT5DFSsGk2+PascOgL0JYkL2kw==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.4.tgz", + "integrity": "sha512-deLOfD+RvFgrpAmSZgfGdWYE+OKyHcVHaRQ7NphG/63scpRvTHHeQMAxGGvaLVGJ+HYVcCXlzcTK0ZehFf+eHQ==", + "dev": true + }, + "yargs-parser": { + "version": "20.2.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.3.tgz", + "integrity": "sha512-emOFRT9WVHw03QSvN5qor9QQT9+sw5vwxfYweivSMHTcAXPefwVae2FjO7JJjj8hCE4CzPOPeFM83VwT29HCww==", + "dev": true + } + } + }, + "yargs-parser": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "dependencies": { + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + } + } + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "dependencies": { + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + } + } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + } + } +} From 631f8df552880e3b8eaf1f1c9ad041377a7b67b5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 18:41:49 -0400 Subject: [PATCH 630/691] maybe thisll fix it? --- .../__tests__/api/evm/snapshot.test.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index e59ed480aa..43958a4408 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -465,6 +465,18 @@ describe("api", () => { // and mine one more block just to force the any executable transactions // to be immediately mined console.log("got here 9"); + + const gotTxsProm = new Promise(resolve => { + let count = 0; + const unsub = provider.on("message", m => { + console.log(m); + if (++count === 3) { + unsub(); + resolve(null); + } + }); + }); + await send("evm_mine"); const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); @@ -512,17 +524,6 @@ describe("api", () => { ); }); - const gotTxsProm = new Promise(resolve => { - let count = 0; - const unsub = provider.on("message", m => { - console.log(m); - if (++count === 3) { - unsub(); - resolve(null); - } - }); - }); - // send one more transaction to fill in the gap send("eth_sendTransaction", [{ from, to, value: value++ }]); console.log("got here 12"); From cf51e7c92b1d00a209bb39c5506c4e401646b825 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 18:53:15 -0400 Subject: [PATCH 631/691] remove debug logs --- .../ethereum/__tests__/api/evm/snapshot.test.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 43958a4408..a3b7bc0b09 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -387,12 +387,10 @@ describe("api", () => { send, accounts: [from, to] } = context; - console.log("got here 1"); const accountNonce = parseInt( await send("eth_getTransactionCount", [from]), 16 ); - console.log("got here 2"); const snapShotId = await send("evm_snapshot"); // increment value for each transaction so the hashes always differ @@ -402,9 +400,7 @@ describe("api", () => { const revertedTx = await send("eth_sendTransaction", [ { from, to, value: value++ } ]); - console.log("got here 3"); await provider.once("message"); - console.log("got here 4"); // revert while these transactions are being mined const revertPromise = send("evm_revert", [snapShotId]); @@ -446,7 +442,6 @@ describe("api", () => { send("eth_getTransactionByHash", [hash]); // wait for the revert to finish up - console.log("got here 5"); const result = await Promise.race([revertPromise, txHashPromises]); assert.strictEqual( result, @@ -455,16 +450,12 @@ describe("api", () => { ); // wait for the inFlightTxs to be mined - console.log("got here 6"); await txsMinedProm; - console.log("got here 7"); const txHashes = await txHashPromises; - console.log("got here 8"); const laterHashes = await Promise.all(laterTxs); // and mine one more block just to force the any executable transactions // to be immediately mined - console.log("got here 9"); const gotTxsProm = new Promise(resolve => { let count = 0; @@ -481,7 +472,6 @@ describe("api", () => { const finalReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalTransactionsProm = Promise.all(txHashes.map(getTx)); - console.log("got here 10"); const [finalReceipts, finalTransactions] = await Promise.all([ finalReceiptsProm, finalTransactionsProm @@ -504,7 +494,6 @@ describe("api", () => { const laterTxsReceiptsProm = Promise.all(laterHashes.map(getReceipt)); const laterTxsTransactionsProm = Promise.all(laterHashes.map(getTx)); - console.log("got here 11"); const [laterTxsReceipts, laterTxsTransactions] = await Promise.all([ laterTxsReceiptsProm, laterTxsTransactionsProm @@ -526,12 +515,10 @@ describe("api", () => { // send one more transaction to fill in the gap send("eth_sendTransaction", [{ from, to, value: value++ }]); - console.log("got here 12"); await gotTxsProm; const finalLaterTxsReceiptsProm = Promise.all(txHashes.map(getReceipt)); const finalLaterTxsTransactionsProm = Promise.all(txHashes.map(getTx)); - console.log("got here 13"); const [ finalLaterTxsReceipts, finalLaterTxsTransactions @@ -554,9 +541,7 @@ describe("api", () => { ); }); - console.log("got here 14"); const revertedTxReceipt = await getReceipt(revertedTx); - console.log("got here 15"); const revertedTxTransactions = await getTx(revertedTx); assert.strictEqual( revertedTxReceipt, From b16e651605023905d0137093dc876e14aa1d1f7c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 18:53:31 -0400 Subject: [PATCH 632/691] don't search the heaps too far --- src/chains/ethereum/src/transaction-pool.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/src/transaction-pool.ts b/src/chains/ethereum/src/transaction-pool.ts index 2e8f01924d..e2305a1f64 100644 --- a/src/chains/ethereum/src/transaction-pool.ts +++ b/src/chains/ethereum/src/transaction-pool.ts @@ -253,9 +253,12 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { } /** - * TODO(perf): this looks super slow, doesn't it? + * Returns the transaction matching the given hash. + * + * This isn't the fastest thing... but querying for pending transactions is + * likely rare, so leaving this slow so other code paths can be faster might + * be okay. * - * Returns the transaction matching the given hash * @param transactionHash */ public find(transactionHash: Buffer) { @@ -264,7 +267,9 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // first search pending transactions for (let [_, transactions] of this.#origins) { if (transactions === undefined) continue; - for (let tx of transactions.array) { + const arr = transactions.array; + for (let i = 0; i < transactions.length; i++) { + const tx = arr[i]; if (tx.hash().equals(transactionHash)) { return tx; } @@ -273,7 +278,9 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { // then transactions eligible for execution for (let [_, transactions] of pending) { - for (let tx of transactions.array) { + const arr = transactions.array; + for (let i = 0; i < transactions.length; i++) { + const tx = arr[i]; if (tx.hash().equals(transactionHash)) { return tx; } From e10663621a6b5041e5a83abd3cf0ead07f822d34 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 19:13:58 -0400 Subject: [PATCH 633/691] update OS matrix to macos-11 and add windows-2016 --- .github/workflows/CI.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 106f632c66..ef9d00a82e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,7 +12,14 @@ jobs: matrix: node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] os: - [windows-2019, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15] + [ + windows-2016, + windows-2019, + ubuntu-16.04, + ubuntu-18.04, + ubuntu-20.04, + macos-11.0, + ] runs-on: ${{ matrix.os }} From f3f978947033a9834e27f1c446c36b99e0a05434 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 20:28:26 -0400 Subject: [PATCH 634/691] dno't link on the header image --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dff48a353d..2efc17feb5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- Ganache + Ganache

From 05b99e4b615c7cf9eccde80bf61ea8c0dd02ed05 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 20:29:25 -0400 Subject: [PATCH 635/691] better header link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2efc17feb5..73f867d88d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- Ganache + Ganache

From b9e52e8c6d915d5553e6a862d821e03046ee8737 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 21:04:24 -0400 Subject: [PATCH 636/691] worth a shot --- src/chains/ethereum/__tests__/api/bzz/bzz.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts index f98366479a..e599dcd12f 100644 --- a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts +++ b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts @@ -6,6 +6,8 @@ describe("api", () => { describe("bzz", () => { let provider: EthereumProvider; before(async () => { + // will this make GitHub Action's windwos-2019 Node v14 test work + await new Promise(resolve => setTimeout(resolve, 1000)); provider = await getProvider(); }); From 2b798fa2ced411befce982bd4257d169cb4190a3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 22:26:49 -0400 Subject: [PATCH 637/691] maybe this time --- src/chains/ethereum/__tests__/api/bzz/bzz.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts index e599dcd12f..5bc8646558 100644 --- a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts +++ b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts @@ -7,8 +7,8 @@ describe("api", () => { let provider: EthereumProvider; before(async () => { // will this make GitHub Action's windwos-2019 Node v14 test work - await new Promise(resolve => setTimeout(resolve, 1000)); provider = await getProvider(); + await new Promise(resolve => setTimeout(resolve, 1000)); }); it("bzz_hive stub returns value", async () => { From 0a8bf1ccafaa85839c603aa92f9d0c94821a4346 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 22:28:46 -0400 Subject: [PATCH 638/691] typos are fun! --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 73f867d88d..e7e08f7627 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ ## Features -Ganache uses simulates full Ethereum client behavior and makes developing Ethereum applications faster, easier, and safer. It includes all popular RPC functions and features (like events) and can be run deterministically to make development a breeze. +Ganache is an Ethereum simulator that makes developing Ethereum applications faster, easier, and safer. It includes all popular RPC functions and features (like events) and can be run deterministically to make development a breeze. - Fork any Ethereum network without waiting to sync - Ethereum json-rpc support From 790bc9ac1511bb4af572f35de559a01a883f3842 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 29 Oct 2020 22:30:38 -0400 Subject: [PATCH 639/691] italics was a bad idea --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7e08f7627..e6bdf7cefc 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Ganache is an Ethereum simulator that makes developing Ethereum applications fas - Fork any Ethereum network without waiting to sync - Ethereum json-rpc support - Snapshot/revert state -- Mine blocks _instantly_, _on demand_, or at an interval +- Mine blocks instantly, on demand, or at an interval - Fast-forward time - Impersonate any account (no private keys required!) - Listens for JSON-RPC 2.0 requests over HTTP/WebSockets From 88aca291067f28d2c2f94b619382039b511edd32 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 11:04:10 -0400 Subject: [PATCH 640/691] more CI debugging --- .github/workflows/CI.yml | 12 ++---------- src/chains/ethereum/__tests__/api/bzz/bzz.test.ts | 4 +++- src/chains/ethereum/src/provider.ts | 8 ++++++++ src/packages/utils/src/utils/executor.ts | 1 + src/packages/utils/src/utils/request-coordinator.ts | 9 +++++++++ 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ef9d00a82e..32b623655e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,16 +10,8 @@ jobs: strategy: fail-fast: false matrix: - node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] - os: - [ - windows-2016, - windows-2019, - ubuntu-16.04, - ubuntu-18.04, - ubuntu-20.04, - macos-11.0, - ] + node: [14.x] + os: [windows-2019] runs-on: ${{ matrix.os }} diff --git a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts index 5bc8646558..3127e01704 100644 --- a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts +++ b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts @@ -8,11 +8,13 @@ describe("api", () => { before(async () => { // will this make GitHub Action's windwos-2019 Node v14 test work provider = await getProvider(); - await new Promise(resolve => setTimeout(resolve, 1000)); + console.log("here 0"); }); it("bzz_hive stub returns value", async () => { + console.log("here 1"); const result = await provider.send("bzz_hive"); + console.log("here last"); assert.deepStrictEqual(result, []); }); diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 06446ae232..bda7f43ba0 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -91,6 +91,7 @@ export default class EthereumProvider | JsonRpcTypes.Request[], arg2?: Callback | any[] ) { + console.log("here 2"); let method: RequestMethods; let params: any; let response: Promise<{}> | undefined; @@ -158,8 +159,11 @@ export default class EthereumProvider public async request( args: RequestParams ) { + console.log("here 3"); const rawResult = await this.requestRaw(args); + console.log("here 4"); const value = await rawResult.value; + console.log("here 5"); return JSON.parse(JSON.stringify(value)); } @@ -174,7 +178,9 @@ export default class EthereumProvider }: RequestParams) { this.#logRequest(method, params); + console.log("here 6"); const result = await this.#executor.execute(this.#api, method, params); + console.log("here 7"); const promise = result.value as mergePromiseGenerics; if (promise instanceof PromiEvent) { promise.on("message", data => { @@ -192,6 +198,7 @@ export default class EthereumProvider }); } const value = promise.catch((error: Error) => { + console.log("here 8 (catch)"); if (this.#options.chain.vmErrorsOnRPCResponse) { if (hasOwn(error, "result")) { // stringify the result here @@ -204,6 +211,7 @@ export default class EthereumProvider // then rethrow throw error; }); + console.log("here 9"); return { value: value }; } diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index 92fab8b1da..3f9e0be335 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -22,6 +22,7 @@ export class Executor { methodName: M, params: Parameters ) { + console.log("here 10"); // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { diff --git a/src/packages/utils/src/utils/request-coordinator.ts b/src/packages/utils/src/utils/request-coordinator.ts index b70f9409eb..ed01445927 100644 --- a/src/packages/utils/src/utils/request-coordinator.ts +++ b/src/packages/utils/src/utils/request-coordinator.ts @@ -37,6 +37,7 @@ export class RequestCoordinator { * running. */ public pause = () => { + console.log("here 19"); this.#paused = true; }; @@ -44,11 +45,13 @@ export class RequestCoordinator { * Resume processing. */ public resume = () => { + console.log("here 20"); this.#paused = false; this.#process(); }; #process = () => { + console.log("here 15"); // if we aren't paused and the number of things we're processing is under // our limit and we have things to process: do it! while ( @@ -56,6 +59,7 @@ export class RequestCoordinator { this.pending.length > 0 && (!this.limit || this.runningTasks < this.limit) ) { + console.log("here 16"); const current = this.pending.shift(); this.runningTasks++; current() @@ -66,6 +70,7 @@ export class RequestCoordinator { // `Promise.allSettled([current()]).finally` to do this instead of the `current().catch(noop).finally`. /shrug .catch(noop) .finally(() => { + console.log("here 18"); this.runningTasks--; this.#process(); }); @@ -80,10 +85,13 @@ export class RequestCoordinator { thisArgument: any, argumentsList: Parameters ) => { + console.log("here 11"); return new Promise<{ value: ReturnType }>((resolve, reject) => { // const executor is `async` to force the return value into a Promise. + console.log("here 12"); const executor = async () => { try { + console.log("here 13"); const value = Reflect.apply( fn, thisArgument, @@ -92,6 +100,7 @@ export class RequestCoordinator { resolve({ value }); return value; } catch (e) { + console.log("here 14 (catch)"); reject(e); } }; From 252024b6de108b05fc7652b7cf1c4dc31f600748 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 11:14:06 -0400 Subject: [PATCH 641/691] interesting --- src/chains/ethereum/__tests__/api/bzz/bzz.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts index 3127e01704..a5f3055a32 100644 --- a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts +++ b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts @@ -5,10 +5,13 @@ import EthereumProvider from "../../../src/provider"; describe("api", () => { describe("bzz", () => { let provider: EthereumProvider; - before(async () => { + beforeEach(async () => { // will this make GitHub Action's windwos-2019 Node v14 test work + console.log("here a"); + console.log(Date.now()); provider = await getProvider(); console.log("here 0"); + console.log(Date.now()); }); it("bzz_hive stub returns value", async () => { From 87079adbddbff45ccded4038e0506eae93fd274c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 11:15:55 -0400 Subject: [PATCH 642/691] update setup-msbuild CI dep --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 32b623655e..25eadf05ea 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,7 +23,7 @@ jobs: node-version: ${{ matrix.node }} - name: Add msbuild to PATH if: matrix.os == 'windows-2019' - uses: microsoft/setup-msbuild@v1.0.1 + uses: microsoft/setup-msbuild@v1.0.2 - name: install node tools if: matrix.os == 'windows-2019' # windows-build-tools@5.2.2 failed to install, so we use 4.0.0 From fa2fb6f1664efc6e8d67fe1964184e6514127810 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 11:25:46 -0400 Subject: [PATCH 643/691] wonder if we need build tools nowadays? --- .github/workflows/CI.yml | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 25eadf05ea..972dc7e277 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,8 +10,16 @@ jobs: strategy: fail-fast: false matrix: - node: [14.x] - os: [windows-2019] + node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] + os: + [ + windows-2016, + windows-2019, + ubuntu-16.04, + ubuntu-18.04, + ubuntu-20.04, + macos-11.0, + ] runs-on: ${{ matrix.os }} @@ -21,22 +29,6 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} - - name: Add msbuild to PATH - if: matrix.os == 'windows-2019' - uses: microsoft/setup-msbuild@v1.0.2 - - name: install node tools - if: matrix.os == 'windows-2019' - # windows-build-tools@5.2.2 failed to install, so we use 4.0.0 - run: npm install --global --production windows-build-tools@4.0.0 - - name: install node-gyp - if: matrix.os == 'windows-2019' - run: npm install --global node-gyp@latest - - name: Set node config to use python2.7 - if: matrix.os == 'windows-2019' - run: npm config set python python2.7 - - name: Set node config to set msvs_version to 2015 - if: matrix.os == 'windows-2019' - run: npm config set msvs_version 2015 - run: npm ci - run: npm test env: From f2d8000b3d2fbe77d3a987f5de8c352ec8151f4c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 11:35:20 -0400 Subject: [PATCH 644/691] add timeout to first eth test --- src/chains/ethereum/__tests__/api/bzz/bzz.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts index a5f3055a32..6fe8d22ade 100644 --- a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts +++ b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts @@ -5,7 +5,13 @@ import EthereumProvider from "../../../src/provider"; describe("api", () => { describe("bzz", () => { let provider: EthereumProvider; - beforeEach(async () => { + before(async function () { + // GitHub Actions' windows-2019 Node v14 environment can sometimes take a + // VERY long time to run this `before`, as it is CURRENTLY the first + // @ganache/ethereum test that mocha runs (alphabetically)... and for some + // reason it is slow. + this.timeout(10000); + // will this make GitHub Action's windwos-2019 Node v14 test work console.log("here a"); console.log(Date.now()); From a8256160fcb9241723a711e4e4bf9c7d9bfa36bf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 11:41:33 -0400 Subject: [PATCH 645/691] build tools are needed for `bigint-buffer` --- .github/workflows/CI.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 972dc7e277..64bddedb1b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,6 +29,23 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} + # we need build tools for the `bigint-buffer` module + - name: Add msbuild to PATH + if: startsWith(matrix.os, 'windows-') + uses: microsoft/setup-msbuild@v1.0.2 + - name: install node tools + if: startsWith(matrix.os, 'windows-') + # windows-build-tools@5.2.2 failed to install, so we use 4.0.0 + run: npm install --global --production windows-build-tools@4.0.0 + - name: install node-gyp + if: startsWith(matrix.os, 'windows-') + run: npm install --global node-gyp@latest + - name: Set node config to use python2.7 + if: startsWith(matrix.os, 'windows-') + run: npm config set python python2.7 + - name: Set node config to set msvs_version to 2015 + if: startsWith(matrix.os, 'windows-') + run: npm config set msvs_version 2015 - run: npm ci - run: npm test env: From c2a587d319dd2e8cf8724aafb4239c0d22b398b2 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 11:51:00 -0400 Subject: [PATCH 646/691] remvoe debug logging --- src/chains/ethereum/__tests__/api/bzz/bzz.test.ts | 7 ------- src/chains/ethereum/__tests__/api/evm/snapshot.test.ts | 3 --- src/chains/ethereum/src/provider.ts | 8 -------- src/packages/utils/src/utils/executor.ts | 1 - src/packages/utils/src/utils/request-coordinator.ts | 9 --------- 5 files changed, 28 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts index 6fe8d22ade..156264e3bc 100644 --- a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts +++ b/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts @@ -12,18 +12,11 @@ describe("api", () => { // reason it is slow. this.timeout(10000); - // will this make GitHub Action's windwos-2019 Node v14 test work - console.log("here a"); - console.log(Date.now()); provider = await getProvider(); - console.log("here 0"); - console.log(Date.now()); }); it("bzz_hive stub returns value", async () => { - console.log("here 1"); const result = await provider.send("bzz_hive"); - console.log("here last"); assert.deepStrictEqual(result, []); }); diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index a3b7bc0b09..3757ae83d2 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -408,7 +408,6 @@ describe("api", () => { const txsMinedProm = new Promise(resolve => { let count = 0; const unsub = provider.on("message", m => { - console.log(m); if (++count === 2) { unsub(); resolve(null); @@ -460,7 +459,6 @@ describe("api", () => { const gotTxsProm = new Promise(resolve => { let count = 0; const unsub = provider.on("message", m => { - console.log(m); if (++count === 3) { unsub(); resolve(null); @@ -478,7 +476,6 @@ describe("api", () => { ]); // verify that we do have the receipts - console.log(finalReceipts); finalReceipts.forEach(receipt => { assert.notStrictEqual(receipt, null, "Receipt should not be null"); }); diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index bda7f43ba0..06446ae232 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -91,7 +91,6 @@ export default class EthereumProvider | JsonRpcTypes.Request[], arg2?: Callback | any[] ) { - console.log("here 2"); let method: RequestMethods; let params: any; let response: Promise<{}> | undefined; @@ -159,11 +158,8 @@ export default class EthereumProvider public async request( args: RequestParams ) { - console.log("here 3"); const rawResult = await this.requestRaw(args); - console.log("here 4"); const value = await rawResult.value; - console.log("here 5"); return JSON.parse(JSON.stringify(value)); } @@ -178,9 +174,7 @@ export default class EthereumProvider }: RequestParams) { this.#logRequest(method, params); - console.log("here 6"); const result = await this.#executor.execute(this.#api, method, params); - console.log("here 7"); const promise = result.value as mergePromiseGenerics; if (promise instanceof PromiEvent) { promise.on("message", data => { @@ -198,7 +192,6 @@ export default class EthereumProvider }); } const value = promise.catch((error: Error) => { - console.log("here 8 (catch)"); if (this.#options.chain.vmErrorsOnRPCResponse) { if (hasOwn(error, "result")) { // stringify the result here @@ -211,7 +204,6 @@ export default class EthereumProvider // then rethrow throw error; }); - console.log("here 9"); return { value: value }; } diff --git a/src/packages/utils/src/utils/executor.ts b/src/packages/utils/src/utils/executor.ts index 3f9e0be335..92fab8b1da 100644 --- a/src/packages/utils/src/utils/executor.ts +++ b/src/packages/utils/src/utils/executor.ts @@ -22,7 +22,6 @@ export class Executor { methodName: M, params: Parameters ) { - console.log("here 10"); // The methodName is user-entered data and can be all sorts of weird hackery // Make sure we only accept what we expect to avoid headache and heartache if (typeof methodName === "string") { diff --git a/src/packages/utils/src/utils/request-coordinator.ts b/src/packages/utils/src/utils/request-coordinator.ts index ed01445927..b70f9409eb 100644 --- a/src/packages/utils/src/utils/request-coordinator.ts +++ b/src/packages/utils/src/utils/request-coordinator.ts @@ -37,7 +37,6 @@ export class RequestCoordinator { * running. */ public pause = () => { - console.log("here 19"); this.#paused = true; }; @@ -45,13 +44,11 @@ export class RequestCoordinator { * Resume processing. */ public resume = () => { - console.log("here 20"); this.#paused = false; this.#process(); }; #process = () => { - console.log("here 15"); // if we aren't paused and the number of things we're processing is under // our limit and we have things to process: do it! while ( @@ -59,7 +56,6 @@ export class RequestCoordinator { this.pending.length > 0 && (!this.limit || this.runningTasks < this.limit) ) { - console.log("here 16"); const current = this.pending.shift(); this.runningTasks++; current() @@ -70,7 +66,6 @@ export class RequestCoordinator { // `Promise.allSettled([current()]).finally` to do this instead of the `current().catch(noop).finally`. /shrug .catch(noop) .finally(() => { - console.log("here 18"); this.runningTasks--; this.#process(); }); @@ -85,13 +80,10 @@ export class RequestCoordinator { thisArgument: any, argumentsList: Parameters ) => { - console.log("here 11"); return new Promise<{ value: ReturnType }>((resolve, reject) => { // const executor is `async` to force the return value into a Promise. - console.log("here 12"); const executor = async () => { try { - console.log("here 13"); const value = Reflect.apply( fn, thisArgument, @@ -100,7 +92,6 @@ export class RequestCoordinator { resolve({ value }); return value; } catch (e) { - console.log("here 14 (catch)"); reject(e); } }; From c310ea7d660c22080644a1942125a84290775de3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 12:13:06 -0400 Subject: [PATCH 647/691] don't mine an empty block --- src/chains/ethereum/src/miner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index f04cfc70b4..2086ecc10d 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -160,7 +160,7 @@ export default class Miner extends Emittery.Typed< // if there are more txs to mine, start mining them without awaiting their // result. - if (!onlyOneBlock && this.#pending) { + if (!onlyOneBlock && this.#pending && this.#priced.length > 0) { this.#setPricedHeap(); this.#pending = false; const nextBlock = this.#createBlock(lastBlock); From 3c142766156b0810229edf7537d9ca314fb66ae0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 12:18:03 -0400 Subject: [PATCH 648/691] maybe fix flaky test --- .../ethereum/__tests__/api/evm/snapshot.test.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts index 3757ae83d2..5d72ba744b 100644 --- a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts +++ b/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts @@ -271,10 +271,15 @@ describe("api", () => { transactionsProm ]); - // verify that we don't yet have a receipt - receipts.forEach(receipt => { - assert.strictEqual(receipt, null, "Receipt should be null"); - }); + // sometimes ganache is REALLY fast and mines and saves the first tx + // before we even get here (which is fine). As long as we have tx that + // is still pending (meaning its receipt is `null`) the test is still + // testing what we want it to. + assert.strictEqual( + receipts.some(r => r === null), + true, + "At least 1 receipt should be null" + ); // and that the transations were all accepted transactions.forEach(transaction => { From 210b92adf4d02b43660d939b60f5d63fb1765df0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 13:21:51 -0400 Subject: [PATCH 649/691] readme tweaks --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e6bdf7cefc..65d380f5d3 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ You can then add ganache-cli to your package.json scripts: } ``` -_see [Documentation](#documentation) additional command line options_ +_See [Documentation](#documentation) for additional command line options._ then start it: @@ -136,7 +136,7 @@ $ npm install ganache-cli then start ganache as an EIP-1193 provider only: ```javascript -import ganache from "ganache-cli"; +const ganache = require("ganache-cli"); const options = {}; const provider = ganache.provider(options); @@ -146,7 +146,7 @@ const accounts = await provider.request({ method: "eth_accounts", params: [] }); or as an EIP-1193 provider _and_ JSON-RPC web server: ```javascript -import ganache from "ganache-cli"; +const ganache = require("ganache-cli"); const options = {}; const server = ganache.server(options); @@ -164,9 +164,9 @@ server.listen(PORT, err => { To use ganache as a Web3 provider: -``` -import Web3 from "web3"; -import ganache from "ganache-cli"; +```javascript +const Web3 = require("web3"); +const ganache = require("ganache-cli"); const web3 = new Web3(ganache.provider()); ``` @@ -179,8 +179,8 @@ const web3 = new Web3(ganache.provider(), null, { transactionConfirmationBlocks: #### As an [ethers.js]() provider: -``` -import ganache from "ganache-core"; +```javascript +const ganache = require("ganache-cli"); const provider = new ethers.providers.Web3Provider(ganache.provider()); ``` From e32cf670c03ffc0394f5aa7a929a598e34a7de44 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 13:28:21 -0400 Subject: [PATCH 650/691] fixes for things --- src/chains/ethereum/src/blockchain.ts | 216 ++++++++++++++------------ 1 file changed, 113 insertions(+), 103 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index ef02e28389..31e68b2eb0 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -257,113 +257,123 @@ export default class Blockchain extends Emittery.Typed< } miner.on("block", async (blockData: any) => { - await this.#blockBeingSavedPromise; - const previousBlock = blocks.latest; - const previousHeader = previousBlock.value.header; - const previousNumber = - Quantity.from(previousHeader.number).toBigInt() || 0n; - const block = blocks.createBlock({ - parentHash: previousHeader.hash(), - number: Quantity.from(previousNumber + 1n).toBuffer(), - coinbase: this.coinbase.toBuffer(), - timestamp: blockData.timestamp, - // difficulty: - gasLimit: options.miner.blockGasLimit.toBuffer(), - transactionsTrie: blockData.transactionsTrie.root, - receiptTrie: blockData.receiptTrie.root, - stateRoot: this.trie.root, - gasUsed: Quantity.from(blockData.gasUsed).toBuffer() - }); - - blocks.latest = block; - const value = block.value; - const header = value.header; - this.#blockBeingSavedPromise = database.batch(() => { - const blockHash = value.hash(); - const blockNumber = header.number; - const blockNumberQ = Quantity.from(blockNumber); - const blockLogs = BlockLogs.create(blockHash); - const timestamp = new Date( - Quantity.from(header.timestamp).toNumber() * 1000 - ).toString(); - blockData.blockTransactions.forEach( - (tx: Transaction, i: number) => { - const hash = tx.hash(); - const index = Quantity.from(i).toBuffer(); - const txAndExtraData = [ - ...tx.raw, - blockHash, - blockNumber, - index, - Buffer.from([tx.type]), - tx.from - ]; - const encodedTx = rlpEncode(txAndExtraData); - this.transactions.set(hash, encodedTx); - - const receipt = tx.getReceipt(); - const encodedReceipt = receipt.serialize(true); - this.transactionReceipts.set(hash, encodedReceipt); - - tx.getLogs().forEach(log => { - blockLogs.append(index, hash, log); - }); + return (this.#blockBeingSavedPromise = this.#blockBeingSavedPromise + .then(() => { + const previousBlock = blocks.latest; + const previousHeader = previousBlock.value.header; + const previousNumber = + Quantity.from(previousHeader.number).toBigInt() || 0n; + const block = blocks.createBlock({ + parentHash: previousHeader.hash(), + number: Quantity.from(previousNumber + 1n).toBuffer(), + coinbase: this.coinbase.toBuffer(), + timestamp: blockData.timestamp, + // difficulty: + gasLimit: options.miner.blockGasLimit.toBuffer(), + transactionsTrie: blockData.transactionsTrie.root, + receiptTrie: blockData.receiptTrie.root, + stateRoot: this.trie.root, + gasUsed: Quantity.from(blockData.gasUsed).toBuffer() + }); - logger.log(""); - logger.log(" Transaction: " + Data.from(hash)); - - const contractAddress = receipt.contractAddress; - if (contractAddress != null) { - logger.log( - " Contract created: " + Address.from(contractAddress) - ); - } - - const raw = receipt.raw; - logger.log(" Gas usage: " + Quantity.from(raw[1])); - logger.log(" Block Number: " + blockNumberQ); - logger.log(" Block Time: " + timestamp); - - const error = tx.execException; - if (error) { - logger.log(" Runtime Error: " + error.data.message); - if ((error as any).reason) { - logger.log( - " Revert reason: " + (error as any).data.reason - ); + blocks.latest = block; + const value = block.value; + const header = value.header; + return database.batch(() => { + const blockHash = value.hash(); + const blockNumber = header.number; + const blockNumberQ = Quantity.from(blockNumber); + const blockLogs = BlockLogs.create(blockHash); + const timestamp = new Date( + Quantity.from(header.timestamp).toNumber() * 1000 + ).toString(); + blockData.blockTransactions.forEach( + (tx: Transaction, i: number) => { + const hash = tx.hash(); + const index = Quantity.from(i).toBuffer(); + const txAndExtraData = [ + ...tx.raw, + blockHash, + blockNumber, + index, + Buffer.from([tx.type]), + tx.from + ]; + const encodedTx = rlpEncode(txAndExtraData); + this.transactions.set(hash, encodedTx); + + const receipt = tx.getReceipt(); + const encodedReceipt = receipt.serialize(true); + this.transactionReceipts.set(hash, encodedReceipt); + + tx.getLogs().forEach(log => { + blockLogs.append(index, hash, log); + }); + + logger.log(""); + logger.log(" Transaction: " + Data.from(hash)); + + const contractAddress = receipt.contractAddress; + if (contractAddress != null) { + logger.log( + " Contract created: " + Address.from(contractAddress) + ); + } + + const raw = receipt.raw; + logger.log(" Gas usage: " + Quantity.from(raw[1])); + logger.log(" Block Number: " + blockNumberQ); + logger.log(" Block Time: " + timestamp); + + const error = tx.execException; + if (error) { + logger.log(" Runtime Error: " + error.data.message); + if ((error as any).reason) { + logger.log( + " Revert reason: " + (error as any).data.reason + ); + } + } + + logger.log(""); } - } + ); + blockLogs.blockNumber = blockNumberQ; + this.blockLogs.set(blockNumber, blockLogs.serialize()); + value.transactions = blockData.blockTransactions; + blocks.putBlock(block); + return { block, blockLogs }; + }); + }) + .then(async ({ block, blockLogs }) => { + // emit the block once everything has been fully saved to the database + block.value.transactions.forEach(transaction => { + const error = options.chain.vmErrorsOnRPCResponse + ? transaction.execException + : null; + transaction.finalize("confirmed", error); + }); - logger.log(""); + if (instamine && options.miner.legacyInstamine) { + // in legacy instamine mode we must delay the broadcast of new blocks + await new Promise(resolve => { + process.nextTick(async () => { + // emit block logs first so filters can pick them up before + // block listeners are notified + await this.emit("blockLogs", blockLogs); + await this.emit("block", block); + resolve(void 0); + }); + }); + } else { + // emit block logs first so filters can pick them up before + // block listeners are notified + await this.emit("blockLogs", blockLogs); + await this.emit("block", block); } - ); - blockLogs.blockNumber = blockNumberQ; - this.blockLogs.set(blockNumber, blockLogs.serialize()); - value.transactions = blockData.blockTransactions; - blocks.putBlock(block); - return { block, blockLogs }; - }); - - // emit the block once everything has been fully saved to the database - return this.#blockBeingSavedPromise.then(({ block, blockLogs }) => { - block.value.transactions.forEach(transaction => { - const error = options.chain.vmErrorsOnRPCResponse - ? transaction.execException - : null; - transaction.finalize("confirmed", error); - }); - - if (instamine && options.miner.legacyInstamine) { - // in legacy instamine mode we must delay the broadcast of new blocks - process.nextTick(() => { - this.emit("block", block); - this.emit("blockLogs", blockLogs); - }); - } else { - this.emit("block", block); - this.emit("blockLogs", blockLogs); - } - }); + + return { block, blockLogs }; + })); }); this.once("stop").then(() => miner.clearListeners()); From 8e4ff5bccb808a8464f722856ed516a07a9e3d65 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 13:29:37 -0400 Subject: [PATCH 651/691] fix pause functions --- .../src/data-managers/transaction-manager.ts | 14 +++++++------- src/chains/ethereum/src/miner.ts | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/chains/ethereum/src/data-managers/transaction-manager.ts b/src/chains/ethereum/src/data-managers/transaction-manager.ts index 3338f7e85f..406e5e9c51 100644 --- a/src/chains/ethereum/src/data-managers/transaction-manager.ts +++ b/src/chains/ethereum/src/data-managers/transaction-manager.ts @@ -78,13 +78,13 @@ export default class TransactionManager extends Manager { * affect if already paused. */ public async pause() { - if (this.#paused) return; - - // stop processing new transactions immediately - this.#paused = true; - this.#resumer = new Promise(resolve => { - this.#resolver = resolve; - }); + if (!this.#paused) { + // stop processing new transactions immediately + this.#paused = true; + this.#resumer = new Promise(resolve => { + this.#resolver = resolve; + }); + } // then wait until all async things we were already processing are done // before returning diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index 2086ecc10d..b6f33db65c 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -66,12 +66,12 @@ export default class Miner extends Emittery.Typed< readonly #createBlock: (previousBlock: Block) => Block; public async pause() { - if (this.#paused) return; - - this.#paused = true; - this.#resumer = new Promise(resolve => { - this.#resolver = resolve; - }); + if (!this.#paused) { + this.#paused = true; + this.#resumer = new Promise(resolve => { + this.#resolver = resolve; + }); + } if (this.#isBusy) { await this.once("idle"); From 8a62cf782d6fccb2eab17707c4d97436ce43140a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 13:42:48 -0400 Subject: [PATCH 652/691] checking if 15.x works yet --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 64bddedb1b..84296e9e07 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] + node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x] os: [ windows-2016, From 12f3bb21e57cd995a7162cb02d740b4407f40c6c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 13:47:21 -0400 Subject: [PATCH 653/691] nope --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 84296e9e07..64bddedb1b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x] + node: [10.7.0, 10.x, 11.x, 12.x, 13.x, 14.x] os: [ windows-2016, From e96eb04c18253329eeb7d069c45a5e6f844fc144 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 14:35:26 -0400 Subject: [PATCH 654/691] sourcemap-support doesn't seem to do anything? --- src/chains/ethereum/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index ffeb068248..4a74d9aeed 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -29,7 +29,7 @@ "docs.preview": "ws --open --port 3010 --directory ./lib/docs", "tsc": "ts-node ../../../scripts/compile", "test": "nyc --reporter lcov npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register --require source-map-support/register '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" From c66522b4e09fadba49e08ba88ad7c394fc8b182c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 14:35:45 -0400 Subject: [PATCH 655/691] clean up --- src/chains/ethereum/src/blockchain.ts | 301 ++++++++++++++------------ 1 file changed, 160 insertions(+), 141 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 31e68b2eb0..80f2f6d173 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -226,155 +226,33 @@ export default class Blockchain extends Emittery.Typed< { // configure and start miner - const logger = options.logging.logger; - + const txPool = this.transactions.transactionPool; + const minerOpts = options.miner; const miner = (this.#miner = new Miner( - options.miner, - this.transactions.transactionPool.executables, + minerOpts, + txPool.executables, instamine, this.vm, this.#readyNextBlock )); - { - // automatic mining - const mineAll = async (maxTransactions: number) => - this.#isPaused() ? null : this.mine(maxTransactions); - if (instamine) { - // insta mining - // whenever the transaction pool is drained mine the txs into blocks - this.transactions.transactionPool.on( - "drain", - mineAll.bind(null, 1) - ); - } else { - // interval mining - const wait = () => - unref(setTimeout(mineNext, options.miner.blockTime * 1000)); - const mineNext = () => mineAll(-1).then(wait); - wait(); - } + //#region automatic mining + const nullResolved = Promise.resolve(null); + const mineAll = (maxTransactions: number) => + this.#isPaused() ? nullResolved : this.mine(maxTransactions); + if (instamine) { + // insta mining + // whenever the transaction pool is drained mine the txs into blocks + txPool.on("drain", mineAll.bind(null, 1)); + } else { + // interval mining + const wait = () => unref(setTimeout(next, minerOpts.blockTime * 1e3)); + const next = () => mineAll(-1).then(wait); + wait(); } + //#endregion - miner.on("block", async (blockData: any) => { - return (this.#blockBeingSavedPromise = this.#blockBeingSavedPromise - .then(() => { - const previousBlock = blocks.latest; - const previousHeader = previousBlock.value.header; - const previousNumber = - Quantity.from(previousHeader.number).toBigInt() || 0n; - const block = blocks.createBlock({ - parentHash: previousHeader.hash(), - number: Quantity.from(previousNumber + 1n).toBuffer(), - coinbase: this.coinbase.toBuffer(), - timestamp: blockData.timestamp, - // difficulty: - gasLimit: options.miner.blockGasLimit.toBuffer(), - transactionsTrie: blockData.transactionsTrie.root, - receiptTrie: blockData.receiptTrie.root, - stateRoot: this.trie.root, - gasUsed: Quantity.from(blockData.gasUsed).toBuffer() - }); - - blocks.latest = block; - const value = block.value; - const header = value.header; - return database.batch(() => { - const blockHash = value.hash(); - const blockNumber = header.number; - const blockNumberQ = Quantity.from(blockNumber); - const blockLogs = BlockLogs.create(blockHash); - const timestamp = new Date( - Quantity.from(header.timestamp).toNumber() * 1000 - ).toString(); - blockData.blockTransactions.forEach( - (tx: Transaction, i: number) => { - const hash = tx.hash(); - const index = Quantity.from(i).toBuffer(); - const txAndExtraData = [ - ...tx.raw, - blockHash, - blockNumber, - index, - Buffer.from([tx.type]), - tx.from - ]; - const encodedTx = rlpEncode(txAndExtraData); - this.transactions.set(hash, encodedTx); - - const receipt = tx.getReceipt(); - const encodedReceipt = receipt.serialize(true); - this.transactionReceipts.set(hash, encodedReceipt); - - tx.getLogs().forEach(log => { - blockLogs.append(index, hash, log); - }); - - logger.log(""); - logger.log(" Transaction: " + Data.from(hash)); - - const contractAddress = receipt.contractAddress; - if (contractAddress != null) { - logger.log( - " Contract created: " + Address.from(contractAddress) - ); - } - - const raw = receipt.raw; - logger.log(" Gas usage: " + Quantity.from(raw[1])); - logger.log(" Block Number: " + blockNumberQ); - logger.log(" Block Time: " + timestamp); - - const error = tx.execException; - if (error) { - logger.log(" Runtime Error: " + error.data.message); - if ((error as any).reason) { - logger.log( - " Revert reason: " + (error as any).data.reason - ); - } - } - - logger.log(""); - } - ); - blockLogs.blockNumber = blockNumberQ; - this.blockLogs.set(blockNumber, blockLogs.serialize()); - value.transactions = blockData.blockTransactions; - blocks.putBlock(block); - return { block, blockLogs }; - }); - }) - .then(async ({ block, blockLogs }) => { - // emit the block once everything has been fully saved to the database - block.value.transactions.forEach(transaction => { - const error = options.chain.vmErrorsOnRPCResponse - ? transaction.execException - : null; - transaction.finalize("confirmed", error); - }); - - if (instamine && options.miner.legacyInstamine) { - // in legacy instamine mode we must delay the broadcast of new blocks - await new Promise(resolve => { - process.nextTick(async () => { - // emit block logs first so filters can pick them up before - // block listeners are notified - await this.emit("blockLogs", blockLogs); - await this.emit("block", block); - resolve(void 0); - }); - }); - } else { - // emit block logs first so filters can pick them up before - // block listeners are notified - await this.emit("blockLogs", blockLogs); - await this.emit("block", block); - } - - return { block, blockLogs }; - })); - }); + miner.on("block", this.#handleNewBlockData); this.once("stop").then(() => miner.clearListeners()); } @@ -384,6 +262,147 @@ export default class Blockchain extends Emittery.Typed< }); } + #fillNewBlock = (blockData: any) => { + const blocks = this.blocks; + const options = this.#options; + const prevBlock = blocks.latest; + const prevHeader = prevBlock.value.header; + const prevNumber = Quantity.from(prevHeader.number).toBigInt() || 0n; + const block = blocks.createBlock({ + parentHash: prevHeader.hash(), + number: Quantity.from(prevNumber + 1n).toBuffer(), + coinbase: this.coinbase.toBuffer(), + timestamp: blockData.timestamp, + // difficulty: + gasLimit: options.miner.blockGasLimit.toBuffer(), + transactionsTrie: blockData.transactionsTrie.root, + receiptTrie: blockData.receiptTrie.root, + stateRoot: this.trie.root, + gasUsed: Quantity.from(blockData.gasUsed).toBuffer() + }); + block.value.transactions = blockData.blockTransactions; + return block; + }; + + #saveNewBlock = (block: Block) => { + const logger = this.#options.logging.logger; + const blocks = this.blocks; + blocks.latest = block; + const value = block.value; + const header = value.header; + return this.#database.batch(() => { + const blockHash = value.hash(); + const blockNumber = header.number; + const blockNumberQ = Quantity.from(blockNumber); + const blockLogs = BlockLogs.create(blockHash); + const timestamp = new Date( + Quantity.from(header.timestamp).toNumber() * 1000 + ).toString(); + value.transactions.forEach((tx: Transaction, i: number) => { + const hash = tx.hash(); + const index = Quantity.from(i).toBuffer(); + const txAndExtraData = [ + ...tx.raw, + blockHash, + blockNumber, + index, + Buffer.from([tx.type]), + tx.from + ]; + const encodedTx = rlpEncode(txAndExtraData); + this.transactions.set(hash, encodedTx); + + const receipt = tx.getReceipt(); + const encodedReceipt = receipt.serialize(true); + this.transactionReceipts.set(hash, encodedReceipt); + + tx.getLogs().forEach(blockLogs.append.bind(blockLogs, index, hash)); + + const error = tx.execException; + this.#logTransaction(hash, receipt, blockNumberQ, timestamp, error); + }); + blockLogs.blockNumber = blockNumberQ; + this.blockLogs.set(blockNumber, blockLogs.serialize()); + blocks.putBlock(block); + return { block, blockLogs }; + }); + }; + + #emitNewBlock = async (blockInfo: { block: Block; blockLogs: BlockLogs }) => { + const options = this.#options; + const vmErrorsOnRPCResponse = options.chain.vmErrorsOnRPCResponse; + const { block, blockLogs } = blockInfo; + + // emit the block once everything has been fully saved to the database + block.value.transactions.forEach(transaction => { + const error = vmErrorsOnRPCResponse ? transaction.execException : null; + transaction.finalize("confirmed", error); + }); + + if (this.#instamine && options.miner.legacyInstamine) { + // in legacy instamine mode we must delay the broadcast of new blocks + await new Promise(resolve => { + process.nextTick(async () => { + // emit block logs first so filters can pick them up before + // block listeners are notified + await Promise.all([ + this.emit("blockLogs", blockLogs), + this.emit("block", block) + ]); + resolve(void 0); + }); + }); + } else { + // emit block logs first so filters can pick them up before + // block listeners are notified + await Promise.all([ + this.emit("blockLogs", blockLogs), + this.emit("block", block) + ]); + } + + return blockInfo; + }; + + #logTransaction = ( + hash: Buffer, + receipt: TransactionReceipt, + blockNumber: Quantity, + timestamp: string, + error: RuntimeError | undefined + ) => { + const logger = this.#options.logging.logger; + logger.log(""); + logger.log(" Transaction: " + Data.from(hash)); + + const contractAddress = receipt.contractAddress; + if (contractAddress != null) { + logger.log(" Contract created: " + Address.from(contractAddress)); + } + + logger.log(" Gas usage: " + Quantity.from(receipt.raw[1])); + logger.log(" Block Number: " + blockNumber); + logger.log(" Block Time: " + timestamp); + + if (error) { + logger.log(" Runtime Error: " + error.data.message); + if ((error as any).reason) { + logger.log(" Revert reason: " + (error as any).data.reason); + } + } + + logger.log(""); + }; + + #handleNewBlockData = async (blockData: any) => { + this.#blockBeingSavedPromise = this.#blockBeingSavedPromise + .then(() => this.#fillNewBlock(blockData)) + .then(this.#saveNewBlock) + .then(this.#emitNewBlock); + + return this.#blockBeingSavedPromise; + }; + coinbase: Address; #readyNextBlock = (previousBlock: EthereumBlock, timestamp?: number) => { From 4ef226ca5722a6624d0c108cdd964c09188af43f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 15:28:53 -0400 Subject: [PATCH 656/691] ensure we can add new tranasctions to the same origin after a failed tranasction --- src/chains/ethereum/src/miner.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner.ts index b6f33db65c..44fc0a0bea 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner.ts @@ -383,7 +383,11 @@ export default class Miner extends Emittery.Typed< if (pendingOrigin.removeBest()) { replaceFromHeap(this.#priced, pendingOrigin); } else { + // if there are no more transactions from this origin remove this tx + // from the priced heap and clear out it's origin so it can accept new + // transactions from this origin. this.#priced.removeBest(); + this.#origins.delete(origin); } const e = { From c8bd5f16a249ddfec563d4d22b6e5df203d9ebc3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 15:29:02 -0400 Subject: [PATCH 657/691] remove dead code --- src/chains/ethereum/src/blockchain.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 80f2f6d173..1ea9a09b72 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -285,7 +285,6 @@ export default class Blockchain extends Emittery.Typed< }; #saveNewBlock = (block: Block) => { - const logger = this.#options.logging.logger; const blocks = this.blocks; blocks.latest = block; const value = block.value; From 531a54780c5b5e41da83c2b796db3b97c87afd0f Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 15:45:38 -0400 Subject: [PATCH 658/691] we don't calculate difficulty --- src/chains/ethereum/src/blockchain.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 1ea9a09b72..627853702f 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -273,7 +273,6 @@ export default class Blockchain extends Emittery.Typed< number: Quantity.from(prevNumber + 1n).toBuffer(), coinbase: this.coinbase.toBuffer(), timestamp: blockData.timestamp, - // difficulty: gasLimit: options.miner.blockGasLimit.toBuffer(), transactionsTrie: blockData.transactionsTrie.root, receiptTrie: blockData.receiptTrie.root, From 8f90fedd89b7241a25f1ff9c62fa63d256d591a1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 20:44:56 -0400 Subject: [PATCH 659/691] Add description field to create script --- scripts/create.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/create.ts b/scripts/create.ts index 686d1c1c1b..edcf74552e 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -95,6 +95,7 @@ process.stdout.write(`${COLORS.Reset}`); const pkg = { name: packageName, version: version, + description: "", author: packageAuthor || require("../package.json").author, homepage: `https://github.com/trufflesuite/ganache-core/tree/develop/src/${location}/${name}#readme`, license: "MIT", From bd91bf479fc0b3e64268a23e93c366e2e1fd0828 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 30 Oct 2020 20:46:24 -0400 Subject: [PATCH 660/691] small miner refactor/move --- src/chains/ethereum/src/blockchain.ts | 8 +- src/chains/ethereum/src/{ => miner}/miner.ts | 99 +++++++++---------- .../ethereum/src/miner/replace-from-heap.ts | 20 ++++ 3 files changed, 70 insertions(+), 57 deletions(-) rename src/chains/ethereum/src/{ => miner}/miner.ts (86%) create mode 100644 src/chains/ethereum/src/miner/replace-from-heap.ts diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 627853702f..decdf5ca6a 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -1,5 +1,5 @@ import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; -import Miner from "./miner"; +import Miner, { BlockData } from "./miner/miner"; import Database from "./database"; import Emittery from "emittery"; import BlockManager, { Block } from "./data-managers/block-manager"; @@ -262,7 +262,7 @@ export default class Blockchain extends Emittery.Typed< }); } - #fillNewBlock = (blockData: any) => { + #fillNewBlock = (blockData: BlockData) => { const blocks = this.blocks; const options = this.#options; const prevBlock = blocks.latest; @@ -392,7 +392,7 @@ export default class Blockchain extends Emittery.Typed< logger.log(""); }; - #handleNewBlockData = async (blockData: any) => { + #handleNewBlockData = async (blockData: BlockData) => { this.#blockBeingSavedPromise = this.#blockBeingSavedPromise .then(() => this.#fillNewBlock(blockData)) .then(this.#saveNewBlock) @@ -455,7 +455,7 @@ export default class Blockchain extends Emittery.Typed< createVmFromStateTrie = ( stateTrie: CheckpointTrie, allowUnlimitedContractSize: boolean - ): any => { + ) => { const blocks = this.blocks; // ethereumjs vm doesn't use the callback style anymore const getBlock = class T { diff --git a/src/chains/ethereum/src/miner.ts b/src/chains/ethereum/src/miner/miner.ts similarity index 86% rename from src/chains/ethereum/src/miner.ts rename to src/chains/ethereum/src/miner/miner.ts index 44fc0a0bea..955e36c76b 100644 --- a/src/chains/ethereum/src/miner.ts +++ b/src/chains/ethereum/src/miner/miner.ts @@ -1,6 +1,6 @@ -import params from "./things/params"; +import params from "../things/params"; import { utils } from "@ganache/utils"; -import Transaction from "./things/transaction"; +import Transaction from "../things/transaction"; import { Quantity, Data } from "@ganache/utils"; import { promisify } from "util"; import Trie from "merkle-patricia-tree"; @@ -8,11 +8,12 @@ import Emittery from "emittery"; import Block from "ethereumjs-block"; import VM from "ethereumjs-vm"; import { encode as rlpEncode } from "rlp"; -import { EthereumInternalOptions } from "./options"; -import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; -import { Executables } from "./types/executables"; +import { EthereumInternalOptions } from "../options"; +import RuntimeError, { RETURN_TYPES } from "../errors/runtime-error"; +import { Executables } from "../types/executables"; +import replaceFromHeap from "./replace-from-heap"; -type BlockData = { +export type BlockData = { blockTransactions: Transaction[]; transactionsTrie: Trie; receiptTrie: Trie; @@ -23,27 +24,8 @@ type BlockData = { const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => promisify(trie.put.bind(trie))(key, val); -function replaceFromHeap( - priced: utils.Heap, - source: utils.Heap -) { - // get the next best for this account, removing from the source Heap: - const next = source.peek(); - if (next) { - // remove the current best priced transaction from this account and replace - // it with the account's next lowest nonce transaction: - priced.replaceBest(next); - next.locked = true; - return true; - } else { - // since we don't have a next, just remove this item from priced - return priced.removeBest(); - } -} - -function byPrice(values: Transaction[], a: number, b: number) { - return Quantity.from(values[a].gasPrice) > Quantity.from(values[b].gasPrice); -} +const sortByPrice = (values: Transaction[], a: number, b: number) => + Quantity.from(values[a].gasPrice) > Quantity.from(values[b].gasPrice); export default class Miner extends Emittery.Typed< { block: BlockData }, @@ -86,7 +68,7 @@ export default class Miner extends Emittery.Typed< } // create a Heap that sorts by gasPrice - readonly #priced = new utils.Heap(byPrice); + readonly #priced = new utils.Heap(sortByPrice); /* * @param executables A live Map of pending transactions from the transaction * pool. The miner will update this Map by removing the best transactions @@ -130,6 +112,7 @@ export default class Miner extends Emittery.Typed< if (this.#paused) { await this.#resumer; } + // only allow mining a single block at a time (per miner) if (this.#isBusy) { // if we are currently mining a block, set the `pending` property @@ -140,11 +123,10 @@ export default class Miner extends Emittery.Typed< return; } else { this.#setPricedHeap(); + const result = await this.#mine(block, maxTransactions, onlyOneBlock); + this.emit("idle"); + return result; } - - const result = await this.#mine(block, maxTransactions, onlyOneBlock); - this.emit("idle"); - return result; } #mine = async ( @@ -160,11 +142,13 @@ export default class Miner extends Emittery.Typed< // if there are more txs to mine, start mining them without awaiting their // result. - if (!onlyOneBlock && this.#pending && this.#priced.length > 0) { + if (this.#pending) { this.#setPricedHeap(); this.#pending = false; - const nextBlock = this.#createBlock(lastBlock); - await this.#mine(nextBlock, this.#instamine ? 1 : -1); + if (!onlyOneBlock && this.#priced.length > 0) { + const nextBlock = this.#createBlock(lastBlock); + await this.#mine(nextBlock, this.#instamine ? 1 : -1); + } } return transactions; }; @@ -208,14 +192,13 @@ export default class Miner extends Emittery.Typed< let numTransactions = 0; let blockGasLeft = this.#options.blockGasLimit.toBigInt(); + const blockBloom = block.header.bloom; const promises: Promise[] = []; // Set a block-level checkpoint so our unsaved trie doesn't update the // vm's "live" trie. await this.#checkpoint(); - const blockBloom = block.header.bloom; - // Run until we run out of items, or until the inner loop stops us. // we don't call `shift()` here because we will may need to `replace` // this `best` transaction with the next best transaction from the same @@ -232,9 +215,8 @@ export default class Miner extends Emittery.Typed< // same account. // * We do "unlock" this transaction in the transaction pool's `pending` // queue so it can be replaced, if needed. - priced.removeBest(); best.locked = false; - this.#origins.delete(origin); + this.#removeBestAndOrigin(origin); continue; } @@ -296,7 +278,7 @@ export default class Miner extends Emittery.Typed< // this tx into our `priced` heap. keepMining = replaceFromHeap(priced, pendingOrigin); } else { - keepMining = priced.removeBest(); + keepMining = this.#removeBestAndOrigin(origin); } break; } @@ -309,7 +291,7 @@ export default class Miner extends Emittery.Typed< } else { // since we don't have any more txs from this account, just get the // next bext transaction sorted in our `priced` heap. - keepMining = priced.removeBest(); + keepMining = this.#removeBestAndOrigin(origin); } } else { // didn't fit in the current block @@ -325,9 +307,9 @@ export default class Miner extends Emittery.Typed< keepMining = priced.removeBest(); } } else { - // no result means the tranasction is an "always failing tx", so we - // revert it's changes here. - // Note: we don't clean up ()`removeBest`, etc) because `runTx`'s + // no result means the transaction is an "always failing tx", so we + // revert its changes here. + // Note: we don't clean up (`removeBest`, etc) because `runTx`'s // error handler does the clean up itself. await this.#revert(); } @@ -335,13 +317,13 @@ export default class Miner extends Emittery.Typed< await Promise.all(promises); await this.#commit(); + + const emitBlockProm = this.emit("block", blockData); if (legacyInstamine === true) { // we need to wait for each block to be done mining when in legacy // mode because things like `mine` and `miner_start` must wait for the - // first mine operation to be completed. - await this.emit("block", blockData); - } else { - this.emit("block", blockData); + // first mine operation to be fully complete. + await emitBlockProm; } if (onlyOneBlock) { @@ -355,7 +337,6 @@ export default class Miner extends Emittery.Typed< if (priced.length !== 0) { maxTransactions = this.#instamine ? 1 : -1; block = this.#createBlock(block); - continue; } else { // reset the miner this.#reset(); @@ -386,8 +367,7 @@ export default class Miner extends Emittery.Typed< // if there are no more transactions from this origin remove this tx // from the priced heap and clear out it's origin so it can accept new // transactions from this origin. - this.#priced.removeBest(); - this.#origins.delete(origin); + this.#removeBestAndOrigin(origin); } const e = { @@ -396,21 +376,30 @@ export default class Miner extends Emittery.Typed< exceptionError: { error: errorMessage }, returnValue: Buffer.allocUnsafe(0) } - } as any; + }; tx.finalize( "rejected", - new RuntimeError(tx.hash(), e, RETURN_TYPES.TRANSACTION_HASH) + new RuntimeError(tx.hash(), e as any, RETURN_TYPES.TRANSACTION_HASH) ); return null; } }; + #removeBestAndOrigin = (origin: string) => { + this.#origins.delete(origin); + return this.#priced.removeBest(); + }; + #reset = () => { this.#origins.clear(); this.#priced.clear(); this.#isBusy = false; }; + /** + * Adds one transaction from each origin into the "priced" heap, which + * sorts each tx by gasPrice (high to low) + */ #setPricedHeap = () => { const { pending } = this.#executables; const origins = this.#origins; @@ -428,6 +417,10 @@ export default class Miner extends Emittery.Typed< } }; + /** + * Updates the "priced" heap with transactions from origins it doesn't yet + * contain. + */ #updatePricedHeap = () => { const { pending } = this.#executables; const origins = this.#origins; diff --git a/src/chains/ethereum/src/miner/replace-from-heap.ts b/src/chains/ethereum/src/miner/replace-from-heap.ts new file mode 100644 index 0000000000..fe93e2f0c5 --- /dev/null +++ b/src/chains/ethereum/src/miner/replace-from-heap.ts @@ -0,0 +1,20 @@ +import { utils } from "@ganache/utils"; +import Transaction from "../things/transaction"; + +export default function replaceFromHeap( + priced: utils.Heap, + source: utils.Heap +) { + // get the next best for this account, removing from the source Heap: + const next = source.peek(); + if (next) { + // remove the current best priced transaction from this account and replace + // it with the account's next lowest nonce transaction: + priced.replaceBest(next); + next.locked = true; + return true; + } else { + // since we don't have a next, just remove this item from priced + return priced.removeBest(); + } +} From a4546253b07bb136a43307f852d40711da70a61c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 2 Nov 2020 13:31:53 -0500 Subject: [PATCH 661/691] change "transaction rejected; gas price too low to replace existing transaction" error to just "replacement transaction underpriced" --- src/chains/ethereum/src/transaction-pool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/transaction-pool.ts b/src/chains/ethereum/src/transaction-pool.ts index e2305a1f64..e0ff56d6a7 100644 --- a/src/chains/ethereum/src/transaction-pool.ts +++ b/src/chains/ethereum/src/transaction-pool.ts @@ -140,7 +140,7 @@ export default class TransactionPool extends Emittery.Typed<{}, "drain"> { ); } else { throw new CodedError( - "transaction rejected; gas price too low to replace existing transaction", + "replacement transaction underpriced", ErrorCodes.TRANSACTION_REJECTED ); } From 604f5d50407ee0cf9713a75eb0c3554d2899d68d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 14:43:36 -0500 Subject: [PATCH 662/691] move `prepare` to `postinstall` --- package.json | 2 +- scripts/postinstall.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 scripts/postinstall.ts diff --git a/package.json b/package.json index 1956fbf167..9d830666ef 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "docs.preview": "lerna exec --no-bail npm run docs.preview", "clean": "npx shx rm -rf node_modules && npx lerna clean -y && npm run tsc.clean", "create": "ts-node ./scripts/create", - "prepare": "lerna bootstrap && echo \"\n\\033[1;36m Tip:\\033[0;36m run \\033[1;2;33msource completions.sh\\033[0;36m to supply bash completions for npm scripts\\033[0m\n\"", + "postinstall": "lerna bootstrap && ts-node ./scripts/postinstall", "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm run test", "tsc": "lerna exec -- npm run tsc", diff --git a/scripts/postinstall.ts b/scripts/postinstall.ts new file mode 100644 index 0000000000..bf6bb8e904 --- /dev/null +++ b/scripts/postinstall.ts @@ -0,0 +1,7 @@ +import chalk from "chalk"; + +console.log(""); +console.log( + chalk`{bold.cyan Tip:} {cyan run} {bold.yellow.dim source completions.sh} {cyan to supply bash completions for npm scripts}` +); +console.log(""); From 5ea5cdc8713b4b088d7bfde1162f0ae3cbdaeca5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 14:44:50 -0500 Subject: [PATCH 663/691] Update JSDoc examples --- src/chains/ethereum/src/api.ts | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 0eefe01c69..2fd23e397e 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -425,13 +425,13 @@ export default class EthereumApi implements types.Api { * @returns `true` if a snapshot was reverted, otherwise `false` * * @example - *
+ * ```javascript * const snapshotId = await provider.send("evm_snapshot"); * const isReverted = await provider.send("evm_revert", [snapshotId]); - *
+ * ``` * * @example - *
+ * ```javascript * const provider = ganache.provider(); * const [from, to] = await provider.send("eth_accounts"); * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); @@ -454,7 +454,7 @@ export default class EthereumApi implements types.Api { * * const endingBalance = await provider.send("eth_getBalance", [from]); * assert.strictEqual(BigInt(endingBalance), startingBalance); - *
+ * ``` */ @assertArgLength(1) async evm_revert(snapshotId: string | number) { @@ -471,12 +471,12 @@ export default class EthereumApi implements types.Api { * @returns The hex-encoded identifier for this snapshot * * @example - *
+ * ```javascript * const snapshotId = await provider.send("evm_snapshot"); - *
+ * ``` * * @example - *
+ * ```javascript * const provider = ganache.provider(); * const [from, to] = await provider.send("eth_accounts"); * const startingBalance = BigInt(await provider.send("eth_getBalance", [from])); @@ -499,7 +499,7 @@ export default class EthereumApi implements types.Api { * * const endingBalance = await provider.send("eth_getBalance", [from]); * assert.strictEqual(BigInt(endingBalance), startingBalance); - *
+ * ``` */ async evm_snapshot() { return Quantity.from(this.#blockchain.snapshot()); @@ -975,7 +975,12 @@ export default class EthereumApi implements types.Api { * Returns the currently configured chain id, a value used in * replay-protected transaction signing as introduced by EIP-155. * @returns The chain id as a string. - * @EIP [155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) + * @EIP [155 – Simple replay attack protection](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) + * + * @example + * ```javascript + * await provider.send("eth_chainId"); + * ``` */ @assertArgLength(0) async eth_chainId() { From dd596707e0071111747ee8c35b91dafc9ea5276a Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 14:45:12 -0500 Subject: [PATCH 664/691] . --- src/chains/ethereum/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 2fd23e397e..3d58b3ec7f 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -976,7 +976,7 @@ export default class EthereumApi implements types.Api { * replay-protected transaction signing as introduced by EIP-155. * @returns The chain id as a string. * @EIP [155 – Simple replay attack protection](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) - * + * * @example * ```javascript * await provider.send("eth_chainId"); From 4c9d2ba4fa2d09d8afe49c6ef87885a6d3cdd6bd Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 14:45:39 -0500 Subject: [PATCH 665/691] remove blockchain step event as nothing was using it --- src/chains/ethereum/src/blockchain.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index decdf5ca6a..3b1d74a749 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -71,7 +71,7 @@ type BlockchainTypedEvents = { blockLogs: BlockLogs; pendingTransaction: Transaction; }; -type BlockchainEvents = "start" | "stop" | "step"; +type BlockchainEvents = "start" | "stop"; /** * Sets the provided VM state manager's state root *without* first @@ -197,7 +197,6 @@ export default class Blockchain extends Emittery.Typed< this.trie, options.chain.allowUnlimitedContractSize ); - this.vm.on("step", this.emit.bind(this, "step")); await this.#commitAccounts(initialAccounts); @@ -730,7 +729,6 @@ export default class Blockchain extends Emittery.Typed< stateTrie, this.vm.allowUnlimitedContractSize ); - vm.on("step", this.emit.bind(this, "step")); result = await vm.runCall({ caller: transaction.from.toBuffer(), From 67e2ae7bbd83dfb83d9ca1f98226e7d6fcd54843 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 14:46:12 -0500 Subject: [PATCH 666/691] use BN's toArrayLike instead of toBuffer for browser compat --- src/chains/ethereum/src/miner/miner.ts | 4 +++- src/chains/ethereum/src/things/transaction.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/chains/ethereum/src/miner/miner.ts b/src/chains/ethereum/src/miner/miner.ts index 955e36c76b..2f50326950 100644 --- a/src/chains/ethereum/src/miner/miner.ts +++ b/src/chains/ethereum/src/miner/miner.ts @@ -228,7 +228,9 @@ export default class Miner extends Emittery.Typed< const result = await this.#runTx(best, block, origin, pending); if (result !== null) { - const gasUsed = Quantity.from(result.gasUsed.toBuffer()).toBigInt(); + const gasUsed = Quantity.from( + result.gasUsed.toArrayLike(Buffer) + ).toBigInt(); if (blockGasLeft >= gasUsed) { // if the transaction will fit in the block, commit it! await this.#commit(); diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 56aa85f9a1..565c5c4163 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -505,7 +505,7 @@ class Transaction extends (EthereumJsTransaction as any) { result.bloom.bitvector, (this.#logs = vmResult.logs || ([] as TransactionLog[])), result.createdAddress, - result.gasUsed.toBuffer() + result.gasUsed.toArrayLike(Buffer) )); return receipt.serialize(false); From 94e47c957cab22f2b621231d6e12aff31a5fb989 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 14:46:51 -0500 Subject: [PATCH 667/691] add code-block to promise-queue example --- src/packages/promise-queue/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/packages/promise-queue/src/index.ts b/src/packages/promise-queue/src/index.ts index c860aaf881..80c2e558ab 100644 --- a/src/packages/promise-queue/src/index.ts +++ b/src/packages/promise-queue/src/index.ts @@ -11,6 +11,7 @@ const emitteryMethods = ["emit", "once"] as const; * return promises; this queue is for the promises themselves. * * @example + * ```javascript * const queue = new PromiseQueue(); * * const slow = new Promise(resolve => setTimeout(resolve, 1000, "slow")); @@ -27,6 +28,7 @@ const emitteryMethods = ["emit", "once"] as const; * * * note: whatever the promise starting doing when it was created will still * happen, no promises are aborted; rather, the return value is ignored. + * ``` */ @Emittery.mixin(Symbol.for("emittery"), emitteryMethods) class PromiseQueue { From 452b826935b086549955b292250b4df141ed2cf3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 14:47:24 -0500 Subject: [PATCH 668/691] use destructuring for import/require --- .../utils/src/things/json-rpc/json-rpc-quantity.ts | 2 +- src/packages/utils/src/utils/bigint-to-buffer.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts index b75a7b1489..4d085941ea 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-quantity.ts @@ -1,5 +1,5 @@ import { BaseJsonRpcType } from "./json-rpc-base-types"; -const toBigIntBE = require("bigint-buffer").toBigIntBE; +import { toBigIntBE } from "bigint-buffer"; export class Quantity extends BaseJsonRpcType { _nullable: boolean = false; diff --git a/src/packages/utils/src/utils/bigint-to-buffer.ts b/src/packages/utils/src/utils/bigint-to-buffer.ts index 49ea2e9ddf..7670043227 100644 --- a/src/packages/utils/src/utils/bigint-to-buffer.ts +++ b/src/packages/utils/src/utils/bigint-to-buffer.ts @@ -16,7 +16,12 @@ function bigIntByteLength(value: bigint) { const MAX_SAFE_INTEGER = BigInt(Number.MAX_SAFE_INTEGER); try { - const toBufferBE = require("bigint-buffer").toBufferBE; + const { toBufferBE } = require("bigint-buffer"); + + // force fallback if only `toBufferBE` is missing (this can happen if toBufferBE isn't polyfilled for the browser, + // which, at the time of this writing... it isn't) + if (!toBufferBE) throw new Error("Missing function `toBufferBE`!"); + _bigIntToBuffer = (value: bigint) => { if (value <= MAX_SAFE_INTEGER) { return uintToBuffer(Number(value)); From 53a617589131418c4c533fca1af7a652b6b37762 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 14:48:04 -0500 Subject: [PATCH 669/691] add leveldown opts, in case of browser use --- src/chains/ethereum/src/database.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/src/database.ts index e12ab9e4dd..b20b39026b 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/src/database.ts @@ -65,7 +65,10 @@ export default class Database extends Emittery { if (this.#closed) return this.#cleanup(); } this.directory = directory; - const store = encode(leveldown(directory), levelupOptions); + + // specify an empty `prefix` for browser-based leveldown (level-js) + const leveldownOpts = { prefix: "" }; + const store = encode(leveldown(directory, leveldownOpts), levelupOptions); this.#rootStore = store; db = levelup(store, {}); } From f3b17ccadc96090eb7f5838f05811306c5f1e1ba Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 14:50:49 -0500 Subject: [PATCH 670/691] add webpack, switch to ttypescript --- .gitignore | 1 + npm-shrinkwrap.json | 1469 ++++++++++++++++++++++- package.json | 23 +- scripts/compile.ts | 144 --- scripts/create.ts | 2 +- src/chains/ethereum/npm-shrinkwrap.json | 6 + src/chains/ethereum/package.json | 4 +- src/chains/ethereum/src/api.ts | 7 +- src/chains/tezos/package.json | 5 +- src/packages/core/package.json | 2 +- src/packages/flavors/package.json | 2 +- src/packages/options/package.json | 2 +- src/packages/promise-queue/package.json | 2 +- src/packages/utils/package.json | 2 +- tsconfig.json | 10 +- webpack.config.ts | 4 + webpack/browser-bigint-buffer.ts | 4 + webpack/browser-tmp-promise.ts | 362 ++++++ webpack/webpack.browser.config.ts | 38 + webpack/webpack.common.config.ts | 40 + webpack/webpack.node.config.ts | 22 + 21 files changed, 1971 insertions(+), 180 deletions(-) delete mode 100644 scripts/compile.ts create mode 100644 webpack.config.ts create mode 100644 webpack/browser-bigint-buffer.ts create mode 100644 webpack/browser-tmp-promise.ts create mode 100644 webpack/webpack.browser.config.ts create mode 100644 webpack/webpack.common.config.ts create mode 100644 webpack/webpack.node.config.ts diff --git a/.gitignore b/.gitignore index ef45fb5aaf..84795d7c22 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ lerna-debug.log npm-debug.log src/**/*/lib coverage +dist/ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 904007b0c2..796babac94 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2512,6 +2512,32 @@ "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", "dev": true }, + "@types/eslint": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.4.tgz", + "integrity": "sha512-YCY4kzHMsHoyKspQH+nwSe+70Kep7Vjt2X+dZe5Vs2vkRudqtoFoUIv1RlJmZB8Hbp7McneupoZij4PadxsK5Q==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", + "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.45", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", + "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", + "dev": true + }, "@types/events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", @@ -2537,6 +2563,12 @@ "@types/node": "*" } }, + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, "@types/lodash": { "version": "4.14.161", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.161.tgz", @@ -2686,6 +2718,208 @@ "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, + "@webassemblyjs/ast": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", + "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", + "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", + "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", + "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", + "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", + "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", + "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", + "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", + "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", + "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", + "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", + "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", + "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/helper-wasm-section": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-opt": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", + "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", + "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", + "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", + "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/floating-point-hex-parser": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-code-frame": "1.9.0", + "@webassemblyjs/helper-fsm": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", + "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webpack-cli/info": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.0.2.tgz", + "integrity": "sha512-FEfLQwmN4pXZSYSrtp+KC84rFanoCIxXFpS2wUvviDCE2fnajwxw2GXzbj83IlH4Dl8Wq8kJjavVwvxv3YJmnw==", + "dev": true, + "requires": { + "envinfo": "^7.7.3" + } + }, + "@webpack-cli/serve": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.0.1.tgz", + "integrity": "sha512-WGMaTMTK6NOe29Hw1WBEok9vGLfKg5C6jWzNOS/6HH1YadR+RL+TRWRcSyc81Dzulljhk/Ree9mrDM4Np9GGOQ==", + "dev": true + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, "@zkochan/cmd-shim": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", @@ -2728,6 +2962,12 @@ } } }, + "acorn": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz", + "integrity": "sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ==", + "dev": true + }, "agent-base": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", @@ -2768,6 +3008,12 @@ "uri-js": "^4.2.2" } }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -2913,12 +3159,24 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, + "array-back": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz", + "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", + "dev": true + }, "array-differ": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", "dev": true }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", + "dev": true + }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", @@ -2973,6 +3231,30 @@ "safer-buffer": "~2.1.0" } }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "assert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", + "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", + "dev": true, + "requires": { + "es6-object-assign": "^1.1.0", + "is-nan": "^1.2.1", + "object-is": "^1.0.1", + "util": "^0.12.0" + } + }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -3025,6 +3307,15 @@ "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=", "dev": true }, + "available-typed-arrays": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", + "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", + "dev": true, + "requires": { + "array-filter": "^1.0.0" + } + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -3125,6 +3416,12 @@ "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", "dev": true }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, "bigint-buffer": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", @@ -3245,6 +3542,76 @@ "safe-buffer": "^5.0.1" } }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + } + } + }, + "browserslist": { + "version": "4.14.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.6.tgz", + "integrity": "sha512-zeFYcUo85ENhc/zxHbiIp0LGzzTrE2Pv2JhxvS7kpUb9Q9D38kUX6Bie7pGutJ/5iF5rOxE7CepAuWD56xJ33A==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001154", + "electron-to-chromium": "^1.3.585", + "escalade": "^3.1.1", + "node-releases": "^1.1.65" + } + }, "bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", @@ -3454,6 +3821,12 @@ } } }, + "caniuse-lite": { + "version": "1.0.30001154", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001154.tgz", + "integrity": "sha512-y9DvdSti8NnYB9Be92ddMZQrcOe04kcQtcxtBx4NkB04+qZ+JUWotnXBJTmxlKudhxNTQ3RRknMwNU2YQl/Org==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -3567,6 +3940,15 @@ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", @@ -3904,6 +4286,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "colorette": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", + "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", + "dev": true + }, "columnify": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", @@ -3929,6 +4317,46 @@ "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", "dev": true }, + "command-line-usage": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.0.tgz", + "integrity": "sha512-Ew1clU4pkUeo6AFVDFxCbnN7GIZfXl48HIOQeFQnkO3oOqvpI7wdqtLRwv9iOCZ/7A+z4csVZeiDdEcj8g6Wiw==", + "dev": true, + "requires": { + "array-back": "^4.0.0", + "chalk": "^2.4.2", + "table-layout": "^1.0.0", + "typical": "^5.2.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "commander": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", @@ -4363,6 +4791,16 @@ "parse-json": "^4.0.0" } }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -4408,6 +4846,25 @@ "which": "^2.0.1" } }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -4506,6 +4963,12 @@ "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", "dev": true }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, "default-require-extensions": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", @@ -4619,6 +5082,16 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "dev": true }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, "detect-indent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", @@ -4641,6 +5114,17 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, "dir-glob": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", @@ -4725,6 +5209,12 @@ "safer-buffer": "^2.1.0" } }, + "electron-to-chromium": { + "version": "1.3.586", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.586.tgz", + "integrity": "sha512-or8FCbQCRlPZHkOoqBULOI9hzTiStVIQqDLgAPt8pzY+swTrW+89vsqd24Zn+Iv4guAJLxRBD6OR5AmbpabGDA==", + "dev": true + }, "elliptic": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", @@ -4750,6 +5240,12 @@ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, "encoding": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", @@ -4811,12 +5307,31 @@ "once": "^1.4.0" } }, - "env-paths": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", - "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==", - "dev": true - }, + "enhanced-resolve": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.3.1.tgz", + "integrity": "sha512-G1XD3MRGrGfNcf6Hg0LVZG7GIKcYkbfHa5QMxt1HDUTdYoXH0JR1xXyg+MaKLF73E9A27uWNVxvFivNRYeUB6w==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.0.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "env-paths": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", + "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA==", + "dev": true + }, "envinfo": { "version": "7.7.3", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz", @@ -4887,6 +5402,12 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, + "es6-object-assign": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", + "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", + "dev": true + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -4914,12 +5435,45 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, "ethashjs": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz", @@ -5331,6 +5885,12 @@ "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", "dev": true }, + "events": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "dev": true + }, "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -5861,6 +6421,12 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, "foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -7030,9 +7596,9 @@ } }, "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, "iferr": { "version": "0.1.5", @@ -7315,6 +7881,12 @@ } } }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -7427,6 +7999,12 @@ "number-is-nan": "^1.0.0" } }, + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==", + "dev": true + }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -7441,6 +8019,15 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, + "is-nan": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.0.tgz", + "integrity": "sha512-z7bbREymOqt2CCaZVly8aC4ML3Xhfi0ekuOnjO2L8vKdl+CttdVoGZQhd4adMFAsxQ5VeRVwORs4tU8RH+HFtQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, "is-negated-glob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", @@ -7542,6 +8129,18 @@ "text-extensions": "^1.0.0" } }, + "is-typed-array": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.3.tgz", + "integrity": "sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.0", + "es-abstract": "^1.17.4", + "foreach": "^2.0.5", + "has-symbols": "^1.0.1" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -7749,6 +8348,17 @@ "istanbul-lib-report": "^3.0.0" } }, + "jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + } + }, "js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", @@ -7952,6 +8562,39 @@ } } }, + "level-js": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/level-js/-/level-js-5.0.2.tgz", + "integrity": "sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg==", + "dev": true, + "requires": { + "abstract-leveldown": "~6.2.3", + "buffer": "^5.5.0", + "inherits": "^2.0.3", + "ltgt": "^2.1.2" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + } + } + }, "level-mem": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", @@ -8196,6 +8839,34 @@ "type-fest": "^0.3.0" } }, + "loader-runner": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.1.0.tgz", + "integrity": "sha512-oR4lB4WvwFoC70ocraKhn5nkKSs23t57h9udUgw8o0iH8hMXeEoRuUgfcvgUwAJ1ZpRqBvcou4N2SMvM1DwMrA==", + "dev": true + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -8421,6 +9092,54 @@ } } }, + "memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", @@ -8957,6 +9676,12 @@ "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", "dev": true }, + "monaco-editor": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.21.2.tgz", + "integrity": "sha512-jS51RLuzMaoJpYbu7F6TPuWpnWTLD4kjRW0+AZzcryvbxrTwhNy1KC9yboyKpgMTahpUbDUsuQULoo0GV1EPqg==", + "dev": true + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -9137,6 +9862,29 @@ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" }, + "node-loader": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/node-loader/-/node-loader-1.0.2.tgz", + "integrity": "sha512-myxAxpyMR7knjA4Uzwf3gjxaMtxSWj2vpm9o6AYWWxQ1S3XMBNeG2vzYcp/5eW03cBGfgSxyP+wntP8qhBJNhQ==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + }, + "dependencies": { + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + } + } + }, "node-preload": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", @@ -9146,6 +9894,12 @@ "process-on-spawn": "^1.0.0" } }, + "node-releases": { + "version": "1.1.65", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.65.tgz", + "integrity": "sha512-YpzJOe2WFIW0V4ZkJQd/DGR/zdVwc/pI4Nl1CZrBO19FdRcSTmsuhdttw9rsTzzJLrNcSloLiBbEYx1C4f6gpA==", + "dev": true + }, "nopt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", @@ -9612,6 +10366,44 @@ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" }, + "object-is": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.3.tgz", + "integrity": "sha512-teyqLvFWzLkq5B9ki8FVWA902UER2qkxmdA4nLf+wjOLAWgxzCWZNCxpDq9MvE8MmhWNr+I8w3BN49Vx36Y6Xg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, "object-keys": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", @@ -9710,6 +10502,12 @@ "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", "dev": true }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -9901,6 +10699,19 @@ } } }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, "parse-git-config": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", @@ -9989,6 +10800,12 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -10287,6 +11104,12 @@ } } }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -10358,6 +11181,20 @@ "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -10423,6 +11260,16 @@ "safe-buffer": "^5.1.0" } }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, "reachdown": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz", @@ -10605,6 +11452,12 @@ "strip-indent": "^3.0.0" } }, + "reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -10837,6 +11690,17 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, "scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", @@ -11227,6 +12091,12 @@ "is-plain-obj": "^1.0.0" } }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -11413,6 +12283,16 @@ } } }, + "stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dev": true, + "requires": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, "stream-each": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", @@ -11693,6 +12573,24 @@ "has-flag": "^4.0.0" } }, + "table-layout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.1.tgz", + "integrity": "sha512-dEquqYNJiGwY7iPfZ3wbXDI944iqanTSchrACLL2nOB+1r+h1Nzu2eH+DuPPvWvm5Ry7iAPeFlgEtP5bIp5U7Q==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + } + }, + "tapable": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.0.0.tgz", + "integrity": "sha512-bjzn0C0RWoffnNdTzNi7rNDhs1Zlwk2tRXgk8EiHKAOX1Mag3d6T0Y5zNa7l9CJ+EoUne/0UHdwS8tMbkh9zDg==", + "dev": true + }, "tar": { "version": "4.4.13", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", @@ -11736,15 +12634,71 @@ } } }, - "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "terser": { + "version": "5.3.8", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz", + "integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==", "dev": true, "requires": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz", + "integrity": "sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ==", + "dev": true, + "requires": { + "jest-worker": "^26.6.1", + "p-limit": "^3.0.2", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", + "source-map": "^0.6.1", + "terser": "^5.3.8" + }, + "dependencies": { + "p-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" } }, "text-extensions": { @@ -11926,6 +12880,113 @@ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, + "ts-loader": { + "version": "8.0.7", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.7.tgz", + "integrity": "sha512-ooa4wxlZ9TOXaJ/iVyZlWsim79Ul4KyifSwyT2hOrbQA6NZJypsLOE198o8Ko+JV+ZHnMArvWcl4AnRqpCU/Mw==", + "dev": true, + "requires": { + "chalk": "^2.3.0", + "enhanced-resolve": "^4.0.0", + "loader-utils": "^1.0.2", + "micromatch": "^4.0.0", + "semver": "^6.0.0" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "enhanced-resolve": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", + "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, "ts-morph": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.3.0.tgz", @@ -11950,12 +13011,27 @@ "yn": "3.1.1" } }, + "ts-transformer-inline-file": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ts-transformer-inline-file/-/ts-transformer-inline-file-0.1.1.tgz", + "integrity": "sha512-2bPkAFjATsRG4ld8TFTUqn4TvEdXLQf/wwGsepFeRKSXLPqFRhdUHusAGPB1/Zif3CVjppD+bfne58gynd8RfQ==", + "dev": true + }, "tslib": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, + "ttypescript": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.12.tgz", + "integrity": "sha512-1ojRyJvpnmgN9kIHmUnQPlEV1gq+VVsxVYjk/NfvMlHSmYxjK5hEvOOU2MQASrbekTUiUM7pR/nXeCc8bzvMOQ==", + "dev": true, + "requires": { + "resolve": ">=1.9.0" + } + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -11998,6 +13074,12 @@ "integrity": "sha512-b/LAttdVl3G6FEmnMkDsK0xvfvaftXpSKrjXn+OVCRqrwz5WD/6QJOiN+dTorqDY+hkaH+r2gP5wI1jBDmdQ7A==", "dev": true }, + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true + }, "uWebSockets.js": { "version": "github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c", "from": "github:uNetworking/uWebSockets.js#v18.4.0" @@ -12162,6 +13244,20 @@ } } }, + "util": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz", + "integrity": "sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "safe-buffer": "^5.1.2", + "which-typed-array": "^1.1.2" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -12193,6 +13289,12 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -12223,6 +13325,24 @@ "extsprintf": "^1.2.0" } }, + "watchpack": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.0.1.tgz", + "integrity": "sha512-vO8AKGX22ZRo6PiOFM9dC0re8IcKh8Kd/aH2zeqUc6w4/jBGlTy2P7fTC6ekT0NjVeGjgU2dGC5rNstKkeLEQg==", + "dev": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "dependencies": { + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + } + } + }, "wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -12238,6 +13358,299 @@ "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", "dev": true }, + "webpack": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.4.0.tgz", + "integrity": "sha512-udpYTyqz8toTTdaOsL2QKPLeZLt2IEm9qY7yTXuFEQhKu5bk0yQD9BtAdVQksmz4jFbbWOiWmm3NHarO0zr/ng==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.45", + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/wasm-edit": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "acorn": "^8.0.4", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.3.1", + "eslint-scope": "^5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.1.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "pkg-dir": "^4.2.0", + "schema-utils": "^3.0.0", + "tapable": "^2.0.0", + "terser-webpack-plugin": "^5.0.3", + "watchpack": "^2.0.0", + "webpack-sources": "^2.1.1" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + } + } + }, + "webpack-cli": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.1.0.tgz", + "integrity": "sha512-NdhxXMZmoik62Y05t0h1y65LjBM7BwFPq311ihXuMM3RY6dlc4KkCTyHLzTuBEc+bqq6d3xh+CWmU0xRexNJBA==", + "dev": true, + "requires": { + "@webpack-cli/info": "^1.0.2", + "@webpack-cli/serve": "^1.0.1", + "ansi-escapes": "^4.3.1", + "colorette": "^1.2.1", + "command-line-usage": "^6.1.0", + "commander": "^6.0.0", + "enquirer": "^2.3.4", + "execa": "^4.0.0", + "import-local": "^3.0.2", + "interpret": "^2.0.0", + "rechoir": "^0.7.0", + "v8-compile-cache": "^2.1.0", + "webpack-merge": "^4.2.2" + }, + "dependencies": { + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + } + }, + "commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", + "dev": true + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "webpack-sources": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", + "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", + "dev": true, + "requires": { + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "whatwg-url": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", @@ -12270,6 +13683,20 @@ "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", "dev": true }, + "which-typed-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.2.tgz", + "integrity": "sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.2", + "es-abstract": "^1.17.5", + "foreach": "^2.0.5", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.1", + "is-typed-array": "^1.1.3" + } + }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", @@ -12294,6 +13721,16 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "wordwrapjs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", + "integrity": "sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ==", + "dev": true, + "requires": { + "reduce-flatten": "^2.0.0", + "typical": "^5.0.0" + } + }, "workerpool": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.2.tgz", diff --git a/package.json b/package.json index 9d830666ef..244b860284 100644 --- a/package.json +++ b/package.json @@ -7,15 +7,16 @@ "npm": ">=6.1.0" }, "scripts": { - "docs.build": "lerna exec --no-bail npm run docs.build", - "docs.preview": "lerna exec --no-bail npm run docs.preview", + "docs.build": "lerna run docs.build", + "docs.preview": "lerna run docs.preview", "clean": "npx shx rm -rf node_modules && npx lerna clean -y && npm run tsc.clean", "create": "ts-node ./scripts/create", "postinstall": "lerna bootstrap && ts-node ./scripts/postinstall", "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm run test", "tsc": "lerna exec -- npm run tsc", - "tsc.clean": "npx lerna exec -- npx shx rm -rf lib" + "tsc.clean": "npx lerna exec -- npx shx rm -rf lib", + "prepare": "webpack" }, "dependencies": { "bip39": "3.0.2", @@ -49,27 +50,43 @@ "@types/uws": "0.13.2", "@types/ws": "7.2.7", "@types/yargs": "15.0.9", + "assert": "2.0.0", + "buffer": "5.6.0", "camelcase": "6.1.0", "chalk": "4.1.0", "cli-highlight": "2.1.4", "cross-env": "7.0.2", + "crypto-browserify": "3.12.0", "fs-extra": "9.0.1", "git-user-name": "2.0.0", "husky": "4.3.0", "into-stream": "6.0.0", "lerna": "3.22.1", + "level-js": "5.0.2", "mocha": "8.2.0", + "monaco-editor": "0.21.2", + "node-loader": "1.0.2", "npm-package-arg": "8.1.0", "nyc": "15.1.0", + "os-browserify": "0.3.0", + "path-browserify": "1.0.1", "prettier": "2.1.2", "pretty-quick": "3.1.0", + "process": "0.11.10", "shx": "0.3.3", "solc": "0.7.4", + "stream-browserify": "3.0.0", "superagent": "6.1.0", + "ts-loader": "8.0.7", "ts-morph": "7.3.0", "ts-node": "9.0.0", + "ts-transformer-inline-file": "0.1.1", + "ttypescript": "1.5.12", "typescript": "4.1.0-beta", "utf-8-validate": "5.0.2", + "util": "0.12.3", + "webpack": "5.4.0", + "webpack-cli": "4.1.0", "ws": "7.3.1", "yargs": "16.1.0" }, diff --git a/scripts/compile.ts b/scripts/compile.ts deleted file mode 100644 index 3f277eecd0..0000000000 --- a/scripts/compile.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { ts, Project, SourceFile } from "ts-morph"; -import { resolve, dirname } from "path"; -import { NodeFlags } from "typescript"; - -function trimQuote(path: string) { - return path.slice(1, path.length - 1); -} - -function resolveJsonImport(path: string): string { - if (path.endsWith(".json")) { - return path; - } - try { - path = require.resolve(path + ".json"); - } catch (_) { - return ""; - } - return path; -} - -function serializeToAst(v: any): ts.Expression { - if (Array.isArray(v)) { - return ts.createArrayLiteral(v.map(el => serializeToAst(el))); - } - switch (typeof v) { - case "string": - return ts.createStringLiteral(v); - case "number": - return ts.createNumericLiteral(String(v)); - case "boolean": - return v ? ts.createTrue() : ts.createFalse(); - case "object": - if (!v) { - return ts.createNull(); - } - const keys = Object.keys(v); - return ts.createObjectLiteral( - keys.map(k => - ts.createPropertyAssignment( - ts.createStringLiteral(k), - serializeToAst(v[k]) - ) - ) - ); - default: - throw new Error(`Can't serializeToAst ${typeof v}`); - } -} - -function serializeToTypeAst(v: any): ts.TypeNode { - if (Array.isArray(v)) { - return ts.createTupleTypeNode(v.map(el => serializeToTypeAst(el))); - } - switch (typeof v) { - case "string": - return ts.createKeywordTypeNode(ts.SyntaxKind.StringKeyword); - case "number": - return ts.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword); - case "boolean": - return v ? ts.createTrue() : ts.createFalse(); - case "object": - if (!v) { - return ts.createNull(); - } - const keys = Object.keys(v); - return ts.createTypeLiteralNode( - keys.map(k => - ts.createPropertySignature( - void 0, - ts.createStringLiteral(k), - void 0, - serializeToTypeAst(v[k]), - void 0 - ) - ) - ); - default: - throw new Error(`Can't serializeToTypeAst ${typeof v}`); - } -} - -function resolveJsonImportFromNode( - node: ts.ImportDeclaration, - sf: SourceFile -): string { - const jsonPath = trimQuote(node.moduleSpecifier.getText()); - return ( - jsonPath && resolveJsonImport(resolve(dirname(sf.getFilePath()), jsonPath)) - ); -} - -const parseConfigHost: ts.ParseConfigHost = ts.sys; -const configFileName = ts.findConfigFile( - "./", - ts.sys.fileExists, - "tsconfig.json" -) as string; -const configFile = ts.readConfigFile(configFileName, ts.sys.readFile); -const compilerOptions = ts.parseJsonConfigFileContent( - configFile.config, - parseConfigHost, - "./" -); -const project = new Project({ - compilerOptions: compilerOptions.options -}); -const sources = project.addSourceFilesAtPaths(compilerOptions.fileNames); - -sources.forEach(sourceFile => { - sourceFile.transform(traversal => { - const node = traversal.visitChildren(); - let jsonPath: string; - if ( - ts.isImportDeclaration(node) && - (jsonPath = resolveJsonImportFromNode(node, sourceFile)) && - node.importClause - ) { - const namedBindings = node.importClause.namedBindings; - if (namedBindings && "elements" in namedBindings) { - const jsonFile = require(jsonPath); - const json = namedBindings.elements.map(element => { - const name = element.name.text; - const propertyName = element.propertyName - ? element.propertyName.text - : name; - const value = jsonFile[propertyName]; - return ts.createVariableDeclaration( - name, - serializeToTypeAst(value), - serializeToAst(value) - ); - }); - return ts.createVariableStatement( - [], - ts.createVariableDeclarationList(json, NodeFlags.Const) - ); - } - } - - return node; - }); -}); - -project.emit(); diff --git a/scripts/create.ts b/scripts/create.ts index edcf74552e..2cf0e30634 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -112,7 +112,7 @@ process.stdout.write(`${COLORS.Reset}`); directory: `src/${location}/${name}` }, scripts: { - tsc: "ts-node ../../../scripts/compile", + tsc: "ttsc", test: "nyc npm run mocha", mocha: "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 8853170ebd..1a858ffc58 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -3806,6 +3806,12 @@ "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", "dev": true }, + "ts-transformer-inline-file": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ts-transformer-inline-file/-/ts-transformer-inline-file-0.1.1.tgz", + "integrity": "sha512-2bPkAFjATsRG4ld8TFTUqn4TvEdXLQf/wwGsepFeRKSXLPqFRhdUHusAGPB1/Zif3CVjppD+bfne58gynd8RfQ==", + "dev": true + }, "tsscmp": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 4a74d9aeed..2cbb2301cd 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -26,8 +26,7 @@ "scripts": { "docs.build": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run docs.post-process", "docs.post-process": "node ./scripts/post-process-docs.js", - "docs.preview": "ws --open --port 3010 --directory ./lib/docs", - "tsc": "ts-node ../../../scripts/compile", + "tsc": "ttsc", "test": "nyc --reporter lcov npm run mocha", "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" }, @@ -66,6 +65,7 @@ "cheerio": "1.0.0-rc.3", "local-web-server": "4.2.1", "open-cli": "6.0.1", + "ts-transformer-inline-file": "0.1.1", "typedoc": "0.17.8" } } diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 3d58b3ec7f..92e5be0164 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -15,10 +15,10 @@ import Address from "./things/address"; import Transaction from "./things/transaction"; import Wallet from "./wallet"; import { decode as rlpDecode } from "rlp"; +import { $INLINE_JSON } from "ts-transformer-inline-file"; const createKeccakHash = require("keccak"); -// Read in the current ganache version from core's package.json -import { version } from "../../../packages/core/package.json"; + import { PromiEvent, utils } from "@ganache/utils"; import Emittery from "emittery"; import Common from "ethereumjs-common"; @@ -44,6 +44,9 @@ import { parseFilterRange } from "./helpers/filter-parsing"; import { Hardfork } from "./options/chain-options"; + +// Read in the current ganache version from core's package.json +const { version } = $INLINE_JSON("../../../packages/core/package.json"); //#endregion //#region Constants diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 99a8957ff2..3d17414186 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -24,10 +24,7 @@ "directory": "src/chains/tezos" }, "scripts": { - "docs.build": "rm -rf ./lib/docs ./lib/api.json && typedoc --options ./typedoc.json --readme ./README.md --out ./lib/docs --json ./lib/api.json src/api.ts && npm run docs.post-process", - "docs.post-process": "node ./scripts/post-process-docs.js", - "docs.preview": "ws --open --port 3011 --directory ./lib/docs", - "tsc": "ts-node ../../../scripts/compile" + "tsc": "ttsc" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/core/package.json b/src/packages/core/package.json index 6fd5568871..c065e667a4 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -24,7 +24,7 @@ "directory": "src/packages/core" }, "scripts": { - "tsc": "ts-node ../../../scripts/compile", + "tsc": "ttsc", "test": "nyc npm run mocha", "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register '__tests__/**/*.test.ts'" }, diff --git a/src/packages/flavors/package.json b/src/packages/flavors/package.json index 53409df9d9..ce6bae31e3 100644 --- a/src/packages/flavors/package.json +++ b/src/packages/flavors/package.json @@ -21,7 +21,7 @@ "directory": "src/packages/flavors" }, "scripts": { - "tsc": "ts-node ../../../scripts/compile" + "tsc": "ttsc" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/options/package.json b/src/packages/options/package.json index a79c76daec..ed0a59e52a 100644 --- a/src/packages/options/package.json +++ b/src/packages/options/package.json @@ -20,7 +20,7 @@ "directory": "src/packages/options" }, "scripts": { - "tsc": "ts-node ../../../scripts/compile" + "tsc": "ttsc" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index a2733d634d..6d359332f9 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -20,7 +20,7 @@ "directory": "src/packages/promise-queue" }, "scripts": { - "tsc": "ts-node ../../../scripts/compile", + "tsc": "ttsc", "test": "nyc npm run mocha", "mocha": "cross-env TS_NODE_FILES=true mocha --exit --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" }, diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index 086e5b3305..420461737e 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -24,7 +24,7 @@ "directory": "src/packages/utils" }, "scripts": { - "tsc": "ts-node ../../../scripts/compile" + "tsc": "ttsc" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/tsconfig.json b/tsconfig.json index 7e0df315f1..3731e0a3a5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,8 +10,6 @@ "moduleResolution": "node", "noErrorTruncation": true, "sourceMap": true, - /** `resolveJsonModule: true` allows for inlining properties from .json files via our `compile.ts` script */ - "resolveJsonModule": true, "strict": true, /** `noImplicitAny: false` and `strictNullChecks: false` are temporary during initial rapid development. */ "strictNullChecks": false, @@ -19,6 +17,12 @@ "newLine": "lf", "lib": ["ES2020"], "typeRoots": ["./node_modules/@types", "src/@types"], - "experimentalDecorators": true + "experimentalDecorators": true, + "plugins": [ + { + // Inlines package.json + "transform": "ts-transformer-inline-file/transformer" + } + ] } } diff --git a/webpack.config.ts b/webpack.config.ts new file mode 100644 index 0000000000..ceb4f824a1 --- /dev/null +++ b/webpack.config.ts @@ -0,0 +1,4 @@ +import webpackBrowser from "./webpack/webpack.browser.config"; +import webpackNode from "./webpack/webpack.node.config"; + +export default [webpackBrowser, webpackNode]; diff --git a/webpack/browser-bigint-buffer.ts b/webpack/browser-bigint-buffer.ts new file mode 100644 index 0000000000..8df9d9f3a0 --- /dev/null +++ b/webpack/browser-bigint-buffer.ts @@ -0,0 +1,4 @@ +export function toBigIntBE(buf: Buffer) { + // TODO(perf): this is slow. Can we make it fast in browserland? + return BigInt(`0x${buf.toString("hex")}`); +} diff --git a/webpack/browser-tmp-promise.ts b/webpack/browser-tmp-promise.ts new file mode 100644 index 0000000000..5bae4efb49 --- /dev/null +++ b/webpack/browser-tmp-promise.ts @@ -0,0 +1,362 @@ +import { resolve, isAbsolute, basename, join, relative } from "path"; +import { randomBytes, pseudoRandomBytes } from "crypto"; + +export interface TmpNameOptions { + dir?: string; + name?: string; + postfix?: string; + prefix?: string; + template?: string; + tmpdir?: string; + tries?: number; +} + +export interface DirOptions extends TmpNameOptions { + keep?: boolean; + mode?: number; + unsafeCleanup?: boolean; +} + +const // the random characters to choose from + RANDOM_CHARS = + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + TEMPLATE_PATTERN = /XXXXXX/, + DEFAULT_TRIES = 3, + _removeObjects = []; + +let _gracefulCleanup = false; + +/** + * The garbage collector. + * + * @private + */ +async function _garbageCollector() { + /* istanbul ignore else */ + if (!_gracefulCleanup) return; + + // the function being called removes itself from _removeObjects, + // loop until _removeObjects is empty + while (_removeObjects.length) { + try { + _removeObjects[0](); + } catch (e) { + // already removed? + } + } +} + +/** + * Random name generator based on crypto. + * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript + * + * @param {number} howMany + * @returns {string} the generated random name + * @private + */ +function _randomChars(howMany: number) { + let value = [], + rnd = null; + + // make sure that we do not fail because we ran out of entropy + try { + rnd = randomBytes(howMany); + } catch (e) { + rnd = pseudoRandomBytes(howMany); + } + + for (var i = 0; i < howMany; i++) { + value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); + } + + return value.join(""); +} + +/** + * Helper which determines whether a string s is blank, that is undefined, or empty or null. + * + * @private + * @param {string} s + * @returns {Boolean} true whether the string s is blank, false otherwise + */ +function _isBlank(s: string) { + return s === null || _isUndefined(s) || !s.trim(); +} + +/** + * Checks whether the `obj` parameter is defined or not. + * + * @param {Object} obj + * @returns {boolean} true if the object is undefined + * @private + */ +function _isUndefined(obj: Object) { + return typeof obj === "undefined"; +} + +/** + * Generates a new temporary name. + * + * @param {Object} opts + * @returns {string} the new random name according to opts + * @private + */ +function _generateTmpName(options: TmpNameOptions) { + const tmpDir = options.tmpdir; + + /* istanbul ignore else */ + if (!_isUndefined(options.name)) + return join(tmpDir, options.dir, options.name); + + /* istanbul ignore else */ + if (!_isUndefined(options.template)) + return join(tmpDir, options.dir, options.template).replace( + TEMPLATE_PATTERN, + _randomChars(6) + ); + + // prefix and postfix + const name = [ + options.prefix ? options.prefix : "tmp", + "-", + _randomChars(12), + options.postfix ? "-" + options.postfix : "" + ].join(""); + + return join(tmpDir, options.dir, name); +} + +function _indexedDbExists(name: string) { + return new Promise(resolve => { + const req = indexedDB.open(name); + let existed = true; + req.onsuccess = function () { + req.result.close(); + if (!existed) indexedDB.deleteDatabase(name); + resolve(existed); + }; + req.onupgradeneeded = function () { + existed = false; + }; + }); +} + +/** + * Gets a temporary file name. + * + * @param {(Options)} opts options + */ +function tmpName(options: TmpNameOptions) { + const opts = _parseArguments(options); + + _assertAndSanitizeOptions(opts); + + let tries = opts.tries; + + return (async function _getUniqueName() { + const name = _generateTmpName(opts); + + // check whether the path exists then retry if needed + const exists = await _indexedDbExists(name); + if (exists) { + if (tries-- > 0) return _getUniqueName(); + + throw new Error( + "Could not get a unique tmp filename, max tries reached " + name + ); + } + + return name; + })(); +} + +function _prepareTmpDirRemoveCallback(name: string, options: DirOptions) { + const removeCallback = () => { + return new Promise((resolve, reject) => { + const request = indexedDB.deleteDatabase(name); + request.onerror = function (e) { + reject(); + }; + + request.onsuccess = function () { + resolve(void 0); + }; + }); + }; + if (!options.keep) _removeObjects.unshift(removeCallback); + return removeCallback; +} + +function _assertAndSanitizeOptions(options: DirOptions) { + options.tmpdir = _getTmpDir(options); + + const tmpDir = options.tmpdir; + + if (!_isUndefined(options.name)) + _assertIsRelative(options.name, "name", tmpDir); + + if (!_isUndefined(options.dir)) _assertIsRelative(options.dir, "dir", tmpDir); + + if (!_isUndefined(options.template)) { + _assertIsRelative(options.template, "template", tmpDir); + if (!options.template.match(TEMPLATE_PATTERN)) + throw new Error(`Invalid template, found "${options.template}".`); + } + + if ( + (!_isUndefined(options.tries) && isNaN(options.tries)) || + options.tries < 0 + ) + throw new Error(`Invalid tries, found "${options.tries}".`); + + options.tries = _isUndefined(options.name) + ? options.tries || DEFAULT_TRIES + : 1; + options.keep = !!options.keep; + + // sanitize dir, also keep (multiple) blanks if the user, purportedly sane, requests us to + options.dir = _isUndefined(options.dir) + ? "" + : relative(tmpDir, _resolvePath(options.dir, tmpDir)); + options.template = _isUndefined(options.template) + ? undefined + : relative(tmpDir, _resolvePath(options.template, tmpDir)); + // sanitize further if template is relative to options.dir + options.template = _isBlank(options.template) + ? undefined + : relative(options.dir, options.template); + + options.name = _isUndefined(options.name) + ? undefined + : _sanitizeName(options.name); + options.prefix = _isUndefined(options.prefix) ? "" : options.prefix; + options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; +} + +/** + * Resolve the specified path name in respect to tmpDir. + * + * The specified name might include relative path components, e.g. ../ + * so we need to resolve in order to be sure that is is located inside tmpDir + * + * @param name + * @param tmpDir + * @returns {string} + * @private + */ +function _resolvePath(name: string, tmpDir: string) { + const sanitizedName = _sanitizeName(name); + if (sanitizedName.startsWith(tmpDir)) { + return resolve(sanitizedName); + } else { + return resolve(join(tmpDir, sanitizedName)); + } +} + +/** + * Sanitize the specified path name by removing all quote characters. + * + * @param name + * @returns {string} + * @private + */ +function _sanitizeName(name: string) { + if (_isBlank(name)) { + return name; + } + return name.replace(/["']/g, ""); +} + +/** + * Asserts whether specified name is relative to the specified tmpDir. + * + * @param {string} name + * @param {string} option + * @param {string} tmpDir + * @throws {Error} + * @private + */ +function _assertIsRelative( + name: string, + option: "name" | "dir" | "template", + tmpDir: string +) { + if (option === "name") { + // assert that name is not absolute and does not contain a path + if (isAbsolute(name)) + throw new Error( + `${option} option must not contain an absolute path, found "${name}".` + ); + // must not fail on valid . or .. or similar such constructs + let _basename = basename(name); + if (_basename === ".." || _basename === "." || _basename !== name) + throw new Error( + `${option} option must not contain a path, found "${name}".` + ); + } else { + // if (option === 'dir' || option === 'template') { + // assert that dir or template are relative to tmpDir + if (isAbsolute(name) && !name.startsWith(tmpDir)) { + throw new Error( + `${option} option must be relative to "${tmpDir}", found "${name}".` + ); + } + let resolvedPath = _resolvePath(name, tmpDir); + if (!resolvedPath.startsWith(tmpDir)) + throw new Error( + `${option} option must be relative to "${tmpDir}", found "${resolvedPath}".` + ); + } +} + +function _parseArguments(options: DirOptions): DirOptions { + if (_isUndefined(options)) { + return {}; + } + // copy options so we do not leak the changes we make internally + const actualOptions = {}; + for (const key of Object.getOwnPropertyNames(options)) { + actualOptions[key] = options[key]; + } + + return actualOptions; +} + +/** + * Creates a temporary directory. + * + * @param {(Options)} opts the options + */ +export async function dir(options: DirOptions) { + const opts = _parseArguments(options); + // gets a temporary filename + const path = await tmpName(opts); + return { + path, + cleanup: _prepareTmpDirRemoveCallback(path, options) + }; +} + +/** + * Sets the graceful cleanup. + * + * If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit, otherwise the + * temporary objects will remain in place, waiting to be cleaned up on system restart or otherwise scheduled temporary + * object removals. + */ +export function setGracefulCleanup() { + _gracefulCleanup = true; +} + +/** + * Returns the currently configured tmp dir. + * + * @private + * @param {?Options} options + * @returns {string} the currently configured tmp dir + */ +function _getTmpDir(options: TmpNameOptions) { + return resolve(_sanitizeName((options && options.tmpdir) || "/tmp")); +} + +// window.addEventListener("beforeunload", _garbageCollector); diff --git a/webpack/webpack.browser.config.ts b/webpack/webpack.browser.config.ts new file mode 100644 index 0000000000..3f01ecf70d --- /dev/null +++ b/webpack/webpack.browser.config.ts @@ -0,0 +1,38 @@ +import base from "./webpack.common.config"; +import webpack from "webpack"; +import path from "path"; +import merge from "webpack-merge"; + +const config: webpack.Configuration = merge({}, base, { + resolve: { + extensions: [".tsx", ".ts", ".js"], + fallback: { + //#region node polyfills + util: require.resolve("util/"), + crypto: require.resolve("crypto-browserify"), + path: require.resolve("path-browserify"), + assert: require.resolve("assert/"), + stream: require.resolve("stream-browserify/"), + os: require.resolve("os-browserify/browser"), + fs: false + //#endregion node polyfills + }, + alias: { + "tmp-promise": require.resolve("./browser-tmp-promise"), + "bigint-buffer": require.resolve("./browser-bigint-buffer"), + // replace leveldown with a browser version + leveldown: require.resolve("level-js/"), + // browser version can't start a server, so just remove the websocket server since it can't work anyway + "uWebSockets.js": false + } + }, + output: { + path: path.resolve(__dirname, "../", "dist", "web") + }, + plugins: [ + new webpack.ProvidePlugin({ Buffer: ["buffer", "Buffer"] }), + new webpack.ProvidePlugin({ process: ["process"] }) + ] +}); + +export default config; diff --git a/webpack/webpack.common.config.ts b/webpack/webpack.common.config.ts new file mode 100644 index 0000000000..8c61f66907 --- /dev/null +++ b/webpack/webpack.common.config.ts @@ -0,0 +1,40 @@ +import webpack from "webpack"; + +// inlines files, like package.json +import packageJsonTransformer from "ts-transformer-inline-file/transformer"; +import path from "path"; + +const base: webpack.Configuration = { + entry: path.resolve(__dirname, "../", "src/packages/core/src/index.ts"), + devtool: "source-map", + module: { + rules: [ + { + test: /\.tsx?$/, + use: [ + { + // webpack typescript modules + loader: "ts-loader", + options: { + getCustomTransformers: program => ({ + before: [packageJsonTransformer(program)] + }) + } + } + ], + exclude: /node_modules/ + } + ] + }, + resolve: { + extensions: [".tsx", ".ts", ".js"] + }, + output: { + libraryTarget: "umd", + filename: "ganache.min.js", + library: "Ganache", + libraryExport: "default" + } +}; + +export default base; diff --git a/webpack/webpack.node.config.ts b/webpack/webpack.node.config.ts new file mode 100644 index 0000000000..61ab5dd6c1 --- /dev/null +++ b/webpack/webpack.node.config.ts @@ -0,0 +1,22 @@ +import base from "./webpack.common.config"; +import webpack from "webpack"; +import path from "path"; +import merge from "webpack-merge"; + +const config: webpack.Configuration = merge({}, base, { + target: "node", + output: { + path: path.resolve(__dirname, "../", "dist", "node") + }, + module: { + rules: [ + { + // webpack load native modules + test: /\.node$/, + loader: "node-loader" + } + ] + } +}); + +export default config; From dbaf7674e7e0c2f0bccf987c1ca99945cc4f5439 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 15:08:06 -0500 Subject: [PATCH 671/691] Add TS_NODE_COMPILER=ttypescript options --- docs/launch.json | 1 + scripts/create.ts | 2 +- src/chains/ethereum/__tests__/api/web3/web3.test.ts | 3 ++- src/chains/ethereum/package.json | 2 +- src/packages/core/package.json | 2 +- src/packages/promise-queue/package.json | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/launch.json b/docs/launch.json index bcf2efe2ba..22293bdec6 100644 --- a/docs/launch.json +++ b/docs/launch.json @@ -10,6 +10,7 @@ "name": "Typescript Mocha All", "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", "env": { + "TS_NODE_COMPILER": "ttypescript", "TS_NODE_FILES": "true" }, // 10.7.0 is the earliest version of Node.js that we support, and is the first version to support BigInt literals. diff --git a/scripts/create.ts b/scripts/create.ts index 2cf0e30634..dd00b8cd1b 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -115,7 +115,7 @@ process.stdout.write(`${COLORS.Reset}`); tsc: "ttsc", test: "nyc npm run mocha", mocha: - "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" + "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/chains/ethereum/__tests__/api/web3/web3.test.ts b/src/chains/ethereum/__tests__/api/web3/web3.test.ts index 21c9a51275..6bd766030e 100644 --- a/src/chains/ethereum/__tests__/api/web3/web3.test.ts +++ b/src/chains/ethereum/__tests__/api/web3/web3.test.ts @@ -1,7 +1,8 @@ import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; -import { version } from "../../../../../packages/core/package.json"; +import { $INLINE_JSON } from "ts-transformer-inline-file"; +const { version } = $INLINE_JSON("../../../../../packages/core/package.json"); describe("api", () => { describe("web3", () => { diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 2cbb2301cd..557ba07899 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -28,7 +28,7 @@ "docs.post-process": "node ./scripts/post-process-docs.js", "tsc": "ttsc", "test": "nyc --reporter lcov npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/core/package.json b/src/packages/core/package.json index c065e667a4..35bd1ec8b5 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -26,7 +26,7 @@ "scripts": { "tsc": "ttsc", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index 6d359332f9..df86f6becb 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -22,7 +22,7 @@ "scripts": { "tsc": "ttsc", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_FILES=true mocha --exit --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" From da1d4de320b54131c69efca68451abee1d2f2535 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 18:54:09 -0500 Subject: [PATCH 672/691] Add a "ganache" package --- CONTRIBUTING.md | 2 +- npm-shrinkwrap.json | 6 +- package.json | 4 +- scripts/create.ts | 4 +- src/chains/ethereum/src/index.ts | 1 + src/packages/core/index.ts | 3 +- src/packages/core/src/server.ts | 2 +- src/packages/flavors/src/index.ts | 2 + src/packages/ganache/.npmignore | 8 + src/packages/ganache/LICENSE | 21 + src/packages/ganache/README.md | 3 + src/packages/ganache/__tests__/index.test.ts | 6 + src/packages/ganache/npm-shrinkwrap.json | 1145 +++++++++++++++++ src/packages/ganache/package.json | 52 + src/packages/ganache/src/index.ts | 6 + src/packages/ganache/tsconfig.json | 8 + .../packages/ganache/webpack.config.ts | 0 .../polyfills}/browser-bigint-buffer.ts | 0 .../webpack/polyfills}/browser-tmp-promise.ts | 0 .../webpack}/webpack.browser.config.ts | 4 +- .../ganache/webpack}/webpack.common.config.ts | 3 +- .../ganache/webpack}/webpack.node.config.ts | 0 src/packages/options/src/helpers/exclusive.ts | 45 +- tsconfig.json | 2 +- 24 files changed, 1276 insertions(+), 51 deletions(-) create mode 100644 src/packages/ganache/.npmignore create mode 100644 src/packages/ganache/LICENSE create mode 100644 src/packages/ganache/README.md create mode 100644 src/packages/ganache/__tests__/index.test.ts create mode 100644 src/packages/ganache/npm-shrinkwrap.json create mode 100644 src/packages/ganache/package.json create mode 100644 src/packages/ganache/src/index.ts create mode 100644 src/packages/ganache/tsconfig.json rename webpack.config.ts => src/packages/ganache/webpack.config.ts (100%) rename {webpack => src/packages/ganache/webpack/polyfills}/browser-bigint-buffer.ts (100%) rename {webpack => src/packages/ganache/webpack/polyfills}/browser-tmp-promise.ts (100%) rename {webpack => src/packages/ganache/webpack}/webpack.browser.config.ts (88%) rename {webpack => src/packages/ganache/webpack}/webpack.common.config.ts (89%) rename {webpack => src/packages/ganache/webpack}/webpack.node.config.ts (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6e1db7237..9403b966fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,7 +107,7 @@ diff --git a/.vscode/launch.json b/.vscode/launch.json index 2a2aa9e..57cbf21 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json -@@ -23,7 +23,7 @@ +@@ -24,7 +24,7 @@ "--colors", "--require", "ts-node/register", diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 796babac94..3051131194 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -13069,9 +13069,9 @@ } }, "typescript": { - "version": "4.1.0-beta", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.0-beta.tgz", - "integrity": "sha512-b/LAttdVl3G6FEmnMkDsK0xvfvaftXpSKrjXn+OVCRqrwz5WD/6QJOiN+dTorqDY+hkaH+r2gP5wI1jBDmdQ7A==", + "version": "4.1.1-rc", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.1-rc.tgz", + "integrity": "sha512-tgNcFrLIjlaMWEc7bKC0bxLNIt8BIAauY/HLUOQDyTP75HGskETtXOt46x4EKAHRKhWVLMc7yM02puTHa/yhCA==", "dev": true }, "typical": { diff --git a/package.json b/package.json index 244b860284..3bf3b80519 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "test": "lerna exec -- npm run test", "tsc": "lerna exec -- npm run tsc", "tsc.clean": "npx lerna exec -- npx shx rm -rf lib", - "prepare": "webpack" + "prepare": "lerna run prepare" }, "dependencies": { "bip39": "3.0.2", @@ -82,7 +82,7 @@ "ts-node": "9.0.0", "ts-transformer-inline-file": "0.1.1", "ttypescript": "1.5.12", - "typescript": "4.1.0-beta", + "typescript": "4.1.1-rc", "utf-8-validate": "5.0.2", "util": "0.12.3", "webpack": "5.4.0", diff --git a/scripts/create.ts b/scripts/create.ts index dd00b8cd1b..39abf32b01 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -7,7 +7,6 @@ import camelCase from "camelcase"; import npa from "npm-package-arg"; import userName from "git-user-name"; import { join, resolve } from "path"; -import { version } from "../lerna.json"; import { highlight } from "cli-highlight"; import { mkdir, mkdirSync, writeFile } from "fs-extra"; import { @@ -91,10 +90,11 @@ process.stdout.write(`${COLORS.Reset}`); const packageName = `@ganache/${name}`; let packageAuthor = userName(); + const version = "0.1.0"; const pkg = { name: packageName, - version: version, + version, description: "", author: packageAuthor || require("../package.json").author, homepage: `https://github.com/trufflesuite/ganache-core/tree/develop/src/${location}/${name}#readme`, diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index e6f7f689f0..9b93bf54ed 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -13,6 +13,7 @@ function isHttp( } export type ProviderOptions = EthereumProviderOptions; +export type Provider = EthereumProvider; export const Provider = EthereumProvider; export const FlavorName = "ethereum" as const; diff --git a/src/packages/core/index.ts b/src/packages/core/index.ts index 3b05966675..538c575585 100644 --- a/src/packages/core/index.ts +++ b/src/packages/core/index.ts @@ -3,4 +3,5 @@ // files when developing, debugging, and running tests // // ************************************************************************* // -export * from "./src/index"; +import core from "./src/index"; +export default core; diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index a8397eb064..7ecb4cc778 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -99,7 +99,7 @@ export default class Server { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + this.#app.listen(port as any, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); } ).then(listenSocket => { if (listenSocket) { diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts index 7f52f25426..0ea4ca282e 100644 --- a/src/packages/flavors/src/index.ts +++ b/src/packages/flavors/src/index.ts @@ -17,6 +17,8 @@ export type Connectors = { [K in keyof ConnectorsByName]: ConnectorsByName[K]; }[keyof ConnectorsByName]; +export type Providers = Ethereum.Provider /*| Tezos.Provider */; + export type Options = { flavor?: typeof Ethereum.FlavorName; } & Ethereum.ProviderOptions; diff --git a/src/packages/ganache/.npmignore b/src/packages/ganache/.npmignore new file mode 100644 index 0000000000..b1e1059b5c --- /dev/null +++ b/src/packages/ganache/.npmignore @@ -0,0 +1,8 @@ +./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/packages/ganache/LICENSE b/src/packages/ganache/LICENSE new file mode 100644 index 0000000000..39f3b14498 --- /dev/null +++ b/src/packages/ganache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/packages/ganache/README.md b/src/packages/ganache/README.md new file mode 100644 index 0000000000..8c29560519 --- /dev/null +++ b/src/packages/ganache/README.md @@ -0,0 +1,3 @@ +# `ganache` + +> TODO: description diff --git a/src/packages/ganache/__tests__/index.test.ts b/src/packages/ganache/__tests__/index.test.ts new file mode 100644 index 0000000000..5543536bea --- /dev/null +++ b/src/packages/ganache/__tests__/index.test.ts @@ -0,0 +1,6 @@ +import assert from "assert"; +import ganache from "../src/"; + +describe("@ganache/ganache", () => { + it("needs tests"); +}); diff --git a/src/packages/ganache/npm-shrinkwrap.json b/src/packages/ganache/npm-shrinkwrap.json new file mode 100644 index 0000000000..a47c7d2d47 --- /dev/null +++ b/src/packages/ganache/npm-shrinkwrap.json @@ -0,0 +1,1145 @@ +{ + "name": "ganache", + "version": "3.0.0-internal.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/eslint": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.4.tgz", + "integrity": "sha512-YCY4kzHMsHoyKspQH+nwSe+70Kep7Vjt2X+dZe5Vs2vkRudqtoFoUIv1RlJmZB8Hbp7McneupoZij4PadxsK5Q==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", + "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.45", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", + "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, + "@types/node": { + "version": "14.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", + "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", + "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", + "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", + "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", + "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", + "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", + "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", + "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", + "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", + "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", + "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", + "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", + "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", + "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/helper-wasm-section": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-opt": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", + "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", + "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", + "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", + "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/floating-point-hex-parser": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-code-frame": "1.9.0", + "@webassemblyjs/helper-fsm": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", + "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webpack-cli/info": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.1.0.tgz", + "integrity": "sha512-uNWSdaYHc+f3LdIZNwhdhkjjLDDl3jP2+XBqAq9H8DjrJUvlOKdP8TNruy1yEaDfgpAIgbSAN7pye4FEHg9tYQ==", + "dev": true, + "requires": { + "envinfo": "^7.7.3" + } + }, + "@webpack-cli/serve": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.1.0.tgz", + "integrity": "sha512-7RfnMXCpJ/NThrhq4gYQYILB18xWyoQcBey81oIyVbmgbc6m5ZHHyFK+DyH7pLHJf0p14MxL4mTsoPAgBSTpIg==", + "dev": true + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "acorn": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz", + "integrity": "sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "array-back": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz", + "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", + "dev": true + }, + "browserslist": { + "version": "4.14.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.6.tgz", + "integrity": "sha512-zeFYcUo85ENhc/zxHbiIp0LGzzTrE2Pv2JhxvS7kpUb9Q9D38kUX6Bie7pGutJ/5iF5rOxE7CepAuWD56xJ33A==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001154", + "electron-to-chromium": "^1.3.585", + "escalade": "^3.1.1", + "node-releases": "^1.1.65" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001154", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001154.tgz", + "integrity": "sha512-y9DvdSti8NnYB9Be92ddMZQrcOe04kcQtcxtBx4NkB04+qZ+JUWotnXBJTmxlKudhxNTQ3RRknMwNU2YQl/Org==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colorette": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", + "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", + "dev": true + }, + "command-line-usage": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.0.tgz", + "integrity": "sha512-Ew1clU4pkUeo6AFVDFxCbnN7GIZfXl48HIOQeFQnkO3oOqvpI7wdqtLRwv9iOCZ/7A+z4csVZeiDdEcj8g6Wiw==", + "dev": true, + "requires": { + "array-back": "^4.0.0", + "chalk": "^2.4.2", + "table-layout": "^1.0.0", + "typical": "^5.2.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.588", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.588.tgz", + "integrity": "sha512-0zr+ZfytnLeJZxGgmEpPTcItu5Mm4A5zHPZXLfHcGp0mdsk95rmD7ePNewYtK1yIdLbk8Z1U2oTRRfOtR4gbYg==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.3.1.tgz", + "integrity": "sha512-G1XD3MRGrGfNcf6Hg0LVZG7GIKcYkbfHa5QMxt1HDUTdYoXH0JR1xXyg+MaKLF73E9A27uWNVxvFivNRYeUB6w==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.0.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "envinfo": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz", + "integrity": "sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "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=", + "dev": true + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "events": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", + "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", + "dev": true + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true + }, + "is-core-module": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz", + "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "loader-runner": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.1.0.tgz", + "integrity": "sha512-oR4lB4WvwFoC70ocraKhn5nkKSs23t57h9udUgw8o0iH8hMXeEoRuUgfcvgUwAJ1ZpRqBvcou4N2SMvM1DwMrA==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node-releases": { + "version": "1.1.65", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.65.tgz", + "integrity": "sha512-YpzJOe2WFIW0V4ZkJQd/DGR/zdVwc/pI4Nl1CZrBO19FdRcSTmsuhdttw9rsTzzJLrNcSloLiBbEYx1C4f6gpA==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", + "dev": true, + "requires": { + "resolve": "^1.9.0" + } + }, + "reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true + }, + "resolve": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz", + "integrity": "sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA==", + "dev": true, + "requires": { + "is-core-module": "^2.0.0", + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + }, + "serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "table-layout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.1.tgz", + "integrity": "sha512-dEquqYNJiGwY7iPfZ3wbXDI944iqanTSchrACLL2nOB+1r+h1Nzu2eH+DuPPvWvm5Ry7iAPeFlgEtP5bIp5U7Q==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + } + }, + "tapable": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.0.0.tgz", + "integrity": "sha512-bjzn0C0RWoffnNdTzNi7rNDhs1Zlwk2tRXgk8EiHKAOX1Mag3d6T0Y5zNa7l9CJ+EoUne/0UHdwS8tMbkh9zDg==", + "dev": true + }, + "terser": { + "version": "5.3.8", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz", + "integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz", + "integrity": "sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ==", + "dev": true, + "requires": { + "jest-worker": "^26.6.1", + "p-limit": "^3.0.2", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", + "source-map": "^0.6.1", + "terser": "^5.3.8" + }, + "dependencies": { + "p-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + } + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true + }, + "uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "dev": true + }, + "watchpack": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.0.1.tgz", + "integrity": "sha512-vO8AKGX22ZRo6PiOFM9dC0re8IcKh8Kd/aH2zeqUc6w4/jBGlTy2P7fTC6ekT0NjVeGjgU2dGC5rNstKkeLEQg==", + "dev": true, + "requires": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } + }, + "webpack": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.4.0.tgz", + "integrity": "sha512-udpYTyqz8toTTdaOsL2QKPLeZLt2IEm9qY7yTXuFEQhKu5bk0yQD9BtAdVQksmz4jFbbWOiWmm3NHarO0zr/ng==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.45", + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/wasm-edit": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "acorn": "^8.0.4", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.3.1", + "eslint-scope": "^5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.1.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "pkg-dir": "^4.2.0", + "schema-utils": "^3.0.0", + "tapable": "^2.0.0", + "terser-webpack-plugin": "^5.0.3", + "watchpack": "^2.0.0", + "webpack-sources": "^2.1.1" + } + }, + "webpack-cli": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.2.0.tgz", + "integrity": "sha512-EIl3k88vaF4fSxWSgtAQR+VwicfLMTZ9amQtqS4o+TDPW9HGaEpbFBbAZ4A3ZOT5SOnMxNOzROsSTPiE8tBJPA==", + "dev": true, + "requires": { + "@webpack-cli/info": "^1.1.0", + "@webpack-cli/serve": "^1.1.0", + "colorette": "^1.2.1", + "command-line-usage": "^6.1.0", + "commander": "^6.2.0", + "enquirer": "^2.3.6", + "execa": "^4.1.0", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "leven": "^3.1.0", + "rechoir": "^0.7.0", + "v8-compile-cache": "^2.2.0", + "webpack-merge": "^4.2.2" + }, + "dependencies": { + "commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", + "dev": true + } + } + }, + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "webpack-sources": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", + "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", + "dev": true, + "requires": { + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wordwrapjs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", + "integrity": "sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ==", + "dev": true, + "requires": { + "reduce-flatten": "^2.0.0", + "typical": "^5.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json new file mode 100644 index 0000000000..233683e912 --- /dev/null +++ b/src/packages/ganache/package.json @@ -0,0 +1,52 @@ +{ + "name": "ganache", + "version": "3.0.0-internal.0", + "description": "A library and cli to create a local blockchain for fast Ethereum development.", + "author": "David Murdoch", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/ganache#readme", + "license": "MIT", + "main": "dist/node/ganache.min.js", + "browser": "dist/web/ganache.min.js", + "types": "src/index.ts", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/packages/ganache" + }, + "scripts": { + "tsc": "ttsc", + "test": "nyc npm run mocha", + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'", + "prepare": "webpack" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "keywords": [ + "ganache", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling", + "truffle" + ], + "devDependencies": { + "@ganache/core": "2.2.1", + "webpack": "5.4.0", + "webpack-cli": "4.2.0", + "@ganache/flavors": "2.2.1" + } +} diff --git a/src/packages/ganache/src/index.ts b/src/packages/ganache/src/index.ts new file mode 100644 index 0000000000..eed1825a54 --- /dev/null +++ b/src/packages/ganache/src/index.ts @@ -0,0 +1,6 @@ +import Ganache from "@ganache/core"; + +export default { + server: Ganache.server, + provider: Ganache.provider +}; diff --git a/src/packages/ganache/tsconfig.json b/src/packages/ganache/tsconfig.json new file mode 100644 index 0000000000..e39670ea81 --- /dev/null +++ b/src/packages/ganache/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "lib", + "module": "UMD" + }, + "include": ["src"] +} diff --git a/webpack.config.ts b/src/packages/ganache/webpack.config.ts similarity index 100% rename from webpack.config.ts rename to src/packages/ganache/webpack.config.ts diff --git a/webpack/browser-bigint-buffer.ts b/src/packages/ganache/webpack/polyfills/browser-bigint-buffer.ts similarity index 100% rename from webpack/browser-bigint-buffer.ts rename to src/packages/ganache/webpack/polyfills/browser-bigint-buffer.ts diff --git a/webpack/browser-tmp-promise.ts b/src/packages/ganache/webpack/polyfills/browser-tmp-promise.ts similarity index 100% rename from webpack/browser-tmp-promise.ts rename to src/packages/ganache/webpack/polyfills/browser-tmp-promise.ts diff --git a/webpack/webpack.browser.config.ts b/src/packages/ganache/webpack/webpack.browser.config.ts similarity index 88% rename from webpack/webpack.browser.config.ts rename to src/packages/ganache/webpack/webpack.browser.config.ts index 3f01ecf70d..b83b63a0a5 100644 --- a/webpack/webpack.browser.config.ts +++ b/src/packages/ganache/webpack/webpack.browser.config.ts @@ -18,8 +18,8 @@ const config: webpack.Configuration = merge({}, base, { //#endregion node polyfills }, alias: { - "tmp-promise": require.resolve("./browser-tmp-promise"), - "bigint-buffer": require.resolve("./browser-bigint-buffer"), + "tmp-promise": require.resolve("./polyfills/browser-tmp-promise"), + "bigint-buffer": require.resolve("./polyfills/browser-bigint-buffer"), // replace leveldown with a browser version leveldown: require.resolve("level-js/"), // browser version can't start a server, so just remove the websocket server since it can't work anyway diff --git a/webpack/webpack.common.config.ts b/src/packages/ganache/webpack/webpack.common.config.ts similarity index 89% rename from webpack/webpack.common.config.ts rename to src/packages/ganache/webpack/webpack.common.config.ts index 8c61f66907..8391514008 100644 --- a/webpack/webpack.common.config.ts +++ b/src/packages/ganache/webpack/webpack.common.config.ts @@ -2,10 +2,9 @@ import webpack from "webpack"; // inlines files, like package.json import packageJsonTransformer from "ts-transformer-inline-file/transformer"; -import path from "path"; const base: webpack.Configuration = { - entry: path.resolve(__dirname, "../", "src/packages/core/src/index.ts"), + entry: "./src/index.ts", devtool: "source-map", module: { rules: [ diff --git a/webpack/webpack.node.config.ts b/src/packages/ganache/webpack/webpack.node.config.ts similarity index 100% rename from webpack/webpack.node.config.ts rename to src/packages/ganache/webpack/webpack.node.config.ts diff --git a/src/packages/options/src/helpers/exclusive.ts b/src/packages/options/src/helpers/exclusive.ts index 7adbfad5af..51a89e6466 100644 --- a/src/packages/options/src/helpers/exclusive.ts +++ b/src/packages/options/src/helpers/exclusive.ts @@ -145,42 +145,15 @@ export type ExclusiveGroupUnionAndUnconstrainedPlus< : never; //#region UnionToTuple -type TuplePrepend = [ - NewElement, - ...Tuple -]; - -type Consumer = (value: Value) => void; - -type IntersectionFromUnion = ( - Union extends unknown ? Consumer : never -) extends Consumer - ? ResultIntersection - : never; - -type OverloadedConsumerFromUnion = IntersectionFromUnion< - Union extends unknown ? Consumer : never ->; - -type UnionLast = OverloadedConsumerFromUnion extends ( - a: infer A -) => void - ? A - : never; - -type UnionExcludingLast = Exclude>; - -type TupleFromUnionRec< - RemainingUnion, - CurrentTuple extends readonly unknown[] -> = [RemainingUnion] extends [never] - ? CurrentTuple - : TupleFromUnionRec< - UnionExcludingLast, - TuplePrepend> - >; - -export type UnionToTuple = TupleFromUnionRec; +export type UnionToTuple = ( + (T extends any ? (t: T) => T : never) extends infer U + ? (U extends any ? (u: U) => any : never) extends (v: infer V) => any + ? V + : never + : never +) extends (_: any) => infer W + ? [...UnionToTuple>, W] + : []; //#endregion //#endregion exclusive group options helpers diff --git a/tsconfig.json b/tsconfig.json index 3731e0a3a5..f3fb504851 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "alwaysStrict": true, "declaration": true, "skipLibCheck": true, - "module": "CommonJS", + "module": "ES6", "esModuleInterop": true, "target": "ES2020", "moduleResolution": "node", From 322b42d8d50dc041498f92ecee96396d35b9d2d1 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 20:56:12 -0500 Subject: [PATCH 673/691] switch back to CommonJS --- src/packages/ganache/tsconfig.json | 2 +- tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/ganache/tsconfig.json b/src/packages/ganache/tsconfig.json index e39670ea81..a92ef985c9 100644 --- a/src/packages/ganache/tsconfig.json +++ b/src/packages/ganache/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../../tsconfig.json", "compilerOptions": { "outDir": "lib", - "module": "UMD" + "module": "CommonJS" }, "include": ["src"] } diff --git a/tsconfig.json b/tsconfig.json index f3fb504851..3731e0a3a5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "alwaysStrict": true, "declaration": true, "skipLibCheck": true, - "module": "ES6", + "module": "CommonJS", "esModuleInterop": true, "target": "ES2020", "moduleResolution": "node", From 49506c5987833fee74a0186fef7db4fd550133c4 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Wed, 4 Nov 2020 21:10:47 -0500 Subject: [PATCH 674/691] update version numbers of new packages to 0.1.0 --- src/chains/ethereum/npm-shrinkwrap.json | 2 +- src/chains/ethereum/package.json | 8 ++++---- src/chains/tezos/npm-shrinkwrap.json | 2 +- src/chains/tezos/package.json | 6 +++--- src/packages/core/package.json | 12 ++++++------ src/packages/flavors/package.json | 8 ++++---- src/packages/ganache/package.json | 4 ++-- src/packages/options/package.json | 4 ++-- src/packages/promise-queue/package.json | 2 +- src/packages/utils/package.json | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 1a858ffc58..f657b78f51 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "@ganache/ethereum", - "version": "2.2.1", + "version": "0.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 557ba07899..393e088e5e 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -1,6 +1,6 @@ { "name": "@ganache/ethereum", - "version": "2.2.1", + "version": "0.1.0", "description": "Ganache's Ethereum client implementation", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/ethereum#readme", @@ -48,9 +48,9 @@ "tooling" ], "dependencies": { - "@ganache/options": "^2.2.1", - "@ganache/promise-queue": "^2.2.1", - "@ganache/utils": "^2.2.1", + "@ganache/options": "^0.1.0", + "@ganache/promise-queue": "^0.1.0", + "@ganache/utils": "^0.1.0", "@types/keccak": "3.0.1", "eth-sig-util": "2.5.3", "ethereumjs-abi": "0.6.8", diff --git a/src/chains/tezos/npm-shrinkwrap.json b/src/chains/tezos/npm-shrinkwrap.json index 94b695f171..9e3af356ce 100644 --- a/src/chains/tezos/npm-shrinkwrap.json +++ b/src/chains/tezos/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "@ganache/tezos", - "version": "2.2.1", + "version": "0.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 3d17414186..56a05a20d9 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -1,6 +1,6 @@ { "name": "@ganache/tezos", - "version": "2.2.1", + "version": "0.1.0", "description": "Ganache's Tezos client implementation", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/chains/tezos#readme", @@ -40,8 +40,8 @@ "tooling" ], "dependencies": { - "@ganache/options": "^2.2.1", - "@ganache/utils": "^2.2.1" + "@ganache/options": "^0.1.0", + "@ganache/utils": "^0.1.0" }, "devDependencies": { "@trufflesuite/typedoc-default-themes": "0.6.1", diff --git a/src/packages/core/package.json b/src/packages/core/package.json index 35bd1ec8b5..cfcbdbe90f 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@ganache/core", - "version": "2.2.1", + "version": "0.1.0", "description": "A library to create a local blockchain for fast Ethereum development.", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/core#readme", @@ -46,10 +46,10 @@ "tooling" ], "dependencies": { - "@ganache/options": "^2.2.1", - "@ganache/flavors": "^2.2.1", - "@ganache/ethereum": "^2.2.1", - "@ganache/tezos": "^2.2.1", - "@ganache/utils": "^2.2.1" + "@ganache/options": "^0.1.0", + "@ganache/flavors": "^0.1.0", + "@ganache/ethereum": "^0.1.0", + "@ganache/tezos": "^0.1.0", + "@ganache/utils": "^0.1.0" } } diff --git a/src/packages/flavors/package.json b/src/packages/flavors/package.json index ce6bae31e3..4144f9d096 100644 --- a/src/packages/flavors/package.json +++ b/src/packages/flavors/package.json @@ -1,6 +1,6 @@ { "name": "@ganache/flavors", - "version": "2.2.1", + "version": "0.1.0", "description": "Ganache's flavors enumeration and TypeScript types", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/flavors#readme", @@ -41,8 +41,8 @@ "tooling" ], "dependencies": { - "@ganache/ethereum": "^2.2.1", - "@ganache/tezos": "^2.2.1", - "@ganache/utils": "^2.2.1" + "@ganache/ethereum": "^0.1.0", + "@ganache/tezos": "^0.1.0", + "@ganache/utils": "^0.1.0" } } diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index 233683e912..5b6bd83979 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -44,9 +44,9 @@ "truffle" ], "devDependencies": { - "@ganache/core": "2.2.1", + "@ganache/core": "^0.1.0", "webpack": "5.4.0", "webpack-cli": "4.2.0", - "@ganache/flavors": "2.2.1" + "@ganache/flavors": "^0.1.0" } } diff --git a/src/packages/options/package.json b/src/packages/options/package.json index ed0a59e52a..8b823cee2d 100644 --- a/src/packages/options/package.json +++ b/src/packages/options/package.json @@ -1,6 +1,6 @@ { "name": "@ganache/options", - "version": "2.2.1", + "version": "0.1.0", "description": "Ganache's server/provider options TypeScript types", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/options#readme", @@ -40,6 +40,6 @@ "tooling" ], "dependencies": { - "@ganache/utils": "^2.2.1" + "@ganache/utils": "^0.1.0" } } diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index df86f6becb..2a8b7f9ddf 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -1,6 +1,6 @@ { "name": "@ganache/promise-queue", - "version": "2.2.1", + "version": "0.1.0", "description": "A queue that resolves Promise instances in first-in first-out order.", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/promise-queue#readme", diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index 420461737e..9e0b36274f 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@ganache/utils", - "version": "2.2.1", + "version": "0.1.0", "description": "Utility functions for @ganache packages", "author": "David Murdoch (https://davidmurdoch.com)", "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/utils#readme", From 65b019a3ef17b6968e1b9f79379082095e41b209 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 5 Nov 2020 16:39:13 -0500 Subject: [PATCH 675/691] move some packages to where they belong --- npm-shrinkwrap.json | 3731 +---------------- package.json | 55 +- .../ethereum/__tests__/api/eth/sign.test.ts | 20 +- src/chains/ethereum/npm-shrinkwrap.json | 1019 ++--- src/chains/ethereum/package.json | 28 +- src/chains/ethereum/src/api.ts | 8 +- src/chains/ethereum/src/wallet.ts | 10 +- src/chains/tezos/npm-shrinkwrap.json | 10 + src/chains/tezos/package.json | 6 +- src/packages/core/npm-shrinkwrap.json | 222 +- src/packages/core/package.json | 11 +- src/packages/ganache/npm-shrinkwrap.json | 1154 +++++ src/packages/ganache/package.json | 25 +- .../webpack/polyfills/browser-tmp-promise.ts | 2 + .../ganache/webpack/webpack.browser.config.ts | 3 + .../ganache/webpack/webpack.common.config.ts | 8 +- .../ganache/webpack/webpack.node.config.ts | 2 +- src/packages/options/npm-shrinkwrap.json | 161 +- src/packages/options/package.json | 7 +- src/packages/promise-queue/package-lock.json | 19 + src/packages/promise-queue/package.json | 8 +- src/packages/utils/npm-shrinkwrap.json | 41 +- src/packages/utils/package.json | 11 +- 23 files changed, 2407 insertions(+), 4154 deletions(-) create mode 100644 src/packages/promise-queue/package-lock.json diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 3051131194..a7e90d8f49 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -263,16 +263,6 @@ "to-fast-properties": "^2.0.0" } }, - "@dsherret/to-absolute-glob": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@dsherret/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-H2R13IvZdM6gei2vOGSzF7HdMyw=", - "dev": true, - "requires": { - "is-absolute": "^1.0.0", - "is-negated-glob": "^1.0.0" - } - }, "@evocateur/libnpmaccess": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz", @@ -2158,40 +2148,12 @@ "glob-to-regexp": "^0.3.0" } }, - "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.3", - "run-parallel": "^1.1.9" - }, - "dependencies": { - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true - } - } - }, "@nodelib/fs.stat": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, - "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.3", - "fastq": "^1.6.0" - } - }, "@octokit/auth-token": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.2.tgz", @@ -2375,175 +2337,6 @@ "@types/node": ">= 8" } }, - "@ts-morph/common": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.5.2.tgz", - "integrity": "sha512-eLmfYV6u6gUgHrB9QV9lpuWg3cD60mhXdv0jvM5exWR/Cor8HG+GziFIj2hPEWHJknqzuU4meZd8DTqIzZfDRQ==", - "dev": true, - "requires": { - "@dsherret/to-absolute-glob": "^2.0.2", - "fast-glob": "^3.2.2", - "fs-extra": "^9.0.0", - "is-negated-glob": "^1.0.0", - "multimatch": "^4.0.0", - "typescript": "~3.9.7" - }, - "dependencies": { - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", - "dev": true - }, - "array-differ": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", - "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "multimatch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", - "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", - "dev": true, - "requires": { - "@types/minimatch": "^3.0.3", - "array-differ": "^3.0.0", - "array-union": "^2.1.0", - "arrify": "^2.0.1", - "minimatch": "^3.0.4" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", - "dev": true - } - } - }, - "@types/bn.js": { - "version": "4.11.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", - "requires": { - "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "14.11.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", - "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" - } - } - }, - "@types/cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", - "dev": true - }, - "@types/eslint": { - "version": "7.2.4", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.4.tgz", - "integrity": "sha512-YCY4kzHMsHoyKspQH+nwSe+70Kep7Vjt2X+dZe5Vs2vkRudqtoFoUIv1RlJmZB8Hbp7McneupoZij4PadxsK5Q==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "@types/eslint-scope": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", - "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", - "dev": true, - "requires": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, - "@types/estree": { - "version": "0.0.45", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", - "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", - "dev": true - }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, "@types/fs-extra": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.2.tgz", @@ -2563,27 +2356,6 @@ "@types/node": "*" } }, - "@types/json-schema": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", - "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", - "dev": true - }, - "@types/lodash": { - "version": "4.14.161", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.161.tgz", - "integrity": "sha512-EP6O3Jkr7bXvZZSZYlsgt5DIjiGr0dXP1/jVEwVLTFgg0d+3lWVQkRavYVQszV7dYUwvg0B8R0MBDpcmXg7XIA==", - "dev": true - }, - "@types/lodash.clonedeep": { - "version": "4.5.6", - "resolved": "https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz", - "integrity": "sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==", - "dev": true, - "requires": { - "@types/lodash": "*" - } - }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -2603,9 +2375,9 @@ "dev": true }, "@types/node": { - "version": "14.14.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.2.tgz", - "integrity": "sha512-jeYJU2kl7hL9U5xuI/BhKPZ4vqGM/OmK6whiFAXVhlstzZhVamWhDSmHyGLIp+RVyuF9/d0dqr2P85aFj4BvJg==", + "version": "14.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", + "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==", "dev": true }, "@types/normalize-package-data": { @@ -2626,77 +2398,12 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", - "requires": { - "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "14.11.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", - "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" - } - } - }, "@types/prettier": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz", "integrity": "sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==", "dev": true }, - "@types/secp256k1": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", - "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", - "requires": { - "@types/node": "*" - }, - "dependencies": { - "@types/node": { - "version": "14.11.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", - "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==" - } - } - }, - "@types/seedrandom": { - "version": "2.4.28", - "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz", - "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", - "dev": true - }, - "@types/superagent": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.10.tgz", - "integrity": "sha512-xAgkb2CMWUMCyVc/3+7iQfOEBE75NvuZeezvmixbUw3nmENf2tCnQkW5yQLTYqvXUQ+R6EXxdqKKbal2zM5V/g==", - "dev": true, - "requires": { - "@types/cookiejar": "*", - "@types/node": "*" - } - }, - "@types/uws": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", - "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/node": "*" - } - }, - "@types/ws": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.7.tgz", - "integrity": "sha512-UUFC/xxqFLP17hTva8/lVT0SybLUrfSD9c+iapKb0fEiC8uoDbA+xuZ3pAN603eW+bY8ebSMLm9jXdIPnD0ZgA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/yargs": { "version": "15.0.9", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.9.tgz", @@ -2718,327 +2425,98 @@ "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, - "@webassemblyjs/ast": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", - "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "@zkochan/cmd-shim": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", + "integrity": "sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg==", "dev": true, "requires": { - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0" + "is-windows": "^1.0.0", + "mkdirp-promise": "^5.0.1", + "mz": "^2.5.0" } }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", - "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", - "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", - "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", - "dev": true - }, - "@webassemblyjs/helper-code-frame": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", - "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, "requires": { - "@webassemblyjs/wast-printer": "1.9.0" + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" } }, - "@webassemblyjs/helper-fsm": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", - "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, - "@webassemblyjs/helper-module-context": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", - "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0" + "es6-promisify": "^5.0.0" } }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", - "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", - "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "agentkeepalive": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", + "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0" + "humanize-ms": "^1.2.1" } }, - "@webassemblyjs/ieee754": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", - "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "requires": { - "@xtuc/ieee754": "^1.2.0" + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" } }, - "@webassemblyjs/leb128": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", - "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "ajv": { + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", "dev": true, "requires": { - "@xtuc/long": "4.2.2" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "@webassemblyjs/utf8": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", - "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, - "@webassemblyjs/wasm-edit": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", - "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/helper-wasm-section": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-opt": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "@webassemblyjs/wast-printer": "1.9.0" - } + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true }, - "@webassemblyjs/wasm-gen": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", - "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true }, - "@webassemblyjs/wasm-opt": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", - "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", - "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "@webassemblyjs/wast-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", - "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/floating-point-hex-parser": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-code-frame": "1.9.0", - "@webassemblyjs/helper-fsm": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", - "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "@webpack-cli/info": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.0.2.tgz", - "integrity": "sha512-FEfLQwmN4pXZSYSrtp+KC84rFanoCIxXFpS2wUvviDCE2fnajwxw2GXzbj83IlH4Dl8Wq8kJjavVwvxv3YJmnw==", - "dev": true, - "requires": { - "envinfo": "^7.7.3" - } - }, - "@webpack-cli/serve": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.0.1.tgz", - "integrity": "sha512-WGMaTMTK6NOe29Hw1WBEok9vGLfKg5C6jWzNOS/6HH1YadR+RL+TRWRcSyc81Dzulljhk/Ree9mrDM4Np9GGOQ==", - "dev": true - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "@zkochan/cmd-shim": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", - "integrity": "sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg==", - "dev": true, - "requires": { - "is-windows": "^1.0.0", - "mkdirp-promise": "^5.0.1", - "mz": "^2.5.0" - } - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, - "abstract-leveldown": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", - "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", - "requires": { - "xtend": "~4.0.0" - }, - "dependencies": { - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "acorn": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz", - "integrity": "sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ==", - "dev": true - }, - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "agentkeepalive": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz", - "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==", - "dev": true, - "requires": { - "humanize-ms": "^1.2.1" - } - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.5", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", - "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true - }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" + "color-convert": "^1.9.0" } }, "any-promise": { @@ -3159,24 +2637,12 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, - "array-back": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz", - "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", - "dev": true - }, "array-differ": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-2.1.0.tgz", "integrity": "sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w==", "dev": true }, - "array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", - "dev": true - }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", @@ -3231,30 +2697,6 @@ "safer-buffer": "~2.1.0" } }, - "asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - } - }, - "assert": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", - "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", - "dev": true, - "requires": { - "es6-object-assign": "^1.1.0", - "is-nan": "^1.2.1", - "object-is": "^1.0.1", - "util": "^0.12.0" - } - }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -3267,22 +2709,6 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, - "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", - "requires": { - "lodash": "^4.17.14" - } - }, - "async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "requires": { - "async": "^2.4.0" - } - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -3307,15 +2733,6 @@ "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=", "dev": true }, - "available-typed-arrays": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", - "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", - "dev": true, - "requires": { - "array-filter": "^1.0.0" - } - }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -3331,7 +2748,8 @@ "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", @@ -3388,19 +2806,6 @@ } } }, - "base-x": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", - "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" - }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -3416,74 +2821,23 @@ "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==", "dev": true }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, - "bigint-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", - "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", - "optional": true, - "requires": { - "bindings": "^1.3.0" - } - }, "binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bip39": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", - "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", - "requires": { - "@types/node": "11.11.6", - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1" - }, - "dependencies": { - "@types/node": { - "version": "11.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", - "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" - } - } - }, - "blakejs": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", - "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" - }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" - }, "brace-expansion": { "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", "concat-map": "0.0.1" @@ -3518,144 +2872,24 @@ } } }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "dev": true, - "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "bn.js": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", - "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", - "dev": true - } - } - }, - "browserslist": { - "version": "4.14.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.6.tgz", - "integrity": "sha512-zeFYcUo85ENhc/zxHbiIp0LGzzTrE2Pv2JhxvS7kpUb9Q9D38kUX6Bie7pGutJ/5iF5rOxE7CepAuWD56xJ33A==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001154", - "electron-to-chromium": "^1.3.585", - "escalade": "^3.1.1", - "node-releases": "^1.1.65" - } - }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", - "requires": { - "base-x": "^3.0.2" - } - }, - "bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "requires": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, "btoa-lite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=", "dev": true }, - "buffer": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", - "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4" - } - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" - }, "builtins": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", @@ -3821,12 +3055,6 @@ } } }, - "caniuse-lite": { - "version": "1.0.30001154", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001154.tgz", - "integrity": "sha512-y9DvdSti8NnYB9Be92ddMZQrcOe04kcQtcxtBx4NkB04+qZ+JUWotnXBJTmxlKudhxNTQ3RRknMwNU2YQl/Org==", - "dev": true - }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -3875,14 +3103,6 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, - "checkpoint-store": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", - "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", - "requires": { - "functional-red-black-tree": "^1.0.1" - } - }, "chokidar": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.3.tgz", @@ -3940,30 +3160,12 @@ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, - "chrome-trace-event": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", - "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -4249,12 +3451,6 @@ "shallow-clone": "^3.0.0" } }, - "code-block-writer": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.0.tgz", - "integrity": "sha512-RG9hpXtWFeUWhuUav1YuP/vGcyncW+t90yJLk9fNZs1De2OuHTHKAKThVCokt29PYq5RoJ0QSZaIZ+rvPO23hA==", - "dev": true - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -4286,12 +3482,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "colorette": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", - "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", - "dev": true - }, "columnify": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", @@ -4311,58 +3501,6 @@ "delayed-stream": "~1.0.0" } }, - "command-exists": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "dev": true - }, - "command-line-usage": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.0.tgz", - "integrity": "sha512-Ew1clU4pkUeo6AFVDFxCbnN7GIZfXl48HIOQeFQnkO3oOqvpI7wdqtLRwv9iOCZ/7A+z4csVZeiDdEcj8g6Wiw==", - "dev": true, - "requires": { - "array-back": "^4.0.0", - "chalk": "^2.4.2", - "table-layout": "^1.0.0", - "typical": "^5.2.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "dev": true - }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", @@ -4411,7 +3549,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 }, "concat-stream": { "version": "1.6.2", @@ -4732,12 +3871,6 @@ } } }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", - "dev": true - }, "copy-concurrently": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", @@ -4769,15 +3902,11 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, - "core-js-pure": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", - "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" - }, "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=" + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, "cosmiconfig": { "version": "5.2.1", @@ -4791,41 +3920,6 @@ "parse-json": "^4.0.0" } }, - "create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "cross-env": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz", @@ -4846,25 +3940,6 @@ "which": "^2.0.1" } }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -4963,12 +4038,6 @@ "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", "dev": true }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, "default-require-extensions": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", @@ -4995,18 +4064,11 @@ "clone": "^1.0.2" } }, - "deferred-leveldown": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", - "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, "requires": { "object-keys": "^1.0.12" }, @@ -5014,7 +4076,8 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true } } }, @@ -5059,11 +4122,6 @@ } } }, - "defined": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", - "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=" - }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -5082,16 +4140,6 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "dev": true }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, "detect-indent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz", @@ -5114,17 +4162,6 @@ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, "dir-glob": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", @@ -5209,43 +4246,12 @@ "safer-buffer": "^2.1.0" } }, - "electron-to-chromium": { - "version": "1.3.586", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.586.tgz", - "integrity": "sha512-or8FCbQCRlPZHkOoqBULOI9hzTiStVIQqDLgAPt8pzY+swTrW+89vsqd24Zn+Iv4guAJLxRBD6OR5AmbpabGDA==", - "dev": true - }, - "elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "emittery": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", - "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==" - }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true - }, "encoding": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", @@ -5255,49 +4261,6 @@ "iconv-lite": "^0.6.2" } }, - "encoding-down": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", - "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", - "requires": { - "abstract-leveldown": "^5.0.0", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "xtend": "^4.0.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", - "requires": { - "buffer": "^5.6.0" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -5307,25 +4270,6 @@ "once": "^1.4.0" } }, - "enhanced-resolve": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.3.1.tgz", - "integrity": "sha512-G1XD3MRGrGfNcf6Hg0LVZG7GIKcYkbfHa5QMxt1HDUTdYoXH0JR1xXyg+MaKLF73E9A27uWNVxvFivNRYeUB6w==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.4", - "tapable": "^2.0.0" - } - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, "env-paths": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz", @@ -5344,14 +4288,6 @@ "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA=", "dev": true }, - "errno": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", - "requires": { - "prr": "~1.0.1" - } - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -5365,6 +4301,7 @@ "version": "1.17.6", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", @@ -5382,7 +4319,8 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true } } }, @@ -5390,6 +4328,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -5402,12 +4341,6 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "es6-object-assign": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", - "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", - "dev": true - }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -5435,559 +4368,106 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "eventemitter3": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", "dev": true }, - "ethashjs": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz", - "integrity": "sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==", + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, "requires": { - "async": "^2.1.2", - "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.0.2", - "miller-rabin": "^4.0.0" + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" }, "dependencies": { - "buffer-xor": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", - "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, "requires": { - "safe-buffer": "^5.1.1" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } - } - } - }, - "ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "requires": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "ethereumjs-account": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", - "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", - "requires": { - "ethereumjs-util": "^6.0.0", - "rlp": "^2.2.1", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" + "isexe": "^2.0.0" } } } }, - "ethereumjs-block": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", - "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, "requires": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" + "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": { - "ethereumjs-util": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", - "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "ethereumjs-blockchain": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz", - "integrity": "sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ==", - "requires": { - "async": "^2.6.1", - "ethashjs": "~0.0.7", - "ethereumjs-block": "~2.2.2", - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.1.0", - "flow-stoplight": "^1.0.0", - "level-mem": "^3.0.1", - "lru-cache": "^5.1.1", - "rlp": "^2.2.2", - "semaphore": "^1.1.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - } - } - }, - "ethereumjs-common": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", - "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" - }, - "ethereumjs-tx": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", - "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - } - } - }, - "ethereumjs-util": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz", - "integrity": "sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.4" - }, - "dependencies": { - "bn.js": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", - "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==" - } - } - }, - "ethereumjs-vm": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz", - "integrity": "sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==", - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "core-js-pure": "^3.0.1", - "ethereumjs-account": "^3.0.0", - "ethereumjs-block": "^2.2.2", - "ethereumjs-blockchain": "^4.0.3", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.2", - "ethereumjs-util": "^6.2.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1", - "util.promisify": "^1.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", - "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "levelup": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", - "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", - "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" - }, - "ethereumjs-util": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", - "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "ethjs-util": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", - "requires": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - } - }, - "eventemitter3": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", - "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", - "dev": true - }, - "events": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", - "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "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": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" + "ms": "2.0.0" } }, "define-property": { @@ -6145,14 +4625,6 @@ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "dev": true }, - "fake-merkle-patricia-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", - "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", - "requires": { - "checkpoint-store": "^1.1.0" - } - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -6202,21 +4674,6 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", - "dev": true - }, - "fastq": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", - "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, "figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", @@ -6232,12 +4689,6 @@ "escape-string-regexp": "^1.0.5" } }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "optional": true - }, "fill-range": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", @@ -6356,11 +4807,6 @@ "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, - "flow-stoplight": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", - "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" - }, "flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", @@ -6409,24 +4855,12 @@ } } }, - "follow-redirects": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", - "dev": true - }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -6454,12 +4888,6 @@ "mime-types": "^2.1.12" } }, - "formidable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", - "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", - "dev": true - }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -6603,7 +5031,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "2.1.3", @@ -6615,12 +5044,8 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "gauge": { "version": "2.7.4", @@ -7170,6 +5595,7 @@ "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7275,6 +5701,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -7288,7 +5715,8 @@ "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true }, "has-unicode": { "version": "2.0.1", @@ -7328,25 +5756,6 @@ } } }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, "hasha": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", @@ -7371,16 +5780,6 @@ } } }, - "hdkey": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-2.0.1.tgz", - "integrity": "sha512-c+tl9PHG9/XkGgG0tD7CJpRVaE0jfZizDNmnErUAKQ4EjQSOcOUcV3EN9ZEZS8pZ4usaeiiK0H7stzuzna8feA==", - "requires": { - "bs58check": "^2.1.2", - "safe-buffer": "^5.1.1", - "secp256k1": "^4.0.0" - } - }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -7393,16 +5792,6 @@ "integrity": "sha512-zBZAmhSupHIl5sITeMqIJnYCDfAEc3Gdkqj65wC1lpI468MMQeeQkhcIAvk+RylAkxrCcI9xy9piHiXeQ1BdzQ==", "dev": true }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, "homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -7595,11 +5984,6 @@ "safer-buffer": ">= 2.1.2 < 3.0.0" } }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, "iferr": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", @@ -7621,11 +6005,6 @@ "minimatch": "^3.0.4" } }, - "immediate": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", - "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" - }, "import-fresh": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", @@ -7676,6 +6055,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -7684,7 +6064,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "ini": { "version": "1.3.5", @@ -7851,16 +6232,6 @@ "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", "dev": true }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "dev": true, - "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", @@ -7881,12 +6252,6 @@ } } }, - "is-arguments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", - "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", - "dev": true - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -7911,7 +6276,8 @@ "is-callable": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true }, "is-ci": { "version": "2.0.0", @@ -7945,7 +6311,8 @@ "is-date-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true }, "is-descriptor": { "version": "0.1.6", @@ -7999,12 +6366,6 @@ "number-is-nan": "^1.0.0" } }, - "is-generator-function": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", - "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==", - "dev": true - }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -8014,30 +6375,11 @@ "is-extglob": "^2.1.1" } }, - "is-hex-prefixed": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" - }, - "is-nan": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.0.tgz", - "integrity": "sha512-z7bbREymOqt2CCaZVly8aC4ML3Xhfi0ekuOnjO2L8vKdl+CttdVoGZQhd4adMFAsxQ5VeRVwORs4tU8RH+HFtQ==", - "dev": true, - "requires": { - "define-properties": "^1.1.3" - } - }, - "is-negated-glob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", - "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", - "dev": true - }, "is-negative-zero": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", - "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=" + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true }, "is-number": { "version": "3.0.0", @@ -8084,17 +6426,9 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", "dev": true, "requires": { - "is-unc-path": "^1.0.0" + "has-symbols": "^1.0.1" } }, "is-ssh": { @@ -8116,6 +6450,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, "requires": { "has-symbols": "^1.0.1" } @@ -8129,33 +6464,12 @@ "text-extensions": "^1.0.0" } }, - "is-typed-array": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.3.tgz", - "integrity": "sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.0", - "es-abstract": "^1.17.4", - "foreach": "^2.0.5", - "has-symbols": "^1.0.1" - } - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "dev": true, - "requires": { - "unc-path-regex": "^0.1.2" - } - }, "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", @@ -8168,11 +6482,6 @@ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -8348,23 +6657,6 @@ "istanbul-lib-report": "^3.0.0" } }, - "jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - } - }, - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "dev": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -8460,30 +6752,12 @@ "verror": "1.10.0" } }, - "keccak": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.0.tgz", - "integrity": "sha512-/4h4FIfFEpTEuySXi/nVFM5rqSKPnnhI7cL4K3MFSwoI3VyM7AhPSq3SsysARtnEBEeIKMBUWD8cTh9nHE8AkA==", - "requires": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, "lerna": { "version": "3.22.1", "resolved": "https://registry.npmjs.org/lerna/-/lerna-3.22.1.tgz", @@ -8510,316 +6784,6 @@ "npmlog": "^4.1.2" } }, - "level-codec": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", - "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" - }, - "level-concat-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" - }, - "level-errors": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", - "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", - "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-js": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/level-js/-/level-js-5.0.2.tgz", - "integrity": "sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg==", - "dev": true, - "requires": { - "abstract-leveldown": "~6.2.3", - "buffer": "^5.5.0", - "inherits": "^2.0.3", - "ltgt": "^2.1.2" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "dev": true, - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - } - } - }, - "level-mem": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", - "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", - "requires": { - "level-packager": "~4.0.0", - "memdown": "~3.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" - }, - "memdown": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", - "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", - "requires": { - "abstract-leveldown": "~5.0.0", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-option-wrap": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/level-option-wrap/-/level-option-wrap-1.1.0.tgz", - "integrity": "sha1-rSDmjZ88IsiJdTHMaqevWWse0Sk=", - "requires": { - "defined": "~0.0.0" - } - }, - "level-packager": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", - "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", - "requires": { - "encoding-down": "~5.0.0", - "levelup": "^3.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", - "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", - "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", - "requires": { - "abstract-leveldown": "~5.0.0", - "inherits": "^2.0.3" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", - "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "xtend": "^4.0.0" - } - }, - "levelup": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", - "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", - "requires": { - "deferred-leveldown": "~4.0.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~3.0.0", - "xtend": "~4.0.0" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-supports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", - "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", - "requires": { - "xtend": "^4.0.2" - }, - "dependencies": { - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "level-ws": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", - "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" - } - } - }, - "leveldown": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", - "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", - "requires": { - "abstract-leveldown": "~6.2.1", - "napi-macros": "~2.0.0", - "node-gyp-build": "~4.1.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "node-gyp-build": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", - "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, "lines-and-columns": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", @@ -8839,38 +6803,10 @@ "type-fest": "^0.3.0" } }, - "loader-runner": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.1.0.tgz", - "integrity": "sha512-oR4lB4WvwFoC70ocraKhn5nkKSs23t57h9udUgw8o0iH8hMXeEoRuUgfcvgUwAJ1ZpRqBvcou4N2SMvM1DwMrA==", - "dev": true - }, - "loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - }, - "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - } - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { "p-locate": "^3.0.0", @@ -8880,7 +6816,8 @@ "lodash": { "version": "4.17.20", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true }, "lodash._reinterpolate": { "version": "3.0.0", @@ -8891,7 +6828,8 @@ "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true }, "lodash.flattendeep": { "version": "4.4.0", @@ -8971,15 +6909,11 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, "requires": { "yallist": "^3.0.2" } }, - "ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" - }, "macos-release": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz", @@ -9049,103 +6983,6 @@ "object-visit": "^1.0.0" } }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "memdown": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", - "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", - "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", - "requires": { - "xtend": "~4.0.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", - "dev": true - }, "meow": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", @@ -9286,12 +7123,6 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true - }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -9313,21 +7144,6 @@ "to-regex": "^3.0.2" } }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", - "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==", - "dev": true - }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", @@ -9355,20 +7171,11 @@ "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, "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.7" } @@ -9773,11 +7580,6 @@ "to-regex": "^3.0.1" } }, - "napi-macros": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", - "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" - }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -9790,11 +7592,6 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" - }, "node-fetch": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", @@ -9857,34 +7654,6 @@ } } }, - "node-gyp-build": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" - }, - "node-loader": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/node-loader/-/node-loader-1.0.2.tgz", - "integrity": "sha512-myxAxpyMR7knjA4Uzwf3gjxaMtxSWj2vpm9o6AYWWxQ1S3XMBNeG2vzYcp/5eW03cBGfgSxyP+wntP8qhBJNhQ==", - "dev": true, - "requires": { - "loader-utils": "^2.0.0", - "schema-utils": "^3.0.0" - }, - "dependencies": { - "loader-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", - "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" - } - } - } - }, "node-preload": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", @@ -9894,12 +7663,6 @@ "process-on-spawn": "^1.0.0" } }, - "node-releases": { - "version": "1.1.65", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.65.tgz", - "integrity": "sha512-YpzJOe2WFIW0V4ZkJQd/DGR/zdVwc/pI4Nl1CZrBO19FdRcSTmsuhdttw9rsTzzJLrNcSloLiBbEYx1C4f6gpA==", - "dev": true - }, "nopt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", @@ -10364,50 +8127,8 @@ "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", - "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==" - }, - "object-is": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.3.tgz", - "integrity": "sha512-teyqLvFWzLkq5B9ki8FVWA902UER2qkxmdA4nLf+wjOLAWgxzCWZNCxpDq9MvE8MmhWNr+I8w3BN49Vx36Y6Xg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.18.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", - "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - } - } - }, - "object-keys": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", - "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true }, "object-visit": { "version": "1.0.1", @@ -10422,6 +8143,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", + "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.18.0-next.0", @@ -10433,6 +8155,7 @@ "version": "1.18.0-next.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", + "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", @@ -10451,7 +8174,8 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true } } }, @@ -10459,6 +8183,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.0-next.1" @@ -10483,6 +8208,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } @@ -10502,12 +8228,6 @@ "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", "dev": true }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -10699,19 +8419,6 @@ } } }, - "parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "requires": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, "parse-git-config": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", @@ -10800,12 +8507,6 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, - "path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, "path-dirname": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", @@ -10821,7 +8522,8 @@ "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=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, "path-key": { "version": "3.1.1", @@ -10852,18 +8554,6 @@ } } }, - "pbkdf2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -11104,16 +8794,11 @@ } } }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true }, "process-on-spawn": { "version": "1.0.0", @@ -11170,31 +8855,12 @@ "genfun": "^5.0.0" } }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -11256,25 +8922,11 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { - "randombytes": "^2.0.5", "safe-buffer": "^5.1.0" } }, - "reachdown": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz", - "integrity": "sha512-6LsdRe4cZyOjw4NnvbhUd/rGG7WQ9HMopPr+kyL018Uci4kijtxcGR5kVb5Ln13k4PEE+fEFQbjfOvNw7cnXmA==" - }, "read": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", @@ -11406,6 +9058,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -11452,12 +9105,6 @@ "strip-indent": "^3.0.0" } }, - "reduce-flatten": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", - "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", - "dev": true - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -11532,12 +9179,6 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true - }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -11604,49 +9245,21 @@ "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=", "dev": true }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, "requires": { "glob": "^7.1.3" } }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rlp": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", - "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", - "requires": { - "bn.js": "^4.11.1" - } - }, "run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true - }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -11656,11 +9269,6 @@ "aproba": "^1.1.1" } }, - "rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" - }, "rxjs": { "version": "6.6.3", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", @@ -11673,7 +9281,8 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true }, "safe-regex": { "version": "1.1.0", @@ -11690,46 +9299,11 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, - "schema-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", - "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.6", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" - } - }, - "scrypt-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" - }, - "secp256k1": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", - "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", - "requires": { - "elliptic": "^6.5.2", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, - "seedrandom": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", - "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" - }, - "semaphore": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", - "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" - }, "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true }, "semver-compare": { "version": "1.0.0", @@ -11781,20 +9355,6 @@ } } }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -12017,86 +9577,15 @@ } } }, - "solc": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.4.tgz", - "integrity": "sha512-IVLqAfUkJqgTS0JIgFPeC50ehUeBXu2eE+iU+rqb6UeOyf6w/BB/EsNcTSTpjtUti8BTG/sCd2qVhrWVYy7p0g==", - "dev": true, - "requires": { - "command-exists": "^1.2.8", - "commander": "3.0.2", - "follow-redirects": "^1.12.1", - "fs-extra": "^0.30.0", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", - "tmp": "0.0.33" - }, - "dependencies": { - "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - } - } - }, - "sort-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", - "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", + "sort-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz", + "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=", "dev": true, "requires": { "is-plain-obj": "^1.0.0" } }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -12283,16 +9772,6 @@ } } }, - "stream-browserify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", - "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", - "dev": true, - "requires": { - "inherits": "~2.0.4", - "readable-stream": "^3.5.0" - } - }, "stream-each": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", @@ -12324,6 +9803,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" @@ -12333,6 +9813,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" @@ -12342,6 +9823,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, "requires": { "safe-buffer": "~5.2.0" } @@ -12373,14 +9855,6 @@ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true }, - "strip-hex-prefix": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", - "requires": { - "is-hex-prefixed": "1.0.0" - } - }, "strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -12407,163 +9881,6 @@ "through": "^2.3.4" } }, - "subleveldown": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.1.tgz", - "integrity": "sha512-cVqd/URpp7si1HWu5YqQ3vqQkjuolAwHypY1B4itPlS71/lsf6TQPZ2Y0ijT22EYVkvH5ove9JFJf4u7VGPuZw==", - "requires": { - "abstract-leveldown": "^6.3.0", - "encoding-down": "^6.2.0", - "inherits": "^2.0.3", - "level-option-wrap": "^1.1.0", - "levelup": "^4.4.0", - "reachdown": "^1.1.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", - "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "requires": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - }, - "dependencies": { - "abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "requires": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - } - } - }, - "encoding-down": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", - "requires": { - "abstract-leveldown": "^6.2.1", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0" - } - }, - "level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", - "requires": { - "buffer": "^5.6.0" - } - }, - "level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - } - }, - "levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", - "requires": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - } - } - }, - "superagent": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", - "integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==", - "dev": true, - "requires": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.2", - "debug": "^4.1.1", - "fast-safe-stringify": "^2.0.7", - "form-data": "^3.0.0", - "formidable": "^1.2.2", - "methods": "^1.1.2", - "mime": "^2.4.6", - "qs": "^6.9.4", - "readable-stream": "^3.6.0", - "semver": "^7.3.2" - }, - "dependencies": { - "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "form-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", - "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", - "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", - "dev": true - }, - "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true - } - } - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -12573,24 +9890,6 @@ "has-flag": "^4.0.0" } }, - "table-layout": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.1.tgz", - "integrity": "sha512-dEquqYNJiGwY7iPfZ3wbXDI944iqanTSchrACLL2nOB+1r+h1Nzu2eH+DuPPvWvm5Ry7iAPeFlgEtP5bIp5U7Q==", - "dev": true, - "requires": { - "array-back": "^4.0.1", - "deep-extend": "~0.6.0", - "typical": "^5.2.0", - "wordwrapjs": "^4.0.0" - } - }, - "tapable": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.0.0.tgz", - "integrity": "sha512-bjzn0C0RWoffnNdTzNi7rNDhs1Zlwk2tRXgk8EiHKAOX1Mag3d6T0Y5zNa7l9CJ+EoUne/0UHdwS8tMbkh9zDg==", - "dev": true - }, "tar": { "version": "4.4.13", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", @@ -12634,62 +9933,6 @@ } } }, - "terser": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz", - "integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.7.2", - "source-map-support": "~0.5.19" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - } - } - }, - "terser-webpack-plugin": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz", - "integrity": "sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ==", - "dev": true, - "requires": { - "jest-worker": "^26.6.1", - "p-limit": "^3.0.2", - "schema-utils": "^3.0.0", - "serialize-javascript": "^5.0.1", - "source-map": "^0.6.1", - "terser": "^5.3.8" - }, - "dependencies": { - "p-limit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", - "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -12785,22 +10028,6 @@ } } }, - "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "requires": { - "rimraf": "^3.0.0" - } - }, - "tmp-promise": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.2.tgz", - "integrity": "sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA==", - "requires": { - "tmp": "^0.2.0" - } - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -12880,124 +10107,6 @@ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, - "ts-loader": { - "version": "8.0.7", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.7.tgz", - "integrity": "sha512-ooa4wxlZ9TOXaJ/iVyZlWsim79Ul4KyifSwyT2hOrbQA6NZJypsLOE198o8Ko+JV+ZHnMArvWcl4AnRqpCU/Mw==", - "dev": true, - "requires": { - "chalk": "^2.3.0", - "enhanced-resolve": "^4.0.0", - "loader-utils": "^1.0.2", - "micromatch": "^4.0.0", - "semver": "^6.0.0" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "enhanced-resolve": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", - "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } - } - }, - "ts-morph": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-7.3.0.tgz", - "integrity": "sha512-BUKSoz7AFSKPcYTZODbICW2mOthAN4vc5juD6FL1lD/dLwZ0WvrC3zqBM3/X6f5gHxq3yaz+HmanHGaWm0ddbQ==", - "dev": true, - "requires": { - "@dsherret/to-absolute-glob": "^2.0.2", - "@ts-morph/common": "~0.5.2", - "code-block-writer": "^10.1.0" - } - }, "ts-node": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", @@ -13074,16 +10183,6 @@ "integrity": "sha512-tgNcFrLIjlaMWEc7bKC0bxLNIt8BIAauY/HLUOQDyTP75HGskETtXOt46x4EKAHRKhWVLMc7yM02puTHa/yhCA==", "dev": true }, - "typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "dev": true - }, - "uWebSockets.js": { - "version": "github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c", - "from": "github:uNetworking/uWebSockets.js#v18.4.0" - }, "uglify-js": { "version": "3.10.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz", @@ -13103,12 +10202,6 @@ "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0=", "dev": true }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true - }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -13227,41 +10320,11 @@ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, - "utf-8-validate": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.2.tgz", - "integrity": "sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==", - "dev": true, - "requires": { - "node-gyp-build": "~3.7.0" - }, - "dependencies": { - "node-gyp-build": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz", - "integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==", - "dev": true - } - } - }, - "util": { - "version": "0.12.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz", - "integrity": "sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "safe-buffer": "^5.1.2", - "which-typed-array": "^1.1.2" - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true }, "util-promisify": { "version": "2.1.0", @@ -13272,29 +10335,12 @@ "object.getownpropertydescriptors": "^2.0.3" } }, - "util.promisify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", - "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.2", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.0" - } - }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, - "v8-compile-cache": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", - "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", - "dev": true - }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -13325,24 +10371,6 @@ "extsprintf": "^1.2.0" } }, - "watchpack": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.0.1.tgz", - "integrity": "sha512-vO8AKGX22ZRo6PiOFM9dC0re8IcKh8Kd/aH2zeqUc6w4/jBGlTy2P7fTC6ekT0NjVeGjgU2dGC5rNstKkeLEQg==", - "dev": true, - "requires": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "dependencies": { - "glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - } - } - }, "wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -13358,299 +10386,6 @@ "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", "dev": true }, - "webpack": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.4.0.tgz", - "integrity": "sha512-udpYTyqz8toTTdaOsL2QKPLeZLt2IEm9qY7yTXuFEQhKu5bk0yQD9BtAdVQksmz4jFbbWOiWmm3NHarO0zr/ng==", - "dev": true, - "requires": { - "@types/eslint-scope": "^3.7.0", - "@types/estree": "^0.0.45", - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/wasm-edit": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "acorn": "^8.0.4", - "browserslist": "^4.14.5", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.3.1", - "eslint-scope": "^5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.4", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^4.1.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "pkg-dir": "^4.2.0", - "schema-utils": "^3.0.0", - "tapable": "^2.0.0", - "terser-webpack-plugin": "^5.0.3", - "watchpack": "^2.0.0", - "webpack-sources": "^2.1.1" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - } - } - }, - "webpack-cli": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.1.0.tgz", - "integrity": "sha512-NdhxXMZmoik62Y05t0h1y65LjBM7BwFPq311ihXuMM3RY6dlc4KkCTyHLzTuBEc+bqq6d3xh+CWmU0xRexNJBA==", - "dev": true, - "requires": { - "@webpack-cli/info": "^1.0.2", - "@webpack-cli/serve": "^1.0.1", - "ansi-escapes": "^4.3.1", - "colorette": "^1.2.1", - "command-line-usage": "^6.1.0", - "commander": "^6.0.0", - "enquirer": "^2.3.4", - "execa": "^4.0.0", - "import-local": "^3.0.2", - "interpret": "^2.0.0", - "rechoir": "^0.7.0", - "v8-compile-cache": "^2.1.0", - "webpack-merge": "^4.2.2" - }, - "dependencies": { - "ansi-escapes": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", - "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", - "dev": true, - "requires": { - "type-fest": "^0.11.0" - } - }, - "commander": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", - "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", - "dev": true - }, - "execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "import-local": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", - "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - } - }, - "interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", - "dev": true - }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "requires": { - "path-key": "^3.0.0" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "rechoir": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", - "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", - "dev": true, - "requires": { - "resolve": "^1.9.0" - } - }, - "resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "requires": { - "resolve-from": "^5.0.0" - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "type-fest": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", - "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", - "dev": true - } - } - }, - "webpack-merge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", - "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", - "dev": true, - "requires": { - "lodash": "^4.17.15" - } - }, - "webpack-sources": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", - "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", - "dev": true, - "requires": { - "source-list-map": "^2.0.1", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "whatwg-url": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", @@ -13683,20 +10418,6 @@ "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", "dev": true }, - "which-typed-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.2.tgz", - "integrity": "sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.2", - "es-abstract": "^1.17.5", - "foreach": "^2.0.5", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.1", - "is-typed-array": "^1.1.3" - } - }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", @@ -13721,16 +10442,6 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, - "wordwrapjs": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", - "integrity": "sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ==", - "dev": true, - "requires": { - "reduce-flatten": "^2.0.0", - "typical": "^5.0.0" - } - }, "workerpool": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.2.tgz", @@ -13785,7 +10496,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "write-file-atomic": { "version": "2.4.3", @@ -13862,20 +10574,6 @@ } } }, - "ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", - "dev": true - }, - "xtend": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", - "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", - "requires": { - "object-keys": "~0.4.0" - } - }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", @@ -13885,7 +10583,8 @@ "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true }, "yaml": { "version": "1.10.0", diff --git a/package.json b/package.json index 3bf3b80519..0061486c4d 100644 --- a/package.json +++ b/package.json @@ -7,92 +7,47 @@ "npm": ">=6.1.0" }, "scripts": { - "docs.build": "lerna run docs.build", - "docs.preview": "lerna run docs.preview", + "build": "lerna run build", "clean": "npx shx rm -rf node_modules && npx lerna clean -y && npm run tsc.clean", "create": "ts-node ./scripts/create", + "docs.build": "lerna run docs.build", + "docs.preview": "lerna run docs.preview", "postinstall": "lerna bootstrap && ts-node ./scripts/postinstall", "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm run test", "tsc": "lerna exec -- npm run tsc", - "tsc.clean": "npx lerna exec -- npx shx rm -rf lib", - "prepare": "lerna run prepare" - }, - "dependencies": { - "bip39": "3.0.2", - "emittery": "0.7.2", - "ethereumjs-account": "3.0.0", - "ethereumjs-block": "2.2.2", - "ethereumjs-common": "1.5.1", - "ethereumjs-tx": "2.1.2", - "ethereumjs-util": "7.0.7", - "ethereumjs-vm": "4.2.0", - "hdkey": "2.0.1", - "leveldown": "5.6.0", - "lodash.clonedeep": "4.5.0", - "secp256k1": "4.0.2", - "seedrandom": "3.0.5", - "subleveldown": "5.0.1", - "tmp-promise": "3.0.2", - "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0" + "tsc.clean": "npx lerna exec -- npx shx rm -rf lib" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "1.0.1", "@types/fs-extra": "9.0.2", - "@types/lodash.clonedeep": "4.5.6", "@types/mocha": "8.0.3", - "@types/node": "14.14.2", + "@types/node": "14.14.6", "@types/npm-package-arg": "6.1.0", "@types/prettier": "2.1.5", - "@types/secp256k1": "4.0.1", - "@types/seedrandom": "2.4.28", - "@types/superagent": "4.1.10", - "@types/uws": "0.13.2", - "@types/ws": "7.2.7", "@types/yargs": "15.0.9", - "assert": "2.0.0", - "buffer": "5.6.0", "camelcase": "6.1.0", "chalk": "4.1.0", "cli-highlight": "2.1.4", "cross-env": "7.0.2", - "crypto-browserify": "3.12.0", "fs-extra": "9.0.1", "git-user-name": "2.0.0", "husky": "4.3.0", "into-stream": "6.0.0", "lerna": "3.22.1", - "level-js": "5.0.2", "mocha": "8.2.0", "monaco-editor": "0.21.2", - "node-loader": "1.0.2", "npm-package-arg": "8.1.0", "nyc": "15.1.0", - "os-browserify": "0.3.0", - "path-browserify": "1.0.1", "prettier": "2.1.2", "pretty-quick": "3.1.0", - "process": "0.11.10", "shx": "0.3.3", - "solc": "0.7.4", - "stream-browserify": "3.0.0", - "superagent": "6.1.0", - "ts-loader": "8.0.7", - "ts-morph": "7.3.0", "ts-node": "9.0.0", "ts-transformer-inline-file": "0.1.1", "ttypescript": "1.5.12", "typescript": "4.1.1-rc", - "utf-8-validate": "5.0.2", - "util": "0.12.3", - "webpack": "5.4.0", - "webpack-cli": "4.1.0", - "ws": "7.3.1", "yargs": "16.1.0" }, - "optionalDependencies": { - "bigint-buffer": "1.1.5" - }, "license": "MIT", "husky": { "hooks": { diff --git a/src/chains/ethereum/__tests__/api/eth/sign.test.ts b/src/chains/ethereum/__tests__/api/eth/sign.test.ts index f9ab5ff051..be8db14351 100644 --- a/src/chains/ethereum/__tests__/api/eth/sign.test.ts +++ b/src/chains/ethereum/__tests__/api/eth/sign.test.ts @@ -44,8 +44,14 @@ describe("api", () => { const r = Buffer.from(sgn.slice(0, 64), "hex"); const s = Buffer.from(sgn.slice(64, 128), "hex"); - const v = parseInt(sgn.slice(128, 130), 16) + 27; - const pub = ecrecover(msgHash, v, r, s); + const v = parseInt(sgn.slice(128), 16); + const pub = ecrecover( + msgHash, + v, + r, + s, + provider.getOptions().chain.chainId + ); const addr = fromSigned(pubToAddress(pub)); const strAddr = "0x" + addr.toString("hex"); assert.strictEqual(strAddr, accounts[0].toLowerCase()); @@ -64,8 +70,14 @@ describe("api", () => { const r = Buffer.from(sgn.slice(0, 64), "hex"); const s = Buffer.from(sgn.slice(64, 128), "hex"); - const v = parseInt(sgn.slice(128, 130), 16) + 27; - const pub = ecrecover(msgHash, v, r, s); + const v = parseInt(sgn.slice(128), 16); + const pub = ecrecover( + msgHash, + v, + r, + s, + provider.getOptions().chain.chainId + ); const addr = fromSigned(pubToAddress(pub)); const strAddr = "0x" + addr.toString("hex"); assert.deepStrictEqual(strAddr, accounts[0].toLowerCase()); diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index f657b78f51..1ce25d2fcc 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -4,32 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "dev": true - }, - "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.10.4", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, "@koa/cors": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@koa/cors/-/cors-3.1.0.tgz", @@ -39,12 +13,6 @@ "vary": "^1.1.2" } }, - "@tokenizer/token": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.1.1.tgz", - "integrity": "sha512-XO6INPbZCxdprl+9qa/AAbFFOMzzwqYxpjPgLICrMD6C2FCw6qfJOPcBk6JqqPLSaZ/Qx87qn4rpPmPMwaAK6w==", - "dev": true - }, "@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", @@ -71,12 +39,21 @@ "@types/node": "*" } }, - "@types/debug": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz", - "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ==", + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", "dev": true }, + "@types/fs-extra": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.2.tgz", + "integrity": "sha512-jp0RI6xfZpi5JL8v7WQwpBEQTq63RqW2kxwTZt+m27LcJqQdPVU1yGnT1ZI4EtCDynQQJtIGyQahkiCGCS7e+A==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/keccak": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/keccak/-/keccak-3.0.1.tgz", @@ -85,23 +62,26 @@ "@types/node": "*" } }, - "@types/minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "@types/lodash": { + "version": "4.14.164", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.164.tgz", + "integrity": "sha512-fXCEmONnrtbYUc5014avwBeMdhHHO8YJCkOBflUL9EoJBSKZ1dei+VO74fA7JkTHZ1GvZack2TyIw5U+1lT8jg==", "dev": true }, + "@types/lodash.clonedeep": { + "version": "4.5.6", + "resolved": "https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz", + "integrity": "sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA==", + "dev": true, + "requires": { + "@types/lodash": "*" + } + }, "@types/node": { "version": "14.0.23", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.23.tgz", "integrity": "sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw==" }, - "@types/normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", - "dev": true - }, "@types/pbkdf2": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", @@ -118,6 +98,31 @@ "@types/node": "*" } }, + "@types/seedrandom": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz", + "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", + "dev": true + }, + "@types/uws": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", + "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/node": "*" + } + }, + "@types/ws": { + "version": "7.2.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.7.tgz", + "integrity": "sha512-UUFC/xxqFLP17hTva8/lVT0SybLUrfSD9c+iapKb0fEiC8uoDbA+xuZ3pAN603eW+bY8ebSMLm9jXdIPnD0ZgA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", @@ -209,12 +214,6 @@ "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", "dev": true }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "async": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", @@ -231,6 +230,12 @@ "async": "^2.4.0" } }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, "backbone": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz", @@ -243,8 +248,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base-x": { "version": "3.0.8", @@ -290,6 +294,24 @@ "file-uri-to-path": "1.0.0" } }, + "bip39": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", + "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", + "requires": { + "@types/node": "11.11.6", + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1" + }, + "dependencies": { + "@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" + } + } + }, "bip66": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", @@ -318,7 +340,6 @@ "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", "concat-map": "0.0.1" @@ -396,23 +417,6 @@ "ylru": "^1.2.0" } }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" - } - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -488,6 +492,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true + }, "command-line-args": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.1.1.tgz", @@ -534,6 +544,12 @@ } } }, + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true + }, "common-log-format": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/common-log-format/-/common-log-format-1.0.0.tgz", @@ -552,8 +568,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "content-disposition": { "version": "0.5.3", @@ -670,30 +685,6 @@ "ms": "2.0.0" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "dev": true, - "requires": { - "decamelize": "^1.1.0", - "map-obj": "^1.0.0" - }, - "dependencies": { - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - } - } - }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", @@ -729,6 +720,11 @@ } } }, + "defined": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", + "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=" + }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -812,6 +808,11 @@ "minimalistic-crypto-utils": "^1.0.0" } }, + "emittery": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", + "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==" + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -875,15 +876,6 @@ "prr": "~1.0.1" } }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, "es-abstract": { "version": "1.17.6", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", @@ -972,6 +964,20 @@ } } } + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } } } }, @@ -1099,6 +1105,20 @@ "merkle-patricia-tree": "^2.1.2" }, "dependencies": { + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1234,9 +1254,9 @@ } }, "ethereumjs-common": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.1.tgz", - "integrity": "sha512-aVUPRLgmXORGXXEVkFYgPhr9TGtpBY2tGhZ9Uh0A3lIUzUDr1x6kQx33SbjPUkLkX3eniPQnIL/2psjkjrOfcQ==" + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", + "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==" }, "ethereumjs-tx": { "version": "2.1.2", @@ -1264,17 +1284,23 @@ } }, "ethereumjs-util": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", - "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz", + "integrity": "sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==", "requires": { - "bn.js": "^4.11.0", + "@types/bn.js": "^4.11.3", + "bn.js": "^5.1.2", "create-hash": "^1.1.2", - "elliptic": "^6.5.2", "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" + "ethjs-util": "0.1.6", + "rlp": "^2.2.4" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==" + } } }, "ethereumjs-vm": { @@ -1437,18 +1463,6 @@ "checkpoint-store": "^1.1.0" } }, - "file-type": { - "version": "14.6.2", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-14.6.2.tgz", - "integrity": "sha512-kSZTAJxPXBdBgJyoC7TexkBWoMI/D1Gas6aTtAn9VIRFwCehwiluGV5O8O2GwqO5zIqeEvXxEKl/xfcaAKB0Yg==", - "dev": true, - "requires": { - "readable-web-to-node-stream": "^2.0.0", - "strtok3": "^6.0.3", - "token-types": "^2.0.0", - "typedarray-to-buffer": "^3.1.5" - } - }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -1471,21 +1485,17 @@ } } }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, "flow-stoplight": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" }, + "follow-redirects": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", + "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", + "dev": true + }, "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", @@ -1493,21 +1503,21 @@ "dev": true }, "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", "dev": true, "requires": { + "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "function-bind": { "version": "1.1.1", @@ -1519,17 +1529,10 @@ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, - "get-stdin": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", - "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", - "dev": true - }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1558,12 +1561,6 @@ "wordwrap": "^1.0.0" } }, - "hard-rejection": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", - "dev": true - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1602,6 +1599,16 @@ "minimalistic-assert": "^1.0.1" } }, + "hdkey": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hdkey/-/hdkey-2.0.1.tgz", + "integrity": "sha512-c+tl9PHG9/XkGgG0tD7CJpRVaE0jfZizDNmnErUAKQ4EjQSOcOUcV3EN9ZEZS8pZ4usaeiiK0H7stzuzna8feA==", + "requires": { + "bs58check": "^2.1.2", + "safe-buffer": "^5.1.1", + "secp256k1": "^4.0.0" + } + }, "highlight.js": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.1.2.tgz", @@ -1618,12 +1625,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "htmlparser2": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", @@ -1758,12 +1759,6 @@ "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, "inflation": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.0.0.tgz", @@ -1774,7 +1769,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -1791,12 +1785,6 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, "is-callable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", @@ -1824,12 +1812,6 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - }, "is-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", @@ -1838,12 +1820,6 @@ "has-symbols": "^1.0.1" } }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true - }, "is-symbol": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", @@ -1852,12 +1828,6 @@ "has-symbols": "^1.0.1" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, "is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -1878,16 +1848,10 @@ "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==", "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", "dev": true }, "json-stringify-safe": { @@ -1897,12 +1861,21 @@ "dev": true }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true + } } }, "jsonparse": { @@ -1929,11 +1902,14 @@ "tsscmp": "1.0.6" } }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } }, "koa": { "version": "2.13.0", @@ -2224,6 +2200,14 @@ } } }, + "level-option-wrap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/level-option-wrap/-/level-option-wrap-1.1.0.tgz", + "integrity": "sha1-rSDmjZ88IsiJdTHMaqevWWse0Sk=", + "requires": { + "defined": "~0.0.0" + } + }, "level-packager": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", @@ -2360,6 +2344,40 @@ } } }, + "leveldown": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", + "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", + "requires": { + "abstract-leveldown": "~6.2.1", + "napi-macros": "~2.0.0", + "node-gyp-build": "~4.1.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "node-gyp-build": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", + "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, "levelup": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", @@ -2418,12 +2436,6 @@ } } }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, "load-module": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/load-module/-/load-module-3.0.0.tgz", @@ -2458,15 +2470,6 @@ "node-version-matches": "^2.0.1" } }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, "lodash": { "version": "4.17.19", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", @@ -2484,6 +2487,11 @@ "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", "dev": true }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" + }, "lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", @@ -2671,29 +2679,6 @@ "koa-static": "^5.0.0" } }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, - "map-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", - "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", - "dev": true - }, "marked": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/marked/-/marked-1.0.0.tgz", @@ -2749,24 +2734,11 @@ } } }, - "meow": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.1.tgz", - "integrity": "sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==", - "dev": true, - "requires": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "^4.0.2", - "normalize-package-data": "^2.5.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.13.1", - "yargs-parser": "^18.1.3" - } + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true }, "merkle-patricia-tree": { "version": "3.0.0", @@ -2782,6 +2754,20 @@ "semaphore": ">=1.0.1" }, "dependencies": { + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -2863,12 +2849,6 @@ "mime-db": "1.44.0" } }, - "min-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", - "dev": true - }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -2883,7 +2863,6 @@ "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.7" } @@ -2894,17 +2873,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - } - }, "morgan": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", @@ -2957,6 +2925,11 @@ "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" }, + "napi-macros": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", + "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -2996,18 +2969,6 @@ } } }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, "nth-check": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", @@ -3079,7 +3040,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -3100,55 +3060,12 @@ "is-wsl": "^2.1.1" } }, - "open-cli": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/open-cli/-/open-cli-6.0.1.tgz", - "integrity": "sha512-A5h8MF3GrT1efn9TiO9LPajDnLtuEiGQT5G8TxWObBlgt1cZJF1YbQo/kNtsD1bJb7HxnT6SaSjzeLq0Rfhygw==", - "dev": true, - "requires": { - "file-type": "^14.1.4", - "get-stdin": "^7.0.0", - "meow": "^6.1.0", - "open": "^7.0.3", - "temp-write": "^4.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "parse-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", - "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", - "lines-and-columns": "^1.1.6" - } - }, "parse5": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", @@ -3164,17 +3081,10 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, "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=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-parse": { "version": "1.0.6", @@ -3200,12 +3110,6 @@ "sha.js": "^2.4.8" } }, - "peek-readable": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-3.1.0.tgz", - "integrity": "sha512-KGuODSTV6hcgdZvDrIDBUkN0utcAVj1LL7FfGbM0viKTtCHmtZcuEJ+lGqsp0fTFkGqesdtemV2yUSMeyy3ddA==", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -3234,12 +3138,6 @@ "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", "dev": true }, - "quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "dev": true - }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3275,44 +3173,10 @@ } } }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } - } - }, - "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dev": true, - "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } - } + "reachdown": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reachdown/-/reachdown-1.1.0.tgz", + "integrity": "sha512-6LsdRe4cZyOjw4NnvbhUd/rGG7WQ9HMopPr+kyL018Uci4kijtxcGR5kVb5Ln13k4PEE+fEFQbjfOvNw7cnXmA==" }, "readable-stream": { "version": "3.6.0", @@ -3324,12 +3188,6 @@ "util-deprecate": "^1.0.1" } }, - "readable-web-to-node-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-2.0.0.tgz", - "integrity": "sha512-+oZJurc4hXpaaqsN68GoZGQAQIA3qr09Or4fqEsargABnbe5Aau8hFn6ISVleT3cpY/0n/8drn7huyyEvTbghA==", - "dev": true - }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -3339,22 +3197,18 @@ "resolve": "^1.1.6" } }, - "redent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "dev": true, - "requires": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - } - }, "reduce-flatten": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.0.tgz", "integrity": "sha512-eczl8wAYBxJ6Egl6I1ECIF+8z6sHu+KE7BzaEDZTpPXKXfy9SUDQlVYwkRcNTjJLC3Iakxbhss50KuT/R6SYfg==", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -3400,6 +3254,14 @@ } } }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -3448,6 +3310,11 @@ "node-gyp-build": "^4.2.0" } }, + "seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" + }, "semaphore": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", @@ -3539,42 +3406,75 @@ "rechoir": "^0.6.2" } }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "solc": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.4.tgz", + "integrity": "sha512-IVLqAfUkJqgTS0JIgFPeC50ehUeBXu2eE+iU+rqb6UeOyf6w/BB/EsNcTSTpjtUti8BTG/sCd2qVhrWVYy7p0g==", "dev": true, "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "command-exists": "^1.2.8", + "commander": "3.0.2", + "follow-redirects": "^1.12.1", + "fs-extra": "^0.30.0", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "require-from-string": "^2.0.0", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "dependencies": { + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + } } }, - "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "statuses": { @@ -3692,24 +3592,63 @@ "is-hex-prefixed": "1.0.0" } }, - "strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, - "requires": { - "min-indent": "^1.0.0" - } - }, - "strtok3": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.0.4.tgz", - "integrity": "sha512-rqWMKwsbN9APU47bQTMEYTPcwdpKDtmf1jVhHzNW2cL1WqAxaM9iBb9t5P2fj+RV2YsErUWgQzHD5JwV0uCTEQ==", - "dev": true, + "subleveldown": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/subleveldown/-/subleveldown-5.0.1.tgz", + "integrity": "sha512-cVqd/URpp7si1HWu5YqQ3vqQkjuolAwHypY1B4itPlS71/lsf6TQPZ2Y0ijT22EYVkvH5ove9JFJf4u7VGPuZw==", "requires": { - "@tokenizer/token": "^0.1.1", - "@types/debug": "^4.1.5", - "peek-readable": "^3.1.0" + "abstract-leveldown": "^6.3.0", + "encoding-down": "^6.2.0", + "inherits": "^2.0.3", + "level-option-wrap": "^1.1.0", + "levelup": "^4.4.0", + "reachdown": "^1.1.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", + "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "encoding-down": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", + "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", + "requires": { + "abstract-leveldown": "^6.2.1", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0" + } + }, + "level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "requires": { + "buffer": "^5.6.0" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } } }, "supports-color": { @@ -3741,25 +3680,6 @@ } } }, - "temp-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", - "integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=", - "dev": true - }, - "temp-write": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/temp-write/-/temp-write-4.0.0.tgz", - "integrity": "sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "is-stream": "^2.0.0", - "make-dir": "^3.0.0", - "temp-dir": "^1.0.0", - "uuid": "^3.3.2" - } - }, "thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -3784,26 +3704,26 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", - "dev": true + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "requires": { + "rimraf": "^3.0.0" + } }, - "token-types": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-2.0.0.tgz", - "integrity": "sha512-WWvu8sGK8/ZmGusekZJJ5NM6rRVTTDO7/bahz4NGiSDb/XsmdYBn6a1N/bymUHuWYTWeuLUg98wUzvE4jPdCZw==", - "dev": true, + "tmp-promise": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.2.tgz", + "integrity": "sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA==", "requires": { - "@tokenizer/token": "^0.1.0", - "ieee754": "^1.1.13" + "tmp": "^0.2.0" } }, - "trim-newlines": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", - "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, "ts-transformer-inline-file": { @@ -3828,12 +3748,6 @@ "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" }, - "type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", - "dev": true - }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -3844,15 +3758,6 @@ "mime-types": "~2.1.24" } }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, "typedoc": { "version": "0.17.8", "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.17.8.tgz", @@ -3869,6 +3774,34 @@ "progress": "^2.0.3", "shelljs": "^0.8.4", "typedoc-default-themes": "^0.10.2" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } } }, "typedoc-default-themes": { @@ -3886,6 +3819,11 @@ "integrity": "sha512-+g3NEp7fJLe9DPa1TArHm9QAA7YciZmWnfAqEaFrBihQ7epOv9i99rjtgb6Iz0wh3WuQDjsCTDfgRoGnmHN81A==", "dev": true }, + "uWebSockets.js": { + "version": "github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c", + "from": "github:uNetworking/uWebSockets.js#v18.4.0", + "dev": true + }, "uglify-js": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", @@ -3900,9 +3838,9 @@ "dev": true }, "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", "dev": true }, "unpipe": { @@ -3927,22 +3865,6 @@ "object.getownpropertydescriptors": "^2.1.0" } }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -3988,8 +3910,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "xtend": { "version": "2.1.2", @@ -4004,16 +3925,6 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, "ylru": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.2.1.tgz", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 393e088e5e..efd752c666 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -52,20 +52,42 @@ "@ganache/promise-queue": "^0.1.0", "@ganache/utils": "^0.1.0", "@types/keccak": "3.0.1", + "bip39": "3.0.2", + "emittery": "0.7.2", "eth-sig-util": "2.5.3", "ethereumjs-abi": "0.6.8", + "ethereumjs-account": "3.0.0", + "ethereumjs-block": "2.2.2", + "ethereumjs-common": "1.5.2", + "ethereumjs-tx": "2.1.2", "ethereumjs-vm": "4.2.0", + "ethereumjs-util": "7.0.7", + "hdkey": "2.0.1", "keccak": "3.0.0", + "leveldown": "5.6.0", "levelup": "4.4.0", + "lodash.clonedeep": "4.5.0", "merkle-patricia-tree": "3.0.0", - "scrypt-js": "3.0.1" + "scrypt-js": "3.0.1", + "secp256k1": "4.0.2", + "seedrandom": "3.0.5", + "subleveldown": "5.0.1", + "tmp-promise": "3.0.2" }, "devDependencies": { "@trufflesuite/typedoc-default-themes": "0.6.1", + "@types/fs-extra": "9.0.2", + "@types/lodash.clonedeep": "4.5.6", + "@types/secp256k1": "4.0.1", + "@types/seedrandom": "2.4.28", + "@types/uws": "0.13.2", + "@types/ws": "7.2.7", "cheerio": "1.0.0-rc.3", + "fs-extra": "9.0.1", "local-web-server": "4.2.1", - "open-cli": "6.0.1", + "solc": "0.7.4", "ts-transformer-inline-file": "0.1.1", - "typedoc": "0.17.8" + "typedoc": "0.17.8", + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0" } } diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 92e5be0164..18a668ee90 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1283,12 +1283,16 @@ export default class EthereumApi implements types.Api { } const messageHash = hashPersonalMessage(Data.from(message).toBuffer()); - const signature = ecsign(messageHash, privateKey.toBuffer()); + const signature = ecsign( + messageHash, + privateKey.toBuffer(), + this.#options.chain.chainId + ); return toRpcSig( signature.v, signature.r, signature.s, - +this.#options.chain.chainId + this.#options.chain.chainId ); } diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/src/wallet.ts index 23033f3abd..64d5f1106d 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/src/wallet.ts @@ -88,7 +88,7 @@ export default class Wallet { readonly knownAccounts = new Set(); readonly encryptedKeyFiles = new Map(); readonly unlockedAccounts = new Map(); - readonly lockTimers = new Map(); + readonly lockTimers = new Map(); #hdKey: HDKey; @@ -397,7 +397,7 @@ export default class Wallet { const existingTimer = this.lockTimers.get(lowerAddress); if (existingTimer) { - clearTimeout(existingTimer as number); + clearTimeout(existingTimer); } // a duration <= 0 will remain unlocked @@ -405,7 +405,7 @@ export default class Wallet { if (durationMs > 0) { const timeout = setTimeout(this.#lockAccount, durationMs, lowerAddress); utils.unref(timeout); - this.lockTimers.set(lowerAddress, timeout); + this.lockTimers.set(lowerAddress, timeout as any); } this.unlockedAccounts.set(lowerAddress, Data.from(secretKey)); @@ -428,7 +428,7 @@ export default class Wallet { if (durationMs > 0) { const timeout = setTimeout(this.#lockAccount, durationMs, lowerAddress); utils.unref(timeout); - this.lockTimers.set(lowerAddress, timeout); + this.lockTimers.set(lowerAddress, timeout as any); } // otherwise, unlock it! @@ -445,7 +445,7 @@ export default class Wallet { public lockAccount(lowerAddress: string) { if (!this.unlockedAccounts.has(lowerAddress)) return false; - clearTimeout(this.lockTimers.get(lowerAddress) as number); + clearTimeout(this.lockTimers.get(lowerAddress)); return this.#lockAccount(lowerAddress); } } diff --git a/src/chains/tezos/npm-shrinkwrap.json b/src/chains/tezos/npm-shrinkwrap.json index 9e3af356ce..8228513ad0 100644 --- a/src/chains/tezos/npm-shrinkwrap.json +++ b/src/chains/tezos/npm-shrinkwrap.json @@ -471,6 +471,11 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, + "emittery": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", + "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==" + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -1832,6 +1837,11 @@ "integrity": "sha512-+g3NEp7fJLe9DPa1TArHm9QAA7YciZmWnfAqEaFrBihQ7epOv9i99rjtgb6Iz0wh3WuQDjsCTDfgRoGnmHN81A==", "dev": true }, + "uWebSockets.js": { + "version": "github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c", + "from": "github:uNetworking/uWebSockets.js#v18.4.0", + "dev": true + }, "uglify-js": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.0.tgz", diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index 56a05a20d9..e5163246ca 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -41,12 +41,14 @@ ], "dependencies": { "@ganache/options": "^0.1.0", - "@ganache/utils": "^0.1.0" + "@ganache/utils": "^0.1.0", + "emittery": "0.7.2" }, "devDependencies": { "@trufflesuite/typedoc-default-themes": "0.6.1", "cheerio": "1.0.0-rc.3", "local-web-server": "4.2.1", - "typedoc": "0.17.8" + "typedoc": "0.17.8", + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0" } } diff --git a/src/packages/core/npm-shrinkwrap.json b/src/packages/core/npm-shrinkwrap.json index bf6c57f431..30de3ba9f9 100644 --- a/src/packages/core/npm-shrinkwrap.json +++ b/src/packages/core/npm-shrinkwrap.json @@ -1,5 +1,223 @@ { "name": "@ganache/core", - "version": "2.2.1", - "lockfileVersion": 1 + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", + "dev": true + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/node": { + "version": "14.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", + "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==", + "dev": true + }, + "@types/superagent": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.10.tgz", + "integrity": "sha512-xAgkb2CMWUMCyVc/3+7iQfOEBE75NvuZeezvmixbUw3nmENf2tCnQkW5yQLTYqvXUQ+R6EXxdqKKbal2zM5V/g==", + "dev": true, + "requires": { + "@types/cookiejar": "*", + "@types/node": "*" + } + }, + "@types/uws": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", + "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/node": "*" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true + }, + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "fast-safe-stringify": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", + "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", + "dev": true + }, + "form-data": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", + "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "formidable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", + "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==", + "dev": true + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "mime": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==", + "dev": true + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "dev": true + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "superagent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", + "integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==", + "dev": true, + "requires": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.2", + "debug": "^4.1.1", + "fast-safe-stringify": "^2.0.7", + "form-data": "^3.0.0", + "formidable": "^1.2.2", + "methods": "^1.1.2", + "mime": "^2.4.6", + "qs": "^6.9.4", + "readable-stream": "^3.6.0", + "semver": "^7.3.2" + } + }, + "uWebSockets.js": { + "version": "github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c", + "from": "github:uNetworking/uWebSockets.js#v18.4.0" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "ws": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", + "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", + "dev": true + } + } } diff --git a/src/packages/core/package.json b/src/packages/core/package.json index cfcbdbe90f..dc593b6131 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -46,10 +46,17 @@ "tooling" ], "dependencies": { - "@ganache/options": "^0.1.0", - "@ganache/flavors": "^0.1.0", + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0", "@ganache/ethereum": "^0.1.0", + "@ganache/flavors": "^0.1.0", + "@ganache/options": "^0.1.0", "@ganache/tezos": "^0.1.0", "@ganache/utils": "^0.1.0" + }, + "devDependencies": { + "@types/superagent": "4.1.10", + "@types/uws": "0.13.2", + "superagent": "6.1.0", + "ws": "7.3.1" } } diff --git a/src/packages/ganache/npm-shrinkwrap.json b/src/packages/ganache/npm-shrinkwrap.json index a47c7d2d47..6ca8cc3a0f 100644 --- a/src/packages/ganache/npm-shrinkwrap.json +++ b/src/packages/ganache/npm-shrinkwrap.json @@ -244,6 +244,31 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + }, + "dependencies": { + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + } + } + }, "acorn": { "version": "8.0.4", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz", @@ -283,12 +308,170 @@ "color-convert": "^1.9.0" } }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "array-back": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz", "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", "dev": true }, + "array-filter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", + "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", + "dev": true + }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "assert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz", + "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==", + "dev": true, + "requires": { + "es6-object-assign": "^1.1.0", + "is-nan": "^1.2.1", + "object-is": "^1.0.1", + "util": "^0.12.0" + } + }, + "available-typed-arrays": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", + "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", + "dev": true, + "requires": { + "array-filter": "^1.0.0" + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "dev": true + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, "browserslist": { "version": "4.14.6", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.6.tgz", @@ -301,12 +484,38 @@ "node-releases": "^1.1.65" } }, + "buffer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.1.tgz", + "integrity": "sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, "caniuse-lite": { "version": "1.0.30001154", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001154.tgz", @@ -350,6 +559,16 @@ "tslib": "^1.9.0" } }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -389,6 +608,57 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "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=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -400,18 +670,110 @@ "which": "^2.0.1" } }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, "electron-to-chromium": { "version": "1.3.588", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.588.tgz", "integrity": "sha512-0zr+ZfytnLeJZxGgmEpPTcItu5Mm4A5zHPZXLfHcGp0mdsk95rmD7ePNewYtK1yIdLbk8Z1U2oTRRfOtR4gbYg==", "dev": true }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -446,6 +808,52 @@ "integrity": "sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==", "dev": true }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es6-object-assign": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", + "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=", + "dev": true + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -497,6 +905,16 @@ "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", "dev": true }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, "execa": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", @@ -526,6 +944,15 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -536,12 +963,29 @@ "path-exists": "^4.0.0" } }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "get-intrinsic": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", + "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -578,12 +1022,62 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, + "immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", + "dev": true + }, "import-local": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", @@ -594,12 +1088,30 @@ "resolve-cwd": "^3.0.0" } }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, "interpret": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, "is-core-module": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz", @@ -609,12 +1121,102 @@ "has": "^1.0.3" } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==", + "dev": true + }, + "is-nan": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.0.tgz", + "integrity": "sha512-z7bbREymOqt2CCaZVly8aC4ML3Xhfi0ekuOnjO2L8vKdl+CttdVoGZQhd4adMFAsxQ5VeRVwORs4tU8RH+HFtQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-typed-array": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.3.tgz", + "integrity": "sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.0", + "es-abstract": "^1.17.4", + "foreach": "^2.0.5", + "has-symbols": "^1.0.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -644,6 +1246,54 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==", + "dev": true + }, + "level-js": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/level-js/-/level-js-5.0.2.tgz", + "integrity": "sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg==", + "dev": true, + "requires": { + "abstract-leveldown": "~6.2.3", + "buffer": "^5.5.0", + "inherits": "^2.0.3", + "ltgt": "^2.1.2" + }, + "dependencies": { + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + } + } + }, + "level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "dev": true, + "requires": { + "xtend": "^4.0.2" + } + }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -656,6 +1306,17 @@ "integrity": "sha512-oR4lB4WvwFoC70ocraKhn5nkKSs23t57h9udUgw8o0iH8hMXeEoRuUgfcvgUwAJ1ZpRqBvcou4N2SMvM1DwMrA==", "dev": true }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -671,12 +1332,105 @@ "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=", + "dev": true + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", @@ -698,12 +1452,40 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "node-loader": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/node-loader/-/node-loader-1.0.2.tgz", + "integrity": "sha512-myxAxpyMR7knjA4Uzwf3gjxaMtxSWj2vpm9o6AYWWxQ1S3XMBNeG2vzYcp/5eW03cBGfgSxyP+wntP8qhBJNhQ==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + } + }, "node-releases": { "version": "1.1.65", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.65.tgz", @@ -719,6 +1501,40 @@ "path-key": "^3.0.0" } }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true + }, + "object-is": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.3.tgz", + "integrity": "sha512-teyqLvFWzLkq5B9ki8FVWA902UER2qkxmdA4nLf+wjOLAWgxzCWZNCxpDq9MvE8MmhWNr+I8w3BN49Vx36Y6Xg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -737,6 +1553,12 @@ "mimic-fn": "^2.1.0" } }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -761,6 +1583,25 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -779,6 +1620,25 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -788,6 +1648,46 @@ "find-up": "^4.0.0" } }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + } + } + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -813,6 +1713,27 @@ "safe-buffer": "^5.1.0" } }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "rechoir": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", @@ -853,12 +1774,28 @@ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "schema-utils": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", @@ -870,6 +1807,12 @@ "ajv-keywords": "^3.5.2" } }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, "serialize-javascript": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", @@ -879,6 +1822,16 @@ "randombytes": "^2.1.0" } }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -922,6 +1875,45 @@ "source-map": "^0.6.0" } }, + "stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dev": true, + "requires": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz", + "integrity": "sha512-8oAG/hi14Z4nOVP0z6mdiVZ/wqjDtWSLygMigTzAb+7aPEDTleeFf+WrF+alzecxIRkckkJVn+dTlwzJXORATw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } + }, + "string.prototype.trimstart": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.2.tgz", + "integrity": "sha512-7F6CdBTl5zyu30BJFdzSTlSlLPwODC23Od+iLoVH8X6+3fvDPPuBVVj9iaB1GOsSTSIgVfsfm27R2FGrAPznWg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -999,12 +1991,107 @@ } } }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "ts-loader": { + "version": "8.0.7", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.7.tgz", + "integrity": "sha512-ooa4wxlZ9TOXaJ/iVyZlWsim79Ul4KyifSwyT2hOrbQA6NZJypsLOE198o8Ko+JV+ZHnMArvWcl4AnRqpCU/Mw==", + "dev": true, + "requires": { + "chalk": "^2.3.0", + "enhanced-resolve": "^4.0.0", + "loader-utils": "^1.0.2", + "micromatch": "^4.0.0", + "semver": "^6.0.0" + }, + "dependencies": { + "enhanced-resolve": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz", + "integrity": "sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + } + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true + } + } + }, + "ts-node": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", + "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", + "dev": true, + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + } + }, + "ts-transformer-inline-file": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ts-transformer-inline-file/-/ts-transformer-inline-file-0.1.1.tgz", + "integrity": "sha512-2bPkAFjATsRG4ld8TFTUqn4TvEdXLQf/wwGsepFeRKSXLPqFRhdUHusAGPB1/Zif3CVjppD+bfne58gynd8RfQ==", + "dev": true + }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "ttypescript": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.12.tgz", + "integrity": "sha512-1ojRyJvpnmgN9kIHmUnQPlEV1gq+VVsxVYjk/NfvMlHSmYxjK5hEvOOU2MQASrbekTUiUM7pR/nXeCc8bzvMOQ==", + "dev": true, + "requires": { + "resolve": ">=1.9.0" + } + }, + "typescript": { + "version": "4.1.1-rc", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.1-rc.tgz", + "integrity": "sha512-tgNcFrLIjlaMWEc7bKC0bxLNIt8BIAauY/HLUOQDyTP75HGskETtXOt46x4EKAHRKhWVLMc7yM02puTHa/yhCA==", + "dev": true + }, "typical": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", @@ -1020,6 +2107,26 @@ "punycode": "^2.1.0" } }, + "util": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz", + "integrity": "sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "safe-buffer": "^5.1.2", + "which-typed-array": "^1.1.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, "v8-compile-cache": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", @@ -1125,6 +2232,41 @@ "isexe": "^2.0.0" } }, + "which-typed-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.2.tgz", + "integrity": "sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.2", + "es-abstract": "^1.17.5", + "foreach": "^2.0.5", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.1", + "is-typed-array": "^1.1.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } + } + }, "wordwrapjs": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", @@ -1140,6 +2282,18 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true } } } diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index 5b6bd83979..912b605878 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -21,10 +21,10 @@ "directory": "src/packages/ganache" }, "scripts": { + "build": "webpack", "tsc": "ttsc", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'", - "prepare": "webpack" + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" @@ -45,8 +45,25 @@ ], "devDependencies": { "@ganache/core": "^0.1.0", + "@ganache/flavors": "^0.1.0", + "@types/node": "14.14.6", + "assert": "2.0.0", + "buffer": "6.0.1", + "crypto-browserify": "3.12.0", + "events": "3.2.0", + "level-js": "5.0.2", + "node-loader": "1.0.2", + "os-browserify": "0.3.0", + "path-browserify": "1.0.1", + "process": "0.11.10", + "stream-browserify": "3.0.0", + "ts-loader": "8.0.7", + "ts-node": "9.0.0", + "ts-transformer-inline-file": "0.1.1", + "ttypescript": "1.5.12", + "typescript": "4.1.1-rc", + "util": "0.12.3", "webpack": "5.4.0", - "webpack-cli": "4.2.0", - "@ganache/flavors": "^0.1.0" + "webpack-cli": "4.2.0" } } diff --git a/src/packages/ganache/webpack/polyfills/browser-tmp-promise.ts b/src/packages/ganache/webpack/polyfills/browser-tmp-promise.ts index 5bae4efb49..5e35d343b0 100644 --- a/src/packages/ganache/webpack/polyfills/browser-tmp-promise.ts +++ b/src/packages/ganache/webpack/polyfills/browser-tmp-promise.ts @@ -1,3 +1,5 @@ +declare const indexedDB: any; + import { resolve, isAbsolute, basename, join, relative } from "path"; import { randomBytes, pseudoRandomBytes } from "crypto"; diff --git a/src/packages/ganache/webpack/webpack.browser.config.ts b/src/packages/ganache/webpack/webpack.browser.config.ts index b83b63a0a5..ac8ae380e2 100644 --- a/src/packages/ganache/webpack/webpack.browser.config.ts +++ b/src/packages/ganache/webpack/webpack.browser.config.ts @@ -14,6 +14,9 @@ const config: webpack.Configuration = merge({}, base, { assert: require.resolve("assert/"), stream: require.resolve("stream-browserify/"), os: require.resolve("os-browserify/browser"), + process: require.resolve("process/browser"), + events: require.resolve("events/"), + buffer: require.resolve("buffer/"), fs: false //#endregion node polyfills }, diff --git a/src/packages/ganache/webpack/webpack.common.config.ts b/src/packages/ganache/webpack/webpack.common.config.ts index 8391514008..188e9a08d6 100644 --- a/src/packages/ganache/webpack/webpack.common.config.ts +++ b/src/packages/ganache/webpack/webpack.common.config.ts @@ -12,7 +12,6 @@ const base: webpack.Configuration = { test: /\.tsx?$/, use: [ { - // webpack typescript modules loader: "ts-loader", options: { getCustomTransformers: program => ({ @@ -29,10 +28,13 @@ const base: webpack.Configuration = { extensions: [".tsx", ".ts", ".js"] }, output: { - libraryTarget: "umd", filename: "ganache.min.js", library: "Ganache", - libraryExport: "default" + libraryExport: "default", + libraryTarget: "umd" + }, + stats: { + colors: true } }; diff --git a/src/packages/ganache/webpack/webpack.node.config.ts b/src/packages/ganache/webpack/webpack.node.config.ts index 61ab5dd6c1..f6282b2fc9 100644 --- a/src/packages/ganache/webpack/webpack.node.config.ts +++ b/src/packages/ganache/webpack/webpack.node.config.ts @@ -4,7 +4,7 @@ import path from "path"; import merge from "webpack-merge"; const config: webpack.Configuration = merge({}, base, { - target: "node", + target: "node10.7", output: { path: path.resolve(__dirname, "../", "dist", "node") }, diff --git a/src/packages/options/npm-shrinkwrap.json b/src/packages/options/npm-shrinkwrap.json index a70bfbbfd6..f19b0af9a9 100644 --- a/src/packages/options/npm-shrinkwrap.json +++ b/src/packages/options/npm-shrinkwrap.json @@ -1 +1,160 @@ -{"name":"@ganache/options","version":"2.2.1","lockfileVersion":1} +{ + "name": "@ganache/options", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" + }, + "@types/seedrandom": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@types/seedrandom/-/seedrandom-2.4.28.tgz", + "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", + "dev": true + }, + "bip39": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", + "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", + "requires": { + "@types/node": "11.11.6", + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + } + } +} diff --git a/src/packages/options/package.json b/src/packages/options/package.json index 8b823cee2d..136044dc20 100644 --- a/src/packages/options/package.json +++ b/src/packages/options/package.json @@ -40,6 +40,11 @@ "tooling" ], "dependencies": { - "@ganache/utils": "^0.1.0" + "@ganache/utils": "^0.1.0", + "bip39": "3.0.2", + "seedrandom": "3.0.5" + }, + "devDependencies": { + "@types/seedrandom": "2.4.28" } } diff --git a/src/packages/promise-queue/package-lock.json b/src/packages/promise-queue/package-lock.json new file mode 100644 index 0000000000..3659c2db06 --- /dev/null +++ b/src/packages/promise-queue/package-lock.json @@ -0,0 +1,19 @@ +{ + "name": "@ganache/promise-queue", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "emittery": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", + "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==" + }, + "ts-transformer-inline-file": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ts-transformer-inline-file/-/ts-transformer-inline-file-0.1.1.tgz", + "integrity": "sha512-2bPkAFjATsRG4ld8TFTUqn4TvEdXLQf/wwGsepFeRKSXLPqFRhdUHusAGPB1/Zif3CVjppD+bfne58gynd8RfQ==", + "dev": true + } + } +} diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index 2a8b7f9ddf..f2af709390 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -40,5 +40,11 @@ "fe", "web3", "tooling" - ] + ], + "dependencies": { + "emittery": "0.7.2" + }, + "devDependencies": { + "ts-transformer-inline-file": "0.1.1" + } } diff --git a/src/packages/utils/npm-shrinkwrap.json b/src/packages/utils/npm-shrinkwrap.json index 64fd593d48..5499a0fbaa 100644 --- a/src/packages/utils/npm-shrinkwrap.json +++ b/src/packages/utils/npm-shrinkwrap.json @@ -1,5 +1,42 @@ { "name": "@ganache/utils", - "version": "2.2.1", - "lockfileVersion": 1 + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "bigint-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", + "optional": true, + "requires": { + "bindings": "^1.3.0" + } + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "emittery": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", + "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==" + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, + "uWebSockets.js": { + "version": "github:uNetworking/uWebSockets.js#3dbec7b56d627193e20705844b6bd10e49848b8c", + "from": "github:uNetworking/uWebSockets.js#v18.4.0", + "dev": true + } + } } diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index 9e0b36274f..23a0f6fa78 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -42,5 +42,14 @@ "fe", "web3", "tooling" - ] + ], + "dependencies": { + "emittery": "^0.7.2" + }, + "devDependencies": { + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0" + }, + "optionalDependencies": { + "bigint-buffer": "1.1.5" + } } From 38df445ddac066edc565674bcc20e0222d22dc1d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 5 Nov 2020 17:14:21 -0500 Subject: [PATCH 676/691] Update dependency: typescript@4.1.0-beta MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit typescript * ganache: ^4.1.0-beta → 4.1.0-beta --- src/packages/ganache/npm-shrinkwrap.json | 6 +++--- src/packages/ganache/package.json | 2 +- src/packages/utils/package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/packages/ganache/npm-shrinkwrap.json b/src/packages/ganache/npm-shrinkwrap.json index 6ca8cc3a0f..56f6bc1727 100644 --- a/src/packages/ganache/npm-shrinkwrap.json +++ b/src/packages/ganache/npm-shrinkwrap.json @@ -2087,9 +2087,9 @@ } }, "typescript": { - "version": "4.1.1-rc", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.1-rc.tgz", - "integrity": "sha512-tgNcFrLIjlaMWEc7bKC0bxLNIt8BIAauY/HLUOQDyTP75HGskETtXOt46x4EKAHRKhWVLMc7yM02puTHa/yhCA==", + "version": "4.1.0-beta", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.0-beta.tgz", + "integrity": "sha512-b/LAttdVl3G6FEmnMkDsK0xvfvaftXpSKrjXn+OVCRqrwz5WD/6QJOiN+dTorqDY+hkaH+r2gP5wI1jBDmdQ7A==", "dev": true }, "typical": { diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index 912b605878..82ce13da5b 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -61,7 +61,7 @@ "ts-node": "9.0.0", "ts-transformer-inline-file": "0.1.1", "ttypescript": "1.5.12", - "typescript": "4.1.1-rc", + "typescript": "^4.1.0-beta", "util": "0.12.3", "webpack": "5.4.0", "webpack-cli": "4.2.0" diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index 23a0f6fa78..228d70643b 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -44,7 +44,7 @@ "tooling" ], "dependencies": { - "emittery": "^0.7.2" + "emittery": "0.7.2" }, "devDependencies": { "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0" From 2c222d15967b1cde9cf67fd3f405cd78ed1a8d1c Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 5 Nov 2020 17:26:33 -0500 Subject: [PATCH 677/691] sync ts versions --- src/packages/ganache/npm-shrinkwrap.json | 6 +++--- src/packages/ganache/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/ganache/npm-shrinkwrap.json b/src/packages/ganache/npm-shrinkwrap.json index 56f6bc1727..6ca8cc3a0f 100644 --- a/src/packages/ganache/npm-shrinkwrap.json +++ b/src/packages/ganache/npm-shrinkwrap.json @@ -2087,9 +2087,9 @@ } }, "typescript": { - "version": "4.1.0-beta", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.0-beta.tgz", - "integrity": "sha512-b/LAttdVl3G6FEmnMkDsK0xvfvaftXpSKrjXn+OVCRqrwz5WD/6QJOiN+dTorqDY+hkaH+r2gP5wI1jBDmdQ7A==", + "version": "4.1.1-rc", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.1-rc.tgz", + "integrity": "sha512-tgNcFrLIjlaMWEc7bKC0bxLNIt8BIAauY/HLUOQDyTP75HGskETtXOt46x4EKAHRKhWVLMc7yM02puTHa/yhCA==", "dev": true }, "typical": { diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index 82ce13da5b..912b605878 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -61,7 +61,7 @@ "ts-node": "9.0.0", "ts-transformer-inline-file": "0.1.1", "ttypescript": "1.5.12", - "typescript": "^4.1.0-beta", + "typescript": "4.1.1-rc", "util": "0.12.3", "webpack": "5.4.0", "webpack-cli": "4.2.0" From 091734d37ed26f86e8057329c02325c36d309913 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 6 Nov 2020 16:28:48 -0500 Subject: [PATCH 678/691] addd new package for inline type literals as runtime values --- .../ts-transformer-type-const/.gitignore | 1 + .../ts-transformer-type-const/.npmignore | 8 ++ .../ts-transformer-type-const/LICENSE | 21 +++++ .../ts-transformer-type-const/README.md | 45 ++++++++++ .../ts-transformer-type-const/index.d.ts | 1 + .../ts-transformer-type-const/index.js | 0 .../npm-shrinkwrap.json | 1 + .../ts-transformer-type-const/package.json | 43 ++++++++++ .../ts-transformer-type-const/transformer.ts | 83 +++++++++++++++++++ .../ts-transformer-type-const/tsconfig.json | 13 +++ 10 files changed, 216 insertions(+) create mode 100644 src/packages/ts-transformer-type-const/.gitignore create mode 100644 src/packages/ts-transformer-type-const/.npmignore create mode 100644 src/packages/ts-transformer-type-const/LICENSE create mode 100644 src/packages/ts-transformer-type-const/README.md create mode 100644 src/packages/ts-transformer-type-const/index.d.ts create mode 100644 src/packages/ts-transformer-type-const/index.js create mode 100644 src/packages/ts-transformer-type-const/npm-shrinkwrap.json create mode 100644 src/packages/ts-transformer-type-const/package.json create mode 100644 src/packages/ts-transformer-type-const/transformer.ts create mode 100644 src/packages/ts-transformer-type-const/tsconfig.json diff --git a/src/packages/ts-transformer-type-const/.gitignore b/src/packages/ts-transformer-type-const/.gitignore new file mode 100644 index 0000000000..9c329094b5 --- /dev/null +++ b/src/packages/ts-transformer-type-const/.gitignore @@ -0,0 +1 @@ +transformer.js \ No newline at end of file diff --git a/src/packages/ts-transformer-type-const/.npmignore b/src/packages/ts-transformer-type-const/.npmignore new file mode 100644 index 0000000000..b1e1059b5c --- /dev/null +++ b/src/packages/ts-transformer-type-const/.npmignore @@ -0,0 +1,8 @@ +./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/packages/ts-transformer-type-const/LICENSE b/src/packages/ts-transformer-type-const/LICENSE new file mode 100644 index 0000000000..39f3b14498 --- /dev/null +++ b/src/packages/ts-transformer-type-const/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/packages/ts-transformer-type-const/README.md b/src/packages/ts-transformer-type-const/README.md new file mode 100644 index 0000000000..2f1595aa45 --- /dev/null +++ b/src/packages/ts-transformer-type-const/README.md @@ -0,0 +1,45 @@ +# `@ganache/ts-transformer-type-const` + +A TypeScript custom transformer to inline literal types as JS runtime values + +# Requirement + +TypeScript >= 3.2.0 + +# How to use this package + +This package exports 2 functions. +One is `constToValue` which is used in TypeScript codes to obtain the value of given type, while the other is a TypeScript custom transformer which is used to compile the `constToValue` function correctly. + +## How to use `constToValue` + +```ts +import { constToValue } from "@ganache/ts-transformer-type-const"; + +type myType = "some value"; +const myValue = constToValue(); + +console.log(myValue); // "some value" +``` + +## How to use the custom transformer + +Unfortunately, TypeScript itself does not currently provide any easy way to use custom transformers (See https://github.com/Microsoft/TypeScript/issues/14419). + +### ttypescript + +See [examples/ttypescript](examples/ttypescript) for detail. +See [ttypescript's README](https://github.com/cevek/ttypescript/blob/master/README.md) for how to use this with module bundlers such as webpack or Rollup. + +```json +// tsconfig.json +{ + "compilerOptions": { + // ... + "plugins": [ + { "transform": "@ganache/ts-transformer-type-const/transformer" } + ] + } + // ... +} +``` diff --git a/src/packages/ts-transformer-type-const/index.d.ts b/src/packages/ts-transformer-type-const/index.d.ts new file mode 100644 index 0000000000..af8928394d --- /dev/null +++ b/src/packages/ts-transformer-type-const/index.d.ts @@ -0,0 +1 @@ +export function constToValue(): T; diff --git a/src/packages/ts-transformer-type-const/index.js b/src/packages/ts-transformer-type-const/index.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/packages/ts-transformer-type-const/npm-shrinkwrap.json b/src/packages/ts-transformer-type-const/npm-shrinkwrap.json new file mode 100644 index 0000000000..af75c09dfb --- /dev/null +++ b/src/packages/ts-transformer-type-const/npm-shrinkwrap.json @@ -0,0 +1 @@ +{"name":"@ganache/ts-transformer-type-const","version":"0.1.0","lockfileVersion":1} diff --git a/src/packages/ts-transformer-type-const/package.json b/src/packages/ts-transformer-type-const/package.json new file mode 100644 index 0000000000..c4640ae11c --- /dev/null +++ b/src/packages/ts-transformer-type-const/package.json @@ -0,0 +1,43 @@ +{ + "name": "@ganache/ts-transformer-type-const", + "version": "0.1.0", + "description": "A TypeScript custom transformer to literal types as JS runtime values", + "author": "David Murdoch", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/ts-transformer-type-const#readme", + "license": "MIT", + "files": [ + "index.js", + "index.d.ts", + "transformer.js", + "transformer.ts" + ], + "repository": { + "type": "git", + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/packages/ts-transformer-type-const" + }, + "scripts": { + "tsc": "ttsc" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "keywords": [ + "ganache", + "ganache-ts-transformer-type-const", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling", + "truffle" + ], + "peerDependencies": { + "typescript": ">=3.2.0" + } +} diff --git a/src/packages/ts-transformer-type-const/transformer.ts b/src/packages/ts-transformer-type-const/transformer.ts new file mode 100644 index 0000000000..46452689d7 --- /dev/null +++ b/src/packages/ts-transformer-type-const/transformer.ts @@ -0,0 +1,83 @@ +import ts from "typescript"; +import path from "path"; + +export default function transformer( + program: ts.Program +): ts.TransformerFactory { + return (context: ts.TransformationContext) => (file: ts.SourceFile) => + visitNodeAndChildren(file, program, context); +} + +function visitNodeAndChildren( + node: ts.SourceFile, + program: ts.Program, + context: ts.TransformationContext +): ts.SourceFile; +function visitNodeAndChildren( + node: ts.Node, + program: ts.Program, + context: ts.TransformationContext +): ts.Node | undefined; +function visitNodeAndChildren( + node: ts.Node, + program: ts.Program, + context: ts.TransformationContext +): ts.Node | undefined { + return ts.visitEachChild( + visitNode(node, program), + childNode => visitNodeAndChildren(childNode, program, context), + context + ); +} + +function visitNode(node: ts.SourceFile, program: ts.Program): ts.SourceFile; +function visitNode(node: ts.Node, program: ts.Program): ts.Node | undefined; +function visitNode(node: ts.Node, program: ts.Program): ts.Node | undefined { + const typeChecker = program.getTypeChecker(); + if (isTypeConstImportExpression(node)) { + return; + } + if (!isTypeConstCallExpression(node, typeChecker)) { + return node; + } + if (!node.typeArguments) { + return ts.createNull(); + } + const type = typeChecker.getTypeFromTypeNode(node.typeArguments[0]); + if (!type.isLiteral()) { + return ts.createNull(); + } + return ts.createLiteral(type.value); +} + +const indexJs = path.join(__dirname, "index.js"); +function isTypeConstImportExpression( + node: ts.Node +): node is ts.ImportDeclaration { + if (!ts.isImportDeclaration(node)) { + return false; + } + const module = (node.moduleSpecifier as ts.StringLiteral).text; + return module === "@ganache/ts-transformer-type-const"; +} + +const indexTs = path.join(__dirname, "index.d.ts"); +function isTypeConstCallExpression( + node: ts.Node, + typeChecker: ts.TypeChecker +): node is ts.CallExpression { + if (!ts.isCallExpression(node)) { + return false; + } + const signature = typeChecker.getResolvedSignature(node); + if (typeof signature === "undefined") { + return false; + } + const { declaration } = signature; + return ( + !!declaration && + !ts.isJSDocSignature(declaration) && + require.resolve(declaration.getSourceFile().fileName) === indexTs && + declaration.name?.getText() === "constToValue" + ); +} diff --git a/src/packages/ts-transformer-type-const/tsconfig.json b/src/packages/ts-transformer-type-const/tsconfig.json new file mode 100644 index 0000000000..5a493bcf8f --- /dev/null +++ b/src/packages/ts-transformer-type-const/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "strict": true, + "noEmitOnError": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "esModuleInterop": true + }, + "include": ["transformer.ts"], + "exclude": ["node_modules"] +} From 771f85f46a6b4b53e304a454b132901384329f55 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Fri, 6 Nov 2020 16:29:02 -0500 Subject: [PATCH 679/691] delete old options files --- src/packages/options/src/old/options.ts.old | 257 ------------------ .../options/src/old/provider-options.ts.old | 67 ----- .../options/src/provider-options.ts.old | 3 - 3 files changed, 327 deletions(-) delete mode 100644 src/packages/options/src/old/options.ts.old delete mode 100644 src/packages/options/src/old/provider-options.ts.old delete mode 100644 src/packages/options/src/provider-options.ts.old diff --git a/src/packages/options/src/old/options.ts.old b/src/packages/options/src/old/options.ts.old deleted file mode 100644 index ab0162a7a4..0000000000 --- a/src/packages/options/src/old/options.ts.old +++ /dev/null @@ -1,257 +0,0 @@ -import {Quantity} from "@ganache/utils"; - -interface Logger { - log(message?: any, ...optionalParams: any[]): void; -} - -// Okay, so a "bug" in TS treats types with the same shape as having the same -// name, so Intellisense would say that AccountType requires `[Address, Address]` -// instead of `[Address, PrivateKey]`, flip flopping like this "fixes" it. -type Account = {balance: string; secretKey?: string}; - -export interface Options { - /** - * Array of Accounts. Each object should have a balance key with a hexadecimal - * value. The key secretKey can also be specified, which represents the - * account's private key. If no secretKey, the address is auto-generated with - * the given balance. If specified, the key is used to determine the account's - * address. - */ - accounts?: Account[]; - - /** - * Output VM opcodes for debugging. Defaults to `false` - */ - debug?: boolean; - - /** - * Specify blockTime in seconds for automatic mining. If you don't specify - * this flag, ganache will instantly mine a new block for every transaction. - * Using the blockTime option is discouraged unless you have tests which - * require a specific mining interval. - */ - blockTime?: number; - - /** - * An object, like console, that implements a log() function. - */ - logger?: Logger; - - /** - * Use a specific HD wallet mnemonic to generate initial addresses. - */ - mnemonic?: string; - - /** - * Use arbitrary data to generate the HD wallet mnemonic to be used. - */ - seed?: string; - - /** - * The default account balance, specified in ether. Defaults to `100` ether - */ - default_balance_ether?: bigint; - - /** - * Number of accounts to generate at startup. Default to `10`. - */ - total_accounts?: number; - - /** - * When a string, same as --fork option above. Can also be a Web3 Provider - * object, optionally used in conjunction with the fork_block_number - */ - fork?: string | object; - - /** - * Block number the provider should fork from, when the fork option is - * specified. If the fork option is specified as a string including the @ - * sign and a block number, the block number in the fork parameter takes - * precedence. - */ - fork_block_number?: string | bigint; - - /** - * The currently configured chain id, a value used in replay-protected - * transaction signing as introduced by EIP-155. Default's to `1337` - */ - chainId?: number; - - /** - * Alias of `networkId`. - */ - netVersion?: string | number; - - /** - * Alias of `networkId`. - */ - net_version?: string | number; - - /** - * The id of the network returned by the RPC method `net_version`. - * Defaults to the current timestamp (`Date.now()`). - */ - networkId?: number; - - /** - * Alias of `networkId`. - */ - network_id?: string | number; - - /** - * Date that the first block should start. Use this feature, along with the - * `evm_increaseTime` RPC, to test time-dependent code. - */ - time?: Date; - - /** - * Alias of `secure` - */ - locked?: boolean; - - /** - * Lock available accounts by default (good for third party transaction signing). Defaults to `false`. - */ - secure?: boolean; - - /** - * Array of addresses or address indexes specifying which accounts should be unlocked. Alias of unlockedAccounts - */ - unlocked_accounts?: Array; - - /** - * Specify a path to a directory to save the chain database. If a database - * already exists, that chain will be initialized instead of creating a new - * one. - */ - db_path?: string; - - /** - * Specify an alternative database instance, for instance MemDOWN. - */ - db?: object; - - /** - * Whether to report runtime errors from EVM code as RPC errors. - * This is `true` by default to replicate the error reporting behavior of - * previous versions of ganache. - */ - vmErrorsOnRPCResponse?: boolean; - - /** - * The hierarchical deterministic path to use when generating accounts. - * Default: "m/44'/60'/0'/0/" - */ - hdPath?: string; - - /** - * Allows unlimited contract sizes while debugging. By setting this to true, the check within the EVM for contract size limit of 24KB (see EIP-170) is bypassed. Setting this to true will cause ganache-core to behave differently than production environments. (default: false; ONLY set to true during debugging). - */ - allowUnlimitedContractSize?: boolean; - /** - * Sets the default gas price for transactions if not otherwise specified. - * Must be specified as a hex string in wei. Defaults to "0x77359400", or 2 gwei. - */ - gasPrice?: string | number | bigint; - - /** - * Sets the block gas limit. Must be specified as a hex string. Defaults to - * "0x6691b7". - */ - gasLimit?: string | number | bigint; - - defaultTransactionGasLimit?: string | number | bigint; - - /** - * Sets the transaction gas limit for `eth_call` and `eth_estimateGas` calls. Must be specified as a `hex` string. Defaults to `"0x1fffffffffffff"` (`Number.MAX_SAFE_INTEGER`) - */ - callGasLimit?: string | number | bigint; - - /** - * - */ - verbose?: boolean; - - /** - * - */ - asyncRequestProcessing?: boolean; - - hardfork?: "constantinople" | "byzantium" | "petersburg" | "istanbul" | "muirGlacier"; - - legacyInstamine?: boolean; - - /** - * Specifies a file to save accounts and private keys to, for testing. - * - * Can be a filename or file descriptor. - * - * If specifying a filename, the directory path must already exist. - * - * See: https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options - */ - account_keys_path?: string | number; - - /** - * Sets the address where mining rewards will go. - * - * * `{string}` hex-encoded address - * * `{number}` index of the account returned by `eth_getAccounts` - * - * Defaults to `0x0000000000000000000000000000000000000000` - * - */ - coinbase?: string | number; - - /** - * Alias of `coinbase`. - */ - etherbase?: string | number; -}; - -// const getDefault: (options?: Options) => Options = options => { -// const networkId = (options -// ? options.networkId || options.netVersion || options.network_id || options.net_version || Date.now() -// : Date.now() -// ).toString(); -// const chainId = options ? options.chainId || 1337 : 1337; -// const secure = options ? options.secure || options.locked || false : false; -// const coinbase = options ? options.coinbase || options.etherbase || "0x0000000000000000000000000000000000000000" : "0x0000000000000000000000000000000000000000"; -// const callGasLimit = options ? options.callGasLimit ? Quantity.from(options.callGasLimit as any) : Quantity.from(Number.MAX_SAFE_INTEGER) : Quantity.from(Number.MAX_SAFE_INTEGER); -// return Object.assign( -// { -// chainId, -// debug: false, -// logger: {log: () => {}}, -// default_balance_ether: 100n, -// total_accounts: 10n, -// networkId, -// vmErrorsOnRPCResponse: false, -// hdPath: "m/44'/60'/0'/0/", -// allowUnlimitedContractSize: false, -// gasPrice: new Quantity(2000000000), -// gasLimit: new Quantity(6721975), -// defaultTransactionGasLimit: new Quantity(90000), -// callGasLimit, -// verbose: false, -// asyncRequestProcessing: true, -// hardfork: "muirGlacier", -// secure, -// legacyInstamine: false, -// coinbase -// }, -// options -// ); -// } - -type Options = { - -} & EthereumOptions; - -const getDefault: (options?: Options) => Options = options => { - -}; - -export const Options = { - getDefault -}; diff --git a/src/packages/options/src/old/provider-options.ts.old b/src/packages/options/src/old/provider-options.ts.old deleted file mode 100644 index 6d2b3f9cd3..0000000000 --- a/src/packages/options/src/old/provider-options.ts.old +++ /dev/null @@ -1,67 +0,0 @@ -import {Options} from "./options"; -import {entropyToMnemonic} from "bip39"; -import seedrandom, {seedrandom_prng} from "seedrandom"; - -function randomBytes(length: number, rng: () => number) { - const buf = Buffer.allocUnsafe(length); - for (let i = 0; i < length; i++) { - buf[i] = (rng() * 255) | 0; - } - return buf; -} - -const randomAlphaNumericString = (() => { - const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - const alphabetLength = alphabet.length; - return (length: number, rng: () => number) => { - let text = ""; - for (let i = 0; i < length; i++) { - text += alphabet[(rng() * alphabetLength) | 0]; - } - - return text; - }; -})(); - -export interface ProviderOptions extends Options { - /** - * Array of strings to installed subproviders - */ - subProviders?: any[]; - - flavor?: "ethereum" | "tezos"; -} - -const getDefault: (options?: ProviderOptions) => ProviderOptions = options => { - const _options = Object.assign( - { - subProviders: [], - flavor: "ethereum" as "ethereum" | "tezos" - }, - Options.getDefault(options) - ); - - if (!_options.mnemonic) { - let rng: seedrandom_prng; - let seed = _options.seed; - if (!seed) { - // do this so that we can use the same seed on our next run and get the same - // results without explicitly setting a seed up front. - // Use the alea PRNG for its extra speed. - rng = seedrandom.alea as seedrandom_prng; - seed = _options.seed = randomAlphaNumericString(10, rng()); - } else { - // Use the default seedrandom PRNG for ganache-core < 3.0 back-compatibility - rng = seedrandom; - } - // generate a randomized default mnemonic - const _randomBytes = randomBytes(16, rng(seed)); - _options.mnemonic = entropyToMnemonic(_randomBytes); - } - return _options; -}; - - -export const ProviderOptions = { - getDefault -}; diff --git a/src/packages/options/src/provider-options.ts.old b/src/packages/options/src/provider-options.ts.old deleted file mode 100644 index 77dcd42a92..0000000000 --- a/src/packages/options/src/provider-options.ts.old +++ /dev/null @@ -1,3 +0,0 @@ -// import { Options } from "./old/options"; - -// export interface ProviderOptions = Options \ No newline at end of file From 12e12b87a560927278914bcf1f9d98c0982a1293 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 7 Nov 2020 11:31:51 -0500 Subject: [PATCH 680/691] tweak options --- .../ethereum/__tests__/api/web3/web3.test.ts | 3 +- src/chains/ethereum/package.json | 2 +- src/chains/ethereum/src/api.ts | 18 +++- src/chains/ethereum/src/blockchain.ts | 3 +- src/chains/ethereum/src/index.ts | 4 +- src/chains/ethereum/src/miner/miner.ts | 7 +- .../ethereum/src/options/chain-options.ts | 91 ++++++++++++++--- .../ethereum/src/options/database-options.ts | 24 ++++- src/chains/ethereum/src/options/index.ts | 36 +++++++ .../ethereum/src/options/legacy-options.ts | 25 +++++ .../ethereum/src/options/logging-options.ts | 48 ++++++--- .../ethereum/src/options/miner-options.ts | 72 +++++++++++--- .../ethereum/src/options/wallet-options.ts | 97 +++++++++++++++---- src/chains/ethereum/src/provider.ts | 29 +++++- src/packages/core/index.ts | 6 +- .../core/src/@types/uWebsockets.js.ts | 7 ++ src/packages/core/src/connector.ts | 16 +-- src/packages/core/src/index.ts | 2 + .../core/src/options/server-options.ts | 49 +++++++--- src/packages/core/src/server.ts | 26 ++++- src/packages/flavors/src/index.ts | 2 - src/packages/ganache/npm-shrinkwrap.json | 6 -- src/packages/ganache/package.json | 3 +- src/packages/ganache/src/index.ts | 2 +- src/packages/ganache/tsconfig.json | 3 +- src/packages/options/src/helpers/base.ts | 3 + src/packages/options/src/helpers/create.ts | 33 +++---- .../options/src/helpers/definition.ts | 18 +++- src/packages/options/src/helpers/getters.ts | 19 +++- src/packages/options/src/helpers/index.ts | 7 ++ src/packages/options/src/index.ts | 2 - ...{package-lock.json => npm-shrinkwrap.json} | 6 -- src/packages/promise-queue/package.json | 3 - .../ts-transformer-type-const/.gitignore | 1 - .../ts-transformer-type-const/.npmignore | 8 -- .../ts-transformer-type-const/LICENSE | 21 ---- .../ts-transformer-type-const/README.md | 45 --------- .../ts-transformer-type-const/index.d.ts | 1 - .../ts-transformer-type-const/index.js | 0 .../npm-shrinkwrap.json | 1 - .../ts-transformer-type-const/package.json | 43 -------- .../ts-transformer-type-const/transformer.ts | 83 ---------------- .../ts-transformer-type-const/tsconfig.json | 13 --- tsconfig.json | 1 - 44 files changed, 519 insertions(+), 370 deletions(-) create mode 100644 src/chains/ethereum/src/options/legacy-options.ts rename src/packages/promise-queue/{package-lock.json => npm-shrinkwrap.json} (54%) delete mode 100644 src/packages/ts-transformer-type-const/.gitignore delete mode 100644 src/packages/ts-transformer-type-const/.npmignore delete mode 100644 src/packages/ts-transformer-type-const/LICENSE delete mode 100644 src/packages/ts-transformer-type-const/README.md delete mode 100644 src/packages/ts-transformer-type-const/index.d.ts delete mode 100644 src/packages/ts-transformer-type-const/index.js delete mode 100644 src/packages/ts-transformer-type-const/npm-shrinkwrap.json delete mode 100644 src/packages/ts-transformer-type-const/package.json delete mode 100644 src/packages/ts-transformer-type-const/transformer.ts delete mode 100644 src/packages/ts-transformer-type-const/tsconfig.json diff --git a/src/chains/ethereum/__tests__/api/web3/web3.test.ts b/src/chains/ethereum/__tests__/api/web3/web3.test.ts index 6bd766030e..63e194920d 100644 --- a/src/chains/ethereum/__tests__/api/web3/web3.test.ts +++ b/src/chains/ethereum/__tests__/api/web3/web3.test.ts @@ -1,8 +1,7 @@ import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; -import { $INLINE_JSON } from "ts-transformer-inline-file"; -const { version } = $INLINE_JSON("../../../../../packages/core/package.json"); +const { version } = require("../../../../../packages/ganache/package.json"); describe("api", () => { describe("web3", () => { diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index efd752c666..812404c246 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -60,8 +60,8 @@ "ethereumjs-block": "2.2.2", "ethereumjs-common": "1.5.2", "ethereumjs-tx": "2.1.2", - "ethereumjs-vm": "4.2.0", "ethereumjs-util": "7.0.7", + "ethereumjs-vm": "4.2.0", "hdkey": "2.0.1", "keccak": "3.0.0", "leveldown": "5.6.0", diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 18a668ee90..5a840c5b86 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -46,7 +46,7 @@ import { import { Hardfork } from "./options/chain-options"; // Read in the current ganache version from core's package.json -const { version } = $INLINE_JSON("../../../packages/core/package.json"); +const { version } = $INLINE_JSON("../../../packages/ganache/package.json"); //#endregion //#region Constants @@ -166,12 +166,13 @@ export default class EthereumApi implements types.Api { */ constructor( options: EthereumInternalOptions, + wallet: Wallet, emitter: Emittery.Typed<{ message: any }, "connect" | "disconnect"> ) { this.#options = options; const chain = options.chain; - const { initialAccounts } = (this.#wallet = new Wallet(options.wallet)); + const { initialAccounts } = (this.#wallet = wallet); const coinbaseAddress = parseCoinbaseAddress( options.miner.coinbase, initialAccounts @@ -594,6 +595,19 @@ export default class EthereumApi implements types.Api { this.#blockchain.coinbase = Address.from(address); return true; } + + /** + * Set the extraData block header field a miner can include + * @param address + */ + @assertArgLength(1) + async miner_setExtra(extra: string) { + if (extra.length > 32) { + throw new Error(`extra exceeds max length. ${extra.length} > 32`); + } + this.#options.miner.extraData = extra; + return true; + } //#endregion //#region web3 diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 3b1d74a749..df6003d5ec 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -276,7 +276,8 @@ export default class Blockchain extends Emittery.Typed< transactionsTrie: blockData.transactionsTrie.root, receiptTrie: blockData.receiptTrie.root, stateRoot: this.trie.root, - gasUsed: Quantity.from(blockData.gasUsed).toBuffer() + gasUsed: Quantity.from(blockData.gasUsed).toBuffer(), + extraData: blockData.extraData }); block.value.transactions = blockData.blockTransactions; return block; diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/index.ts index 9b93bf54ed..6d180dab1a 100644 --- a/src/chains/ethereum/src/index.ts +++ b/src/chains/ethereum/src/index.ts @@ -4,7 +4,7 @@ import { JsonRpcTypes, types, utils } from "@ganache/utils"; import EthereumProvider from "./provider"; import { RecognizedString, WebSocket, HttpRequest } from "uWebSockets.js"; import CodedError, { ErrorCodes } from "./errors/coded-error"; -import { EthereumProviderOptions } from "./options"; +import { EthereumProviderOptions, EthereumLegacyOptions } from "./options"; function isHttp( connection: HttpRequest | WebSocket @@ -12,7 +12,7 @@ function isHttp( return connection.constructor.name === "uWS.HttpRequest"; } -export type ProviderOptions = EthereumProviderOptions; +export type ProviderOptions = EthereumProviderOptions | EthereumLegacyOptions; export type Provider = EthereumProvider; export const Provider = EthereumProvider; export const FlavorName = "ethereum" as const; diff --git a/src/chains/ethereum/src/miner/miner.ts b/src/chains/ethereum/src/miner/miner.ts index 2f50326950..6225be9fab 100644 --- a/src/chains/ethereum/src/miner/miner.ts +++ b/src/chains/ethereum/src/miner/miner.ts @@ -19,6 +19,7 @@ export type BlockData = { receiptTrie: Trie; gasUsed: bigint; timestamp: Buffer; + extraData: string; }; const putInTrie = (trie: Trie, key: Buffer, val: Buffer) => @@ -159,6 +160,7 @@ export default class Miner extends Emittery.Typed< onlyOneBlock: boolean ) => { const { pending, inProgress } = this.#executables; + const options = this.#options; let keepMining = true; const priced = this.#priced; @@ -177,7 +179,8 @@ export default class Miner extends Emittery.Typed< transactionsTrie, receiptTrie, gasUsed: 0n, - timestamp: block.header.timestamp + timestamp: block.header.timestamp, + extraData: options.extraData }; // don't mine anything at all if maxTransactions is `0` @@ -190,7 +193,7 @@ export default class Miner extends Emittery.Typed< } let numTransactions = 0; - let blockGasLeft = this.#options.blockGasLimit.toBigInt(); + let blockGasLeft = options.blockGasLimit.toBigInt(); const blockBloom = block.header.bloom; const promises: Promise[] = []; diff --git a/src/chains/ethereum/src/options/chain-options.ts b/src/chains/ethereum/src/options/chain-options.ts index 7a702232a1..140f0acc2f 100644 --- a/src/chains/ethereum/src/options/chain-options.ts +++ b/src/chains/ethereum/src/options/chain-options.ts @@ -17,16 +17,33 @@ export type ChainConfig = { * differently than production environments. You should only set this to * `true` during local debugging. * - * Default is `false`. + * @default false */ readonly allowUnlimitedContractSize: { type: boolean; hasDefault: true; + legacy: { + /** + * @deprecated Use chain.allowUnlimitedContractSize instead + */ + allowUnlimitedContractSize: boolean; + }; }; + /** + * When set to `false` only one request will be processed at a time. + * + * @default true + */ readonly asyncRequestProcessing: { type: boolean; hasDefault: true; + legacy: { + /** + * @deprecated Use chain.asyncRequestProcessing instead + */ + asyncRequestProcessing: boolean; + }; }; /** @@ -34,11 +51,17 @@ export type ChainConfig = { * transaction signing as introduced by * [EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md). * - * Defaults to `1337`. + * @default 1337 */ readonly chainId: { type: number; hasDefault: true; + legacy: { + /** + * @deprecated Use chain.chainId instead + */ + chainId: number; + }; }; /** @@ -46,10 +69,18 @@ export type ChainConfig = { * * Defaults to the current timestamp, via JavaScript's `Date.now()` (the * number of millisconds since the UNIX epoch). + * + * @default Date.now() */ readonly networkId: { type: number; hasDefault: true; + legacy: { + /** + * @deprecated Use chain.networkId instead + */ + networkId: number; + }; }; /** @@ -58,55 +89,83 @@ export type ChainConfig = { */ readonly time: { type: number | Date; + legacy: { + /** + * @deprecated Use chain.time instead + */ + time: number | Date; + }; }; /** * Set the hardfork rules for the EVM. + * @default "muirGlacier" */ readonly hardfork: { type: Hardfork; hasDefault: true; + legacy: { + /** + * @deprecated Use chain.hardfork instead + */ + hardfork: Hardfork; + }; }; /** * Whether to report runtime errors from EVM code as RPC errors. * - * Defaults to `false`. + * @default false */ readonly vmErrorsOnRPCResponse: { type: boolean; hasDefault: true; + legacy: { + /** + * @deprecated Use chain.vmErrorsOnRPCResponse instead + */ + vmErrorsOnRPCResponse: boolean; + }; }; }; exclusiveGroups: []; }; +const normalize = (rawInput: T) => rawInput; + export const ChainOptions: Definitions = { allowUnlimitedContractSize: { - normalize: rawInput => rawInput, - default: () => false + normalize, + default: () => false, + legacyName: "allowUnlimitedContractSize" }, asyncRequestProcessing: { - normalize: rawInput => rawInput, - default: () => true + normalize, + default: () => true, + legacyName: "asyncRequestProcessing" }, chainId: { - normalize: rawInput => rawInput, - default: () => 1337 + normalize, + default: () => 1337, + legacyName: "chainId" }, networkId: { - normalize: rawInput => rawInput, - default: () => Date.now() + normalize, + default: () => Date.now(), + legacyName: "networkId" }, time: { - normalize: rawInput => rawInput + normalize, + legacyName: "time" }, hardfork: { - normalize: rawInput => rawInput, - default: () => "muirGlacier" + normalize, + default: () => "muirGlacier", + legacyName: "hardfork" }, vmErrorsOnRPCResponse: { - normalize: rawInput => rawInput, - default: () => false + normalize, + default: () => false, + legacyName: "vmErrorsOnRPCResponse" } }; diff --git a/src/chains/ethereum/src/options/database-options.ts b/src/chains/ethereum/src/options/database-options.ts index 26a17981ed..97c48f288c 100644 --- a/src/chains/ethereum/src/options/database-options.ts +++ b/src/chains/ethereum/src/options/database-options.ts @@ -3,29 +3,43 @@ import { Definitions } from "@ganache/options"; export type DatabaseConfig = { options: { /** - * Specify an alternative database instance, for instance MemDOWN. + * Specify an alternative database instance, like MemDOWN */ - readonly db: { + db: { type: string | object; + legacy: { + /** + * @deprecated Use database.db instead + */ + db: string | object; + }; }; /** * Specify a path to a directory to save the chain database. If a database * already exists, that chain will be initialized instead of creating a new * one. */ - readonly dbPath: { + dbPath: { type: string; + legacy: { + /** + * @deprecated Use database.dbPath instead + */ + db_path: string; + }; }; }; exclusiveGroups: [["db", "dbPath"]]; }; +const normalize = (rawInput: T) => rawInput; export const DatabaseOptions: Definitions = { db: { - normalize: rawInput => rawInput + normalize, + legacyName: "db" }, dbPath: { - normalize: rawInput => rawInput, + normalize, legacyName: "db_path" } }; diff --git a/src/chains/ethereum/src/options/index.ts b/src/chains/ethereum/src/options/index.ts index ce99e6fc43..388aeacc15 100644 --- a/src/chains/ethereum/src/options/index.ts +++ b/src/chains/ethereum/src/options/index.ts @@ -4,10 +4,16 @@ import { LoggingConfig, LoggingOptions } from "./logging-options"; import { MinerConfig, MinerOptions } from "./miner-options"; import { WalletConfig, WalletOptions } from "./wallet-options"; import { + Base, Defaults, Definitions, ExternalConfig, InternalConfig, + Legacy, + LegacyOptions, + OptionName, + OptionRawType, + Options, OptionsConfig } from "@ganache/options"; @@ -19,6 +25,36 @@ export type EthereumOptions = { wallet: WalletConfig; }; +type MakeLegacyOptions = UnionToIntersection< + { + [K in OptionName]: K extends LegacyOptions + ? Legacy + : Record>; + }[keyof Options] +>; + +type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ( + k: infer I +) => void + ? I + : never; + +type g = Partial< + { + [K in keyof UnionToIntersection< + MakeLegacyOptions + >]: UnionToIntersection>[K]; + } +>; + +export type EthereumLegacyOptions = Partial< + MakeLegacyOptions & + MakeLegacyOptions & + MakeLegacyOptions & + MakeLegacyOptions & + MakeLegacyOptions +>; + export type EthereumProviderOptions = Partial< { [K in keyof EthereumOptions]: ExternalConfig; diff --git a/src/chains/ethereum/src/options/legacy-options.ts b/src/chains/ethereum/src/options/legacy-options.ts new file mode 100644 index 0000000000..113a08ba51 --- /dev/null +++ b/src/chains/ethereum/src/options/legacy-options.ts @@ -0,0 +1,25 @@ +// import { Base } from "@ganache/options"; +// import { OptionRawType, OptionName } from "@ganache/options"; +// import { ChainConfig } from "./chain-options"; +// import { DatabaseConfig } from "./database-options"; +// import { LoggingConfig } from "./logging-options"; +// import { MinerConfig } from "./miner-options"; +// import { WalletConfig } from "./wallet-options"; + +// type MakeLegacyOptions = { +// [ +// K in OptionName as void extends C["options"][K]["legacyName"] ? K : C["options"][K]["legacyName"] +// ]: +// OptionRawType +// }; + +// /** +// * @deprecated +// */ +// export type LegacyOptions = Partial< +// MakeLegacyOptions & +// MakeLegacyOptions & +// MakeLegacyOptions & +// MakeLegacyOptions & +// MakeLegacyOptions +// >; diff --git a/src/chains/ethereum/src/options/logging-options.ts b/src/chains/ethereum/src/options/logging-options.ts index 668dbbfafd..99d34db4d2 100644 --- a/src/chains/ethereum/src/options/logging-options.ts +++ b/src/chains/ethereum/src/options/logging-options.ts @@ -1,15 +1,25 @@ import { Definitions } from "@ganache/options"; +export type Logger = { + log(message?: any, ...optionalParams: any[]): void; +}; + export type LoggingConfig = { options: { /** * Set to `true` to log EVM opcodes. * - * Defaults to `false`. + * @default false */ readonly debug: { type: boolean; hasDefault: true; + legacy: { + /** + * @deprecated Use logging.debug instead + */ + debug: boolean; + }; }; /** @@ -27,38 +37,52 @@ export type LoggingConfig = { * ``` */ readonly logger: { - type: { - log(message?: any, ...optionalParams: any[]): void; - }; + type: Logger; hasDefault: true; + legacy: { + /** + * @deprecated Use logging.logger instead + */ + logger: Logger; + }; }; /** * Set to `true` to log all RPC requests and responses. * - * Defaults to `false`. + * @default false */ readonly verbose: { type: boolean; hasDefault: true; + legacy: { + /** + * @deprecated Use logging.verbose instead + */ + verbose: boolean; + }; }; }; exclusiveGroups: []; }; -const logger = { log: console.log.bind(console) }; +const logger: Logger = { log: console.log.bind(console) }; +const normalize = (rawInput: T) => rawInput; export const LoggingOptions: Definitions = { debug: { - normalize: rawInput => rawInput, - default: () => false + normalize, + default: () => false, + legacyName: "debug" }, logger: { - normalize: rawInput => rawInput, - default: () => logger + normalize, + default: () => logger, + legacyName: "logger" }, verbose: { - normalize: rawInput => rawInput, - default: () => false + normalize, + default: () => false, + legacyName: "verbose" } }; diff --git a/src/chains/ethereum/src/options/miner-options.ts b/src/chains/ethereum/src/options/miner-options.ts index b902f7a30e..9e3eefd17e 100644 --- a/src/chains/ethereum/src/options/miner-options.ts +++ b/src/chains/ethereum/src/options/miner-options.ts @@ -1,6 +1,7 @@ -import { Quantity, utils } from "@ganache/utils"; +import { Data, Quantity, utils } from "@ganache/utils"; import { Definitions } from "@ganache/options"; import Address from "../things/address"; +import { DatabaseOptions } from "./database-options"; export type MinerConfig = { options: { @@ -12,40 +13,57 @@ export type MinerConfig = { * Using the `blockTime` option is discouraged unless you have tests which * require a specific mining interval. * - * Defaults to `0` ("instamine mode"). + * @default 0 // "instamine mode" */ blockTime: { type: number; hasDefault: true; + legacy: { + /** + * @deprecated Use miner.blockTime instead + */ + blockTime: number; + }; }; /** * Sets the default gas price in WEI for transactions if not otherwise specified. * - * Defaults to `2_000_000`. + * @default 2_000_000 */ gasPrice: { type: Quantity; rawType: string | number | bigint; hasDefault: true; + legacy: { + /** + * @deprecated Use miner.gasPrice instead + */ + gasPrice: string | number | bigint; + }; }; /** * Sets the block gas limit in WEI. * - * Defaults to `12_000_000`. + * @default 12_000_000 */ blockGasLimit: { type: Quantity; rawType: string | number | bigint; hasDefault: true; - legacyName: "gasLimit"; + legacy: { + /** + * @deprecated Use miner.blockGasLimit instead + */ + gasLimit: string | number | bigint; + }; }; /** * Sets the _default_ transaction gas limit in WEI. * - * Defaults to `9_000`. + * @default 9_000 */ defaultTransactionGasLimit: { type: Quantity; @@ -57,12 +75,18 @@ export type MinerConfig = { * Sets the transaction gas limit in WEI for `eth_call` and * eth_estimateGas` calls. * - * Defaults to `9_007_199_254_740_991` (`2**53 - 1`). + * @default 9_007_199_254_740_991 // 2**53 - 1 */ callGasLimit: { type: Quantity; rawType: string | number | bigint; hasDefault: true; + legacy: { + /** + * @deprecated Use miner.callGasLimit instead + */ + callGasLimit: string | number | bigint; + }; }; /** @@ -70,7 +94,8 @@ export type MinerConfig = { * the transaction's hash is returned to the caller. If `legacyInstamine` is * `true`, `blockTime` must be `0` (default). * - * Defaults to `false`. + * @default false + * @deprecated Will be removed in v4 */ legacyInstamine: { type: boolean; @@ -83,25 +108,33 @@ export type MinerConfig = { * * `{string}` hex-encoded address * * `{number}` index of the account returned by `eth_getAccounts` * - * Defaults to `0x0000000000000000000000000000000000000000`. + * @default "0x0000000000000000000000000000000000000000" */ coinbase: { rawType: string | number; type: string | number | Address; hasDefault: true; }; + + extraData: { + type: string; + }; }; exclusiveGroups: []; }; +const normalize = (rawInput: T) => rawInput; + export const MinerOptions: Definitions = { blockTime: { - normalize: rawInput => rawInput, - default: () => 0 + normalize, + default: () => 0, + legacyName: "blockTime" }, gasPrice: { normalize: Quantity.from, - default: () => Quantity.from(2_000_000_000) + default: () => Quantity.from(2_000_000_000), + legacyName: "gasPrice" }, blockGasLimit: { normalize: Quantity.from, @@ -114,14 +147,23 @@ export const MinerOptions: Definitions = { }, callGasLimit: { normalize: Quantity.from, - default: () => Quantity.from(Number.MAX_SAFE_INTEGER) + default: () => Quantity.from(Number.MAX_SAFE_INTEGER), + legacyName: "callGasLimit" }, coinbase: { - normalize: rawInput => rawInput, + normalize, default: () => Address.from(utils.ACCOUNT_ZERO) }, legacyInstamine: { - normalize: rawInput => rawInput, + normalize, default: () => false + }, + extraData: { + normalize: rawType => { + if (rawType.length > 32) { + throw new Error(`extra exceeds max length. ${rawType.length} > 32`); + } + return rawType; + } } }; diff --git a/src/chains/ethereum/src/options/wallet-options.ts b/src/chains/ethereum/src/options/wallet-options.ts index 8483587a03..d3d643df3d 100644 --- a/src/chains/ethereum/src/options/wallet-options.ts +++ b/src/chains/ethereum/src/options/wallet-options.ts @@ -1,8 +1,6 @@ import seedrandom from "seedrandom"; import { entropyToMnemonic } from "bip39"; -import { Quantity } from "@ganache/utils"; - import { Definitions } from "@ganache/options"; const { alea } = seedrandom; @@ -36,11 +34,19 @@ export type OptionsAccount = { export type WalletConfig = { options: { /** - * Number of accounts to generate at startup. Defaults to `10`. + * Number of accounts to generate at startup. + * + * @default 10 */ totalAccounts: { type: number; hasDefault: true; + legacy: { + /** + * @deprecated Use wallet.totalAccounts instead + */ + total_accounts: number; + }; }; /** @@ -52,6 +58,12 @@ export type WalletConfig = { */ accounts: { type: OptionsAccount[]; + legacy: { + /** + * @deprecated Use wallet.accounts instead + */ + accounts: number; + }; }; /** @@ -60,6 +72,12 @@ export type WalletConfig = { seed: { type: string; hasDefault: true; + legacy: { + /** + * @deprecated Use wallet.seed instead + */ + seed: number; + }; }; /** @@ -68,6 +86,12 @@ export type WalletConfig = { mnemonic: { type: string; hasDefault: true; + legacy: { + /** + * @deprecated Use wallet.mnemonic instead + */ + mnemonic: number; + }; }; /** @@ -75,14 +99,28 @@ export type WalletConfig = { */ unlockedAccounts: { type: Array; + legacy: { + /** + * @deprecated Use wallet.unlockedAccounts instead + */ + unlocked_accounts: Array; + }; }; /** * Lock available accounts by default (good for third party transaction signing). Defaults to `false`. + * + * @default false */ secure: { type: boolean; hasDefault: true; + legacy: { + /** + * @deprecated Use wallet.secure instead + */ + secure: number; + }; }; /** @@ -96,66 +134,91 @@ export type WalletConfig = { */ accountKeysPath: { type: string | number; + legacy: { + /** + * @deprecated Use wallet.accountKeysPath instead + */ + account_keys_path: string | number; + }; }; /** * The default account balance, specified in ether. Defaults to `100` ether + * + * @default 100 // ether */ defaultBalance: { type: number; - rawType: number; hasDefault: true; + legacy: { + /** + * @deprecated Use wallet.defaultBalance instead + */ + default_balance_ether: number; + }; }; /** * The hierarchical deterministic path to use when generating accounts. - * Default: "m/44'/60'/0'/0/" + * + * @default "m/44'/60'/0'/0/" */ hdPath: { type: string; hasDefault: true; + legacy: { + /** + * @deprecated Use wallet.totalAcchdPathounts instead + */ + hd_path: string; + }; }; }; exclusiveGroups: [["totalAccounts", "accounts"], ["mnemonic", "seed"]]; }; +const normalize = (rawInput: T) => rawInput; export const WalletOptions: Definitions = { totalAccounts: { - normalize: rawInput => rawInput, + normalize, default: () => 10, legacyName: "total_accounts" }, accounts: { - normalize: rawInput => rawInput + normalize, + legacyName: "accounts" }, seed: { - normalize: rawInput => rawInput, - default: () => randomAlphaNumericString(10, alea()) + normalize, + default: () => randomAlphaNumericString(10, alea()), + legacyName: "seed" }, mnemonic: { - normalize: rawInput => rawInput, + normalize, default: config => - entropyToMnemonic(randomBytes(16, seedrandom(config.seed))) + entropyToMnemonic(randomBytes(16, seedrandom(config.seed))), + legacyName: "mnemonic" }, unlockedAccounts: { - normalize: rawInput => rawInput, + normalize, legacyName: "unlocked_accounts" }, secure: { - normalize: rawInput => rawInput, - default: () => false + normalize, + default: () => false, + legacyName: "secure" }, accountKeysPath: { - normalize: rawInput => rawInput, + normalize, legacyName: "account_keys_path" }, defaultBalance: { - normalize: rawInput => rawInput, + normalize, default: () => 100, legacyName: "default_balance_ether" }, hdPath: { - normalize: rawInput => rawInput, + normalize, default: () => "m/44'/60'/0'/0/", legacyName: "hd_path" } diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index 06446ae232..daf9f6b225 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -4,10 +4,12 @@ import { JsonRpcTypes } from "@ganache/utils"; import { EthereumProviderOptions, EthereumInternalOptions, - EthereumOptionsConfig + EthereumOptionsConfig, + EthereumLegacyOptions } from "./options"; import cloneDeep from "lodash.clonedeep"; import { PromiEvent, types, utils } from "@ganache/utils"; +import Wallet from "./wallet"; declare type RequestMethods = types.KnownKeys; type mergePromiseGenerics = Promise< @@ -31,16 +33,21 @@ export default class EthereumProvider #options: EthereumInternalOptions; #api: EthereumApi; #executor: utils.Executor; + #wallet: Wallet; - constructor(options: EthereumProviderOptions = {}, executor: utils.Executor) { + constructor( + options: EthereumProviderOptions | EthereumLegacyOptions = {}, + executor: utils.Executor + ) { super(); const providerOptions = (this.#options = EthereumOptionsConfig.normalize( - options + options as EthereumProviderOptions )); this.#executor = executor; + const wallet = (this.#wallet = new Wallet(providerOptions.wallet)); - this.#api = new EthereumApi(providerOptions, this); + this.#api = new EthereumApi(providerOptions, wallet, this); } /** @@ -50,6 +57,20 @@ export default class EthereumProvider return cloneDeep(this.#options); } + /** + * Returns the unlocked accounts + */ + public getInitialAccounts() { + const accounts: Record = {}; + this.#wallet.initialAccounts.forEach(account => { + accounts[account.address.toString()] = { + secretKey: account.privateKey.toString(), + balance: account.balance.toBigInt() + }; + }); + return accounts; + } + /** * Remove an event subscription */ diff --git a/src/packages/core/index.ts b/src/packages/core/index.ts index 538c575585..eef3b87f5d 100644 --- a/src/packages/core/index.ts +++ b/src/packages/core/index.ts @@ -1,7 +1,5 @@ -// ************************************************************************* // -// This file is necessary to "trick" typescript into using our ./src/**/*.ts // -// files when developing, debugging, and running tests // -// ************************************************************************* // +export { ProviderOptions, ServerOptions } from "./src/options"; import core from "./src/index"; + export default core; diff --git a/src/packages/core/src/@types/uWebsockets.js.ts b/src/packages/core/src/@types/uWebsockets.js.ts index ebb1f396f5..21eb947df8 100644 --- a/src/packages/core/src/@types/uWebsockets.js.ts +++ b/src/packages/core/src/@types/uWebsockets.js.ts @@ -7,6 +7,13 @@ enum ListenOptions { // uWebSockets.js doesn't include these in its TS def file. declare module "uWebSockets.js" { export interface TemplatedApp { + listen( + host: RecognizedString, + port: number, + options: ListenOptions, + cb: (listenSocket: us_listen_socket | false) => void + ): TemplatedApp; + listen( port: number, options: ListenOptions, diff --git a/src/packages/core/src/connector.ts b/src/packages/core/src/connector.ts index 756187322d..d8203b89f2 100644 --- a/src/packages/core/src/connector.ts +++ b/src/packages/core/src/connector.ts @@ -1,6 +1,7 @@ import { utils } from "@ganache/utils"; import { ConnectorsByName, DefaultFlavor } from "@ganache/flavors"; import { Options as ProviderOptions } from "@ganache/flavors"; +import { hasOwn } from "@ganache/utils/src/utils"; /** * Loads the connector specified by the given `flavor` @@ -17,12 +18,12 @@ export default { // Set up our request coordinator to either use FIFO or or async request processing. // The RequestCoordinator _can_ be used to coordinate the number of requests being processed, but we don't use it // for that (yet), instead of "all" (0) or just 1 as we are doing here: - providerOptions.chain = providerOptions.chain || {}; - if (providerOptions.chain.asyncRequestProcessing == null) { - providerOptions.chain.asyncRequestProcessing = true; - } + const asyncRequestProcessing = + "chain" in providerOptions + ? providerOptions.chain.asyncRequestProcessing + : (providerOptions as any).asyncRequestProcessing; const requestCoordinator = new utils.RequestCoordinator( - providerOptions.chain.asyncRequestProcessing ? 0 : 1 + asyncRequestProcessing ? 0 : 1 ); // The Executor is responsible for actually executing the method on the chain/API. @@ -30,7 +31,10 @@ export default { // to a RequestCoordinator. const executor = new utils.Executor(requestCoordinator); - const connector = new ConnectorsByName[flavor](providerOptions, executor); + const connector = new ConnectorsByName[flavor]( + providerOptions as any, + executor + ); // The request coordinator is initialized in a "paused" state; when the provider is ready we unpause. // This lets us accept queue requests before we've even fully initialized. diff --git a/src/packages/core/src/index.ts b/src/packages/core/src/index.ts index 7e3314b1bf..d94b4c9af4 100644 --- a/src/packages/core/src/index.ts +++ b/src/packages/core/src/index.ts @@ -2,6 +2,8 @@ import Connector from "./connector"; import { ProviderOptions, ServerOptions } from "./options"; import Server from "./server"; +export { ProviderOptions, ServerOptions } from "./options"; + export default { server: (options?: ServerOptions) => new Server(options), provider: (options?: ProviderOptions) => diff --git a/src/packages/core/src/options/server-options.ts b/src/packages/core/src/options/server-options.ts index 27c8358045..b64a4cdfad 100644 --- a/src/packages/core/src/options/server-options.ts +++ b/src/packages/core/src/options/server-options.ts @@ -2,20 +2,20 @@ import { Definitions } from "@ganache/options"; export type ServerConfig = { options: { - /** - * Port number to listen on when running as a server. Defaults to `8545` - */ - readonly port: { - type: number; - hasDefault: true; - }; - /** * Enable a websocket server. This is `true` by default. + * + * @default true */ readonly ws: { type: boolean; hasDefault: true; + legacy: { + /** + * @deprecated Use server.ws instead. + */ + ws: boolean; + }; }; /** @@ -24,26 +24,45 @@ export type ServerConfig = { * * Default is "auto", which responds using the same format as the incoming * message that triggered the response. + * + * @default "auto" */ readonly wsBinary: { type: boolean | "auto"; hasDefault: true; }; + + /** + * @obsolete Option removed in v3 + */ + readonly keepAliveTimeout: { + type: void; + legacy: { + /** + * @obsolete Option removed in v3 + */ + keepAliveTimeout: void; + }; + }; }; exclusiveGroups: []; }; +const normalize = (rawInput: T) => rawInput; export const ServerOptions: Definitions = { - port: { - normalize: rawInput => rawInput, - default: () => 8545 - }, ws: { - normalize: rawInput => rawInput, - default: () => true + normalize, + default: () => true, + legacyName: "ws" }, wsBinary: { - normalize: rawInput => rawInput, + normalize, default: () => "auto" + }, + keepAliveTimeout: { + normalize: () => { + throw new Error("`keepAliveTimeout` was removed in v3"); + }, + legacyName: "keepAliveTimeout" } }; diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index 7ecb4cc778..035d3b1645 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -6,6 +6,8 @@ import Connector from "./connector"; import WebsocketServer, { WebSocketCapableFlavor } from "./servers/ws-server"; import HttpServer from "./servers/http-server"; +const DEFAULT_HOST = "127.0.0.1"; + type Providers = Connectors["provider"]; type Callback = (err: Error | null) => void; @@ -74,8 +76,21 @@ export default class Server { } listen(port: number): Promise; + listen(port: number, host: string): Promise; listen(port: number, callback: Callback): void; - listen(port: number, callback?: Callback): void | Promise { + listen(port: number, host: string, callback: Callback): void; + listen( + port: number, + host?: string | Callback, + callback?: Callback + ): void | Promise { + let hostname: string; + if (typeof host === "function") { + callback = host; + hostname = DEFAULT_HOST; + } else if (host == null) { + hostname = DEFAULT_HOST; + } const callbackIsFunction = typeof callback === "function"; const status = this.#status; if (status === Status.closing) { @@ -99,7 +114,12 @@ export default class Server { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - this.#app.listen(port as any, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + (this.#app as any).listen( + hostname, + port as any, + LIBUS_LISTEN_EXCLUSIVE_PORT, + resolve + ); } ).then(listenSocket => { if (listenSocket) { @@ -109,7 +129,7 @@ export default class Server { } else { this.#status = Status.closed; const err = new Error( - `listen EADDRINUSE: address already in use 127.0.0.1:${port}.` + `listen EADDRINUSE: address already in use ${hostname}:${port}.` ); if (callbackIsFunction) callback!(err); else throw err; diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts index 0ea4ca282e..49fe84df43 100644 --- a/src/packages/flavors/src/index.ts +++ b/src/packages/flavors/src/index.ts @@ -23,5 +23,3 @@ export type Options = { flavor?: typeof Ethereum.FlavorName; } & Ethereum.ProviderOptions; // | [Tezos.FlavorName]: Tezos.ProviderOptions; - -// export type Apis = T extends types.Connector ? R : never; diff --git a/src/packages/ganache/npm-shrinkwrap.json b/src/packages/ganache/npm-shrinkwrap.json index 6ca8cc3a0f..e5dc1172a5 100644 --- a/src/packages/ganache/npm-shrinkwrap.json +++ b/src/packages/ganache/npm-shrinkwrap.json @@ -2065,12 +2065,6 @@ "yn": "3.1.1" } }, - "ts-transformer-inline-file": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ts-transformer-inline-file/-/ts-transformer-inline-file-0.1.1.tgz", - "integrity": "sha512-2bPkAFjATsRG4ld8TFTUqn4TvEdXLQf/wwGsepFeRKSXLPqFRhdUHusAGPB1/Zif3CVjppD+bfne58gynd8RfQ==", - "dev": true - }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index 912b605878..5ec14a4e3f 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -44,7 +44,7 @@ "truffle" ], "devDependencies": { - "@ganache/core": "^0.1.0", + "@ganache/cli": "^0.1.0", "@ganache/flavors": "^0.1.0", "@types/node": "14.14.6", "assert": "2.0.0", @@ -59,7 +59,6 @@ "stream-browserify": "3.0.0", "ts-loader": "8.0.7", "ts-node": "9.0.0", - "ts-transformer-inline-file": "0.1.1", "ttypescript": "1.5.12", "typescript": "4.1.1-rc", "util": "0.12.3", diff --git a/src/packages/ganache/src/index.ts b/src/packages/ganache/src/index.ts index eed1825a54..edc13ead4d 100644 --- a/src/packages/ganache/src/index.ts +++ b/src/packages/ganache/src/index.ts @@ -1,4 +1,4 @@ -import Ganache from "@ganache/core"; +import Ganache from "@ganache/cli"; export default { server: Ganache.server, diff --git a/src/packages/ganache/tsconfig.json b/src/packages/ganache/tsconfig.json index a92ef985c9..62676b00a1 100644 --- a/src/packages/ganache/tsconfig.json +++ b/src/packages/ganache/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../tsconfig.json", "compilerOptions": { - "outDir": "lib", - "module": "CommonJS" + "outDir": "lib" }, "include": ["src"] } diff --git a/src/packages/options/src/helpers/base.ts b/src/packages/options/src/helpers/base.ts index 01d1c11dd5..4c4cc4187d 100644 --- a/src/packages/options/src/helpers/base.ts +++ b/src/packages/options/src/helpers/base.ts @@ -3,6 +3,9 @@ export namespace Base { rawType?: any; type: any; hasDefault?: true; + legacy?: { + [k: string]: any; + }; }; export type ExclusiveGroupOptionName = string; diff --git a/src/packages/options/src/helpers/create.ts b/src/packages/options/src/helpers/create.ts index 60c94a3421..4facf51bdd 100644 --- a/src/packages/options/src/helpers/create.ts +++ b/src/packages/options/src/helpers/create.ts @@ -6,7 +6,7 @@ import { utils } from "@ganache/utils"; const hasOwn = utils.hasOwn; -export type Options = { [key: string]: Base.Config }; +type Options = { [key: string]: Base.Config }; export type ProviderOptions = Partial< { @@ -27,34 +27,31 @@ function fill(defaults: any, options: any, target: any, namespace: any) { const config = (target[namespace] = target[namespace] || {}); if (hasOwn(options, namespace)) { - const userOpts = options[namespace]; + const namespaceOptions = options[namespace]; const keys = Object.keys(def); for (let i = 0, l = keys.length; i < l; i++) { const key = keys[i]; - const defProp = def[key]; - if (hasOwn(userOpts, key)) { - config[key] = defProp.normalize(userOpts[key]); - } else { - const legacyName = defProp.legacyName || key; - if (hasOwn(options, legacyName)) { - config[key] = defProp.normalize(options[legacyName]); - } else if (hasOwn(defProp, "default")) { - config[key] = defProp.default(config); - } + const propDefinition = def[key]; + const value = namespaceOptions[key]; + if (value != null) { + config[key] = propDefinition.normalize(value); + } else if (hasOwn(propDefinition, "default")) { + config[key] = propDefinition.default(config); } } } else { const keys = Object.keys(def); for (let i = 0, l = keys.length; i < l; i++) { const key = keys[i]; - const defProp = def[key]; + const propDefinition = def[key]; - const legacyName = defProp.legacyName || key; - if (hasOwn(options, legacyName)) { - config[key] = defProp.normalize(options[legacyName]); - } else if (hasOwn(defProp, "default")) { - config[key] = defProp.default(config); + const legacyName = propDefinition.legacyName || key; + const value = options[legacyName]; + if (value != null) { + config[key] = propDefinition.normalize(value); + } else if (hasOwn(propDefinition, "default")) { + config[key] = propDefinition.default(config); } } } diff --git a/src/packages/options/src/helpers/definition.ts b/src/packages/options/src/helpers/definition.ts index 733b81b858..217c99b6ed 100644 --- a/src/packages/options/src/helpers/definition.ts +++ b/src/packages/options/src/helpers/definition.ts @@ -1,7 +1,9 @@ import { Base } from "./base"; import { ExclusiveGroupUnionAndUnconstrainedPlus } from "./exclusive"; import { + Legacy, OptionHasDefault, + OptionHasLegacy, OptionName, OptionRawType, OptionType @@ -21,12 +23,22 @@ export type InternalConfig< C extends Base.Config > = ExclusiveGroupUnionAndUnconstrainedPlus; +type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ( + k: infer I +) => void + ? I + : never; + export type Definitions = { [N in OptionName]: { - normalize: Normalize; - legacyName?: string; + readonly normalize: Normalize; } & (void extends OptionHasDefault ? {} - : { default: (config: InternalConfig) => OptionType }); + : { readonly default: (config: InternalConfig) => OptionType }) & + (void extends OptionHasLegacy + ? {} + : { + readonly legacyName: UnionToIntersection>; + }); }; //#endregion Definition helpers diff --git a/src/packages/options/src/helpers/getters.ts b/src/packages/options/src/helpers/getters.ts index 514ffe59c9..6897d2eb30 100644 --- a/src/packages/options/src/helpers/getters.ts +++ b/src/packages/options/src/helpers/getters.ts @@ -6,7 +6,7 @@ export type ExclusiveGroups = C["exclusiveGroups"]; //#endregion //#region getters for keys -export type OptionName = string & keyof Options; +export type OptionName = keyof Options; export type ExclusiveGroupIndex = number & keyof ExclusiveGroups; //#endregion @@ -35,4 +35,21 @@ export type OptionHasDefault< C extends Base.Config, N extends OptionName = OptionName > = Option["hasDefault"]; + +export type OptionHasLegacy< + C extends Base.Config, + N extends OptionName = OptionName +> = Option["legacy"]; + +export type LegacyOptions = { + [K in keyof C["options"]]: C["options"][K] extends { legacy: any } + ? K + : never; +}[keyof C["options"]]; + +export type Legacy> = Option< + C, + N +>["legacy"]; + //#endregion getters for option diff --git a/src/packages/options/src/helpers/index.ts b/src/packages/options/src/helpers/index.ts index 8b1d1d6c91..4e6619fff8 100644 --- a/src/packages/options/src/helpers/index.ts +++ b/src/packages/options/src/helpers/index.ts @@ -1,4 +1,11 @@ export * from "./base"; +export { + Options, + LegacyOptions, + Legacy, + OptionName, + OptionRawType +} from "./getters"; export * from "./exclusive"; export * from "./definition"; export * from "./create"; diff --git a/src/packages/options/src/index.ts b/src/packages/options/src/index.ts index 8b3e896db9..d4e09d7b43 100644 --- a/src/packages/options/src/index.ts +++ b/src/packages/options/src/index.ts @@ -1,3 +1 @@ -//export * from "./options"; export * from "./helpers"; -//export * from "./provider-options"; diff --git a/src/packages/promise-queue/package-lock.json b/src/packages/promise-queue/npm-shrinkwrap.json similarity index 54% rename from src/packages/promise-queue/package-lock.json rename to src/packages/promise-queue/npm-shrinkwrap.json index 3659c2db06..3f55a05c8c 100644 --- a/src/packages/promise-queue/package-lock.json +++ b/src/packages/promise-queue/npm-shrinkwrap.json @@ -8,12 +8,6 @@ "version": "0.7.2", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==" - }, - "ts-transformer-inline-file": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ts-transformer-inline-file/-/ts-transformer-inline-file-0.1.1.tgz", - "integrity": "sha512-2bPkAFjATsRG4ld8TFTUqn4TvEdXLQf/wwGsepFeRKSXLPqFRhdUHusAGPB1/Zif3CVjppD+bfne58gynd8RfQ==", - "dev": true } } } diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index f2af709390..f4b8d94615 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -43,8 +43,5 @@ ], "dependencies": { "emittery": "0.7.2" - }, - "devDependencies": { - "ts-transformer-inline-file": "0.1.1" } } diff --git a/src/packages/ts-transformer-type-const/.gitignore b/src/packages/ts-transformer-type-const/.gitignore deleted file mode 100644 index 9c329094b5..0000000000 --- a/src/packages/ts-transformer-type-const/.gitignore +++ /dev/null @@ -1 +0,0 @@ -transformer.js \ No newline at end of file diff --git a/src/packages/ts-transformer-type-const/.npmignore b/src/packages/ts-transformer-type-const/.npmignore deleted file mode 100644 index b1e1059b5c..0000000000 --- a/src/packages/ts-transformer-type-const/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -./index.ts -__tests__ -.nyc_output -coverage -scripts -src -tsconfig.json -typedoc.json diff --git a/src/packages/ts-transformer-type-const/LICENSE b/src/packages/ts-transformer-type-const/LICENSE deleted file mode 100644 index 39f3b14498..0000000000 --- a/src/packages/ts-transformer-type-const/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2019-2020 Truffle Blockchain Group - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/packages/ts-transformer-type-const/README.md b/src/packages/ts-transformer-type-const/README.md deleted file mode 100644 index 2f1595aa45..0000000000 --- a/src/packages/ts-transformer-type-const/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# `@ganache/ts-transformer-type-const` - -A TypeScript custom transformer to inline literal types as JS runtime values - -# Requirement - -TypeScript >= 3.2.0 - -# How to use this package - -This package exports 2 functions. -One is `constToValue` which is used in TypeScript codes to obtain the value of given type, while the other is a TypeScript custom transformer which is used to compile the `constToValue` function correctly. - -## How to use `constToValue` - -```ts -import { constToValue } from "@ganache/ts-transformer-type-const"; - -type myType = "some value"; -const myValue = constToValue(); - -console.log(myValue); // "some value" -``` - -## How to use the custom transformer - -Unfortunately, TypeScript itself does not currently provide any easy way to use custom transformers (See https://github.com/Microsoft/TypeScript/issues/14419). - -### ttypescript - -See [examples/ttypescript](examples/ttypescript) for detail. -See [ttypescript's README](https://github.com/cevek/ttypescript/blob/master/README.md) for how to use this with module bundlers such as webpack or Rollup. - -```json -// tsconfig.json -{ - "compilerOptions": { - // ... - "plugins": [ - { "transform": "@ganache/ts-transformer-type-const/transformer" } - ] - } - // ... -} -``` diff --git a/src/packages/ts-transformer-type-const/index.d.ts b/src/packages/ts-transformer-type-const/index.d.ts deleted file mode 100644 index af8928394d..0000000000 --- a/src/packages/ts-transformer-type-const/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export function constToValue(): T; diff --git a/src/packages/ts-transformer-type-const/index.js b/src/packages/ts-transformer-type-const/index.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/packages/ts-transformer-type-const/npm-shrinkwrap.json b/src/packages/ts-transformer-type-const/npm-shrinkwrap.json deleted file mode 100644 index af75c09dfb..0000000000 --- a/src/packages/ts-transformer-type-const/npm-shrinkwrap.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"@ganache/ts-transformer-type-const","version":"0.1.0","lockfileVersion":1} diff --git a/src/packages/ts-transformer-type-const/package.json b/src/packages/ts-transformer-type-const/package.json deleted file mode 100644 index c4640ae11c..0000000000 --- a/src/packages/ts-transformer-type-const/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "@ganache/ts-transformer-type-const", - "version": "0.1.0", - "description": "A TypeScript custom transformer to literal types as JS runtime values", - "author": "David Murdoch", - "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/ts-transformer-type-const#readme", - "license": "MIT", - "files": [ - "index.js", - "index.d.ts", - "transformer.js", - "transformer.ts" - ], - "repository": { - "type": "git", - "url": "https://github.com/trufflesuite/ganache-core.git", - "directory": "src/packages/ts-transformer-type-const" - }, - "scripts": { - "tsc": "ttsc" - }, - "bugs": { - "url": "https://github.com/trufflesuite/ganache-core/issues" - }, - "keywords": [ - "ganache", - "ganache-ts-transformer-type-const", - "ethereum", - "evm", - "blockchain", - "smart contracts", - "dapps", - "solidity", - "vyper", - "fe", - "web3", - "tooling", - "truffle" - ], - "peerDependencies": { - "typescript": ">=3.2.0" - } -} diff --git a/src/packages/ts-transformer-type-const/transformer.ts b/src/packages/ts-transformer-type-const/transformer.ts deleted file mode 100644 index 46452689d7..0000000000 --- a/src/packages/ts-transformer-type-const/transformer.ts +++ /dev/null @@ -1,83 +0,0 @@ -import ts from "typescript"; -import path from "path"; - -export default function transformer( - program: ts.Program -): ts.TransformerFactory { - return (context: ts.TransformationContext) => (file: ts.SourceFile) => - visitNodeAndChildren(file, program, context); -} - -function visitNodeAndChildren( - node: ts.SourceFile, - program: ts.Program, - context: ts.TransformationContext -): ts.SourceFile; -function visitNodeAndChildren( - node: ts.Node, - program: ts.Program, - context: ts.TransformationContext -): ts.Node | undefined; -function visitNodeAndChildren( - node: ts.Node, - program: ts.Program, - context: ts.TransformationContext -): ts.Node | undefined { - return ts.visitEachChild( - visitNode(node, program), - childNode => visitNodeAndChildren(childNode, program, context), - context - ); -} - -function visitNode(node: ts.SourceFile, program: ts.Program): ts.SourceFile; -function visitNode(node: ts.Node, program: ts.Program): ts.Node | undefined; -function visitNode(node: ts.Node, program: ts.Program): ts.Node | undefined { - const typeChecker = program.getTypeChecker(); - if (isTypeConstImportExpression(node)) { - return; - } - if (!isTypeConstCallExpression(node, typeChecker)) { - return node; - } - if (!node.typeArguments) { - return ts.createNull(); - } - const type = typeChecker.getTypeFromTypeNode(node.typeArguments[0]); - if (!type.isLiteral()) { - return ts.createNull(); - } - return ts.createLiteral(type.value); -} - -const indexJs = path.join(__dirname, "index.js"); -function isTypeConstImportExpression( - node: ts.Node -): node is ts.ImportDeclaration { - if (!ts.isImportDeclaration(node)) { - return false; - } - const module = (node.moduleSpecifier as ts.StringLiteral).text; - return module === "@ganache/ts-transformer-type-const"; -} - -const indexTs = path.join(__dirname, "index.d.ts"); -function isTypeConstCallExpression( - node: ts.Node, - typeChecker: ts.TypeChecker -): node is ts.CallExpression { - if (!ts.isCallExpression(node)) { - return false; - } - const signature = typeChecker.getResolvedSignature(node); - if (typeof signature === "undefined") { - return false; - } - const { declaration } = signature; - return ( - !!declaration && - !ts.isJSDocSignature(declaration) && - require.resolve(declaration.getSourceFile().fileName) === indexTs && - declaration.name?.getText() === "constToValue" - ); -} diff --git a/src/packages/ts-transformer-type-const/tsconfig.json b/src/packages/ts-transformer-type-const/tsconfig.json deleted file mode 100644 index 5a493bcf8f..0000000000 --- a/src/packages/ts-transformer-type-const/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "target": "es5", - "module": "commonjs", - "strict": true, - "noEmitOnError": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "esModuleInterop": true - }, - "include": ["transformer.ts"], - "exclude": ["node_modules"] -} diff --git a/tsconfig.json b/tsconfig.json index 3731e0a3a5..5dea564bc2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,6 @@ "experimentalDecorators": true, "plugins": [ { - // Inlines package.json "transform": "ts-transformer-inline-file/transformer" } ] From fe03feefcf47b202e5088d156db3cc0b28aa7d52 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 7 Nov 2020 11:43:34 -0500 Subject: [PATCH 681/691] add WIP cli port --- src/packages/cli/.npmignore | 8 + src/packages/cli/LICENSE | 21 ++ src/packages/cli/README.md | 3 + src/packages/cli/__tests__/index.test.ts | 6 + src/packages/cli/index.ts | 5 + src/packages/cli/npm-shrinkwrap.json | 391 +++++++++++++++++++++++ src/packages/cli/package.json | 52 +++ src/packages/cli/src/index.ts | 260 +++++++++++++++ src/packages/cli/tsconfig.json | 7 + 9 files changed, 753 insertions(+) create mode 100644 src/packages/cli/.npmignore create mode 100644 src/packages/cli/LICENSE create mode 100644 src/packages/cli/README.md create mode 100644 src/packages/cli/__tests__/index.test.ts create mode 100644 src/packages/cli/index.ts create mode 100644 src/packages/cli/npm-shrinkwrap.json create mode 100644 src/packages/cli/package.json create mode 100644 src/packages/cli/src/index.ts create mode 100644 src/packages/cli/tsconfig.json diff --git a/src/packages/cli/.npmignore b/src/packages/cli/.npmignore new file mode 100644 index 0000000000..b1e1059b5c --- /dev/null +++ b/src/packages/cli/.npmignore @@ -0,0 +1,8 @@ +./index.ts +__tests__ +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/packages/cli/LICENSE b/src/packages/cli/LICENSE new file mode 100644 index 0000000000..39f3b14498 --- /dev/null +++ b/src/packages/cli/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/packages/cli/README.md b/src/packages/cli/README.md new file mode 100644 index 0000000000..2f34bb6a47 --- /dev/null +++ b/src/packages/cli/README.md @@ -0,0 +1,3 @@ +# `@ganache/cli` + +> TODO: description diff --git a/src/packages/cli/__tests__/index.test.ts b/src/packages/cli/__tests__/index.test.ts new file mode 100644 index 0000000000..08ddd8e61c --- /dev/null +++ b/src/packages/cli/__tests__/index.test.ts @@ -0,0 +1,6 @@ +import assert from "assert"; +import cli from "../src/"; + +describe("@ganache/cli", () => { + it("needs tests"); +}); diff --git a/src/packages/cli/index.ts b/src/packages/cli/index.ts new file mode 100644 index 0000000000..f9c66395b9 --- /dev/null +++ b/src/packages/cli/index.ts @@ -0,0 +1,5 @@ +// ************************************************************************* // +// This file is necessary to "trick" typescript into using our ./src/**/*.ts // +// files when developing, debugging, and running tests // +// ************************************************************************* // +export * from "./src/index"; diff --git a/src/packages/cli/npm-shrinkwrap.json b/src/packages/cli/npm-shrinkwrap.json new file mode 100644 index 0000000000..ccd2cf1917 --- /dev/null +++ b/src/packages/cli/npm-shrinkwrap.json @@ -0,0 +1,391 @@ +{ + "name": "@ganache/cli", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", + "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==" + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/secp256k1": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "requires": { + "@types/node": "*" + } + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" + }, + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==" + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + } + } + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "ethereumjs-util": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz", + "integrity": "sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.4" + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + }, + "keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "requires": { + "bn.js": "^4.11.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + } + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + } + } +} diff --git a/src/packages/cli/package.json b/src/packages/cli/package.json new file mode 100644 index 0000000000..84c5795ddb --- /dev/null +++ b/src/packages/cli/package.json @@ -0,0 +1,52 @@ +{ + "name": "@ganache/cli", + "version": "0.1.0", + "description": "", + "author": "David Murdoch", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/cli#readme", + "license": "MIT", + "main": "lib/index.js", + "types": "src/index.ts", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/packages/cli" + }, + "scripts": { + "tsc": "ttsc", + "test": "nyc npm run mocha", + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "keywords": [ + "ganache", + "ganache-cli", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling", + "truffle" + ], + "devDependencies": { + "@ganache/core": "^0.1.0" + }, + "dependencies": { + "@types/node": "14.14.6", + "ethereumjs-util": "^7.0.7" + } +} diff --git a/src/packages/cli/src/index.ts b/src/packages/cli/src/index.ts new file mode 100644 index 0000000000..87203d5ccb --- /dev/null +++ b/src/packages/cli/src/index.ts @@ -0,0 +1,260 @@ +#!/usr/bin/env node + +import Ganache from "@ganache/core"; +import { $INLINE_JSON } from "ts-transformer-inline-file"; +import { toChecksumAddress } from "ethereumjs-util"; + +export default Ganache; + +const { version: ganacheVersion } = $INLINE_JSON("../../core/package.json"); +const { version } = $INLINE_JSON("../package.json"); +const detailedVersion = + "Ganache CLI v" + version + " (ganache-core: " + ganacheVersion + ")"; + +const isDocker = + "DOCKER" in process.env && process.env.DOCKER.toLowerCase() === "true"; + +function parseAccounts(accounts) { + function splitAccount(account) { + account = account.split(","); + return { + secretKey: account[0], + balance: account[1] + }; + } + + if (typeof accounts === "string") return [splitAccount(accounts)]; + else if (!Array.isArray(accounts)) return; + + var ret = []; + for (var i = 0; i < accounts.length; i++) { + ret.push(splitAccount(accounts[i])); + } + return ret; +} + +// TODO: CLI parser: +const argv: any = {}; +const port = 8545; +const host = "127.0.0.1"; + +if (argv.d) { + argv.s = "TestRPC is awesome!"; // Seed phrase; don't change to Ganache, maintain original determinism +} + +if (typeof argv.unlock == "string") { + argv.unlock = [argv.unlock]; +} + +let logger: { + log: (message?: any, ...optionalParams: any[]) => void; +} = console; + +// If quiet argument passed, no output +if (argv.q === true) { + logger = { + log: function () {} + }; +} + +// If the mem argument is passed, only show memory output, +// not transaction history. +if (argv.mem === true) { + logger = { + log: function () {} + }; + + setInterval(function () { + console.log(process.memoryUsage()); + }, 1000); +} + +var options: any = { + wallet: { + accountKeysPath: argv.account_keys_path, + mnemonic: argv.m, + seed: argv.s, + totalAccounts: argv.a, + defaultBalance: argv.e, + accounts: parseAccounts(argv.account), + unlockedAccounts: argv.unlock, + secure: argv.n, + hdPath: argv.hdPath + } as any, + logging: { + debug: argv.debug, + verbose: argv.v, + logger: logger + }, + miner: { + blockTime: argv.b, + gasPrice: argv.g, + blockGasLimit: argv.l, + callGasLimit: argv.callGasLimit + }, + // forking: { + // fork: argv.f, + // forkCacheSize: argv.forkCacheSize + // }, // TODO + chain: { + hardfork: argv.k, + networkId: argv.i, + vmErrorsOnRPCResponse: !argv.noVMErrorsOnRPCResponse, + allowUnlimitedContractSize: argv.allowUnlimitedContractSize, + time: argv.t, + chainId: argv.chainId + // keepAliveTimeout: argv.keepAliveTimeout,// TODO: this was removed on purpose + }, + database: { + dbPath: argv.db + } +}; + +var server = Ganache.server(options); + +console.log(detailedVersion); + +let started = false; +process.on("uncaughtException", function (e) { + if (started) { + console.log(e); + } else { + console.log(e.stack); + } + process.exit(1); +}); + +// See http://stackoverflow.com/questions/10021373/what-is-the-windows-equivalent-of-process-onsigint-in-node-js +if (process.platform === "win32") { + require("readline") + .createInterface({ + input: process.stdin, + output: process.stdout + }) + .on("SIGINT", function () { + process.emit("SIGINT" as any); // TODO: don't abuse process's emit + }); +} + +const closeHandler = async function () { + // graceful shutdown + try { + await server.close(); + process.exit(0); + } catch (err) { + // https://nodejs.org/api/process.html#process_process_exit_code + // writes to process.stdout in Node.js are sometimes asynchronous and may occur over + // multiple ticks of the Node.js event loop. Calling process.exit(), however, forces + // the process to exit before those additional writes to stdout can be performed. + if ((process.stdout as any)._handle) + (process.stdout as any).setBlocking(true); + console.log(err.stack || err); + process.exit(); + } +}; + +process.on("SIGINT", closeHandler); +process.on("SIGTERM", closeHandler); +process.on("SIGHUP", closeHandler); + +async function startGanache(err) { + if (err) { + console.log(err); + return; + } + started = true; + const liveOptions = server.provider.getOptions(); + const accounts = server.provider.getInitialAccounts(); + + console.log(""); + console.log("Available Accounts"); + console.log("=================="); + + var addresses = Object.keys(accounts); + var ethInWei = 1000000000000000000n; + + addresses.forEach(function (address, index) { + var balance = accounts[address].balance; + var strBalance = balance / ethInWei; + var about = balance % ethInWei === 0n ? "" : "~"; + var line = `(${index}) ${toChecksumAddress( + address + )} (${about}${strBalance} ETH)`; + + // if (state.isUnlocked(address) == false) { + // line += " 🔒"; + // } + + console.log(line); + }); + + console.log(""); + console.log("Private Keys"); + console.log("=================="); + + addresses.forEach(function (address, index) { + console.log("(" + index + ") " + accounts[address].secretKey); + }); + + if (options.wallet.accountKeysPath != null) { + console.log(""); + console.log("Accounts and keys saved to " + options.wallet.accountKeysPath); + } + + if (argv.a == null) { + console.log(""); + console.log("HD Wallet"); + console.log("=================="); + console.log("Mnemonic: " + liveOptions.wallet.mnemonic); + console.log( + "Base HD Path: " + liveOptions.wallet.hdPath + "{account_index}" + ); + } + + if (liveOptions.miner.gasPrice) { + console.log(""); + console.log("Gas Price"); + console.log("=================="); + console.log(liveOptions.miner.gasPrice); + } + + if (liveOptions.miner.blockGasLimit) { + console.log(""); + console.log("BlockGas Limit"); + console.log("=================="); + console.log(liveOptions.miner.blockGasLimit); + } + + if (liveOptions.miner.callGasLimit) { + console.log(""); + console.log("Call Gas Limit"); + console.log("=================="); + console.log(liveOptions.miner.callGasLimit); + } + + // if (options.fork) { + // console.log(""); + // console.log("Forked Chain"); + // console.log("=================="); + // console.log("Location: " + state.blockchain.options.fork); + // console.log( + // "Block: " + to.number(state.blockchain.forkBlockNumber) + // ); + // console.log("Network ID: " + state.net_version); + // console.log( + // "Time: " + (state.blockchain.startTime || new Date()).toString() + // ); + // let maxCacheSize; + // if (options.forkCacheSize === -1) { + // maxCacheSize = "∞"; + // } else { + // maxCacheSize = options.forkCacheSize + " bytes"; + // } + // console.log("Max Cache Size: " + maxCacheSize); + // } + + console.log(""); + console.log("Listening on " + host + ":" + port); +} + +server.listen(port, host, startGanache); diff --git a/src/packages/cli/tsconfig.json b/src/packages/cli/tsconfig.json new file mode 100644 index 0000000000..62676b00a1 --- /dev/null +++ b/src/packages/cli/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["src"] +} From d78fda227eb74d974a532ed2e431d662321fe1bf Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 7 Nov 2020 12:25:11 -0500 Subject: [PATCH 682/691] fix host bug --- src/packages/core/src/server.ts | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index 035d3b1645..347ee20823 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -6,10 +6,10 @@ import Connector from "./connector"; import WebsocketServer, { WebSocketCapableFlavor } from "./servers/ws-server"; import HttpServer from "./servers/http-server"; -const DEFAULT_HOST = "127.0.0.1"; - type Providers = Connectors["provider"]; +const DEFAULT_HOST = "127.0.0.1"; + type Callback = (err: Error | null) => void; /** @@ -84,12 +84,10 @@ export default class Server { host?: string | Callback, callback?: Callback ): void | Promise { - let hostname: string; + let hostname: string = null; if (typeof host === "function") { callback = host; - hostname = DEFAULT_HOST; - } else if (host == null) { - hostname = DEFAULT_HOST; + hostname = null; } const callbackIsFunction = typeof callback === "function"; const status = this.#status; @@ -114,12 +112,14 @@ export default class Server { // Make sure we have *exclusive* use of this port. // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; - (this.#app as any).listen( - hostname, - port as any, - LIBUS_LISTEN_EXCLUSIVE_PORT, - resolve - ); + hostname + ? this.#app.listen( + hostname, + port, + LIBUS_LISTEN_EXCLUSIVE_PORT, + resolve + ) + : this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); } ).then(listenSocket => { if (listenSocket) { @@ -129,7 +129,9 @@ export default class Server { } else { this.#status = Status.closed; const err = new Error( - `listen EADDRINUSE: address already in use ${hostname}:${port}.` + `listen EADDRINUSE: address already in use ${ + hostname || DEFAULT_HOST + }:${port}.` ); if (callbackIsFunction) callback!(err); else throw err; From b8c5503d87652f21eabe1dc07945061ee7483fa0 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 7 Nov 2020 14:45:05 -0500 Subject: [PATCH 683/691] reorganize things --- CONTRIBUTING.md | 4 +- docs/launch.json | 2 +- lerna.json | 2 +- scripts/create.ts | 49 ++-- src/chains/ethereum/.npmignore | 2 +- src/chains/ethereum/index.ts | 13 +- src/chains/ethereum/npm-shrinkwrap.json | 16 -- src/chains/ethereum/package.json | 7 +- .../ethereum/src/{index.ts => connector.ts} | 0 .../ethereum/src/options/chain-options.ts | 4 +- .../ethereum/src/options/database-options.ts | 2 +- src/chains/ethereum/src/options/helpers.ts | 1 + .../ethereum/src/options/logging-options.ts | 3 +- .../ethereum/src/options/miner-options.ts | 17 +- .../ethereum/src/options/wallet-options.ts | 2 +- .../@types/solc/index.d.ts | 0 .../{__tests__ => tests}/api/bzz/bzz.test.ts | 0 .../{__tests__ => tests}/api/db/db.test.ts | 0 .../api/eth/contracts/GetCode.sol | 0 .../api/eth/contracts/GetStorageAt.sol | 0 .../api/eth/contracts/Logs.sol | 0 .../api/eth/contracts/Reverts.sol | 0 .../{__tests__ => tests}/api/eth/eth.test.ts | 0 .../api/eth/getCode.test.ts | 0 .../api/eth/getStorageAt.test.ts | 0 .../api/eth/legacyInstamining.test.ts | 0 .../{__tests__ => tests}/api/eth/logs.test.ts | 0 .../api/eth/sendRawTransaction.test.ts | 0 .../api/eth/sendTransaction.test.ts | 0 .../{__tests__ => tests}/api/eth/sign.test.ts | 0 .../api/eth/signTypedData.test.ts | 0 .../api/eth/subscribe.test.ts | 0 .../api/eth/uncles.test.ts | 0 .../{__tests__ => tests}/api/evm/evm.test.ts | 0 .../{__tests__ => tests}/api/evm/snapshot.sol | 0 .../api/evm/snapshot.test.ts | 0 .../api/miner/miner.test.ts | 0 .../{__tests__ => tests}/api/net/net.test.ts | 0 .../api/personal/personal.test.ts | 0 .../api/rpc/modules.test.ts | 0 .../{__tests__ => tests}/api/shh/shh.test.ts | 0 .../api/web3/web3.test.ts | 0 .../contracts/HelloWorld.sol | 0 .../{__tests__ => tests}/helpers/compile.ts | 0 .../helpers/getProvider.ts | 0 .../{__tests__ => tests}/provider.test.ts | 0 .../{__tests__ => tests}/temp-tests.test.ts | 0 .../{__tests__ => tests}/tsconfig.json | 0 src/chains/ethereum/tsconfig.json | 2 +- src/chains/tezos/.npmignore | 2 +- src/chains/tezos/index.ts | 46 +++- src/chains/tezos/package.json | 2 +- src/chains/tezos/src/index.ts | 42 --- .../tezos/{__tests__ => tests}/index.test.ts | 0 src/chains/tezos/tsconfig.json | 2 +- src/packages/cli/.npmignore | 2 +- src/packages/cli/index.ts | 7 +- src/packages/cli/npm-shrinkwrap.json | 227 ++++++++++++++++ src/packages/cli/package.json | 14 +- src/packages/cli/src/{index.ts => cli.ts} | 4 +- .../cli/{__tests__ => tests}/index.test.ts | 2 +- src/packages/cli/tsconfig.json | 2 +- src/packages/core/.npmignore | 2 +- src/packages/core/index.ts | 12 +- src/packages/core/npm-shrinkwrap.json | 16 -- src/packages/core/package.json | 11 +- src/packages/core/src/index.ts | 11 - .../core/src/options/server-options.ts | 1 - src/packages/core/src/server.ts | 4 +- .../{__tests__ => tests}/connector.test.ts | 2 +- .../helpers/getProvider.ts | 0 .../{__tests__ => tests}/interface.test.ts | 2 +- .../core/{__tests__ => tests}/server.test.ts | 2 +- ...a4012219db100ef0a340307869393f9df55ebd470c | 0 ...3d12ccdd1938364fb8e72dcdda25d6baa70992b80f | 0 ...a730bb0282bbaaadd8ac1b94510b69a499527c3505 | 0 ...243a1661770198770b14029eed74f0eb473c79cd83 | 0 src/packages/core/tsconfig.json | 2 +- src/packages/flavors/.npmignore | 2 +- src/packages/flavors/index.ts | 29 ++- src/packages/flavors/npm-shrinkwrap.json | 246 +++++++++++++++++- src/packages/flavors/package.json | 7 +- src/packages/flavors/src/index.ts | 25 -- .../{__tests__ => tests}/index.test.ts | 0 src/packages/flavors/tsconfig.json | 2 +- src/packages/ganache/.npmignore | 2 +- src/packages/ganache/{src => }/index.ts | 0 src/packages/ganache/npm-shrinkwrap.json | 21 ++ src/packages/ganache/package.json | 9 +- .../{__tests__ => tests}/index.test.ts | 2 +- src/packages/ganache/tsconfig.json | 2 +- .../ganache/webpack/webpack.common.config.ts | 2 +- src/packages/options/.npmignore | 2 +- src/packages/options/index.ts | 17 +- src/packages/options/npm-shrinkwrap.json | 227 ++++++++++++++++ src/packages/options/package.json | 5 +- .../options/src/{helpers => }/base.ts | 8 +- .../options/src/{helpers => }/create.ts | 0 .../options/src/{helpers => }/definition.ts | 0 .../options/src/{helpers => }/exclusive.ts | 0 .../options/src/{helpers => }/getters.ts | 0 src/packages/options/src/helpers/index.ts | 11 - src/packages/options/src/index.ts | 1 - src/packages/options/tests/index.test.ts | 7 + src/packages/options/tsconfig.json | 2 +- src/packages/promise-queue/.npmignore | 2 +- src/packages/promise-queue/index.ts | 111 +++++++- src/packages/promise-queue/package.json | 10 +- src/packages/promise-queue/src/index.ts | 108 -------- .../{__tests__ => tests}/index.test.ts | 2 +- src/packages/utils/.npmignore | 2 +- src/packages/utils/index.ts | 13 +- src/packages/utils/package.json | 4 +- src/packages/utils/src/index.ts | 7 - .../utils/{__tests__ => tests}/utils.test.ts | 0 src/packages/utils/tsconfig.json | 2 +- 116 files changed, 1051 insertions(+), 382 deletions(-) rename src/chains/ethereum/src/{index.ts => connector.ts} (100%) create mode 100644 src/chains/ethereum/src/options/helpers.ts rename src/chains/ethereum/{__tests__ => tests}/@types/solc/index.d.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/bzz/bzz.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/db/db.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/contracts/GetCode.sol (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/contracts/GetStorageAt.sol (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/contracts/Logs.sol (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/contracts/Reverts.sol (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/eth.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/getCode.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/getStorageAt.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/legacyInstamining.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/logs.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/sendRawTransaction.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/sendTransaction.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/sign.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/signTypedData.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/subscribe.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/eth/uncles.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/evm/evm.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/evm/snapshot.sol (100%) rename src/chains/ethereum/{__tests__ => tests}/api/evm/snapshot.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/miner/miner.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/net/net.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/personal/personal.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/rpc/modules.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/shh/shh.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/api/web3/web3.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/contracts/HelloWorld.sol (100%) rename src/chains/ethereum/{__tests__ => tests}/helpers/compile.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/helpers/getProvider.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/provider.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/temp-tests.test.ts (100%) rename src/chains/ethereum/{__tests__ => tests}/tsconfig.json (100%) delete mode 100644 src/chains/tezos/src/index.ts rename src/chains/tezos/{__tests__ => tests}/index.test.ts (100%) rename src/packages/cli/src/{index.ts => cli.ts} (99%) rename src/packages/cli/{__tests__ => tests}/index.test.ts (76%) delete mode 100644 src/packages/core/src/index.ts rename src/packages/core/{__tests__ => tests}/connector.test.ts (99%) rename src/packages/core/{__tests__ => tests}/helpers/getProvider.ts (100%) rename src/packages/core/{__tests__ => tests}/interface.test.ts (94%) rename src/packages/core/{__tests__ => tests}/server.test.ts (99%) rename src/packages/core/{__tests__ => tests}/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c (100%) rename src/packages/core/{__tests__ => tests}/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f (100%) rename src/packages/core/{__tests__ => tests}/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 (100%) rename src/packages/core/{__tests__ => tests}/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 (100%) delete mode 100644 src/packages/flavors/src/index.ts rename src/packages/flavors/{__tests__ => tests}/index.test.ts (100%) rename src/packages/ganache/{src => }/index.ts (100%) rename src/packages/ganache/{__tests__ => tests}/index.test.ts (74%) rename src/packages/options/src/{helpers => }/base.ts (72%) rename src/packages/options/src/{helpers => }/create.ts (100%) rename src/packages/options/src/{helpers => }/definition.ts (100%) rename src/packages/options/src/{helpers => }/exclusive.ts (100%) rename src/packages/options/src/{helpers => }/getters.ts (100%) delete mode 100644 src/packages/options/src/helpers/index.ts delete mode 100644 src/packages/options/src/index.ts create mode 100644 src/packages/options/tests/index.test.ts delete mode 100644 src/packages/promise-queue/src/index.ts rename src/packages/promise-queue/{__tests__ => tests}/index.test.ts (73%) delete mode 100644 src/packages/utils/src/index.ts rename src/packages/utils/{__tests__ => tests}/utils.test.ts (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9403b966fe..b55bdff3f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -111,8 +111,8 @@ index 2a2aa9e..57cbf21 100644 "--colors", "--require", "ts-node/register", -- "${workspaceFolder}/src/**/__tests__/**/*.test.ts" -+ "${workspaceFolder}/src/chains/ethereum/__tests__/**/*.test.ts" +- "${workspaceFolder}/src/**/tests/**/*.test.ts" ++ "${workspaceFolder}/src/chains/ethereum/tests/**/*.test.ts" ], "skipFiles": ["/**"], "console": "integratedTerminal", diff --git a/docs/launch.json b/docs/launch.json index 22293bdec6..5022ee3196 100644 --- a/docs/launch.json +++ b/docs/launch.json @@ -24,7 +24,7 @@ "--colors", "--require", "ts-node/register", - "${workspaceFolder}/src/**/__tests__/**/*.test.ts" + "${workspaceFolder}/src/**/tests/**/*.test.ts" ], "skipFiles": ["/**"], "console": "integratedTerminal", diff --git a/lerna.json b/lerna.json index 80afc5f80a..f53127ee45 100644 --- a/lerna.json +++ b/lerna.json @@ -1,4 +1,4 @@ { "packages": ["src/packages/*", "src/chains/*"], - "version": "2.2.1" + "version": "independent" } diff --git a/scripts/create.ts b/scripts/create.ts index 39abf32b01..aab83848c2 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -101,9 +101,10 @@ process.stdout.write(`${COLORS.Reset}`); license: "MIT", main: "lib/index.js", types: "src/index.ts", + source: "index.ts", directories: { lib: "lib", - test: "__tests__" + test: "test" }, files: ["lib"], repository: { @@ -115,7 +116,7 @@ process.stdout.write(`${COLORS.Reset}`); tsc: "ttsc", test: "nyc npm run mocha", mocha: - "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" + "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'" }, bugs: { url: "https://github.com/trufflesuite/ganache-core/issues" @@ -161,17 +162,10 @@ describe("${packageName}", () => { const indexFile = `export default { // TODO } -`; - - const rootIndexFile = `// ************************************************************************* // -// This file is necessary to "trick" typescript into using our ./src/**/*.ts // -// files when developing, debugging, and running tests // -// ************************************************************************* // -export * from "./src/index"; `; const dir = join(workspaceDir, "src", location, name); - const tests = join(dir, "__tests__"); + const tests = join(dir, "tests"); const src = join(dir, "src"); function initSrc() { @@ -181,12 +175,33 @@ export * from "./src/index"; ); } - function initRootIndex() { + function initIndex() { + // When a bundler compiles our libs this headerdoc comment will cause that + // tool to retain our LICENSE information in their bundled output. + const headerdoc = `/*! + * ${packageName} + * + * @copyright Truffle Blockchain Group + * @author ${pkg.author} + * @license ${pkg.license} +*/ + +`; + return writeFile( + join(dir, "index.ts"), + prettier.format(headerdoc + indexFile, { + ...prettierConfig, + parser: "typescript" + }) + ); + } + + function initRootFiles() { return Promise.all([ writeFile( join(dir, ".npmignore"), `./index.ts -__tests__ +tests .nyc_output coverage scripts @@ -195,13 +210,6 @@ tsconfig.json typedoc.json ` ), - writeFile( - join(dir, "index.ts"), - prettier.format(rootIndexFile, { - ...prettierConfig, - parser: "typescript" - }) - ), writeFile(join(dir, "LICENSE"), LICENSE) ]); } @@ -222,7 +230,8 @@ typedoc.json mkdirSync(dir); await Promise.all([ - initRootIndex(), + initRootFiles(), + initIndex(), mkdir(tests).then(initTests), mkdir(src).then(initSrc), writeFile( diff --git a/src/chains/ethereum/.npmignore b/src/chains/ethereum/.npmignore index b1e1059b5c..115ab4f024 100644 --- a/src/chains/ethereum/.npmignore +++ b/src/chains/ethereum/.npmignore @@ -1,5 +1,5 @@ ./index.ts -__tests__ +tests .nyc_output coverage scripts diff --git a/src/chains/ethereum/index.ts b/src/chains/ethereum/index.ts index 3b05966675..e035a1fa9f 100644 --- a/src/chains/ethereum/index.ts +++ b/src/chains/ethereum/index.ts @@ -1,6 +1,9 @@ -// ************************************************************************* // -// This file is necessary to "trick" typescript into using our ./src/**/*.ts // -// files when developing, debugging, and running tests // -// ************************************************************************* // +/*! + * @ganache/ethereum + * + * @copyright 2019-2020 Truffle Blockchain Group + * @author David Murdoch (https://davidmurdoch.com) + * @license MIT + */ -export * from "./src/index"; +export * from "./src/connector"; diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/npm-shrinkwrap.json index 1ce25d2fcc..9e70451782 100644 --- a/src/chains/ethereum/npm-shrinkwrap.json +++ b/src/chains/ethereum/npm-shrinkwrap.json @@ -39,12 +39,6 @@ "@types/node": "*" } }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, "@types/fs-extra": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.2.tgz", @@ -104,16 +98,6 @@ "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", "dev": true }, - "@types/uws": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", - "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/node": "*" - } - }, "@types/ws": { "version": "7.2.7", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.2.7.tgz", diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/package.json index 812404c246..eab86a37a9 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/package.json @@ -7,10 +7,10 @@ "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", - "source": "src/index.ts", + "source": "index.ts", "directories": { "lib": "lib", - "test": "__tests__" + "test": "tests" }, "files": [ "lib" @@ -28,7 +28,7 @@ "docs.post-process": "node ./scripts/post-process-docs.js", "tsc": "ttsc", "test": "nyc --reporter lcov npm run mocha", - "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" @@ -80,7 +80,6 @@ "@types/lodash.clonedeep": "4.5.6", "@types/secp256k1": "4.0.1", "@types/seedrandom": "2.4.28", - "@types/uws": "0.13.2", "@types/ws": "7.2.7", "cheerio": "1.0.0-rc.3", "fs-extra": "9.0.1", diff --git a/src/chains/ethereum/src/index.ts b/src/chains/ethereum/src/connector.ts similarity index 100% rename from src/chains/ethereum/src/index.ts rename to src/chains/ethereum/src/connector.ts diff --git a/src/chains/ethereum/src/options/chain-options.ts b/src/chains/ethereum/src/options/chain-options.ts index 140f0acc2f..3fa46bde30 100644 --- a/src/chains/ethereum/src/options/chain-options.ts +++ b/src/chains/ethereum/src/options/chain-options.ts @@ -1,3 +1,4 @@ +import { normalize } from "./helpers"; import { Definitions } from "@ganache/options"; export type Hardfork = @@ -128,11 +129,8 @@ export type ChainConfig = { }; }; }; - exclusiveGroups: []; }; -const normalize = (rawInput: T) => rawInput; - export const ChainOptions: Definitions = { allowUnlimitedContractSize: { normalize, diff --git a/src/chains/ethereum/src/options/database-options.ts b/src/chains/ethereum/src/options/database-options.ts index 97c48f288c..97dc431f9b 100644 --- a/src/chains/ethereum/src/options/database-options.ts +++ b/src/chains/ethereum/src/options/database-options.ts @@ -1,3 +1,4 @@ +import { normalize } from "./helpers"; import { Definitions } from "@ganache/options"; export type DatabaseConfig = { @@ -31,7 +32,6 @@ export type DatabaseConfig = { }; exclusiveGroups: [["db", "dbPath"]]; }; -const normalize = (rawInput: T) => rawInput; export const DatabaseOptions: Definitions = { db: { diff --git a/src/chains/ethereum/src/options/helpers.ts b/src/chains/ethereum/src/options/helpers.ts new file mode 100644 index 0000000000..b2961afe57 --- /dev/null +++ b/src/chains/ethereum/src/options/helpers.ts @@ -0,0 +1 @@ +export const normalize = (rawInput: T) => rawInput; diff --git a/src/chains/ethereum/src/options/logging-options.ts b/src/chains/ethereum/src/options/logging-options.ts index 99d34db4d2..2ec70f9609 100644 --- a/src/chains/ethereum/src/options/logging-options.ts +++ b/src/chains/ethereum/src/options/logging-options.ts @@ -1,3 +1,4 @@ +import { normalize } from "./helpers"; import { Definitions } from "@ganache/options"; export type Logger = { @@ -63,11 +64,9 @@ export type LoggingConfig = { }; }; }; - exclusiveGroups: []; }; const logger: Logger = { log: console.log.bind(console) }; -const normalize = (rawInput: T) => rawInput; export const LoggingOptions: Definitions = { debug: { diff --git a/src/chains/ethereum/src/options/miner-options.ts b/src/chains/ethereum/src/options/miner-options.ts index 9e3eefd17e..e209540d67 100644 --- a/src/chains/ethereum/src/options/miner-options.ts +++ b/src/chains/ethereum/src/options/miner-options.ts @@ -1,7 +1,7 @@ -import { Data, Quantity, utils } from "@ganache/utils"; +import { normalize } from "./helpers"; +import { Quantity, utils } from "@ganache/utils"; import { Definitions } from "@ganache/options"; import Address from "../things/address"; -import { DatabaseOptions } from "./database-options"; export type MinerConfig = { options: { @@ -120,11 +120,8 @@ export type MinerConfig = { type: string; }; }; - exclusiveGroups: []; }; -const normalize = (rawInput: T) => rawInput; - export const MinerOptions: Definitions = { blockTime: { normalize, @@ -143,7 +140,7 @@ export const MinerOptions: Definitions = { }, defaultTransactionGasLimit: { normalize: Quantity.from, - default: () => Quantity.from(90000) + default: () => Quantity.from(90_000) }, callGasLimit: { normalize: Quantity.from, @@ -159,11 +156,11 @@ export const MinerOptions: Definitions = { default: () => false }, extraData: { - normalize: rawType => { - if (rawType.length > 32) { - throw new Error(`extra exceeds max length. ${rawType.length} > 32`); + normalize: extra => { + if (extra.length > 32) { + throw new Error(`extra exceeds max length. ${extra.length} > 32`); } - return rawType; + return extra; } } }; diff --git a/src/chains/ethereum/src/options/wallet-options.ts b/src/chains/ethereum/src/options/wallet-options.ts index d3d643df3d..2628835403 100644 --- a/src/chains/ethereum/src/options/wallet-options.ts +++ b/src/chains/ethereum/src/options/wallet-options.ts @@ -1,3 +1,4 @@ +import { normalize } from "./helpers"; import seedrandom from "seedrandom"; import { entropyToMnemonic } from "bip39"; @@ -176,7 +177,6 @@ export type WalletConfig = { }; exclusiveGroups: [["totalAccounts", "accounts"], ["mnemonic", "seed"]]; }; -const normalize = (rawInput: T) => rawInput; export const WalletOptions: Definitions = { totalAccounts: { diff --git a/src/chains/ethereum/__tests__/@types/solc/index.d.ts b/src/chains/ethereum/tests/@types/solc/index.d.ts similarity index 100% rename from src/chains/ethereum/__tests__/@types/solc/index.d.ts rename to src/chains/ethereum/tests/@types/solc/index.d.ts diff --git a/src/chains/ethereum/__tests__/api/bzz/bzz.test.ts b/src/chains/ethereum/tests/api/bzz/bzz.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/bzz/bzz.test.ts rename to src/chains/ethereum/tests/api/bzz/bzz.test.ts diff --git a/src/chains/ethereum/__tests__/api/db/db.test.ts b/src/chains/ethereum/tests/api/db/db.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/db/db.test.ts rename to src/chains/ethereum/tests/api/db/db.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol b/src/chains/ethereum/tests/api/eth/contracts/GetCode.sol similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/contracts/GetCode.sol rename to src/chains/ethereum/tests/api/eth/contracts/GetCode.sol diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol b/src/chains/ethereum/tests/api/eth/contracts/GetStorageAt.sol similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/contracts/GetStorageAt.sol rename to src/chains/ethereum/tests/api/eth/contracts/GetStorageAt.sol diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol b/src/chains/ethereum/tests/api/eth/contracts/Logs.sol similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/contracts/Logs.sol rename to src/chains/ethereum/tests/api/eth/contracts/Logs.sol diff --git a/src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol b/src/chains/ethereum/tests/api/eth/contracts/Reverts.sol similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/contracts/Reverts.sol rename to src/chains/ethereum/tests/api/eth/contracts/Reverts.sol diff --git a/src/chains/ethereum/__tests__/api/eth/eth.test.ts b/src/chains/ethereum/tests/api/eth/eth.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/eth.test.ts rename to src/chains/ethereum/tests/api/eth/eth.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/getCode.test.ts b/src/chains/ethereum/tests/api/eth/getCode.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/getCode.test.ts rename to src/chains/ethereum/tests/api/eth/getCode.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts b/src/chains/ethereum/tests/api/eth/getStorageAt.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/getStorageAt.test.ts rename to src/chains/ethereum/tests/api/eth/getStorageAt.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/tests/api/eth/legacyInstamining.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/legacyInstamining.test.ts rename to src/chains/ethereum/tests/api/eth/legacyInstamining.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/logs.test.ts b/src/chains/ethereum/tests/api/eth/logs.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/logs.test.ts rename to src/chains/ethereum/tests/api/eth/logs.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts b/src/chains/ethereum/tests/api/eth/sendRawTransaction.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/sendRawTransaction.test.ts rename to src/chains/ethereum/tests/api/eth/sendRawTransaction.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts b/src/chains/ethereum/tests/api/eth/sendTransaction.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/sendTransaction.test.ts rename to src/chains/ethereum/tests/api/eth/sendTransaction.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/sign.test.ts b/src/chains/ethereum/tests/api/eth/sign.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/sign.test.ts rename to src/chains/ethereum/tests/api/eth/sign.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts b/src/chains/ethereum/tests/api/eth/signTypedData.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/signTypedData.test.ts rename to src/chains/ethereum/tests/api/eth/signTypedData.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/subscribe.test.ts b/src/chains/ethereum/tests/api/eth/subscribe.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/subscribe.test.ts rename to src/chains/ethereum/tests/api/eth/subscribe.test.ts diff --git a/src/chains/ethereum/__tests__/api/eth/uncles.test.ts b/src/chains/ethereum/tests/api/eth/uncles.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/eth/uncles.test.ts rename to src/chains/ethereum/tests/api/eth/uncles.test.ts diff --git a/src/chains/ethereum/__tests__/api/evm/evm.test.ts b/src/chains/ethereum/tests/api/evm/evm.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/evm/evm.test.ts rename to src/chains/ethereum/tests/api/evm/evm.test.ts diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.sol b/src/chains/ethereum/tests/api/evm/snapshot.sol similarity index 100% rename from src/chains/ethereum/__tests__/api/evm/snapshot.sol rename to src/chains/ethereum/tests/api/evm/snapshot.sol diff --git a/src/chains/ethereum/__tests__/api/evm/snapshot.test.ts b/src/chains/ethereum/tests/api/evm/snapshot.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/evm/snapshot.test.ts rename to src/chains/ethereum/tests/api/evm/snapshot.test.ts diff --git a/src/chains/ethereum/__tests__/api/miner/miner.test.ts b/src/chains/ethereum/tests/api/miner/miner.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/miner/miner.test.ts rename to src/chains/ethereum/tests/api/miner/miner.test.ts diff --git a/src/chains/ethereum/__tests__/api/net/net.test.ts b/src/chains/ethereum/tests/api/net/net.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/net/net.test.ts rename to src/chains/ethereum/tests/api/net/net.test.ts diff --git a/src/chains/ethereum/__tests__/api/personal/personal.test.ts b/src/chains/ethereum/tests/api/personal/personal.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/personal/personal.test.ts rename to src/chains/ethereum/tests/api/personal/personal.test.ts diff --git a/src/chains/ethereum/__tests__/api/rpc/modules.test.ts b/src/chains/ethereum/tests/api/rpc/modules.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/rpc/modules.test.ts rename to src/chains/ethereum/tests/api/rpc/modules.test.ts diff --git a/src/chains/ethereum/__tests__/api/shh/shh.test.ts b/src/chains/ethereum/tests/api/shh/shh.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/shh/shh.test.ts rename to src/chains/ethereum/tests/api/shh/shh.test.ts diff --git a/src/chains/ethereum/__tests__/api/web3/web3.test.ts b/src/chains/ethereum/tests/api/web3/web3.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/api/web3/web3.test.ts rename to src/chains/ethereum/tests/api/web3/web3.test.ts diff --git a/src/chains/ethereum/__tests__/contracts/HelloWorld.sol b/src/chains/ethereum/tests/contracts/HelloWorld.sol similarity index 100% rename from src/chains/ethereum/__tests__/contracts/HelloWorld.sol rename to src/chains/ethereum/tests/contracts/HelloWorld.sol diff --git a/src/chains/ethereum/__tests__/helpers/compile.ts b/src/chains/ethereum/tests/helpers/compile.ts similarity index 100% rename from src/chains/ethereum/__tests__/helpers/compile.ts rename to src/chains/ethereum/tests/helpers/compile.ts diff --git a/src/chains/ethereum/__tests__/helpers/getProvider.ts b/src/chains/ethereum/tests/helpers/getProvider.ts similarity index 100% rename from src/chains/ethereum/__tests__/helpers/getProvider.ts rename to src/chains/ethereum/tests/helpers/getProvider.ts diff --git a/src/chains/ethereum/__tests__/provider.test.ts b/src/chains/ethereum/tests/provider.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/provider.test.ts rename to src/chains/ethereum/tests/provider.test.ts diff --git a/src/chains/ethereum/__tests__/temp-tests.test.ts b/src/chains/ethereum/tests/temp-tests.test.ts similarity index 100% rename from src/chains/ethereum/__tests__/temp-tests.test.ts rename to src/chains/ethereum/tests/temp-tests.test.ts diff --git a/src/chains/ethereum/__tests__/tsconfig.json b/src/chains/ethereum/tests/tsconfig.json similarity index 100% rename from src/chains/ethereum/__tests__/tsconfig.json rename to src/chains/ethereum/tests/tsconfig.json diff --git a/src/chains/ethereum/tsconfig.json b/src/chains/ethereum/tsconfig.json index 8c3d008ad2..0c41d652c6 100644 --- a/src/chains/ethereum/tsconfig.json +++ b/src/chains/ethereum/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"], + "include": ["index.ts"], "typeRoots": ["./node_modules/@types", "./src/@types"] } diff --git a/src/chains/tezos/.npmignore b/src/chains/tezos/.npmignore index b1e1059b5c..115ab4f024 100644 --- a/src/chains/tezos/.npmignore +++ b/src/chains/tezos/.npmignore @@ -1,5 +1,5 @@ ./index.ts -__tests__ +tests .nyc_output coverage scripts diff --git a/src/chains/tezos/index.ts b/src/chains/tezos/index.ts index 3b05966675..5a788f80bd 100644 --- a/src/chains/tezos/index.ts +++ b/src/chains/tezos/index.ts @@ -1,6 +1,42 @@ -// ************************************************************************* // -// This file is necessary to "trick" typescript into using our ./src/**/*.ts // -// files when developing, debugging, and running tests // -// ************************************************************************* // +import Emittery from "emittery"; +import { utils, types } from "@ganache/utils"; +import Provider from "./src/provider"; +import TezosApi from "./src/api"; +import { HttpRequest } from "uWebSockets.js"; -export * from "./src/index"; +export type TezosProvider = Provider; +export const TezosProvider = Provider; + +export class TezosConnector + extends Emittery.Typed + implements types.Connector { + provider: Provider; + #api: TezosApi; + + constructor(providerOptions: any, requestCoordinator: utils.Executor) { + super(); + + const api = (this.#api = new TezosApi()); + this.provider = new Provider(providerOptions); + } + + format(result: any) { + return JSON.stringify(result); + } + + formatError(error: any) { + return JSON.stringify(error); + } + + parse(message: Buffer) { + return JSON.parse(message); + } + + handle(payload: any, _connection: HttpRequest): Promise { + return Promise.resolve(123); + } + + close() { + return {}; + } +} diff --git a/src/chains/tezos/package.json b/src/chains/tezos/package.json index e5163246ca..00a21f3240 100644 --- a/src/chains/tezos/package.json +++ b/src/chains/tezos/package.json @@ -10,7 +10,7 @@ "source": "src/index.ts", "directories": { "lib": "lib", - "test": "__tests__" + "test": "tests" }, "files": [ "lib" diff --git a/src/chains/tezos/src/index.ts b/src/chains/tezos/src/index.ts deleted file mode 100644 index 2e56ae6710..0000000000 --- a/src/chains/tezos/src/index.ts +++ /dev/null @@ -1,42 +0,0 @@ -import Emittery from "emittery"; -import { utils, types } from "@ganache/utils"; -import Provider from "./provider"; -import TezosApi from "./api"; -import { HttpRequest } from "uWebSockets.js"; - -export type TezosProvider = Provider; -export const TezosProvider = Provider; - -export class TezosConnector - extends Emittery.Typed - implements types.Connector { - provider: Provider; - #api: TezosApi; - - constructor(providerOptions: any, requestCoordinator: utils.Executor) { - super(); - - const api = (this.#api = new TezosApi()); - this.provider = new Provider(providerOptions); - } - - format(result: any) { - return JSON.stringify(result); - } - - formatError(error: any) { - return JSON.stringify(error); - } - - parse(message: Buffer) { - return JSON.parse(message); - } - - handle(payload: any, _connection: HttpRequest): Promise { - return Promise.resolve(123); - } - - close() { - return {}; - } -} diff --git a/src/chains/tezos/__tests__/index.test.ts b/src/chains/tezos/tests/index.test.ts similarity index 100% rename from src/chains/tezos/__tests__/index.test.ts rename to src/chains/tezos/tests/index.test.ts diff --git a/src/chains/tezos/tsconfig.json b/src/chains/tezos/tsconfig.json index 62676b00a1..25d5c3cf7e 100644 --- a/src/chains/tezos/tsconfig.json +++ b/src/chains/tezos/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["index.ts"] } diff --git a/src/packages/cli/.npmignore b/src/packages/cli/.npmignore index b1e1059b5c..115ab4f024 100644 --- a/src/packages/cli/.npmignore +++ b/src/packages/cli/.npmignore @@ -1,5 +1,5 @@ ./index.ts -__tests__ +tests .nyc_output coverage scripts diff --git a/src/packages/cli/index.ts b/src/packages/cli/index.ts index f9c66395b9..23657f8cb5 100644 --- a/src/packages/cli/index.ts +++ b/src/packages/cli/index.ts @@ -1,5 +1,2 @@ -// ************************************************************************* // -// This file is necessary to "trick" typescript into using our ./src/**/*.ts // -// files when developing, debugging, and running tests // -// ************************************************************************* // -export * from "./src/index"; +import Ganache from "@ganache/core"; +export default Ganache; diff --git a/src/packages/cli/npm-shrinkwrap.json b/src/packages/cli/npm-shrinkwrap.json index ccd2cf1917..fe02034501 100644 --- a/src/packages/cli/npm-shrinkwrap.json +++ b/src/packages/cli/npm-shrinkwrap.json @@ -33,6 +33,15 @@ "@types/node": "*" } }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, "base-x": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", @@ -92,6 +101,17 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -101,6 +121,88 @@ "safe-buffer": "^5.0.1" } }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "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=", + "dev": true + }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -147,6 +249,12 @@ } } }, + "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=", + "dev": true + }, "ethereum-cryptography": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", @@ -200,6 +308,55 @@ "safe-buffer": "^5.1.1" } }, + "google-closure-compiler": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler/-/google-closure-compiler-20201102.0.1.tgz", + "integrity": "sha512-Cz+1jOswH0MwMVPu1rRH1xD4KYuY5XW2ox5aXwqaAxevqmirhr36f8wgKPHuVRSovFejW640r6UFwyrOT6U0CA==", + "dev": true, + "requires": { + "chalk": "2.x", + "google-closure-compiler-java": "^20201102.0.1", + "google-closure-compiler-linux": "^20201102.0.1", + "google-closure-compiler-osx": "^20201102.0.1", + "google-closure-compiler-windows": "^20201102.0.1", + "minimist": "1.x", + "vinyl": "2.x", + "vinyl-sourcemaps-apply": "^0.2.0" + } + }, + "google-closure-compiler-java": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20201102.0.1.tgz", + "integrity": "sha512-pXJIlyqepHhih0HCbShkAZJyViIxdyd4V7MnCUZEXLIIlygw92e2dC+5XiONDQZgRlF93BPmWCy9jr7wYoW1hQ==", + "dev": true + }, + "google-closure-compiler-linux": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-linux/-/google-closure-compiler-linux-20201102.0.1.tgz", + "integrity": "sha512-aRbyTGnQoFXchcpEFNrP1p/WIvYOgN3hYKI+MOHWkvwVJBY2P8gpb07hAigO8fj+QKD/SFCl+2pXP+JniWOEqw==", + "dev": true, + "optional": true + }, + "google-closure-compiler-osx": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-osx/-/google-closure-compiler-osx-20201102.0.1.tgz", + "integrity": "sha512-VguqEAOYI6XYZN6JcLMP8fpsoXk1Z9YuntMjv0IDVydkbZaHYOI4zE39FJhMuWiN7gOzSX2b/BBC6GsSh1F3fw==", + "dev": true, + "optional": true + }, + "google-closure-compiler-windows": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-windows/-/google-closure-compiler-windows-20201102.0.1.tgz", + "integrity": "sha512-LlynipQi/iP76mjkOu6Rc1mCRuxTAhRvLjq10aGfVjKwpbCAF0Jq2a5k2ygr4xYiINNi2/L2qUw6ObPm9wQCOw==", + "dev": true, + "optional": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -239,6 +396,12 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "keccak": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", @@ -268,6 +431,12 @@ "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", @@ -290,6 +459,12 @@ "sha.js": "^2.4.8" } }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -308,6 +483,18 @@ "util-deprecate": "^1.0.1" } }, + "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=", + "dev": true + }, + "replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true + }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -382,10 +569,50 @@ "is-hex-prefixed": "1.0.0" } }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + }, + "vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "dev": true, + "requires": { + "source-map": "^0.5.1" + }, + "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 + } + } } } } diff --git a/src/packages/cli/package.json b/src/packages/cli/package.json index 84c5795ddb..529a50f8fd 100644 --- a/src/packages/cli/package.json +++ b/src/packages/cli/package.json @@ -6,10 +6,15 @@ "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/cli#readme", "license": "MIT", "main": "lib/index.js", - "types": "src/index.ts", + "types": "lib/index.d.ts", + "source": "index.ts", + "bin": { + "ganache": "./lib/cli.js", + "ganache-cli": "./lib/cli.js" + }, "directories": { "lib": "lib", - "test": "__tests__" + "test": "tests" }, "files": [ "lib" @@ -22,7 +27,7 @@ "scripts": { "tsc": "ttsc", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" @@ -43,7 +48,8 @@ "truffle" ], "devDependencies": { - "@ganache/core": "^0.1.0" + "@ganache/core": "^0.1.0", + "google-closure-compiler": "20201102.0.1" }, "dependencies": { "@types/node": "14.14.6", diff --git a/src/packages/cli/src/index.ts b/src/packages/cli/src/cli.ts similarity index 99% rename from src/packages/cli/src/index.ts rename to src/packages/cli/src/cli.ts index 87203d5ccb..91a6b77dfa 100644 --- a/src/packages/cli/src/index.ts +++ b/src/packages/cli/src/cli.ts @@ -1,11 +1,9 @@ #!/usr/bin/env node -import Ganache from "@ganache/core"; +import Ganache from "../index"; import { $INLINE_JSON } from "ts-transformer-inline-file"; import { toChecksumAddress } from "ethereumjs-util"; -export default Ganache; - const { version: ganacheVersion } = $INLINE_JSON("../../core/package.json"); const { version } = $INLINE_JSON("../package.json"); const detailedVersion = diff --git a/src/packages/cli/__tests__/index.test.ts b/src/packages/cli/tests/index.test.ts similarity index 76% rename from src/packages/cli/__tests__/index.test.ts rename to src/packages/cli/tests/index.test.ts index 08ddd8e61c..e853595762 100644 --- a/src/packages/cli/__tests__/index.test.ts +++ b/src/packages/cli/tests/index.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import cli from "../src/"; +import cli from ".."; describe("@ganache/cli", () => { it("needs tests"); diff --git a/src/packages/cli/tsconfig.json b/src/packages/cli/tsconfig.json index 62676b00a1..25d5c3cf7e 100644 --- a/src/packages/cli/tsconfig.json +++ b/src/packages/cli/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["index.ts"] } diff --git a/src/packages/core/.npmignore b/src/packages/core/.npmignore index b1e1059b5c..115ab4f024 100644 --- a/src/packages/core/.npmignore +++ b/src/packages/core/.npmignore @@ -1,5 +1,5 @@ ./index.ts -__tests__ +tests .nyc_output coverage scripts diff --git a/src/packages/core/index.ts b/src/packages/core/index.ts index eef3b87f5d..debc6e2150 100644 --- a/src/packages/core/index.ts +++ b/src/packages/core/index.ts @@ -1,5 +1,11 @@ -export { ProviderOptions, ServerOptions } from "./src/options"; +import Connector from "./src/connector"; +import { ProviderOptions, ServerOptions } from "./src/options"; +import Server from "./src/server"; -import core from "./src/index"; +export { ProviderOptions, ServerOptions } from "./src/options"; -export default core; +export default { + server: (options?: ServerOptions) => new Server(options), + provider: (options?: ProviderOptions) => + Connector.initialize(options).provider +}; diff --git a/src/packages/core/npm-shrinkwrap.json b/src/packages/core/npm-shrinkwrap.json index 30de3ba9f9..d73c4cc56d 100644 --- a/src/packages/core/npm-shrinkwrap.json +++ b/src/packages/core/npm-shrinkwrap.json @@ -10,12 +10,6 @@ "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", "dev": true }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, "@types/node": { "version": "14.14.6", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", @@ -32,16 +26,6 @@ "@types/node": "*" } }, - "@types/uws": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@types/uws/-/uws-0.13.2.tgz", - "integrity": "sha512-PtSuctnHZPMJKGDvpBpX+3EvL8PPcErNOv6A0HacFJV1954ggrTZusLVrZjqBrActKf/C91dbdl/piOmLMeg8A==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/node": "*" - } - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", diff --git a/src/packages/core/package.json b/src/packages/core/package.json index dc593b6131..8fdc8eb0c6 100644 --- a/src/packages/core/package.json +++ b/src/packages/core/package.json @@ -7,10 +7,10 @@ "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", - "source": "src/index.ts", + "source": "index.ts", "directories": { "lib": "lib", - "test": "__tests__" + "test": "tests" }, "files": [ "lib" @@ -26,7 +26,7 @@ "scripts": { "tsc": "ttsc", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --throw-deprecation --trace-warnings --check-leaks --require ts-node/register 'tests/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" @@ -46,16 +46,15 @@ "tooling" ], "dependencies": { - "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0", "@ganache/ethereum": "^0.1.0", "@ganache/flavors": "^0.1.0", "@ganache/options": "^0.1.0", "@ganache/tezos": "^0.1.0", - "@ganache/utils": "^0.1.0" + "@ganache/utils": "^0.1.0", + "uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0" }, "devDependencies": { "@types/superagent": "4.1.10", - "@types/uws": "0.13.2", "superagent": "6.1.0", "ws": "7.3.1" } diff --git a/src/packages/core/src/index.ts b/src/packages/core/src/index.ts deleted file mode 100644 index d94b4c9af4..0000000000 --- a/src/packages/core/src/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Connector from "./connector"; -import { ProviderOptions, ServerOptions } from "./options"; -import Server from "./server"; - -export { ProviderOptions, ServerOptions } from "./options"; - -export default { - server: (options?: ServerOptions) => new Server(options), - provider: (options?: ProviderOptions) => - Connector.initialize(options).provider -}; diff --git a/src/packages/core/src/options/server-options.ts b/src/packages/core/src/options/server-options.ts index b64a4cdfad..02d2015bbf 100644 --- a/src/packages/core/src/options/server-options.ts +++ b/src/packages/core/src/options/server-options.ts @@ -45,7 +45,6 @@ export type ServerConfig = { }; }; }; - exclusiveGroups: []; }; const normalize = (rawInput: T) => rawInput; diff --git a/src/packages/core/src/server.ts b/src/packages/core/src/server.ts index 347ee20823..226297f28e 100644 --- a/src/packages/core/src/server.ts +++ b/src/packages/core/src/server.ts @@ -113,13 +113,13 @@ export default class Server { // https://github.com/uNetworking/uSockets/commit/04295b9730a4d413895fa3b151a7337797dcb91f#diff-79a34a07b0945668e00f805838601c11R51 const LIBUS_LISTEN_EXCLUSIVE_PORT = 1; hostname - ? this.#app.listen( + ? (this.#app as any).listen( hostname, port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve ) - : this.#app.listen(port, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); + : this.#app.listen(port as any, LIBUS_LISTEN_EXCLUSIVE_PORT, resolve); } ).then(listenSocket => { if (listenSocket) { diff --git a/src/packages/core/__tests__/connector.test.ts b/src/packages/core/tests/connector.test.ts similarity index 99% rename from src/packages/core/__tests__/connector.test.ts rename to src/packages/core/tests/connector.test.ts index b7c913eb27..4828110351 100644 --- a/src/packages/core/__tests__/connector.test.ts +++ b/src/packages/core/tests/connector.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import Ganache from "../src"; +import Ganache from "../"; import { Provider as EthereumProvider } from "@ganache/ethereum"; describe("connector", () => { diff --git a/src/packages/core/__tests__/helpers/getProvider.ts b/src/packages/core/tests/helpers/getProvider.ts similarity index 100% rename from src/packages/core/__tests__/helpers/getProvider.ts rename to src/packages/core/tests/helpers/getProvider.ts diff --git a/src/packages/core/__tests__/interface.test.ts b/src/packages/core/tests/interface.test.ts similarity index 94% rename from src/packages/core/__tests__/interface.test.ts rename to src/packages/core/tests/interface.test.ts index 7ce9616857..ad9f658680 100644 --- a/src/packages/core/__tests__/interface.test.ts +++ b/src/packages/core/tests/interface.test.ts @@ -1,4 +1,4 @@ -import Ganache from "../src"; +import Ganache from ".."; import * as assert from "assert"; describe("interface", () => { diff --git a/src/packages/core/__tests__/server.test.ts b/src/packages/core/tests/server.test.ts similarity index 99% rename from src/packages/core/__tests__/server.test.ts rename to src/packages/core/tests/server.test.ts index 6c7a73093c..71fc06f0df 100644 --- a/src/packages/core/__tests__/server.test.ts +++ b/src/packages/core/tests/server.test.ts @@ -1,4 +1,4 @@ -import Ganache from "../src"; +import Ganache from "../"; import * as assert from "assert"; import request from "superagent"; import WebSocket from "ws"; diff --git a/src/packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c b/src/packages/core/tests/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c similarity index 100% rename from src/packages/core/__tests__/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c rename to src/packages/core/tests/testdb/!trie_db!0x08ac839d755e4a25bcbc47a4012219db100ef0a340307869393f9df55ebd470c diff --git a/src/packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f b/src/packages/core/tests/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f similarity index 100% rename from src/packages/core/__tests__/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f rename to src/packages/core/tests/testdb/!trie_db!0x6990c157721aea0e000dc63d12ccdd1938364fb8e72dcdda25d6baa70992b80f diff --git a/src/packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 b/src/packages/core/tests/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 similarity index 100% rename from src/packages/core/__tests__/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 rename to src/packages/core/tests/testdb/!trie_db!0xb0108c95b74533d6862f59a730bb0282bbaaadd8ac1b94510b69a499527c3505 diff --git a/src/packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 b/src/packages/core/tests/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 similarity index 100% rename from src/packages/core/__tests__/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 rename to src/packages/core/tests/testdb/!trie_db!0xf173aa08e820d7e4b4bb0c243a1661770198770b14029eed74f0eb473c79cd83 diff --git a/src/packages/core/tsconfig.json b/src/packages/core/tsconfig.json index 62676b00a1..25d5c3cf7e 100644 --- a/src/packages/core/tsconfig.json +++ b/src/packages/core/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["index.ts"] } diff --git a/src/packages/flavors/.npmignore b/src/packages/flavors/.npmignore index b1e1059b5c..115ab4f024 100644 --- a/src/packages/flavors/.npmignore +++ b/src/packages/flavors/.npmignore @@ -1,5 +1,5 @@ ./index.ts -__tests__ +tests .nyc_output coverage scripts diff --git a/src/packages/flavors/index.ts b/src/packages/flavors/index.ts index 3b05966675..49fe84df43 100644 --- a/src/packages/flavors/index.ts +++ b/src/packages/flavors/index.ts @@ -1,6 +1,25 @@ -// ************************************************************************* // -// This file is necessary to "trick" typescript into using our ./src/**/*.ts // -// files when developing, debugging, and running tests // -// ************************************************************************* // +// import {TezosConnector} from "@ganache/tezos"; +import * as Ethereum from "@ganache/ethereum"; -export * from "./src/index"; +export const DefaultFlavor = Ethereum.FlavorName; + +export type ConnectorsByName = { + [Ethereum.FlavorName]: Ethereum.Connector; + // [Tezos.FlavorName]: Tezos.Connector +}; + +export const ConnectorsByName = { + [Ethereum.FlavorName]: Ethereum.Connector + // [Tezos.FlavorName]: Tezos.Connector +}; + +export type Connectors = { + [K in keyof ConnectorsByName]: ConnectorsByName[K]; +}[keyof ConnectorsByName]; + +export type Providers = Ethereum.Provider /*| Tezos.Provider */; + +export type Options = { + flavor?: typeof Ethereum.FlavorName; +} & Ethereum.ProviderOptions; +// | [Tezos.FlavorName]: Tezos.ProviderOptions; diff --git a/src/packages/flavors/npm-shrinkwrap.json b/src/packages/flavors/npm-shrinkwrap.json index 4846667240..2fc171fdb6 100644 --- a/src/packages/flavors/npm-shrinkwrap.json +++ b/src/packages/flavors/npm-shrinkwrap.json @@ -1 +1,245 @@ -{"name":"@ganache/flavors","version":"2.2.1","lockfileVersion":1} +{ + "name": "@ganache/flavors", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "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=", + "dev": true + }, + "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=", + "dev": true + }, + "google-closure-compiler": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler/-/google-closure-compiler-20201102.0.1.tgz", + "integrity": "sha512-Cz+1jOswH0MwMVPu1rRH1xD4KYuY5XW2ox5aXwqaAxevqmirhr36f8wgKPHuVRSovFejW640r6UFwyrOT6U0CA==", + "dev": true, + "requires": { + "chalk": "2.x", + "google-closure-compiler-java": "^20201102.0.1", + "google-closure-compiler-linux": "^20201102.0.1", + "google-closure-compiler-osx": "^20201102.0.1", + "google-closure-compiler-windows": "^20201102.0.1", + "minimist": "1.x", + "vinyl": "2.x", + "vinyl-sourcemaps-apply": "^0.2.0" + } + }, + "google-closure-compiler-java": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20201102.0.1.tgz", + "integrity": "sha512-pXJIlyqepHhih0HCbShkAZJyViIxdyd4V7MnCUZEXLIIlygw92e2dC+5XiONDQZgRlF93BPmWCy9jr7wYoW1hQ==", + "dev": true + }, + "google-closure-compiler-linux": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-linux/-/google-closure-compiler-linux-20201102.0.1.tgz", + "integrity": "sha512-aRbyTGnQoFXchcpEFNrP1p/WIvYOgN3hYKI+MOHWkvwVJBY2P8gpb07hAigO8fj+QKD/SFCl+2pXP+JniWOEqw==", + "dev": true, + "optional": true + }, + "google-closure-compiler-osx": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-osx/-/google-closure-compiler-osx-20201102.0.1.tgz", + "integrity": "sha512-VguqEAOYI6XYZN6JcLMP8fpsoXk1Z9YuntMjv0IDVydkbZaHYOI4zE39FJhMuWiN7gOzSX2b/BBC6GsSh1F3fw==", + "dev": true, + "optional": true + }, + "google-closure-compiler-windows": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-windows/-/google-closure-compiler-windows-20201102.0.1.tgz", + "integrity": "sha512-LlynipQi/iP76mjkOu6Rc1mCRuxTAhRvLjq10aGfVjKwpbCAF0Jq2a5k2ygr4xYiINNi2/L2qUw6ObPm9wQCOw==", + "dev": true, + "optional": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "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=", + "dev": true + }, + "replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + }, + "vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "dev": true, + "requires": { + "source-map": "^0.5.1" + }, + "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 + } + } + } + } +} diff --git a/src/packages/flavors/package.json b/src/packages/flavors/package.json index 4144f9d096..060097bda8 100644 --- a/src/packages/flavors/package.json +++ b/src/packages/flavors/package.json @@ -7,10 +7,10 @@ "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", - "source": "src/index.ts", + "source": "index.ts", "directories": { "lib": "lib", - "test": "__tests__" + "test": "tests" }, "files": [ "lib" @@ -44,5 +44,8 @@ "@ganache/ethereum": "^0.1.0", "@ganache/tezos": "^0.1.0", "@ganache/utils": "^0.1.0" + }, + "devDependencies": { + "google-closure-compiler": "20201102.0.1" } } diff --git a/src/packages/flavors/src/index.ts b/src/packages/flavors/src/index.ts deleted file mode 100644 index 49fe84df43..0000000000 --- a/src/packages/flavors/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// import {TezosConnector} from "@ganache/tezos"; -import * as Ethereum from "@ganache/ethereum"; - -export const DefaultFlavor = Ethereum.FlavorName; - -export type ConnectorsByName = { - [Ethereum.FlavorName]: Ethereum.Connector; - // [Tezos.FlavorName]: Tezos.Connector -}; - -export const ConnectorsByName = { - [Ethereum.FlavorName]: Ethereum.Connector - // [Tezos.FlavorName]: Tezos.Connector -}; - -export type Connectors = { - [K in keyof ConnectorsByName]: ConnectorsByName[K]; -}[keyof ConnectorsByName]; - -export type Providers = Ethereum.Provider /*| Tezos.Provider */; - -export type Options = { - flavor?: typeof Ethereum.FlavorName; -} & Ethereum.ProviderOptions; -// | [Tezos.FlavorName]: Tezos.ProviderOptions; diff --git a/src/packages/flavors/__tests__/index.test.ts b/src/packages/flavors/tests/index.test.ts similarity index 100% rename from src/packages/flavors/__tests__/index.test.ts rename to src/packages/flavors/tests/index.test.ts diff --git a/src/packages/flavors/tsconfig.json b/src/packages/flavors/tsconfig.json index 62676b00a1..25d5c3cf7e 100644 --- a/src/packages/flavors/tsconfig.json +++ b/src/packages/flavors/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["index.ts"] } diff --git a/src/packages/ganache/.npmignore b/src/packages/ganache/.npmignore index b1e1059b5c..115ab4f024 100644 --- a/src/packages/ganache/.npmignore +++ b/src/packages/ganache/.npmignore @@ -1,5 +1,5 @@ ./index.ts -__tests__ +tests .nyc_output coverage scripts diff --git a/src/packages/ganache/src/index.ts b/src/packages/ganache/index.ts similarity index 100% rename from src/packages/ganache/src/index.ts rename to src/packages/ganache/index.ts diff --git a/src/packages/ganache/npm-shrinkwrap.json b/src/packages/ganache/npm-shrinkwrap.json index e5dc1172a5..5b6a690549 100644 --- a/src/packages/ganache/npm-shrinkwrap.json +++ b/src/packages/ganache/npm-shrinkwrap.json @@ -2271,6 +2271,27 @@ "typical": "^5.0.0" } }, + "wrapper-webpack-plugin": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrapper-webpack-plugin/-/wrapper-webpack-plugin-2.1.0.tgz", + "integrity": "sha512-e+2FhSYGCxhDq3PcUw5mRhH+8vcYa+9d9AuLChJUZ9ZbUPhQOHZ/O2dnN98iTqeUuvrzSSOv13+x/NhrAm5JEg==", + "dev": true, + "requires": { + "webpack-sources": "^1.1.0" + }, + "dependencies": { + "webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index 5ec14a4e3f..abde59cf7a 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -7,13 +7,14 @@ "license": "MIT", "main": "dist/node/ganache.min.js", "browser": "dist/web/ganache.min.js", - "types": "src/index.ts", + "types": "lib/index.d.ts", + "source": "index.ts", "directories": { "lib": "lib", - "test": "__tests__" + "test": "tests" }, "files": [ - "lib" + "dist" ], "repository": { "type": "git", @@ -24,7 +25,7 @@ "build": "webpack", "tsc": "ttsc", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register '__tests__/**/*.test.ts'" + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" diff --git a/src/packages/ganache/__tests__/index.test.ts b/src/packages/ganache/tests/index.test.ts similarity index 74% rename from src/packages/ganache/__tests__/index.test.ts rename to src/packages/ganache/tests/index.test.ts index 5543536bea..70ad885d99 100644 --- a/src/packages/ganache/__tests__/index.test.ts +++ b/src/packages/ganache/tests/index.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import ganache from "../src/"; +import ganache from ".."; describe("@ganache/ganache", () => { it("needs tests"); diff --git a/src/packages/ganache/tsconfig.json b/src/packages/ganache/tsconfig.json index 62676b00a1..25d5c3cf7e 100644 --- a/src/packages/ganache/tsconfig.json +++ b/src/packages/ganache/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["index.ts"] } diff --git a/src/packages/ganache/webpack/webpack.common.config.ts b/src/packages/ganache/webpack/webpack.common.config.ts index 188e9a08d6..be145ce551 100644 --- a/src/packages/ganache/webpack/webpack.common.config.ts +++ b/src/packages/ganache/webpack/webpack.common.config.ts @@ -4,7 +4,7 @@ import webpack from "webpack"; import packageJsonTransformer from "ts-transformer-inline-file/transformer"; const base: webpack.Configuration = { - entry: "./src/index.ts", + entry: "./index.ts", devtool: "source-map", module: { rules: [ diff --git a/src/packages/options/.npmignore b/src/packages/options/.npmignore index b1e1059b5c..115ab4f024 100644 --- a/src/packages/options/.npmignore +++ b/src/packages/options/.npmignore @@ -1,5 +1,5 @@ ./index.ts -__tests__ +tests .nyc_output coverage scripts diff --git a/src/packages/options/index.ts b/src/packages/options/index.ts index 3b05966675..7a9075164c 100644 --- a/src/packages/options/index.ts +++ b/src/packages/options/index.ts @@ -1,6 +1,11 @@ -// ************************************************************************* // -// This file is necessary to "trick" typescript into using our ./src/**/*.ts // -// files when developing, debugging, and running tests // -// ************************************************************************* // - -export * from "./src/index"; +export * from "./src/base"; +export { + Options, + LegacyOptions, + Legacy, + OptionName, + OptionRawType +} from "./src/getters"; +export * from "./src/exclusive"; +export * from "./src/definition"; +export * from "./src/create"; diff --git a/src/packages/options/npm-shrinkwrap.json b/src/packages/options/npm-shrinkwrap.json index f19b0af9a9..7f40e07aef 100644 --- a/src/packages/options/npm-shrinkwrap.json +++ b/src/packages/options/npm-shrinkwrap.json @@ -15,6 +15,15 @@ "integrity": "sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA==", "dev": true }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, "bip39": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", @@ -26,6 +35,17 @@ "randombytes": "^2.0.1" } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -35,6 +55,88 @@ "safe-buffer": "^5.0.1" } }, + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "cloneable-readable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "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=", + "dev": true + }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -60,6 +162,61 @@ "sha.js": "^2.4.8" } }, + "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=", + "dev": true + }, + "google-closure-compiler": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler/-/google-closure-compiler-20201102.0.1.tgz", + "integrity": "sha512-Cz+1jOswH0MwMVPu1rRH1xD4KYuY5XW2ox5aXwqaAxevqmirhr36f8wgKPHuVRSovFejW640r6UFwyrOT6U0CA==", + "dev": true, + "requires": { + "chalk": "2.x", + "google-closure-compiler-java": "^20201102.0.1", + "google-closure-compiler-linux": "^20201102.0.1", + "google-closure-compiler-osx": "^20201102.0.1", + "google-closure-compiler-windows": "^20201102.0.1", + "minimist": "1.x", + "vinyl": "2.x", + "vinyl-sourcemaps-apply": "^0.2.0" + } + }, + "google-closure-compiler-java": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20201102.0.1.tgz", + "integrity": "sha512-pXJIlyqepHhih0HCbShkAZJyViIxdyd4V7MnCUZEXLIIlygw92e2dC+5XiONDQZgRlF93BPmWCy9jr7wYoW1hQ==", + "dev": true + }, + "google-closure-compiler-linux": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-linux/-/google-closure-compiler-linux-20201102.0.1.tgz", + "integrity": "sha512-aRbyTGnQoFXchcpEFNrP1p/WIvYOgN3hYKI+MOHWkvwVJBY2P8gpb07hAigO8fj+QKD/SFCl+2pXP+JniWOEqw==", + "dev": true, + "optional": true + }, + "google-closure-compiler-osx": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-osx/-/google-closure-compiler-osx-20201102.0.1.tgz", + "integrity": "sha512-VguqEAOYI6XYZN6JcLMP8fpsoXk1Z9YuntMjv0IDVydkbZaHYOI4zE39FJhMuWiN7gOzSX2b/BBC6GsSh1F3fw==", + "dev": true, + "optional": true + }, + "google-closure-compiler-windows": { + "version": "20201102.0.1", + "resolved": "https://registry.npmjs.org/google-closure-compiler-windows/-/google-closure-compiler-windows-20201102.0.1.tgz", + "integrity": "sha512-LlynipQi/iP76mjkOu6Rc1mCRuxTAhRvLjq10aGfVjKwpbCAF0Jq2a5k2ygr4xYiINNi2/L2qUw6ObPm9wQCOw==", + "dev": true, + "optional": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -75,6 +232,12 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -85,6 +248,12 @@ "safe-buffer": "^5.1.2" } }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "pbkdf2": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", @@ -97,6 +266,12 @@ "sha.js": "^2.4.8" } }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -115,6 +290,18 @@ "util-deprecate": "^1.0.1" } }, + "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=", + "dev": true + }, + "replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true + }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -151,10 +338,50 @@ "safe-buffer": "~5.2.0" } }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + }, + "vinyl-sourcemaps-apply": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", + "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", + "dev": true, + "requires": { + "source-map": "^0.5.1" + }, + "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 + } + } } } } diff --git a/src/packages/options/package.json b/src/packages/options/package.json index 136044dc20..4b5bdb1259 100644 --- a/src/packages/options/package.json +++ b/src/packages/options/package.json @@ -7,7 +7,7 @@ "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", - "source": "src/index.ts", + "source": "index.ts", "directories": { "lib": "lib" }, @@ -45,6 +45,7 @@ "seedrandom": "3.0.5" }, "devDependencies": { - "@types/seedrandom": "2.4.28" + "@types/seedrandom": "2.4.28", + "google-closure-compiler": "20201102.0.1" } } diff --git a/src/packages/options/src/helpers/base.ts b/src/packages/options/src/base.ts similarity index 72% rename from src/packages/options/src/helpers/base.ts rename to src/packages/options/src/base.ts index 4c4cc4187d..5f5cc59789 100644 --- a/src/packages/options/src/helpers/base.ts +++ b/src/packages/options/src/base.ts @@ -1,10 +1,10 @@ export namespace Base { export type Option = { - rawType?: any; - type: any; + rawType?: unknown; + type: unknown; hasDefault?: true; legacy?: { - [k: string]: any; + [name: string]: unknown; }; }; @@ -16,6 +16,6 @@ export namespace Base { [optionName: string]: Option; }; - exclusiveGroups: ExclusiveGroup[]; + exclusiveGroups?: ExclusiveGroup[]; }; } diff --git a/src/packages/options/src/helpers/create.ts b/src/packages/options/src/create.ts similarity index 100% rename from src/packages/options/src/helpers/create.ts rename to src/packages/options/src/create.ts diff --git a/src/packages/options/src/helpers/definition.ts b/src/packages/options/src/definition.ts similarity index 100% rename from src/packages/options/src/helpers/definition.ts rename to src/packages/options/src/definition.ts diff --git a/src/packages/options/src/helpers/exclusive.ts b/src/packages/options/src/exclusive.ts similarity index 100% rename from src/packages/options/src/helpers/exclusive.ts rename to src/packages/options/src/exclusive.ts diff --git a/src/packages/options/src/helpers/getters.ts b/src/packages/options/src/getters.ts similarity index 100% rename from src/packages/options/src/helpers/getters.ts rename to src/packages/options/src/getters.ts diff --git a/src/packages/options/src/helpers/index.ts b/src/packages/options/src/helpers/index.ts deleted file mode 100644 index 4e6619fff8..0000000000 --- a/src/packages/options/src/helpers/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from "./base"; -export { - Options, - LegacyOptions, - Legacy, - OptionName, - OptionRawType -} from "./getters"; -export * from "./exclusive"; -export * from "./definition"; -export * from "./create"; diff --git a/src/packages/options/src/index.ts b/src/packages/options/src/index.ts deleted file mode 100644 index d4e09d7b43..0000000000 --- a/src/packages/options/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./helpers"; diff --git a/src/packages/options/tests/index.test.ts b/src/packages/options/tests/index.test.ts new file mode 100644 index 0000000000..2288012cc3 --- /dev/null +++ b/src/packages/options/tests/index.test.ts @@ -0,0 +1,7 @@ +"use strict"; + +const options = require(".."); + +describe("@ganache/options", () => { + it("needs tests"); +}); diff --git a/src/packages/options/tsconfig.json b/src/packages/options/tsconfig.json index 62676b00a1..25d5c3cf7e 100644 --- a/src/packages/options/tsconfig.json +++ b/src/packages/options/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["index.ts"] } diff --git a/src/packages/promise-queue/.npmignore b/src/packages/promise-queue/.npmignore index b1e1059b5c..115ab4f024 100644 --- a/src/packages/promise-queue/.npmignore +++ b/src/packages/promise-queue/.npmignore @@ -1,5 +1,5 @@ ./index.ts -__tests__ +tests .nyc_output coverage scripts diff --git a/src/packages/promise-queue/index.ts b/src/packages/promise-queue/index.ts index 7cf1638089..2ff0738700 100644 --- a/src/packages/promise-queue/index.ts +++ b/src/packages/promise-queue/index.ts @@ -1,7 +1,108 @@ -// ************************************************************************* // -// This file is necessary to "trick" typescript into using our ./src/**/*.ts // -// files when developing, debugging, and running tests // -// ************************************************************************* // -import PromiseQueue from "./src/index"; +import Emittery from "emittery"; +import Entry from "./src/entry"; + +const emitteryMethods = ["emit", "once"] as const; + +/** + * Creates a FIFO queue to that ensures promises are _resolved_ in the order + * they were added. + * + * This is different than a FIFO queue that _executes_ functions that + * return promises; this queue is for the promises themselves. + * + * @example + * ```javascript + * const queue = new PromiseQueue(); + * + * const slow = new Promise(resolve => setTimeout(resolve, 1000, "slow")); + * const fast = Promise.resolve("fast"); + * + * await Promise.race([ + * queue.add(slow), + * queue.add(fast) + * ]); // returns "slow" + * + * Additionally, the queued promise chain can be cleared via `queue.clear(value)`. + * This will cause the chain of promises to all resolve immediately with the + * given value. * + * + * * note: whatever the promise starting doing when it was created will still + * happen, no promises are aborted; rather, the return value is ignored. + * ``` + */ +@Emittery.mixin(Symbol.for("emittery"), emitteryMethods) +class PromiseQueue { + /** + * Returns true if there are promises pending in the queue + */ + public isBusy() { + return this.#queue.length !== 0; + } + + // TODO(perf): a singly linked list is probably a better option here + readonly #queue: Entry[] = []; + + #tryResolve = (queue: Entry[], entry: Entry) => { + // if this is now the highest priority entry, resolve the outer + // Promise + if (entry === queue[0]) { + queue.shift(); + entry.resolve(entry.value); + // then try resolving the rest + this.#tryResolveChain(queue); + } else { + entry.resolved = true; + } + }; + + /** + * Adds the promise to the end of the queue. + * @param promise + * @returns a promise that resolves with the given promise's result. If the + * queue was `clear`ed before the promise could be shifted off the return + * value will be the `value` passed to `clear`. + */ + add(promise: Promise) { + const queue = this.#queue; + const entry: Entry = new Entry(promise, queue, this.#tryResolve); + queue.push(entry); + return entry.promise; + } + + /** + * Clears all promises from the queue and sets their resolved values to the + * given value. + */ + clear(value: T) { + // remove all entrys from the queue and mark them. + const cancelledQueue = this.#queue.splice(0); + cancelledQueue.forEach(entry => { + entry.queue = cancelledQueue; + entry.value = value; + }); + } + + /** + * Removes all _resolved_ promises from the front of the chain of promises. + */ + #tryResolveChain = (queue: Entry[]) => { + let first = queue[0]; + while (first && first.resolved) { + queue.shift(); + first.resolve(first.value); + first = queue[0]; + } + + // if there is nothing left to do emit `"idle"` + if (queue.length === 0) { + this.emit("idle"); + } + }; +} + +interface PromiseQueue + extends Pick { + emittery: Emittery; +} export default PromiseQueue; diff --git a/src/packages/promise-queue/package.json b/src/packages/promise-queue/package.json index f4b8d94615..4fdf5beb6c 100644 --- a/src/packages/promise-queue/package.json +++ b/src/packages/promise-queue/package.json @@ -6,10 +6,11 @@ "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/promise-queue#readme", "license": "MIT", "main": "lib/index.js", - "types": "src/index.ts", + "types": "lib/index.d.ts", + "source": "index.ts", "directories": { "lib": "lib", - "test": "__tests__" + "test": "tests" }, "files": [ "lib" @@ -22,7 +23,7 @@ "scripts": { "tsc": "ttsc", "test": "nyc npm run mocha", - "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --require ts-node/register --recursive --check-leaks '__tests__/**.ts'" + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --require ts-node/register --recursive --check-leaks 'tests/**.ts'" }, "bugs": { "url": "https://github.com/trufflesuite/ganache-core/issues" @@ -43,5 +44,6 @@ ], "dependencies": { "emittery": "0.7.2" - } + }, + "devDependencies": {} } diff --git a/src/packages/promise-queue/src/index.ts b/src/packages/promise-queue/src/index.ts deleted file mode 100644 index 80c2e558ab..0000000000 --- a/src/packages/promise-queue/src/index.ts +++ /dev/null @@ -1,108 +0,0 @@ -import Emittery from "emittery"; -import Entry from "./entry"; - -const emitteryMethods = ["emit", "once"] as const; - -/** - * Creates a FIFO queue to that ensures promises are _resolved_ in the order - * they were added. - * - * This is different than a FIFO queue that _executes_ functions that - * return promises; this queue is for the promises themselves. - * - * @example - * ```javascript - * const queue = new PromiseQueue(); - * - * const slow = new Promise(resolve => setTimeout(resolve, 1000, "slow")); - * const fast = Promise.resolve("fast"); - * - * await Promise.race([ - * queue.add(slow), - * queue.add(fast) - * ]); // returns "slow" - * - * Additionally, the queued promise chain can be cleared via `queue.clear(value)`. - * This will cause the chain of promises to all resolve immediately with the - * given value. * - * - * * note: whatever the promise starting doing when it was created will still - * happen, no promises are aborted; rather, the return value is ignored. - * ``` - */ -@Emittery.mixin(Symbol.for("emittery"), emitteryMethods) -class PromiseQueue { - /** - * Returns true if there are promises pending in the queue - */ - public isBusy() { - return this.#queue.length !== 0; - } - - // TODO(perf): a singly linked list is probably a better option here - readonly #queue: Entry[] = []; - - #tryResolve = (queue: Entry[], entry: Entry) => { - // if this is now the highest priority entry, resolve the outer - // Promise - if (entry === queue[0]) { - queue.shift(); - entry.resolve(entry.value); - // then try resolving the rest - this.#tryResolveChain(queue); - } else { - entry.resolved = true; - } - }; - - /** - * Adds the promise to the end of the queue. - * @param promise - * @returns a promise that resolves with the given promise's result. If the - * queue was `clear`ed before the promise could be shifted off the return - * value will be the `value` passed to `clear`. - */ - add(promise: Promise) { - const queue = this.#queue; - const entry: Entry = new Entry(promise, queue, this.#tryResolve); - queue.push(entry); - return entry.promise; - } - - /** - * Clears all promises from the queue and sets their resolved values to the - * given value. - */ - clear(value: T) { - // remove all entrys from the queue and mark them. - const cancelledQueue = this.#queue.splice(0); - cancelledQueue.forEach(entry => { - entry.queue = cancelledQueue; - entry.value = value; - }); - } - - /** - * Removes all _resolved_ promises from the front of the chain of promises. - */ - #tryResolveChain = (queue: Entry[]) => { - let first = queue[0]; - while (first && first.resolved) { - queue.shift(); - first.resolve(first.value); - first = queue[0]; - } - - // if there is nothing left to do emit `"idle"` - if (queue.length === 0) { - this.emit("idle"); - } - }; -} - -interface PromiseQueue - extends Pick { - emittery: Emittery; -} - -export default PromiseQueue; diff --git a/src/packages/promise-queue/__tests__/index.test.ts b/src/packages/promise-queue/tests/index.test.ts similarity index 73% rename from src/packages/promise-queue/__tests__/index.test.ts rename to src/packages/promise-queue/tests/index.test.ts index 103ef1c2f6..d7f1dac8c2 100644 --- a/src/packages/promise-queue/__tests__/index.test.ts +++ b/src/packages/promise-queue/tests/index.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import PromiseQueue from "../src/"; +import PromiseQueue from ".."; describe("@ganache/promise-queue", () => { it("needs tests"); diff --git a/src/packages/utils/.npmignore b/src/packages/utils/.npmignore index b1e1059b5c..115ab4f024 100644 --- a/src/packages/utils/.npmignore +++ b/src/packages/utils/.npmignore @@ -1,5 +1,5 @@ ./index.ts -__tests__ +tests .nyc_output coverage scripts diff --git a/src/packages/utils/index.ts b/src/packages/utils/index.ts index 3b05966675..236ca0179c 100644 --- a/src/packages/utils/index.ts +++ b/src/packages/utils/index.ts @@ -1,6 +1,7 @@ -// ************************************************************************* // -// This file is necessary to "trick" typescript into using our ./src/**/*.ts // -// files when developing, debugging, and running tests // -// ************************************************************************* // - -export * from "./src/index"; +export * as types from "./src/types"; +export * as utils from "./src/utils"; +export * as JsonRpc from "./src/things/json-rpc"; +export * from "./src/things/json-rpc/json-rpc-quantity"; +export * from "./src/things/json-rpc/json-rpc-data"; +export { default as JsonRpcTypes } from "./src/things/jsonrpc"; +export { default as PromiEvent } from "./src/things/promievent"; diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index 228d70643b..e3baa76ca1 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -7,10 +7,10 @@ "license": "MIT", "main": "lib/index.js", "types": "lib/index.d.ts", - "source": "src/index.ts", + "source": "index.ts", "directories": { "lib": "lib", - "test": "__tests__" + "test": "tests" }, "files": [ "lib" diff --git a/src/packages/utils/src/index.ts b/src/packages/utils/src/index.ts deleted file mode 100644 index 39fd9d0cff..0000000000 --- a/src/packages/utils/src/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * as types from "./types"; -export * as utils from "./utils"; -export * as JsonRpc from "./things/json-rpc"; -export * from "./things/json-rpc/json-rpc-quantity"; -export * from "./things/json-rpc/json-rpc-data"; -export { default as JsonRpcTypes } from "./things/jsonrpc"; -export { default as PromiEvent } from "./things/promievent"; diff --git a/src/packages/utils/__tests__/utils.test.ts b/src/packages/utils/tests/utils.test.ts similarity index 100% rename from src/packages/utils/__tests__/utils.test.ts rename to src/packages/utils/tests/utils.test.ts diff --git a/src/packages/utils/tsconfig.json b/src/packages/utils/tsconfig.json index 62676b00a1..25d5c3cf7e 100644 --- a/src/packages/utils/tsconfig.json +++ b/src/packages/utils/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["index.ts"] } From e50e93c928f7fe4e68e2170e3ad5a359dc211f29 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 7 Nov 2020 17:45:05 -0500 Subject: [PATCH 684/691] cli things --- .../ethereum/src/options/logging-options.ts | 2 +- .../ethereum/src/options/miner-options.ts | 11 +- src/chains/ethereum/src/provider.ts | 15 +- src/packages/cli/args.ts | 258 ++++++++++++++++++ src/packages/cli/{src => }/cli.ts | 46 ++-- src/packages/cli/index.ts | 1 + src/packages/cli/tsconfig.json | 2 +- src/packages/ganache/npm-shrinkwrap.json | 21 -- src/packages/ganache/src/cli.js | 3 + src/packages/options/src/create.ts | 18 +- src/packages/promise-queue/tsconfig.json | 2 +- 11 files changed, 320 insertions(+), 59 deletions(-) create mode 100644 src/packages/cli/args.ts rename src/packages/cli/{src => }/cli.ts (88%) create mode 100644 src/packages/ganache/src/cli.js diff --git a/src/chains/ethereum/src/options/logging-options.ts b/src/chains/ethereum/src/options/logging-options.ts index 2ec70f9609..72efb4af0b 100644 --- a/src/chains/ethereum/src/options/logging-options.ts +++ b/src/chains/ethereum/src/options/logging-options.ts @@ -66,7 +66,7 @@ export type LoggingConfig = { }; }; -const logger: Logger = { log: console.log.bind(console) }; +const logger: Logger = { log: () => {} }; export const LoggingOptions: Definitions = { debug: { diff --git a/src/chains/ethereum/src/options/miner-options.ts b/src/chains/ethereum/src/options/miner-options.ts index e209540d67..95edb83895 100644 --- a/src/chains/ethereum/src/options/miner-options.ts +++ b/src/chains/ethereum/src/options/miner-options.ts @@ -100,6 +100,14 @@ export type MinerConfig = { legacyInstamine: { type: boolean; hasDefault: true; + // legacyInstamine is _not_ a legacy option, but it is used as one so users + // can use it just as they would other legacy options (without a namespace) + legacy: { + /** + * @deprecated Use miner.legacyInstamine instead. Will be removed in v4. + */ + legacyInstamine: boolean; + }; }; /** @@ -153,7 +161,8 @@ export const MinerOptions: Definitions = { }, legacyInstamine: { normalize, - default: () => false + default: () => false, + legacyName: "legacyInstamine" }, extraData: { normalize: extra => { diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index daf9f6b225..f63bbd2089 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -61,11 +61,18 @@ export default class EthereumProvider * Returns the unlocked accounts */ public getInitialAccounts() { - const accounts: Record = {}; - this.#wallet.initialAccounts.forEach(account => { - accounts[account.address.toString()] = { + const accounts: Record< + string, + { unlocked: boolean; secretKey: string; balance: bigint } + > = {}; + const wallet = this.#wallet; + const unlockedAccounts = this.#wallet.unlockedAccounts; + wallet.initialAccounts.forEach(account => { + const address = account.address.toString(); + accounts[address] = { secretKey: account.privateKey.toString(), - balance: account.balance.toBigInt() + balance: account.balance.toBigInt(), + unlocked: unlockedAccounts.has(address) }; }); return accounts; diff --git a/src/packages/cli/args.ts b/src/packages/cli/args.ts new file mode 100644 index 0000000000..e8fd9ae7ac --- /dev/null +++ b/src/packages/cli/args.ts @@ -0,0 +1,258 @@ +import yargs from "yargs"; + +export default function (version: string, isDocker: boolean) { + return yargs + .strict() + .option("p", { + group: "Network:", + alias: "port", + type: "number", + default: 8545, + describe: "Port number to listen on" + }) + .option("h", { + group: "Network:", + alias: ["host", "hostname"], + type: "string", + default: isDocker ? "0.0.0.0" : "127.0.0.1", + describe: "Hostname to listen on" + }) + .option("keepAliveTimeout", { + group: "Network:", + type: "number", + default: 5000, + describe: + "The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed." + }) + .option("a", { + group: "Accounts:", + alias: "accounts", + describe: "Number of accounts to generate at startup", + type: "number", + default: 10 + }) + .option("e", { + group: "Accounts:", + alias: "defaultBalanceEther", + describe: "Amount of ether to assign each test account", + type: "number", + default: 100.0 + }) + .option("account", { + group: "Accounts:", + describe: + "Account data in the form ',', can be specified multiple times. Note that private keys are 64 characters long and must be entered as an 0x-prefixed hex string. Balance can either be input as an integer, or as a 0x-prefixed hex string with either form specifying the initial balance in wei.", + type: "array", + string: true, + demandOption: false + }) + .option("account_keys_path", { + group: "Accounts:", + alias: "acctKeys", + type: "string", + describe: + "saves generated accounts and private keys as JSON object in specified file", + normalize: true, + demandOption: false, + default: null + }) + .option("n", { + group: "Accounts:", + alias: "secure", + describe: + "Lock available accounts by default (good for third party transaction signing)", + type: "boolean", + default: false + }) + .option("u", { + group: "Accounts:", + alias: "unlock", + type: "array", + string: true, + describe: "Comma-separated list of accounts or indices to unlock", + demandOption: false + }) + .option("k", { + group: "Chain:", + alias: "hardfork", + type: "string", + describe: + "Allows users to specify which hardfork should be used. Supported hardforks are `byzantium`, `constantinople`, `petersburg`, `istanbul` and `muirGlacier` (default).", + default: "muirGlacier" + }) + .option("f", { + group: "Chain:", + alias: "fork", + type: "string", + describe: + "Fork from another currently running Ethereum client at a given block. Input should be the HTTP location and port of the other client, e.g. 'http://localhost:8545' or optionally provide a block number 'http://localhost:8545@1599200'", + default: false + }) + .option("forkCacheSize", { + group: "Chain:", + type: "number", + describe: + "The maximum size, in bytes, of the in-memory cache for queries on a chain fork. Defaults to `1_073_741_824` bytes (1 gigabyte). You can set this to `0` to disable caching (not recommended), or to `-1` for unlimited (will be limited by your node process).", + default: 1073741824 + }) + .option("db", { + group: "Chain:", + describe: "Directory of chain database; creates one if it doesn't exist", + type: "string", + normalize: true, + default: null + }) + .option("s", { + group: "Chain:", + alias: "seed", + type: "string", + describe: "Arbitrary data to generate the HD wallet mnemonic to be used", + defaultDescription: "Random value, unless -d is specified", + conflicts: "d", + demandOption: false + }) + .option("hdPath", { + group: "Accounts:", + alias: "hd_path", + describe: `The hierarchical deterministic path to use when generating accounts. Default: "m/44'/60'/0'/0/"`, + type: "string", + demandOption: false + }) + .option("d", { + group: "Chain:", + alias: "deterministic", + describe: + "Generate deterministic addresses based on a pre-defined mnemonic.", + conflicts: "s", + type: "boolean", + default: undefined, + demandOption: false + }) + .option("m", { + group: "Chain:", + alias: "mnemonic", + type: "string", + describe: + "bip39 mnemonic phrase for generating a PRNG seed, which is in turn used for hierarchical deterministic (HD) account generation", + demandOption: false + }) + .option("noVMErrorsOnRPCResponse", { + group: "Chain:", + describe: + "Do not transmit transaction failures as RPC errors. Enable this flag for error reporting behaviour which is compatible with other clients such as geth and Parity.", + type: "boolean", + default: false + }) + .option("b", { + group: "Chain:", + alias: "blockTime", + type: "number", + describe: + "Block time in seconds for automatic mining. Will instantly mine a new block for every transaction if option omitted. Avoid using unless your test cases require a specific mining interval.", + demandOption: false + }) + .option("i", { + group: "Chain:", + alias: "networkId", + type: "number", + describe: "The Network ID ganache-cli will use to identify itself.", + defaultDescription: + "System time at process start or Network ID of forked blockchain if configured.", + demandOption: false + }) + .option("chainId", { + group: "Chain:", + type: "number", + describe: + "The Chain ID ganache-cli will use for `eth_chainId` RPC and the `CHAINID` opcode.", + defaultDescription: + "For legacy reasons, the default is currently `1337` for `eth_chainId` RPC and `1` for the `CHAINID` opcode. This will be fixed in the next major version of ganache-cli and ganache-core!", + demandOption: false + }) + .option("g", { + group: "Chain:", + alias: "gasPrice", + describe: "The price of gas in wei", + type: "number", + default: 20000000000 + }) + .option("l", { + group: "Chain:", + alias: "gasLimit", + describe: "The block gas limit in wei", + type: "number", + default: 0x6691b7 + }) + .option("callGasLimit", { + group: "Chain:", + describe: + 'Sets the transaction gas limit for `eth_call` and `eth_estimateGas` calls. Must be specified as a hex string. Defaults to "0x1fffffffffffff" (Number.MAX_SAFE_INTEGER)', + type: "number", + default: 0x1fffffffffffff + }) + .option("allowUnlimitedContractSize", { + group: "Chain:", + describe: + "Allows unlimited contract sizes while debugging. By enabling this flag, the check within the EVM for contract size limit of 24KB (see EIP-170) is bypassed. Enabling this flag *will* cause ganache-cli to behave differently than production environments.", + type: "boolean", + default: false + }) + .option("t", { + group: "Chain:", + alias: "time", + describe: + "Date (ISO 8601) that the first block should start. Use this feature, along with the evm_increaseTime method to test time-dependent code.", + type: "string", + coerce: arg => { + let timestamp = Date.parse(arg); + if (isNaN(timestamp)) { + throw new Error("Invalid 'time' format"); + } + return new Date(timestamp); + } + }) + .option("debug", { + group: "Other:", + describe: "Output VM opcodes for debugging", + type: "boolean", + default: false + }) + .option("v", { + group: "Other:", + alias: "verbose", + describe: "Log all requests and responses to stdout", + type: "boolean", + default: false + }) + .option("mem", { + group: "Other:", + describe: "Only show memory output, not tx history", + type: "boolean", + default: false + }) + .option("q", { + group: "Other:", + alias: "quiet", + describe: "Run ganache quietly (no logs)", + type: "boolean", + default: false + }) + .showHelpOnFail(false, "Specify -? or --help for available options") + .help("help") + .alias("help", "?") + .wrap(Math.min(120, yargs.terminalWidth())) + .version(version) + .check(argv => { + if (argv.p < 1 || argv.p > 65535) { + throw new Error(`Invalid port number '${argv.p}'`); + } + + if (argv.h.trim() == "") { + throw new Error( + "Cannot leave hostname blank; please provide a hostname" + ); + } + + return true; + }); +} diff --git a/src/packages/cli/src/cli.ts b/src/packages/cli/cli.ts similarity index 88% rename from src/packages/cli/src/cli.ts rename to src/packages/cli/cli.ts index 91a6b77dfa..c91fb3efc1 100644 --- a/src/packages/cli/src/cli.ts +++ b/src/packages/cli/cli.ts @@ -1,23 +1,26 @@ #!/usr/bin/env node -import Ganache from "../index"; +import Ganache from "./index"; import { $INLINE_JSON } from "ts-transformer-inline-file"; import { toChecksumAddress } from "ethereumjs-util"; +import args from "./args"; -const { version: ganacheVersion } = $INLINE_JSON("../../core/package.json"); -const { version } = $INLINE_JSON("../package.json"); +const { version: ganacheVersion } = $INLINE_JSON("../core/package.json"); +const { version } = $INLINE_JSON("./package.json"); const detailedVersion = "Ganache CLI v" + version + " (ganache-core: " + ganacheVersion + ")"; const isDocker = "DOCKER" in process.env && process.env.DOCKER.toLowerCase() === "true"; -function parseAccounts(accounts) { - function splitAccount(account) { - account = account.split(","); +const argv = args(detailedVersion, isDocker).argv; + +function parseAccounts(accounts: string[]) { + function splitAccount(account: string) { + const accountParts = account.split(","); return { - secretKey: account[0], - balance: account[1] + secretKey: accountParts[0], + balance: accountParts[1] }; } @@ -31,11 +34,6 @@ function parseAccounts(accounts) { return ret; } -// TODO: CLI parser: -const argv: any = {}; -const port = 8545; -const host = "127.0.0.1"; - if (argv.d) { argv.s = "TestRPC is awesome!"; // Seed phrase; don't change to Ganache, maintain original determinism } @@ -67,7 +65,7 @@ if (argv.mem === true) { }, 1000); } -var options: any = { +var options = { wallet: { accountKeysPath: argv.account_keys_path, mnemonic: argv.m, @@ -78,7 +76,7 @@ var options: any = { unlockedAccounts: argv.unlock, secure: argv.n, hdPath: argv.hdPath - } as any, + } as any, // any type this because we just pass whatever the user gives us logging: { debug: argv.debug, verbose: argv.v, @@ -100,15 +98,15 @@ var options: any = { vmErrorsOnRPCResponse: !argv.noVMErrorsOnRPCResponse, allowUnlimitedContractSize: argv.allowUnlimitedContractSize, time: argv.t, - chainId: argv.chainId - // keepAliveTimeout: argv.keepAliveTimeout,// TODO: this was removed on purpose - }, + chainId: argv.chainId, + keepAliveTimeout: argv.keepAliveTimeout + } as any, database: { dbPath: argv.db } }; -var server = Ganache.server(options); +const server = Ganache.server(options); console.log(detailedVersion); @@ -179,9 +177,9 @@ async function startGanache(err) { address )} (${about}${strBalance} ETH)`; - // if (state.isUnlocked(address) == false) { - // line += " 🔒"; - // } + if (!accounts[address].unlocked) { + line += " 🔒"; + } console.log(line); }); @@ -252,7 +250,7 @@ async function startGanache(err) { // } console.log(""); - console.log("Listening on " + host + ":" + port); + console.log("Listening on " + argv.h + ":" + argv.p); } -server.listen(port, host, startGanache); +server.listen(argv.p, argv.h, startGanache); diff --git a/src/packages/cli/index.ts b/src/packages/cli/index.ts index 23657f8cb5..526cebbc45 100644 --- a/src/packages/cli/index.ts +++ b/src/packages/cli/index.ts @@ -1,2 +1,3 @@ import Ganache from "@ganache/core"; +export { ServerOptions, ProviderOptions } from "@ganache/core"; export default Ganache; diff --git a/src/packages/cli/tsconfig.json b/src/packages/cli/tsconfig.json index 25d5c3cf7e..081b4a87ef 100644 --- a/src/packages/cli/tsconfig.json +++ b/src/packages/cli/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["index.ts"] + "include": ["index.ts", "cli.ts"] } diff --git a/src/packages/ganache/npm-shrinkwrap.json b/src/packages/ganache/npm-shrinkwrap.json index 5b6a690549..e5dc1172a5 100644 --- a/src/packages/ganache/npm-shrinkwrap.json +++ b/src/packages/ganache/npm-shrinkwrap.json @@ -2271,27 +2271,6 @@ "typical": "^5.0.0" } }, - "wrapper-webpack-plugin": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrapper-webpack-plugin/-/wrapper-webpack-plugin-2.1.0.tgz", - "integrity": "sha512-e+2FhSYGCxhDq3PcUw5mRhH+8vcYa+9d9AuLChJUZ9ZbUPhQOHZ/O2dnN98iTqeUuvrzSSOv13+x/NhrAm5JEg==", - "dev": true, - "requires": { - "webpack-sources": "^1.1.0" - }, - "dependencies": { - "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - } - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/src/packages/ganache/src/cli.js b/src/packages/ganache/src/cli.js new file mode 100644 index 0000000000..896f21dedf --- /dev/null +++ b/src/packages/ganache/src/cli.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +import "@ganache/cli"; diff --git a/src/packages/options/src/create.ts b/src/packages/options/src/create.ts index 4facf51bdd..45426ec33f 100644 --- a/src/packages/options/src/create.ts +++ b/src/packages/options/src/create.ts @@ -33,11 +33,17 @@ function fill(defaults: any, options: any, target: any, namespace: any) { for (let i = 0, l = keys.length; i < l; i++) { const key = keys[i]; const propDefinition = def[key]; - const value = namespaceOptions[key]; - if (value != null) { - config[key] = propDefinition.normalize(value); - } else if (hasOwn(propDefinition, "default")) { - config[key] = propDefinition.default(config); + let value = namespaceOptions[key]; + if (value !== undefined) { + config[key] = propDefinition.normalize(namespaceOptions[key]); + } else { + const legacyName = propDefinition.legacyName || key; + value = options[legacyName]; + if (value !== undefined) { + config[key] = propDefinition.normalize(value); + } else if (hasOwn(propDefinition, "default")) { + config[key] = propDefinition.default(config); + } } } } else { @@ -48,7 +54,7 @@ function fill(defaults: any, options: any, target: any, namespace: any) { const legacyName = propDefinition.legacyName || key; const value = options[legacyName]; - if (value != null) { + if (value !== undefined) { config[key] = propDefinition.normalize(value); } else if (hasOwn(propDefinition, "default")) { config[key] = propDefinition.default(config); diff --git a/src/packages/promise-queue/tsconfig.json b/src/packages/promise-queue/tsconfig.json index 62676b00a1..25d5c3cf7e 100644 --- a/src/packages/promise-queue/tsconfig.json +++ b/src/packages/promise-queue/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["src"] + "include": ["index.ts"] } From 389b1b8b47d906392d756c43f5f443e3d4ba1878 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 7 Nov 2020 18:13:43 -0500 Subject: [PATCH 685/691] built cli --- npm-shrinkwrap.json | 18 +++++++++++++++ package.json | 1 + src/packages/ganache/package.json | 4 ++++ src/packages/ganache/src/cli.js | 3 --- src/packages/ganache/src/cli.ts | 3 +++ src/packages/ganache/tsconfig.json | 2 +- src/packages/ganache/webpack.config.ts | 3 ++- .../ganache/webpack/webpack.cli.config.ts | 22 +++++++++++++++++++ tsconfig.json | 7 ++++++ 9 files changed, 58 insertions(+), 5 deletions(-) delete mode 100644 src/packages/ganache/src/cli.js create mode 100644 src/packages/ganache/src/cli.ts create mode 100644 src/packages/ganache/webpack/webpack.cli.config.ts diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a7e90d8f49..602cef2955 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2425,6 +2425,24 @@ "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, + "@zerollup/ts-helpers": { + "version": "1.7.18", + "resolved": "https://registry.npmjs.org/@zerollup/ts-helpers/-/ts-helpers-1.7.18.tgz", + "integrity": "sha512-S9zN+y+i5yN/evfWquzSO3lubqPXIsPQf6p9OiPMpRxDx/0totPLF39XoRw48Dav5dSvbIE8D2eAPpXXJxvKwg==", + "dev": true, + "requires": { + "resolve": "^1.12.0" + } + }, + "@zerollup/ts-transform-paths": { + "version": "1.7.18", + "resolved": "https://registry.npmjs.org/@zerollup/ts-transform-paths/-/ts-transform-paths-1.7.18.tgz", + "integrity": "sha512-YPVUxvWQVzRx1OBN0Pmkd58+R9FcfUJuwTaPUSoi5rKxuXMtxevTXdfi0w5mEaIH8b0DfL+wg0wFDHiJE+S2zA==", + "dev": true, + "requires": { + "@zerollup/ts-helpers": "^1.7.18" + } + }, "@zkochan/cmd-shim": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz", diff --git a/package.json b/package.json index 0061486c4d..028c2a9dc6 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@types/npm-package-arg": "6.1.0", "@types/prettier": "2.1.5", "@types/yargs": "15.0.9", + "@zerollup/ts-transform-paths": "1.7.18", "camelcase": "6.1.0", "chalk": "4.1.0", "cli-highlight": "2.1.4", diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index abde59cf7a..6ec84d3ab8 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -9,6 +9,10 @@ "browser": "dist/web/ganache.min.js", "types": "lib/index.d.ts", "source": "index.ts", + "bin": { + "ganache": "./lib/cli.js", + "ganache-cli": "./lib/cli.js" + }, "directories": { "lib": "lib", "test": "tests" diff --git a/src/packages/ganache/src/cli.js b/src/packages/ganache/src/cli.js deleted file mode 100644 index 896f21dedf..0000000000 --- a/src/packages/ganache/src/cli.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -import "@ganache/cli"; diff --git a/src/packages/ganache/src/cli.ts b/src/packages/ganache/src/cli.ts new file mode 100644 index 0000000000..138f2163f5 --- /dev/null +++ b/src/packages/ganache/src/cli.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +import "@ganache/cli/cli"; diff --git a/src/packages/ganache/tsconfig.json b/src/packages/ganache/tsconfig.json index 25d5c3cf7e..2bb885156a 100644 --- a/src/packages/ganache/tsconfig.json +++ b/src/packages/ganache/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["index.ts"] + "include": ["index.ts", "src/cli.ts"] } diff --git a/src/packages/ganache/webpack.config.ts b/src/packages/ganache/webpack.config.ts index ceb4f824a1..a6ce6ef258 100644 --- a/src/packages/ganache/webpack.config.ts +++ b/src/packages/ganache/webpack.config.ts @@ -1,4 +1,5 @@ import webpackBrowser from "./webpack/webpack.browser.config"; import webpackNode from "./webpack/webpack.node.config"; +import webpackCli from "./webpack/webpack.cli.config"; -export default [webpackBrowser, webpackNode]; +export default [webpackBrowser, webpackNode, webpackCli]; diff --git a/src/packages/ganache/webpack/webpack.cli.config.ts b/src/packages/ganache/webpack/webpack.cli.config.ts new file mode 100644 index 0000000000..0d97c50d59 --- /dev/null +++ b/src/packages/ganache/webpack/webpack.cli.config.ts @@ -0,0 +1,22 @@ +import base from "./webpack.common.config"; +import webpack from "webpack"; +import path from "path"; +import merge from "webpack-merge"; + +const config: webpack.Configuration = merge({}, base, { + target: "node10.7", + output: { + path: path.resolve(__dirname, "../", "dist", "cli") + }, + module: { + rules: [ + { + // webpack load native modules + test: /\.node$/, + loader: "node-loader" + } + ] + } +}); + +export default config; diff --git a/tsconfig.json b/tsconfig.json index 5dea564bc2..9bba1c6888 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,9 +18,16 @@ "lib": ["ES2020"], "typeRoots": ["./node_modules/@types", "src/@types"], "experimentalDecorators": true, + "paths": { + "@ganache/cli/cli": ["../cli/lib/cli"] + }, "plugins": [ { "transform": "ts-transformer-inline-file/transformer" + }, + { + "transform": "@zerollup/ts-transform-paths", + "exclude": "*" } ] } From 8949364f1349d1f0f869be4b8627516fb41245e5 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 7 Nov 2020 18:20:36 -0500 Subject: [PATCH 686/691] clean dist folders on tsc.clean --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 028c2a9dc6..01d6bb00ae 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "reinstall": "npm run clean && npm install", "test": "lerna exec -- npm run test", "tsc": "lerna exec -- npm run tsc", - "tsc.clean": "npx lerna exec -- npx shx rm -rf lib" + "tsc.clean": "npx lerna exec -- npx shx rm -rf lib dist" }, "devDependencies": { "@istanbuljs/nyc-config-typescript": "1.0.1", From 9fd2cdd742055865d21c6984d26aaca996a74a1d Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Sat, 7 Nov 2020 21:44:57 -0500 Subject: [PATCH 687/691] make builds work --- src/packages/cli/cli.ts | 6 +- src/packages/ganache/npm-shrinkwrap.json | 121 ++++++++++++++---- src/packages/ganache/package.json | 11 +- .../ganache/webpack/webpack.cli.config.ts | 9 ++ .../ganache/webpack/webpack.node.config.ts | 1 + 5 files changed, 117 insertions(+), 31 deletions(-) diff --git a/src/packages/cli/cli.ts b/src/packages/cli/cli.ts index c91fb3efc1..97aaf78935 100644 --- a/src/packages/cli/cli.ts +++ b/src/packages/cli/cli.ts @@ -211,21 +211,21 @@ async function startGanache(err) { console.log(""); console.log("Gas Price"); console.log("=================="); - console.log(liveOptions.miner.gasPrice); + console.log(liveOptions.miner.gasPrice.toBigInt()); } if (liveOptions.miner.blockGasLimit) { console.log(""); console.log("BlockGas Limit"); console.log("=================="); - console.log(liveOptions.miner.blockGasLimit); + console.log(liveOptions.miner.blockGasLimit.toBigInt()); } if (liveOptions.miner.callGasLimit) { console.log(""); console.log("Call Gas Limit"); console.log("=================="); - console.log(liveOptions.miner.callGasLimit); + console.log(liveOptions.miner.callGasLimit.toBigInt()); } // if (options.fork) { diff --git a/src/packages/ganache/npm-shrinkwrap.json b/src/packages/ganache/npm-shrinkwrap.json index e5dc1172a5..51019d29c1 100644 --- a/src/packages/ganache/npm-shrinkwrap.json +++ b/src/packages/ganache/npm-shrinkwrap.json @@ -248,7 +248,6 @@ "version": "6.2.3", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "dev": true, "requires": { "buffer": "^5.5.0", "immediate": "^3.2.3", @@ -261,7 +260,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -370,8 +368,7 @@ "base64-js": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "dev": true + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, "big.js": { "version": "5.2.2", @@ -379,6 +376,22 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, + "bigint-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", + "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", + "requires": { + "bindings": "^1.3.0" + } + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "bn.js": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", @@ -397,8 +410,7 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browserify-aes": { "version": "1.2.0", @@ -749,7 +761,6 @@ "version": "6.5.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", - "dev": true, "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -763,8 +774,7 @@ "bn.js": { "version": "4.11.9", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" } } }, @@ -944,6 +954,11 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -1043,7 +1058,6 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -1053,7 +1067,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -1069,14 +1082,12 @@ "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, "immediate": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", - "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", - "dev": true + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" }, "import-local": { "version": "3.0.2", @@ -1091,8 +1102,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "interpret": { "version": "2.2.0", @@ -1255,11 +1265,26 @@ "minimist": "^1.2.5" } }, + "keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" + } + } + }, "level-concat-iterator": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==", - "dev": true + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" }, "level-js": { "version": "5.0.2", @@ -1289,11 +1314,20 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", - "dev": true, "requires": { "xtend": "^4.0.2" } }, + "leveldown": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz", + "integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==", + "requires": { + "abstract-leveldown": "~6.2.1", + "napi-macros": "~2.0.0", + "node-gyp-build": "~4.1.0" + } + }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -1455,14 +1489,12 @@ "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, "minimalistic-crypto-utils": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "minimist": { "version": "1.2.5", @@ -1470,12 +1502,27 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, + "napi-macros": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz", + "integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==" + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node-gyp-build": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz", + "integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==" + }, "node-loader": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/node-loader/-/node-loader-1.0.2.tgz", @@ -1807,6 +1854,23 @@ "ajv-keywords": "^3.5.2" } }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "dependencies": { + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" + } + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -1841,6 +1905,12 @@ "shebang-regex": "^3.0.0" } }, + "shebang-loader": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shebang-loader/-/shebang-loader-0.0.1.tgz", + "integrity": "sha1-pAAEldRMzu++xjQ157FphWn6Uuw=", + "dev": true + }, "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", @@ -2280,8 +2350,7 @@ "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" }, "yn": { "version": "3.1.1", diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index 6ec84d3ab8..06ce1ecce1 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -10,8 +10,8 @@ "types": "lib/index.d.ts", "source": "index.ts", "bin": { - "ganache": "./lib/cli.js", - "ganache-cli": "./lib/cli.js" + "ganache": "dist/cli/ganache.min.js", + "ganache-cli": "dist/cli/ganache.min.js" }, "directories": { "lib": "lib", @@ -61,6 +61,7 @@ "os-browserify": "0.3.0", "path-browserify": "1.0.1", "process": "0.11.10", + "shebang-loader": "0.0.1", "stream-browserify": "3.0.0", "ts-loader": "8.0.7", "ts-node": "9.0.0", @@ -69,5 +70,11 @@ "util": "0.12.3", "webpack": "5.4.0", "webpack-cli": "4.2.0" + }, + "dependencies": { + "bigint-buffer": "1.1.5", + "keccak": "3.0.1", + "leveldown": "5.6.0", + "secp256k1": "4.0.2" } } diff --git a/src/packages/ganache/webpack/webpack.cli.config.ts b/src/packages/ganache/webpack/webpack.cli.config.ts index 0d97c50d59..3c78cea72c 100644 --- a/src/packages/ganache/webpack/webpack.cli.config.ts +++ b/src/packages/ganache/webpack/webpack.cli.config.ts @@ -4,16 +4,25 @@ import path from "path"; import merge from "webpack-merge"; const config: webpack.Configuration = merge({}, base, { + entry: "./src/cli.ts", target: "node10.7", output: { path: path.resolve(__dirname, "../", "dist", "cli") }, + externals: ["bigint-buffer", "leveldown", "secp256k1", "keccak"], + plugins: [ + new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true }) + ], module: { rules: [ { // webpack load native modules test: /\.node$/, loader: "node-loader" + }, + { + test: /cli.ts$/, + use: "shebang-loader" } ] } diff --git a/src/packages/ganache/webpack/webpack.node.config.ts b/src/packages/ganache/webpack/webpack.node.config.ts index f6282b2fc9..babd9f0162 100644 --- a/src/packages/ganache/webpack/webpack.node.config.ts +++ b/src/packages/ganache/webpack/webpack.node.config.ts @@ -8,6 +8,7 @@ const config: webpack.Configuration = merge({}, base, { output: { path: path.resolve(__dirname, "../", "dist", "node") }, + externals: ["leveldown", "secp256k1", "keccak"], module: { rules: [ { From 7b94228a711483a54fbabaea0169ef7f79ee7466 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Tue, 10 Nov 2020 16:03:28 -0500 Subject: [PATCH 688/691] cli things . . . --- src/chains/ethereum/src/api.ts | 60 ++++++++-------- src/chains/ethereum/src/blockchain.ts | 71 ++++++++++++------- .../src/data-managers/transaction-manager.ts | 17 +++-- .../src/things/transaction-receipt.ts | 5 +- .../ethereum/tests/api/miner/miner.test.ts | 2 +- .../tests/api/personal/personal.test.ts | 4 +- .../ethereum/tests/api/web3/web3.test.ts | 5 +- src/packages/cli/args.ts | 2 +- src/packages/cli/cli.ts | 5 ++ .../things/json-rpc/json-rpc-base-types.ts | 6 +- src/packages/utils/src/utils/constants.ts | 1 + 11 files changed, 106 insertions(+), 72 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 5a840c5b86..4f599fe0ec 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -16,8 +16,7 @@ import Transaction from "./things/transaction"; import Wallet from "./wallet"; import { decode as rlpDecode } from "rlp"; import { $INLINE_JSON } from "ts-transformer-inline-file"; - -const createKeccakHash = require("keccak"); +import keccak from "keccak"; import { PromiEvent, utils } from "@ganache/utils"; import Emittery from "emittery"; @@ -51,7 +50,7 @@ const { version } = $INLINE_JSON("../../../packages/ganache/package.json"); //#region Constants const RPCQUANTITY_ZERO = utils.RPCQUANTITY_ZERO; -const CLIENT_VERSION = `Ganache/v${version}`; +const CLIENT_VERSION = `Ganache/v${version}/EthereumJS TestRPC/v${version}/ethereum-js`; const PROTOCOL_VERSION = Data.from("0x3f"); const RPC_MODULES = { eth: "1.0", @@ -171,7 +170,7 @@ export default class EthereumApi implements types.Api { ) { this.#options = options; - const chain = options.chain; + const { chain } = options; const { initialAccounts } = (this.#wallet = wallet); const coinbaseAddress = parseCoinbaseAddress( options.miner.coinbase, @@ -627,7 +626,7 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1) async web3_sha3(data: string) { - return Data.from(createKeccakHash("keccak256").update(data).digest()); + return Data.from(keccak("keccak256").update(data).digest()); } //#endregion @@ -687,14 +686,14 @@ export default class EthereumApi implements types.Api { return blockchain.vm.copy(); }; return new Promise((resolve, reject) => { - const coinbase = blockchain.coinbase; + const { coinbase } = blockchain; const tx = Transaction.fromJSON( transaction, this.#common, Transaction.types.fake ); if (tx._from == null) { - tx._from = blockchain.coinbase.toBuffer(); + tx._from = coinbase.toBuffer(); } if (tx.gasLimit.length !== 0) { tx.gas = tx.gasLimit; @@ -711,7 +710,6 @@ export default class EthereumApi implements types.Api { timestamp: parentHeader.timestamp, parentHash: parentHeader.parentHash, coinbase: coinbase.toBuffer(), - // gas estimates and eth_calls aren't subject to regular block gas limits gasLimit: tx.gas }); newBlock.value.transactions.push(tx); @@ -1148,17 +1146,19 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1) async eth_getTransactionByHash(transactionHash: string) { - const chain = this.#blockchain; + // Note: we do NOT use the transactionManager's finalizationQueue, because + // we might actually want to get transactions that aren't yet finalized. + const { transactions } = this.#blockchain; const hashBuffer = Data.from(transactionHash).toBuffer(); // we must check the database before checking the pending cache, because the // cache is updated _after_ the transaction is already in the database, and // the database contains block info whereas the pending cache doesn't. - const transaction = await chain.transactions.get(hashBuffer); + const transaction = await transactions.get(hashBuffer); if (transaction === null) { // if we can't find it in the list of pending transactions, check the db! - const tx = chain.transactions.transactionPool.find(hashBuffer); + const tx = transactions.transactionPool.find(hashBuffer); return tx ? tx.toJSON(null) : null; } else { return transaction.toJSON(); @@ -1175,11 +1175,17 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1) async eth_getTransactionReceipt(transactionHash: string) { - const blockchain = this.#blockchain; - const transactionPromise = blockchain.transactions.get(transactionHash); - const receiptPromise = blockchain.transactionReceipts.get(transactionHash); + const { transactions, transactionReceipts, blocks } = this.#blockchain; + const txHash = Data.from(transactionHash).toBuffer(); + if (this.#blockchain.isStarted() && this.#options.miner.blockTime === 0) { + const prom = transactions.finalizationQueue.get(txHash.toString("hex")); + if (prom) await prom; + } + + const transactionPromise = transactions.get(txHash); + const receiptPromise = transactionReceipts.get(txHash); const blockPromise = transactionPromise.then(t => - t ? blockchain.blocks.get(t._blockNum) : null + t ? blocks.get(t._blockNum) : null ); const [transaction, receipt, block] = await Promise.all([ transactionPromise, @@ -1253,9 +1259,9 @@ export default class EthereumApi implements types.Api { if (isUnlockedAccount) { const secretKey = wallet.unlockedAccounts.get(fromString); return this.#blockchain.queueTransaction(tx, secretKey); + } else { + return this.#blockchain.queueTransaction(tx); } - - return this.#blockchain.queueTransaction(tx); } /** @@ -1290,24 +1296,16 @@ export default class EthereumApi implements types.Api { @assertArgLength(2) async eth_sign(address: string | Buffer, message: string | Buffer) { const account = Address.from(address).toString().toLowerCase(); - const wallet = this.#wallet; - const privateKey = wallet.unlockedAccounts.get(account); + + const privateKey = this.#wallet.unlockedAccounts.get(account); if (privateKey == null) { throw new Error("cannot sign data; no private key"); } + const chainId = this.#options.chain.chainId; const messageHash = hashPersonalMessage(Data.from(message).toBuffer()); - const signature = ecsign( - messageHash, - privateKey.toBuffer(), - this.#options.chain.chainId - ); - return toRpcSig( - signature.v, - signature.r, - signature.s, - this.#options.chain.chainId - ); + const { v, r, s } = ecsign(messageHash, privateKey.toBuffer(), chainId); + return toRpcSig(v, r, s, chainId); } /** @@ -1761,7 +1759,7 @@ export default class EthereumApi implements types.Api { timestamp: parentHeader.timestamp, parentHash: parentHeader.parentHash, coinbase: blockchain.coinbase.toBuffer(), - gas + gasLimit: gas.toBuffer() }); const simulatedTransaction = { diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index df6003d5ec..35f1d861b5 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -1,3 +1,4 @@ +import { EOL } from "os"; import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; import Miner, { BlockData } from "./miner/miner"; import Database from "./database"; @@ -26,6 +27,7 @@ import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; import { VmError, ERROR } from "ethereumjs-vm/dist/exceptions"; import { EthereumInternalOptions } from "./options"; import { Snapshots } from "./types/snapshots"; +import { options } from "yargs"; type SimulationTransaction = { /** @@ -132,15 +134,15 @@ export default class Blockchain extends Emittery.Typed< const legacyInstamine = options.miner.legacyInstamine; { - // warnings + // warnings and errors if (legacyInstamine) { console.info( "Legacy instamining, where transactions are fully mined before the hash is returned, is deprecated and will be removed in the future." ); } - if (instamine === false) { - if (legacyInstamine === true) { + if (!instamine) { + if (legacyInstamine) { console.info( "Setting `legacyInstamine` to `true` has no effect when blockTime is non-zero" ); @@ -268,10 +270,10 @@ export default class Blockchain extends Emittery.Typed< const prevHeader = prevBlock.value.header; const prevNumber = Quantity.from(prevHeader.number).toBigInt() || 0n; const block = blocks.createBlock({ - parentHash: prevHeader.hash(), number: Quantity.from(prevNumber + 1n).toBuffer(), - coinbase: this.coinbase.toBuffer(), timestamp: blockData.timestamp, + parentHash: prevHeader.hash(), + coinbase: this.coinbase.toBuffer(), gasLimit: options.miner.blockGasLimit.toBuffer(), transactionsTrie: blockData.transactionsTrie.root, receiptTrie: blockData.receiptTrie.root, @@ -284,10 +286,10 @@ export default class Blockchain extends Emittery.Typed< }; #saveNewBlock = (block: Block) => { - const blocks = this.blocks; + const { blocks } = this; blocks.latest = block; - const value = block.value; - const header = value.header; + const { value } = block; + const { header } = value; return this.#database.batch(() => { const blockHash = value.hash(); const blockNumber = header.number; @@ -296,6 +298,7 @@ export default class Blockchain extends Emittery.Typed< const timestamp = new Date( Quantity.from(header.timestamp).toNumber() * 1000 ).toString(); + const logOutput: string[] = []; value.transactions.forEach((tx: Transaction, i: number) => { const hash = tx.hash(); const index = Quantity.from(i).toBuffer(); @@ -316,25 +319,32 @@ export default class Blockchain extends Emittery.Typed< tx.getLogs().forEach(blockLogs.append.bind(blockLogs, index, hash)); - const error = tx.execException; - this.#logTransaction(hash, receipt, blockNumberQ, timestamp, error); + logOutput.push( + this.#getTransactionLogOutput( + hash, + receipt, + blockNumberQ, + timestamp, + tx.execException + ) + ); }); + blockLogs.blockNumber = blockNumberQ; this.blockLogs.set(blockNumber, blockLogs.serialize()); blocks.putBlock(block); + this.#options.logging.logger.log(logOutput.join(EOL)); return { block, blockLogs }; }); }; #emitNewBlock = async (blockInfo: { block: Block; blockLogs: BlockLogs }) => { const options = this.#options; - const vmErrorsOnRPCResponse = options.chain.vmErrorsOnRPCResponse; const { block, blockLogs } = blockInfo; // emit the block once everything has been fully saved to the database block.value.transactions.forEach(transaction => { - const error = vmErrorsOnRPCResponse ? transaction.execException : null; - transaction.finalize("confirmed", error); + transaction.finalize("confirmed", transaction.execException); }); if (this.#instamine && options.miner.legacyInstamine) { @@ -362,34 +372,32 @@ export default class Blockchain extends Emittery.Typed< return blockInfo; }; - #logTransaction = ( + #getTransactionLogOutput = ( hash: Buffer, receipt: TransactionReceipt, blockNumber: Quantity, timestamp: string, error: RuntimeError | undefined ) => { - const logger = this.#options.logging.logger; - logger.log(""); - logger.log(" Transaction: " + Data.from(hash)); + let str = `${EOL} Transaction: ${Data.from(hash)}${EOL}`; const contractAddress = receipt.contractAddress; if (contractAddress != null) { - logger.log(" Contract created: " + Address.from(contractAddress)); + str += ` Contract created: ${Address.from(contractAddress)}${EOL}`; } - logger.log(" Gas usage: " + Quantity.from(receipt.raw[1])); - logger.log(" Block Number: " + blockNumber); - logger.log(" Block Time: " + timestamp); + str += ` Gas usage: ${Quantity.from(receipt.raw[1]).toNumber()}${EOL} + Block number: ${blockNumber.toNumber()}${EOL} + Block time: ${timestamp}${EOL}`; if (error) { - logger.log(" Runtime Error: " + error.data.message); - if ((error as any).reason) { - logger.log(" Revert reason: " + (error as any).data.reason); + str += ` Runtime error: ${error.data.message}${EOL}`; + if (error.data.reason) { + str += ` Revert reason: ${error.data.reason}${EOL}`; } } - logger.log(""); + return str; }; #handleNewBlockData = async (blockData: BlockData) => { @@ -698,8 +706,17 @@ export default class Blockchain extends Emittery.Typed< return hash; } else { if (this.#instamine && this.#options.miner.legacyInstamine) { - const { error } = await transaction.once("finalized"); - if (error) throw error; + // in legacyInstamine mode we must wait for the transaction to be saved + // before we can return the hash + const { status, error } = await transaction.once("finalized"); + // in legacyInstamine mode we must throw on all rejected transaction + // errors. We must also throw on `confirmed` tranactions when + // vmErrorsOnRPCResposnse is enabled. + if ( + error && + (status === "rejected" || this.#options.chain.vmErrorsOnRPCResponse) + ) + throw error; } return hash; } diff --git a/src/chains/ethereum/src/data-managers/transaction-manager.ts b/src/chains/ethereum/src/data-managers/transaction-manager.ts index 406e5e9c51..130164cb08 100644 --- a/src/chains/ethereum/src/data-managers/transaction-manager.ts +++ b/src/chains/ethereum/src/data-managers/transaction-manager.ts @@ -9,9 +9,10 @@ import Common from "ethereumjs-common"; import { Data } from "@ganache/utils"; export default class TransactionManager extends Manager { - public transactionPool: TransactionPool; + public readonly transactionPool: TransactionPool; - #queue = new PromiseQueue(); + public readonly finalizationQueue = new Map>(); + readonly #queue = new PromiseQueue(); #paused = false; #resumer: Promise; #resolver: (value: void) => void; @@ -50,12 +51,17 @@ export default class TransactionManager extends Manager { secretKey ); const result = await this.#queue.add(insertion); + if (result) { + const hash = transaction.hash().toString("hex"); + const txQueue = this.finalizationQueue.set( + hash, + transaction.once("finalized").then(() => txQueue.delete(hash)) + ); + this.transactionPool.drain(); - return true; - } else { - return false; } + return result; } /** @@ -71,6 +77,7 @@ export default class TransactionManager extends Manager { public clear() { this.#queue.clear(false); this.transactionPool.clear(); + this.finalizationQueue.clear(); } /** diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index ede2214c3b..4de9ab7f04 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -3,6 +3,9 @@ import { Block } from "../data-managers/block-manager"; import { encode as rlpEncode, decode as rlpDecode } from "rlp"; import { Data, Quantity } from "@ganache/utils"; import BlockLogs, { TransactionLog } from "./blocklogs"; +import { utils } from "@ganache/utils"; + +const STATUSES = [utils.RPCQUANTITY_ZERO, utils.RPCQUANTITY_ONE]; type OmitLastType]> = T extends [ ...infer A, @@ -109,7 +112,7 @@ export default class TransactionReceipt { contractAddress, logs, logsBloom: Data.from(raw[2], 256), - status: raw[0][0] + status: STATUSES[raw[0][0]] }; } } diff --git a/src/chains/ethereum/tests/api/miner/miner.test.ts b/src/chains/ethereum/tests/api/miner/miner.test.ts index 9d418e2e28..cc2c05e722 100644 --- a/src/chains/ethereum/tests/api/miner/miner.test.ts +++ b/src/chains/ethereum/tests/api/miner/miner.test.ts @@ -96,7 +96,7 @@ describe("api", () => { status, blockNumber } = await provider.send("eth_getTransactionReceipt", [txHash]); - assert.strictEqual(status, 1); + assert.strictEqual(status, "0x1"); const { miner } = await provider.send("eth_getBlockByNumber", [ blockNumber ]); diff --git a/src/chains/ethereum/tests/api/personal/personal.test.ts b/src/chains/ethereum/tests/api/personal/personal.test.ts index 1ec37637c7..c9a62effc2 100644 --- a/src/chains/ethereum/tests/api/personal/personal.test.ts +++ b/src/chains/ethereum/tests/api/personal/personal.test.ts @@ -59,7 +59,7 @@ describe("api", () => { ]); assert.strictEqual( receipt.status, - 1, + "0x1", "Transaction failed when it should have succeeded" ); @@ -158,7 +158,7 @@ describe("api", () => { ]); assert.strictEqual( receipt.status, - 1, + "0x1", "Transaction failed when it should have succeeded" ); diff --git a/src/chains/ethereum/tests/api/web3/web3.test.ts b/src/chains/ethereum/tests/api/web3/web3.test.ts index 63e194920d..a87f8949dd 100644 --- a/src/chains/ethereum/tests/api/web3/web3.test.ts +++ b/src/chains/ethereum/tests/api/web3/web3.test.ts @@ -12,7 +12,10 @@ describe("api", () => { it("web3_clientVersion returns the client version", async () => { const result = await provider.send("web3_clientVersion"); - assert.deepStrictEqual(result, "Ganache/v" + version); + assert.deepStrictEqual( + result, + `Ganache/v${version}/EthereumJS TestRPC/v${version}/ethereum-js` + ); }); it("web3_sha should hash the given input", async () => { diff --git a/src/packages/cli/args.ts b/src/packages/cli/args.ts index e8fd9ae7ac..81cd18069c 100644 --- a/src/packages/cli/args.ts +++ b/src/packages/cli/args.ts @@ -141,7 +141,7 @@ export default function (version: string, isDocker: boolean) { describe: "Do not transmit transaction failures as RPC errors. Enable this flag for error reporting behaviour which is compatible with other clients such as geth and Parity.", type: "boolean", - default: false + default: true }) .option("b", { group: "Chain:", diff --git a/src/packages/cli/cli.ts b/src/packages/cli/cli.ts index 97aaf78935..45f39e01ce 100644 --- a/src/packages/cli/cli.ts +++ b/src/packages/cli/cli.ts @@ -249,6 +249,11 @@ async function startGanache(err) { // console.log("Max Cache Size: " + maxCacheSize); // } + console.log(""); + console.log("Chain Id"); + console.log("=================="); + console.log(liveOptions.chain.chainId); + console.log(""); console.log("Listening on " + argv.h + ":" + argv.p); } diff --git a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts index 590e598412..8de25c06ec 100644 --- a/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts +++ b/src/packages/utils/src/things/json-rpc/json-rpc-base-types.ts @@ -1,7 +1,7 @@ import { bigIntToBuffer } from "../../utils"; import { uintToBuffer } from "../../utils"; -const EMPTY_BUFFER = Buffer.allocUnsafe(0); +import { BUFFER_EMPTY } from "../../utils/constants"; export const strCache = new WeakMap(); export const bufCache = new WeakMap(); @@ -47,7 +47,7 @@ export class BaseJsonRpcType< case "string": { // handle hex-encoded string if ((value as string).indexOf("0x") === 0) { - strCache.set(this, value); + strCache.set(this, (value as string).toLowerCase()); toBuffers.set(this, () => { let fixedValue = (value as string).slice(2); if (fixedValue.length % 2 === 1) { @@ -68,7 +68,7 @@ export class BaseJsonRpcType< // This is a weird thing that returns undefined/null for a call // to toString(). this.toString = () => value as string; - bufCache.set(this, EMPTY_BUFFER); + bufCache.set(this, BUFFER_EMPTY); break; } throw new Error(`Cannot wrap a "${type}" as a json-rpc type`); diff --git a/src/packages/utils/src/utils/constants.ts b/src/packages/utils/src/utils/constants.ts index b4098c49b5..2fa4b5304a 100644 --- a/src/packages/utils/src/utils/constants.ts +++ b/src/packages/utils/src/utils/constants.ts @@ -4,4 +4,5 @@ export const ACCOUNT_ZERO = Buffer.allocUnsafe(20).fill(0); export const BUFFER_EMPTY = Buffer.allocUnsafe(0); export const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); export const RPCQUANTITY_ZERO = Quantity.from(0n); +export const RPCQUANTITY_ONE = Quantity.from(1n); export const WEI = 1000000000000000000n as const; From 4ded160cb921847a103ba9b48890ba0921cd7779 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 12 Nov 2020 21:51:06 -0500 Subject: [PATCH 689/691] use our own block instead of an ethereumjs-block --- src/chains/ethereum/src/api.ts | 86 +++---- src/chains/ethereum/src/blockchain.ts | 172 +++++++------ .../src/data-managers/account-manager.ts | 2 +- .../src/data-managers/block-manager.ts | 123 +--------- .../ethereum/src/helpers/filter-parsing.ts | 3 +- src/chains/ethereum/src/miner/miner.ts | 71 +++--- .../ethereum/src/options/miner-options.ts | 26 +- .../ethereum/src/things/runtime-block.ts | 230 ++++++++++++++++++ .../src/things/transaction-receipt.ts | 12 +- src/chains/ethereum/src/things/transaction.ts | 17 +- src/chains/ethereum/src/types/snapshots.ts | 2 +- .../ethereum/tests/api/eth/subscribe.test.ts | 6 +- src/packages/utils/src/utils/constants.ts | 10 +- 13 files changed, 466 insertions(+), 294 deletions(-) create mode 100644 src/chains/ethereum/src/things/runtime-block.ts diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index 4f599fe0ec..a794c84024 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1,4 +1,5 @@ //#region Imports +import { RuntimeBlock, Block } from "./things/runtime-block"; import { toRpcSig, KECCAK256_NULL, @@ -23,7 +24,6 @@ import Emittery from "emittery"; import Common from "ethereumjs-common"; import BlockLogs from "./things/blocklogs"; import EthereumAccount from "ethereumjs-account"; -import { Block } from "./data-managers/block-manager"; import estimateGas from "./helpers/gas-estimator"; import CodedError, { ErrorCodes } from "./errors/coded-error"; import { WhisperPostObject } from "./types/shh"; @@ -597,14 +597,16 @@ export default class EthereumApi implements types.Api { /** * Set the extraData block header field a miner can include - * @param address + * @param extra */ @assertArgLength(1) async miner_setExtra(extra: string) { - if (extra.length > 32) { - throw new Error(`extra exceeds max length. ${extra.length} > 32`); + const bytes = Data.from(extra); + const length = bytes.toBuffer().length; + if (length > 32) { + throw new Error(`extra exceeds max length. ${length} > 32`); } - this.#options.miner.extraData = extra; + this.#options.miner.extraData = bytes; return true; } //#endregion @@ -679,7 +681,7 @@ export default class EthereumApi implements types.Api { const blockchain = this.#blockchain; const blocks = blockchain.blocks; const parentBlock = await blocks.get(blockNumber); - const parentHeader = parentBlock.value.header; + const parentHeader = parentBlock.header; const options = this.#options; const generateVM = () => { @@ -705,17 +707,16 @@ export default class EthereumApi implements types.Api { tx.gas = tx.gasLimit = options.miner.callGasLimit.toBuffer(); } } - const newBlock = blocks.createBlock({ - number: parentHeader.number, - timestamp: parentHeader.timestamp, - parentHash: parentHeader.parentHash, - coinbase: coinbase.toBuffer(), - gasLimit: tx.gas - }); - newBlock.value.transactions.push(tx); + const newBlock = new RuntimeBlock( + parentHeader.number, + parentHeader.parentHash, + parentHeader.miner, + tx.gas, + parentHeader.timestamp + ); const runArgs = { tx: tx, - block: newBlock.value, + block: newBlock, skipBalance: true, skipNonce: true }; @@ -982,8 +983,7 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(0) async eth_blockNumber() { - const latest = await this.#blockchain.blocks.get(Tag.LATEST); - return Quantity.from(latest.value.header.number); + return this.#blockchain.blocks.latest.header.number; } /** @@ -1386,25 +1386,25 @@ export default class EthereumApi implements types.Api { const promiEvent = PromiEvent.resolve(subscription); const unsubscribe = this.#blockchain.on("block", (block: Block) => { - const value = block.value; + const value = block; const header = value.header; const result = { - logsBloom: Data.from(header.bloom, 256), - miner: Address.from(header.coinbase), - difficulty: Quantity.from(header.difficulty), - extraData: Data.from(header.extraData), - gasLimit: Quantity.from(header.gasLimit), - gasUsed: Quantity.from(header.gasUsed), - hash: Data.from(value.hash(), 32), - mixHash: Data.from(header.mixHash, 32), - nonce: Data.from(header.nonce, 8), - number: Quantity.from(header.number, true), - parentHash: Data.from(header.parentHash, 32), - receiptsRoot: Data.from(header.receiptTrie, 32), - stateRoot: Data.from(header.stateRoot, 32), - timestamp: Quantity.from(header.timestamp), - transactionsRoot: Data.from(header.transactionsTrie, 32), - sha3Uncles: Data.from(header.uncleHash, 32) + logsBloom: header.logsBloom, + miner: header.miner, + difficulty: header.difficulty, + extraData: header.extraData, + gasLimit: header.gasLimit, + gasUsed: header.gasUsed, + hash: block.hash(), + mixHash: block.header.mixHash, + nonce: header.nonce, + number: header.number, + parentHash: header.parentHash, + receiptsRoot: header.receiptsRoot, + stateRoot: header.stateRoot, + timestamp: header.timestamp, + transactionsRoot: header.transactionsRoot, + sha3Uncles: header.sha3Uncles }; // TODO: move the JSON stringification closer to where the message @@ -1505,7 +1505,7 @@ export default class EthereumApi implements types.Api { @assertArgLength(0) async eth_newBlockFilter() { const unsubscribe = this.#blockchain.on("block", (block: Block) => { - value.updates.push(Data.from(block.value.hash(), 32)); + value.updates.push(block.hash()); }); const value = { updates: [], @@ -1730,7 +1730,7 @@ export default class EthereumApi implements types.Api { const blockchain = this.#blockchain; const blocks = blockchain.blocks; const parentBlock = await blocks.get(blockNumber); - const parentHeader = parentBlock.value.header; + const parentHeader = parentBlock.header; const options = this.#options; let gas: Quantity; @@ -1754,13 +1754,13 @@ export default class EthereumApi implements types.Api { data = Data.from(transaction.data); } - const block = blocks.createBlock({ - number: parentHeader.number, - timestamp: parentHeader.timestamp, - parentHash: parentHeader.parentHash, - coinbase: blockchain.coinbase.toBuffer(), - gasLimit: gas.toBuffer() - }); + const block = new RuntimeBlock( + parentHeader.number, + parentHeader.parentHash, + blockchain.coinbase, + gas.toBuffer(), + parentHeader.timestamp + ); const simulatedTransaction = { gas, diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/src/blockchain.ts index 35f1d861b5..57aded2c45 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/src/blockchain.ts @@ -1,13 +1,13 @@ import { EOL } from "os"; import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; -import Miner, { BlockData } from "./miner/miner"; +import Miner from "./miner/miner"; import Database from "./database"; import Emittery from "emittery"; -import BlockManager, { Block } from "./data-managers/block-manager"; +import BlockManager from "./data-managers/block-manager"; import BlockLogs from "./things/blocklogs"; import TransactionManager from "./data-managers/transaction-manager"; import CheckpointTrie from "merkle-patricia-tree"; -import { BN } from "ethereumjs-util"; +import { BN, KECCAK256_RLP } from "ethereumjs-util"; import Account from "./things/account"; import { promisify } from "util"; import { Quantity, Data } from "@ganache/utils"; @@ -19,7 +19,6 @@ import Manager from "./data-managers/manager"; import TransactionReceipt from "./things/transaction-receipt"; import { encode as rlpEncode } from "rlp"; import Common from "ethereumjs-common"; -import { Block as EthereumBlock } from "ethereumjs-block"; import VM from "ethereumjs-vm"; import Address from "./things/address"; import BlockLogManager from "./data-managers/blocklog-manager"; @@ -27,7 +26,14 @@ import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; import { VmError, ERROR } from "ethereumjs-vm/dist/exceptions"; import { EthereumInternalOptions } from "./options"; import { Snapshots } from "./types/snapshots"; -import { options } from "yargs"; +import { RuntimeBlock, Block } from "./things/runtime-block"; +const { + BUFFER_EMPTY, + RPCQUANTITY_EMPTY, + BUFFER_32_ZERO, + BUFFER_256_ZERO, + RPCQUANTITY_ZERO +} = utils; type SimulationTransaction = { /** @@ -54,7 +60,7 @@ type SimulationTransaction = { * Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation */ data?: Data; - block: Block; + block: RuntimeBlock; }; const unref = utils.unref; @@ -173,7 +179,7 @@ export default class Blockchain extends Emittery.Typed< }); this.trie = new CheckpointTrie( database.trie, - latest.value.header.stateRoot + latest.header.stateRoot.toBuffer() ); } else { this.trie = new CheckpointTrie(database.trie, null); @@ -206,6 +212,7 @@ export default class Blockchain extends Emittery.Typed< // create first block let firstBlockTime: number; if (options.chain.time != null) { + // If we were given a timestamp, use it instead of the `_currentTime` const t = +options.chain.time; firstBlockTime = Math.floor(t / 1000); this.setTime(t); @@ -263,43 +270,26 @@ export default class Blockchain extends Emittery.Typed< }); } - #fillNewBlock = (blockData: BlockData) => { - const blocks = this.blocks; - const options = this.#options; - const prevBlock = blocks.latest; - const prevHeader = prevBlock.value.header; - const prevNumber = Quantity.from(prevHeader.number).toBigInt() || 0n; - const block = blocks.createBlock({ - number: Quantity.from(prevNumber + 1n).toBuffer(), - timestamp: blockData.timestamp, - parentHash: prevHeader.hash(), - coinbase: this.coinbase.toBuffer(), - gasLimit: options.miner.blockGasLimit.toBuffer(), - transactionsTrie: blockData.transactionsTrie.root, - receiptTrie: blockData.receiptTrie.root, - stateRoot: this.trie.root, - gasUsed: Quantity.from(blockData.gasUsed).toBuffer(), - extraData: blockData.extraData - }); - block.value.transactions = blockData.blockTransactions; - return block; - }; - - #saveNewBlock = (block: Block) => { + #saveNewBlock = ({ + block, + serialized + }: { + block: Block; + serialized: Buffer; + }) => { const { blocks } = this; blocks.latest = block; - const { value } = block; - const { header } = value; return this.#database.batch(() => { - const blockHash = value.hash(); - const blockNumber = header.number; - const blockNumberQ = Quantity.from(blockNumber); + const blockHash = block.hash().toBuffer(); + const blockHeader = block.header; + const blockNumberQ = blockHeader.number; + const blockNumber = blockHeader.number.toBuffer(); const blockLogs = BlockLogs.create(blockHash); const timestamp = new Date( - Quantity.from(header.timestamp).toNumber() * 1000 + blockHeader.timestamp.toNumber() * 1000 ).toString(); const logOutput: string[] = []; - value.transactions.forEach((tx: Transaction, i: number) => { + block.getTransactions().forEach((tx: Transaction, i: number) => { const hash = tx.hash(); const index = Quantity.from(i).toBuffer(); const txAndExtraData = [ @@ -332,7 +322,7 @@ export default class Blockchain extends Emittery.Typed< blockLogs.blockNumber = blockNumberQ; this.blockLogs.set(blockNumber, blockLogs.serialize()); - blocks.putBlock(block); + blocks.putBlock(blockNumber, blockHash, serialized); this.#options.logging.logger.log(logOutput.join(EOL)); return { block, blockLogs }; }); @@ -343,7 +333,7 @@ export default class Blockchain extends Emittery.Typed< const { block, blockLogs } = blockInfo; // emit the block once everything has been fully saved to the database - block.value.transactions.forEach(transaction => { + block.getTransactions().forEach(transaction => { transaction.finalize("confirmed", transaction.execException); }); @@ -400,10 +390,12 @@ export default class Blockchain extends Emittery.Typed< return str; }; - #handleNewBlockData = async (blockData: BlockData) => { + #handleNewBlockData = async (blockData: { + block: Block; + serialized: Buffer; + }) => { this.#blockBeingSavedPromise = this.#blockBeingSavedPromise - .then(() => this.#fillNewBlock(blockData)) - .then(this.#saveNewBlock) + .then(() => this.#saveNewBlock(blockData)) .then(this.#emitNewBlock); return this.#blockBeingSavedPromise; @@ -411,16 +403,16 @@ export default class Blockchain extends Emittery.Typed< coinbase: Address; - #readyNextBlock = (previousBlock: EthereumBlock, timestamp?: number) => { + #readyNextBlock = (previousBlock: Block, timestamp?: number) => { const previousHeader = previousBlock.header; - const previousNumber = - Quantity.from(previousHeader.number).toBigInt() || 0n; - return this.blocks.createBlock({ - number: Quantity.from(previousNumber + 1n).toBuffer(), - gasLimit: this.#options.miner.blockGasLimit.toBuffer(), - timestamp: timestamp == null ? this.#currentTime() : timestamp, - parentHash: previousHeader.hash() - }).value; + const previousNumber = previousHeader.number.toBigInt() || 0n; + return new RuntimeBlock( + Quantity.from(previousNumber + 1n), + previousBlock.hash(), + this.coinbase, + this.#options.miner.blockGasLimit.toBuffer(), + Quantity.from(timestamp == null ? this.#currentTime() : timestamp) + ); }; isStarted = () => { @@ -433,7 +425,7 @@ export default class Blockchain extends Emittery.Typed< onlyOneBlock: boolean = false ) => { await this.#blockBeingSavedPromise; - const nextBlock = this.#readyNextBlock(this.blocks.latest.value, timestamp); + const nextBlock = this.#readyNextBlock(this.blocks.latest, timestamp); return this.#miner.mine(nextBlock, maxTransactions, onlyOneBlock); }; @@ -469,7 +461,7 @@ export default class Blockchain extends Emittery.Typed< const getBlock = class T { static async [promisify.custom](number: BN) { const block = await blocks.get(number.toBuffer()).catch(_ => null); - return block ? block.value : null; + return block ? { hash: () => block.hash().toBuffer() } : null; } }; @@ -510,20 +502,40 @@ export default class Blockchain extends Emittery.Typed< timestamp: number, blockGasLimit: Quantity ) => { + // README: block `0` is weird in that a `0` _should_ be hashed as `[]`, + // but actually return a real `0` with read back later. So we pull some + // shenangians here so we don't require checks in functions that consume + // this block's `0` value later + const rawBlockNumber = RPCQUANTITY_EMPTY; + // create the genesis block - const genesis = this.blocks.next({ - // If we were given a timestamp, use it instead of the `_currentTime` - timestamp, - gasLimit: blockGasLimit.toBuffer(), - stateRoot: this.trie.root, - number: "0x0" - }); + const genesis = new RuntimeBlock( + rawBlockNumber, + Quantity.from(BUFFER_32_ZERO), + this.#options.miner.coinbase as Address, + blockGasLimit.toBuffer(), + Quantity.from(timestamp) + ); // store the genesis block in the database - return this.blocks.putBlock(genesis).then(block => ({ - block, - blockLogs: BlockLogs.create(block.value.hash()) - })); + const { block, serialized } = genesis.finalize( + KECCAK256_RLP, + KECCAK256_RLP, + BUFFER_256_ZERO, + this.trie.root, + BUFFER_EMPTY, + this.#options.miner.extraData, + [] + ); + // README: set the block number to an actual 0 now. + block.header.number = RPCQUANTITY_ZERO; + const hash = block.hash().toBuffer(); + return this.blocks + .putBlock(block.header.number.toBuffer(), hash, serialized) + .then(_ => ({ + block, + blockLogs: BlockLogs.create(hash) + })); }; #timeAdjustment: number = 0; @@ -557,15 +569,16 @@ export default class Blockchain extends Emittery.Typed< #deleteBlockData = (blocksToDelete: Block[]) => { return this.#database.batch(() => { const { blocks, transactions, transactionReceipts, blockLogs } = this; - blocksToDelete.forEach(({ value }) => { - value.transactions.forEach(tx => { + blocksToDelete.forEach(value => { + value.getTransactions().forEach(tx => { const txHash = tx.hash(); transactions.del(txHash); transactionReceipts.del(txHash); }); - blocks.del(value.header.number); - blocks.del(value.header.hash()); - blockLogs.del(value.header.number); + const blockNum = value.header.number.toBuffer(); + blocks.del(blockNum); + blocks.del(value.hash().toBuffer()); + blockLogs.del(blockNum); }); }); }; @@ -597,7 +610,7 @@ export default class Blockchain extends Emittery.Typed< if (id === 1) { snapshots.unsubscribeFromBlocks = this.on("block", block => { snapshots.blocks = { - current: block.value.hash(), + current: block.hash().toBuffer(), next: snapshots.blocks }; }); @@ -645,10 +658,10 @@ export default class Blockchain extends Emittery.Typed< this.transactions.clear(); const blocks = this.blocks; - const currentHash = blocks.latest.value.header.hash(); + const currentHash = blocks.latest.hash().toBuffer(); const snapshotBlock = snapshot.block; - const snapshotHeader = snapshotBlock.value.header; - const snapshotHash = snapshotHeader.hash(); + const snapshotHeader = snapshotBlock.header; + const snapshotHash = snapshotBlock.hash().toBuffer(); // remove this and all stored snapshots after this snapshot snaps.splice(snapshotIndex); @@ -674,7 +687,10 @@ export default class Blockchain extends Emittery.Typed< await Promise.all(blockPromises).then(this.#deleteBlockData); - setStateRootSync(this.vm.stateManager, snapshotHeader.stateRoot); + setStateRootSync( + this.vm.stateManager, + snapshotHeader.stateRoot.toBuffer() + ); blocks.latest = snapshotBlock; } @@ -741,7 +757,7 @@ export default class Blockchain extends Emittery.Typed< if (gasLeft >= 0) { const stateTrie = new CheckpointTrie( this.#database.trie, - parentBlock.value.header.stateRoot + parentBlock.header.stateRoot.toBuffer() ); const vm = this.createVmFromStateTrie( stateTrie, @@ -755,21 +771,21 @@ export default class Blockchain extends Emittery.Typed< gasLimit: Quantity.from(gasLeft).toBuffer(), to: transaction.to && transaction.to.toBuffer(), value: transaction.value && transaction.value.toBuffer(), - block: transaction.block.value + block: transaction.block }); } else { result = { execResult: { runState: { programCounter: 0 }, exceptionError: new VmError(ERROR.OUT_OF_GAS), - returnValue: Buffer.allocUnsafe(0) + returnValue: BUFFER_EMPTY } } as any; } if (result.execResult.exceptionError) { if (this.#options.chain.vmErrorsOnRPCResponse) { // eth_call transactions don't really have a transaction hash - const hash = Buffer.allocUnsafe(0); + const hash = BUFFER_EMPTY; throw new RuntimeError(hash, result, RETURN_TYPES.RETURN_VALUE); } else { return Data.from(result.execResult.returnValue || "0x"); diff --git a/src/chains/ethereum/src/data-managers/account-manager.ts b/src/chains/ethereum/src/data-managers/account-manager.ts index 5d1a7e43b4..f0be2b9c37 100644 --- a/src/chains/ethereum/src/data-managers/account-manager.ts +++ b/src/chains/ethereum/src/data-managers/account-manager.ts @@ -23,7 +23,7 @@ export default class AccountManager { ): Promise { const blockchain = this.#blockchain; const block = await blockchain.blocks.get(blockNumber); - const trieCopy = new Trie(this.#trie, block.value.header.stateRoot); + const trieCopy = new Trie(this.#trie, block.header.stateRoot.toBuffer()); return new Promise((resolve, reject) => { trieCopy.get(address.toBuffer(), (err, data) => { if (err) return reject(err); diff --git a/src/chains/ethereum/src/data-managers/block-manager.ts b/src/chains/ethereum/src/data-managers/block-manager.ts index 791d7d3d20..c05bf9505b 100644 --- a/src/chains/ethereum/src/data-managers/block-manager.ts +++ b/src/chains/ethereum/src/data-managers/block-manager.ts @@ -1,14 +1,10 @@ -import EthereumJsBlock from "ethereumjs-block"; import Manager from "./manager"; import Tag from "../things/tags"; import { LevelUp } from "levelup"; import { Quantity, Data } from "@ganache/utils"; -import Transaction from "../things/transaction"; -import { decode as rlpDecode } from "rlp"; import Common from "ethereumjs-common"; -import { utils } from "@ganache/utils"; +import { Block } from "../things/runtime-block"; -const RPCQUANTITY_ZERO = utils.RPCQUANTITY_ZERO; const NOTFOUND = 404; const EMPTY_BUFFER = Buffer.from([]); @@ -49,18 +45,6 @@ export default class BlockManager extends Manager { this.#blockIndexes = blockIndexes; } - /** - * Gets or creates the next block (which might be the *pending* block). Uses the values in the optional `header` - * object to create the block - * @param header The values to set on the block's header. These typically come from the parent block. - */ - next(header?: {}) { - if (!this.pending) { - this.pending = this.createBlock(header); - } - return this.pending; - } - getBlockByTag(tag: Tag) { switch (Tag.normalize(tag as Tag)) { case Tag.LATEST: @@ -71,7 +55,7 @@ export default class BlockManager extends Manager { break; case Tag.PENDING: // TODO: build a real pending block! - return this.createBlock(this.latest.value.header); + return this.latest; // this.createBlock(this.latest.header); case Tag.EARLIEST: return this.earliest; default: @@ -86,28 +70,12 @@ export default class BlockManager extends Manager { if (typeof tagOrBlockNumber === "string") { const block = this.getBlockByTag(tagOrBlockNumber as Tag); if (block) { - const blockNumber = block.value.header.number; - if (blockNumber.length === 0) { - return Quantity.from(Buffer.from([0])); - } else { - return Quantity.from(blockNumber); - } + return block.header.number; } } return Quantity.from(tagOrBlockNumber); } - /** - * Creates a Block object with the specified header values - * @param header - */ - createBlock(header: {}): Block { - const block = new Block(null, this.#common); - // TODO: make better - Object.assign(block.value.header, header); - return block; - } - async getNumberFromHash(hash: string | Buffer | Tag) { return this.#blockIndexes.get(Data.from(hash).toBuffer()).catch(e => { if (e.status === NOTFOUND) return null; @@ -142,20 +110,17 @@ export default class BlockManager extends Manager { * Writes the block object to the underlying database. * @param block */ - async putBlock(block: Block) { - const blockValue = block.value; - const header = blockValue.header; - let key = header.number; + async putBlock(number: Buffer, hash: Buffer, serialized: Buffer) { + let key = number; // ensure we can store Block #0 as key "00", not "" if (EMPTY_BUFFER.equals(key)) { key = Buffer.from([0]); } - const secondaryKey = header.hash(); + const secondaryKey = hash; await Promise.all([ this.#blockIndexes.put(secondaryKey, key), - super.set(key, block.serialize()) + super.set(key, serialized) ]); - return block; } updateTaggedBlocks() { @@ -186,77 +151,3 @@ export default class BlockManager extends Manager { }); } } - -export class Block { - public readonly value: EthereumJsBlock; - constructor(raw: Buffer, common: Common) { - if (raw) { - this.size = raw.length; - const data = (rlpDecode(raw) as any) as [Buffer[], Buffer[], Buffer[]]; - this.value = new EthereumJsBlock( - { header: data[0], uncleHeaders: data[2] }, - { common } - ); - const rawTransactions = data[1]; - - // parse transactions so we can use our own transaction class - for (let i = 0; i < rawTransactions.length; i++) { - const tx = new Transaction(rawTransactions[i], common); - this.value.transactions.push(tx); - } - } else { - this.value = new EthereumJsBlock(null, { common }); - this.size = 0; - } - } - - size: number; - - serialize() { - const serialized = this.value.serialize(true); - this.size = serialized.length; - return serialized; - } - - getTxFn = ( - include = false - ): (( - tx: Transaction - ) => { [key: string]: string | Data | Quantity } | Data) => { - if (include) { - return (tx: Transaction) => tx.toJSON(this); - } else { - return (tx: Transaction) => Data.from(tx.hash()); - } - }; - - toJSON(includeFullTransactions = false) { - const header = this.value.header; - return { - number: Quantity.from(header.number), - hash: Data.from(this.value.hash()), - parentHash: Data.from(header.parentHash), - mixHash: Data.from(header.mixHash), - nonce: Data.from(header.nonce, 8), - sha3Uncles: Data.from(header.uncleHash), - logsBloom: Data.from(header.bloom), - transactionsRoot: Data.from(header.transactionsTrie), - stateRoot: Data.from(header.stateRoot), - receiptsRoot: Data.from(header.receiptTrie), - miner: Data.from(header.coinbase), - difficulty: Quantity.from(header.difficulty), - // TODO(forking): since ganache's difficulty is always 0, `totalDifficulty` for new blocks - // should just be the forked block's `difficulty`. See https://ethereum.stackexchange.com/a/7102/44640 - totalDifficulty: RPCQUANTITY_ZERO, - extraData: Data.from(header.extraData), - size: Quantity.from(this.size), - gasLimit: Quantity.from(header.gasLimit), - gasUsed: Quantity.from(header.gasUsed), - timestamp: Quantity.from(header.timestamp), - transactions: this.value.transactions.map( - this.getTxFn(includeFullTransactions) - ), - uncles: [] as string[] // this.value.uncleHeaders.map(function(uncleHash) {return to.hex(uncleHash)}) - }; - } -} diff --git a/src/chains/ethereum/src/helpers/filter-parsing.ts b/src/chains/ethereum/src/helpers/filter-parsing.ts index 71cb476413..e9f2f82d15 100644 --- a/src/chains/ethereum/src/helpers/filter-parsing.ts +++ b/src/chains/ethereum/src/helpers/filter-parsing.ts @@ -21,8 +21,7 @@ export function parseFilterRange( filter: Omit, blockchain: Blockchain ) { - const latestBlockNumberBuffer = blockchain.blocks.latest.value.header.number; - const latestBlock = Quantity.from(latestBlockNumberBuffer); + const latestBlock = blockchain.blocks.latest.header.number; const fromBlock = blockchain.blocks.getEffectiveNumber( filter.fromBlock || "latest" ); diff --git a/src/chains/ethereum/src/miner/miner.ts b/src/chains/ethereum/src/miner/miner.ts index 6225be9fab..26f8526f70 100644 --- a/src/chains/ethereum/src/miner/miner.ts +++ b/src/chains/ethereum/src/miner/miner.ts @@ -1,17 +1,17 @@ import params from "../things/params"; -import { utils } from "@ganache/utils"; import Transaction from "../things/transaction"; -import { Quantity, Data } from "@ganache/utils"; +import { utils, Quantity, Data } from "@ganache/utils"; import { promisify } from "util"; import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; -import Block from "ethereumjs-block"; import VM from "ethereumjs-vm"; import { encode as rlpEncode } from "rlp"; import { EthereumInternalOptions } from "../options"; import RuntimeError, { RETURN_TYPES } from "../errors/runtime-error"; import { Executables } from "../types/executables"; import replaceFromHeap from "./replace-from-heap"; +import { Block, RuntimeBlock } from "../things/runtime-block"; +const { BUFFER_EMPTY, BUFFER_256_ZERO } = utils; export type BlockData = { blockTransactions: Transaction[]; @@ -29,7 +29,7 @@ const sortByPrice = (values: Transaction[], a: number, b: number) => Quantity.from(values[a].gasPrice) > Quantity.from(values[b].gasPrice); export default class Miner extends Emittery.Typed< - { block: BlockData }, + { block: { block: Block; serialized: Buffer } }, "idle" > { #currentlyExecutingPrice = 0n; @@ -46,7 +46,7 @@ export default class Miner extends Emittery.Typed< readonly #checkpoint: () => Promise; readonly #commit: () => Promise; readonly #revert: () => Promise; - readonly #createBlock: (previousBlock: Block) => Block; + readonly #createBlock: (previousBlock: Block) => RuntimeBlock; public async pause() { if (!this.#paused) { @@ -80,7 +80,7 @@ export default class Miner extends Emittery.Typed< executables: Executables, instamine: boolean, vm: VM, - createBlock: (previousBlock: Block) => Block + createBlock: (previousBlock: Block) => RuntimeBlock ) { super(); const stateManager = vm.stateManager; @@ -106,7 +106,7 @@ export default class Miner extends Emittery.Typed< * @returns the transactions mined in the _first_ block */ public async mine( - block: Block, + block: RuntimeBlock, maxTransactions: number = -1, onlyOneBlock = false ) { @@ -131,7 +131,7 @@ export default class Miner extends Emittery.Typed< } #mine = async ( - block: Block, + block: RuntimeBlock, maxTransactions: number = -1, onlyOneBlock = false ) => { @@ -155,10 +155,12 @@ export default class Miner extends Emittery.Typed< }; #mineTxs = async ( - block: Block, + runtimeBlock: RuntimeBlock, maxTransactions: number, onlyOneBlock: boolean ) => { + let block: Block; + const { pending, inProgress } = this.#executables; const options = this.#options; @@ -174,28 +176,29 @@ export default class Miner extends Emittery.Typed< const transactionsTrie = new Trie(null, null); const receiptTrie = new Trie(null, null); - const blockData: BlockData = { - blockTransactions, - transactionsTrie, - receiptTrie, - gasUsed: 0n, - timestamp: block.header.timestamp, - extraData: options.extraData - }; - // don't mine anything at all if maxTransactions is `0` if (maxTransactions === 0) { await this.#checkpoint(); await this.#commit(); - this.emit("block", blockData); + const finalizedBlockData = runtimeBlock.finalize( + transactionsTrie.root, + receiptTrie.root, + BUFFER_256_ZERO, + this.#vm.stateManager._trie.root, + BUFFER_EMPTY, // gas used + options.extraData, + [] + ); + this.emit("block", finalizedBlockData); this.#reset(); - return { block, transactions: [] }; + return { block: finalizedBlockData.block, transactions: [] }; } let numTransactions = 0; let blockGasLeft = options.blockGasLimit.toBigInt(); + let blockGasUsed = 0n; - const blockBloom = block.header.bloom; + const blockBloom = Buffer.allocUnsafe(256).fill(0); const promises: Promise[] = []; // Set a block-level checkpoint so our unsaved trie doesn't update the @@ -229,7 +232,7 @@ export default class Miner extends Emittery.Typed< // the case where the transaction is rejected by the VM. await this.#checkpoint(); - const result = await this.#runTx(best, block, origin, pending); + const result = await this.#runTx(best, runtimeBlock, origin, pending); if (result !== null) { const gasUsed = Quantity.from( result.gasUsed.toArrayLike(Buffer) @@ -240,12 +243,12 @@ export default class Miner extends Emittery.Typed< blockTransactions[numTransactions] = best; blockGasLeft -= gasUsed; - blockData.gasUsed += gasUsed; + blockGasUsed += gasUsed; // calculate receipt and tx tries const txKey = rlpEncode(numTransactions); promises.push(putInTrie(transactionsTrie, txKey, best.serialize())); - const receipt = best.fillFromResult(result, blockData.gasUsed); + const receipt = best.fillFromResult(result, blockGasUsed); promises.push(putInTrie(receiptTrie, txKey, receipt)); // update the block's bloom @@ -323,7 +326,19 @@ export default class Miner extends Emittery.Typed< await Promise.all(promises); await this.#commit(); - const emitBlockProm = this.emit("block", blockData); + const finalizedBlockData = runtimeBlock.finalize( + transactionsTrie.root, + receiptTrie.root, + blockBloom, + this.#vm.stateManager._trie.root, + blockGasUsed === 0n + ? BUFFER_EMPTY + : Quantity.from(blockGasUsed).toBuffer(), + options.extraData, + blockTransactions + ); + block = finalizedBlockData.block; + const emitBlockProm = this.emit("block", finalizedBlockData); if (legacyInstamine === true) { // we need to wait for each block to be done mining when in legacy // mode because things like `mine` and `miner_start` must wait for the @@ -341,7 +356,7 @@ export default class Miner extends Emittery.Typed< if (priced.length !== 0) { maxTransactions = this.#instamine ? 1 : -1; - block = this.#createBlock(block); + runtimeBlock = this.#createBlock(block); } else { // reset the miner this.#reset(); @@ -354,7 +369,7 @@ export default class Miner extends Emittery.Typed< #runTx = async ( tx: Transaction, - block: Block, + block: RuntimeBlock, origin: string, pending: Map> ) => { @@ -379,7 +394,7 @@ export default class Miner extends Emittery.Typed< execResult: { runState: { programCounter: 0 }, exceptionError: { error: errorMessage }, - returnValue: Buffer.allocUnsafe(0) + returnValue: BUFFER_EMPTY } }; tx.finalize( diff --git a/src/chains/ethereum/src/options/miner-options.ts b/src/chains/ethereum/src/options/miner-options.ts index 95edb83895..932aadd31a 100644 --- a/src/chains/ethereum/src/options/miner-options.ts +++ b/src/chains/ethereum/src/options/miner-options.ts @@ -1,5 +1,5 @@ import { normalize } from "./helpers"; -import { Quantity, utils } from "@ganache/utils"; +import { Data, Quantity, utils } from "@ganache/utils"; import { Definitions } from "@ganache/options"; import Address from "../things/address"; @@ -120,12 +120,14 @@ export type MinerConfig = { */ coinbase: { rawType: string | number; - type: string | number | Address; + type: Address | number; hasDefault: true; }; extraData: { - type: string; + rawType: string; + type: Data; + hasDefault: true; }; }; }; @@ -156,7 +158,9 @@ export const MinerOptions: Definitions = { legacyName: "callGasLimit" }, coinbase: { - normalize, + normalize: rawType => { + return typeof rawType === "number" ? rawType : Address.from(rawType); + }, default: () => Address.from(utils.ACCOUNT_ZERO) }, legacyInstamine: { @@ -165,11 +169,15 @@ export const MinerOptions: Definitions = { legacyName: "legacyInstamine" }, extraData: { - normalize: extra => { - if (extra.length > 32) { - throw new Error(`extra exceeds max length. ${extra.length} > 32`); + normalize: (extra: string) => { + const bytes = Data.from(extra); + if (bytes.toBuffer().length > 32) { + throw new Error( + `extra exceeds max length. ${bytes.toBuffer().length} > 32` + ); } - return extra; - } + return bytes; + }, + default: () => Data.from(utils.BUFFER_EMPTY) } }; diff --git a/src/chains/ethereum/src/things/runtime-block.ts b/src/chains/ethereum/src/things/runtime-block.ts new file mode 100644 index 0000000000..95aa14a3d9 --- /dev/null +++ b/src/chains/ethereum/src/things/runtime-block.ts @@ -0,0 +1,230 @@ +import { Data, Quantity } from "@ganache/utils"; +import { utils } from "@ganache/utils"; +import Common from "ethereumjs-common"; +import keccak from "keccak"; +import { encode as rlpEncode, decode as rlpDecode } from "rlp"; +import Transaction from "../things/transaction"; +import Address from "./address"; +import { KECCAK256_RLP_ARRAY } from "ethereumjs-util"; + +const { BUFFER_EMPTY, RPCQUANTITY_ZERO } = utils; + +type BlockHeader = { + parentHash: Data; + sha3Uncles: Data; + miner: Data; + stateRoot: Data; + transactionsRoot: Data; + receiptsRoot: Data; + logsBloom: Data; + difficulty: Quantity; + number: Quantity; + gasLimit: Quantity; + gasUsed: Quantity; + timestamp: Quantity; + extraData: Data; + mixHash: Data; + nonce: Data; +}; + +function makeHeader(raw: Buffer[]) { + const number = raw[8]; + + return { + parentHash: Data.from(raw[0], 32), + sha3Uncles: Data.from(raw[1], 32), + miner: Data.from(raw[2], 20), + stateRoot: Data.from(raw[3], 32), + transactionsRoot: Data.from(raw[4], 32), + receiptsRoot: Data.from(raw[5], 32), + logsBloom: Data.from(raw[6], 256), + difficulty: Quantity.from(raw[7], false), + // HACK: because `number` here is used as a key for the db we need to ensure + // that the value here holds an actual `0` when the raw === Buffer([]) + // the other empty buffer values aren't ever used as keys, so leaving them + // empty will probably be okay. + number: Quantity.from(raw[8], false), + gasLimit: Quantity.from(raw[9], false), + gasUsed: Quantity.from(raw[10], false), + timestamp: Quantity.from(raw[11], false), + extraData: Data.from(raw[12]), + mixHash: Data.from(raw[13], 32), + nonce: Data.from(raw[14], 8) + }; +} + +export class Block { + private readonly _size: number; + private readonly _raw: Buffer[]; + private readonly _common: Common; + private _transactions: Transaction[] = null; + private readonly _rawTransactions: Buffer[][] = null; + + public readonly header: BlockHeader; + + constructor(serialized: Buffer, common: Common) { + if (serialized) { + this._common = common; + this._size = serialized.length; + const deserialized = (rlpDecode(serialized) as any) as [ + Buffer[], + Buffer[][] + ]; + const raw = (this._raw = deserialized[0]); + this._rawTransactions = deserialized[1]; + this.header = makeHeader(raw); + } + } + + private _hash: Data; + hash() { + return ( + this._hash || + (this._hash = Data.from( + keccak("keccak256").update(rlpEncode(this._raw)).digest(), + 32 + )) + ); + } + + getTransactions() { + if (this._transactions) { + return this._transactions; + } + const common = this._common; + return (this._transactions = this._rawTransactions.map( + raw => new Transaction(raw, common) + )); + } + + toJSON(includeFullTransactions = false) { + const txFn = this.getTxFn(includeFullTransactions); + let jsonTxs: Data[] | {}[]; + + let transactions = this._transactions; + if (transactions) { + jsonTxs = transactions.map(txFn); + } else { + const common = this._common; + transactions = this._transactions = []; + jsonTxs = this._rawTransactions.map(raw => { + const tx = new Transaction(raw, common); + transactions.push(tx); + return txFn(tx); + }); + } + + return { + hash: this.hash(), + ...this.header, + + // TODO(forking): since ganache's difficulty is always 0, `totalDifficulty` for new blocks + // should just be the forked block's `difficulty`. See https://ethereum.stackexchange.com/a/7102/44640 + totalDifficulty: RPCQUANTITY_ZERO, + size: Quantity.from(this._size), + transactions: jsonTxs, + uncles: [] as string[] // this.value.uncleHeaders.map(function(uncleHash) {return to.hex(uncleHash)}) + }; + } + + getTxFn( + include = false + ): (tx: Transaction) => { [key: string]: string | Data | Quantity } | Data { + if (include) { + return (tx: Transaction) => tx.toJSON(this as any); + } else { + return (tx: Transaction) => Data.from(tx.hash()); + } + } +} + +/** + * A minimal block that can be used by the EVM to run transactions. + */ +export class RuntimeBlock { + public readonly header: { + parentHash: Buffer; + coinbase: Buffer; + number: Buffer; + gasLimit: Buffer; + timestamp: Buffer; + }; + + constructor( + number: Quantity, + parentHash: Data, + coinbase: Address, + gasLimit: Buffer, + timestamp: Quantity + ) { + const ts = timestamp.toBuffer(); + this.header = { + parentHash: parentHash.toBuffer(), + coinbase: coinbase.toBuffer(), + number: number.toBuffer(), + gasLimit: gasLimit.length === 0 ? BUFFER_EMPTY : gasLimit, + timestamp: ts.length === 0 ? BUFFER_EMPTY : ts + }; + } + + /** + * Returns the serialization of all block data and returns the hash of the + * block header. + * + * @param transactionsTrie + * @param receiptTrie + * @param bloom + * @param stateRoot + * @param gasUsed + * @param extraData + * @param transactions + */ + finalize( + transactionsTrie: Buffer, + receiptTrie: Buffer, + bloom: Buffer, + stateRoot: Buffer, + gasUsed: Buffer, + extraData: Data, + transactions: Transaction[] + ) { + const { header } = this; + const rawHeader = [ + header.parentHash, + KECCAK256_RLP_ARRAY, // uncleHash + header.coinbase, + stateRoot, + transactionsTrie, + receiptTrie, + bloom, + BUFFER_EMPTY, // difficulty + header.number, + header.gasLimit, + gasUsed, + header.timestamp, + extraData.toBuffer(), + Buffer.allocUnsafe(32).fill(0), // mixHash + Buffer.allocUnsafe(8).fill(0) // nonce + ]; + const rawTransactions = transactions.map(tx => tx.raw); + const raw = [rawHeader, rawTransactions]; + + const serialized = rlpEncode(raw); + + // make a new block, but pass `null` so it doesn't do the extra + // deserialization work since we already have everything in a deserialized + // state here. We'll just set it ourselves by reaching into the "_private" + // fields. + const block = new Block(null, null); + (block as any)._size = serialized.length; + (block as any)._raw = rawHeader; + (block as any)._rawTransactions = rawTransactions; + (block as any)._transactions = transactions; + (block as any).header = makeHeader(rawHeader); + + return { + block, + serialized + }; + } +} diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/src/things/transaction-receipt.ts index 4de9ab7f04..aa02c54b62 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/src/things/transaction-receipt.ts @@ -1,9 +1,9 @@ import Transaction from "./transaction"; -import { Block } from "../data-managers/block-manager"; import { encode as rlpEncode, decode as rlpDecode } from "rlp"; import { Data, Quantity } from "@ganache/utils"; import BlockLogs, { TransactionLog } from "./blocklogs"; import { utils } from "@ganache/utils"; +import { Block } from "./runtime-block"; const STATUSES = [utils.RPCQUANTITY_ZERO, utils.RPCQUANTITY_ONE]; @@ -94,8 +94,10 @@ export default class TransactionReceipt { this.contractAddress.length === 0 ? null : Data.from(this.contractAddress); - const blockLog = BlockLogs.create(block.value.hash()); - blockLog.blockNumber = Quantity.from(block.value.header.number); + const blockHash = block.hash(); + const blockNumber = block.header.number; + const blockLog = BlockLogs.create(blockHash.toBuffer()); + blockLog.blockNumber = blockNumber; ((raw[3] as any) as TransactionLog[]).forEach(log => { blockLog.append(transaction._index, transaction.hash(), log); }); @@ -103,8 +105,8 @@ export default class TransactionReceipt { return { transactionHash: Data.from(transaction.hash()), transactionIndex: Quantity.from((transaction as any)._index), - blockNumber: Quantity.from(block.value.header.number), - blockHash: Data.from(block.value.hash()), + blockNumber, + blockHash, from: Data.from(transaction.from), to: contractAddress ? null : Data.from(transaction.to), cumulativeGasUsed: Quantity.from(raw[1]), diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/src/things/transaction.ts index 565c5c4163..3d6f584a56 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/src/things/transaction.ts @@ -10,12 +10,12 @@ import * as ethUtil from "ethereumjs-util"; import assert from "assert"; import { decode as rlpDecode } from "rlp"; import { RunTxResult } from "ethereumjs-vm/dist/runTx"; -import { Block } from "../data-managers/block-manager"; import TransactionReceipt from "./transaction-receipt"; import Common from "ethereumjs-common"; import { TransactionLog } from "./blocklogs"; import Address from "./address"; import { ExtractValuesFromType } from "../types/extract-values-from-types"; +import { Block } from "./runtime-block"; const MAX_UINT64 = (1n << 64n) - 1n; const ZERO_BUFFER = Buffer.from([0]); @@ -459,13 +459,20 @@ class Transaction extends (EthereumJsTransaction as any) { * @param {Object} block The block this Transaction appears in. */ toJSON(block?: Block) { - const blockHash = block ? block.value.hash() : this._blockHash; - const blockNum = block ? block.value.header.number : this._blockNum; + let blockHash: Data; + let blockNum: Quantity; + if (block) { + blockHash = block.hash(); + blockNum = block.header.number; + } else { + blockHash = this._blockHash ? Data.from(this._blockHash, 32) : null; + blockNum = this._blockNum ? Quantity.from(this._blockNum) : null; + } return { hash: Data.from(this.hash(), 32), nonce: Quantity.from(this.nonce), - blockHash: blockHash ? Data.from(blockHash, 32) : null, - blockNumber: blockNum ? Quantity.from(blockNum) : null, + blockHash: blockHash ? blockHash : null, + blockNumber: blockNum ? blockNum : null, transactionIndex: this._index ? Quantity.from(this._index) : null, from: Address.from(this.from), to: this.to.length === 0 ? null : Address.from(this.to), diff --git a/src/chains/ethereum/src/types/snapshots.ts b/src/chains/ethereum/src/types/snapshots.ts index 05215ad169..7b7f1d07cd 100644 --- a/src/chains/ethereum/src/types/snapshots.ts +++ b/src/chains/ethereum/src/types/snapshots.ts @@ -1,5 +1,5 @@ import Emittery from "emittery"; -import { Block } from "../data-managers/block-manager"; +import { Block } from "../things/runtime-block"; type SinglyLinkedList = { current: T; next: SinglyLinkedList }; diff --git a/src/chains/ethereum/tests/api/eth/subscribe.test.ts b/src/chains/ethereum/tests/api/eth/subscribe.test.ts index 460d87dd77..1a326693da 100644 --- a/src/chains/ethereum/tests/api/eth/subscribe.test.ts +++ b/src/chains/ethereum/tests/api/eth/subscribe.test.ts @@ -9,12 +9,12 @@ describe("api", () => { let provider: EthereumProvider; let accounts: string[]; const gasLimit = "0x6691b7"; - const now = new Date("2019/03/15 GMT"); + const time = new Date("2019/03/15 GMT"); beforeEach(async () => { provider = await getProvider({ chain: { - time: now + time }, miner: { blockGasLimit: gasLimit @@ -28,7 +28,7 @@ describe("api", () => { describe("newHeads", () => { it("subscribes and unsubscribes", async () => { - const timestamp = ((+now / 1000) | 0) + 1; + const timestamp = ((+time / 1000) | 0) + 1; const startingBlockNumber = parseInt( await provider.send("eth_blockNumber") ); diff --git a/src/packages/utils/src/utils/constants.ts b/src/packages/utils/src/utils/constants.ts index 2fa4b5304a..a065b48e57 100644 --- a/src/packages/utils/src/utils/constants.ts +++ b/src/packages/utils/src/utils/constants.ts @@ -1,8 +1,12 @@ import { Quantity } from "../things/json-rpc/json-rpc-quantity"; -export const ACCOUNT_ZERO = Buffer.allocUnsafe(20).fill(0); +export const BUFFER_256_ZERO = Buffer.allocUnsafe(256).fill(0); +export const ACCOUNT_ZERO = BUFFER_256_ZERO.slice(0, 20); export const BUFFER_EMPTY = Buffer.allocUnsafe(0); -export const BUFFER_ZERO = Buffer.allocUnsafe(1).fill(0); -export const RPCQUANTITY_ZERO = Quantity.from(0n); +export const BUFFER_ZERO = BUFFER_256_ZERO.slice(0, 1); +export const BUFFER_32_ZERO = BUFFER_256_ZERO.slice(0, 32); + +export const RPCQUANTITY_EMPTY = Quantity.from(BUFFER_EMPTY, true); +export const RPCQUANTITY_ZERO = Quantity.from(BUFFER_ZERO); export const RPCQUANTITY_ONE = Quantity.from(1n); export const WEI = 1000000000000000000n as const; From d2942a594ed34f95e393fa1d985570ce4f1883b3 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Thu, 12 Nov 2020 22:11:31 -0500 Subject: [PATCH 690/691] remove finalizationQueue --- src/chains/ethereum/src/api.ts | 6 ------ .../ethereum/src/data-managers/transaction-manager.ts | 8 -------- 2 files changed, 14 deletions(-) diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/src/api.ts index a794c84024..0bc3f12cf6 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/src/api.ts @@ -1146,8 +1146,6 @@ export default class EthereumApi implements types.Api { */ @assertArgLength(1) async eth_getTransactionByHash(transactionHash: string) { - // Note: we do NOT use the transactionManager's finalizationQueue, because - // we might actually want to get transactions that aren't yet finalized. const { transactions } = this.#blockchain; const hashBuffer = Data.from(transactionHash).toBuffer(); @@ -1177,10 +1175,6 @@ export default class EthereumApi implements types.Api { async eth_getTransactionReceipt(transactionHash: string) { const { transactions, transactionReceipts, blocks } = this.#blockchain; const txHash = Data.from(transactionHash).toBuffer(); - if (this.#blockchain.isStarted() && this.#options.miner.blockTime === 0) { - const prom = transactions.finalizationQueue.get(txHash.toString("hex")); - if (prom) await prom; - } const transactionPromise = transactions.get(txHash); const receiptPromise = transactionReceipts.get(txHash); diff --git a/src/chains/ethereum/src/data-managers/transaction-manager.ts b/src/chains/ethereum/src/data-managers/transaction-manager.ts index 130164cb08..8cd74d109d 100644 --- a/src/chains/ethereum/src/data-managers/transaction-manager.ts +++ b/src/chains/ethereum/src/data-managers/transaction-manager.ts @@ -11,7 +11,6 @@ import { Data } from "@ganache/utils"; export default class TransactionManager extends Manager { public readonly transactionPool: TransactionPool; - public readonly finalizationQueue = new Map>(); readonly #queue = new PromiseQueue(); #paused = false; #resumer: Promise; @@ -53,12 +52,6 @@ export default class TransactionManager extends Manager { const result = await this.#queue.add(insertion); if (result) { - const hash = transaction.hash().toString("hex"); - const txQueue = this.finalizationQueue.set( - hash, - transaction.once("finalized").then(() => txQueue.delete(hash)) - ); - this.transactionPool.drain(); } return result; @@ -77,7 +70,6 @@ export default class TransactionManager extends Manager { public clear() { this.#queue.clear(false); this.transactionPool.clear(); - this.finalizationQueue.clear(); } /** From 31b86029ff38131ad983858363a2c39d1f846403 Mon Sep 17 00:00:00 2001 From: David Murdoch Date: Mon, 16 Nov 2020 11:11:47 -0500 Subject: [PATCH 691/691] rename `requestRaw` to `_requestRaw` --- src/chains/ethereum/src/connector.ts | 2 +- src/chains/ethereum/src/provider.ts | 6 +++--- src/packages/core/tests/server.test.ts | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/chains/ethereum/src/connector.ts b/src/chains/ethereum/src/connector.ts index 6d180dab1a..0c8a3f14fc 100644 --- a/src/chains/ethereum/src/connector.ts +++ b/src/chains/ethereum/src/connector.ts @@ -89,7 +89,7 @@ export class Connector } } const params = payload.params as Parameters; - return this.#provider.requestRaw({ method, params }); + return this.#provider._requestRaw({ method, params }); }; format( diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/src/provider.ts index f63bbd2089..0f4dcf841e 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/src/provider.ts @@ -186,17 +186,17 @@ export default class EthereumProvider public async request( args: RequestParams ) { - const rawResult = await this.requestRaw(args); + const rawResult = await this._requestRaw(args); const value = await rawResult.value; return JSON.parse(JSON.stringify(value)); } /** - * Used when the caller wants to access the orignal `PromiEvent`, which would + * INTERNAL. Used when the caller wants to access the orignal `PromiEvent`, which would * otherwise be flattened into a regular Promise through the Promise chain. * @param request */ - public async requestRaw({ + public async _requestRaw({ method, params }: RequestParams) { diff --git a/src/packages/core/tests/server.test.ts b/src/packages/core/tests/server.test.ts index 71fc06f0df..50897ef5de 100644 --- a/src/packages/core/tests/server.test.ts +++ b/src/packages/core/tests/server.test.ts @@ -430,10 +430,10 @@ describe("server", () => { try { const provider = s.provider; - const oldRequestRaw = provider.requestRaw; + const oldRequestRaw = (provider as any)._requestRaw; const req = request.post("http://localhost:" + port); const abortPromise = new Promise(resolve => { - provider.requestRaw = () => { + (provider as any)._requestRaw = () => { // abort the request object after intercepting the request req.abort(); return new Promise(innerResolve => { @@ -455,7 +455,7 @@ describe("server", () => { // wait for the server to react to the requesrt's `abort` await abortPromise; - provider.requestRaw = oldRequestRaw; + provider._requestRaw = oldRequestRaw; // now make sure we are still up and running: await simpleTest(); @@ -652,7 +652,7 @@ describe("server", () => { it("doesn't crash when the connection is closed while a request is in flight", async () => { const provider = s.provider; - provider.requestRaw = (async () => { + provider._requestRaw = (async () => { // close our websocket after intercepting the request await s.close(); return { value: Promise.resolve(void 0) }; @@ -682,8 +682,8 @@ describe("server", () => { it("handles PromiEvent messages", async () => { const provider = s.provider; const message = "I hope you get this message"; - const oldRequestRaw = provider.requestRaw.bind(provider); - provider.requestRaw = (async () => { + const oldRequestRaw = provider._requestRaw.bind(provider); + provider._requestRaw = (async () => { const promiEvent = new PromiEvent(resolve => { const subId = "0xsubscriptionId"; resolve(subId); @@ -719,7 +719,7 @@ describe("server", () => { assert.strictEqual(result, message); - provider.requestRaw = oldRequestRaw; + provider._requestRaw = oldRequestRaw; }); it("handles batched json-rpc requests/responses", async () => { @@ -789,7 +789,7 @@ describe("server", () => { it("doesn't crash when the connection is closed while a subscription is in flight", async () => { const provider = s.provider; let promiEvent: PromiEvent; - provider.requestRaw = (async () => { + provider._requestRaw = (async () => { promiEvent = new PromiEvent(resolve => { resolve("0xsubscriptionId"); }); @@ -835,7 +835,7 @@ describe("server", () => { // create tons of data to force websocket backpressure const huge = {}; for (let i = 0; i < 1e6; i++) huge["prop_" + i] = { i }; - s.provider.requestRaw = (async () => { + s.provider._requestRaw = (async () => { return { value: Promise.resolve(huge) }; }) as any; }